From de4d40446f570d11f5290147dd0a8ec6c5471bed Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Mon, 15 Jun 2026 16:32:53 +0000 Subject: [PATCH] =?UTF-8?q?##=20Go=20SDK=20Changes:=20*=20`OpenRouter.Chat?= =?UTF-8?q?.Send()`:=20=20=20*=20=20`request`=20**Changed**=20(Breaking=20?= =?UTF-8?q?=E2=9A=A0=EF=B8=8F)=20=20=20*=20=20`response`=20**Changed**=20?= =?UTF-8?q?=20=20*=20=20`error`=20**Changed**=20*=20`OpenRouter.VideoGener?= =?UTF-8?q?ation.Generate()`:=20=20=20*=20=20`request.Request`=20**Changed?= =?UTF-8?q?**=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20=20=20*=20=20`error.Open?= =?UTF-8?q?routerMetadata`=20**Added**=20*=20`OpenRouter.Beta.Responses.Se?= =?UTF-8?q?nd()`:=20=20=20*=20=20`request`=20**Changed**=20(Breaking=20?= =?UTF-8?q?=E2=9A=A0=EF=B8=8F)=20=20=20*=20=20`response`=20**Changed**=20(?= =?UTF-8?q?Breaking=20=E2=9A=A0=EF=B8=8F)=20=20=20*=20=20`error`=20**Chang?= =?UTF-8?q?ed**=20*=20`OpenRouter.Rerank.Rerank()`:=20=20=20*=20=20`reques?= =?UTF-8?q?t.Request`=20**Changed**=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20?= =?UTF-8?q?=20=20*=20=20`response.Results[].Document`=20**Changed**=20=20?= =?UTF-8?q?=20*=20=20`error.OpenrouterMetadata`=20**Added**=20*=20`OpenRou?= =?UTF-8?q?ter.Models.ListForUser()`:=20=20=20*=20=20`response.Data[]`=20*?= =?UTF-8?q?*Changed**=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20=20=20*=20=20`er?= =?UTF-8?q?ror.OpenrouterMetadata`=20**Added**=20*=20`OpenRouter.Models.Li?= =?UTF-8?q?st()`:=20=20=20*=20=20`request`=20**Changed**=20(Breaking=20?= =?UTF-8?q?=E2=9A=A0=EF=B8=8F)=20=20=20*=20=20`response.Data[]`=20**Change?= =?UTF-8?q?d**=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20=20=20*=20=20`error.Ope?= =?UTF-8?q?nrouterMetadata`=20**Added**=20*=20`OpenRouter.Generations.GetG?= =?UTF-8?q?eneration()`:=20=20=20*=20=20`response.Data`=20**Changed**=20(B?= =?UTF-8?q?reaking=20=E2=9A=A0=EF=B8=8F)=20=20=20*=20=20`error.OpenrouterM?= =?UTF-8?q?etadata`=20**Added**=20*=20`OpenRouter.Endpoints.List()`:=20=20?= =?UTF-8?q?=20*=20=20`response.Data`=20**Changed**=20(Breaking=20=E2=9A=A0?= =?UTF-8?q?=EF=B8=8F)=20=20=20*=20=20`error.OpenrouterMetadata`=20**Added*?= =?UTF-8?q?*=20*=20`OpenRouter.Endpoints.ListZdrEndpoints()`:=20=20=20*=20?= =?UTF-8?q?=20`response.Data[].ProviderName`=20**Changed**=20(Breaking=20?= =?UTF-8?q?=E2=9A=A0=EF=B8=8F)=20=20=20*=20=20`error.OpenrouterMetadata`?= =?UTF-8?q?=20**Added**=20*=20`OpenRouter.Embeddings.ListModels()`:=20=20?= =?UTF-8?q?=20*=20=20`response.Data[]`=20**Changed**=20(Breaking=20?= =?UTF-8?q?=E2=9A=A0=EF=B8=8F)=20=20=20*=20=20`error.OpenrouterMetadata`?= =?UTF-8?q?=20**Added**=20*=20`OpenRouter.Embeddings.Generate()`:=20=20=20?= =?UTF-8?q?*=20=20`request.Request`=20**Changed**=20(Breaking=20=E2=9A=A0?= =?UTF-8?q?=EF=B8=8F)=20=20=20*=20=20`response.Usage.PromptTokensDetails.F?= =?UTF-8?q?ileTokens`=20**Added**=20=20=20*=20=20`error.OpenrouterMetadata?= =?UTF-8?q?`=20**Added**=20*=20`OpenRouter.Observability.Create()`:=20**Ad?= =?UTF-8?q?ded**=20*=20`OpenRouter.Guardrails.Delete()`:=20=20`error.Openr?= =?UTF-8?q?outerMetadata`=20**Added**=20*=20`OpenRouter.Files.Upload()`:?= =?UTF-8?q?=20**Added**=20*=20`OpenRouter.Files.Delete()`:=20**Added**=20*?= =?UTF-8?q?=20`OpenRouter.Files.Retrieve()`:=20**Added**=20*=20`OpenRouter?= =?UTF-8?q?.Files.Download()`:=20**Added**=20*=20`OpenRouter.Models.Get()`?= =?UTF-8?q?:=20**Added**=20*=20`OpenRouter.Observability.List()`:=20**Adde?= =?UTF-8?q?d**=20*=20`OpenRouter.Beta.Analytics.GetAnalyticsMeta()`:=20**A?= =?UTF-8?q?dded**=20*=20`OpenRouter.Observability.Delete()`:=20**Added**?= =?UTF-8?q?=20*=20`OpenRouter.Observability.Get()`:=20**Added**=20*=20`Ope?= =?UTF-8?q?nRouter.Observability.Update()`:=20**Added**=20*=20`OpenRouter.?= =?UTF-8?q?Presets.List()`:=20**Added**=20*=20`OpenRouter.Presets.Get()`:?= =?UTF-8?q?=20**Added**=20*=20`OpenRouter.Presets.CreatePresetsChatComplet?= =?UTF-8?q?ions()`:=20**Added**=20*=20`OpenRouter.Presets.CreatePresetsMes?= =?UTF-8?q?sages()`:=20**Added**=20*=20`OpenRouter.Presets.CreatePresetsRe?= =?UTF-8?q?sponses()`:=20**Added**=20*=20`OpenRouter.Presets.ListVersions(?= =?UTF-8?q?)`:=20**Added**=20*=20`OpenRouter.Presets.GetVersion()`:=20**Ad?= =?UTF-8?q?ded**=20*=20`OpenRouter.Analytics.GetUserActivity()`:=20=20`err?= =?UTF-8?q?or.OpenrouterMetadata`=20**Added**=20*=20`OpenRouter.Tts.Create?= =?UTF-8?q?Speech()`:=20=20=20*=20=20`request.Request.Provider.Options`=20?= =?UTF-8?q?**Changed**=20=20=20*=20=20`error.OpenrouterMetadata`=20**Added?= =?UTF-8?q?**=20*=20`OpenRouter.OAuth.ExchangeAuthCodeForApiKey()`:=20=20`?= =?UTF-8?q?error.OpenrouterMetadata`=20**Added**=20*=20`OpenRouter.OAuth.C?= =?UTF-8?q?reateAuthCode()`:=20=20=20*=20=20`request.Request.WorkspaceId`?= =?UTF-8?q?=20**Added**=20=20=20*=20=20`error`=20**Changed**=20*=20`OpenRo?= =?UTF-8?q?uter.Datasets.GetRankingsDaily()`:=20**Added**=20*=20`OpenRoute?= =?UTF-8?q?r.Credits.GetCredits()`:=20=20`error.OpenrouterMetadata`=20**Ad?= =?UTF-8?q?ded**=20*=20`OpenRouter.Datasets.GetBenchmarksDesignArena()`:?= =?UTF-8?q?=20**Added**=20*=20`OpenRouter.Datasets.GetBenchmarksArtificial?= =?UTF-8?q?Analysis()`:=20**Added**=20*=20`OpenRouter.Datasets.GetAppRanki?= =?UTF-8?q?ngs()`:=20**Added**=20*=20`OpenRouter.Byok.Update()`:=20**Added?= =?UTF-8?q?**=20*=20`OpenRouter.Byok.Get()`:=20**Added**=20*=20`OpenRouter?= =?UTF-8?q?.Generations.ListGenerationContent()`:=20=20`error.OpenrouterMe?= =?UTF-8?q?tadata`=20**Added**=20*=20`OpenRouter.Guardrails.List()`:=20=20?= =?UTF-8?q?=20*=20=20`response.Data[]`=20**Changed**=20=20=20*=20=20`error?= =?UTF-8?q?.OpenrouterMetadata`=20**Added**=20*=20`OpenRouter.Guardrails.C?= =?UTF-8?q?reate()`:=20=20=20*=20=20`request.Request`=20**Changed**=20=20?= =?UTF-8?q?=20*=20=20`response.Data`=20**Changed**=20=20=20*=20=20`error.O?= =?UTF-8?q?penrouterMetadata`=20**Added**=20*=20`OpenRouter.Files.List()`:?= =?UTF-8?q?=20**Added**=20*=20`OpenRouter.Guardrails.Get()`:=20=20=20*=20?= =?UTF-8?q?=20`response.Data`=20**Changed**=20=20=20*=20=20`error.Openrout?= =?UTF-8?q?erMetadata`=20**Added**=20*=20`OpenRouter.Guardrails.Update()`:?= =?UTF-8?q?=20=20=20*=20=20`request.UpdateGuardrailRequest`=20**Changed**?= =?UTF-8?q?=20=20=20*=20=20`response.Data`=20**Changed**=20=20=20*=20=20`e?= =?UTF-8?q?rror.OpenrouterMetadata`=20**Added**=20*=20`OpenRouter.Guardrai?= =?UTF-8?q?ls.ListGuardrailKeyAssignments()`:=20=20`error.OpenrouterMetada?= =?UTF-8?q?ta`=20**Added**=20*=20`OpenRouter.Guardrails.BulkAssignKeys()`:?= =?UTF-8?q?=20=20`error.OpenrouterMetadata`=20**Added**=20*=20`OpenRouter.?= =?UTF-8?q?Guardrails.BulkUnassignKeys()`:=20=20`error.OpenrouterMetadata`?= =?UTF-8?q?=20**Added**=20*=20`OpenRouter.Guardrails.ListGuardrailMemberAs?= =?UTF-8?q?signments()`:=20=20`error.OpenrouterMetadata`=20**Added**=20*?= =?UTF-8?q?=20`OpenRouter.Guardrails.BulkAssignMembers()`:=20=20`error.Ope?= =?UTF-8?q?nrouterMetadata`=20**Added**=20*=20`OpenRouter.Guardrails.BulkU?= =?UTF-8?q?nassignMembers()`:=20=20`error.OpenrouterMetadata`=20**Added**?= =?UTF-8?q?=20*=20`OpenRouter.Guardrails.ListKeyAssignments()`:=20=20`erro?= =?UTF-8?q?r.OpenrouterMetadata`=20**Added**=20*=20`OpenRouter.Guardrails.?= =?UTF-8?q?ListMemberAssignments()`:=20=20`error.OpenrouterMetadata`=20**A?= =?UTF-8?q?dded**=20*=20`OpenRouter.ApiKeys.GetCurrentKeyMetadata()`:=20?= =?UTF-8?q?=20`error.OpenrouterMetadata`=20**Added**=20*=20`OpenRouter.Api?= =?UTF-8?q?Keys.List()`:=20=20`error.OpenrouterMetadata`=20**Added**=20*?= =?UTF-8?q?=20`OpenRouter.ApiKeys.Create()`:=20=20`error.OpenrouterMetadat?= =?UTF-8?q?a`=20**Added**=20*=20`OpenRouter.ApiKeys.Delete()`:=20=20`error?= =?UTF-8?q?.OpenrouterMetadata`=20**Added**=20*=20`OpenRouter.ApiKeys.Get(?= =?UTF-8?q?)`:=20=20`error.OpenrouterMetadata`=20**Added**=20*=20`OpenRout?= =?UTF-8?q?er.ApiKeys.Update()`:=20=20`error.OpenrouterMetadata`=20**Added?= =?UTF-8?q?**=20*=20`OpenRouter.Byok.Delete()`:=20**Added**=20*=20`OpenRou?= =?UTF-8?q?ter.Models.Count()`:=20=20`error.OpenrouterMetadata`=20**Added*?= =?UTF-8?q?*=20*=20`OpenRouter.Byok.Create()`:=20**Added**=20*=20`OpenRout?= =?UTF-8?q?er.Organization.ListMembers()`:=20=20`error.OpenrouterMetadata`?= =?UTF-8?q?=20**Added**=20*=20`OpenRouter.Providers.List()`:=20=20`error.O?= =?UTF-8?q?penrouterMetadata`=20**Added**=20*=20`OpenRouter.Byok.List()`:?= =?UTF-8?q?=20**Added**=20*=20`OpenRouter.Stt.CreateTranscription()`:=20**?= =?UTF-8?q?Added**=20*=20`OpenRouter.Beta.Analytics.QueryAnalytics()`:=20*?= =?UTF-8?q?*Added**=20*=20`OpenRouter.VideoGeneration.GetGeneration()`:=20?= =?UTF-8?q?=20`error.OpenrouterMetadata`=20**Added**=20*=20`OpenRouter.Vid?= =?UTF-8?q?eoGeneration.GetVideoContent()`:=20=20`error.OpenrouterMetadata?= =?UTF-8?q?`=20**Added**=20*=20`OpenRouter.VideoGeneration.ListVideosModel?= =?UTF-8?q?s()`:=20=20=20*=20=20`response.Data[]`=20**Changed**=20=20=20*?= =?UTF-8?q?=20=20`error.OpenrouterMetadata`=20**Added**=20*=20`OpenRouter.?= =?UTF-8?q?Workspaces.List()`:=20=20=20*=20=20`response.Data[]`=20**Change?= =?UTF-8?q?d**=20=20=20*=20=20`error.OpenrouterMetadata`=20**Added**=20*?= =?UTF-8?q?=20`OpenRouter.Workspaces.Create()`:=20=20=20*=20=20`request.Re?= =?UTF-8?q?quest`=20**Changed**=20=20=20*=20=20`response.Data`=20**Changed?= =?UTF-8?q?**=20=20=20*=20=20`error.OpenrouterMetadata`=20**Added**=20*=20?= =?UTF-8?q?`OpenRouter.Workspaces.Delete()`:=20=20`error.OpenrouterMetadat?= =?UTF-8?q?a`=20**Added**=20*=20`OpenRouter.Workspaces.Get()`:=20=20=20*?= =?UTF-8?q?=20=20`response.Data`=20**Changed**=20=20=20*=20=20`error.Openr?= =?UTF-8?q?outerMetadata`=20**Added**=20*=20`OpenRouter.Workspaces.Update(?= =?UTF-8?q?)`:=20=20=20*=20=20`request.UpdateWorkspaceRequest`=20**Changed?= =?UTF-8?q?**=20=20=20*=20=20`response.Data`=20**Changed**=20=20=20*=20=20?= =?UTF-8?q?`error.OpenrouterMetadata`=20**Added**=20*=20`OpenRouter.Worksp?= =?UTF-8?q?aces.BulkAddMembers()`:=20=20`error.OpenrouterMetadata`=20**Add?= =?UTF-8?q?ed**=20*=20`OpenRouter.Workspaces.BulkRemoveMembers()`:=20=20`e?= =?UTF-8?q?rror.OpenrouterMetadata`=20**Added**?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .devcontainer/devcontainer.json | 2 +- .speakeasy/gen.lock | 4759 ++- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 32357 ++++++++++------ .speakeasy/workflow.lock | 12 +- README.md | 89 +- RELEASES.md | 12 +- analytics.go | 2 +- apikeys.go | 12 +- beta.go | 3 + betaanalytics.go | 617 + byok.go | 1484 + chat.go | 40 +- credits.go | 2 +- datasets.go | 1310 + docs/models/components/aabenchmarkentry.md | 12 + docs/models/components/action.md | 8 +- docs/models/components/actiontypesearch.md | 18 + docs/models/components/advisornestedtool.md | 12 + docs/models/components/advisorreasoning.md | 11 + .../components/advisorreasoningeffort.md | 28 + .../components/advisorservertoolconfig.md | 19 + .../components/advisorservertoolopenrouter.md | 11 + .../advisorservertoolopenroutertype.md | 18 + .../components/anthropicallowedcallers.md | 23 + .../components/anthropicbase64imagesource.md | 10 + .../anthropicbase64imagesourcetype.md | 18 + .../components/anthropicbase64pdfsource.md | 10 + .../anthropicbase64pdfsourcemediatype.md | 18 + .../anthropicbase64pdfsourcetype.md | 18 + .../anthropiccachecontroldirective.md | 2 +- .../anthropiccitationcharlocationparam.md | 13 + .../anthropiccitationcharlocationparamtype.md | 18 + ...hropiccitationcontentblocklocationparam.md | 13 + ...iccitationcontentblocklocationparamtype.md | 18 + .../anthropiccitationpagelocationparam.md | 13 + .../anthropiccitationpagelocationparamtype.md | 18 + .../anthropiccitationsearchresultlocation.md | 14 + ...thropiccitationsearchresultlocationtype.md | 18 + ...nthropiccitationwebsearchresultlocation.md | 12 + ...opiccitationwebsearchresultlocationtype.md | 18 + .../components/anthropicdocumentblockparam.md | 13 + .../anthropicdocumentblockparamcitations.md | 8 + .../anthropicdocumentblockparamcontent1.md | 29 + .../anthropicdocumentblockparamcontent2.md | 29 + .../anthropicdocumentblockparamsourceunion.md | 45 + .../components/anthropicimageblockparam.md | 10 + .../anthropicimageblockparamsource.md | 29 + .../anthropicimageblockparamtype.md | 18 + .../components/anthropicimagemimetype.md | 24 + .../anthropicinputtokensclearatleast.md | 9 + .../anthropicinputtokensclearatleasttype.md | 18 + .../components/anthropicinputtokenstrigger.md | 9 + ....md => anthropicinputtokenstriggertype.md} | 6 +- .../components/anthropicplaintextsource.md | 10 + .../anthropicplaintextsourcemediatype.md | 18 + .../anthropicplaintextsourcetype.md | 18 + .../anthropicsearchresultblockparam.md | 13 + ...nthropicsearchresultblockparamcitations.md | 8 + .../anthropicsearchresultblockparamtype.md | 18 + .../components/anthropictextblockparam.md | 11 + .../components/anthropictextblockparamtype.md | 18 + .../components/anthropicthinkingdisplay.md | 22 + .../components/anthropicthinkingturns.md | 9 + .../components/anthropicthinkingturnstype.md | 18 + .../components/anthropictooluseskeep.md | 9 + .../components/anthropictooluseskeeptype.md | 18 + .../components/anthropictoolusestrigger.md | 9 + .../anthropictoolusestriggertype.md | 18 + .../components/anthropicurlimagesource.md | 9 + .../components/anthropicurlimagesourcetype.md | 18 + .../components/anthropicurlpdfsource.md | 9 + .../components/anthropicurlpdfsourcetype.md | 18 + .../anthropicwebsearchresultblockparam.md | 12 + .../anthropicwebsearchresultblockparamtype.md | 18 + .../anthropicwebsearchtooluserlocation.md | 12 + .../anthropicwebsearchtooluserlocationtype.md | 18 + docs/models/components/apitype.md | 4 +- docs/models/components/applypatchcallitem.md | 14 + .../components/applypatchcallitemtype.md | 18 + .../components/applypatchcalloperation.md | 41 + .../applypatchcalloperationdiffdeltaevent.md | 14 + ...plypatchcalloperationdiffdeltaeventtype.md | 18 + .../applypatchcalloperationdiffdoneevent.md | 14 + ...pplypatchcalloperationdiffdoneeventtype.md | 18 + .../components/applypatchcalloutputitem.md | 14 + .../applypatchcalloutputitemstatus.md | 22 + .../applypatchcalloutputitemtype.md | 18 + .../models/components/applypatchcallstatus.md | 24 + .../applypatchcreatefileoperation.md | 12 + .../applypatchcreatefileoperationtype.md | 18 + .../applypatchdeletefileoperation.md | 11 + .../applypatchdeletefileoperationtype.md | 18 + .../models/components/applypatchengineenum.md | 25 + .../components/applypatchservertoolconfig.md | 10 + .../applypatchservertoolopenrouter.md | 11 + .../applypatchservertoolopenroutertype.md | 18 + .../applypatchupdatefileoperation.md | 12 + .../applypatchupdatefileoperationtype.md | 18 + docs/models/components/apprankingsitem.md | 12 + docs/models/components/apprankingsresponse.md | 9 + docs/models/components/aspectratio.md | 2 + docs/models/components/audiourl.md | 8 + docs/models/components/autorouterplugin.md | 11 +- docs/models/components/baseinputsunion1.md | 32 + docs/models/components/bashservertool.md | 11 + .../models/components/bashservertoolconfig.md | 12 + .../models/components/bashservertoolengine.md | 25 + .../components/bashservertoolenvironment.md | 31 + docs/models/components/bashservertooltype.md | 18 + docs/models/components/benchmarkpricing.md | 11 + docs/models/components/benchmarksaaitem.md | 13 + docs/models/components/benchmarksaameta.md | 13 + .../components/benchmarksaametasource.md | 20 + .../components/benchmarksaametasourceurl.md | 20 + .../components/benchmarksaametaversion.md | 20 + .../models/components/benchmarksaaresponse.md | 9 + docs/models/components/benchmarksdaitem.md | 16 + docs/models/components/benchmarksdameta.md | 16 + .../components/benchmarksdametasource.md | 20 + .../components/benchmarksdametasourceurl.md | 20 + .../components/benchmarksdametaversion.md | 20 + .../models/components/benchmarksdaresponse.md | 9 + docs/models/components/byokkey.md | 19 + docs/models/components/byokproviderslug.md | 105 + docs/models/components/caching.md | 11 + docs/models/components/chatfunctiontool.md | 32 + docs/models/components/chatrequest.md | 74 +- docs/models/components/chatrequesteffort.md | 28 + docs/models/components/chatrequestplugin.md | 16 + .../{reasoning.md => chatrequestreasoning.md} | 4 +- .../components/chatrequestreasoningeffort.md | 28 + docs/models/components/chatresult.md | 21 +- .../models/components/chatservertoolchoice.md | 10 + docs/models/components/chatstreamchunk.md | 23 +- docs/models/components/chatstreamdelta.md | 2 +- .../chatstreamingresponse.md} | 4 +- docs/models/components/chattoolchoice.md | 8 + docs/models/components/chatusage.md | 17 +- .../components/chatwebsearchshorthand.md | 23 +- docs/models/components/citation.md | 53 + docs/models/components/cleartoolinputs.md | 37 + docs/models/components/compactionitem.md | 12 + docs/models/components/compactionitemtype.md | 18 + .../components/containerautoenvironment.md | 10 + .../containerautoenvironmenttype.md | 18 + .../containerreferenceenvironment.md | 11 + .../containerreferenceenvironmenttype.md | 18 + docs/models/components/contentcompaction.md | 10 + docs/models/components/contentfilteraction.md | 24 + .../components/contentfilterbuiltinaction.md | 25 + .../components/contentfilterbuiltinentry.md | 13 + .../contentfilterbuiltinentryinput.md | 13 + .../components/contentfilterbuiltinslug.md | 30 + docs/models/components/contentfilterentry.md | 12 + docs/models/components/contentpartaudio.md | 9 + .../models/components/contentpartaudiotype.md | 18 + .../components/contentpartinputaudio.md | 9 + .../components/contentpartinputaudiotype.md | 18 + .../models/components/contentpartinputfile.md | 9 + .../components/contentpartinputfiletype.md | 18 + .../components/contentpartinputvideo.md | 9 + .../components/contentpartinputvideotype.md | 18 + docs/models/components/contentpartvideo.md | 9 + .../models/components/contentpartvideotype.md | 18 + .../components/contentredactedthinking.md | 9 + .../models/components/contentservertooluse.md | 12 + docs/models/components/contentthinking.md | 10 + .../models/components/contenttoolreference.md | 9 + docs/models/components/contenttoolresult.md | 12 + docs/models/components/contenttooluse.md | 12 + .../components/contentwebsearchtoolresult.md | 11 + .../contentwebsearchtoolresulterror.md | 9 + docs/models/components/contextmanagement.md | 8 + docs/models/components/contradiction.md | 9 + docs/models/components/costdetails.md | 6 +- .../models/components/createbyokkeyrequest.md | 15 + .../components/createbyokkeyresponse.md | 8 + .../components/createguardrailrequest.md | 30 +- .../components/createguardrailresponse.md | 6 +- .../createobservabilitydestinationrequest.md | 16 + ...eateobservabilitydestinationrequesttype.md | 39 + .../createobservabilitydestinationresponse.md | 8 + .../createpresetfrominferenceresponse.md | 10 + .../components/createworkspacerequest.md | 24 +- .../components/createworkspaceresponse.md | 6 +- docs/models/components/customtool.md | 12 +- .../customtoolcallinputdeltaevent.md | 14 + .../customtoolcallinputdeltaeventtype.md | 18 + .../customtoolcallinputdoneevent.md | 14 + .../customtoolcallinputdoneeventtype.md | 18 + docs/models/components/customtoolcallitem.md | 15 + .../components/customtoolcallitemtype.md | 18 + .../components/customtoolcalloutputitem.md | 13 + .../customtoolcalloutputitemdetail.md | 24 + ...ustomtoolcalloutputitemoutputinputimage.md | 12 + .../customtoolcalloutputitemoutputunion1.md | 37 + .../customtoolcalloutputitemoutputunion2.md | 29 + ...lcalloutputitemtypecustomtoolcalloutput.md | 18 + .../customtoolcalloutputitemtypeinputimage.md | 18 + .../models/components/customtooltypecustom.md | 18 + docs/models/components/dabenchmarkentry.md | 14 + docs/models/components/dataregion.md | 24 + .../components/deletebyokkeyresponse.md | 8 + .../deleteobservabilitydestinationresponse.md | 8 + .../easyinputmessagecontentinputimage.md | 10 +- .../components/easyinputmessagecontenttype.md | 18 - .../components/easyinputmessagedetail.md | 11 +- .../easyinputmessagetypeinputimage.md | 18 + docs/models/components/edit.md | 37 + .../components/editclearthinking20251015.md | 9 + .../components/editcleartooluses20250919.md | 13 + docs/models/components/editcompact20260112.md | 11 + docs/models/components/edittypeinputtokens.md | 18 + docs/models/components/effort.md | 28 - docs/models/components/elobounds.md | 11 + docs/models/components/endpointinfo.md | 10 + docs/models/components/endpointsmetadata.md | 9 + docs/models/components/errorcode.md | 25 + docs/models/components/failedmodel.md | 10 + docs/models/components/field.md | 32 + docs/models/components/filedeleteresponse.md | 11 + .../components/filedeleteresponsetype.md | 18 + docs/models/components/filelistresponse.md | 14 + docs/models/components/filemetadata.md | 16 + docs/models/components/filemetadatatype.md | 18 + .../components/filesearchservertoolvalue1.md | 29 + .../components/filesearchservertoolvalue2.md | 45 + docs/models/components/filters.md | 10 +- docs/models/components/functioncallitem.md | 17 +- .../functioncalloutputitemdetail.md | 11 +- .../functioncalloutputitemoutputinputimage.md | 12 + .../functioncalloutputitemoutputunion1.md | 6 +- .../functioncalloutputitemtypeinputimage.md | 18 + .../models/components/fusionanalysisresult.md | 14 + .../fusioncallanalysiscompletedevent.md | 14 + .../fusioncallanalysiscompletedeventtype.md | 18 + .../fusioncallanalysisinprogressevent.md | 14 + .../fusioncallanalysisinprogresseventtype.md | 18 + .../components/fusioncallcompletedevent.md | 13 + .../fusioncallcompletedeventtype.md | 18 + .../components/fusioncallinprogressevent.md | 13 + .../fusioncallinprogresseventtype.md | 18 + .../components/fusioncallpaneladdedevent.md | 14 + .../fusioncallpaneladdedeventtype.md | 18 + .../fusioncallpanelcompletedevent.md | 15 + .../fusioncallpanelcompletedeventtype.md | 18 + .../components/fusioncallpaneldeltaevent.md | 15 + .../fusioncallpaneldeltaeventtype.md | 18 + .../components/fusioncallpanelfailedevent.md | 16 + .../fusioncallpanelfailedeventtype.md | 18 + .../fusioncallpanelreasoningdeltaevent.md | 15 + .../fusioncallpanelreasoningdeltaeventtype.md | 18 + docs/models/components/fusionplugin.md | 13 + docs/models/components/fusionpluginid.md | 18 + docs/models/components/fusionplugintool.md | 9 + .../components/fusionservertoolconfig.md | 16 + .../fusionservertoolconfigeffort.md | 28 + .../fusionservertoolconfigreasoning.md | 11 + .../components/fusionservertoolconfigtool.md | 9 + .../components/fusionservertoolopenrouter.md | 11 + .../fusionservertoolopenroutertype.md | 18 + .../components/generationcontentdataoutput.md | 2 +- .../components/generationresponsedata.md | 87 +- docs/models/components/getbyokkeyresponse.md | 8 + .../models/components/getguardrailresponse.md | 6 +- .../getobservabilitydestinationresponse.md | 8 + docs/models/components/getpresetresponse.md | 10 + .../components/getpresetversionresponse.md | 10 + .../models/components/getworkspaceresponse.md | 6 +- docs/models/components/group.md | 9 + docs/models/components/guardrail.md | 36 +- docs/models/components/inputimagedetail.md | 11 +- .../inputmessageitemcontentinputimage.md | 10 +- .../components/inputmessageitemdetail.md | 11 +- .../inputmessageitemtypeinputimage.md | 18 + docs/models/components/inputreference.md | 39 + docs/models/components/inputschema.md | 11 + docs/models/components/inputsunion1.md | 248 + docs/models/components/itemreferenceitem.md | 11 + .../components/itemreferenceitemtype.md | 18 + docs/models/components/keep.md | 37 + docs/models/components/keepall.md | 8 + docs/models/components/keepenum.md | 18 + docs/models/components/keeptype.md | 18 + .../components/legacywebsearchservertool.md | 16 +- .../models/components/listbyokkeysresponse.md | 9 + .../listobservabilitydestinationsresponse.md | 9 + docs/models/components/listpresetsresponse.md | 11 + .../components/listpresetversionsresponse.md | 11 + docs/models/components/localshellcallitem.md | 14 + .../components/localshellcallitemaction.md | 13 + .../components/localshellcalloutputitem.md | 13 + .../localshellcalloutputitemstatus.md | 23 + .../localshellcalloutputitemtype.md | 18 + docs/models/components/logic.md | 22 + .../components/mcpapprovalrequestitem.md | 14 + .../components/mcpapprovalrequestitemtype.md | 18 + .../components/mcpapprovalresponseitem.md | 14 + .../components/mcpapprovalresponseitemtype.md | 18 + docs/models/components/mcpcallitem.md | 16 + docs/models/components/mcpcallitemtype.md | 18 + docs/models/components/mcplisttoolsitem.md | 14 + .../models/components/mcplisttoolsitemtool.md | 11 + .../models/components/mcplisttoolsitemtype.md | 18 + .../messagesadvisortoolresultblock.md | 12 + .../messagesadvisortoolresultblocktype.md | 18 + .../components/messagesfallbackparam.md | 11 + .../models/components/messagesmessageparam.md | 11 + .../messagesmessageparamcontentunion1.md | 53 + .../messagesmessageparamcontentunion2.md | 29 + .../messagesmessageparamcontentunion3.md | 29 + .../messagesmessageparamcontentunion4.md | 109 + .../messagesmessageparamcontentunion5.md | 29 + .../components/messagesmessageparamrole.md | 23 + .../messagesmessageparamtypecompaction.md | 18 + .../models/components/messagesoutputconfig.md | 12 + .../components/messagesoutputconfigeffort.md | 27 + .../components/messagesoutputconfigformat.md | 11 + .../messagesoutputconfigtypejsonschema.md | 18 + docs/models/components/messagesrequest.md | 35 + .../components/messagesrequestplugin.md | 85 + docs/models/components/messagesrequesttool.md | 9 + .../components/messagesrequesttoolunion.md | 117 + docs/models/components/metadata.md | 8 + docs/models/components/metadatalevel.md | 24 + docs/models/components/method.md | 22 + docs/models/components/model.md | 38 +- docs/models/components/modelbenchmarks.md | 11 + docs/models/components/modelresponse.md | 10 + docs/models/components/modelslistresponse.md | 6 +- docs/models/components/multimodalmedia.md | 9 + docs/models/components/nameadvisor.md | 18 + docs/models/components/namebash.md | 18 + .../models/components/namestrreplaceeditor.md | 18 + docs/models/components/namewebsearch1.md | 18 + docs/models/components/namewebsearch2.md | 18 + .../observabilityarizedestination.md | 19 + .../observabilityarizedestinationconfig.md | 12 + .../observabilityarizedestinationtype.md | 18 + .../observabilitybraintrustdestination.md | 19 + ...bservabilitybraintrustdestinationconfig.md | 11 + .../observabilitybraintrustdestinationtype.md | 18 + .../observabilityclickhousedestination.md | 19 + ...bservabilityclickhousedestinationconfig.md | 13 + .../observabilityclickhousedestinationtype.md | 18 + .../observabilitydatadogdestination.md | 19 + .../observabilitydatadogdestinationconfig.md | 11 + .../observabilitydatadogdestinationtype.md | 18 + .../components/observabilitydestination.md | 151 + .../observabilityfilterrulesconfig.md | 11 + .../observabilityfilterrulesconfigvalue.md | 29 + .../observabilitygrafanadestination.md | 19 + .../observabilitygrafanadestinationconfig.md | 11 + .../observabilitygrafanadestinationtype.md | 18 + .../observabilitylangfusedestination.md | 19 + .../observabilitylangfusedestinationconfig.md | 11 + .../observabilitylangfusedestinationtype.md | 18 + .../observabilitylangsmithdestination.md | 19 + ...observabilitylangsmithdestinationconfig.md | 12 + .../observabilitylangsmithdestinationtype.md | 18 + .../observabilitynewrelicdestination.md | 19 + .../observabilitynewrelicdestinationconfig.md | 10 + .../observabilitynewrelicdestinationtype.md | 18 + .../observabilityopikdestination.md | 19 + .../observabilityopikdestinationconfig.md | 11 + .../observabilityopikdestinationtype.md | 18 + .../observabilityotelcollectordestination.md | 19 + ...rvabilityotelcollectordestinationconfig.md | 9 + ...servabilityotelcollectordestinationtype.md | 18 + .../observabilityposthogdestination.md | 19 + .../observabilityposthogdestinationconfig.md | 10 + .../observabilityposthogdestinationtype.md | 18 + .../observabilityrampdestination.md | 19 + .../observabilityrampdestinationconfig.md | 10 + .../observabilityrampdestinationtype.md | 18 + .../components/observabilitys3destination.md | 19 + .../observabilitys3destinationconfig.md | 16 + .../observabilitys3destinationtype.md | 18 + .../observabilitysentrydestination.md | 19 + .../observabilitysentrydestinationconfig.md | 10 + .../observabilitysentrydestinationtype.md | 18 + .../observabilitysnowflakedestination.md | 19 + ...observabilitysnowflakedestinationconfig.md | 14 + .../observabilitysnowflakedestinationtype.md | 18 + .../observabilityweavedestination.md | 19 + .../observabilityweavedestinationconfig.md | 12 + .../observabilityweavedestinationtype.md | 18 + .../observabilitywebhookdestination.md | 19 + .../observabilitywebhookdestinationconfig.md | 10 + .../observabilitywebhookdestinationtype.md | 18 + .../openairesponsecustomtoolcall.md | 13 + .../openairesponsecustomtoolcalloutput.md | 11 + ...enairesponsecustomtoolcalloutputoutput1.md | 39 + ...enairesponsecustomtoolcalloutputoutput2.md | 29 + .../openairesponsecustomtoolcalloutputtype.md | 18 + .../openairesponsecustomtoolcalltype.md | 18 + .../openairesponsefunctiontoolcall.md | 1 + .../openairesponsestoolchoiceapplypatch.md | 8 + .../openairesponsestoolchoiceshell.md | 8 + ...openairesponsestoolchoicetypeapplypatch.md | 18 + .../openairesponsestoolchoicetypeshell.md | 18 + .../openairesponsestoolchoiceunion.md | 16 + docs/models/components/openresponsesresult.md | 3 +- docs/models/components/openroutermetadata.md | 17 + docs/models/components/operator.md | 33 + ...{speechrequestoptions.md => optionsobj.md} | 10 +- docs/models/components/outcome.md | 31 + docs/models/components/outcomeexit.md | 9 + docs/models/components/outcometimeout.md | 8 + .../components/outputadvisorservertoolitem.md | 17 + .../outputadvisorservertoolitemtype.md | 18 + .../components/outputapplypatchcallitem.md | 14 + .../outputapplypatchcallitemtype.md | 18 + .../outputapplypatchservertoolitem.md | 16 +- .../outputcodeinterpretercallitemtypeimage.md | 18 + .../components/outputcustomtoolcallitem.md | 15 + .../outputcustomtoolcallitemtype.md | 18 + .../components/outputfunctioncallitem.md | 1 + .../components/outputfusionservertoolitem.md | 17 + .../outputfusionservertoolitemtype.md | 18 + docs/models/components/outputimage.md | 8 +- docs/models/components/outputinputimage.md | 12 - docs/models/components/outputitems.md | 56 + docs/models/components/outputmodality.md | 19 +- docs/models/components/outputshellcallitem.md | 14 + .../components/outputshellcallitemaction.md | 10 + .../components/outputshellcallitemtype.md | 18 + .../components/outputshellcalloutputitem.md | 15 + .../outputshellcalloutputitemoutput.md | 10 + ...tshellcalloutputitemtypeshellcalloutput.md | 18 + .../outputsubagentservertoolitem.md | 17 + .../outputsubagentservertoolitemtype.md | 18 + .../outputwebfetchservertoolitem.md | 2 + .../components/outputwebsearchcallitem.md | 2 +- ...=> outputwebsearchcallitemactionsearch.md} | 4 +- .../outputwebsearchservertoolitem.md | 11 +- .../outputwebsearchservertoolitemaction.md | 12 + .../outputwebsearchservertoolitemsource.md | 9 + ...chservertoolitemtypeopenrouterwebsearch.md | 18 + ...outputwebsearchservertoolitemtypesearch.md | 18 + .../outputwebsearchservertoolitemtypeurl.md | 18 + docs/models/components/parameters.md | 9 - docs/models/components/partialcoverage.md | 9 + docs/models/components/pipelinestage.md | 14 + docs/models/components/pipelinestagetype.md | 27 + docs/models/components/preset.md | 20 + .../components/presetdesignatedversion.md | 17 + docs/models/components/presetstatus.md | 25 + .../components/presetwithdesignatedversion.md | 21 + .../preview20250311websearchservertool.md | 16 +- .../components/previewwebsearchservertool.md | 16 +- .../components/promptinjectionscanscope.md | 24 + docs/models/components/providername.md | 9 +- ...onrequestoptions.md => provideroptions.md} | 10 +- docs/models/components/providerresponse.md | 2 +- .../providerresponseprovidername.md | 10 +- docs/models/components/rankingsdailyitem.md | 10 + docs/models/components/rankingsdailymeta.md | 11 + .../components/rankingsdailymetaversion.md | 20 + .../components/rankingsdailyresponse.md | 9 + docs/models/components/region.md | 22 + docs/models/components/response.md | 9 + docs/models/components/responsesrequest.md | 76 +- .../components/responsesrequestplugin.md | 16 + .../components/responsesrequesttoolunion.md | 56 + .../responsesstreamingresponse.md} | 4 +- docs/models/components/routerattempt.md | 10 + docs/models/components/routerparams.md | 11 + docs/models/components/routingstrategy.md | 29 + docs/models/components/rule.md | 10 + docs/models/components/searchqualitylevel.md | 2 +- docs/models/components/shellcallitem.md | 15 + docs/models/components/shellcallitemaction.md | 10 + docs/models/components/shellcallitemstatus.md | 23 + docs/models/components/shellcallitemtype.md | 18 + docs/models/components/shellcalloutputitem.md | 15 + .../components/shellcalloutputitemoutput.md | 11 + .../components/shellcalloutputitemstatus.md | 23 + .../components/shellcalloutputitemtype.md | 18 + docs/models/components/shellcallstatus.md | 25 + .../components/shellservertoolconfig.md | 12 + .../components/shellservertoolengine.md | 24 + .../components/shellservertoolenvironment.md | 31 + .../components/shellservertoolopenrouter.md | 11 + .../shellservertoolopenroutertype.md | 18 + docs/models/components/sourcecontent.md | 9 + docs/models/components/sourcetype.md | 18 + .../components/speechrequestprovider.md | 6 +- docs/models/components/speed.md | 24 + docs/models/components/stance.md | 9 + .../stopservertoolswhencondition.md | 55 + .../stopservertoolswhenfinishreasonis.md | 11 + .../stopservertoolswhenfinishreasonistype.md | 18 + .../stopservertoolswhenhastoolcall.md | 11 + .../stopservertoolswhenhastoolcalltype.md | 18 + .../components/stopservertoolswhenmaxcost.md | 11 + ...e.md => stopservertoolswhenmaxcosttype.md} | 6 +- .../stopservertoolswhenmaxtokensused.md | 11 + .../stopservertoolswhenmaxtokensusedtype.md | 18 + .../stopservertoolswhenstepcountis.md | 11 + .../stopservertoolswhenstepcountistype.md | 18 + docs/models/components/streamevents.md | 104 + docs/models/components/sttinputaudio.md | 11 + docs/models/components/sttrequest.md | 14 + docs/models/components/sttrequestprovider.md | 10 + docs/models/components/sttresponse.md | 11 + docs/models/components/sttusage.md | 14 + docs/models/components/subagentnestedtool.md | 12 + docs/models/components/subagentreasoning.md | 11 + .../components/subagentreasoningeffort.md | 28 + .../components/subagentservertoolconfig.md | 16 + .../subagentservertoolopenrouter.md | 11 + .../subagentservertoolopenroutertype.md | 18 + .../models/components/supportedaspectratio.md | 2 + docs/models/components/supportedsize.md | 8 + docs/models/components/system.md | 29 + docs/models/components/taskbudget.md | 12 + docs/models/components/thinking.md | 37 + docs/models/components/thinkingadaptive.md | 9 + docs/models/components/thinkingdisabled.md | 8 + docs/models/components/thinkingenabled.md | 10 + docs/models/components/tooladvisor20260301.md | 15 + docs/models/components/toolbash20250124.md | 10 + docs/models/components/toolchoice.md | 45 + docs/models/components/toolchoiceany.md | 9 + docs/models/components/toolchoiceauto.md | 9 + docs/models/components/toolchoicenone.md | 8 + docs/models/components/toolchoicetool.md | 10 + docs/models/components/toolchoicetypeauto.md | 18 + docs/models/components/toolcustom.md | 12 + .../components/tooltexteditor20250124.md | 10 + docs/models/components/tooltypecustom.md | 18 + docs/models/components/tooltypeephemeral.md | 18 + .../components/toolwebsearch20250305.md | 14 + .../components/toolwebsearch20260209.md | 15 + docs/models/components/tournamentstats.md | 14 + docs/models/components/trigger.md | 29 + docs/models/components/triggerinputtokens.md | 9 + docs/models/components/typeadaptive.md | 18 + docs/models/components/typeadvisor20260301.md | 18 + docs/models/components/typeany.md | 18 + docs/models/components/typebash20250124.md | 18 + .../components/typeclearthinking20251015.md | 18 + .../components/typecleartooluses20250919.md | 18 + docs/models/components/typecompact20260112.md | 18 + docs/models/components/typecustom.md | 18 - docs/models/components/typedisabled.md | 18 + docs/models/components/typedocument.md | 18 + docs/models/components/typeenabled.md | 18 + docs/models/components/typeexec.md | 18 + docs/models/components/typeexit.md | 18 + docs/models/components/typeimage.md | 18 - docs/models/components/typelocalshellcall.md | 18 + docs/models/components/typenone.md | 18 + .../models/components/typeredactedthinking.md | 18 + docs/models/components/typeservertooluse.md | 18 + .../components/typetexteditor20250124.md | 18 + docs/models/components/typethinking.md | 18 + docs/models/components/typetimeout.md | 18 + .../{typesearch.md => typetokens.md} | 6 +- docs/models/components/typetool.md | 18 + docs/models/components/typetoolreference.md | 18 + docs/models/components/typetoolresult.md | 18 + docs/models/components/typetooluse.md | 18 + .../components/typewebsearch20250305.md | 18 + .../components/typewebsearch20260209.md | 18 + .../components/typewebsearchtoolresult.md | 18 + ...ype.md => typewebsearchtoolresulterror.md} | 6 +- docs/models/components/uniqueinsight.md | 9 + .../models/components/updatebyokkeyrequest.md | 13 + .../components/updatebyokkeyresponse.md | 8 + .../components/updateguardrailrequest.md | 28 +- .../components/updateguardrailresponse.md | 6 +- .../updateobservabilitydestinationrequest.md | 14 + .../updateobservabilitydestinationresponse.md | 8 + .../components/updateworkspacerequest.md | 24 +- .../components/updateworkspaceresponse.md | 6 +- docs/models/components/urlcitation.md | 1 + docs/models/components/usage.md | 2 +- docs/models/components/usagecostdetails.md | 10 + docs/models/components/userlocation.md | 14 + docs/models/components/value1.md | 29 - docs/models/components/value2.md | 45 - .../components/videogenerationrequest.md | 27 +- .../videogenerationrequestprovider.md | 6 +- docs/models/components/videourl.md | 8 + docs/models/components/webfetchengineenum.md | 28 + docs/models/components/webfetchplugin.md | 12 + docs/models/components/webfetchpluginid.md | 18 + docs/models/components/webfetchservertool.md | 11 + .../components/webfetchservertoolconfig.md | 14 + .../components/webfetchservertooltype.md | 18 + docs/models/components/websearchconfig.md | 19 +- docs/models/components/websearchengine.md | 13 +- docs/models/components/websearchengineenum.md | 19 +- docs/models/components/websearchplugin.md | 20 +- docs/models/components/websearchplugintype.md | 18 + docs/models/components/websearchservertool.md | 16 +- .../components/websearchservertoolconfig.md | 17 + .../websearchservertoolopenrouter.md | 8 +- .../websearchuserlocationservertool.md | 8 +- docs/models/components/workspace.md | 32 +- docs/models/operations/arena.md | 25 + docs/models/operations/category.md | 34 - docs/models/operations/content.md | 24 + .../operations/createauthkeyscoderequest.md | 19 +- .../createpresetschatcompletionsrequest.md | 9 + .../createpresetsmessagesrequest.md | 9 + .../createpresetsresponsesrequest.md | 9 + docs/models/operations/creatererankrequest.md | 14 +- .../operations/createresponsesrequest.md | 9 + .../operations/createresponsesresponse.md | 2 +- .../models/operations/deletebyokkeyrequest.md | 8 + docs/models/operations/deletefilerequest.md | 9 + .../deleteobservabilitydestinationrequest.md | 8 + docs/models/operations/dimension.md | 9 + docs/models/operations/direction.md | 22 + docs/models/operations/displayformat.md | 27 + docs/models/operations/distillable.md | 24 + docs/models/operations/document.md | 31 +- docs/models/operations/documentrequest.md | 11 + docs/models/operations/documentresponse.md | 11 + .../operations/downloadfilecontentrequest.md | 9 + docs/models/operations/file.md | 9 + docs/models/operations/filter.md | 10 + .../models/operations/getanalyticsmetadata.md | 11 + .../operations/getanalyticsmetaresponse.md | 10 + .../operations/getapprankingscategory.md | 26 + .../operations/getapprankingsrequest.md | 14 + .../operations/getapprankingsresponse.md | 8 + docs/models/operations/getapprankingssort.md | 24 + .../getbenchmarksartificialanalysisrequest.md | 8 + .../getbenchmarksdesignarenarequest.md | 10 + docs/models/operations/getbyokkeyrequest.md | 8 + .../operations/getfilemetadatarequest.md | 9 + docs/models/operations/getmodelrequest.md | 9 + docs/models/operations/getmodelscategory.md | 34 + docs/models/operations/getmodelsrequest.md | 22 +- docs/models/operations/getmodelssort.md | 30 + .../getobservabilitydestinationrequest.md | 8 + docs/models/operations/getpresetrequest.md | 8 + .../operations/getpresetversionrequest.md | 9 + .../operations/getrankingsdailyrequest.md | 9 + docs/models/operations/granularity.md | 9 + docs/models/operations/granularityname.md | 27 + docs/models/operations/listbyokkeysrequest.md | 11 + .../models/operations/listbyokkeysresponse.md | 8 + docs/models/operations/listfilesrequest.md | 10 + docs/models/operations/listfilesresponse.md | 8 + .../operations/listguardrailsresponse.md | 6 +- .../listobservabilitydestinationsrequest.md | 10 + .../listobservabilitydestinationsresponse.md | 8 + docs/models/operations/listpresetsrequest.md | 9 + docs/models/operations/listpresetsresponse.md | 8 + .../operations/listpresetversionsrequest.md | 10 + .../operations/listpresetversionsresponse.md | 8 + .../operations/listworkspacesresponse.md | 6 +- docs/models/operations/metadata.md | 10 + docs/models/operations/metric.md | 11 + docs/models/operations/operator.md | 9 + docs/models/operations/operatorname.md | 30 + docs/models/operations/orderby.md | 9 + docs/models/operations/prompttokensdetails.md | 13 +- docs/models/operations/provider.md | 105 + docs/models/operations/queryanalyticsdata1.md | 9 + docs/models/operations/queryanalyticsdata2.md | 10 + .../operations/queryanalyticsrequest.md | 15 + .../operations/queryanalyticsresponse.md | 10 + docs/models/operations/region.md | 20 + docs/models/operations/result.md | 10 +- .../sendchatcompletionrequestrequest.md | 9 + .../sendchatcompletionrequestresponse.md | 2 +- docs/models/operations/subcategory.md | 37 + docs/models/operations/timerange.md | 9 + .../models/operations/updatebyokkeyrequest.md | 9 + .../updateobservabilitydestinationrequest.md | 9 + docs/models/operations/uploadfilerequest.md | 9 + .../operations/uploadfilerequestbody.md | 8 + docs/models/operations/value1.md | 39 + docs/models/operations/value2.md | 29 + docs/models/operations/valuetype.md | 24 + docs/models/operations/zdr.md | 20 + .../sdkerrors/badgatewayresponseerror.md | 1 + .../sdkerrors/badrequestresponseerror.md | 1 + .../models/sdkerrors/conflictresponseerror.md | 1 + .../edgenetworktimeoutresponseerror.md | 1 + .../sdkerrors/forbiddenresponseerror.md | 1 + .../sdkerrors/internalserverresponseerror.md | 1 + .../models/sdkerrors/notfoundresponseerror.md | 1 + .../sdkerrors/payloadtoolargeresponseerror.md | 1 + .../sdkerrors/paymentrequiredresponseerror.md | 1 + .../provideroverloadedresponseerror.md | 1 + .../sdkerrors/requesttimeoutresponseerror.md | 1 + .../serviceunavailableresponseerror.md | 1 + .../sdkerrors/toomanyrequestsresponseerror.md | 1 + .../sdkerrors/unauthorizedresponseerror.md | 1 + .../unprocessableentityresponseerror.md | 1 + docs/sdks/betaanalytics/README.md | 136 + docs/sdks/byok/README.md | 317 + docs/sdks/chat/README.md | 83 +- docs/sdks/datasets/README.md | 293 + docs/sdks/files/README.md | 325 + docs/sdks/guardrails/README.md | 5 +- docs/sdks/models/README.md | 70 +- docs/sdks/oauth/README.md | 1 + docs/sdks/observability/README.md | 435 + docs/sdks/presets/README.md | 491 + docs/sdks/rerank/README.md | 10 +- docs/sdks/responses/README.md | 65 +- docs/sdks/stt/README.md | 79 + docs/sdks/tts/README.md | 2 +- embeddings.go | 4 +- endpoints.go | 4 +- files.go | 1649 + generations.go | 4 +- go.mod | 2 +- guardrails.go | 26 +- internal/utils/json.go | 7 + internal/utils/union.go | 5 +- internal/utils/union_test.go | 70 + models.go | 264 +- models/components/aabenchmarkentry.go | 34 + models/components/advisornestedtool.go | 46 + models/components/advisorreasoning.go | 67 + models/components/advisorservertoolconfig.go | 112 + .../components/advisorservertoolopenrouter.go | 64 + models/components/anthropicallowedcallers.go | 26 + .../components/anthropicbase64imagesource.go | 73 + models/components/anthropicbase64pdfsource.go | 96 + .../anthropiccachecontroldirective.go | 2 +- .../anthropiccitationcharlocationparam.go | 94 + ...hropiccitationcontentblocklocationparam.go | 94 + .../anthropiccitationpagelocationparam.go | 94 + .../anthropiccitationsearchresultlocation.go | 102 + ...nthropiccitationwebsearchresultlocation.go | 86 + .../components/anthropicdocumentblockparam.go | 501 + models/components/anthropicimageblockparam.go | 165 + models/components/anthropicimagemimetype.go | 27 + .../anthropicinputtokensclearatleast.go | 62 + .../components/anthropicinputtokenstrigger.go | 62 + models/components/anthropicplaintextsource.go | 93 + .../anthropicsearchresultblockparam.go | 117 + models/components/anthropictextblockparam.go | 247 + models/components/anthropicthinkingdisplay.go | 25 + models/components/anthropicthinkingturns.go | 62 + models/components/anthropictooluseskeep.go | 62 + models/components/anthropictoolusestrigger.go | 62 + models/components/anthropicurlimagesource.go | 62 + models/components/anthropicurlpdfsource.go | 62 + .../anthropicwebsearchresultblockparam.go | 87 + .../anthropicwebsearchtooluserlocation.go | 87 + models/components/applypatchcallitem.go | 102 + models/components/applypatchcalloperation.go | 153 + .../applypatchcalloperationdiffdeltaevent.go | 87 + .../applypatchcalloperationdiffdoneevent.go | 87 + models/components/applypatchcalloutputitem.go | 110 + models/components/applypatchcallstatus.go | 26 + .../applypatchcreatefileoperation.go | 71 + .../applypatchdeletefileoperation.go | 63 + models/components/applypatchengineenum.go | 27 + .../components/applypatchservertoolconfig.go | 31 + .../applypatchservertoolopenrouter.go | 64 + .../applypatchupdatefileoperation.go | 71 + models/components/apprankingsitem.go | 51 + models/components/apprankingsresponse.go | 23 + models/components/autorouterplugin.go | 9 + models/components/baseinputsunion.go | 104 + models/components/bashservertool.go | 64 + models/components/bashservertoolconfig.go | 63 + models/components/bashservertoolengine.go | 27 + .../components/bashservertoolenvironment.go | 96 + models/components/benchmarkpricing.go | 25 + models/components/benchmarksaaitem.go | 60 + models/components/benchmarksaameta.go | 137 + models/components/benchmarksaaresponse.go | 22 + models/components/benchmarksdaitem.go | 131 + models/components/benchmarksdameta.go | 186 + models/components/benchmarksdaresponse.go | 22 + models/components/byokkey.go | 118 + models/components/byokproviderslug.go | 107 + models/components/chatfunctiontool.go | 104 + models/components/chatrequest.go | 180 +- models/components/chatresult.go | 12 +- models/components/chatservertoolchoice.go | 31 + models/components/chatstreamchunk.go | 12 +- models/components/chatstreamingresponse.go | 19 + models/components/chattoolchoice.go | 26 + models/components/chatusage.go | 27 + models/components/chatwebsearchshorthand.go | 21 +- models/components/compactionitem.go | 72 + models/components/containerautoenvironment.go | 55 + .../containerreferenceenvironment.go | 64 + models/components/contentfilteraction.go | 26 + .../components/contentfilterbuiltinaction.go | 27 + .../components/contentfilterbuiltinentry.go | 43 + .../contentfilterbuiltinentryinput.go | 45 + models/components/contentfilterbuiltinslug.go | 32 + models/components/contentfilterentry.go | 38 + models/components/contentpartaudio.go | 84 + models/components/contentpartimage.go | 23 + models/components/contentpartinputaudio.go | 62 + models/components/contentpartinputfile.go | 62 + models/components/contentpartinputvideo.go | 62 + models/components/contentpartvideo.go | 84 + models/components/costdetails.go | 35 + models/components/createbyokkeyrequest.go | 94 + models/components/createbyokkeyresponse.go | 14 + models/components/createguardrailrequest.go | 58 +- .../createobservabilitydestinationrequest.go | 141 + .../createobservabilitydestinationresponse.go | 82 + .../createpresetfrominferenceresponse.go | 16 + models/components/createworkspacerequest.go | 32 +- models/components/customtool.go | 24 +- .../customtoolcallinputdeltaevent.go | 87 + .../customtoolcallinputdoneevent.go | 87 + models/components/customtoolcallitem.go | 96 + models/components/customtoolcalloutputitem.go | 368 + models/components/dabenchmarkentry.go | 52 + models/components/deletebyokkeyresponse.go | 28 + .../deleteobservabilitydestinationresponse.go | 28 + models/components/easyinputmessage.go | 29 +- models/components/endpointinfo.go | 45 + models/components/endpointsmetadata.go | 37 + models/components/filedeleteresponse.go | 51 + models/components/filelistresponse.go | 48 + models/components/filemetadata.go | 91 + models/components/filesearchservertool.go | 146 +- models/components/functioncallitem.go | 17 +- models/components/functioncalloutputitem.go | 81 +- models/components/fusionanalysisresult.go | 182 + .../fusioncallanalysiscompletedevent.go | 88 + .../fusioncallanalysisinprogressevent.go | 87 + models/components/fusioncallcompletedevent.go | 79 + .../components/fusioncallinprogressevent.go | 79 + .../components/fusioncallpaneladdedevent.go | 87 + .../fusioncallpanelcompletedevent.go | 95 + .../components/fusioncallpaneldeltaevent.go | 95 + .../components/fusioncallpanelfailedevent.go | 103 + .../fusioncallpanelreasoningdeltaevent.go | 95 + models/components/fusionplugin.go | 131 + models/components/fusionservertoolconfig.go | 177 + .../components/fusionservertoolopenrouter.go | 64 + models/components/generationresponse.go | 72 +- models/components/getbyokkeyresponse.go | 14 + .../getobservabilitydestinationresponse.go | 82 + models/components/getpresetresponse.go | 16 + models/components/getpresetversionresponse.go | 16 + models/components/guardrail.go | 58 +- models/components/inputimage.go | 9 +- models/components/inputmessageitem.go | 29 +- models/components/inputreference.go | 123 + models/components/inputsunion.go | 858 +- models/components/itemreferenceitem.go | 63 + .../components/legacywebsearchservertool.go | 4 +- models/components/listbyokkeysresponse.go | 24 + .../listobservabilitydestinationsresponse.go | 24 + models/components/listpresetsresponse.go | 23 + .../components/listpresetversionsresponse.go | 23 + models/components/localshellcallitem.go | 173 + models/components/localshellcalloutputitem.go | 103 + models/components/mcpapprovalrequestitem.go | 87 + models/components/mcpapprovalresponseitem.go | 88 + models/components/mcpcallitem.go | 104 + models/components/mcplisttoolsitem.go | 134 + .../messagesadvisortoolresultblock.go | 71 + models/components/messagesfallbackparam.go | 38 + models/components/messagesmessageparam.go | 1453 + models/components/messagesoutputconfig.go | 172 + models/components/messagesrequest.go | 3246 ++ models/components/metadatalevel.go | 26 + models/components/model.go | 30 + models/components/modelbenchmarks.go | 40 + models/components/modelresponse.go | 16 + models/components/multimodalmedia.go | 37 + .../observabilityarizedestination.go | 207 + .../observabilitybraintrustdestination.go | 199 + .../observabilityclickhousedestination.go | 216 + .../observabilitydatadogdestination.go | 202 + models/components/observabilitydestination.go | 530 + .../observabilityfilterrulesconfig.go | 284 + .../observabilitygrafanadestination.go | 199 + .../observabilitylangfusedestination.go | 199 + .../observabilitylangsmithdestination.go | 209 + .../observabilitynewrelicdestination.go | 213 + .../observabilityopikdestination.go | 199 + .../observabilityotelcollectordestination.go | 183 + .../observabilityposthogdestination.go | 191 + .../observabilityrampdestination.go | 192 + .../components/observabilitys3destination.go | 247 + .../observabilitysentrydestination.go | 191 + .../observabilitysnowflakedestination.go | 223 + .../observabilityweavedestination.go | 207 + .../observabilitywebhookdestination.go | 212 + .../openairesponsecustomtoolcall.go | 95 + .../openairesponsecustomtoolcalloutput.go | 310 + .../openairesponsefunctiontoolcall.go | 17 +- .../openairesponsestoolchoiceunion.go | 166 +- models/components/openresponsesresult.go | 14 +- models/components/openroutermetadata.go | 101 + .../components/outputadvisorservertoolitem.go | 116 + models/components/outputapplypatchcallitem.go | 101 + .../outputapplypatchservertoolitem.go | 42 +- .../outputcodeinterpretercallitem.go | 22 +- models/components/outputcustomtoolcallitem.go | 96 + models/components/outputfunctioncallitem.go | 17 +- .../components/outputfusionservertoolitem.go | 187 + models/components/outputitems.go | 191 +- models/components/outputmodality.go | 17 +- models/components/outputshellcallitem.go | 126 + .../components/outputshellcalloutputitem.go | 357 + .../outputsubagentservertoolitem.go | 116 + .../outputwebfetchservertoolitem.go | 30 +- models/components/outputwebsearchcallitem.go | 113 +- .../outputwebsearchservertoolitem.go | 146 +- models/components/pipelinestage.go | 79 + models/components/pipelinestagetype.go | 29 + models/components/preset.go | 96 + models/components/presetdesignatedversion.go | 71 + models/components/presetstatus.go | 27 + .../components/presetwithdesignatedversion.go | 105 + .../preview20250311websearchservertool.go | 4 +- .../components/previewwebsearchservertool.go | 4 +- models/components/promptinjectionscanscope.go | 26 + models/components/providername.go | 11 +- models/components/provideroptions.go | 942 + models/components/providerresponse.go | 16 +- models/components/rankingsdailyitem.go | 33 + models/components/rankingsdailymeta.go | 71 + models/components/rankingsdailyresponse.go | 23 + models/components/responsesrequest.go | 267 +- .../components/responsesstreamingresponse.go | 191 + models/components/routerattempt.go | 45 + models/components/routerparams.go | 53 + models/components/routingstrategy.go | 32 + models/components/searchqualitylevel.go | 2 +- models/components/shellcallitem.go | 157 + models/components/shellcalloutputitem.go | 165 + models/components/shellcallstatus.go | 27 + models/components/shellservertoolconfig.go | 63 + models/components/shellservertoolengine.go | 26 + .../components/shellservertoolenvironment.go | 96 + .../components/shellservertoolopenrouter.go | 64 + models/components/speechrequest.go | 875 +- .../stopservertoolswhencondition.go | 177 + .../stopservertoolswhenfinishreasonis.go | 63 + .../stopservertoolswhenhastoolcall.go | 63 + .../components/stopservertoolswhenmaxcost.go | 63 + .../stopservertoolswhenmaxtokensused.go | 63 + .../stopservertoolswhenstepcountis.go | 63 + models/components/streamevents.go | 475 +- .../streameventsresponseoutputitemadded.go | 28 + .../streameventsresponseoutputitemdone.go | 28 + models/components/sttinputaudio.go | 25 + models/components/sttrequest.go | 91 + models/components/sttresponse.go | 40 + models/components/sttusage.go | 52 + models/components/subagentnestedtool.go | 46 + models/components/subagentreasoning.go | 67 + models/components/subagentservertoolconfig.go | 85 + .../subagentservertoolopenrouter.go | 64 + models/components/updatebyokkeyrequest.go | 76 + models/components/updatebyokkeyresponse.go | 14 + models/components/updateguardrailrequest.go | 58 +- .../updateobservabilitydestinationrequest.go | 84 + .../updateobservabilitydestinationresponse.go | 82 + models/components/updateworkspacerequest.go | 32 +- models/components/urlcitation.go | 8 + models/components/usage.go | 32 +- models/components/videogenerationrequest.go | 746 +- models/components/videomodel.go | 14 +- models/components/webfetchengineenum.go | 30 + models/components/webfetchplugin.go | 90 + models/components/webfetchservertool.go | 64 + models/components/webfetchservertoolconfig.go | 67 + models/components/websearchconfig.go | 21 +- models/components/websearchengine.go | 11 +- models/components/websearchengineenum.go | 15 +- models/components/websearchplugin.go | 98 +- models/components/websearchservertool.go | 4 +- .../components/websearchservertoolconfig.go | 94 + .../websearchservertoolopenrouter.go | 37 +- .../websearchuserlocationservertool.go | 19 +- models/components/workspace.go | 18 + models/operations/createauthkeyscode.go | 11 +- models/operations/createembeddings.go | 98 +- .../createpresetschatcompletions.go | 27 + models/operations/createpresetsmessages.go | 27 + models/operations/createpresetsresponses.go | 27 + models/operations/creatererank.go | 158 +- models/operations/createresponses.go | 151 +- models/operations/deletebyokkey.go | 15 + models/operations/deletefile.go | 23 + .../deleteobservabilitydestination.go | 15 + models/operations/downloadfilecontent.go | 23 + models/operations/getanalyticsmeta.go | 256 + models/operations/getapprankings.go | 183 + .../getbenchmarksartificialanalysis.go | 30 + models/operations/getbenchmarksdesignarena.go | 72 + models/operations/getbyokkey.go | 15 + models/operations/getfilemetadata.go | 23 + models/operations/getmodel.go | 24 + models/operations/getmodels.go | 250 +- .../operations/getobservabilitydestination.go | 15 + models/operations/getpreset.go | 15 + models/operations/getpresetversion.go | 24 + models/operations/getrankingsdaily.go | 24 + models/operations/listbyokkeys.go | 164 + models/operations/listfiles.go | 50 + .../listobservabilitydestinations.go | 51 + models/operations/listpresets.go | 42 + models/operations/listpresetversions.go | 51 + models/operations/options.go | 2 +- models/operations/queryanalytics.go | 474 + .../operations/sendchatcompletionrequest.go | 31 +- models/operations/updatebyokkey.go | 27 + .../updateobservabilitydestination.go | 27 + models/operations/uploadfile.go | 54 + models/sdkerrors/badgatewayresponseerror.go | 5 +- models/sdkerrors/badrequestresponseerror.go | 5 +- models/sdkerrors/conflictresponseerror.go | 5 +- .../edgenetworktimeoutresponseerror.go | 5 +- models/sdkerrors/forbiddenresponseerror.go | 5 +- .../sdkerrors/internalserverresponseerror.go | 5 +- models/sdkerrors/notfoundresponseerror.go | 5 +- .../sdkerrors/payloadtoolargeresponseerror.go | 5 +- .../sdkerrors/paymentrequiredresponseerror.go | 5 +- .../provideroverloadedresponseerror.go | 5 +- .../sdkerrors/requesttimeoutresponseerror.go | 5 +- .../serviceunavailableresponseerror.go | 5 +- .../sdkerrors/toomanyrequestsresponseerror.go | 5 +- models/sdkerrors/unauthorizedresponseerror.go | 5 +- .../unprocessableentityresponseerror.go | 5 +- oauth.go | 25 +- observability.go | 1524 + openrouter.go | 30 +- organization.go | 2 +- presets.go | 2338 ++ providers.go | 2 +- rerank.go | 2 +- responses.go | 40 +- stt.go | 455 + tts.go | 4 +- types/stream/stream.go | 47 +- videogeneration.go | 8 +- workspaces.go | 14 +- 1046 files changed, 79477 insertions(+), 14297 deletions(-) create mode 100644 betaanalytics.go create mode 100644 byok.go create mode 100644 datasets.go create mode 100644 docs/models/components/aabenchmarkentry.md create mode 100644 docs/models/components/actiontypesearch.md create mode 100644 docs/models/components/advisornestedtool.md create mode 100644 docs/models/components/advisorreasoning.md create mode 100644 docs/models/components/advisorreasoningeffort.md create mode 100644 docs/models/components/advisorservertoolconfig.md create mode 100644 docs/models/components/advisorservertoolopenrouter.md create mode 100644 docs/models/components/advisorservertoolopenroutertype.md create mode 100644 docs/models/components/anthropicallowedcallers.md create mode 100644 docs/models/components/anthropicbase64imagesource.md create mode 100644 docs/models/components/anthropicbase64imagesourcetype.md create mode 100644 docs/models/components/anthropicbase64pdfsource.md create mode 100644 docs/models/components/anthropicbase64pdfsourcemediatype.md create mode 100644 docs/models/components/anthropicbase64pdfsourcetype.md create mode 100644 docs/models/components/anthropiccitationcharlocationparam.md create mode 100644 docs/models/components/anthropiccitationcharlocationparamtype.md create mode 100644 docs/models/components/anthropiccitationcontentblocklocationparam.md create mode 100644 docs/models/components/anthropiccitationcontentblocklocationparamtype.md create mode 100644 docs/models/components/anthropiccitationpagelocationparam.md create mode 100644 docs/models/components/anthropiccitationpagelocationparamtype.md create mode 100644 docs/models/components/anthropiccitationsearchresultlocation.md create mode 100644 docs/models/components/anthropiccitationsearchresultlocationtype.md create mode 100644 docs/models/components/anthropiccitationwebsearchresultlocation.md create mode 100644 docs/models/components/anthropiccitationwebsearchresultlocationtype.md create mode 100644 docs/models/components/anthropicdocumentblockparam.md create mode 100644 docs/models/components/anthropicdocumentblockparamcitations.md create mode 100644 docs/models/components/anthropicdocumentblockparamcontent1.md create mode 100644 docs/models/components/anthropicdocumentblockparamcontent2.md create mode 100644 docs/models/components/anthropicdocumentblockparamsourceunion.md create mode 100644 docs/models/components/anthropicimageblockparam.md create mode 100644 docs/models/components/anthropicimageblockparamsource.md create mode 100644 docs/models/components/anthropicimageblockparamtype.md create mode 100644 docs/models/components/anthropicimagemimetype.md create mode 100644 docs/models/components/anthropicinputtokensclearatleast.md create mode 100644 docs/models/components/anthropicinputtokensclearatleasttype.md create mode 100644 docs/models/components/anthropicinputtokenstrigger.md rename docs/models/components/{functioncalloutputitemoutputtype.md => anthropicinputtokenstriggertype.md} (67%) create mode 100644 docs/models/components/anthropicplaintextsource.md create mode 100644 docs/models/components/anthropicplaintextsourcemediatype.md create mode 100644 docs/models/components/anthropicplaintextsourcetype.md create mode 100644 docs/models/components/anthropicsearchresultblockparam.md create mode 100644 docs/models/components/anthropicsearchresultblockparamcitations.md create mode 100644 docs/models/components/anthropicsearchresultblockparamtype.md create mode 100644 docs/models/components/anthropictextblockparam.md create mode 100644 docs/models/components/anthropictextblockparamtype.md create mode 100644 docs/models/components/anthropicthinkingdisplay.md create mode 100644 docs/models/components/anthropicthinkingturns.md create mode 100644 docs/models/components/anthropicthinkingturnstype.md create mode 100644 docs/models/components/anthropictooluseskeep.md create mode 100644 docs/models/components/anthropictooluseskeeptype.md create mode 100644 docs/models/components/anthropictoolusestrigger.md create mode 100644 docs/models/components/anthropictoolusestriggertype.md create mode 100644 docs/models/components/anthropicurlimagesource.md create mode 100644 docs/models/components/anthropicurlimagesourcetype.md create mode 100644 docs/models/components/anthropicurlpdfsource.md create mode 100644 docs/models/components/anthropicurlpdfsourcetype.md create mode 100644 docs/models/components/anthropicwebsearchresultblockparam.md create mode 100644 docs/models/components/anthropicwebsearchresultblockparamtype.md create mode 100644 docs/models/components/anthropicwebsearchtooluserlocation.md create mode 100644 docs/models/components/anthropicwebsearchtooluserlocationtype.md create mode 100644 docs/models/components/applypatchcallitem.md create mode 100644 docs/models/components/applypatchcallitemtype.md create mode 100644 docs/models/components/applypatchcalloperation.md create mode 100644 docs/models/components/applypatchcalloperationdiffdeltaevent.md create mode 100644 docs/models/components/applypatchcalloperationdiffdeltaeventtype.md create mode 100644 docs/models/components/applypatchcalloperationdiffdoneevent.md create mode 100644 docs/models/components/applypatchcalloperationdiffdoneeventtype.md create mode 100644 docs/models/components/applypatchcalloutputitem.md create mode 100644 docs/models/components/applypatchcalloutputitemstatus.md create mode 100644 docs/models/components/applypatchcalloutputitemtype.md create mode 100644 docs/models/components/applypatchcallstatus.md create mode 100644 docs/models/components/applypatchcreatefileoperation.md create mode 100644 docs/models/components/applypatchcreatefileoperationtype.md create mode 100644 docs/models/components/applypatchdeletefileoperation.md create mode 100644 docs/models/components/applypatchdeletefileoperationtype.md create mode 100644 docs/models/components/applypatchengineenum.md create mode 100644 docs/models/components/applypatchservertoolconfig.md create mode 100644 docs/models/components/applypatchservertoolopenrouter.md create mode 100644 docs/models/components/applypatchservertoolopenroutertype.md create mode 100644 docs/models/components/applypatchupdatefileoperation.md create mode 100644 docs/models/components/applypatchupdatefileoperationtype.md create mode 100644 docs/models/components/apprankingsitem.md create mode 100644 docs/models/components/apprankingsresponse.md create mode 100644 docs/models/components/audiourl.md create mode 100644 docs/models/components/bashservertool.md create mode 100644 docs/models/components/bashservertoolconfig.md create mode 100644 docs/models/components/bashservertoolengine.md create mode 100644 docs/models/components/bashservertoolenvironment.md create mode 100644 docs/models/components/bashservertooltype.md create mode 100644 docs/models/components/benchmarkpricing.md create mode 100644 docs/models/components/benchmarksaaitem.md create mode 100644 docs/models/components/benchmarksaameta.md create mode 100644 docs/models/components/benchmarksaametasource.md create mode 100644 docs/models/components/benchmarksaametasourceurl.md create mode 100644 docs/models/components/benchmarksaametaversion.md create mode 100644 docs/models/components/benchmarksaaresponse.md create mode 100644 docs/models/components/benchmarksdaitem.md create mode 100644 docs/models/components/benchmarksdameta.md create mode 100644 docs/models/components/benchmarksdametasource.md create mode 100644 docs/models/components/benchmarksdametasourceurl.md create mode 100644 docs/models/components/benchmarksdametaversion.md create mode 100644 docs/models/components/benchmarksdaresponse.md create mode 100644 docs/models/components/byokkey.md create mode 100644 docs/models/components/byokproviderslug.md create mode 100644 docs/models/components/caching.md create mode 100644 docs/models/components/chatrequesteffort.md rename docs/models/components/{reasoning.md => chatrequestreasoning.md} (94%) create mode 100644 docs/models/components/chatrequestreasoningeffort.md create mode 100644 docs/models/components/chatservertoolchoice.md rename docs/models/{operations/sendchatcompletionrequestresponsebody.md => components/chatstreamingresponse.md} (97%) create mode 100644 docs/models/components/citation.md create mode 100644 docs/models/components/cleartoolinputs.md create mode 100644 docs/models/components/compactionitem.md create mode 100644 docs/models/components/compactionitemtype.md create mode 100644 docs/models/components/containerautoenvironment.md create mode 100644 docs/models/components/containerautoenvironmenttype.md create mode 100644 docs/models/components/containerreferenceenvironment.md create mode 100644 docs/models/components/containerreferenceenvironmenttype.md create mode 100644 docs/models/components/contentcompaction.md create mode 100644 docs/models/components/contentfilteraction.md create mode 100644 docs/models/components/contentfilterbuiltinaction.md create mode 100644 docs/models/components/contentfilterbuiltinentry.md create mode 100644 docs/models/components/contentfilterbuiltinentryinput.md create mode 100644 docs/models/components/contentfilterbuiltinslug.md create mode 100644 docs/models/components/contentfilterentry.md create mode 100644 docs/models/components/contentpartaudio.md create mode 100644 docs/models/components/contentpartaudiotype.md create mode 100644 docs/models/components/contentpartinputaudio.md create mode 100644 docs/models/components/contentpartinputaudiotype.md create mode 100644 docs/models/components/contentpartinputfile.md create mode 100644 docs/models/components/contentpartinputfiletype.md create mode 100644 docs/models/components/contentpartinputvideo.md create mode 100644 docs/models/components/contentpartinputvideotype.md create mode 100644 docs/models/components/contentpartvideo.md create mode 100644 docs/models/components/contentpartvideotype.md create mode 100644 docs/models/components/contentredactedthinking.md create mode 100644 docs/models/components/contentservertooluse.md create mode 100644 docs/models/components/contentthinking.md create mode 100644 docs/models/components/contenttoolreference.md create mode 100644 docs/models/components/contenttoolresult.md create mode 100644 docs/models/components/contenttooluse.md create mode 100644 docs/models/components/contentwebsearchtoolresult.md create mode 100644 docs/models/components/contentwebsearchtoolresulterror.md create mode 100644 docs/models/components/contextmanagement.md create mode 100644 docs/models/components/contradiction.md create mode 100644 docs/models/components/createbyokkeyrequest.md create mode 100644 docs/models/components/createbyokkeyresponse.md create mode 100644 docs/models/components/createobservabilitydestinationrequest.md create mode 100644 docs/models/components/createobservabilitydestinationrequesttype.md create mode 100644 docs/models/components/createobservabilitydestinationresponse.md create mode 100644 docs/models/components/createpresetfrominferenceresponse.md create mode 100644 docs/models/components/customtoolcallinputdeltaevent.md create mode 100644 docs/models/components/customtoolcallinputdeltaeventtype.md create mode 100644 docs/models/components/customtoolcallinputdoneevent.md create mode 100644 docs/models/components/customtoolcallinputdoneeventtype.md create mode 100644 docs/models/components/customtoolcallitem.md create mode 100644 docs/models/components/customtoolcallitemtype.md create mode 100644 docs/models/components/customtoolcalloutputitem.md create mode 100644 docs/models/components/customtoolcalloutputitemdetail.md create mode 100644 docs/models/components/customtoolcalloutputitemoutputinputimage.md create mode 100644 docs/models/components/customtoolcalloutputitemoutputunion1.md create mode 100644 docs/models/components/customtoolcalloutputitemoutputunion2.md create mode 100644 docs/models/components/customtoolcalloutputitemtypecustomtoolcalloutput.md create mode 100644 docs/models/components/customtoolcalloutputitemtypeinputimage.md create mode 100644 docs/models/components/customtooltypecustom.md create mode 100644 docs/models/components/dabenchmarkentry.md create mode 100644 docs/models/components/dataregion.md create mode 100644 docs/models/components/deletebyokkeyresponse.md create mode 100644 docs/models/components/deleteobservabilitydestinationresponse.md delete mode 100644 docs/models/components/easyinputmessagecontenttype.md create mode 100644 docs/models/components/easyinputmessagetypeinputimage.md create mode 100644 docs/models/components/edit.md create mode 100644 docs/models/components/editclearthinking20251015.md create mode 100644 docs/models/components/editcleartooluses20250919.md create mode 100644 docs/models/components/editcompact20260112.md create mode 100644 docs/models/components/edittypeinputtokens.md delete mode 100644 docs/models/components/effort.md create mode 100644 docs/models/components/elobounds.md create mode 100644 docs/models/components/endpointinfo.md create mode 100644 docs/models/components/endpointsmetadata.md create mode 100644 docs/models/components/errorcode.md create mode 100644 docs/models/components/failedmodel.md create mode 100644 docs/models/components/field.md create mode 100644 docs/models/components/filedeleteresponse.md create mode 100644 docs/models/components/filedeleteresponsetype.md create mode 100644 docs/models/components/filelistresponse.md create mode 100644 docs/models/components/filemetadata.md create mode 100644 docs/models/components/filemetadatatype.md create mode 100644 docs/models/components/filesearchservertoolvalue1.md create mode 100644 docs/models/components/filesearchservertoolvalue2.md create mode 100644 docs/models/components/functioncalloutputitemoutputinputimage.md create mode 100644 docs/models/components/functioncalloutputitemtypeinputimage.md create mode 100644 docs/models/components/fusionanalysisresult.md create mode 100644 docs/models/components/fusioncallanalysiscompletedevent.md create mode 100644 docs/models/components/fusioncallanalysiscompletedeventtype.md create mode 100644 docs/models/components/fusioncallanalysisinprogressevent.md create mode 100644 docs/models/components/fusioncallanalysisinprogresseventtype.md create mode 100644 docs/models/components/fusioncallcompletedevent.md create mode 100644 docs/models/components/fusioncallcompletedeventtype.md create mode 100644 docs/models/components/fusioncallinprogressevent.md create mode 100644 docs/models/components/fusioncallinprogresseventtype.md create mode 100644 docs/models/components/fusioncallpaneladdedevent.md create mode 100644 docs/models/components/fusioncallpaneladdedeventtype.md create mode 100644 docs/models/components/fusioncallpanelcompletedevent.md create mode 100644 docs/models/components/fusioncallpanelcompletedeventtype.md create mode 100644 docs/models/components/fusioncallpaneldeltaevent.md create mode 100644 docs/models/components/fusioncallpaneldeltaeventtype.md create mode 100644 docs/models/components/fusioncallpanelfailedevent.md create mode 100644 docs/models/components/fusioncallpanelfailedeventtype.md create mode 100644 docs/models/components/fusioncallpanelreasoningdeltaevent.md create mode 100644 docs/models/components/fusioncallpanelreasoningdeltaeventtype.md create mode 100644 docs/models/components/fusionplugin.md create mode 100644 docs/models/components/fusionpluginid.md create mode 100644 docs/models/components/fusionplugintool.md create mode 100644 docs/models/components/fusionservertoolconfig.md create mode 100644 docs/models/components/fusionservertoolconfigeffort.md create mode 100644 docs/models/components/fusionservertoolconfigreasoning.md create mode 100644 docs/models/components/fusionservertoolconfigtool.md create mode 100644 docs/models/components/fusionservertoolopenrouter.md create mode 100644 docs/models/components/fusionservertoolopenroutertype.md create mode 100644 docs/models/components/getbyokkeyresponse.md create mode 100644 docs/models/components/getobservabilitydestinationresponse.md create mode 100644 docs/models/components/getpresetresponse.md create mode 100644 docs/models/components/getpresetversionresponse.md create mode 100644 docs/models/components/group.md create mode 100644 docs/models/components/inputmessageitemtypeinputimage.md create mode 100644 docs/models/components/inputreference.md create mode 100644 docs/models/components/inputschema.md create mode 100644 docs/models/components/itemreferenceitem.md create mode 100644 docs/models/components/itemreferenceitemtype.md create mode 100644 docs/models/components/keep.md create mode 100644 docs/models/components/keepall.md create mode 100644 docs/models/components/keepenum.md create mode 100644 docs/models/components/keeptype.md create mode 100644 docs/models/components/listbyokkeysresponse.md create mode 100644 docs/models/components/listobservabilitydestinationsresponse.md create mode 100644 docs/models/components/listpresetsresponse.md create mode 100644 docs/models/components/listpresetversionsresponse.md create mode 100644 docs/models/components/localshellcallitem.md create mode 100644 docs/models/components/localshellcallitemaction.md create mode 100644 docs/models/components/localshellcalloutputitem.md create mode 100644 docs/models/components/localshellcalloutputitemstatus.md create mode 100644 docs/models/components/localshellcalloutputitemtype.md create mode 100644 docs/models/components/logic.md create mode 100644 docs/models/components/mcpapprovalrequestitem.md create mode 100644 docs/models/components/mcpapprovalrequestitemtype.md create mode 100644 docs/models/components/mcpapprovalresponseitem.md create mode 100644 docs/models/components/mcpapprovalresponseitemtype.md create mode 100644 docs/models/components/mcpcallitem.md create mode 100644 docs/models/components/mcpcallitemtype.md create mode 100644 docs/models/components/mcplisttoolsitem.md create mode 100644 docs/models/components/mcplisttoolsitemtool.md create mode 100644 docs/models/components/mcplisttoolsitemtype.md create mode 100644 docs/models/components/messagesadvisortoolresultblock.md create mode 100644 docs/models/components/messagesadvisortoolresultblocktype.md create mode 100644 docs/models/components/messagesfallbackparam.md create mode 100644 docs/models/components/messagesmessageparam.md create mode 100644 docs/models/components/messagesmessageparamcontentunion1.md create mode 100644 docs/models/components/messagesmessageparamcontentunion2.md create mode 100644 docs/models/components/messagesmessageparamcontentunion3.md create mode 100644 docs/models/components/messagesmessageparamcontentunion4.md create mode 100644 docs/models/components/messagesmessageparamcontentunion5.md create mode 100644 docs/models/components/messagesmessageparamrole.md create mode 100644 docs/models/components/messagesmessageparamtypecompaction.md create mode 100644 docs/models/components/messagesoutputconfig.md create mode 100644 docs/models/components/messagesoutputconfigeffort.md create mode 100644 docs/models/components/messagesoutputconfigformat.md create mode 100644 docs/models/components/messagesoutputconfigtypejsonschema.md create mode 100644 docs/models/components/messagesrequest.md create mode 100644 docs/models/components/messagesrequestplugin.md create mode 100644 docs/models/components/messagesrequesttool.md create mode 100644 docs/models/components/messagesrequesttoolunion.md create mode 100644 docs/models/components/metadata.md create mode 100644 docs/models/components/metadatalevel.md create mode 100644 docs/models/components/method.md create mode 100644 docs/models/components/modelbenchmarks.md create mode 100644 docs/models/components/modelresponse.md create mode 100644 docs/models/components/multimodalmedia.md create mode 100644 docs/models/components/nameadvisor.md create mode 100644 docs/models/components/namebash.md create mode 100644 docs/models/components/namestrreplaceeditor.md create mode 100644 docs/models/components/namewebsearch1.md create mode 100644 docs/models/components/namewebsearch2.md create mode 100644 docs/models/components/observabilityarizedestination.md create mode 100644 docs/models/components/observabilityarizedestinationconfig.md create mode 100644 docs/models/components/observabilityarizedestinationtype.md create mode 100644 docs/models/components/observabilitybraintrustdestination.md create mode 100644 docs/models/components/observabilitybraintrustdestinationconfig.md create mode 100644 docs/models/components/observabilitybraintrustdestinationtype.md create mode 100644 docs/models/components/observabilityclickhousedestination.md create mode 100644 docs/models/components/observabilityclickhousedestinationconfig.md create mode 100644 docs/models/components/observabilityclickhousedestinationtype.md create mode 100644 docs/models/components/observabilitydatadogdestination.md create mode 100644 docs/models/components/observabilitydatadogdestinationconfig.md create mode 100644 docs/models/components/observabilitydatadogdestinationtype.md create mode 100644 docs/models/components/observabilitydestination.md create mode 100644 docs/models/components/observabilityfilterrulesconfig.md create mode 100644 docs/models/components/observabilityfilterrulesconfigvalue.md create mode 100644 docs/models/components/observabilitygrafanadestination.md create mode 100644 docs/models/components/observabilitygrafanadestinationconfig.md create mode 100644 docs/models/components/observabilitygrafanadestinationtype.md create mode 100644 docs/models/components/observabilitylangfusedestination.md create mode 100644 docs/models/components/observabilitylangfusedestinationconfig.md create mode 100644 docs/models/components/observabilitylangfusedestinationtype.md create mode 100644 docs/models/components/observabilitylangsmithdestination.md create mode 100644 docs/models/components/observabilitylangsmithdestinationconfig.md create mode 100644 docs/models/components/observabilitylangsmithdestinationtype.md create mode 100644 docs/models/components/observabilitynewrelicdestination.md create mode 100644 docs/models/components/observabilitynewrelicdestinationconfig.md create mode 100644 docs/models/components/observabilitynewrelicdestinationtype.md create mode 100644 docs/models/components/observabilityopikdestination.md create mode 100644 docs/models/components/observabilityopikdestinationconfig.md create mode 100644 docs/models/components/observabilityopikdestinationtype.md create mode 100644 docs/models/components/observabilityotelcollectordestination.md create mode 100644 docs/models/components/observabilityotelcollectordestinationconfig.md create mode 100644 docs/models/components/observabilityotelcollectordestinationtype.md create mode 100644 docs/models/components/observabilityposthogdestination.md create mode 100644 docs/models/components/observabilityposthogdestinationconfig.md create mode 100644 docs/models/components/observabilityposthogdestinationtype.md create mode 100644 docs/models/components/observabilityrampdestination.md create mode 100644 docs/models/components/observabilityrampdestinationconfig.md create mode 100644 docs/models/components/observabilityrampdestinationtype.md create mode 100644 docs/models/components/observabilitys3destination.md create mode 100644 docs/models/components/observabilitys3destinationconfig.md create mode 100644 docs/models/components/observabilitys3destinationtype.md create mode 100644 docs/models/components/observabilitysentrydestination.md create mode 100644 docs/models/components/observabilitysentrydestinationconfig.md create mode 100644 docs/models/components/observabilitysentrydestinationtype.md create mode 100644 docs/models/components/observabilitysnowflakedestination.md create mode 100644 docs/models/components/observabilitysnowflakedestinationconfig.md create mode 100644 docs/models/components/observabilitysnowflakedestinationtype.md create mode 100644 docs/models/components/observabilityweavedestination.md create mode 100644 docs/models/components/observabilityweavedestinationconfig.md create mode 100644 docs/models/components/observabilityweavedestinationtype.md create mode 100644 docs/models/components/observabilitywebhookdestination.md create mode 100644 docs/models/components/observabilitywebhookdestinationconfig.md create mode 100644 docs/models/components/observabilitywebhookdestinationtype.md create mode 100644 docs/models/components/openairesponsecustomtoolcall.md create mode 100644 docs/models/components/openairesponsecustomtoolcalloutput.md create mode 100644 docs/models/components/openairesponsecustomtoolcalloutputoutput1.md create mode 100644 docs/models/components/openairesponsecustomtoolcalloutputoutput2.md create mode 100644 docs/models/components/openairesponsecustomtoolcalloutputtype.md create mode 100644 docs/models/components/openairesponsecustomtoolcalltype.md create mode 100644 docs/models/components/openairesponsestoolchoiceapplypatch.md create mode 100644 docs/models/components/openairesponsestoolchoiceshell.md create mode 100644 docs/models/components/openairesponsestoolchoicetypeapplypatch.md create mode 100644 docs/models/components/openairesponsestoolchoicetypeshell.md create mode 100644 docs/models/components/openroutermetadata.md create mode 100644 docs/models/components/operator.md rename docs/models/components/{speechrequestoptions.md => optionsobj.md} (93%) create mode 100644 docs/models/components/outcome.md create mode 100644 docs/models/components/outcomeexit.md create mode 100644 docs/models/components/outcometimeout.md create mode 100644 docs/models/components/outputadvisorservertoolitem.md create mode 100644 docs/models/components/outputadvisorservertoolitemtype.md create mode 100644 docs/models/components/outputapplypatchcallitem.md create mode 100644 docs/models/components/outputapplypatchcallitemtype.md create mode 100644 docs/models/components/outputcodeinterpretercallitemtypeimage.md create mode 100644 docs/models/components/outputcustomtoolcallitem.md create mode 100644 docs/models/components/outputcustomtoolcallitemtype.md create mode 100644 docs/models/components/outputfusionservertoolitem.md create mode 100644 docs/models/components/outputfusionservertoolitemtype.md delete mode 100644 docs/models/components/outputinputimage.md create mode 100644 docs/models/components/outputshellcallitem.md create mode 100644 docs/models/components/outputshellcallitemaction.md create mode 100644 docs/models/components/outputshellcallitemtype.md create mode 100644 docs/models/components/outputshellcalloutputitem.md create mode 100644 docs/models/components/outputshellcalloutputitemoutput.md create mode 100644 docs/models/components/outputshellcalloutputitemtypeshellcalloutput.md create mode 100644 docs/models/components/outputsubagentservertoolitem.md create mode 100644 docs/models/components/outputsubagentservertoolitemtype.md rename docs/models/components/{actionsearch.md => outputwebsearchcallitemactionsearch.md} (91%) create mode 100644 docs/models/components/outputwebsearchservertoolitemaction.md create mode 100644 docs/models/components/outputwebsearchservertoolitemsource.md create mode 100644 docs/models/components/outputwebsearchservertoolitemtypeopenrouterwebsearch.md create mode 100644 docs/models/components/outputwebsearchservertoolitemtypesearch.md create mode 100644 docs/models/components/outputwebsearchservertoolitemtypeurl.md delete mode 100644 docs/models/components/parameters.md create mode 100644 docs/models/components/partialcoverage.md create mode 100644 docs/models/components/pipelinestage.md create mode 100644 docs/models/components/pipelinestagetype.md create mode 100644 docs/models/components/preset.md create mode 100644 docs/models/components/presetdesignatedversion.md create mode 100644 docs/models/components/presetstatus.md create mode 100644 docs/models/components/presetwithdesignatedversion.md create mode 100644 docs/models/components/promptinjectionscanscope.md rename docs/models/components/{videogenerationrequestoptions.md => provideroptions.md} (93%) create mode 100644 docs/models/components/rankingsdailyitem.md create mode 100644 docs/models/components/rankingsdailymeta.md create mode 100644 docs/models/components/rankingsdailymetaversion.md create mode 100644 docs/models/components/rankingsdailyresponse.md create mode 100644 docs/models/components/region.md create mode 100644 docs/models/components/response.md rename docs/models/{operations/createresponsesresponsebody.md => components/responsesstreamingresponse.md} (99%) create mode 100644 docs/models/components/routerattempt.md create mode 100644 docs/models/components/routerparams.md create mode 100644 docs/models/components/routingstrategy.md create mode 100644 docs/models/components/rule.md create mode 100644 docs/models/components/shellcallitem.md create mode 100644 docs/models/components/shellcallitemaction.md create mode 100644 docs/models/components/shellcallitemstatus.md create mode 100644 docs/models/components/shellcallitemtype.md create mode 100644 docs/models/components/shellcalloutputitem.md create mode 100644 docs/models/components/shellcalloutputitemoutput.md create mode 100644 docs/models/components/shellcalloutputitemstatus.md create mode 100644 docs/models/components/shellcalloutputitemtype.md create mode 100644 docs/models/components/shellcallstatus.md create mode 100644 docs/models/components/shellservertoolconfig.md create mode 100644 docs/models/components/shellservertoolengine.md create mode 100644 docs/models/components/shellservertoolenvironment.md create mode 100644 docs/models/components/shellservertoolopenrouter.md create mode 100644 docs/models/components/shellservertoolopenroutertype.md create mode 100644 docs/models/components/sourcecontent.md create mode 100644 docs/models/components/sourcetype.md create mode 100644 docs/models/components/speed.md create mode 100644 docs/models/components/stance.md create mode 100644 docs/models/components/stopservertoolswhencondition.md create mode 100644 docs/models/components/stopservertoolswhenfinishreasonis.md create mode 100644 docs/models/components/stopservertoolswhenfinishreasonistype.md create mode 100644 docs/models/components/stopservertoolswhenhastoolcall.md create mode 100644 docs/models/components/stopservertoolswhenhastoolcalltype.md create mode 100644 docs/models/components/stopservertoolswhenmaxcost.md rename docs/models/components/{inputmessageitemcontenttype.md => stopservertoolswhenmaxcosttype.md} (66%) create mode 100644 docs/models/components/stopservertoolswhenmaxtokensused.md create mode 100644 docs/models/components/stopservertoolswhenmaxtokensusedtype.md create mode 100644 docs/models/components/stopservertoolswhenstepcountis.md create mode 100644 docs/models/components/stopservertoolswhenstepcountistype.md create mode 100644 docs/models/components/sttinputaudio.md create mode 100644 docs/models/components/sttrequest.md create mode 100644 docs/models/components/sttrequestprovider.md create mode 100644 docs/models/components/sttresponse.md create mode 100644 docs/models/components/sttusage.md create mode 100644 docs/models/components/subagentnestedtool.md create mode 100644 docs/models/components/subagentreasoning.md create mode 100644 docs/models/components/subagentreasoningeffort.md create mode 100644 docs/models/components/subagentservertoolconfig.md create mode 100644 docs/models/components/subagentservertoolopenrouter.md create mode 100644 docs/models/components/subagentservertoolopenroutertype.md create mode 100644 docs/models/components/system.md create mode 100644 docs/models/components/taskbudget.md create mode 100644 docs/models/components/thinking.md create mode 100644 docs/models/components/thinkingadaptive.md create mode 100644 docs/models/components/thinkingdisabled.md create mode 100644 docs/models/components/thinkingenabled.md create mode 100644 docs/models/components/tooladvisor20260301.md create mode 100644 docs/models/components/toolbash20250124.md create mode 100644 docs/models/components/toolchoice.md create mode 100644 docs/models/components/toolchoiceany.md create mode 100644 docs/models/components/toolchoiceauto.md create mode 100644 docs/models/components/toolchoicenone.md create mode 100644 docs/models/components/toolchoicetool.md create mode 100644 docs/models/components/toolchoicetypeauto.md create mode 100644 docs/models/components/toolcustom.md create mode 100644 docs/models/components/tooltexteditor20250124.md create mode 100644 docs/models/components/tooltypecustom.md create mode 100644 docs/models/components/tooltypeephemeral.md create mode 100644 docs/models/components/toolwebsearch20250305.md create mode 100644 docs/models/components/toolwebsearch20260209.md create mode 100644 docs/models/components/tournamentstats.md create mode 100644 docs/models/components/trigger.md create mode 100644 docs/models/components/triggerinputtokens.md create mode 100644 docs/models/components/typeadaptive.md create mode 100644 docs/models/components/typeadvisor20260301.md create mode 100644 docs/models/components/typeany.md create mode 100644 docs/models/components/typebash20250124.md create mode 100644 docs/models/components/typeclearthinking20251015.md create mode 100644 docs/models/components/typecleartooluses20250919.md create mode 100644 docs/models/components/typecompact20260112.md delete mode 100644 docs/models/components/typecustom.md create mode 100644 docs/models/components/typedisabled.md create mode 100644 docs/models/components/typedocument.md create mode 100644 docs/models/components/typeenabled.md create mode 100644 docs/models/components/typeexec.md create mode 100644 docs/models/components/typeexit.md delete mode 100644 docs/models/components/typeimage.md create mode 100644 docs/models/components/typelocalshellcall.md create mode 100644 docs/models/components/typenone.md create mode 100644 docs/models/components/typeredactedthinking.md create mode 100644 docs/models/components/typeservertooluse.md create mode 100644 docs/models/components/typetexteditor20250124.md create mode 100644 docs/models/components/typethinking.md create mode 100644 docs/models/components/typetimeout.md rename docs/models/components/{typesearch.md => typetokens.md} (67%) create mode 100644 docs/models/components/typetool.md create mode 100644 docs/models/components/typetoolreference.md create mode 100644 docs/models/components/typetoolresult.md create mode 100644 docs/models/components/typetooluse.md create mode 100644 docs/models/components/typewebsearch20250305.md create mode 100644 docs/models/components/typewebsearch20260209.md create mode 100644 docs/models/components/typewebsearchtoolresult.md rename docs/models/components/{outputwebsearchservertoolitemtype.md => typewebsearchtoolresulterror.md} (60%) create mode 100644 docs/models/components/uniqueinsight.md create mode 100644 docs/models/components/updatebyokkeyrequest.md create mode 100644 docs/models/components/updatebyokkeyresponse.md create mode 100644 docs/models/components/updateobservabilitydestinationrequest.md create mode 100644 docs/models/components/updateobservabilitydestinationresponse.md create mode 100644 docs/models/components/usagecostdetails.md create mode 100644 docs/models/components/userlocation.md delete mode 100644 docs/models/components/value1.md delete mode 100644 docs/models/components/value2.md create mode 100644 docs/models/components/videourl.md create mode 100644 docs/models/components/webfetchengineenum.md create mode 100644 docs/models/components/webfetchplugin.md create mode 100644 docs/models/components/webfetchpluginid.md create mode 100644 docs/models/components/webfetchservertool.md create mode 100644 docs/models/components/webfetchservertoolconfig.md create mode 100644 docs/models/components/webfetchservertooltype.md create mode 100644 docs/models/components/websearchplugintype.md create mode 100644 docs/models/components/websearchservertoolconfig.md create mode 100644 docs/models/operations/arena.md delete mode 100644 docs/models/operations/category.md create mode 100644 docs/models/operations/createpresetschatcompletionsrequest.md create mode 100644 docs/models/operations/createpresetsmessagesrequest.md create mode 100644 docs/models/operations/createpresetsresponsesrequest.md create mode 100644 docs/models/operations/createresponsesrequest.md create mode 100644 docs/models/operations/deletebyokkeyrequest.md create mode 100644 docs/models/operations/deletefilerequest.md create mode 100644 docs/models/operations/deleteobservabilitydestinationrequest.md create mode 100644 docs/models/operations/dimension.md create mode 100644 docs/models/operations/direction.md create mode 100644 docs/models/operations/displayformat.md create mode 100644 docs/models/operations/distillable.md create mode 100644 docs/models/operations/documentrequest.md create mode 100644 docs/models/operations/documentresponse.md create mode 100644 docs/models/operations/downloadfilecontentrequest.md create mode 100644 docs/models/operations/file.md create mode 100644 docs/models/operations/filter.md create mode 100644 docs/models/operations/getanalyticsmetadata.md create mode 100644 docs/models/operations/getanalyticsmetaresponse.md create mode 100644 docs/models/operations/getapprankingscategory.md create mode 100644 docs/models/operations/getapprankingsrequest.md create mode 100644 docs/models/operations/getapprankingsresponse.md create mode 100644 docs/models/operations/getapprankingssort.md create mode 100644 docs/models/operations/getbenchmarksartificialanalysisrequest.md create mode 100644 docs/models/operations/getbenchmarksdesignarenarequest.md create mode 100644 docs/models/operations/getbyokkeyrequest.md create mode 100644 docs/models/operations/getfilemetadatarequest.md create mode 100644 docs/models/operations/getmodelrequest.md create mode 100644 docs/models/operations/getmodelscategory.md create mode 100644 docs/models/operations/getmodelssort.md create mode 100644 docs/models/operations/getobservabilitydestinationrequest.md create mode 100644 docs/models/operations/getpresetrequest.md create mode 100644 docs/models/operations/getpresetversionrequest.md create mode 100644 docs/models/operations/getrankingsdailyrequest.md create mode 100644 docs/models/operations/granularity.md create mode 100644 docs/models/operations/granularityname.md create mode 100644 docs/models/operations/listbyokkeysrequest.md create mode 100644 docs/models/operations/listbyokkeysresponse.md create mode 100644 docs/models/operations/listfilesrequest.md create mode 100644 docs/models/operations/listfilesresponse.md create mode 100644 docs/models/operations/listobservabilitydestinationsrequest.md create mode 100644 docs/models/operations/listobservabilitydestinationsresponse.md create mode 100644 docs/models/operations/listpresetsrequest.md create mode 100644 docs/models/operations/listpresetsresponse.md create mode 100644 docs/models/operations/listpresetversionsrequest.md create mode 100644 docs/models/operations/listpresetversionsresponse.md create mode 100644 docs/models/operations/metadata.md create mode 100644 docs/models/operations/metric.md create mode 100644 docs/models/operations/operator.md create mode 100644 docs/models/operations/operatorname.md create mode 100644 docs/models/operations/orderby.md create mode 100644 docs/models/operations/provider.md create mode 100644 docs/models/operations/queryanalyticsdata1.md create mode 100644 docs/models/operations/queryanalyticsdata2.md create mode 100644 docs/models/operations/queryanalyticsrequest.md create mode 100644 docs/models/operations/queryanalyticsresponse.md create mode 100644 docs/models/operations/region.md create mode 100644 docs/models/operations/sendchatcompletionrequestrequest.md create mode 100644 docs/models/operations/subcategory.md create mode 100644 docs/models/operations/timerange.md create mode 100644 docs/models/operations/updatebyokkeyrequest.md create mode 100644 docs/models/operations/updateobservabilitydestinationrequest.md create mode 100644 docs/models/operations/uploadfilerequest.md create mode 100644 docs/models/operations/uploadfilerequestbody.md create mode 100644 docs/models/operations/value1.md create mode 100644 docs/models/operations/value2.md create mode 100644 docs/models/operations/valuetype.md create mode 100644 docs/models/operations/zdr.md create mode 100644 docs/sdks/betaanalytics/README.md create mode 100644 docs/sdks/byok/README.md create mode 100644 docs/sdks/datasets/README.md create mode 100644 docs/sdks/files/README.md create mode 100644 docs/sdks/observability/README.md create mode 100644 docs/sdks/presets/README.md create mode 100644 docs/sdks/stt/README.md create mode 100644 files.go create mode 100644 models/components/aabenchmarkentry.go create mode 100644 models/components/advisornestedtool.go create mode 100644 models/components/advisorreasoning.go create mode 100644 models/components/advisorservertoolconfig.go create mode 100644 models/components/advisorservertoolopenrouter.go create mode 100644 models/components/anthropicallowedcallers.go create mode 100644 models/components/anthropicbase64imagesource.go create mode 100644 models/components/anthropicbase64pdfsource.go create mode 100644 models/components/anthropiccitationcharlocationparam.go create mode 100644 models/components/anthropiccitationcontentblocklocationparam.go create mode 100644 models/components/anthropiccitationpagelocationparam.go create mode 100644 models/components/anthropiccitationsearchresultlocation.go create mode 100644 models/components/anthropiccitationwebsearchresultlocation.go create mode 100644 models/components/anthropicdocumentblockparam.go create mode 100644 models/components/anthropicimageblockparam.go create mode 100644 models/components/anthropicimagemimetype.go create mode 100644 models/components/anthropicinputtokensclearatleast.go create mode 100644 models/components/anthropicinputtokenstrigger.go create mode 100644 models/components/anthropicplaintextsource.go create mode 100644 models/components/anthropicsearchresultblockparam.go create mode 100644 models/components/anthropictextblockparam.go create mode 100644 models/components/anthropicthinkingdisplay.go create mode 100644 models/components/anthropicthinkingturns.go create mode 100644 models/components/anthropictooluseskeep.go create mode 100644 models/components/anthropictoolusestrigger.go create mode 100644 models/components/anthropicurlimagesource.go create mode 100644 models/components/anthropicurlpdfsource.go create mode 100644 models/components/anthropicwebsearchresultblockparam.go create mode 100644 models/components/anthropicwebsearchtooluserlocation.go create mode 100644 models/components/applypatchcallitem.go create mode 100644 models/components/applypatchcalloperation.go create mode 100644 models/components/applypatchcalloperationdiffdeltaevent.go create mode 100644 models/components/applypatchcalloperationdiffdoneevent.go create mode 100644 models/components/applypatchcalloutputitem.go create mode 100644 models/components/applypatchcallstatus.go create mode 100644 models/components/applypatchcreatefileoperation.go create mode 100644 models/components/applypatchdeletefileoperation.go create mode 100644 models/components/applypatchengineenum.go create mode 100644 models/components/applypatchservertoolconfig.go create mode 100644 models/components/applypatchservertoolopenrouter.go create mode 100644 models/components/applypatchupdatefileoperation.go create mode 100644 models/components/apprankingsitem.go create mode 100644 models/components/apprankingsresponse.go create mode 100644 models/components/bashservertool.go create mode 100644 models/components/bashservertoolconfig.go create mode 100644 models/components/bashservertoolengine.go create mode 100644 models/components/bashservertoolenvironment.go create mode 100644 models/components/benchmarkpricing.go create mode 100644 models/components/benchmarksaaitem.go create mode 100644 models/components/benchmarksaameta.go create mode 100644 models/components/benchmarksaaresponse.go create mode 100644 models/components/benchmarksdaitem.go create mode 100644 models/components/benchmarksdameta.go create mode 100644 models/components/benchmarksdaresponse.go create mode 100644 models/components/byokkey.go create mode 100644 models/components/byokproviderslug.go create mode 100644 models/components/chatservertoolchoice.go create mode 100644 models/components/chatstreamingresponse.go create mode 100644 models/components/compactionitem.go create mode 100644 models/components/containerautoenvironment.go create mode 100644 models/components/containerreferenceenvironment.go create mode 100644 models/components/contentfilteraction.go create mode 100644 models/components/contentfilterbuiltinaction.go create mode 100644 models/components/contentfilterbuiltinentry.go create mode 100644 models/components/contentfilterbuiltinentryinput.go create mode 100644 models/components/contentfilterbuiltinslug.go create mode 100644 models/components/contentfilterentry.go create mode 100644 models/components/contentpartaudio.go create mode 100644 models/components/contentpartinputaudio.go create mode 100644 models/components/contentpartinputfile.go create mode 100644 models/components/contentpartinputvideo.go create mode 100644 models/components/contentpartvideo.go create mode 100644 models/components/costdetails.go create mode 100644 models/components/createbyokkeyrequest.go create mode 100644 models/components/createbyokkeyresponse.go create mode 100644 models/components/createobservabilitydestinationrequest.go create mode 100644 models/components/createobservabilitydestinationresponse.go create mode 100644 models/components/createpresetfrominferenceresponse.go create mode 100644 models/components/customtoolcallinputdeltaevent.go create mode 100644 models/components/customtoolcallinputdoneevent.go create mode 100644 models/components/customtoolcallitem.go create mode 100644 models/components/customtoolcalloutputitem.go create mode 100644 models/components/dabenchmarkentry.go create mode 100644 models/components/deletebyokkeyresponse.go create mode 100644 models/components/deleteobservabilitydestinationresponse.go create mode 100644 models/components/endpointinfo.go create mode 100644 models/components/endpointsmetadata.go create mode 100644 models/components/filedeleteresponse.go create mode 100644 models/components/filelistresponse.go create mode 100644 models/components/filemetadata.go create mode 100644 models/components/fusionanalysisresult.go create mode 100644 models/components/fusioncallanalysiscompletedevent.go create mode 100644 models/components/fusioncallanalysisinprogressevent.go create mode 100644 models/components/fusioncallcompletedevent.go create mode 100644 models/components/fusioncallinprogressevent.go create mode 100644 models/components/fusioncallpaneladdedevent.go create mode 100644 models/components/fusioncallpanelcompletedevent.go create mode 100644 models/components/fusioncallpaneldeltaevent.go create mode 100644 models/components/fusioncallpanelfailedevent.go create mode 100644 models/components/fusioncallpanelreasoningdeltaevent.go create mode 100644 models/components/fusionplugin.go create mode 100644 models/components/fusionservertoolconfig.go create mode 100644 models/components/fusionservertoolopenrouter.go create mode 100644 models/components/getbyokkeyresponse.go create mode 100644 models/components/getobservabilitydestinationresponse.go create mode 100644 models/components/getpresetresponse.go create mode 100644 models/components/getpresetversionresponse.go create mode 100644 models/components/inputreference.go create mode 100644 models/components/itemreferenceitem.go create mode 100644 models/components/listbyokkeysresponse.go create mode 100644 models/components/listobservabilitydestinationsresponse.go create mode 100644 models/components/listpresetsresponse.go create mode 100644 models/components/listpresetversionsresponse.go create mode 100644 models/components/localshellcallitem.go create mode 100644 models/components/localshellcalloutputitem.go create mode 100644 models/components/mcpapprovalrequestitem.go create mode 100644 models/components/mcpapprovalresponseitem.go create mode 100644 models/components/mcpcallitem.go create mode 100644 models/components/mcplisttoolsitem.go create mode 100644 models/components/messagesadvisortoolresultblock.go create mode 100644 models/components/messagesfallbackparam.go create mode 100644 models/components/messagesmessageparam.go create mode 100644 models/components/messagesoutputconfig.go create mode 100644 models/components/messagesrequest.go create mode 100644 models/components/metadatalevel.go create mode 100644 models/components/modelbenchmarks.go create mode 100644 models/components/modelresponse.go create mode 100644 models/components/multimodalmedia.go create mode 100644 models/components/observabilityarizedestination.go create mode 100644 models/components/observabilitybraintrustdestination.go create mode 100644 models/components/observabilityclickhousedestination.go create mode 100644 models/components/observabilitydatadogdestination.go create mode 100644 models/components/observabilitydestination.go create mode 100644 models/components/observabilityfilterrulesconfig.go create mode 100644 models/components/observabilitygrafanadestination.go create mode 100644 models/components/observabilitylangfusedestination.go create mode 100644 models/components/observabilitylangsmithdestination.go create mode 100644 models/components/observabilitynewrelicdestination.go create mode 100644 models/components/observabilityopikdestination.go create mode 100644 models/components/observabilityotelcollectordestination.go create mode 100644 models/components/observabilityposthogdestination.go create mode 100644 models/components/observabilityrampdestination.go create mode 100644 models/components/observabilitys3destination.go create mode 100644 models/components/observabilitysentrydestination.go create mode 100644 models/components/observabilitysnowflakedestination.go create mode 100644 models/components/observabilityweavedestination.go create mode 100644 models/components/observabilitywebhookdestination.go create mode 100644 models/components/openairesponsecustomtoolcall.go create mode 100644 models/components/openairesponsecustomtoolcalloutput.go create mode 100644 models/components/openroutermetadata.go create mode 100644 models/components/outputadvisorservertoolitem.go create mode 100644 models/components/outputapplypatchcallitem.go create mode 100644 models/components/outputcustomtoolcallitem.go create mode 100644 models/components/outputfusionservertoolitem.go create mode 100644 models/components/outputshellcallitem.go create mode 100644 models/components/outputshellcalloutputitem.go create mode 100644 models/components/outputsubagentservertoolitem.go create mode 100644 models/components/pipelinestage.go create mode 100644 models/components/pipelinestagetype.go create mode 100644 models/components/preset.go create mode 100644 models/components/presetdesignatedversion.go create mode 100644 models/components/presetstatus.go create mode 100644 models/components/presetwithdesignatedversion.go create mode 100644 models/components/promptinjectionscanscope.go create mode 100644 models/components/provideroptions.go create mode 100644 models/components/rankingsdailyitem.go create mode 100644 models/components/rankingsdailymeta.go create mode 100644 models/components/rankingsdailyresponse.go create mode 100644 models/components/responsesstreamingresponse.go create mode 100644 models/components/routerattempt.go create mode 100644 models/components/routerparams.go create mode 100644 models/components/routingstrategy.go create mode 100644 models/components/shellcallitem.go create mode 100644 models/components/shellcalloutputitem.go create mode 100644 models/components/shellcallstatus.go create mode 100644 models/components/shellservertoolconfig.go create mode 100644 models/components/shellservertoolengine.go create mode 100644 models/components/shellservertoolenvironment.go create mode 100644 models/components/shellservertoolopenrouter.go create mode 100644 models/components/stopservertoolswhencondition.go create mode 100644 models/components/stopservertoolswhenfinishreasonis.go create mode 100644 models/components/stopservertoolswhenhastoolcall.go create mode 100644 models/components/stopservertoolswhenmaxcost.go create mode 100644 models/components/stopservertoolswhenmaxtokensused.go create mode 100644 models/components/stopservertoolswhenstepcountis.go create mode 100644 models/components/sttinputaudio.go create mode 100644 models/components/sttrequest.go create mode 100644 models/components/sttresponse.go create mode 100644 models/components/sttusage.go create mode 100644 models/components/subagentnestedtool.go create mode 100644 models/components/subagentreasoning.go create mode 100644 models/components/subagentservertoolconfig.go create mode 100644 models/components/subagentservertoolopenrouter.go create mode 100644 models/components/updatebyokkeyrequest.go create mode 100644 models/components/updatebyokkeyresponse.go create mode 100644 models/components/updateobservabilitydestinationrequest.go create mode 100644 models/components/updateobservabilitydestinationresponse.go create mode 100644 models/components/webfetchengineenum.go create mode 100644 models/components/webfetchplugin.go create mode 100644 models/components/webfetchservertool.go create mode 100644 models/components/webfetchservertoolconfig.go create mode 100644 models/components/websearchservertoolconfig.go create mode 100644 models/operations/createpresetschatcompletions.go create mode 100644 models/operations/createpresetsmessages.go create mode 100644 models/operations/createpresetsresponses.go create mode 100644 models/operations/deletebyokkey.go create mode 100644 models/operations/deletefile.go create mode 100644 models/operations/deleteobservabilitydestination.go create mode 100644 models/operations/downloadfilecontent.go create mode 100644 models/operations/getanalyticsmeta.go create mode 100644 models/operations/getapprankings.go create mode 100644 models/operations/getbenchmarksartificialanalysis.go create mode 100644 models/operations/getbenchmarksdesignarena.go create mode 100644 models/operations/getbyokkey.go create mode 100644 models/operations/getfilemetadata.go create mode 100644 models/operations/getmodel.go create mode 100644 models/operations/getobservabilitydestination.go create mode 100644 models/operations/getpreset.go create mode 100644 models/operations/getpresetversion.go create mode 100644 models/operations/getrankingsdaily.go create mode 100644 models/operations/listbyokkeys.go create mode 100644 models/operations/listfiles.go create mode 100644 models/operations/listobservabilitydestinations.go create mode 100644 models/operations/listpresets.go create mode 100644 models/operations/listpresetversions.go create mode 100644 models/operations/queryanalytics.go create mode 100644 models/operations/updatebyokkey.go create mode 100644 models/operations/updateobservabilitydestination.go create mode 100644 models/operations/uploadfile.go create mode 100644 observability.go create mode 100644 presets.go create mode 100644 stt.go diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 92f5ba5b..8f01e56e 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ // README at: https://github.com/devcontainers/templates/tree/main/src/go { "name": "Go", - "image": "mcr.microsoft.com/devcontainers/go:1-1.22-bullseye", + "image": "mcr.microsoft.com/devcontainers/go:1-1.25-bookworm", // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, // Use 'forwardPorts' to make a list of ports inside the container available locally. diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 561a5977..e4d7d45e 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,25 +1,25 @@ lockVersion: 2.0.0 id: 9eea3e30-2722-4060-973b-57b7f1f75dc0 management: - docChecksum: 403b877988e788624fcb650ab73cf07f + docChecksum: 1e0c98a314677bc490998bdd8faf5b74 docVersion: 1.0.0 - speakeasyVersion: 1.761.1 - generationVersion: 2.879.6 - releaseVersion: 0.4.1 - configChecksum: 960db806dd06a9023145bc3afbc20663 + speakeasyVersion: 1.778.0 + generationVersion: 2.904.2 + releaseVersion: 0.5.0 + configChecksum: a8cd011d0fa84720f7c3504347addacc repoURL: https://github.com/OpenRouterTeam/go-sdk.git installationURL: https://github.com/OpenRouterTeam/go-sdk persistentEdits: - generation_id: 3d5eff3b-317f-4ef2-91f6-93f9ebf00de9 - pristine_commit_hash: 08580742d28051d2ae3849453daba2afb430b658 - pristine_tree_hash: 3ad0d5b73856c95d3041abe6e3c3eb7e975b13e7 + generation_id: 3f918785-6594-4da0-a699-a5dfef68cbd8 + pristine_commit_hash: 9864e3f0078cf81094ccebf5be4ff47dbe33f888 + pristine_tree_hash: 6cbe3f4d063e6fcbc8113e649924ac0a639b1e2b features: go: acceptHeaders: 2.81.2 additionalDependencies: 0.1.0 additionalProperties: 0.1.2 constsAndDefaults: 0.1.14 - core: 3.13.40 + core: 3.13.46 defaultEnabledRetries: 0.2.0 deprecations: 2.81.3 devContainers: 2.90.0 @@ -39,14 +39,15 @@ features: nameOverrides: 2.81.4 nullables: 0.2.1 openEnums: 0.1.0 - pagination: 2.82.6 + pagination: 2.82.7 responseFormat: 0.1.2 retries: 2.84.2 sdkHooks: 0.3.0 - serverEvents: 0.1.7 + serverEvents: 0.1.9 serverEventsSentinels: 0.1.0 serverIDs: 2.81.1 - unions: 2.87.6 + unions: 2.87.7 + uploadStreams: 0.1.0 trackedFiles: .devcontainer/README.md: id: b170c0f184ac @@ -54,8 +55,8 @@ trackedFiles: pristine_git_object: d910019d1e5caf9d9b00616bfd36adcf508ff5ab .devcontainer/devcontainer.json: id: b34062a34eb1 - last_write_checksum: sha1:a518b2fc2f92e998593a1dcb935db4ca1eb2e2f1 - pristine_git_object: 92f5ba5b54156225322fb4b09d2acf4abde9abc9 + last_write_checksum: sha1:00c39389eee01217e51057762bde7339d9e56114 + pristine_git_object: 8f01e56e2f8476fb2a7c79ec6326b3b0d5be8123 .devcontainer/setup.sh: id: 5f1dfbfeb8eb last_write_checksum: sha1:0443cc8beac352499afd25be90adf28d3736dbe0 @@ -70,28 +71,44 @@ trackedFiles: pristine_git_object: b5feedda6fc44f2f262a6355f91a7901023aaccb analytics.go: id: c71afdf2c49d - last_write_checksum: sha1:651ff7a592c338d32d01abe59b31ccf8be5e356a - pristine_git_object: 7f93a20ad266f7e186a2b9ca111374f817ccf2b8 + last_write_checksum: sha1:f9a7a59244b2189cba7845b1a53a673e2c7540f6 + pristine_git_object: 57da7c77186fbbf55dd87ae8acabcab09ae9cc5e apikeys.go: id: 8baafe5dc76e - last_write_checksum: sha1:d6951c59eb7c36dbed41840b5fe0ce617d468335 - pristine_git_object: b8731fd19a748fc9b7700491a2b3141459b35519 + last_write_checksum: sha1:2870a7e8e98b3455e8196fc7040d9cefa79d52fe + pristine_git_object: 8195bc8c518389e0932bc2d3a2edaffb7e036a39 beta.go: id: 812d10ba6460 - last_write_checksum: sha1:a4d30e09db79ca1f3db61cf3cdfd66dce2d77fa3 - pristine_git_object: cf3cf42761bcd152a0d845f6c6bf068c203eaebc + last_write_checksum: sha1:29a9869fb709d85d44a7e6b4042a99519ca12c51 + pristine_git_object: cb62d236fdbe9bcc88c2a32038292fe082c4c75d + betaanalytics.go: + id: 310965b88eac + last_write_checksum: sha1:32edeb7d8708727f9fe9b4e5943a0e14f3dde342 + pristine_git_object: c48c63a64ae8e6b213e79503e08b7610fc017b4d + byok.go: + id: 020bd36a4af9 + last_write_checksum: sha1:c5e242244e6ac68444caf8f4f264c83be4b55a6e + pristine_git_object: 9870c83f62d4cea61004cf65f25443581751c29d chat.go: id: 81535ccb3ff5 - last_write_checksum: sha1:85ea57e079a6a549abe8a24c92117f1470a61221 - pristine_git_object: 8a427a7663e99ba0d840cb8dc05f4e42b07f2ca6 + last_write_checksum: sha1:3fe05c99a2a3f927bac689dc6dd9f0e6c51bc7b3 + pristine_git_object: fedc9b46b5d2a7a4fc521b1af68b563cf4e116d8 credits.go: id: d01cfe328cc3 - last_write_checksum: sha1:2fdab75dc2594b3032df151c741adecc61d94a25 - pristine_git_object: 7d475479a46330287ef2ef3f7673cc14f70c1b7e + last_write_checksum: sha1:05f6c501b571df83b665e2272a621e502d1e252a + pristine_git_object: cf99d6c57d7afe7c115e688f51ebcf9622abfedf + datasets.go: + id: 12a7fa09afbc + last_write_checksum: sha1:6aa5253a92c477768f7a5de3bfcc011747493d08 + pristine_git_object: bc4993002ea7a1aa0f336836dcce7003130f96f7 + docs/models/components/aabenchmarkentry.md: + id: 01bb0baed40d + last_write_checksum: sha1:9bec3fc00cf1e5b5f3d1ff38c22e8e4a9a0f0512 + pristine_git_object: 9b9f206ffd19ce8bd32b51fba11b99cef0184113 docs/models/components/action.md: id: 4c3e678208a3 - last_write_checksum: sha1:28e849db6f97a8d66285456c23e123ddad0c884e - pristine_git_object: 6107db164f479248037fcd2457ef2b0b9b77317a + last_write_checksum: sha1:6219e191548e52b55381d90b2369a2054ac3feeb + pristine_git_object: 58551c6be8ab097fff1b9058dc19778dde1b295d docs/models/components/actionenum.md: id: d7c21e6c1027 last_write_checksum: sha1:3cef9c8561d27220d7f838319ec25e8de0932811 @@ -104,10 +121,10 @@ trackedFiles: id: 83cd1a36001b last_write_checksum: sha1:917398f976f1800432e4e28e6e8724959a5542a2 pristine_git_object: c835d70bcba37392c4c59353bf1f1581314c36d6 - docs/models/components/actionsearch.md: - id: 1cdb2312d866 - last_write_checksum: sha1:ffcca6b8b52422dfec2da1543bffc187051a73da - pristine_git_object: 1a3bfae16b1563651910c59733435784d43ff0dc + docs/models/components/actiontypesearch.md: + id: 77a2d6f363fd + last_write_checksum: sha1:82b00e013ae30396ac16a1c0a824d0673ea86eb3 + pristine_git_object: 6ecc5ec2ef736215980c79ed8e35f492b52dc4fe docs/models/components/activityitem.md: id: 4193971e0669 last_write_checksum: sha1:aef78a46205e7e3828e1207cbc32273768b94c4b @@ -116,6 +133,30 @@ trackedFiles: id: 3d2b6d8ce18b last_write_checksum: sha1:38c09b49cb9a60f403d057b01b0e543044b65220 pristine_git_object: bbcc577c003d50705030367e94814056ac44dbbc + docs/models/components/advisornestedtool.md: + id: 6d5fff806aac + last_write_checksum: sha1:96609487bd3a1afd1f1f06cad6be5524fc9a52fc + pristine_git_object: e56c00f4217110c3a9d3ab55084fb2aa0e881e1b + docs/models/components/advisorreasoning.md: + id: fdbfc810ff1c + last_write_checksum: sha1:33db4e5ba7a05ab603a816614427438cff4a30d5 + pristine_git_object: e8de8b91f9ec4a1d99b85e4d4efa376adbdd7f28 + docs/models/components/advisorreasoningeffort.md: + id: 61fb865e86e6 + last_write_checksum: sha1:34e357e6d819787ce5b13ee88fdb50c46363e4e4 + pristine_git_object: 0cae415c9615a03d838ff6d00c8520060649a102 + docs/models/components/advisorservertoolconfig.md: + id: b2f7eb5b468e + last_write_checksum: sha1:8d60cfa727c770dec3b3b2c218e39f7e87d7fa47 + pristine_git_object: 466ab5d8add414860b0bb9de7d9592a6556b9d2f + docs/models/components/advisorservertoolopenrouter.md: + id: 6ca83dcd9e0f + last_write_checksum: sha1:383898d68f77e355ce50844b0665602fc3716bd1 + pristine_git_object: b60e70f2af32c8c32964046959a9b7ff3d7f9a39 + docs/models/components/advisorservertoolopenroutertype.md: + id: c0c13898466d + last_write_checksum: sha1:e8f327071fb706a65045ef196b53cd02f7a23c4c + pristine_git_object: e2d02194687b3f96fdd2079ec61ebf80bed8c0be docs/models/components/allowedtools.md: id: a51f378e4443 last_write_checksum: sha1:7cbbd944c7b64765eb0bad8ee5f59e78b4838c35 @@ -136,10 +177,34 @@ trackedFiles: id: 7347b170b520 last_write_checksum: sha1:45109203d2e09e0a033ab47bca5d123b3ab9d9af pristine_git_object: bdd358a83a17ebd8b25cf39adc6b121cb390a885 + docs/models/components/anthropicallowedcallers.md: + id: 0bb3131598a7 + last_write_checksum: sha1:57f392d2a607094485936e6f21e0a0c83a977ba3 + pristine_git_object: 54d5cfe6d5a18f9e5a9384cd55cba60612786206 + docs/models/components/anthropicbase64imagesource.md: + id: 0bd4a196cedc + last_write_checksum: sha1:b3653234c5b9656f2e55a24ab5c167d9617c46e9 + pristine_git_object: 6bdc1bf26eb3ed1cdcf9d68ab1a9d324921372a9 + docs/models/components/anthropicbase64imagesourcetype.md: + id: 6f3509583b58 + last_write_checksum: sha1:38229915a10986913a17d573a26005a398e8929a + pristine_git_object: 35cd4a4f42da84cf1a67f9ded84942d3c786c871 + docs/models/components/anthropicbase64pdfsource.md: + id: 07551ffc233f + last_write_checksum: sha1:9fce5b922cc4987a3e50740e6b3b01c3eeb271eb + pristine_git_object: 382669141b3559d49a7dc2801e4db4d25204fceb + docs/models/components/anthropicbase64pdfsourcemediatype.md: + id: a9025d49c91b + last_write_checksum: sha1:8518f9ce0254056e5d373a4832d66e3806d45a11 + pristine_git_object: db85d09d85002200768c4851c091ab7e4f5dfc3e + docs/models/components/anthropicbase64pdfsourcetype.md: + id: b563df25f463 + last_write_checksum: sha1:88791e3db13660958bfebc1f27c36361c2b08579 + pristine_git_object: c510ce5b5fa2657505c42a137355ce534d16fb5d docs/models/components/anthropiccachecontroldirective.md: id: 91d7865961da - last_write_checksum: sha1:74f3e9b1e4938affae69d36313a0a58d5e825a7b - pristine_git_object: 21899272647e475c917b39874c3f3b408e376346 + last_write_checksum: sha1:5706eeaade467f18eb352e38c11474ec5f0e79d1 + pristine_git_object: 408b8d2ff6f44ce397102a80bd2e79c2df16c3a2 docs/models/components/anthropiccachecontroldirectivetype.md: id: a6fbcec6c688 last_write_checksum: sha1:78d624ac5541478dc3f1b103eeb0acacfe7d34f4 @@ -148,30 +213,310 @@ trackedFiles: id: 04e78e2184e9 last_write_checksum: sha1:8be50bc2c0a80e003e0290a5b669d55440ec2ccf pristine_git_object: 8ebad20e790622c306de840f492e2cac11d1fd7c + docs/models/components/anthropiccitationcharlocationparam.md: + id: 3cf783fbcbce + last_write_checksum: sha1:f6e1692c57cbdbd06dff472296b021e0e2916cb7 + pristine_git_object: 9faf4a40a63c27371134fd28be606dd5860c6af7 + docs/models/components/anthropiccitationcharlocationparamtype.md: + id: 3e9343606282 + last_write_checksum: sha1:f41c7bfee5a80c552382ac46044bc267f136a9e8 + pristine_git_object: c9bb00488fecffbbd461b894798ba93b524ce76f + docs/models/components/anthropiccitationcontentblocklocationparam.md: + id: 26e8a259b297 + last_write_checksum: sha1:9475ee016b5f77076efc2cfd082a3ac7bf848c60 + pristine_git_object: def35a805e43496f04f31736719fa00e8b0d23fd + docs/models/components/anthropiccitationcontentblocklocationparamtype.md: + id: 2d0b6a5b0b18 + last_write_checksum: sha1:faafd28c8aafe622f46a2e285b91d0e53aa010d2 + pristine_git_object: 9b47c0394f255d3b14f85d19f9cdaeb9afe6ed3e + docs/models/components/anthropiccitationpagelocationparam.md: + id: 83014f074d51 + last_write_checksum: sha1:27bd3c8f1f58a4527f1ef258105ad69542e65fec + pristine_git_object: 812d63a6af32b810f4ad874c3a410186bb052a30 + docs/models/components/anthropiccitationpagelocationparamtype.md: + id: a25870ae3a9a + last_write_checksum: sha1:64df56cce43ddd549882c26b44b9b0243a8eb63c + pristine_git_object: 4d652afa4124404b109f20388c3745f36c9d6cf1 + docs/models/components/anthropiccitationsearchresultlocation.md: + id: 21b8976e4dfa + last_write_checksum: sha1:4af00b55930b169aeb95fb285293373090a5cf9b + pristine_git_object: f943a65d09525eff738efb5dbe693298508a5d13 + docs/models/components/anthropiccitationsearchresultlocationtype.md: + id: 02391220e43d + last_write_checksum: sha1:f514219bc0829edfdc33559376e41097aa5bf46c + pristine_git_object: c25a37390d2874c380bb17c19315edcfd0f837e0 + docs/models/components/anthropiccitationwebsearchresultlocation.md: + id: 8ab6ca407b8e + last_write_checksum: sha1:2dc2509f442b785b017072bdf5001033f00b2b20 + pristine_git_object: 0ff4eae9b1353dcf139b8faa3c5ea416deb00fb6 + docs/models/components/anthropiccitationwebsearchresultlocationtype.md: + id: d0d4068db256 + last_write_checksum: sha1:037db5d9c2cc739d1639265aa80211c1754138a3 + pristine_git_object: d40fcdd73bccca1915e306372ea0c5e33bbd8e4d + docs/models/components/anthropicdocumentblockparam.md: + id: 9f3bc7099381 + last_write_checksum: sha1:13952476c0fac694718f40cfbaa4232fdcf4c44c + pristine_git_object: 427d8cf107e4751c3be94efb016adad00209f31d + docs/models/components/anthropicdocumentblockparamcitations.md: + id: 4a3701b8d0ac + last_write_checksum: sha1:7b19d81591f2b07a262a296891c9f1b2906a8b7d + pristine_git_object: 3512506aa9f832b44612854f37139ab9bfc8ca63 + docs/models/components/anthropicdocumentblockparamcontent1.md: + id: 3c0f4b7b64fc + last_write_checksum: sha1:f1184fdb0bdc92f585c01b73056a9dc3b0a484d4 + pristine_git_object: 8ddbe2595b0a71f3ecafa144fd9bd5c8aad89df6 + docs/models/components/anthropicdocumentblockparamcontent2.md: + id: 4ca7c89959a1 + last_write_checksum: sha1:548bdf7ce56673741f72119c6f2a386efe49a9fb + pristine_git_object: 2e8fe28bf56379cca59104ea51314c5bfd329f6e + docs/models/components/anthropicdocumentblockparamsourceunion.md: + id: 6b3e324ab5f9 + last_write_checksum: sha1:bff6146d6da910166a98f7f2aefd727bff080d0a + pristine_git_object: 2dd305a9deb7830f9a6ce628355eef1ad50892f5 + docs/models/components/anthropicimageblockparam.md: + id: f373072020b7 + last_write_checksum: sha1:39a9426f29bb56c22f9afee2cf63600b6fa291e5 + pristine_git_object: 15246ac5b56c1dcac7e53a7d35d375272ca8700a + docs/models/components/anthropicimageblockparamsource.md: + id: 020900e00b54 + last_write_checksum: sha1:ba93e0daa9bea13173ebd86833412b87ae582939 + pristine_git_object: 1f963538f554317f9f6c918de8a625166fca466e + docs/models/components/anthropicimageblockparamtype.md: + id: 5f06048dbddf + last_write_checksum: sha1:cea39853c6ca415f6169d46c6690d2bc714e00dd + pristine_git_object: 845ba509ecd15bbe96d4fd38830f00c0acac54f2 + docs/models/components/anthropicimagemimetype.md: + id: e231dbf77b39 + last_write_checksum: sha1:789f268aaac08c659d287258e638419b83d69ca1 + pristine_git_object: b5498493877368a0175de065713c59dd3c86bd50 + docs/models/components/anthropicinputtokensclearatleast.md: + id: 910420dc2e9b + last_write_checksum: sha1:1e35fb1c0cb85e03794ceae6f2a4648b4ec920e1 + pristine_git_object: ea06879d3a7d1feb2e5169f0ec1c10e26ca6386f + docs/models/components/anthropicinputtokensclearatleasttype.md: + id: 1852512dd4cd + last_write_checksum: sha1:148f7753ef8733109c6f88ec01a8ae43e38c5003 + pristine_git_object: 07984400e03579d527df5ecdc16c5e1a051d58bf + docs/models/components/anthropicinputtokenstrigger.md: + id: 688e9448dbeb + last_write_checksum: sha1:b504a56cb1357b45157900cc172626e1c6a3fad9 + pristine_git_object: 2339ad7b46a5f6b4c367f5994000030f97ed7a78 + docs/models/components/anthropicinputtokenstriggertype.md: + id: d0b23493c6bb + last_write_checksum: sha1:346b6531a452114d150894c4f1024a69712c9d17 + pristine_git_object: 865594ce70767168c7602c1ece01d09ade70ac19 + docs/models/components/anthropicplaintextsource.md: + id: 23dc3bba31d4 + last_write_checksum: sha1:061a7c72dc6c53b146440bcec88bca6e80fd05fa + pristine_git_object: ef328d21f7fc46d8aa6672b4fcd932932d5217c8 + docs/models/components/anthropicplaintextsourcemediatype.md: + id: c6c135defc55 + last_write_checksum: sha1:c78a0448af36a25a16cf206fdbebcf40503fc450 + pristine_git_object: 0beeecee3d2173d50234c727f2671e6a7ae95a7f + docs/models/components/anthropicplaintextsourcetype.md: + id: 2202c98d37a4 + last_write_checksum: sha1:8b6307f823203f3d31d5ea289e4fcb445705e99d + pristine_git_object: de85a9b4b0dbc87fa3b7da52046af4f7e0814c59 + docs/models/components/anthropicsearchresultblockparam.md: + id: 09e7f183f85f + last_write_checksum: sha1:bb7c4f035d9fdc41cb02a92b1c072ed633bb1da5 + pristine_git_object: a7f3c31d9cb139d904256a13fecf1b40196a95bc + docs/models/components/anthropicsearchresultblockparamcitations.md: + id: 190fd5c83c2a + last_write_checksum: sha1:abd1886123229be49df27cadfbd047a4c74bcede + pristine_git_object: 72eb4a3d8ea1218d7e45707d3afccfd41a491d65 + docs/models/components/anthropicsearchresultblockparamtype.md: + id: 578a3e4a6d3e + last_write_checksum: sha1:0ac3609b0069a909fa20afde322a50f4270d13e1 + pristine_git_object: d781d5e49fe4854351343902b25e71187bba66d8 + docs/models/components/anthropictextblockparam.md: + id: a32e18ed517f + last_write_checksum: sha1:e90806eedb6e8358e57d25968636049e74e4a44b + pristine_git_object: 3474804f85dc9a95783730f3d82464e37b77e81e + docs/models/components/anthropictextblockparamtype.md: + id: 208760ef9311 + last_write_checksum: sha1:c16456d663ffe96d793ddadf673ef302167a8f9d + pristine_git_object: 389e1fa45650ed264dd8ef8f9e8fe9509ea00d05 + docs/models/components/anthropicthinkingdisplay.md: + id: 506e2e80c279 + last_write_checksum: sha1:981e85708534769a6722055269c43bdec313feeb + pristine_git_object: d784d965f7bf6d74c5edd76eec9855d5e280a127 + docs/models/components/anthropicthinkingturns.md: + id: d39aa9801cdc + last_write_checksum: sha1:5c4bbda68be415e65b5911f171ebd26a43e849a9 + pristine_git_object: d06e19f22d4b894f29139f3e8cdd66d21c21f8a6 + docs/models/components/anthropicthinkingturnstype.md: + id: 061e62e09014 + last_write_checksum: sha1:799fd47a45a22c4824c810a5322ba274b4a117fa + pristine_git_object: 2f91ac3e439799c0c39aa26f1a5a3fa184c85262 + docs/models/components/anthropictooluseskeep.md: + id: 7b271430d401 + last_write_checksum: sha1:0388c5f61b5638bef53df9c8cd0e86a5e85898c6 + pristine_git_object: 0b270dd2141483df49c627581b11cf6b42dc8db7 + docs/models/components/anthropictooluseskeeptype.md: + id: c188372d8025 + last_write_checksum: sha1:b05a9a912da4eed657d83c6c0135e5a65e00d68c + pristine_git_object: f82b0d135391a4de9f6ad6e0b434112e12757284 + docs/models/components/anthropictoolusestrigger.md: + id: c22c70b689b7 + last_write_checksum: sha1:c985d69ef032b0711c6a71372682df2c1b0684ae + pristine_git_object: 581bc8d3f7380ef26ef8406a9fd9ee03ebf72d7d + docs/models/components/anthropictoolusestriggertype.md: + id: 9a6226a00218 + last_write_checksum: sha1:c0163bb2362171335f66d00c4f066aa76bead2a8 + pristine_git_object: 6c8f0880ba36629874cca2e5632d4b180cb0c18a + docs/models/components/anthropicurlimagesource.md: + id: 95782b4ed14b + last_write_checksum: sha1:fcc484e5d109c4a26c503f4685b396821d78799b + pristine_git_object: 8226b9941565887310ca0edb7393f8b686882d82 + docs/models/components/anthropicurlimagesourcetype.md: + id: 7ad934d171ed + last_write_checksum: sha1:34cdc0135901059dd6d647cc6f0bc460e4c24fca + pristine_git_object: cc54359b8bebe16c8956fb5a0af88c6ecacf5373 + docs/models/components/anthropicurlpdfsource.md: + id: 0bd64f4c34ec + last_write_checksum: sha1:a87adf7f2c7961e58d62adfce62e4589390f5789 + pristine_git_object: 0aaaeaf44a420d563a91d2f45da5cc9763550706 + docs/models/components/anthropicurlpdfsourcetype.md: + id: cc8578ecabb7 + last_write_checksum: sha1:fc5754d81c7c96da092c18d108def077c14111af + pristine_git_object: 118c27f4b4f1c06efa441ff4b23748b8c21897bf + docs/models/components/anthropicwebsearchresultblockparam.md: + id: 848b75b92265 + last_write_checksum: sha1:19e0f33942848d0d0b88ad9d5fb0e0509e31878b + pristine_git_object: 3eba2e3e9a359ed737c85a92bd62d78cd6cc0bc5 + docs/models/components/anthropicwebsearchresultblockparamtype.md: + id: 4b6c8b474537 + last_write_checksum: sha1:f373a22b638798cfb1a76261bfd0591033db7d07 + pristine_git_object: 6b0ca0fb58cc26e0a4da4a96803fa326171ecd48 + docs/models/components/anthropicwebsearchtooluserlocation.md: + id: 1f19bc4350af + last_write_checksum: sha1:5a201c55f6958b80b19f5ea0128c23b476360b25 + pristine_git_object: 476175012461d4d74c7eb9f6caaa91739a0732c7 + docs/models/components/anthropicwebsearchtooluserlocationtype.md: + id: ba81be14c816 + last_write_checksum: sha1:91d1dbded6d88090281ca609a0da5a8ff0fd13f1 + pristine_git_object: 52d72b60e0f48490e1db1635d11f226402387a64 docs/models/components/apitype.md: id: 94f0b55d89ac - last_write_checksum: sha1:37dd142bcaea1f805462f77aa81be003f1535d6d - pristine_git_object: c5a630b2642a641a20bd859234f97ed338623cf8 + last_write_checksum: sha1:1c43f7816e1394477a1c577845ef52a3fca2a1e1 + pristine_git_object: 74bccaab8a0a4a49bf293b906fef870f173b7f3f + docs/models/components/applypatchcallitem.md: + id: 27fb40c717af + last_write_checksum: sha1:fbac56c4a45d392c35a807759057c0f35d6842ec + pristine_git_object: 418fdc2dfa670b2279bed6664ddf6fd8d87090b8 + docs/models/components/applypatchcallitemtype.md: + id: d4f3ae7007d8 + last_write_checksum: sha1:a657b40d83c848eb78058a086e15ccb0123b8f55 + pristine_git_object: d71a16ca9956b3ca2b78332fc66c46d371a739db + docs/models/components/applypatchcalloperation.md: + id: 6c73dfb47c06 + last_write_checksum: sha1:82dafab79aded76fb5f390d4bf8c60a39dc88903 + pristine_git_object: 82e0f9c87ec81be98c4135ec7e3c8d8b58546145 + docs/models/components/applypatchcalloperationdiffdeltaevent.md: + id: 6d9635a39d0b + last_write_checksum: sha1:67fd02e7a151121b918f78035bc96f0175abdc2b + pristine_git_object: 2284e032c228205977a16fd612b7d1d40373c165 + docs/models/components/applypatchcalloperationdiffdeltaeventtype.md: + id: fb77219e3ecc + last_write_checksum: sha1:f8b9042c7aa204c912879e3d9341028eac94ed15 + pristine_git_object: 1d5208479ccd05255ba285134df49e3d8dc3ea04 + docs/models/components/applypatchcalloperationdiffdoneevent.md: + id: 3ef0f2b2c319 + last_write_checksum: sha1:1235df2875cd7ee1b71f43f7a5e155b5f025af12 + pristine_git_object: 390559488b7ad5772f2318fbeecbf1999691168b + docs/models/components/applypatchcalloperationdiffdoneeventtype.md: + id: 807a8bb38c6c + last_write_checksum: sha1:4cdcd1be3be80437c77c1c68e0bc6230f45a8b76 + pristine_git_object: fb5c9c1dfbb522e5eff386d57329ae32da2726c3 + docs/models/components/applypatchcalloutputitem.md: + id: 44209157998e + last_write_checksum: sha1:b6b2880aec0db553100716cca0bc9aea22ac6801 + pristine_git_object: 0f744c05531cc8fd6bd1680a01b258ca74b27d4b + docs/models/components/applypatchcalloutputitemstatus.md: + id: 2e4cf9c9995c + last_write_checksum: sha1:5af61324c378fb558e8fd8c4e91b870417848e47 + pristine_git_object: 8dd87d9c762bb36c96a047df4155481ae2dc3309 + docs/models/components/applypatchcalloutputitemtype.md: + id: f5ad333bb5d4 + last_write_checksum: sha1:e309a66e12f17ac401da0d61a86723053ac0dc13 + pristine_git_object: 992d69ec600733ce8bc87e3e31cda7c90aebfffd + docs/models/components/applypatchcallstatus.md: + id: 148d2a76e2f9 + last_write_checksum: sha1:75bd5d61564f46c980d26d15e493267a86b32151 + pristine_git_object: 3ad3fa0ef95df451594ff922dedab979f194eb2c + docs/models/components/applypatchcreatefileoperation.md: + id: abdcab523762 + last_write_checksum: sha1:59796dbf3f6749e0d7458773c0061513a59488a1 + pristine_git_object: 3c578cbb91c5ddbe6c25d85982e46753b60fa7fe + docs/models/components/applypatchcreatefileoperationtype.md: + id: bcb917e45551 + last_write_checksum: sha1:34a73399991081061d7e9be3b18b35973a5ba2a0 + pristine_git_object: 0d19e2c75c3e7fa46a1365d36a8a85ce68941ce6 + docs/models/components/applypatchdeletefileoperation.md: + id: 9c5bd0844a42 + last_write_checksum: sha1:4c7aa64a855c55b30634aa0b419d7bf9d13d68f2 + pristine_git_object: 7e688f932a17cdae6dffcba005a0a6b045a15888 + docs/models/components/applypatchdeletefileoperationtype.md: + id: 6d38c528be5c + last_write_checksum: sha1:1ce33f934bf74f8a77d158b080c3e841a2bbc468 + pristine_git_object: 2f7ecd2d2bd1a07febf0da201995b18db5c623db + docs/models/components/applypatchengineenum.md: + id: bf557a83cbe0 + last_write_checksum: sha1:5ff03ca6d87eaae74503a3048806f3df329d99de + pristine_git_object: 4f607c6ffbdee43b6c62917dcbb10836c0d6566c docs/models/components/applypatchservertool.md: id: 045fefdd410e last_write_checksum: sha1:726028432fec49da351b1b5798682c21dd333b26 pristine_git_object: 1c2b8f64c5e52276520f3602783bd906a3631987 + docs/models/components/applypatchservertoolconfig.md: + id: 46d7ae0be6e1 + last_write_checksum: sha1:ed9658063f53e48120f16ed7e0e33a14074900d7 + pristine_git_object: a5cc33d202b2c80e95f1bd30dcbd910da4a3c4c4 + docs/models/components/applypatchservertoolopenrouter.md: + id: fc0a497ffc51 + last_write_checksum: sha1:7027522ad4c681af565c6412b68b6b20fee91479 + pristine_git_object: 293360b2064c586f0e1b22ed5c9ced6297edb490 + docs/models/components/applypatchservertoolopenroutertype.md: + id: 4f9ade2606f9 + last_write_checksum: sha1:9de03b004a7dd34f5a9c487f24da894a53156c33 + pristine_git_object: 5906fe7c4485fdd01a954ac3d7c9908a0820f1d2 docs/models/components/applypatchservertooltype.md: id: 78d1a01f42c9 last_write_checksum: sha1:b9fa620a3082cae03d04505f8897e6a6ea050108 pristine_git_object: 408835bd7fc46729182a23295ba6e0f294135d1a + docs/models/components/applypatchupdatefileoperation.md: + id: de59c13c94e0 + last_write_checksum: sha1:7746a5ed4b8099b13d993fef4daa76ffb555b6d4 + pristine_git_object: 31a400835a32247d4872453ffeb1b4a4407e6b00 + docs/models/components/applypatchupdatefileoperationtype.md: + id: c533b1fedf80 + last_write_checksum: sha1:e5d089cfef4b0b0501786565d596fb37ef69f42a + pristine_git_object: 9fff74dc570f837a09b4bfa44c954467a30294b3 + docs/models/components/apprankingsitem.md: + id: 1c5a9014b523 + last_write_checksum: sha1:393e4a96f4acd568044ac0ba5a290725bb4899c6 + pristine_git_object: 48cedd0d5b9aac666b4e9c03f61fd64d68f7daa9 + docs/models/components/apprankingsresponse.md: + id: befab39657bb + last_write_checksum: sha1:c7a2a88e94c16dfd7f64478ddd60873738a06827 + pristine_git_object: e0fc5af390803e0c1585911123d3d1cc44a5d6bc docs/models/components/architecture.md: id: b6ccbdf25ac0 last_write_checksum: sha1:eeb8bd60b95b7d8c0fc545cffa7a2a1f3a2bd1da pristine_git_object: c841d6a56d3c69ac2d190806f83683b975eeb0b6 docs/models/components/aspectratio.md: id: ca4fc75a0469 - last_write_checksum: sha1:1bb036ba33189953bf23b892116fdfff77103352 - pristine_git_object: ebace458b910e415015e96ce29034a9ef989d3aa + last_write_checksum: sha1:057bb1e8af46222465784074f09df07930524929 + pristine_git_object: 30c0b981ad04925d22e478487f2490fd6c16d569 + docs/models/components/audiourl.md: + id: 4677aec8cc1f + last_write_checksum: sha1:761a8eef504897f8413af92217f3664ae8482425 + pristine_git_object: 9dfdd39b46e44f6c96b99bd4c9f7bbeb1cd40aaf docs/models/components/autorouterplugin.md: id: 7d896cd10921 - last_write_checksum: sha1:e2fad7c0282886eb19f41ffaebc2760df47faf2f - pristine_git_object: 38479728d4d90127850ce63dbf44365164817546 + last_write_checksum: sha1:0f679c6b65d51876f8a2dc6e7ec607a375bf0243 + pristine_git_object: e414907eab8fc4befd76bc964b23761486b23ce9 docs/models/components/autorouterpluginid.md: id: bc8b88478abc last_write_checksum: sha1:0c57d727433e8b437a72ed0bb26ab141eb809038 @@ -242,12 +587,84 @@ trackedFiles: pristine_git_object: f57bba94061a2b8d7e3e8b812956121dafe9b6d3 docs/models/components/baseinputsunion1.md: id: b70ce2953c7d - last_write_checksum: sha1:a1269ef9a240ede78237d1092eebaaf21c9eb628 - pristine_git_object: 9ebf8bd7eac43ff9840685a3e92d6728f8267510 + last_write_checksum: sha1:643d8cc135272f2fc1209741b002f07e6e8996c9 + pristine_git_object: 36c02a5855ff82f5c81f5c15f4de5c8e39e624ce docs/models/components/basereasoningconfig.md: id: d803b6f41e0f last_write_checksum: sha1:f3b6c3d4bd3f7030b5854884a1f3329185255137 pristine_git_object: 196bff164c159f9f65693a5ac87cabf5d05a4918 + docs/models/components/bashservertool.md: + id: b23a1b4e295a + last_write_checksum: sha1:396e4ef1f0f0be8baacba2123603e1dc6f0f2355 + pristine_git_object: 7dbfce3cf5574af5a0a977deaba9b18dcbbabc01 + docs/models/components/bashservertoolconfig.md: + id: 3b79ba13fb92 + last_write_checksum: sha1:ba51b5ee27006fa70e24c76fce90c8c4c789d6ae + pristine_git_object: 23e89ab9b3ccfe69bd433fd0b9aee2d373ba2f64 + docs/models/components/bashservertoolengine.md: + id: c47e200fbe6e + last_write_checksum: sha1:f8002314344af45fbe747cedc5e5b1bc1bb6caba + pristine_git_object: 5e61f6b203820e1ebdd35aea4fcb0024f288f145 + docs/models/components/bashservertoolenvironment.md: + id: bf73579b6f18 + last_write_checksum: sha1:a1513dce9a93bdb454b9855a6de1cd620009ccf8 + pristine_git_object: f0dedcec43b001e930005840fee9ab61cbaf8d47 + docs/models/components/bashservertooltype.md: + id: a431f828244c + last_write_checksum: sha1:36049ba8dcace63b19515379a0277692aa6e6a14 + pristine_git_object: 7d76c9d0728f3aed82d990ed2eb7ed7ee566e6df + docs/models/components/benchmarkpricing.md: + id: 07b6e0719150 + last_write_checksum: sha1:4320a9c3f9a919423e8c73aad2e6255bda56c30f + pristine_git_object: 3c0d7726ffbab168caf2146c1ff3522e4e44444a + docs/models/components/benchmarksaaitem.md: + id: 5aa6dd44d76b + last_write_checksum: sha1:81b495760536ca493d920f2a9e1149d825b61dcc + pristine_git_object: cfb5382ee846fe53c4d32b3aa91ab15c5df768aa + docs/models/components/benchmarksaameta.md: + id: 0071e8a308ac + last_write_checksum: sha1:22beb109e823eef2f5fd8f4b4f7cff5ef6509561 + pristine_git_object: ae084a5efa1b84d797d2cc28a1f8eea309367dbe + docs/models/components/benchmarksaametasource.md: + id: de9f9b852614 + last_write_checksum: sha1:5fb42813dd4059003bef97df330bdb93e0e90c79 + pristine_git_object: 1fff3fd871ce443e804e6aa0bbb0bd69060ad675 + docs/models/components/benchmarksaametasourceurl.md: + id: 0d289e541257 + last_write_checksum: sha1:c42418e12a9f9eb7b5e13ef9da34b3d881e5c14d + pristine_git_object: 71b7fa02e7f9383ebd461ee4d028913e0ac571df + docs/models/components/benchmarksaametaversion.md: + id: a83ca5df2ca3 + last_write_checksum: sha1:c92b5f1a43fca4ee0abfdc0e281f1ab31a663dd3 + pristine_git_object: d4aaaa1128698afc54f104f371ad81a19ee62405 + docs/models/components/benchmarksaaresponse.md: + id: a37381912ee2 + last_write_checksum: sha1:c09766ecf1514007365d93fbe8304e37f29d4f55 + pristine_git_object: 3961f84ab1d8877cf74faa70863021a5d2cfa1b0 + docs/models/components/benchmarksdaitem.md: + id: dac7dbfccdce + last_write_checksum: sha1:405623f1f9dacae1d9e60c8db722390c7bae0698 + pristine_git_object: 66322fb0a8cb39e58a38285a220d8e1afb015b44 + docs/models/components/benchmarksdameta.md: + id: d754004ac0d7 + last_write_checksum: sha1:fe53d73b9fdd61a7f0e0150b1d9fb8ec6e55d264 + pristine_git_object: b8ba42095d6aa33ea29564a57588df5c99436871 + docs/models/components/benchmarksdametasource.md: + id: 635cddd0531d + last_write_checksum: sha1:7586cf47e59825c714a0fffff7f06c4ead6e2dd6 + pristine_git_object: d6109f39cf52b781aad1138f19abf5888ff14e3c + docs/models/components/benchmarksdametasourceurl.md: + id: 6265b8698fc8 + last_write_checksum: sha1:0e5bc3198fdd99028abdf771be0626452dd1be11 + pristine_git_object: 3eae2e010129978671cf0bdd9b4e76e040f6fdfc + docs/models/components/benchmarksdametaversion.md: + id: 1d8487884b73 + last_write_checksum: sha1:fa290b18b973e93951542a84136efe04c7044b32 + pristine_git_object: db84f1ddab7fc85de302927426e6badbc3756bb8 + docs/models/components/benchmarksdaresponse.md: + id: 24f0adb961d5 + last_write_checksum: sha1:8ee50cef458fdb0326168ccf86b0c5125dc019ad + pristine_git_object: e67e6a75c0af4b5c9e07d2aefa1fef5ba1573110 docs/models/components/bulkaddworkspacemembersrequest.md: id: 51fecdefb722 last_write_checksum: sha1:40ef359d1c1aafb34d8a201852ecc492b7325983 @@ -300,6 +717,18 @@ trackedFiles: id: 2b0e1e77703f last_write_checksum: sha1:068fef9b5ddd712db0b013351da81ffa5d57db33 pristine_git_object: 51bd660c1550adf7bc9f0a83d05615693009d103 + docs/models/components/byokkey.md: + id: 1e9201eecc79 + last_write_checksum: sha1:464c7c8e24fad8da2ccff011ac70bdcb1cdcf5e7 + pristine_git_object: aac5e0943b1e68102839c5f659bc0b84ec6342bc + docs/models/components/byokproviderslug.md: + id: c48bc2b1aea9 + last_write_checksum: sha1:538ebe4f8aab194d4373b655da2a997e78d9fb69 + pristine_git_object: bf7e9bd650a432cc84401bee6ad4b5c53fdec546 + docs/models/components/caching.md: + id: 3dca35b50179 + last_write_checksum: sha1:d2c9ed89d9ab7168111f90a92bbe549780424f82 + pristine_git_object: 006345aef5292122d05aba96b942a5d953d80bd5 docs/models/components/chatassistantimages.md: id: e75bf9e792e1 last_write_checksum: sha1:38a46a07650b7c9eec032e992a1b80c565031b22 @@ -450,8 +879,8 @@ trackedFiles: pristine_git_object: 0a5bad55023a90ac502830d6db287a56c7566f8f docs/models/components/chatfunctiontool.md: id: bdf3fb6b9f6c - last_write_checksum: sha1:a85d14543693613f4a04143fa532c5577978ffa9 - pristine_git_object: af6950b1623268af45ff261dd98004bb8e20c827 + last_write_checksum: sha1:4c5b882f908cef897a17fd967e4d8bc8565bbf60 + pristine_git_object: 9c80a7a82b7282aa5efa35e12704d3ddf7a52f78 docs/models/components/chatfunctiontoolfunction.md: id: b8cf6accb635 last_write_checksum: sha1:3a64022e153a0ffdba1f367f1e83573b39e62575 @@ -490,20 +919,32 @@ trackedFiles: pristine_git_object: 85b4ae5e060b2ec8cd8163af097e0a733883c92e docs/models/components/chatrequest.md: id: f2a2d3702b2f - last_write_checksum: sha1:8e4d43c5c97ec7b867615a797c491f1f7a758d31 - pristine_git_object: 58cf3f3b9c249beaa27df8eae9d6f268fa55e665 + last_write_checksum: sha1:ec05a02fa7746aca237f550848766a9a2e12a09e + pristine_git_object: 1c030576b3952019d3f1d4947b325613c0ed4e74 + docs/models/components/chatrequesteffort.md: + id: 3d949b995266 + last_write_checksum: sha1:91edbd1135261852accfeb2dee641e26237807eb + pristine_git_object: 499c1234ba79e42c4418464b61e0b985bb2a3316 docs/models/components/chatrequestplugin.md: id: 6ea2e614e408 - last_write_checksum: sha1:f78c4d901d3256b0e2823e52d1fabb23cdcfddb1 - pristine_git_object: e2aeef1fdbc464b96e18a96e02ef15dc10ae804e + last_write_checksum: sha1:7c044b9f0722eabd9b592edab7a1bc66d16c008c + pristine_git_object: fb028ef4a7313fdb51536adac0131e72b499098b + docs/models/components/chatrequestreasoning.md: + id: fa84681873ed + last_write_checksum: sha1:ce533672af225c7adeacc80cbbc700f2f7bd8f44 + pristine_git_object: e8a685e8c002ca09d7999094cf6fbf1f1e417fcf + docs/models/components/chatrequestreasoningeffort.md: + id: ca2256a2cfd1 + last_write_checksum: sha1:a482b791d0b86ecd63a57652b0b99714690adfff + pristine_git_object: 86722c52dd720760b9a5cfe12bec2a5a661191f1 docs/models/components/chatrequestservicetier.md: id: de1d4f761717 last_write_checksum: sha1:933539b1f157f51b6d8b04dce7bc85215a634c82 pristine_git_object: 4daa72bd28957b5c894b10dc011f27dc027f405a docs/models/components/chatresult.md: id: 716db90a4239 - last_write_checksum: sha1:f4217bf44247f54b4b5fa0aa5d41e73c49bfc72e - pristine_git_object: 11876116355e5c80fcad3ba08992ab9a60e396c3 + last_write_checksum: sha1:8a78ea17d8a66e09ed10f401c979214be6328859 + pristine_git_object: 9a6728c79c0f18db845ee3d537dbcffcaab827d8 docs/models/components/chatresultobject.md: id: 7f4c86ecda3f last_write_checksum: sha1:c1c1f235153e3729972e6a70a9d7d83bc98cd602 @@ -516,26 +957,34 @@ trackedFiles: id: efde980d36dc last_write_checksum: sha1:a48c53ad450d285f32712e5cb0f9a0f522242fce pristine_git_object: f2cdd3e9be6d3247d6c342d61c74871efbb4a37e + docs/models/components/chatservertoolchoice.md: + id: 07937ae68d42 + last_write_checksum: sha1:b02fa5f22c6e3ca598bc82b6256e01e6ad0ba826 + pristine_git_object: ec6bed1e643e98f44f024d1d7e6ae19b1c41f8ac docs/models/components/chatstreamchoice.md: id: c3d1cb6b12c1 last_write_checksum: sha1:e4fad4781c98a4169c86941629fbbc86eaeceaab pristine_git_object: 01e0d64c1908c4ab072e8b809f7f16346b597240 docs/models/components/chatstreamchunk.md: id: 04426300fd4f - last_write_checksum: sha1:6ff4c7c69f6c4d14cc89834b8a0f0457cbc2af8a - pristine_git_object: 54ec70b6994a173ca760fdc9243d1eccd5a44721 + last_write_checksum: sha1:077615aa767b0a140992113e56cf0c544bf47d30 + pristine_git_object: 4194e190ca11e1b294860a18fb2a9d426c619f80 docs/models/components/chatstreamchunkobject.md: id: 5d9a9bc6b1b0 last_write_checksum: sha1:31639f7b5f82d0ad86c6a785ed5f3a5cc9d53b92 pristine_git_object: 24a53f25ebd4e31bcbbf229c340b9d39322bfd34 docs/models/components/chatstreamdelta.md: id: c8b510da86c7 - last_write_checksum: sha1:73f2da272e2744d34fc3636ead96d519d03eea33 - pristine_git_object: 5d934c4b7edfa64ac1e9b32e3e733acc54ed9039 + last_write_checksum: sha1:e38ce72be69e8e8fdfad59893426ce4a736f5a8f + pristine_git_object: c33cee9258458e478b5905ef57a716dfe1fb5ae3 docs/models/components/chatstreamdeltarole.md: id: fb27a07377d1 last_write_checksum: sha1:ba1e62b491d95f1907f638bf885511728bf3a139 pristine_git_object: 4d8d03990c3d2a18ccdf5a00cd3524ec4f750a49 + docs/models/components/chatstreamingresponse.md: + id: 0fff3153e97d + last_write_checksum: sha1:02edf454b684cbc6c013e8ec7de77ecfce87d746 + pristine_git_object: ca27dbc487d60951c17a354ca86759e717d0a820 docs/models/components/chatstreamoptions.md: id: 167b62f6bf2e last_write_checksum: sha1:71a3f24758b1cf30f351b7be8100bc6c599042e7 @@ -590,8 +1039,8 @@ trackedFiles: pristine_git_object: 26e455071448d4f03fe9500ecd7884df83f1e20c docs/models/components/chattoolchoice.md: id: 678807b5aab1 - last_write_checksum: sha1:a65a0fe5e54baef489e41126c8f16125f8ad6741 - pristine_git_object: e62b62c44130e1b213e11da03ac5f5fe3819aca3 + last_write_checksum: sha1:56f57ade84937ebd4b6dcc89655f91cfac9859b7 + pristine_git_object: ee05100f62f3131881cccef8efd8fe2dbb909369 docs/models/components/chattoolchoiceauto.md: id: cffabce97f17 last_write_checksum: sha1:76548959c79ce4734d8accec471b7d2964f264f3 @@ -618,8 +1067,8 @@ trackedFiles: pristine_git_object: c9602042d89aa7168d60e81447ccb4bb0e03c3ab docs/models/components/chatusage.md: id: 0488e615ed46 - last_write_checksum: sha1:6565cfbad6376b155cab013565952857a567bd00 - pristine_git_object: f3d29a1a7d7de6d1bb31433ef416840c1bc70b59 + last_write_checksum: sha1:b3f757b79d6b57c35dac0c24a5124d00aeda137c + pristine_git_object: e540306aa360bf47aa5334de94d44b660064b20d docs/models/components/chatusermessage.md: id: e5c1cc8b5d6c last_write_checksum: sha1:421a50011001694e5d4e7bb42e76ee67c5282806 @@ -634,12 +1083,20 @@ trackedFiles: pristine_git_object: efec2fbecde464aec7a09237c79e2c9c416db9a8 docs/models/components/chatwebsearchshorthand.md: id: fad82493a2cd - last_write_checksum: sha1:5d8b7379e4add849f5980a0f381b5a78ecbff33a - pristine_git_object: 9ba2ef179878e153b6ccdae35721d76e288eb9bf + last_write_checksum: sha1:a94fa4a168f301f15eb1931fd138bf699de58be2 + pristine_git_object: b8b2bea75b39267d589d41c2bc97a58822f9693e docs/models/components/chatwebsearchshorthandtype.md: id: eaed4e81ffa2 last_write_checksum: sha1:fb2b350e577b17bda819768f881b55de46819298 pristine_git_object: 0b4bbdadc12b38775a4d6eb0894dab564da6c271 + docs/models/components/citation.md: + id: be6e10c98be7 + last_write_checksum: sha1:65f11cbd4f531f787630fa2ab03eefcef33a5fba + pristine_git_object: a81aeb244362030375aff2a3c26e70d5ebb88ee9 + docs/models/components/cleartoolinputs.md: + id: b36c32c12f79 + last_write_checksum: sha1:87cfd8400c5c42e95a39ddaeecc84e90a6335d4a + pristine_git_object: 1a877affdb014cc9159ff36370b3fce81233ac9f docs/models/components/code.md: id: ee3d6f2d513e last_write_checksum: sha1:87d5c8d1dd1e9b1286426ac5072dfb2fecb679b1 @@ -660,6 +1117,14 @@ trackedFiles: id: 0c8573a71d66 last_write_checksum: sha1:948dea86709e60ce34ce7b7636aa15a1839846cc pristine_git_object: 1e7c1236919c6afb82216b9e2f339bf9bca1de21 + docs/models/components/compactionitem.md: + id: 33a48a296c3d + last_write_checksum: sha1:813b20dc1ed5960362be23bf0434b8981cb892bd + pristine_git_object: 598ee73bca0da93ec3941cf3f81d938b101ba00b + docs/models/components/compactionitemtype.md: + id: bf42f31e319f + last_write_checksum: sha1:2f795a8ffc12caf74e925d704da862dbb5986824 + pristine_git_object: 6420ec316d4325b77b3228ebccae267e153ee510 docs/models/components/completiontokensdetails.md: id: c19e8c252f52 last_write_checksum: sha1:49ec94e47b8f360bed7ad7f6f60f4d84a9a1ba0a @@ -696,10 +1161,54 @@ trackedFiles: id: 152c45b035b5 last_write_checksum: sha1:c0282103957bba7f65932f85362bbdd4a5be5f18 pristine_git_object: 1065104bcf4a949e7f83b82da30327b9f3402801 + docs/models/components/containerautoenvironment.md: + id: 9d998da8d211 + last_write_checksum: sha1:859bd45f3f022d4ec7dd697f3a2d1bdcca71ad77 + pristine_git_object: cdaf4c21c64d378caa10c72c70081493c7c62ac6 + docs/models/components/containerautoenvironmenttype.md: + id: 968e7dd44607 + last_write_checksum: sha1:c34d32a765c1bd02a0b9e7526c63e9cbb7fbe4cb + pristine_git_object: 91038e1f0a9fda757cf2f7fcb01598a7c40989f5 + docs/models/components/containerreferenceenvironment.md: + id: 51b3a4630068 + last_write_checksum: sha1:6851ba40613ab208564744ebdee52bb0723bd817 + pristine_git_object: 0c1e5f0b0459f64970c1be84994eef6ce2ff2708 + docs/models/components/containerreferenceenvironmenttype.md: + id: ecdbfe9ccfa6 + last_write_checksum: sha1:242466260ce07deecada2754842401c6e1279a2b + pristine_git_object: f43e9094ee6e781687e8dbda8056579f530fe0c3 docs/models/components/containertype.md: id: 249ebaa2e070 last_write_checksum: sha1:3c20361a17901053664bbb9606d70b4ea351af68 pristine_git_object: cca90e9844bd5bfd698b4d0dd672b8a496df18d2 + docs/models/components/contentcompaction.md: + id: c81cdfe1ba8e + last_write_checksum: sha1:3cd5cce49120c22ede6fb7f32a39934237e77819 + pristine_git_object: df38ba90f2b377c03e24ebba62d414ba8112552c + docs/models/components/contentfilteraction.md: + id: 93c8a7780a15 + last_write_checksum: sha1:d59e79d3f07dbdf77356c46f52c631c57cb089e9 + pristine_git_object: fee5a8e5af363d0f315ac851ad069a567130848d + docs/models/components/contentfilterbuiltinaction.md: + id: 97a82bbc6350 + last_write_checksum: sha1:b24b990ab2c302d5dbd3fd477ebadc6eaf21d34e + pristine_git_object: 832d63ae5550c871e8b781bfd21315b556a9cc0d + docs/models/components/contentfilterbuiltinentry.md: + id: 1f58e3a030b2 + last_write_checksum: sha1:f1df3d84bddae9c3a287128c79d3e931c4ffb867 + pristine_git_object: 575f66d312a7700e92a4f30e94309bcf9fb32006 + docs/models/components/contentfilterbuiltinentryinput.md: + id: cc7b60fa6210 + last_write_checksum: sha1:d8a3404fb05671bfb211531d210e453f42b2b834 + pristine_git_object: 2732c00318017723f76da416277d08f4e91113e3 + docs/models/components/contentfilterbuiltinslug.md: + id: fcebb29b12ba + last_write_checksum: sha1:999661e52609a1bae83aab181f5223a0bbea050b + pristine_git_object: a65c6c7bf97ba62b2bc970b3ea9ca408bfe96fc7 + docs/models/components/contentfilterentry.md: + id: 9568b82b0734 + last_write_checksum: sha1:12fdcfd556c77c186d09ffc6586cb20a705001af + pristine_git_object: 14bb3e4800e1174b9ee923a2983b9d7562c52805 docs/models/components/contentpartaddedevent.md: id: 3cb9b20cd447 last_write_checksum: sha1:1244ccf383c9ac7d8ece43e6d0a710e6b86137c6 @@ -712,6 +1221,14 @@ trackedFiles: id: 79a9fe7e0860 last_write_checksum: sha1:db1df61e29ae6d5e9f51472b42fbb535bed0ffa9 pristine_git_object: 5efcbc67bec78ab9d26b4de001a1da26dc6cbf87 + docs/models/components/contentpartaudio.md: + id: 86d047563b8c + last_write_checksum: sha1:5b2c10c98def3a73c91176b387e6bfa7a8317d67 + pristine_git_object: 2c258e87f47c18d9e2dd636d537d6f98a14b75de + docs/models/components/contentpartaudiotype.md: + id: bec9e736f93a + last_write_checksum: sha1:b760421faa0bafea48762fcb199d18ea8e82f749 + pristine_git_object: b83987eb93e821697ca725b27d749cf50a136a52 docs/models/components/contentpartdoneevent.md: id: 4530530b8b66 last_write_checksum: sha1:36fbbd1af4953f32baf50465ab922acd9ec52276 @@ -736,6 +1253,70 @@ trackedFiles: id: d4f35c8e04d7 last_write_checksum: sha1:ed1670af6b2a19f28ea6cf5a0c23d76468109f97 pristine_git_object: 02c9dcf3a41dfbcc94a1d35a94d204da54097322 + docs/models/components/contentpartinputaudio.md: + id: b4687ede0de6 + last_write_checksum: sha1:49122fca41db8de886463d2a6dfa7c334374a0e1 + pristine_git_object: 24a9dbbd06460ebe0eec705d760f0da863b9c4ed + docs/models/components/contentpartinputaudiotype.md: + id: 64531d75cdf7 + last_write_checksum: sha1:fa12c7d203d02771aeaecb787b19b84fd038c460 + pristine_git_object: 241f1ab98bac59331b48a639fd5c82720f3e0bf4 + docs/models/components/contentpartinputfile.md: + id: deb43e8f65b2 + last_write_checksum: sha1:2f60252abbfb084c13cd088a811eeea032325243 + pristine_git_object: 414e0ef4b02563ffd83ab82b2e283e36a4ef4fff + docs/models/components/contentpartinputfiletype.md: + id: 22f69ad0d983 + last_write_checksum: sha1:c61edeb0b33f9e3a039568997c0085729c4d00a8 + pristine_git_object: ad9b792acf485e2b2e4da143b9f16db64e030278 + docs/models/components/contentpartinputvideo.md: + id: 33673e370c0d + last_write_checksum: sha1:fa69a8b90477ad1417aeaebb98709bf43636521c + pristine_git_object: 435cd193897b63c0f5ab56f871c4e8bb3b3a615a + docs/models/components/contentpartinputvideotype.md: + id: 450386efa0e9 + last_write_checksum: sha1:9933dc36b54a1831e25a42e6673823b09228577e + pristine_git_object: bd26b09e0f93ba70427c04331868d81e10e23498 + docs/models/components/contentpartvideo.md: + id: 304be1905e05 + last_write_checksum: sha1:6bc7c7863ff655b33a8f664a25308d0dcd01a077 + pristine_git_object: 625bf939f493c05197a9828a8109795c74e60853 + docs/models/components/contentpartvideotype.md: + id: a0bfeb0c3d49 + last_write_checksum: sha1:1a2341368cc20edc8bd7079293bdd6e30d795d8d + pristine_git_object: 4f7770625fa51d56a8c2dd1f5a8a96bf2280c50f + docs/models/components/contentredactedthinking.md: + id: 3a32d14b417a + last_write_checksum: sha1:650b4c62d41e28a2d60fa857e0bbe1398509fa10 + pristine_git_object: bf113b1cfd6d684de9b7facb6ebfa1982e90aa56 + docs/models/components/contentservertooluse.md: + id: 6798a1d9e049 + last_write_checksum: sha1:16e196f232841ab779bf8905afc22794c904d9db + pristine_git_object: 953787b3097aba2f080716a6c452748ed0056235 + docs/models/components/contentthinking.md: + id: 10b1c11e4c2f + last_write_checksum: sha1:f15b50d327dae998742576f3c0a3279416b80df0 + pristine_git_object: 2ccf3b1deda9e16983c7a2257e176c77dd8048c2 + docs/models/components/contenttoolreference.md: + id: 366a2ad0446d + last_write_checksum: sha1:7a1dca4d7f7992041da48be74ab04483d8b1ea22 + pristine_git_object: 83eb1fbd1d07d8ae48eeb1adff4f1e77ead502c2 + docs/models/components/contenttoolresult.md: + id: 0414d67ec586 + last_write_checksum: sha1:ff3d30e3ebde028039b3c51d9521e99d056e7663 + pristine_git_object: 431490745e86edb05e9840c1857a6ecd7c403df6 + docs/models/components/contenttooluse.md: + id: e32509b00513 + last_write_checksum: sha1:4286792aa5f18f83cb4eea0dbd6ff8945b5aafab + pristine_git_object: eebb50d3e5112e4cb69ac6888951f9bed15c90e6 + docs/models/components/contentwebsearchtoolresult.md: + id: ecb5c7a19c99 + last_write_checksum: sha1:84636c11da1069395ad8383d29c42d780a1ee6f8 + pristine_git_object: 0208fd562d438a16e08bb279b68899a93ac56990 + docs/models/components/contentwebsearchtoolresulterror.md: + id: 3fd87cce9ced + last_write_checksum: sha1:fae991e142310d367751e9c56402c1dd9e642682 + pristine_git_object: 44fff78044905c085cc7181d173f4bcef693aa36 docs/models/components/contextcompressionengine.md: id: ef623413ad1a last_write_checksum: sha1:f704ad0efed54560fed4f5a4d297f945b205288b @@ -748,34 +1329,130 @@ trackedFiles: id: 68d8c57e1392 last_write_checksum: sha1:4ab61502536581d47bbc8ad096da8f655e2c80e3 pristine_git_object: ef3619278dd51dc1c584a158ae17ac0b43669b46 + docs/models/components/contextmanagement.md: + id: 4e696aee4e7a + last_write_checksum: sha1:ef46b08adf551fd58771197e745ebac34642472a + pristine_git_object: b821cd645aeb5547278b9adb1fa0e5114be17bda + docs/models/components/contradiction.md: + id: b8c79340e6d0 + last_write_checksum: sha1:344515bb63e64d0815d3f825201275f368b5fbb6 + pristine_git_object: 540472dcc4950ae05449fa4db58feb6411bbd7ab docs/models/components/costdetails.md: id: 469c0e9fc0b6 - last_write_checksum: sha1:9b8e199702ef29e58b0da2b45fdf8871a82f7c8b - pristine_git_object: 172780c4fee55446fbc532bf44ebf50dbbce95e2 + last_write_checksum: sha1:12e7cc4256ef4085cce07d0d2573fd80fdd613c1 + pristine_git_object: 0021d8f86e8816f3ab839591e2beedc8e6f57d0a + docs/models/components/createbyokkeyrequest.md: + id: 15a30b7b1c19 + last_write_checksum: sha1:ac1ca287ee5e8cdf04067d8d9fc5b7a2c7f5f019 + pristine_git_object: 317fbd4f2e43491c23355c11d729eaf3ab1b4600 + docs/models/components/createbyokkeyresponse.md: + id: e1c835a00ec2 + last_write_checksum: sha1:33e0f05f6b4e9a433757fdeda01e171828c34b68 + pristine_git_object: 49cbe80769fcdd2ca012818bc25d63238d1943dc docs/models/components/createguardrailrequest.md: id: b844dc6d2415 - last_write_checksum: sha1:9abe24f6427d172f87fa4abc70efdf450ce8f511 - pristine_git_object: beea0c5ff3f1876074779bc17b88076c2fafe869 + last_write_checksum: sha1:000be8260978bcdff2564a09ee3977cb8f75ccef + pristine_git_object: 93fbe7a7d616fe40055f1176acc57224f6eca364 docs/models/components/createguardrailresponse.md: id: 6936a33af8da - last_write_checksum: sha1:a33d5e50d60fe47d6e1f34daa0bb98c865e6d72f - pristine_git_object: 4605f0c72807dcc3b4e385f7650531ecc71969a2 + last_write_checksum: sha1:1a02562e600d76bb15173e71f440582ae3d88226 + pristine_git_object: eebd96425ecdebcb6c20c71c8ab05f6d7ed1004b + docs/models/components/createobservabilitydestinationrequest.md: + id: 37b77a2a4120 + last_write_checksum: sha1:784ce13d9b0838cf08e2c8b337f17039766581ba + pristine_git_object: ff5f5f4e13485636f9a90bf266967258cb78bc9b + docs/models/components/createobservabilitydestinationrequesttype.md: + id: 16691be9330b + last_write_checksum: sha1:dd1fcffa747c6dc2352982d131217d78e13c3720 + pristine_git_object: 06fdda18cd47359ba0a0b596f65975e33d22704d + docs/models/components/createobservabilitydestinationresponse.md: + id: 878183c160a9 + last_write_checksum: sha1:e27e34d0730126b5932f2e0252327aae7ad19bce + pristine_git_object: bcb88c8db6efd076e6bc5c7008b92c731a8a6b4e + docs/models/components/createpresetfrominferenceresponse.md: + id: 4f3314385afc + last_write_checksum: sha1:176daf8b84927f564f9d5db554fb91fa85ce74de + pristine_git_object: 1f14c0a37522eeecbdbb271972bf0fedfbbd6e48 docs/models/components/createworkspacerequest.md: id: 7c0210437c29 - last_write_checksum: sha1:85157fb82d360cd3c4dd98e08cbbc1b107f9b42f - pristine_git_object: 7257bad3a16baebc3af2768901681ed2e6cdf727 + last_write_checksum: sha1:67e54f551edc0e743986ac634e09b8954bbcfa48 + pristine_git_object: ec9560bf33c2311acb28f1ee723d523650bb6ad2 docs/models/components/createworkspaceresponse.md: id: 484ad7c9f402 - last_write_checksum: sha1:711a8acf8d884c68c8cb9d8d69aea86d2bb3fc32 - pristine_git_object: 9cd182d3e9d2f9620101b63dde3d84bee8153d74 + last_write_checksum: sha1:b0f8e9c6fc118a1fdf44aa888c3f8bc711f6a830 + pristine_git_object: 6f359decf0c1db3b4332d747b632570f81c0c469 docs/models/components/customtool.md: id: 3300ea813340 - last_write_checksum: sha1:9ede7e709539df5f8b1d9a559a8789a0924c56b4 - pristine_git_object: 19500f5015ece9154c978a91d8ca9c7ea823e6e4 + last_write_checksum: sha1:4fb051d3c08aa1be39e51323daecb2ff2598b9bb + pristine_git_object: e11193fc15dbc2be517aa628ac028e25fe38f7da + docs/models/components/customtoolcallinputdeltaevent.md: + id: 788a45ae228c + last_write_checksum: sha1:d9302d2e8e29376a3150d43914cd5b8d7725a124 + pristine_git_object: e1401818572c2c451136c0262e74d30e0385d510 + docs/models/components/customtoolcallinputdeltaeventtype.md: + id: 77af3ba714fa + last_write_checksum: sha1:8cc34521a37d1790ba71d375104631200c02892e + pristine_git_object: f278d910cebbc0fda14dae0633a067a698a4c638 + docs/models/components/customtoolcallinputdoneevent.md: + id: 2f225977c83e + last_write_checksum: sha1:567a7a7e277ac4cf4e075d6ee96390a4ff2dc275 + pristine_git_object: 4f765e0e6ca248e8d1b7d2dd7c0565d72fdfe536 + docs/models/components/customtoolcallinputdoneeventtype.md: + id: ce7718db1cbc + last_write_checksum: sha1:248010cbec4c962f3e7d13b43e6afea700e13da1 + pristine_git_object: 25ee1adf1ec3c3600a256943294729ff6740f73f + docs/models/components/customtoolcallitem.md: + id: 3664e3eebc9c + last_write_checksum: sha1:3e6e1cfd9b91bc140c9ae855409fd95ba1b0b7e8 + pristine_git_object: 0cc8a58af83230ea0501f8587181bfe538058039 + docs/models/components/customtoolcallitemtype.md: + id: bed8ccee125b + last_write_checksum: sha1:1bea29202f21fc4a947362d4df207ff184d85010 + pristine_git_object: 1031fe485efb9180305387ec22f2dfab9baf4fc5 + docs/models/components/customtoolcalloutputitem.md: + id: ab31766c36df + last_write_checksum: sha1:28dd91f447bcdf782116159e6274609fc4ae021f + pristine_git_object: 3b69b3d6e1fa42eb27e1722c44f9a2da7d22795f + docs/models/components/customtoolcalloutputitemdetail.md: + id: b18f07fc22a0 + last_write_checksum: sha1:f0608c42ffd09f55c6230a77283407bfffdcb4cb + pristine_git_object: de7714616e1641a9584541ecb50d72b4511ec101 + docs/models/components/customtoolcalloutputitemoutputinputimage.md: + id: 8529d77b492a + last_write_checksum: sha1:bee314fd1303defaf686b091e75f085749db97e7 + pristine_git_object: 073a2512242624e0a709e36a51eae6f27063cf78 + docs/models/components/customtoolcalloutputitemoutputunion1.md: + id: "007072540911" + last_write_checksum: sha1:14b9a54100fbe58d3389bf2fc8473ef770b71f6e + pristine_git_object: 1cef654c212fac4ec4854b4c5591d101878c4685 + docs/models/components/customtoolcalloutputitemoutputunion2.md: + id: 59114479d1f3 + last_write_checksum: sha1:d447d9e5552d12a90236cc901b233daa50c9146c + pristine_git_object: dd238d2cca11f5fc5508f8cba37d4bb0af09321d + docs/models/components/customtoolcalloutputitemtypecustomtoolcalloutput.md: + id: e00ec43d5b6a + last_write_checksum: sha1:0cab8166305d5645e325e90fe79b977dfa4facdb + pristine_git_object: ec8ad6ea8afa7825d606924cb16969608ce24a9a + docs/models/components/customtoolcalloutputitemtypeinputimage.md: + id: 20beb62e97aa + last_write_checksum: sha1:2f271cf3cb97b10c726d1b88df077caff3a660d7 + pristine_git_object: 4db37ce75eb17e70454aaad8074c9e5a790f19b6 + docs/models/components/customtooltypecustom.md: + id: a869cb8937bd + last_write_checksum: sha1:5350c7f53d20c6de7157547794b16ba92cbb7582 + pristine_git_object: 7fefa582b767c38c12736612ad03046d2df69d54 + docs/models/components/dabenchmarkentry.md: + id: 9c233531334f + last_write_checksum: sha1:e1c7138c571a152f6b4bd75c107365c9b885b72c + pristine_git_object: 35febe6b09b847238841ae3e931f4e250b3cfb3b docs/models/components/datacollection.md: id: 3433301af905 last_write_checksum: sha1:9d0d6cc6232a35f34f3cdd931fdbf6202b4c5cd3 pristine_git_object: 35b7c34d60c18923d28d0dec49c7d474c227481f + docs/models/components/dataregion.md: + id: 624b9df5a52a + last_write_checksum: sha1:953e9c157294ab3b8c4c3666b34522db2542a956 + pristine_git_object: 377b76497be5f0e14081a2bc587da572bd4d2606 docs/models/components/datetimeservertool.md: id: ad767ecd8764 last_write_checksum: sha1:a6b61af4ecd6fb7f4a70dd83c9bc32b675067064 @@ -792,10 +1469,18 @@ trackedFiles: id: d183ea015bf2 last_write_checksum: sha1:edf52bb6607c00eb6d5b823defbe7cb8c887b67f pristine_git_object: 7415823094dfbbf23f782ae7e1c1a0d8b2cc3ead + docs/models/components/deletebyokkeyresponse.md: + id: 77d6c5fc7952 + last_write_checksum: sha1:c09cf025839934614e5a311a30f54d2794c04629 + pristine_git_object: 8fd4ae408ca233ee53e88a6652a67947b117416f docs/models/components/deleteguardrailresponse.md: id: 47a6f55589ec last_write_checksum: sha1:a7a96211f15e8f4a1076ba3b8572f00753ad2189 pristine_git_object: 2f6441b142a321ebd82ba6f31ae869bce991d6e8 + docs/models/components/deleteobservabilitydestinationresponse.md: + id: 7651a6a8298b + last_write_checksum: sha1:c22d196ae9974ac937879d21e143fd6f67000f77 + pristine_git_object: 5baf708a7785ee316dc0d65c6493cc3f56dc3ea7 docs/models/components/deleteworkspaceresponse.md: id: 90ec73ca924f last_write_checksum: sha1:3cbe911844906e014f9527df8428ad34b55c207d @@ -806,12 +1491,8 @@ trackedFiles: pristine_git_object: f947497fee86d31818d22109e25a7199a742bb3e docs/models/components/easyinputmessagecontentinputimage.md: id: 6e2767e9515e - last_write_checksum: sha1:e968544c73a0970c3b29720d52c781d2ac6ea7e9 - pristine_git_object: dc3758108ff042ddb15141090459324801fff5c6 - docs/models/components/easyinputmessagecontenttype.md: - id: d650cc5b127e - last_write_checksum: sha1:aab986c5352d1e64afa5a7b969459a47e9cda789 - pristine_git_object: f246739b04e39cdb85a515203f50dadded4e866d + last_write_checksum: sha1:283aa1f4ab2dde658183887afedea2b37cfeb4d1 + pristine_git_object: 3cd649473aae314876ac071e38a30a708426b0a9 docs/models/components/easyinputmessagecontentunion1.md: id: 55786c6d3e36 last_write_checksum: sha1:b8ae9993c116799266e77fe06c7bfa3d4cc8826a @@ -822,8 +1503,8 @@ trackedFiles: pristine_git_object: 3f1f73da5d07697d623e662eb61520bd73e56fd1 docs/models/components/easyinputmessagedetail.md: id: f91321ba978d - last_write_checksum: sha1:822c0b5bde7dcd3aa2f440d4a2ab372afee7427d - pristine_git_object: 802b8a944b12a149b258fad26fb1077f33636b2c + last_write_checksum: sha1:5eecc5fd1366c379f90ef94572c9c4fb6591da6c + pristine_git_object: 629806b585d2ec2bf27d75d5bfc97eade7d31b76 docs/models/components/easyinputmessagephasecommentary.md: id: 94ea8925dbcd last_write_checksum: sha1:1ffd757f024d6038ceabeee6c2c48257ff07e6fc @@ -856,6 +1537,10 @@ trackedFiles: id: db44653678f8 last_write_checksum: sha1:d506aab96824bf6f2008023ee746ffcc9c41fe39 pristine_git_object: dd19fa6786654db6c2c7e6660d61e1a53b3a48fc + docs/models/components/easyinputmessagetypeinputimage.md: + id: 5cd1034010d2 + last_write_checksum: sha1:cbf4beef9d86cd727d124a23ddb4e05e80229cb1 + pristine_git_object: 978f29ea915ce5017b49e3206cac3c7177799b8e docs/models/components/easyinputmessagetypemessage.md: id: ae7ad98feb36 last_write_checksum: sha1:8a25804cbfeeba1616ef25b60ba817dabfa88ae7 @@ -864,10 +1549,38 @@ trackedFiles: id: 45f413beb0c0 last_write_checksum: sha1:cba2b5d474013cd980c90f6de732e71a54f40204 pristine_git_object: d53612b58f1b5cf9482ad6996d5626bdc7d71291 - docs/models/components/effort.md: - id: e4872c8b3271 - last_write_checksum: sha1:08dbf7f0e3f5dc8d51eca51308aabad8761dcab2 - pristine_git_object: 6c201f66926036335af4eb6d0935a311c1620fc8 + docs/models/components/edit.md: + id: d71821318cfb + last_write_checksum: sha1:3e1520109dadb022a487d1c7c70f28d614ac7f4b + pristine_git_object: 7bcb77d0ff13536adb000778dc858bea02f37e8e + docs/models/components/editclearthinking20251015.md: + id: c2cf61214585 + last_write_checksum: sha1:91c482924bff5f010fc09d4f6d179b24e39312e2 + pristine_git_object: 76d58e8ab073d32ed8b19eece4443a79d169611e + docs/models/components/editcleartooluses20250919.md: + id: f58774a36598 + last_write_checksum: sha1:e8d272c205ba2415f3e2fc2f9ef3023ee023fc40 + pristine_git_object: f9e025f0790b8e0af390eccab9117cb131290429 + docs/models/components/editcompact20260112.md: + id: f0011a175005 + last_write_checksum: sha1:3b67f2e863d9cd62791ea65d741bcdb6e67a532f + pristine_git_object: a03637f1285f4ce948fd51908398d1c15276e789 + docs/models/components/edittypeinputtokens.md: + id: 29d7a6df1a96 + last_write_checksum: sha1:a3d2cce4077963a894ba42adbe74046bc857de5f + pristine_git_object: 04c46d2c4d37ccd1291ca04373ec905cf5313e2b + docs/models/components/elobounds.md: + id: bbcd8669fedf + last_write_checksum: sha1:7cb274f88e1569d83ebe65cdfb1e92d7c7356db3 + pristine_git_object: 2764b5668f3de6f5a30758cb1b8c469d59192563 + docs/models/components/endpointinfo.md: + id: c31d4a4b3194 + last_write_checksum: sha1:1d91536077a993620789678df23a20c36820a031 + pristine_git_object: 16c89546329ca328830b3c9fd922d1455dfcddcc + docs/models/components/endpointsmetadata.md: + id: c8ed25b59887 + last_write_checksum: sha1:b2e6f112ac063677c9133ff78d52bfe74bda4a80 + pristine_git_object: 8ea541dd4151fd1025928182e7d9ae61f9f00565 docs/models/components/endpointstatus.md: id: 66c759e13632 last_write_checksum: sha1:9b8d4e29e9da93a7258195af443c724f13002111 @@ -880,6 +1593,10 @@ trackedFiles: id: 8ccbea40d025 last_write_checksum: sha1:c9d91f741c7c138fd4ca6f9068b4cd0ba7730ed1 pristine_git_object: ca83e4d7fa561f8125647aca9a58ab453ca174ec + docs/models/components/errorcode.md: + id: e163472f05d6 + last_write_checksum: sha1:b3cc45586abe6c17b9e6858164e3417a91d56ad2 + pristine_git_object: d886e4468869d809402c615d2f345e2646149a75 docs/models/components/errorevent.md: id: b791b1e2fdad last_write_checksum: sha1:12657ac60092af3e5e2069b6459298c8dcaab109 @@ -888,6 +1605,14 @@ trackedFiles: id: a96f404b8cf1 last_write_checksum: sha1:37ec05cc64b1d7eb2fb1f880cfd25cfe56d533e2 pristine_git_object: 7035f119e61053a5a89fe00e375a7481f7fbe452 + docs/models/components/failedmodel.md: + id: 79efa8ea2a3b + last_write_checksum: sha1:350258a45138e1b6ff21256e160eca7a44c0bef4 + pristine_git_object: 144474f995d7ff976aa8703338284bb9c6215ff7 + docs/models/components/field.md: + id: b7ec0207b40c + last_write_checksum: sha1:3d14025fa6ae3753a365c2a1447d080fb895cf44 + pristine_git_object: 3a07d0e35de9efda2bd6b51feca1d4008c328106 docs/models/components/file.md: id: 1324b27cb7b6 last_write_checksum: sha1:60aadcd6067d583169d89b60c7f0431a1e844e86 @@ -900,6 +1625,26 @@ trackedFiles: id: 17db26d81450 last_write_checksum: sha1:7d7ab90fc1e43a356abcf4da4c7c0fd03688aa95 pristine_git_object: 87390fccf63624942dc8da02d4d51f2294b13489 + docs/models/components/filedeleteresponse.md: + id: 90402001b934 + last_write_checksum: sha1:11d6a36ab50b9faa4f30c446e8ef706448b648d7 + pristine_git_object: e33b53ecf315c2d81154e6586fdc6fe3f4383428 + docs/models/components/filedeleteresponsetype.md: + id: 1fac9521347c + last_write_checksum: sha1:5f0f015bb358a61a8d4d7f9679deecac95734b5a + pristine_git_object: c3277cdfb3d01cea8b9fc8db6a2335a77937db6f + docs/models/components/filelistresponse.md: + id: 24a673645df4 + last_write_checksum: sha1:3221c0cefb5af887129be035d69bb3705e58c817 + pristine_git_object: 5089d131543a6be7397da4c498680a000ec049cf + docs/models/components/filemetadata.md: + id: d4a44f56e8f1 + last_write_checksum: sha1:070a3aa7fa7028614439191b5c5fbd63dce5906f + pristine_git_object: 48f44c22ab27c383aca008d8d29f8b544dd3862d + docs/models/components/filemetadatatype.md: + id: f5baf164bf0b + last_write_checksum: sha1:d7f6ac6b444916e4be1a1eae8d1baf640eb0071d + pristine_git_object: 35111dfe6edb0fdde684508fbf74358a87e20c0b docs/models/components/fileparserplugin.md: id: 9e22f7c81ccd last_write_checksum: sha1:126126a147c25e6e9132e4b5e8b8f2939ed46b46 @@ -920,10 +1665,18 @@ trackedFiles: id: 19b2f82705a7 last_write_checksum: sha1:1ae640f0d41225e478d183251bc0df1d34dbfc88 pristine_git_object: 3c9a7ff9f7f2275d2806143cadb0546f833bf76b + docs/models/components/filesearchservertoolvalue1.md: + id: b33941ad8bde + last_write_checksum: sha1:3792edb26b6ec3e2a097b8a87668e700f84095c1 + pristine_git_object: 290dcd386d1f6535d3d5326b2443cc6ffac8f22a + docs/models/components/filesearchservertoolvalue2.md: + id: 118113231d79 + last_write_checksum: sha1:0daa6da47e876f298821fad835be1d00753bad8a + pristine_git_object: 99ea39b86a402f74f3f3c1dab584145cf1ec029e docs/models/components/filters.md: id: be92131899b5 - last_write_checksum: sha1:7bb653e677f75d2e30e4afcdd8391785316810a6 - pristine_git_object: 2a6b168e47292951045828d1d1ee90a1bc209861 + last_write_checksum: sha1:99721d99da12eafb28d23af4d1eb9db62ccb6e95 + pristine_git_object: 9e4eeeef7866d865f46180ff7992bd3da729f795 docs/models/components/filterstype.md: id: f43e0a88cebe last_write_checksum: sha1:e2c3cd7d7e74394535c99c9f014960d85f94434d @@ -1022,8 +1775,8 @@ trackedFiles: pristine_git_object: cb724cff2414d11d71da7faaddf7ae2ba650a208 docs/models/components/functioncallitem.md: id: 7a0b37b13859 - last_write_checksum: sha1:ef53b21b1056af6944a85d1f1a2ca2e9da7fde2d - pristine_git_object: 8c5a2a85d7da566bd3d5d1dbe8202eda112e4897 + last_write_checksum: sha1:a2c6abc20565b5c7492027df65c42d027ac661f0 + pristine_git_object: 11f98d1d4ef3845908d25271f7f9352416f6104e docs/models/components/functioncallitemtype.md: id: ee9e82ab834a last_write_checksum: sha1:9106131d8862732b7c78ab3388b67794bc3a750d @@ -1034,16 +1787,16 @@ trackedFiles: pristine_git_object: 72320d985a5e5b4ec64e7ef6707348dd7247a787 docs/models/components/functioncalloutputitemdetail.md: id: 111e9c98353e - last_write_checksum: sha1:7a0e8b2a99f1ecf530a2ee5203a5e797ad72e982 - pristine_git_object: 649613929050a3a9debf17ce579b0faaa1f31d44 - docs/models/components/functioncalloutputitemoutputtype.md: - id: 7215778e0707 - last_write_checksum: sha1:2eb5221099e7d091decf9f4412f5ea6d0d7d51a0 - pristine_git_object: 3bed8504ba7725fd78658944305af9d94a1f344d + last_write_checksum: sha1:b547ff3d259ec9e67ee15dd2bdd37e1d7e80e2cd + pristine_git_object: 075d5270d20c5668181fc5b8db6d502b7fccb27b + docs/models/components/functioncalloutputitemoutputinputimage.md: + id: 346425f99218 + last_write_checksum: sha1:0967ec1f015a583f1f8f4199f3af3c754323810d + pristine_git_object: 972e487f341d84a4b5c461ad1cc43ccecd183a1e docs/models/components/functioncalloutputitemoutputunion1.md: id: ea4ef4e042cf - last_write_checksum: sha1:df793b425788e6533f377f8e9d9611f21574b47d - pristine_git_object: c81e70e7f667244cb4f7e1ddb0c6e5adb420d1b7 + last_write_checksum: sha1:014021c7be3da588431a82b74349c0005f0fb3bc + pristine_git_object: 8c921e4bfd76586ac4b2be3d3d0c0054ce6f7e88 docs/models/components/functioncalloutputitemoutputunion2.md: id: d6a04b309450 last_write_checksum: sha1:48de37cdf83a8dfaa142802bf8d5f7924c2c8445 @@ -1056,14 +1809,130 @@ trackedFiles: id: 109e6f149281 last_write_checksum: sha1:615cfb168cfb21177c9a9554f705f3a571742cdb pristine_git_object: 11749667aa19b6ad1a16b163423a08bc6006c93e + docs/models/components/functioncalloutputitemtypeinputimage.md: + id: 380a7eaa98ad + last_write_checksum: sha1:b4da250de5ee5f7037ef93812d5365c12177f8b4 + pristine_git_object: 27198f3ff9230580b4694d9da7f63f99e415d782 + docs/models/components/fusionanalysisresult.md: + id: be77ad6e4622 + last_write_checksum: sha1:6d496c8a4e64941fe4259cba0ac96b3cc60595c6 + pristine_git_object: eaaba7edd141ce25359fb81153656aecffd6c84b + docs/models/components/fusioncallanalysiscompletedevent.md: + id: 46f9c32e2598 + last_write_checksum: sha1:c481f613781b5bc54d6a06f1f9562131074569ec + pristine_git_object: 66dbdacc2f703543e0c931661ca8a96516dcd72e + docs/models/components/fusioncallanalysiscompletedeventtype.md: + id: 9c00304201bc + last_write_checksum: sha1:7cffd691b20ea6b382404e2dafb27f68555780be + pristine_git_object: dd4ef98ba48a6a3e1543087548e4402c41161e04 + docs/models/components/fusioncallanalysisinprogressevent.md: + id: ede30803c31a + last_write_checksum: sha1:be334f91292ab0d14efa9778e07f01f40122a2b2 + pristine_git_object: 1ac4aea29b115d89908741dbaaa61ce9f638a246 + docs/models/components/fusioncallanalysisinprogresseventtype.md: + id: b706483a8bd3 + last_write_checksum: sha1:ed65c92d7859278bbdb02aa89b915a535b53530f + pristine_git_object: ded430147472bc026a7d4640d16ba6284399de68 + docs/models/components/fusioncallcompletedevent.md: + id: 258f6f3c83bf + last_write_checksum: sha1:6108d78f7597960f244624bb47d9957e84e3b510 + pristine_git_object: 90b1114f3fe92438d2e11036ff371b2a39f7d9a3 + docs/models/components/fusioncallcompletedeventtype.md: + id: ecac6a065ab0 + last_write_checksum: sha1:bb8a9be310548c18b5c4ebdd07a25465781a3474 + pristine_git_object: e581d4d42d30fa5dafeb8b539f309c53fbc1cb9a + docs/models/components/fusioncallinprogressevent.md: + id: bf4e20d2864c + last_write_checksum: sha1:cceb59e7908a269fcd5216a2441be1756b8d1211 + pristine_git_object: 879ad6aac96a9a5d2b95103af39ce2e4a8025ab7 + docs/models/components/fusioncallinprogresseventtype.md: + id: 1ba864a604ed + last_write_checksum: sha1:59c3388a53c3590c929e5e585b68ca5379677607 + pristine_git_object: 0215b06e165bf150392576ca3d90e39e1ee5babd + docs/models/components/fusioncallpaneladdedevent.md: + id: ef5d8059ab85 + last_write_checksum: sha1:c5150fdbdbb370c2232f8fbe563f065671088436 + pristine_git_object: da42ef4de25a287fd326212d5078e3e7286038e2 + docs/models/components/fusioncallpaneladdedeventtype.md: + id: 32d539581f22 + last_write_checksum: sha1:b96df92585b28e0e640f5c694ee2519b1b8f6814 + pristine_git_object: 943b08f563e6aba0b4f74a3cd4a10b950de22df2 + docs/models/components/fusioncallpanelcompletedevent.md: + id: 9bd6f9215684 + last_write_checksum: sha1:04f75613db75fe24c78cebc43b6cdcd8a9c968c2 + pristine_git_object: 20aa62f5c20cc7a511e3c5670c1c2c2306b138f9 + docs/models/components/fusioncallpanelcompletedeventtype.md: + id: 09e74b0c89b9 + last_write_checksum: sha1:d756e7b40fbfbe0a98c8ea22463322c140abb1ba + pristine_git_object: b4e6b6547add5a51ac1c478082ae8559e84dab80 + docs/models/components/fusioncallpaneldeltaevent.md: + id: 39cd1c616929 + last_write_checksum: sha1:15ca1afcbadebd9c92ef09640cd4a0b342c7b878 + pristine_git_object: 03e2f0439e32a32f85e19a591c76968531ba5ef6 + docs/models/components/fusioncallpaneldeltaeventtype.md: + id: 1273855f22c2 + last_write_checksum: sha1:9c22e18f86334384c433b090476a63032a216612 + pristine_git_object: 4e6e83df335e2ca20e787c456172ffed6ca46af7 + docs/models/components/fusioncallpanelfailedevent.md: + id: 49efadda8cf0 + last_write_checksum: sha1:33f67115911ee1d4de3067edb2790b92a77ca8a3 + pristine_git_object: 8b9f5baf9da7eb2f556c4630da56ab1ecb2b3b0d + docs/models/components/fusioncallpanelfailedeventtype.md: + id: f23d3ec6664a + last_write_checksum: sha1:b343d3bfdb3f47b5fd8fcd3033de81cc812e39da + pristine_git_object: 707dfa422804af2eeaf714c20b3e047a7c2b9f9d + docs/models/components/fusioncallpanelreasoningdeltaevent.md: + id: 70d071d7b307 + last_write_checksum: sha1:bc78b6fb0785f6367b8ff04c4f23b2114c2ae5b4 + pristine_git_object: 2bc0e1755100d74e2812746492dcd7e48df54bc9 + docs/models/components/fusioncallpanelreasoningdeltaeventtype.md: + id: 05dc4151bc33 + last_write_checksum: sha1:a1bf9263c5a2c0c4e20bf50cb0decef404f456a0 + pristine_git_object: 116c36a6acfdfa5279d3596e8256ace4c0fac1da + docs/models/components/fusionplugin.md: + id: c613af321ccb + last_write_checksum: sha1:68a5d3a63c55eea5da421a33569262076fb8decd + pristine_git_object: ae7186f5237b248c152d3523c503323cd2ac743d + docs/models/components/fusionpluginid.md: + id: cd512b4e857a + last_write_checksum: sha1:81a7d7014206ec26a2a495f0d5086a15ab3959ec + pristine_git_object: 368bb7d4b2cea3ed496c624bcaed333d9f29cf53 + docs/models/components/fusionplugintool.md: + id: 42f047a29717 + last_write_checksum: sha1:b92e8211f1b151b9dbb10174c0d5ec234279cd11 + pristine_git_object: bba489b172f06f6dbbf54b264824a8f5a696110f + docs/models/components/fusionservertoolconfig.md: + id: 69df78f2434d + last_write_checksum: sha1:09705615a575ba26e92d3b76ca46181f1f5ed6d3 + pristine_git_object: c8513720d52a456df4571bbc9b291fe4a83b1e9b + docs/models/components/fusionservertoolconfigeffort.md: + id: 734f8b701071 + last_write_checksum: sha1:1dbf6edd83ec41a864709e98c16ed9276459ad44 + pristine_git_object: bd6d257baf738064d0a81e6c84a70bf4cdf5b8f0 + docs/models/components/fusionservertoolconfigreasoning.md: + id: ff321b3abb87 + last_write_checksum: sha1:25aa412f5abdcc7e1c0aa324ea508d4a890540b5 + pristine_git_object: 4972d47e1d018a8161b5fc4f6eae75f15147a959 + docs/models/components/fusionservertoolconfigtool.md: + id: ba4c3d28af55 + last_write_checksum: sha1:4f5207822d42f5d0f3f6e1071328e23bd81988b5 + pristine_git_object: 757f9d1a2de83d4ff94c2b234a198f5771e89af5 + docs/models/components/fusionservertoolopenrouter.md: + id: 2066e2b0f65c + last_write_checksum: sha1:84f3fd13373c8447e0941e42357d4cd6fbc6d8ef + pristine_git_object: 62946cc99c58dd66d2357b008d485682d384166c + docs/models/components/fusionservertoolopenroutertype.md: + id: 8e3f9efb833d + last_write_checksum: sha1:6bbfeac38614e3078f85eadf6b8ea6a435602753 + pristine_git_object: 8a15d3d15c1da57b977e452c67e5ed0c3dfe7dc8 docs/models/components/generationcontentdata.md: id: d1de7373e133 last_write_checksum: sha1:a2db60dea82258b2de4d077d4bccb42b838b7acf pristine_git_object: 57b74f2fa33da412a12430e771380f3ec098ed42 docs/models/components/generationcontentdataoutput.md: id: bbc2f7c41154 - last_write_checksum: sha1:fe15a4788687408588feeec205e8e3f3fe9a1851 - pristine_git_object: d267ae5ca78aabdbdfae899bb86d091c1ad26461 + last_write_checksum: sha1:8ad946394ce4e0a5d878dced1ae233364ca373e2 + pristine_git_object: 03ccb3a335fe98ba97c8893bbad6e766bb0a982e docs/models/components/generationcontentresponse.md: id: 286dacaa187a last_write_checksum: sha1:986259701f1111591a3c8407e3d2440c3cc5836e @@ -1074,20 +1943,40 @@ trackedFiles: pristine_git_object: df50fdfe93cae1d482ec7fc7bf6daa3fb457e4af docs/models/components/generationresponsedata.md: id: 6b57fc3150a9 - last_write_checksum: sha1:5dbbfb15db29d96e078f5eb8496f02b3a8383cd3 - pristine_git_object: a80be725785d0c20d7ad896ef0908ad91823bfa5 + last_write_checksum: sha1:b783688bd6926f7298e1ffb348feee0e38ba7d23 + pristine_git_object: 36dac265ec7b8dbfdb23712a78afe07f792194ea + docs/models/components/getbyokkeyresponse.md: + id: 7db0880f5e88 + last_write_checksum: sha1:31c4a107ee2c4f43b081cad938bf60a993905a66 + pristine_git_object: dfe12781ffac3072fb6d261511cf2514a6f2666a docs/models/components/getguardrailresponse.md: id: fbaa98e5e4e8 - last_write_checksum: sha1:3a141533e60ff9edbb85c342a22d3395d9d2a3b5 - pristine_git_object: c18e67ea9783fb576e12b24d18c13fdddc3dd26d + last_write_checksum: sha1:32d0651ca0e5cda11e9905bf3bbbb4e15f89d606 + pristine_git_object: 2ac177023c7535b1090ea4e07a4223976fb750fe + docs/models/components/getobservabilitydestinationresponse.md: + id: 0b0660a632e7 + last_write_checksum: sha1:d6ba6d362bb94c957a16383742d8abec8ac0907f + pristine_git_object: 8b0bcafe01ca455ac3ff81f0273e8fc870a3d7bc + docs/models/components/getpresetresponse.md: + id: a8570b2005a5 + last_write_checksum: sha1:c87e8c73bdafaacd06a5effdaf7bd1b8cbc02388 + pristine_git_object: 39fcec1d6f783ce10018a812bbddcb99206055a9 + docs/models/components/getpresetversionresponse.md: + id: 25b2fa6961ec + last_write_checksum: sha1:6c48d020661da804620d06db075f34c1f8c14f51 + pristine_git_object: 9559491c074866dc5d34c42830126eb58a5b249d docs/models/components/getworkspaceresponse.md: id: 460f657c1d8a - last_write_checksum: sha1:205a39c545528a11125cad667f93fcc13b6a623e - pristine_git_object: b1832df811b4ee4985a012a0d7c283e80d7b7c8c + last_write_checksum: sha1:fa6ab723dfeaad188bf2e822752ec5ad61dfb361 + pristine_git_object: 527992cca2dc0388b8d75b127a1b7d70b22ddb70 + docs/models/components/group.md: + id: f89a5bb77672 + last_write_checksum: sha1:63535ad329db9f5893000127bcac607f05d680ed + pristine_git_object: d3b7a0053eb9651f586a2ada1458fead258dc7ab docs/models/components/guardrail.md: id: 25871012ce60 - last_write_checksum: sha1:9eec2fab10a3132643be68a6a4cf7d28cecbf1bb - pristine_git_object: f76fcbabec9e0415a2ec16a1c608f8419779e024 + last_write_checksum: sha1:29fb66793304489412a87cdfd704cca6ce7297f5 + pristine_git_object: 94e1d4deb4658e30690fa40a581fbad3be176425 docs/models/components/guardrailinterval.md: id: 93fea9e27961 last_write_checksum: sha1:bdd75a29da4b64a757530833fc28adda388fe598 @@ -1202,8 +2091,8 @@ trackedFiles: pristine_git_object: d07270940fc671e629ab34e6672a74be791c3295 docs/models/components/inputimagedetail.md: id: 45b28cddbadc - last_write_checksum: sha1:9075e6252b4108a406ffcace53ddb914c1ce63fd - pristine_git_object: 73142de10e7ef4e872d187353adf36067f241314 + last_write_checksum: sha1:b23982e439deaf6f22c75945d3c484fd4fe40ad2 + pristine_git_object: ffb72fef5af04407b3e832c93d7d0fe62b3029ed docs/models/components/inputimagemask.md: id: 3a06718a7784 last_write_checksum: sha1:7cece974742fede4cd4afb19a748662fc7c4a6cd @@ -1218,20 +2107,16 @@ trackedFiles: pristine_git_object: 89a95a4fb9195266e929e190edf5ede025769528 docs/models/components/inputmessageitemcontentinputimage.md: id: c1dc28fa6f7e - last_write_checksum: sha1:a3e09ad55fb23399686255bb9ca2224fc05e3a17 - pristine_git_object: b7054739c3216a367f9a94a7788d969fda847184 - docs/models/components/inputmessageitemcontenttype.md: - id: 6a10f3b4c660 - last_write_checksum: sha1:4245d5d6b49e5dfea2f5480b959ddb598c30030f - pristine_git_object: 5f53764e098fea896a2222b2f3da92ece92fda60 + last_write_checksum: sha1:548e5390147c7e4a6aa5d0a7d77d696dfa06f46d + pristine_git_object: 1d2accfe9fae8ef8a612606416b1faaf8b6fe290 docs/models/components/inputmessageitemcontentunion.md: id: 595d288beccc last_write_checksum: sha1:e337501fb6a3fc3f0e600ee8dafe4bc963bfa2fb pristine_git_object: f58e7d587775903f4274fa69773a895fadab557d docs/models/components/inputmessageitemdetail.md: id: 85e21922789d - last_write_checksum: sha1:8940063c5b06687dfae280a60e7d730904d29029 - pristine_git_object: 91863ccfacc7a1d6136958efe0aaac8da1a66a45 + last_write_checksum: sha1:56686541e84351e52fda6898fbb7ee6b8702af68 + pristine_git_object: c8e85896aca697e8a0b9f2771b9f230c3ae0d337 docs/models/components/inputmessageitemroledeveloper.md: id: 059e168b6c04 last_write_checksum: sha1:24c470f613aa1e64ded63cde87e4eb4550bab0a2 @@ -1248,6 +2133,10 @@ trackedFiles: id: 8984ca2db85b last_write_checksum: sha1:3aa0257cac195dca95d4a6c2640cf2b398530ed9 pristine_git_object: c89f8d928afed321b1dd9d5213736195110b37fe + docs/models/components/inputmessageitemtypeinputimage.md: + id: 7c1c1f30a536 + last_write_checksum: sha1:7de5473949c7e297e6ae90da8b0947ab363ab8c4 + pristine_git_object: 51e3d6c14afa37153e361140e5e3e85baf81831b docs/models/components/inputmessageitemtypemessage.md: id: 37d812509733 last_write_checksum: sha1:2237da5faf10c7a04b21ca5eeb430f220c165aad @@ -1256,6 +2145,14 @@ trackedFiles: id: 74c592f7b16b last_write_checksum: sha1:2e0f3efd656329d0e1e50b8c6b46aa5078ced732 pristine_git_object: 38b4d88db5867b1917c05a0a848090b91d85dabf + docs/models/components/inputreference.md: + id: 71d841d51fd4 + last_write_checksum: sha1:5332a28dee8a3b5d83f0eb753ce484b164d4dbd1 + pristine_git_object: 16408789a4425b9f23f6ad6dc229060151ee0238 + docs/models/components/inputschema.md: + id: 7b98238e0872 + last_write_checksum: sha1:f1c757ee58f62cdfdff422a68476c829e5e0868a + pristine_git_object: 12fc3ec54124f116c75bac830be13a6dcb36edc8 docs/models/components/inputscontent1.md: id: 0f1a5e285fc9 last_write_checksum: sha1:b5b942f8e32372040a5e4856543a654dd76ed777 @@ -1334,8 +2231,8 @@ trackedFiles: pristine_git_object: a124896de5195d8ec1598978830b9def241e3b5b docs/models/components/inputsunion1.md: id: d4f8f367ccc7 - last_write_checksum: sha1:3c9a5c82ff0389c59c2a9894f8dbd4a580205503 - pristine_git_object: 1ef29d7383f59f988bf90ed4ace9d75916c84d52 + last_write_checksum: sha1:259bc79d1c5d9a10cb022230d5b1d33ff59e1f26 + pristine_git_object: 2b792574dd68cddfbf586b3c64761f906107ca98 docs/models/components/inputtext.md: id: 002f3c600e78 last_write_checksum: sha1:ae87be85873c9d60d5b8cf7a9b54ed038056f095 @@ -1368,6 +2265,30 @@ trackedFiles: id: bdd1fc76dc89 last_write_checksum: sha1:1e3f6850bb384a64874c58a45414b2c91001db0f pristine_git_object: 3dbbf4ca040adadbf0ac397645dabe6e27fff069 + docs/models/components/itemreferenceitem.md: + id: 88236b8e14d9 + last_write_checksum: sha1:296b2c1228e4aa9eb02410ef5dea7891828dde3a + pristine_git_object: 36fd18286b902e202fa0ebedc4778254c6e0f10e + docs/models/components/itemreferenceitemtype.md: + id: ec081cca1696 + last_write_checksum: sha1:5cf4fbf89c718009ebc06500cf2791f1b4e383e7 + pristine_git_object: 4095cc572174402f6eb6293bff52b46f825bda38 + docs/models/components/keep.md: + id: 459e2d3bffbe + last_write_checksum: sha1:2993aa53a1218c6ebeb76cca615ffdcf8e40a46d + pristine_git_object: a17c40d4bca3140d6e47c0f49aaa48ef10c814ba + docs/models/components/keepall.md: + id: e16066240af6 + last_write_checksum: sha1:79ea376255b87af9beb19d58c0cdfd06d49a0624 + pristine_git_object: 72ccebc0fd0478482fc1b6248f4c829ef37ae2fd + docs/models/components/keepenum.md: + id: bfa6163fd494 + last_write_checksum: sha1:a9872d43713b1c346f35504df50b813021fd3350 + pristine_git_object: c0c9251187074420f806659eb045b762de3b94fd + docs/models/components/keeptype.md: + id: 740ee4d5f374 + last_write_checksum: sha1:eed6cbc7335fb57be4dcb3341c34d2208a80414e + pristine_git_object: 8d1ea999c064b7a85a1013050c6c5540df35dd48 docs/models/components/keyassignment.md: id: fa208f5584a7 last_write_checksum: sha1:3054e1715b1060975a6fef64e316b67683322ada @@ -1382,12 +2303,16 @@ trackedFiles: pristine_git_object: 2b0ceef3a140c2d5d048f535f71fbe1da854bf89 docs/models/components/legacywebsearchservertool.md: id: "0995730880e4" - last_write_checksum: sha1:6636b95010405880f8d2512b1816652d9c29c857 - pristine_git_object: 7c933a5f5ab2055d142695df28c00de1763e03d7 + last_write_checksum: sha1:05610b315ca2b0b5bc777c38414369a0c4da6076 + pristine_git_object: a6f140c0205f274d2f40d38fef18f5f82521f1de docs/models/components/legacywebsearchservertooltype.md: id: 156a44bc6a24 last_write_checksum: sha1:9bab6c039ae8b8737c1b1a8321987c24a9dfda89 pristine_git_object: c30eb4b2862e95d21e4d7c52340de8d53101803f + docs/models/components/listbyokkeysresponse.md: + id: b875e15a9f3c + last_write_checksum: sha1:99558ee25fe67f7244b434b983006d2b1ef846ff + pristine_git_object: 9a42a0e80e6819aed9a55520b4f715df5996580f docs/models/components/listendpointsresponse.md: id: cdafeaa04fd4 last_write_checksum: sha1:6cc26c34e121447007071ffe3cddd5d6d09e92b0 @@ -1404,10 +2329,46 @@ trackedFiles: id: 309a2b940104 last_write_checksum: sha1:231506e9024152c132c32cb153b0e5ffcd4bbee9 pristine_git_object: 3063e3b0ee3fc0a40242b0f0ac073323d295b28a + docs/models/components/listobservabilitydestinationsresponse.md: + id: 7ff26791c37b + last_write_checksum: sha1:e8011b6fef6754cf93c550fe384947ed80b86ee3 + pristine_git_object: 3987e1c45befa493c6ce8dfc0a9ccd9e53308cf7 + docs/models/components/listpresetsresponse.md: + id: eef2f71b2b03 + last_write_checksum: sha1:3c6bb18fa8504a7d258e8d63755b9ab465db5858 + pristine_git_object: 04a71bf2066ce7ffa8af509e3f0e4cb99aa73835 + docs/models/components/listpresetversionsresponse.md: + id: 1e64a874981d + last_write_checksum: sha1:a1ff06abecbab0d7a1367b3873213808282aa30b + pristine_git_object: 1ab37956dda34a4550c483d86faae467dfa0534d docs/models/components/listworkspacesresponse.md: id: b2dee94f4d66 last_write_checksum: sha1:a31f3c5c55061571a920e0415d250b0eae9281b0 pristine_git_object: 543a6347966514a01e3664025eec6d1da3e17b13 + docs/models/components/localshellcallitem.md: + id: ae4d403b7a1d + last_write_checksum: sha1:851024bbbebff741545ebefcf5d88c20353d62f5 + pristine_git_object: 8ff095f46053f2981c9662ac829661b1784704f7 + docs/models/components/localshellcallitemaction.md: + id: 945f90d69ddf + last_write_checksum: sha1:907bd9b5d0b62beecd23e0b47ec590798d57e99b + pristine_git_object: a94eb6e330b2532149aa4f1be37861ac05e3b7e9 + docs/models/components/localshellcalloutputitem.md: + id: ab210eb92553 + last_write_checksum: sha1:533e4fd9a7d8fdeae828b52086cd2dc59ed64a3b + pristine_git_object: 8d43d8809687a6fa4a8ad587af11d204ab669ccd + docs/models/components/localshellcalloutputitemstatus.md: + id: 7ae513d34a0e + last_write_checksum: sha1:b8688568a286e562a9104171abf2f03cc9f76d3b + pristine_git_object: 15cc696c418748c68780e1978a961850164b0740 + docs/models/components/localshellcalloutputitemtype.md: + id: bd99738294ce + last_write_checksum: sha1:9fcd83e53a71278d5f8b19e54dfd2b0bc9ef45dd + pristine_git_object: 48acb94ed8321892a48c56a246820f863a0bb9a0 + docs/models/components/logic.md: + id: 316142189e5b + last_write_checksum: sha1:94e5151ffc71ad329ec8cc1c65a1081f409e702c + pristine_git_object: f6eba20b0eab5b44a3a11a163fb01e39eb7f4b5a docs/models/components/logprob.md: id: 4afa632685f5 last_write_checksum: sha1:f5346169fa0a9f121b0db224d996e3fbe0ca04e1 @@ -1416,6 +2377,42 @@ trackedFiles: id: 6aa347f0cdf1 last_write_checksum: sha1:9ca0d69207932a26baf05337ebce86d88ec2a9be pristine_git_object: 477f732c38da1f08b65320f0b42dd3ebf98d2129 + docs/models/components/mcpapprovalrequestitem.md: + id: 92d6903268b1 + last_write_checksum: sha1:07afff9e98ddea2f77aa9f0fd412712011f94ed9 + pristine_git_object: 2a164015e23ede50f745a62fca94442df674ab82 + docs/models/components/mcpapprovalrequestitemtype.md: + id: 7b006165fd59 + last_write_checksum: sha1:9549f51e0f6581f3846d353968ae43541058f58c + pristine_git_object: 4e2248a94087b5634520923d3fa34b1bdb23df65 + docs/models/components/mcpapprovalresponseitem.md: + id: 9705ebf37092 + last_write_checksum: sha1:6bc15bd47e5f2bf0df3bd95cdf77ab5bdf1ac44c + pristine_git_object: 497329f7d6b6aa45bee3e3cd7fc02bb2b06ca3ff + docs/models/components/mcpapprovalresponseitemtype.md: + id: e93d45a68c9a + last_write_checksum: sha1:63ca89ab658f8c775e0148728953a547a704add6 + pristine_git_object: 41cd2fb87931b1bce8403df21ba9aa8c9589a654 + docs/models/components/mcpcallitem.md: + id: 907bb040f081 + last_write_checksum: sha1:f6d173e5a0f3340e7aa44feef53a476db4a4e48f + pristine_git_object: 51ed8c9bc9849985ff7233202c57223f5b40fa52 + docs/models/components/mcpcallitemtype.md: + id: e4b26672f31e + last_write_checksum: sha1:25442b2f36dfbfc5175880f6f502e3e8bd0bc067 + pristine_git_object: 9494e53e1bdeb068ade441840bd56b4d16b650f1 + docs/models/components/mcplisttoolsitem.md: + id: 18b11f5f5dbf + last_write_checksum: sha1:625276471b2bf16353b2e4152281a0ff5c93ba19 + pristine_git_object: 649d559901d23ff1fea5211b67118b033df19320 + docs/models/components/mcplisttoolsitemtool.md: + id: ab49a6ab5ac8 + last_write_checksum: sha1:ad305112f734274ef4eab478269890140aff8681 + pristine_git_object: a1d02577ec36c269441767b1b33a4e0fe56bdd83 + docs/models/components/mcplisttoolsitemtype.md: + id: 49ee8971cd9e + last_write_checksum: sha1:fda661faca1873358ae5a91a22fae9ab4bfbfe90 + pristine_git_object: 31b5c8cc9d0d7c5c4c4534c706970551a989bdde docs/models/components/mcpservertool.md: id: 9da40b22ca42 last_write_checksum: sha1:7389912b7e34ccf047c0b5075f8534d453d9b9fa @@ -1432,6 +2429,94 @@ trackedFiles: id: aeb0b1fd517a last_write_checksum: sha1:6342c54cd450b27815af76852ef95ccdb151e607 pristine_git_object: cf18559044896a000d81c0594d506e3fb860dc69 + docs/models/components/messagesadvisortoolresultblock.md: + id: 8a3b0e1598ac + last_write_checksum: sha1:43fa101b18098bf4eebdf92e4a366cb5e47423a9 + pristine_git_object: ac7ec62673c56f165bface84d2ad4caf927901a9 + docs/models/components/messagesadvisortoolresultblocktype.md: + id: 78a571d97274 + last_write_checksum: sha1:6e969cfdf40d8ba2aaade633b47deaaea0fed850 + pristine_git_object: 475e7c9ef9b1b06f1b4b391887fc0e9286437d42 + docs/models/components/messagesfallbackparam.md: + id: 2ee9c7068a15 + last_write_checksum: sha1:eab16777d15f9edbd82143e0e4a6cdf0172c7811 + pristine_git_object: 4db01566abba54ef82287d14705d9e8e94d8ac9c + docs/models/components/messagesmessageparam.md: + id: 03fbc268c837 + last_write_checksum: sha1:afcaff5fdb00b414f3a79c4340d9cf8da25db215 + pristine_git_object: 177199f24467baf20c168ed30d15130f344f992f + docs/models/components/messagesmessageparamcontentunion1.md: + id: 0436919c3998 + last_write_checksum: sha1:b8fb2213b2129daff1a0e8af3138181222b1fad2 + pristine_git_object: be4d0cf470886781618a76ffb17a090198ca7fbd + docs/models/components/messagesmessageparamcontentunion2.md: + id: 6f59ec75e518 + last_write_checksum: sha1:438788e62f57c692b41de7be9653628827bc3a66 + pristine_git_object: 03b4c6e1ff0168be398ab2e43cbc1eacb53cd1e1 + docs/models/components/messagesmessageparamcontentunion3.md: + id: bbd749983279 + last_write_checksum: sha1:43a369ee523b213d29731307a1f5db08b39a1961 + pristine_git_object: abfd621863ff6d8a4e413a6b5ee905dc736e5461 + docs/models/components/messagesmessageparamcontentunion4.md: + id: b0f99f921a73 + last_write_checksum: sha1:0fd4a7bb7540d38a43d9cd15a9944bc329010a82 + pristine_git_object: c9bc2d46b2d74a1db3eb46d22d811703cc503dcd + docs/models/components/messagesmessageparamcontentunion5.md: + id: 1218f5ab75eb + last_write_checksum: sha1:b1895238ab5eca170b7b3e83541ee60c806e0085 + pristine_git_object: 29035fd2c11ca397018593b38cfedd019ed19a3a + docs/models/components/messagesmessageparamrole.md: + id: 63f48cdae128 + last_write_checksum: sha1:96015b2bef236b2b486ab781f0240b578f177b9b + pristine_git_object: e79114a5e0d83a527f7d2a5644ab1825b66d308f + docs/models/components/messagesmessageparamtypecompaction.md: + id: be7b9c933cbf + last_write_checksum: sha1:31632bac2d4edde8b6a304e04c90ac40c232ca4b + pristine_git_object: f3c449644266017924da7d192c21c0abd9b88b78 + docs/models/components/messagesoutputconfig.md: + id: 0f92a26fd94d + last_write_checksum: sha1:74279d7e7f349b7d2f9bd0e6fe441e054b87a72f + pristine_git_object: 650b93bc3a53a3d48a223b2053461f77e89830cf + docs/models/components/messagesoutputconfigeffort.md: + id: fabdfb9f45dd + last_write_checksum: sha1:cf96649fd5dd3fdc186fbf6e13c3d4df4e83268e + pristine_git_object: 8d2eccf5a761b4a00280e3163fa47316157a88d9 + docs/models/components/messagesoutputconfigformat.md: + id: 802603f1605d + last_write_checksum: sha1:87ffc9da5b7453df39b0ced8cba657c2bdb52721 + pristine_git_object: 7101a64e5ca77cfab141d496fd46957c9e1b545a + docs/models/components/messagesoutputconfigtypejsonschema.md: + id: e73163a000ca + last_write_checksum: sha1:4acfe2f93e078374624dd43e9ce1f9057701a19f + pristine_git_object: d9b624b6399f3c074c04e9f25259ad8291bbbc92 + docs/models/components/messagesrequest.md: + id: e568fd3ac212 + last_write_checksum: sha1:2bd93121c1c80c770723de9e62f6358f1a937bb3 + pristine_git_object: 7b6fd798756c064da61dea2c5c5279745b95256f + docs/models/components/messagesrequestplugin.md: + id: b7e53a809066 + last_write_checksum: sha1:3296e4023c7894f71ea676c5b305c2d624ad9846 + pristine_git_object: 22119165185480efb76b041c7e659133b9394e05 + docs/models/components/messagesrequesttool.md: + id: 0285982a7eff + last_write_checksum: sha1:9ad725300f53597044a4b8097a164f01691c1f11 + pristine_git_object: 3a47ca16520c0d6506ac1e443b6b75010d01a1f9 + docs/models/components/messagesrequesttoolunion.md: + id: 9aa8f1c614ae + last_write_checksum: sha1:7ed4473e73148e16e0f248678db261fb0cefcb77 + pristine_git_object: 05a6ffa7eac8370d7e4a3029b1c380a5dea94283 + docs/models/components/metadata.md: + id: 06867fa888c8 + last_write_checksum: sha1:a7ce49afbde20a23fb8678e89be588ca559a5ee1 + pristine_git_object: abeea6e4325b9ff48eadfb8cb12b387494ecf63a + docs/models/components/metadatalevel.md: + id: 73f1a495eda2 + last_write_checksum: sha1:78d18181cbd0783b99d1f2e94744fe0b1c4d160a + pristine_git_object: 2afd96654a2f0db85b7733ba93702ea9cb177250 + docs/models/components/method.md: + id: ed7b996a91be + last_write_checksum: sha1:d93c80f7ba12589f0c970d94ff9bf7056458fbbf + pristine_git_object: 64b22539133c675a6b11f5dbea72973c54e732da docs/models/components/modality.md: id: 1fca791ed92f last_write_checksum: sha1:0d653efb1524f30336af6aad477ff93e4e92fc3d @@ -1446,8 +2531,8 @@ trackedFiles: pristine_git_object: 4ffcefce579fec203b8f0be6b8f30153c1ea7cdc docs/models/components/model.md: id: 151d51d140e4 - last_write_checksum: sha1:23c779f069ec0a60afe163755f21a728b8bb08dd - pristine_git_object: 2b98042e1d4f08e9a65502e7638992dd5e09ca82 + last_write_checksum: sha1:9cf1d62fdcc27ebb499fb1104b7c5de5f0c86197 + pristine_git_object: 972e522916a979fee91b37f964d4bf9c3222eef5 docs/models/components/modelarchitecture.md: id: 0f7c7fb58809 last_write_checksum: sha1:bd46732cc84d202e850a8507f5ed22b36d54a3d6 @@ -1456,6 +2541,10 @@ trackedFiles: id: 58e544392098 last_write_checksum: sha1:362ca0c4d49204af2b5510151607a7048bf51866 pristine_git_object: a457e1916a35057d5da53329c3c811494c9684f8 + docs/models/components/modelbenchmarks.md: + id: b769582a67de + last_write_checksum: sha1:f0ca53c54d9531ecc6b0ad5a137233445fe27df5 + pristine_git_object: 27de268e40dff035df48f7f6c5b883ee79aa0504 docs/models/components/modelenum.md: id: cd59b7abc645 last_write_checksum: sha1:aeb534364d77b985edfe560678dff1d198d00b11 @@ -1468,6 +2557,10 @@ trackedFiles: id: f9fa4fa27c15 last_write_checksum: sha1:6675f03dc0bea9e8e8d1c98e645f863f52ffdb88 pristine_git_object: 8661f88dc95e635b2a12efcd7edc95ebc9969f73 + docs/models/components/modelresponse.md: + id: 0fec1f0ad4bb + last_write_checksum: sha1:542c1ec645c17a86855fa2b8aab89eb58201c6bf + pristine_git_object: 819336221a2aec8c0218f6bb9eb886914bccd92f docs/models/components/modelscountresponse.md: id: e959fec5ad35 last_write_checksum: sha1:033e50f8ade3080f2372743128c2799f734f1b01 @@ -1478,8 +2571,8 @@ trackedFiles: pristine_git_object: 98234566f8c4e7cc2c620a4b6e832fc9e7dd10e5 docs/models/components/modelslistresponse.md: id: 617e4f3fe63c - last_write_checksum: sha1:d54acc31804edbf01b8fcaa2f86ef6eed001cf82 - pristine_git_object: 8f74a7c2d2bdfdd0678e24b03e32d0a8542a6b4e + last_write_checksum: sha1:8140afc0e88414f1181cedeb652ca92bc7957d8f + pristine_git_object: c7ec3c2c1f977b89af9c4d51d0fe7933bc5c0a23 docs/models/components/moderation.md: id: e5bf6ca3cf79 last_write_checksum: sha1:841d3dce111aa7359179cf04b66c9928e080b720 @@ -1496,6 +2589,30 @@ trackedFiles: id: 30ca94df963d last_write_checksum: sha1:949fea1978f89f79d3e37fb2a105819383414a92 pristine_git_object: 7a3020cec1836dc017e31ac3cb14341755356ece + docs/models/components/multimodalmedia.md: + id: ff1874524c17 + last_write_checksum: sha1:1a9697a81f48b0b42d6bc5c6e519659be2a204ec + pristine_git_object: ea77c57476f081613a2362902eb9bad2ce7b4942 + docs/models/components/nameadvisor.md: + id: fdc797806293 + last_write_checksum: sha1:7a1245a8f590bef57a44d6d926d012eb1bd5ff81 + pristine_git_object: 6138f266fb35689bf43b9dc4446eca70a1169fdb + docs/models/components/namebash.md: + id: ab8b9d226536 + last_write_checksum: sha1:41eeaceab9bb5f8e01772f5d5afc309e6fc7e510 + pristine_git_object: 69ff4bbe1820041f9a11f9bb29610f6bf159a2bb + docs/models/components/namestrreplaceeditor.md: + id: aa99281ca0dc + last_write_checksum: sha1:0a43507dee1b8a2589086e863aac89e5b8e197b7 + pristine_git_object: a4b107ad842e47d79fc263fab55e919cc0c760f2 + docs/models/components/namewebsearch1.md: + id: bb43531c2494 + last_write_checksum: sha1:cd634118ccc07354f475d48ab6e3178e5243a307 + pristine_git_object: 73e10722d7f28c12367090824f1b3c10164a423e + docs/models/components/namewebsearch2.md: + id: 37b89dbb9ceb + last_write_checksum: sha1:e2805ab58bf1901192baced5bc15b97a19bce537 + pristine_git_object: 2e4a6629c7440232894ac2e85eee754479ab760b docs/models/components/never.md: id: 60b0e129c52e last_write_checksum: sha1:6ade06db3907ea27991f9527d2751f3c7b3e67a8 @@ -1504,14 +2621,254 @@ trackedFiles: id: 1cf329afe5cd last_write_checksum: sha1:c3838ec3ef7e33173dae598cc0ef56bc9a8c33df pristine_git_object: 558539849df93c043f4f23150742c44ab0fdb6b9 + docs/models/components/observabilityarizedestination.md: + id: ee2646777d7d + last_write_checksum: sha1:acd7055efd4cb1f2c1ea2a962fdf70b6b55b3222 + pristine_git_object: ab2a41a278d76ee0f1bb0de7c96b8d4f7c3b9061 + docs/models/components/observabilityarizedestinationconfig.md: + id: 0fa8ab33adcc + last_write_checksum: sha1:446046b4d0cf9f1a334a1972ce8c2debfacd71af + pristine_git_object: 27cf64ee1feed6b6718897dc277a3cb3d63d4902 + docs/models/components/observabilityarizedestinationtype.md: + id: c26d0e265de7 + last_write_checksum: sha1:153b849816b3d9a7c1cb7e7321955832e68f1ea8 + pristine_git_object: 404681cd29459eafa85c8a0f07ae5795274a4926 + docs/models/components/observabilitybraintrustdestination.md: + id: 8d3f9038f8dd + last_write_checksum: sha1:843c6d26dce03b6964ce8d6cc38e33ae5294d9cd + pristine_git_object: f094ce6f3e1a93bd912a3673af246db03846981c + docs/models/components/observabilitybraintrustdestinationconfig.md: + id: 714eebe94ddd + last_write_checksum: sha1:edfb6e8cddced16d5ccb463e9e9e34e454696b04 + pristine_git_object: 64682360d370d61e3f9f1d3fb324b2723404eb38 + docs/models/components/observabilitybraintrustdestinationtype.md: + id: 17fb6bef03ff + last_write_checksum: sha1:8d27546658fec4e185293915e777e50eab39f284 + pristine_git_object: 8653e21a8c8cda9d152e96b83a052c777dc5ec46 + docs/models/components/observabilityclickhousedestination.md: + id: 7986937dd797 + last_write_checksum: sha1:0541861438e51b33645a685d3d41ec7c724e547e + pristine_git_object: 734b530bfb3967b4d56e3261fb564c0739e47834 + docs/models/components/observabilityclickhousedestinationconfig.md: + id: 4be563aa981d + last_write_checksum: sha1:7b1450bb8803cc1cb0315ab1a6dfbc19b631e04f + pristine_git_object: feef46eab14f4109969c37dd0d93ddc6da2cc0ce + docs/models/components/observabilityclickhousedestinationtype.md: + id: a8efe89af535 + last_write_checksum: sha1:a7f96b010b42ca10f70684e094bc367af7b59635 + pristine_git_object: 0c549d1f0851cc02f00a8a5c0132c114e97800fc + docs/models/components/observabilitydatadogdestination.md: + id: 4b0e60bcebb4 + last_write_checksum: sha1:dcea321512ea5f2abef3ab0da7c43c9143c20572 + pristine_git_object: 03ccf24303708ec2ff677f03df6b6a5e878f5655 + docs/models/components/observabilitydatadogdestinationconfig.md: + id: d74bdec64f4f + last_write_checksum: sha1:244942c69991e7d0f4262438e1ff34b85c68dbbc + pristine_git_object: efcc23c93c0db87ba3638aa2fbd2d5448a2bd8d1 + docs/models/components/observabilitydatadogdestinationtype.md: + id: 60a94b364cc4 + last_write_checksum: sha1:de2c12c0de57a51d88690b62ae90e0fd6eff0844 + pristine_git_object: a09dec8dad36976bfb2715f6d53ec4f55c4c9547 + docs/models/components/observabilitydestination.md: + id: 06073312baec + last_write_checksum: sha1:89e0ac3e01fac0906afc990a52d334c36b08e9ca + pristine_git_object: 6ba3804e92abbf668aa6d4ede9efb24507fa929e + docs/models/components/observabilityfilterrulesconfig.md: + id: 03e1058a5b51 + last_write_checksum: sha1:b4852b763a35c9c75b3efe32c7f5ff98fe7bf56a + pristine_git_object: b37eb9f870af57256c6121b7e957ef4420a35d62 + docs/models/components/observabilityfilterrulesconfigvalue.md: + id: 2be0c9a5e206 + last_write_checksum: sha1:04b15fb8f63446e962a12e8deb685ca6a0d8f97b + pristine_git_object: 331202a71fe477f8dc6aed103976bf030f438ebc + docs/models/components/observabilitygrafanadestination.md: + id: "092685228225" + last_write_checksum: sha1:f57b1a20af8148b364b40d51a30a62927d2d6616 + pristine_git_object: 31bfc3adcb231cdf7bda13000f7fcdff87af1533 + docs/models/components/observabilitygrafanadestinationconfig.md: + id: 93b81480405f + last_write_checksum: sha1:ed770405ad09f0bb4c17b4d24c2e1e7bfc4d913a + pristine_git_object: 918dfd13655f9e1db1c83160ffac8c3c5028a3d9 + docs/models/components/observabilitygrafanadestinationtype.md: + id: afb66285ceec + last_write_checksum: sha1:4ad980f71bd233499a5b9f542e5a2f5e82f8098f + pristine_git_object: 47d91d563317db56b78e7dac38125dc596a2a992 + docs/models/components/observabilitylangfusedestination.md: + id: abb1dafb2128 + last_write_checksum: sha1:3c47f0dcbe2030a474f47812e464556ae3751aad + pristine_git_object: 7f43f6c7f5d5048c112fa210787e0a1e31afd90d + docs/models/components/observabilitylangfusedestinationconfig.md: + id: 0bef1957b2e4 + last_write_checksum: sha1:e107cb8e0654b59852153f6d6fe4d9be362b24be + pristine_git_object: e49c906f24cbd35703f19a780c0ee5099d65ce3f + docs/models/components/observabilitylangfusedestinationtype.md: + id: 753d7673a48f + last_write_checksum: sha1:1d98eebfba6a306ac1481539bd46c3fbea7f1ce1 + pristine_git_object: 87c20422a4a4cc0e47edb1888eeb7360094e94fb + docs/models/components/observabilitylangsmithdestination.md: + id: 26260cae02b0 + last_write_checksum: sha1:e7379147b7665c41bd84bcf14dc283d201cc21af + pristine_git_object: a1c8b04df20f7291c7c9c882b84e7aa29105bfe3 + docs/models/components/observabilitylangsmithdestinationconfig.md: + id: 8003b06cd6c9 + last_write_checksum: sha1:3d4f3148879f6094fbe5f45ec442e95986cfa44d + pristine_git_object: 9c72d2842e197c92bbea69a0f53a0f7d7a7ce598 + docs/models/components/observabilitylangsmithdestinationtype.md: + id: 9a8fa7fe15cf + last_write_checksum: sha1:10380d9f5879924f581aa43fcd26b006fcb4e40f + pristine_git_object: b973da3eaad3fe31dc8180bbc74efb2b50acdff8 + docs/models/components/observabilitynewrelicdestination.md: + id: 8d2b041d20dc + last_write_checksum: sha1:47f999107c66e158d63cf65d3b5ab4e2e8a17056 + pristine_git_object: d89136a343d65cdf943903c3feb9ce4b65667818 + docs/models/components/observabilitynewrelicdestinationconfig.md: + id: f04f6b93b824 + last_write_checksum: sha1:3646b0f1b07952e7b28cb3cdfaa69f45f192f8bb + pristine_git_object: b70332a327ab3ee389cbeeee9b80c9a9d67c83ab + docs/models/components/observabilitynewrelicdestinationtype.md: + id: 4c08f43b36ed + last_write_checksum: sha1:1ba907adb6ab2af4bbd248a100a45fe60474be24 + pristine_git_object: 8e661d4adf35a5372bcfa43f9e72567fe5fbb3ec + docs/models/components/observabilityopikdestination.md: + id: e5aa276aa4d0 + last_write_checksum: sha1:b25a55ee600883b6d843549b30ae5c2452daaae3 + pristine_git_object: 648ed93620b893a6b6a3bafc4e2eb23e8209c23f + docs/models/components/observabilityopikdestinationconfig.md: + id: c6bf1bb23d94 + last_write_checksum: sha1:314a7ab2e633fb6948fff1f66fe64d094031d224 + pristine_git_object: 9c34087634d1cdd4ab9058868ab5fd96823488bc + docs/models/components/observabilityopikdestinationtype.md: + id: 2c52339c76d4 + last_write_checksum: sha1:fcded67e53f96f58900f6ec862faedbcb6619788 + pristine_git_object: 6e249d59b6056ad9e85581ab7a66ee6d5454a8a6 + docs/models/components/observabilityotelcollectordestination.md: + id: 4224db1a15af + last_write_checksum: sha1:4bf5de0f1af07aabfcdb2c3e16b3525b1bb185d7 + pristine_git_object: a36b3741e08f5fe076281c6dbdc08b86a283b104 + docs/models/components/observabilityotelcollectordestinationconfig.md: + id: ed4981780fcb + last_write_checksum: sha1:a8679cd3365a797cf1a77e55c0341a3603488bbe + pristine_git_object: 24efc61b80ee8780211a26f36317712bcdec1c56 + docs/models/components/observabilityotelcollectordestinationtype.md: + id: 90ac129a5622 + last_write_checksum: sha1:722ef98926bbf5bd1f3fd3679a7d61584f982c90 + pristine_git_object: b1c89d19f69ff3165105aef5f046a0f8953d572c + docs/models/components/observabilityposthogdestination.md: + id: 76f152650e52 + last_write_checksum: sha1:f23eced9f8e76dbe62dbee103e26c06e869b5311 + pristine_git_object: 3dc1bfa7a766881f53d3dcd00f0d7d3e82bdad9e + docs/models/components/observabilityposthogdestinationconfig.md: + id: a23cbea68f20 + last_write_checksum: sha1:60e7fe3383acd99d49a020283690402fd8714320 + pristine_git_object: 8d15b9d38572ebc7fd8ebd6b51ca180886c610bc + docs/models/components/observabilityposthogdestinationtype.md: + id: e965287001ec + last_write_checksum: sha1:8ae14dfb47138e9bb0dafc3404767a810e65d082 + pristine_git_object: d3e82bdfd2cbd430e7488fdf51e165ccfb8dce11 + docs/models/components/observabilityrampdestination.md: + id: 58b6b330e0c1 + last_write_checksum: sha1:59c2f3793de32b0598e1fd512d3340d76aa0f85e + pristine_git_object: a4479d6853e7fcb93eff71ce9575c54e4169ab58 + docs/models/components/observabilityrampdestinationconfig.md: + id: 5dfaa51da128 + last_write_checksum: sha1:b8ade060e0404b1d0e9dba9c283afc914db435ae + pristine_git_object: 7025dbb38fe84bd3d8a65ef38313a22a776d636a + docs/models/components/observabilityrampdestinationtype.md: + id: e828fe7a692b + last_write_checksum: sha1:4571e530830fa3d86c244840ad1a94ca99adbf73 + pristine_git_object: 391b1b24ba2d48436a60ac8ebc052d909fb88a47 + docs/models/components/observabilitys3destination.md: + id: b495c4a508dc + last_write_checksum: sha1:98382a12bac1fabda2e5135df24c8d9fc713f436 + pristine_git_object: 979e99a1b97b6d56f319c1bf0d9e5621ce68499f + docs/models/components/observabilitys3destinationconfig.md: + id: 4ad73bda2527 + last_write_checksum: sha1:f7987ed4162eaf98f675e071cd8d97bcf1d05f28 + pristine_git_object: 48423abda412a8bb7f0a0c063f7a03a711d0cee6 + docs/models/components/observabilitys3destinationtype.md: + id: 5328c1d18b1a + last_write_checksum: sha1:a623855c568824aba26c6b744dcec85d572d45a6 + pristine_git_object: ac59cfec13ab263626d4895023a439bc608640a1 + docs/models/components/observabilitysentrydestination.md: + id: 1a40ea62b585 + last_write_checksum: sha1:3dbe957efccca685e18bb9f6cc17998bb3581d54 + pristine_git_object: 1b0ba3cf5643a6f9bece3adbc5ce3192a2edc046 + docs/models/components/observabilitysentrydestinationconfig.md: + id: 99718f7486a4 + last_write_checksum: sha1:82ef6857d87f836f59f5b51d912267e16e87e667 + pristine_git_object: 3dc6bf9725d58b89f4e40c94e63770c062e36773 + docs/models/components/observabilitysentrydestinationtype.md: + id: e9218a6297cd + last_write_checksum: sha1:8e30cd4d04dbfec099e4e835629bee1caae43f21 + pristine_git_object: 5fdd8babce99e54a310e569641e1b2be1383b552 + docs/models/components/observabilitysnowflakedestination.md: + id: 16a4ff3a08b3 + last_write_checksum: sha1:3fa6d22468581b67ca45be4b594014655927a76b + pristine_git_object: a7ecd0a22602d9d6cc4ba5b959da5c80a5eb9c12 + docs/models/components/observabilitysnowflakedestinationconfig.md: + id: 9dd8a5440b0b + last_write_checksum: sha1:3ed2f477f991d7ae87139d3ec3555a8e32d04994 + pristine_git_object: 9c3fb52ca341c0c72a44bc1a44a0a8fdc93800dd + docs/models/components/observabilitysnowflakedestinationtype.md: + id: 8901ebccc10f + last_write_checksum: sha1:2b655e71a0c8f30a56529d7d4f1095ba1735e87d + pristine_git_object: 972b70f8d9d6301a6514d0c1c5f66e8772f8d40b + docs/models/components/observabilityweavedestination.md: + id: 6241e940d86e + last_write_checksum: sha1:ceaeb14beea9114291eb8c6c9a1e2427818f22fc + pristine_git_object: 92ba6a9e3dbb83bf2954d4ce687e54a8302495ac + docs/models/components/observabilityweavedestinationconfig.md: + id: 378c8509b70d + last_write_checksum: sha1:46dae3e61c88b60622c552af6814f37c94de1846 + pristine_git_object: 4c8d47f1304395bcba2b06d3bb63cc44915342c2 + docs/models/components/observabilityweavedestinationtype.md: + id: 49c8713138ca + last_write_checksum: sha1:bf149854ebde4d4638d6f96e37606fe9d25a2bf0 + pristine_git_object: 0c0cfdbd82f4836df20ca9ea70f7ecfa5d89add7 + docs/models/components/observabilitywebhookdestination.md: + id: ebb26f114402 + last_write_checksum: sha1:94ae8aba425d5f94083a32714532b925254f46e6 + pristine_git_object: 988bb009068ec83164f070c30a72df374152df10 + docs/models/components/observabilitywebhookdestinationconfig.md: + id: 681e5a73a29b + last_write_checksum: sha1:0bcb992c44f2fcd5edc77ddff396c4881aab2535 + pristine_git_object: 38ebf13f9adc00dd80cadec4b192569a46830dfb + docs/models/components/observabilitywebhookdestinationtype.md: + id: b02362349a95 + last_write_checksum: sha1:9f05f2408905f92596d9f7f95b496a5f3ee181a9 + pristine_git_object: e9edf290a62a6b0c74317b732f7aa2b9a684636e docs/models/components/only.md: id: 04b9d7307a39 last_write_checksum: sha1:28ab2ebde6fc2fc8f421cc2a57829e3c87000560 pristine_git_object: d0206430b85ad749ebd3c73986b6772edba7bb87 + docs/models/components/openairesponsecustomtoolcall.md: + id: a9145d322364 + last_write_checksum: sha1:e6c6850c6e6568b43b5d9d1660679e001f49303b + pristine_git_object: 2157d295f85c1e5c50c9790ed65f3cfdd494f172 + docs/models/components/openairesponsecustomtoolcalloutput.md: + id: 834775b062bd + last_write_checksum: sha1:499e044dc09f5cae6ca98e46e9eab4dcea84c91e + pristine_git_object: 35c86835dff7c37d603512f7556ebc7efea49df2 + docs/models/components/openairesponsecustomtoolcalloutputoutput1.md: + id: 9b0ab0fe6db8 + last_write_checksum: sha1:b40b40b8daf566053f6893ddba32f77347aa4901 + pristine_git_object: 78cdec6cd7412525d7bc53b6482efe46c85ed2be + docs/models/components/openairesponsecustomtoolcalloutputoutput2.md: + id: 53ce72950e4b + last_write_checksum: sha1:6d14004b734a737091647bc7a06ea203befafe23 + pristine_git_object: 518fc09befa5d63fe4b58b68869a059da415dc38 + docs/models/components/openairesponsecustomtoolcalloutputtype.md: + id: f99ffb0888a6 + last_write_checksum: sha1:d298fb5e382d004d509ac3504e1e391cd171eecb + pristine_git_object: ab0c176e3e643fa5171b52ac181762bebcb0607d + docs/models/components/openairesponsecustomtoolcalltype.md: + id: 3a7598cabdda + last_write_checksum: sha1:1448adc8d978ce68fdb598d5bf80f4e5b77a02c3 + pristine_git_object: 58ba1eb921eab47ba22145fd7387a968961a3b41 docs/models/components/openairesponsefunctiontoolcall.md: id: 6a47d1683c3d - last_write_checksum: sha1:d44e2263547fcf47754770ec40c26a80150fc22b - pristine_git_object: 6130dc76f347fb256e16a1863fe5bcdf862b7515 + last_write_checksum: sha1:8c25942cc63d84f18a0c7a57e907166dfe3298c5 + pristine_git_object: 61779a91d0353bb7e9bf656dfc7518b72e476a23 docs/models/components/openairesponsefunctiontoolcalloutput.md: id: bab2d7effe65 last_write_checksum: sha1:c93ac1cbcea09b2df602a1d5f5d99c30a18a4016 @@ -1584,6 +2941,10 @@ trackedFiles: id: 3e09843fb7d5 last_write_checksum: sha1:485fb2d791431972cc0faae9abcdf85ac730a7b0 pristine_git_object: 77f5c9c14c092be4314a9bc7997bdc359d1f3376 + docs/models/components/openairesponsestoolchoiceapplypatch.md: + id: 205707f10824 + last_write_checksum: sha1:00d71f22193d9a9482d770afd6a4c0a65ec41319 + pristine_git_object: 17d5c9ab67cce88725b7a52d7adcb36b5f765218 docs/models/components/openairesponsestoolchoiceauto.md: id: 92e6bc69a61b last_write_checksum: sha1:f68a78fabe227f5a933a49126217147dfb36d1ce @@ -1600,10 +2961,22 @@ trackedFiles: id: 4eca9209b7e6 last_write_checksum: sha1:52f14ec843bcddc3d0f673601538da1f0464abd8 pristine_git_object: 034869816e952466d260a7a1f6bf322efc0f63b6 + docs/models/components/openairesponsestoolchoiceshell.md: + id: 228720eb4f0f + last_write_checksum: sha1:c820e071499fb525d7aa787779f49578498440d1 + pristine_git_object: b006de9101b7ba5985cfc35dbe941a60447fc5af + docs/models/components/openairesponsestoolchoicetypeapplypatch.md: + id: c2f0c138136f + last_write_checksum: sha1:41ac192ae3be110dc69194e404ded672b05f4e1d + pristine_git_object: a87ba9ab44e49be307098d83ea558fb08e5bf686 docs/models/components/openairesponsestoolchoicetypefunction.md: id: a2e792da43df last_write_checksum: sha1:36a285549528ee145864325df9932ccfe92d5453 pristine_git_object: f1a703abfb01aed2723d6fdc8047960bef660b92 + docs/models/components/openairesponsestoolchoicetypeshell.md: + id: faabc4172f55 + last_write_checksum: sha1:75c60d66cf51131f912ecfee8808d3d1701dda81 + pristine_git_object: e24eeb52ce3733b2f62c97f68ef94413f63670fc docs/models/components/openairesponsestoolchoicetypewebsearchpreview.md: id: 027a415011e2 last_write_checksum: sha1:0bd6583948cb656cdff578304c8f1494ae8eaa4d @@ -1614,8 +2987,8 @@ trackedFiles: pristine_git_object: eca808099d8a9bf07efa39e455f1235f1b753c10 docs/models/components/openairesponsestoolchoiceunion.md: id: c8b586276ebf - last_write_checksum: sha1:38cef097b439211e0979220d01fbcf662c3ab053 - pristine_git_object: ad95ca9ae0418403ac4837d47290584bd1a6683d + last_write_checksum: sha1:7dabf4074354d5a6ee26ee9cbe93535063107ad6 + pristine_git_object: 3ffa5123e352ca2079f63072b0fddbed5b31c038 docs/models/components/openairesponsestruncation.md: id: 474235df8002 last_write_checksum: sha1:828abf80453e7b825f737c5865695c824b4a0ca8 @@ -1638,8 +3011,8 @@ trackedFiles: pristine_git_object: 5c3f3ef76afbc2a802869b4e3bec156c5c88e9fd docs/models/components/openresponsesresult.md: id: 24ca9fbee83e - last_write_checksum: sha1:e5e44334f617496d7e7ffb42c45e3df8b2c034aa - pristine_git_object: 2d0bdc7c17353f704b5cde9cf9d7580222096874 + last_write_checksum: sha1:19471e26378a48c49e8047211f3b996e233f2f0d + pristine_git_object: 954f4e70d7be0fde4f9ca04e8c4b7ee15c38c080 docs/models/components/openresponsesresultobject.md: id: a43f77813a18 last_write_checksum: sha1:dd0db5814159c9a0eecfae8f7d6e12bb9aa47a1b @@ -1656,6 +3029,10 @@ trackedFiles: id: 200d645c1c47 last_write_checksum: sha1:d39757a0d33e5793f7c7c9daf07648794639f7b8 pristine_git_object: 76b4e69b8ffb630f07ba6668b4a62ee6dbd04b47 + docs/models/components/openroutermetadata.md: + id: d46dc503d1b7 + last_write_checksum: sha1:64b5ddbb2ec1bbb8c3efb6f0d5f524b83eaa2a9a + pristine_git_object: d88e76991343c092a76ef475ddb45587bcbfa071 docs/models/components/openrouterwebsearchservertool.md: id: 037a54fab352 last_write_checksum: sha1:1468f27914235a34b49d87e73029d3e415445a98 @@ -1664,14 +3041,50 @@ trackedFiles: id: 445d87a3cea4 last_write_checksum: sha1:20c928cee04f6821f20077714731a3454d0e3c6b pristine_git_object: bc497a5833c34185a2d507f79bc4bf2425847aa4 + docs/models/components/operator.md: + id: 53b616f52014 + last_write_checksum: sha1:7177cf7fdff95f706ba2760aeb4758a4dc92defc + pristine_git_object: 3f5da38f34e67870f3839a6f220da6e21c5cee7a + docs/models/components/optionsobj.md: + id: de3053f1ad05 + last_write_checksum: sha1:33b97782504ce067e922ef63bbfcec867cef60ad + pristine_git_object: 685624c60e2d4b28bf87e3a081681d0f1fa68f1b docs/models/components/order.md: id: 6e3d74da5756 last_write_checksum: sha1:b0e1880d1a810666b053a41375d6437680132dba pristine_git_object: ed4c3ebd808142bb16a06b00edd759d2bec747d2 + docs/models/components/outcome.md: + id: c24ae627e8dc + last_write_checksum: sha1:022ee45de8210014e93e81adfef16247d8d469b8 + pristine_git_object: 18e35fd0ca28e0b60755a5e2a1327ae9131dcad5 + docs/models/components/outcomeexit.md: + id: 3d4d591a9ac3 + last_write_checksum: sha1:e9448370600d49169f89a16d6dbbfe39a2705d8e + pristine_git_object: 779978a95897bc4e66c754ce66235e3b60f64335 + docs/models/components/outcometimeout.md: + id: 5992e0b31d68 + last_write_checksum: sha1:5c2a5809ce4962bba9604b5675ba4a1bdda77ae5 + pristine_git_object: 1eae9d876fbf9bb5237d44bcc8098cd13b1c4087 + docs/models/components/outputadvisorservertoolitem.md: + id: 64e0e191f9d7 + last_write_checksum: sha1:cf6656164d820daf8be5f5c473b83040e45ba044 + pristine_git_object: ccf98129be7bf717cc5f0ce41b965f42b3756a89 + docs/models/components/outputadvisorservertoolitemtype.md: + id: 9d4f414cd58b + last_write_checksum: sha1:0a177b85f24bf04550fc5899ea2bbbf3bacaa2f5 + pristine_git_object: 6c6f41b3a729a10bb8c74b54309f7261a8769894 + docs/models/components/outputapplypatchcallitem.md: + id: 94c99f87dfd8 + last_write_checksum: sha1:91ea3d3da01807bb1ce0ba89ca2f2b44085b3891 + pristine_git_object: 1f9390f7aaee920f8e63f1ffd43c6b01c7506878 + docs/models/components/outputapplypatchcallitemtype.md: + id: 53d98ec953b2 + last_write_checksum: sha1:6ebc09e7ed66eb3cdd7164a833166683fc144d50 + pristine_git_object: f4adcd444e93c2f4ba6e0941bbf39be8d1fa120b docs/models/components/outputapplypatchservertoolitem.md: id: cb85ad9f6795 - last_write_checksum: sha1:89a78a661fd3b1e08de7d5e25f8a2e6604fbb2ff - pristine_git_object: a25a1392795253d0aaab76f6975f6ddd56f2937b + last_write_checksum: sha1:73712c07b67a076f712c6654139fe7b77753605e + pristine_git_object: f5caed235b359e8e403ff1a15e09410bbf7eef95 docs/models/components/outputapplypatchservertoolitemtype.md: id: b0a614984428 last_write_checksum: sha1:8ab5b9ac0272bbe62568a9b082fd9f604a25909f @@ -1700,6 +3113,10 @@ trackedFiles: id: 49cd2e1d83f0 last_write_checksum: sha1:dc92f7d1c46b89a2f8b42891a5f423dfbef46505 pristine_git_object: 3b74fd228992be16f13dc1a981add44674629254 + docs/models/components/outputcodeinterpretercallitemtypeimage.md: + id: 02c88d5f0457 + last_write_checksum: sha1:6e26d31c61c0a318424ed563567023e4f4f70a12 + pristine_git_object: b9d19963279ede01d667f2dfc4379e25306e38f0 docs/models/components/outputcodeinterpreterservertoolitem.md: id: c08315b41f9e last_write_checksum: sha1:259e700b4b3cb264dbe1aca1e4086b8c726a5de6 @@ -1720,6 +3137,14 @@ trackedFiles: id: 9add8bdaf943 last_write_checksum: sha1:21840f44c8ea0a60e857ca4bde1ececf0388c1cf pristine_git_object: e415f4c6488096eaf0309bcc8d3039cdf2c08e6c + docs/models/components/outputcustomtoolcallitem.md: + id: b7fa97d6884c + last_write_checksum: sha1:981e8bcaa26b478c88a108106d0c7e5aac55d0ae + pristine_git_object: ab736afa8ef29e30b7d9bbe1eea1a84f2d72b0d6 + docs/models/components/outputcustomtoolcallitemtype.md: + id: 43b3eefa64d5 + last_write_checksum: sha1:421a00bf1110650749ccbb771c5ed037bdb766e6 + pristine_git_object: d08a2d8de66564d8f278b774f13a87ea3ebd8b42 docs/models/components/outputdatetimeitem.md: id: 9c21a2e5de77 last_write_checksum: sha1:8fc19975b123c419f699d6aefdda84ac23276ed0 @@ -1750,8 +3175,8 @@ trackedFiles: pristine_git_object: 125b8276c39560c9a996a3d3f1688d1958baa4c5 docs/models/components/outputfunctioncallitem.md: id: b51335c14430 - last_write_checksum: sha1:d1ba05d5b046c62fdc622528daec26c7f1c79e2d - pristine_git_object: 122f051d45d12caec0e9f72206152345cc2c046c + last_write_checksum: sha1:64b68a33957e69588e0f0260e0f2641bf4fc0020 + pristine_git_object: 111847f847a6487bc18002310cfa9094a5470ee7 docs/models/components/outputfunctioncallitemstatuscompleted.md: id: 82d51148028a last_write_checksum: sha1:bdd7ac84bbfae44ad1b58bebd8309b38d7cba594 @@ -1772,10 +3197,18 @@ trackedFiles: id: 1544e3e1a5bd last_write_checksum: sha1:400c34fd81ce69783217f9ab7cddf514ae81a969 pristine_git_object: 1987f56f43d1dd8ad4b618c7426bc18f074f9414 + docs/models/components/outputfusionservertoolitem.md: + id: 2a947617585f + last_write_checksum: sha1:c6bd44b69573f46f31caa49000f0b830851119a2 + pristine_git_object: be0896fd1465d45a8d380904e77b842d316e2b3f + docs/models/components/outputfusionservertoolitemtype.md: + id: 4fefb9d36a69 + last_write_checksum: sha1:410fa0c96a5f0f103d630f2ed117cbc5835cc058 + pristine_git_object: 00b7516e1831bbbbb09650572ca225bb8ae3c3fb docs/models/components/outputimage.md: id: e6c10a9bf477 - last_write_checksum: sha1:347ff52f4d40ab29bc5ad289765a500b1ee10b8d - pristine_git_object: b3f6fdf8b31287b8cfb82eb8a951caf3d5a33a89 + last_write_checksum: sha1:57fde12efafdced20f55ce754d4b27c0257c9e69 + pristine_git_object: 4cedac17d7af085bbb423e0af5ab3c052d200d7b docs/models/components/outputimagegenerationcallitem.md: id: ff082c315bf0 last_write_checksum: sha1:364029cfbb3ffa23de14d843545dd15cc20ee65e @@ -1792,10 +3225,6 @@ trackedFiles: id: 8979ed40631c last_write_checksum: sha1:73561bdff848e13456da370bf48dd5eb3e3ccec3 pristine_git_object: b2a97583ed326581c91bd3fbde02961ca1ac216c - docs/models/components/outputinputimage.md: - id: 1520941c9ece - last_write_checksum: sha1:a4119ad2d58b5bb75f523452fb13165a164dde52 - pristine_git_object: 8d034c773195dbf163d490311c81b8f54a36f0ac docs/models/components/outputitemimagegenerationcall.md: id: ba6ccd0af306 last_write_checksum: sha1:342612935d21aa4007e131b403987c48201e3597 @@ -1806,8 +3235,8 @@ trackedFiles: pristine_git_object: a587a747e9f671990cc598274a2bc4aa17b750be docs/models/components/outputitems.md: id: fc00234a3345 - last_write_checksum: sha1:905a30818ba595b4141d6a9d380d6723ad20b0f2 - pristine_git_object: be81518313ee5cc3cd784b84777407a0c10aaff7 + last_write_checksum: sha1:5d5f967cbbc52103a66d5915c27045a1aba825dc + pristine_git_object: c82b4bcd995a9be71aae1b71110f80b8d9082db0 docs/models/components/outputlogs.md: id: 6a63ead256d5 last_write_checksum: sha1:b69a38f4cb37fb9312305ccd3cde7bb6da14403e @@ -1918,8 +3347,8 @@ trackedFiles: pristine_git_object: 30f7eaf8654944bf25dbf26e8bc37c643bc84101 docs/models/components/outputmodality.md: id: 7c3f22f91930 - last_write_checksum: sha1:aba21f76de43a8346ab1a86f45a18f081b6d4b5d - pristine_git_object: 60031d7d498d2705c9ee6938117115f2a28f53f1 + last_write_checksum: sha1:6ef88c08a7311e1bd711fc89f4bc12e47412b90c + pristine_git_object: 445cb04646f7b192878836fad4625c71ea436fcf docs/models/components/outputmodalityenum.md: id: d5d5ec61887a last_write_checksum: sha1:3a16f63798d38955686f8d50a01547cbbad75c22 @@ -1956,6 +3385,38 @@ trackedFiles: id: 4525ee858704 last_write_checksum: sha1:e507ad322fb5878ab5cd202dba546aaa0dc252bd pristine_git_object: 2c6701f9fe87940a914b72d96f280d9d86f6092a + docs/models/components/outputshellcallitem.md: + id: 0b1ffeafab86 + last_write_checksum: sha1:60315281120c2109b4d26b2db0672ec0e4434f3e + pristine_git_object: 50128889d83c99451e17e26095856f79d783cfc9 + docs/models/components/outputshellcallitemaction.md: + id: db3e79346e1a + last_write_checksum: sha1:4665ccc651d5158ed848e8ebe1e0e993429268e3 + pristine_git_object: 07b589e285cdae291645ac0d8edabc1fc1961d8f + docs/models/components/outputshellcallitemtype.md: + id: a3b229d84c67 + last_write_checksum: sha1:4edbdeadf0c177709743e2eec1f4743ae2c2ae46 + pristine_git_object: 8ea342be375f8e8c2e6858c28bec9651030f04db + docs/models/components/outputshellcalloutputitem.md: + id: a093694ceca4 + last_write_checksum: sha1:0925e4c14e6a459d670d202ecf2f3e5667250068 + pristine_git_object: 9c0ae6ad4842263bfe85e0b92db00e0be2d3591f + docs/models/components/outputshellcalloutputitemoutput.md: + id: 7034bdc48984 + last_write_checksum: sha1:993a254a15f8b8a644d9d6096911da0ee97bb4ea + pristine_git_object: 603187056833ee4e88b1a8171e02efa627f77bde + docs/models/components/outputshellcalloutputitemtypeshellcalloutput.md: + id: c31cdf082369 + last_write_checksum: sha1:d4db8dbea59ad4702687fb7c0745ed1a4fd4222d + pristine_git_object: 2fdfc96b081fdd063250749a16e9e5886afe818f + docs/models/components/outputsubagentservertoolitem.md: + id: 0e77ded6d461 + last_write_checksum: sha1:f58d42a1ba751766a44b282dcd40b20838911569 + pristine_git_object: 937b61ee157e29f6cf0b8802ba767d055a22ee2c + docs/models/components/outputsubagentservertoolitemtype.md: + id: 9b35ae8d5c21 + last_write_checksum: sha1:e359d6c269a047ac435464ad3842e1bca6b92bad + pristine_git_object: a38c4a269fc41b0a43c8b7202bc32c21ee83b40c docs/models/components/outputtexteditorservertoolitem.md: id: f78fdad3c287 last_write_checksum: sha1:d6e520f13fbe969a2b360edb37271faf4b8d66ce @@ -1978,32 +3439,48 @@ trackedFiles: pristine_git_object: 9b1acf034adb1a247d971e44e71dfe4cdb0bd280 docs/models/components/outputwebfetchservertoolitem.md: id: 75a0660608e7 - last_write_checksum: sha1:b319bd79baf7265753513c16ec91d1ac7ffc0d67 - pristine_git_object: 81959064fdeae64d6fd15650d243f8f89791a6ee + last_write_checksum: sha1:1f8f00c054696854a37f73f04bf6915a7fa5dec7 + pristine_git_object: 2f854497a78ee930c6db05be5024d4aed08cf759 docs/models/components/outputwebfetchservertoolitemtype.md: id: 508d7d8180f5 last_write_checksum: sha1:25c6ac700ac5f374736151485c58f2c3bee1bb6b pristine_git_object: 154246182ed492c2296f69fda0c8499ea5b353bc docs/models/components/outputwebsearchcallitem.md: id: a3b0f343e8d0 - last_write_checksum: sha1:713aebc05f5c1d26dafa008b8653cf8c168de65b - pristine_git_object: 7424cd91af9f9bfee396059151b524ce2bf452b7 + last_write_checksum: sha1:634f379f5f923db9a1819278fcd3668d831638a9 + pristine_git_object: 458bcaad1f72963d351c71ce04029777ecfbfe6b + docs/models/components/outputwebsearchcallitemactionsearch.md: + id: 02697bdcad48 + last_write_checksum: sha1:c2cc572e8df9c3ac0d46c4089d7a5c6ad505145d + pristine_git_object: b4199c4d425b27e9591ccc9a4b4a1c80a2b13682 docs/models/components/outputwebsearchservertoolitem.md: id: a41e2797cb0c - last_write_checksum: sha1:6558b5242e55905939ae363f6fcfc9096da3a003 - pristine_git_object: ed91d8366095281b8ffac5f51428bf782df7d2fe - docs/models/components/outputwebsearchservertoolitemtype.md: - id: 6ab4b4de6417 - last_write_checksum: sha1:8a3fa8505442aa0b8cb80e610599ac71e26bda44 - pristine_git_object: fd5bdfc9cd5f2efe51b0778c0ccfafa3f0212bf6 + last_write_checksum: sha1:2b87a0058d71d6b2fa11dc2ea4ba8d0ca8a81587 + pristine_git_object: e3423a42655eeebb0ef24bc85b08a4b05be00ea6 + docs/models/components/outputwebsearchservertoolitemaction.md: + id: 43395299552e + last_write_checksum: sha1:0625d96aed0b43ee822a2bf188900c3bf401456c + pristine_git_object: e8c809273d406db8ae9aead0d26625adff8708b9 + docs/models/components/outputwebsearchservertoolitemsource.md: + id: b9b432907a48 + last_write_checksum: sha1:476bbed1eadba3bc7120a26f63cb948be09c13ee + pristine_git_object: 7b6a99a1909c284f19346df722186fe248cd6d18 + docs/models/components/outputwebsearchservertoolitemtypeopenrouterwebsearch.md: + id: 85ee46e72e9c + last_write_checksum: sha1:3386247cc0a3de1048740f425e032214198a346f + pristine_git_object: 94ba8767653dd7ccc756b48fbaa4f417be589f18 + docs/models/components/outputwebsearchservertoolitemtypesearch.md: + id: fb2f0dc725c3 + last_write_checksum: sha1:44915515843c44c1f31d347cac037a418eb88717 + pristine_git_object: 44a8eb9422834c48c7aa4a96cf8f5d36621d1945 + docs/models/components/outputwebsearchservertoolitemtypeurl.md: + id: 8bd05972da13 + last_write_checksum: sha1:f25f8c5d737752a053aa66a433ed1ff2547d2f26 + pristine_git_object: 2f1ebc8ab207023209b910882dc2a64d820a10a7 docs/models/components/parameter.md: id: 51b459adc89d last_write_checksum: sha1:e2723ad8e264a6c31b25688f6c64ab238a4c4338 pristine_git_object: 3cacd4b6497aadcb8ff80e189caf5eb28afd2c90 - docs/models/components/parameters.md: - id: 595559497d10 - last_write_checksum: sha1:a2db84591b87f9fa696306b8bb70df6e9c4d0916 - pristine_git_object: e3c6c80ca7fa52a221a63a9f4e9955b10b9ee177 docs/models/components/paretorouterplugin.md: id: a0c7d794d41a last_write_checksum: sha1:a1a103a1fad8da692430b116430cb5cb8c657b05 @@ -2012,6 +3489,10 @@ trackedFiles: id: 678d49db4f6e last_write_checksum: sha1:539028d29cd70f1691437dc8e87ecc1c8a3401ea pristine_git_object: 108abed6192950fa4a6dceab973e886700835751 + docs/models/components/partialcoverage.md: + id: 4f82bc087584 + last_write_checksum: sha1:9e5f3b4ce36ce059a04a6aa9a78d9efad72bf238 + pristine_git_object: 0256d6e85239fbba94ee37efd73a65b78d81151c docs/models/components/partition.md: id: d6cb865fb578 last_write_checksum: sha1:7decc01705e6a13bf10a0d4170cb69777422b196 @@ -2060,6 +3541,14 @@ trackedFiles: id: d5b95fbe4893 last_write_checksum: sha1:ebdbc4c5bcb2e26d6bd1627db61f11db5fb41227 pristine_git_object: 1aeaa618e20c02496309f16db4577f8efd78db36 + docs/models/components/pipelinestage.md: + id: 235a3a506303 + last_write_checksum: sha1:5eebe0db2b363b0e8584d97b61d85f862e41b558 + pristine_git_object: 3eb50a2a8214d7eee76f6bdfe313117791012203 + docs/models/components/pipelinestagetype.md: + id: 19d7df4e5306 + last_write_checksum: sha1:27762420998575b78f62a85660c03fd97344788b + pristine_git_object: 49d9a63ad859d219a2535dc057f2674de9086d88 docs/models/components/preferredmaxlatency.md: id: 96ac872c6aa2 last_write_checksum: sha1:673f6ca2c3dcc34d0d544f777d044a8798c7f081 @@ -2068,18 +3557,34 @@ trackedFiles: id: a244022ecf3f last_write_checksum: sha1:75bfeca2975d7d48e080aab87ad6ce9e7c921eda pristine_git_object: 28158a86d076b7659cd2871860ab82aa49e17ec5 + docs/models/components/preset.md: + id: 7492d03d75e9 + last_write_checksum: sha1:7e21fc29c21c89f2fca90f5913b030f390541586 + pristine_git_object: c5963f26ddb8283c94f9debba9d139f91ec15d4b + docs/models/components/presetdesignatedversion.md: + id: 51fb6ea6849e + last_write_checksum: sha1:7220422545f5b054d046c85512b8a5768b5b3e3b + pristine_git_object: 0b52d2bec500f401c3e61bd5dcf086ee2650370b + docs/models/components/presetstatus.md: + id: ccd104168b65 + last_write_checksum: sha1:3a63b280cc3a492e6f2ada059208357f537f2a52 + pristine_git_object: 11b7feca323349f67355ca7b9f9ab5333d37d790 + docs/models/components/presetwithdesignatedversion.md: + id: a5e416308bfc + last_write_checksum: sha1:0db0aa40c7315637b0ba6a315fe00424fb027bbd + pristine_git_object: 3671689a4470e45c127d171a62409fec15e531a1 docs/models/components/preview20250311websearchservertool.md: id: e24c57d9f4b0 - last_write_checksum: sha1:ef62d7f73a9c6ac4d4decb93e87fc6023747aa38 - pristine_git_object: 50fd35a635f6ab7fa638a76ed8e7cc3ff76d5818 + last_write_checksum: sha1:bce8c1487cadbb06cfd5e8ba17cbec8a3caaa6b7 + pristine_git_object: 4754cf55e09d329cc166a85cd8c1b7694a80f021 docs/models/components/preview20250311websearchservertooltype.md: id: 8a83d44f8695 last_write_checksum: sha1:89dfd50b34d928a2281cf07963ea265fb8c24631 pristine_git_object: 58ba5cd85f99c387e0524363026c21149600b7e9 docs/models/components/previewwebsearchservertool.md: id: f927c252fa14 - last_write_checksum: sha1:a7ea660852a8e1b2692353480b72655d12170324 - pristine_git_object: ff81696af791144f842fef5a2b47bad9c7a4a706 + last_write_checksum: sha1:a8df503a0531b5ae4b36a824ff117829a14f61a8 + pristine_git_object: 324f28b93999274a341776a77e28fd51cc1755fd docs/models/components/previewwebsearchservertooltype.md: id: 5f4165eb761a last_write_checksum: sha1:bea81711a1497becb99d5458ba2114a0358ec3a3 @@ -2096,14 +3601,22 @@ trackedFiles: id: 832eb2c258a0 last_write_checksum: sha1:143781536d340ee02d96333a4a003203b4bc50da pristine_git_object: e8f471b0dfe5a35ff39e34d60f82b4be77e7cc9f + docs/models/components/promptinjectionscanscope.md: + id: 7c50b46a550d + last_write_checksum: sha1:8bb86edd3636e5f34ea4419f7bb43495b561bb21 + pristine_git_object: 3e852eb8443da3be20c29edb8d6b653cb2394f72 docs/models/components/prompttokensdetails.md: id: d6124531d751 last_write_checksum: sha1:393c9e1d1401aec690b10491b362009904abeca7 pristine_git_object: d1a5b5a38cae3941c6d9f3b9bccc44139a360bb1 docs/models/components/providername.md: id: 0e51a390af7c - last_write_checksum: sha1:05395da87ad5ab270e5d284c4a8c269308dd564c - pristine_git_object: 8a121c3a9bdb1a53ae6a862b366442d0d0f76659 + last_write_checksum: sha1:85e3ea5dd276830580d26ef48480ecc01fe43e96 + pristine_git_object: f881f9515124b411f0a2b3df8b8acfbe942aadd6 + docs/models/components/provideroptions.md: + id: ad91483204a0 + last_write_checksum: sha1:899ee6d6a3c17136d54b01d8526ff7fb63d5d36b + pristine_git_object: e27a7066f6ebf72a5c9929ce219af28bf4f82419 docs/models/components/provideroverloadedresponseerrordata.md: id: 380ab6674a54 last_write_checksum: sha1:d23bc108199ad8f6d98bb6934db669082c6663dd @@ -2114,12 +3627,12 @@ trackedFiles: pristine_git_object: 0aed8c0e1a43e0d0746e291527c7a6cba2b81fae docs/models/components/providerresponse.md: id: a08f6552de3c - last_write_checksum: sha1:994fa410731ae76381cf8d89691b867bf3437851 - pristine_git_object: 879fc60c3da1db98e3032ba9b68aab5d6ca481eb + last_write_checksum: sha1:f29f25c7b6ed8cafad15a0878fc0744ac444e834 + pristine_git_object: 27c027bfd8182229c0582473bd0431f57fc79fa5 docs/models/components/providerresponseprovidername.md: id: 3968e328a0d9 - last_write_checksum: sha1:ff9d130a73c6c3751c0cb21d15dde5ea04028518 - pristine_git_object: c0e1e4abe47554cef1c06c98acd277a909614493 + last_write_checksum: sha1:15c8c8893420df04803d9824e7e68fa774b60668 + pristine_git_object: c5ff82d0201a55164d688c2d7b922c142eb1c126 docs/models/components/providersort.md: id: 71c85ab8ce29 last_write_checksum: sha1:0d931a0e0cf1eb4287ff158481cdb0fe12a85f59 @@ -2156,14 +3669,26 @@ trackedFiles: id: 810b1d591072 last_write_checksum: sha1:0c82b996052619316beccf5c9058d4ec70af8a4e pristine_git_object: 17868aa806b98b0ca0931fc7d2fc3e3993f1eae9 + docs/models/components/rankingsdailyitem.md: + id: 9571e692abc9 + last_write_checksum: sha1:8103b8a429d2b3524589a60f32994def93c78144 + pristine_git_object: 4bd3cc08c7ce97ab3c09b4b9ac8a16219c2bc5c5 + docs/models/components/rankingsdailymeta.md: + id: eecd07b370ae + last_write_checksum: sha1:b987b249577e1dba1fc87225ad8503bb173f70b3 + pristine_git_object: c11e479d681c63ca4c3e880a097c9a24c41792d7 + docs/models/components/rankingsdailymetaversion.md: + id: 6d1acd47d6c3 + last_write_checksum: sha1:e6a1981d919d6c39fdeaba23508550d5fa727b85 + pristine_git_object: b9e4297e0c649719e8d86035e86c74ccf58bac87 + docs/models/components/rankingsdailyresponse.md: + id: c805bc525f4d + last_write_checksum: sha1:ccd729902212524161a3c8a159795740a38fbc56 + pristine_git_object: e9c9eb2bbb2e1571a26ea352d84cd4d83bfc07ac docs/models/components/reason.md: id: "6114076205e2" last_write_checksum: sha1:98e0acc471b1e9d25895fd76fb14fb7626321aef pristine_git_object: 8b439e028f6155494618af32269522ce87525092 - docs/models/components/reasoning.md: - id: f5b98f18902b - last_write_checksum: sha1:59fe0036536adf68f97188bedff8486036d9513d - pristine_git_object: ef272e79f9ed069d1df50af7d27698579f59e89f docs/models/components/reasoningconfig.md: id: 574b3e63c96d last_write_checksum: sha1:ac1911e72b5a94f40abbd8eaaf90261e409e10f3 @@ -2312,6 +3837,10 @@ trackedFiles: id: b514169e5440 last_write_checksum: sha1:c72330d7413ef487735af0c0e4818de723b657ad pristine_git_object: f1e79ff18a9e74965151a51204b743d6cf497507 + docs/models/components/region.md: + id: 4290b6a3b093 + last_write_checksum: sha1:c2492aa10dad2e76326ff8a5a4829d5ac58d9ecc + pristine_git_object: fe53e0c70014c331837c1187e5668b8bbf120b4b docs/models/components/requesttimeoutresponseerrordata.md: id: 69c5270dc522 last_write_checksum: sha1:4464ac4efc107751478edd67950f2fbf41ca24aa @@ -2336,6 +3865,10 @@ trackedFiles: id: 5935a819cd6e last_write_checksum: sha1:ec3eee432bfc0a1c0bcb2980385ef02bdb27a0da pristine_git_object: e0eb77f6bf1958018a0914c3fe6df8c990671e88 + docs/models/components/response.md: + id: 331de1bd5724 + last_write_checksum: sha1:6608ab3ae891646e8c3f098b4f8e2b166d5230bf + pristine_git_object: 8b40d70c00496afc217b0d86411d7a2470b016b2 docs/models/components/responseformat.md: id: a76821d25763 last_write_checksum: sha1:ed39c4d46e57bb06de7577e692fef561c4ec2d21 @@ -2374,12 +3907,12 @@ trackedFiles: pristine_git_object: 6ce38411d7ae7e0423b2e47dec747b50026377ab docs/models/components/responsesrequest.md: id: c8886b84280b - last_write_checksum: sha1:9d1ebe12f2dd12bba1147a5f74755f9fb1d61d9f - pristine_git_object: 3008dbe5946fc6f5853796f803b93c8db95d601c + last_write_checksum: sha1:2aa9c273c133cf1c7802db84bc5d11c6fe13bb6b + pristine_git_object: 31fc559c6b0287859ca9e18b379378296fee9cf9 docs/models/components/responsesrequestplugin.md: id: f7298675fe7f - last_write_checksum: sha1:29f20632df4849ee654e78274a86b37905c1d5f6 - pristine_git_object: 262a2f83ec4ab1c0c18b46a7b6e36caa5df2b275 + last_write_checksum: sha1:6121cb6dbaf9970c35964930f591df916f8ea88d + pristine_git_object: 5a45ba54deb542c482a451a82b086b9b6b9ceac4 docs/models/components/responsesrequestservicetier.md: id: 255d8f4207c3 last_write_checksum: sha1:9c48ffcf7968b2ea649e82b54c1e208297b2bcc4 @@ -2390,12 +3923,32 @@ trackedFiles: pristine_git_object: d7fb923b049a4b97ffca9caeda3b86f59ba8d723 docs/models/components/responsesrequesttoolunion.md: id: 4cf18baf7529 - last_write_checksum: sha1:aec34643d7bc13fb588d6ff473357ca15926c31c - pristine_git_object: 6e7ebf7a6c67bb0ec2affe0875963984a8ee246f + last_write_checksum: sha1:3a368f8722762e623c9086361c7e1184046e6e81 + pristine_git_object: dbab58ad922e6a4d5c3821b0b69ef2224a65a4e4 docs/models/components/responsesrequesttype.md: id: b03da90269ac last_write_checksum: sha1:f2158e97cae5c8fab5b6558e6de8add647ab11af pristine_git_object: 1018539b06926ca1332b08c137239f9f22179089 + docs/models/components/responsesstreamingresponse.md: + id: 83d17ad9aa81 + last_write_checksum: sha1:7b51cc7e35a891470c80955d4301282f08ac5727 + pristine_git_object: 3dfdd56ce711027a4ba0b68b995fcfe713950bed + docs/models/components/routerattempt.md: + id: 5d5b66dc664b + last_write_checksum: sha1:e516ecb3ef7daddb9ec969165e2a00b225829837 + pristine_git_object: 1fcee91805ae2bfd6dd7653fca15fa0d6ad98224 + docs/models/components/routerparams.md: + id: 990e2a5e0a2e + last_write_checksum: sha1:2040872688a9f7b7c937eae158df0257ab37d679 + pristine_git_object: bc551dfb661621697e8404390d69a7147870a070 + docs/models/components/routingstrategy.md: + id: 82d7434fe0a0 + last_write_checksum: sha1:97617c98902cf3cb7dc03af865bee1a7c2ab4162 + pristine_git_object: c6fd093d8ca1072a108d6fd17b866d7542661413 + docs/models/components/rule.md: + id: 96943514f0e3 + last_write_checksum: sha1:bf73bf24ecc289045ca92bd119cb82cd65681b8b + pristine_git_object: 7a1eb0da260709c647859513f401d0b8afbf4570 docs/models/components/searchcontextsizeenum.md: id: 5dfe09405809 last_write_checksum: sha1:c10142661248ef810c919c682c4f5fe812be8b78 @@ -2406,8 +3959,8 @@ trackedFiles: pristine_git_object: f4c421c980543b72d59fcfd48feecf397f1e424d docs/models/components/searchqualitylevel.md: id: b44f90fbd4ad - last_write_checksum: sha1:8891a8ae9fd0b1f15032f9cb0a7ebf0109da6e7f - pristine_git_object: efcd8df6980ebc4dfc78118bf502bead11dbca96 + last_write_checksum: sha1:9c0f4d8be1921e688ac0034a113d504ba46cf9a8 + pristine_git_object: 0b01ccc3ce519d20349409f618f98c8aaec7ba91 docs/models/components/security.md: id: 54906b49ea28 last_write_checksum: sha1:17e398b2abd89b7459f07c9ff820a7cc7c7b7bb7 @@ -2416,10 +3969,66 @@ trackedFiles: id: e788b90469fe last_write_checksum: sha1:27c421fe06d922073e036090024996c760ac48e7 pristine_git_object: 7ac3602db1ca5769b46a22c55fe1e35a725de473 + docs/models/components/shellcallitem.md: + id: 412942719bfa + last_write_checksum: sha1:295232961a14dd2ac5ae051f1826cab9941fec42 + pristine_git_object: 72ff8b737c7e003e0de82aa0cf73b365587465aa + docs/models/components/shellcallitemaction.md: + id: eaf5a46bf890 + last_write_checksum: sha1:3c5cfee3c71947c3e8aee32e6680cb88a778bdf4 + pristine_git_object: 03c1c40a72258c761373af34df43e4c34714357a + docs/models/components/shellcallitemstatus.md: + id: bf734966a138 + last_write_checksum: sha1:920d315f426f705256afcf56b2cc69f8049daa00 + pristine_git_object: fd111d49aecdc23a251eb02c21ad834e24cebeaf + docs/models/components/shellcallitemtype.md: + id: 0b534800b745 + last_write_checksum: sha1:d61b1ff483a48589baece173f367cebd4e172296 + pristine_git_object: a8272cd8b0fb8dec9523aab47d99227bd660fa62 + docs/models/components/shellcalloutputitem.md: + id: a936b6ad3096 + last_write_checksum: sha1:12bdaa192b691f544096e7196aa927e9d264a5a1 + pristine_git_object: da9e2f6053732d99da86f6d735e737cf75bd37cb + docs/models/components/shellcalloutputitemoutput.md: + id: 7b283b699b24 + last_write_checksum: sha1:cff05d54bf1b84b3eeb4cae8d6d45ec6b1d423bd + pristine_git_object: 4e7c02371f20cabd7c59a778dc62bdb8fef8843c + docs/models/components/shellcalloutputitemstatus.md: + id: c0a031d809b9 + last_write_checksum: sha1:211b434484276b38901009df2956bbdd5f041e9f + pristine_git_object: bd90fe3cda5d7587a887b8e0fc6c07d1217386e5 + docs/models/components/shellcalloutputitemtype.md: + id: 7cf92c3f293b + last_write_checksum: sha1:82bf5d7e9636ec75ed853ac74f036d199c7d0612 + pristine_git_object: be1f1646c40c66e2592bec119c9b2562cf454dbd + docs/models/components/shellcallstatus.md: + id: 7e9bc77273f2 + last_write_checksum: sha1:3b3fb78a3527f7a6239a68bd2199585a249ff6dc + pristine_git_object: 3e5cfed1034c936511f4d3726557017915c993b2 docs/models/components/shellservertool.md: id: d01ab67ebcd6 last_write_checksum: sha1:87bdecb0297d42f99132ab99e1d49bc0d0c3e38c pristine_git_object: f21216a889bcc531bb53302ee083356a09813a47 + docs/models/components/shellservertoolconfig.md: + id: 90ed9dc7eab1 + last_write_checksum: sha1:073e5716116268e536291643b70d86f04e25c94f + pristine_git_object: 0a6b03b7875da575a6f815bfa1e5d3c676d28e5e + docs/models/components/shellservertoolengine.md: + id: 9b1a438c3ee2 + last_write_checksum: sha1:94d97da668622f03d267de2229094438434e18d1 + pristine_git_object: e8242df0c5ebb2b0e3a8936f6240e3b4c3d62c39 + docs/models/components/shellservertoolenvironment.md: + id: e1554629cdef + last_write_checksum: sha1:61265ceda82c1e1e375421ec8d96c561cf9923ac + pristine_git_object: 9939a5f0a2e2e5967c53fca47be080f984be7c97 + docs/models/components/shellservertoolopenrouter.md: + id: 333eea395d3a + last_write_checksum: sha1:54a1d8d491f3a0922efa28375e580370d7410e0a + pristine_git_object: 37e3e54be37790cdf76430f50b8255c164592e75 + docs/models/components/shellservertoolopenroutertype.md: + id: 8ad380f44357 + last_write_checksum: sha1:c756964ec52882bbab75ea742af05dd89249b141 + pristine_git_object: 8c4aa861b732187efd2e5c29900618aa16ebb4f7 docs/models/components/shellservertooltype.md: id: d97995846872 last_write_checksum: sha1:dbd2944358d089f72cdc7291e02da7675bcf4138 @@ -2432,30 +4041,86 @@ trackedFiles: id: 4ad121d104d6 last_write_checksum: sha1:50d118fd53032453b78c52f99d6f23bf020c559a pristine_git_object: dd28421e5d8260780e4ff6c163dec2b87eb60715 + docs/models/components/sourcecontent.md: + id: 594d8a4fb7bf + last_write_checksum: sha1:47ee28fd3c98970b14661bcaacbfaf1b59015054 + pristine_git_object: 03bd220892cdcb5fe23d0419bd63220bd5219e1e + docs/models/components/sourcetype.md: + id: 618ed8957b63 + last_write_checksum: sha1:374a1842d71cd8daa746ca22883475ac3a810e23 + pristine_git_object: b4f850a3006484d0d69ef2006399e00f152f09fb docs/models/components/speechrequest.md: id: 1f8504ac04b4 last_write_checksum: sha1:a99e4d46ec0ef8fb7c5dc1f4ae2299e4d5003c82 pristine_git_object: 7b9517c8001a6b143fe69cd42539c37e5ed461cf - docs/models/components/speechrequestoptions.md: - id: 8584645b328f - last_write_checksum: sha1:3d42a39777dfe00dcd9d92652a06b868ab8fb738 - pristine_git_object: fb8888e3691534e8024b25e40e472e05cc950c25 docs/models/components/speechrequestprovider.md: id: ab47ab61ffbe - last_write_checksum: sha1:c613b468496f8a8f8ceb8bce15328533e58deb50 - pristine_git_object: 3171e82fcde1f31d636a16614699b0da003e0a3a + last_write_checksum: sha1:f78c9603532c50f5f129b2ad3ad9b12e2bb03f26 + pristine_git_object: 5eb2fbd1c7b65f4881766857c55dc89168613cc5 + docs/models/components/speed.md: + id: a75f09df7330 + last_write_checksum: sha1:ffeead3a36aeb449dc6af68a533b32cb650da860 + pristine_git_object: 1900f760f5eb208adc3edc1c1a96d280afc98c26 + docs/models/components/stance.md: + id: 07dfa5bbfb63 + last_write_checksum: sha1:2fa8e01647976436ca799000b323fe6b5f126515 + pristine_git_object: d89aee8965fd191fe1295716f9b4218f674763ac docs/models/components/stop.md: id: 7a22fbe78bb4 last_write_checksum: sha1:4c98f3d0ff9778b241bc31030985b995597a0cf4 pristine_git_object: e7006fd3d9770b28515804cdce2c9d8e414e78d2 + docs/models/components/stopservertoolswhencondition.md: + id: 76f93b5761c2 + last_write_checksum: sha1:7824bd77ad46a4a46156520cf537e14ea8b48eef + pristine_git_object: 0c319fa6e84499c3b5ba5ff8dc25c077ab6d21f7 + docs/models/components/stopservertoolswhenfinishreasonis.md: + id: 1dd21ce9ddc9 + last_write_checksum: sha1:0ac1bfb6446a85a243957d067070344ae19b513c + pristine_git_object: 33541eae738686ace027d97b8f462fcaad8a3de5 + docs/models/components/stopservertoolswhenfinishreasonistype.md: + id: da77ce7774ee + last_write_checksum: sha1:951b13369dd1bf6be6e61ed5278374e35e163521 + pristine_git_object: d5f7cd5ac321a0e77d043efca6886ed6d5fa89be + docs/models/components/stopservertoolswhenhastoolcall.md: + id: 872780bcee3a + last_write_checksum: sha1:4386fb860b66834323286297d7f7a3f52fe4fe21 + pristine_git_object: e40bb2ca1c4a3d08ea589c7e495bb33be839ff3e + docs/models/components/stopservertoolswhenhastoolcalltype.md: + id: 09f8b2ed7fa0 + last_write_checksum: sha1:cd556276a18155b4a07a6911c0659536e0629de3 + pristine_git_object: 4ec1bb7b51e10aa2d5c6e9cb806bbec0bedcd367 + docs/models/components/stopservertoolswhenmaxcost.md: + id: 49e0c631f7cb + last_write_checksum: sha1:5e5b06a776f6d5e6c07cac48fdc4777aeccad669 + pristine_git_object: 9d397096a777cb121218949412c076f7a012484b + docs/models/components/stopservertoolswhenmaxcosttype.md: + id: 50b0fb637a24 + last_write_checksum: sha1:e8be665e554a1f709da23f24b5e68146e097e993 + pristine_git_object: 877a98fbc111a5f2c865053ecfd4f3f8cdbe6a59 + docs/models/components/stopservertoolswhenmaxtokensused.md: + id: 0cc8cb79b73d + last_write_checksum: sha1:326525ed83281eb832fbf0022e31e5972815286e + pristine_git_object: 4e74ee756d8b02659e8894ab1789256325bad178 + docs/models/components/stopservertoolswhenmaxtokensusedtype.md: + id: 0d672e83eadd + last_write_checksum: sha1:55b1f5e88ce106da15063e3e6856b6424c5fafe2 + pristine_git_object: 9f857ee29f24779ca8afa16fe8b0f805e2e3e35d + docs/models/components/stopservertoolswhenstepcountis.md: + id: 33f86d4d8910 + last_write_checksum: sha1:464554af9ae9c6219818f7a980f821666aaa8d3a + pristine_git_object: 35061e6085f830dbd09a3b6c7493569c313f2cb2 + docs/models/components/stopservertoolswhenstepcountistype.md: + id: 06a316028f08 + last_write_checksum: sha1:a3b8fee9367b09818604b08741438c0c6365c2b9 + pristine_git_object: c69206958798469857f43cda1a7df35098a9914a docs/models/components/storedprompttemplate.md: id: 398168057efe last_write_checksum: sha1:6bc71db8cf88bd34f187f5ac2c885dd3e3c2d0e9 pristine_git_object: 5129f5aab7948d3ba46b2a600ac926a83adfdc02 docs/models/components/streamevents.md: id: b4011a293eba - last_write_checksum: sha1:b9de050f7ed7c53348a2a9a04042902315831f4a - pristine_git_object: 12e3c3f221b1ac207a162de15dcc63e6749c3a74 + last_write_checksum: sha1:8193bd58cb5c6f44bb5e03e0729884ade4e62132 + pristine_git_object: 903929d330a6e39472a4649580a48c7e9a1baa39 docs/models/components/streameventsresponsecompleted.md: id: 63b394474134 last_write_checksum: sha1:5bb2310472d6e6fccb373198fd3fb9fc0875f3d2 @@ -2504,10 +4169,54 @@ trackedFiles: id: 5aee984d3101 last_write_checksum: sha1:0e4987f2f1b52adea7d4946e0fc63a9824b62611 pristine_git_object: 6cab1414a02ace90aa39f95ad5d0df92f6f78023 + docs/models/components/sttinputaudio.md: + id: 587f7bfc77b9 + last_write_checksum: sha1:30277667cd0dc92bb171f2b5b5621afb8c126c5b + pristine_git_object: deec8b63e5d04a9bca3fb38fe4e3f00bf7bee826 + docs/models/components/sttrequest.md: + id: dc4c7d72fe1b + last_write_checksum: sha1:9b17ae2fc5485ed7a7ff82294b9b2be68f7079bc + pristine_git_object: d2c36bebeada10a786959ffe1337d48c96ae810c + docs/models/components/sttrequestprovider.md: + id: 15505a849b11 + last_write_checksum: sha1:3272ef60d16f48e7b81b93e481b09898748f0c15 + pristine_git_object: 9e2700d12240a446f7b2f1cd2c4b16aece01c380 + docs/models/components/sttresponse.md: + id: 5127df568592 + last_write_checksum: sha1:44e7b98fef0a46feb327d42ec546393870380995 + pristine_git_object: 3bc8dcf19bda9e385eadfa38c3122c3b828df77e + docs/models/components/sttusage.md: + id: 5996d7e5befc + last_write_checksum: sha1:4bd440b13797c9e6933ccceea64f7ab0afaa50f3 + pristine_git_object: f1c12e7a8a842ae2390ab553fecb48d923aa1c24 + docs/models/components/subagentnestedtool.md: + id: c31a7c40fabe + last_write_checksum: sha1:ff467133d5f89b615c0eb4c96f10b26790e2b3d5 + pristine_git_object: a7f5dad834f00af13d6769a8e028a963af110863 + docs/models/components/subagentreasoning.md: + id: 2f58e3f0a788 + last_write_checksum: sha1:324563604a7e168d44f8bb4b3606cbf4b0ff4495 + pristine_git_object: 9748930d243bc6b5e4238fc89d78b5bc760c5a59 + docs/models/components/subagentreasoningeffort.md: + id: 5953b606f718 + last_write_checksum: sha1:9b37b89288ec1cff1bfedcbc21cd5ccb0d553b3c + pristine_git_object: 101dcfa18bf8772db7eb5f81ae6802dea6e990c8 + docs/models/components/subagentservertoolconfig.md: + id: 8bd1bd78db7b + last_write_checksum: sha1:906e3593e842319c80014adffd7bd07594cce4bd + pristine_git_object: 88187215bfb3a34d0e0b114771c8aca7605456cb + docs/models/components/subagentservertoolopenrouter.md: + id: 6227d3d9a747 + last_write_checksum: sha1:6c0dd82ea4d32a843cfa45ca75fbb2277c586072 + pristine_git_object: 9f92b24278cebb68df848eb8b45605e053b04cc3 + docs/models/components/subagentservertoolopenroutertype.md: + id: a99b691ab1c0 + last_write_checksum: sha1:74034f5ac37b2713f030eb96c17204de93cc97a3 + pristine_git_object: 874a6c29c8274261625db70204b5a606d0438237 docs/models/components/supportedaspectratio.md: id: abe96eb1eac4 - last_write_checksum: sha1:b690f13ea0866827bff9fe9667abf74c59337c15 - pristine_git_object: 16424da46ee1ed1259719a4eaa6dc56f880415f9 + last_write_checksum: sha1:809d1e919edd8bb4dbddca3e111ed3cf6eb85ce1 + pristine_git_object: b909916f2be435bd8b8fdad6032f2154afe9c934 docs/models/components/supportedframeimage.md: id: 0841813cb3e4 last_write_checksum: sha1:b9eb77cb5566aa24952bbf7c0480215840783815 @@ -2518,12 +4227,20 @@ trackedFiles: pristine_git_object: bd4de1521b51f5a57b50ffd32d8f7895e9e55558 docs/models/components/supportedsize.md: id: b1e961045c4c - last_write_checksum: sha1:c9071bfff2dd3b365a20053c411ccd12a6206798 - pristine_git_object: d723b90f99b089664b56d27daac389ecdeb72aff + last_write_checksum: sha1:0c6e97975914768054a04bf66b190a7aba89e36e + pristine_git_object: b42d78775fb97d602b59311fc33ae371581bcc5e docs/models/components/syntax.md: id: f6bbcdebe9b7 last_write_checksum: sha1:92b209420e37089d3b7dbb711dc35f262d7e0352 pristine_git_object: 10cc8bddfb739f3b5735b695a345bc4205488907 + docs/models/components/system.md: + id: 8c5882aad149 + last_write_checksum: sha1:c8682a4cc0ee3ae0e317df4a6fda408fbbe55ee5 + pristine_git_object: 8834f4f2b840a1592817364bc814bdac2f3529d4 + docs/models/components/taskbudget.md: + id: 1863e9f01421 + last_write_checksum: sha1:b9cbd4275b342f018b7fc132a6ed25ea66b5fef5 + pristine_git_object: 1f4b73ca44b4743f46400c8d1582fb5f36d5e097 docs/models/components/textdeltaevent.md: id: ad4a3e160ad6 last_write_checksum: sha1:6dbbf95cd39bc4a27a595fcd3be2144ab02144a1 @@ -2544,14 +4261,42 @@ trackedFiles: id: 5ecbc86380dd last_write_checksum: sha1:1d00444d096e78449b8e9cf4791bc740302103c6 pristine_git_object: 3f3f0ee29b5b5db623f70d1f200a4f1511241ef2 + docs/models/components/thinking.md: + id: e9bb107645a1 + last_write_checksum: sha1:82b1d7e7227896fbfc4e7a6b6b83d278cd8e3b94 + pristine_git_object: 54d4cdae9b54778c96ec66a33fd71ffdbe93eec3 + docs/models/components/thinkingadaptive.md: + id: 01f35475d70e + last_write_checksum: sha1:aa1ec61492edd160628aad713ad5b86f74a6de44 + pristine_git_object: e1e0e9486ad166a775fbccf03df82532da6b61c5 + docs/models/components/thinkingdisabled.md: + id: aeb6c6921de3 + last_write_checksum: sha1:f135a5492948c96cd585eedb54f40c51388d7a47 + pristine_git_object: 5143813dc297620d03185537b8b00a0cbe278a24 + docs/models/components/thinkingenabled.md: + id: 10176791991d + last_write_checksum: sha1:b6da859c90aee1b0d89d895c27b30aa11dab5060 + pristine_git_object: aa41ae79e49661b1c925097ac5607df09aa3f758 docs/models/components/tokenizer.md: id: 67b12de83325 last_write_checksum: sha1:6d6597fb22c833e950171cb57e1206ab16f9a700 pristine_git_object: 229de02e42c74f3827bc0d4f36babae3cdc897ef + docs/models/components/tooladvisor20260301.md: + id: 33bf34044c8d + last_write_checksum: sha1:45dd073fa72c91e97cdccc0131f795874dcff957 + pristine_git_object: 0a61a819d2fbf27be463c7d65e2455045a44d923 + docs/models/components/toolbash20250124.md: + id: 83bbba28e57c + last_write_checksum: sha1:aeaa98369a674d26ddde95ed604cf195a21e5fc6 + pristine_git_object: af0c36cb7e646bf21ee322a3b227727a9fbd180c docs/models/components/toolcallstatus.md: id: a018de29f8f3 last_write_checksum: sha1:592ed064c9e6b199a3e35f483b594ebd4b3ebadf pristine_git_object: 125b30212ee38f7ac8a4a0931a2d8b6af1c23c20 + docs/models/components/toolchoice.md: + id: c91f4ccbf84d + last_write_checksum: sha1:fa5283c91020586b1fd91fa28c2063f334201ef2 + pristine_git_object: 8275ca643e1ff0d5f8db8db2d9ecc67766c26893 docs/models/components/toolchoiceallowed.md: id: 34bfeb2b972f last_write_checksum: sha1:318f201dc53904e27448e10758a47d851afd91b8 @@ -2560,6 +4305,50 @@ trackedFiles: id: af863fba7dd5 last_write_checksum: sha1:fae085683e75921548d966171df44b943c462b2b pristine_git_object: ff3724ab9921ab4794a6f83a1bad649951add0ea + docs/models/components/toolchoiceany.md: + id: 0fc24e52bc75 + last_write_checksum: sha1:ff2b8e62a4dbdc9ec89e5b4a8aca744786cc1db2 + pristine_git_object: 4e9c46d9f90204aa96885205d5fe8a4ab4b72fc5 + docs/models/components/toolchoiceauto.md: + id: 48938cddfeb7 + last_write_checksum: sha1:ff7f69e43a2d7136716fabc3ff62a592316b61eb + pristine_git_object: 6b749db318e58df23f2b7eac53ff8ac8494cbf4a + docs/models/components/toolchoicenone.md: + id: 428d50b127d0 + last_write_checksum: sha1:2f057d8e6bf6ef3b7c5695982c0d92515f89e4e0 + pristine_git_object: 9995ccddcd4117c6ee4a5d243decf6530bf807ba + docs/models/components/toolchoicetool.md: + id: b94f3065281e + last_write_checksum: sha1:51aa3d91b3240b8e98cd98852f430c8e0ff24a3d + pristine_git_object: e3af09d6958092ed8fd5ea0d66796f820abf1a6c + docs/models/components/toolchoicetypeauto.md: + id: bd6474bd86b3 + last_write_checksum: sha1:1011a7e9a6abae235e432c64d05f1fccd3f1f0f6 + pristine_git_object: 67edceadd399d33e5a40bacb4ee94dfccd334ea5 + docs/models/components/toolcustom.md: + id: c1c9cb854902 + last_write_checksum: sha1:14df0825e5fe549047c6a77c4ef7430dcb9d9295 + pristine_git_object: 8c6f6a60e00a62c24024e5ec6b9378322b9b2858 + docs/models/components/tooltexteditor20250124.md: + id: beff821c6cae + last_write_checksum: sha1:2a99e2623ffee5cd243168cb694feccdab34ae10 + pristine_git_object: 5adf1568bcf0d07f65fbc5394c5bdb4c0d59595b + docs/models/components/tooltypecustom.md: + id: caa43c172db9 + last_write_checksum: sha1:f1f1f86a68611f0e2e388a24d382b1309365d66c + pristine_git_object: 5169f0557bea67ee0d3f5e852845480ba940592f + docs/models/components/tooltypeephemeral.md: + id: 4d66169f62ed + last_write_checksum: sha1:1adeef702b28bbc3330653d4b38525428927ccbd + pristine_git_object: 7e5d2c32cfa8996e29769b1ea3ce298020ee174a + docs/models/components/toolwebsearch20250305.md: + id: ca46195d30fb + last_write_checksum: sha1:9bbf0dd27a5aee3a57666984a00a0260e7e8983e + pristine_git_object: add9f42e9c276c1c04d17ee7a5db8605254875a0 + docs/models/components/toolwebsearch20260209.md: + id: c435e7fcab46 + last_write_checksum: sha1:1b9a96c85ad6fc3a316e1f5cb2bb86a09a1816bc + pristine_git_object: 593061d338d6b299b71029557fb22f28f8da0a40 docs/models/components/toomanyrequestsresponseerrordata.md: id: b4af37b74e0f last_write_checksum: sha1:c6e5deda29fd2ec74b166b5e71b45bd416487000 @@ -2568,10 +4357,22 @@ trackedFiles: id: 66dacde90b90 last_write_checksum: sha1:486e0baf8a7c76ebf6d9a62310257351d2800a34 pristine_git_object: e04433497c1aa63138d83e5af6ffafb2b2526142 + docs/models/components/tournamentstats.md: + id: d1038930256a + last_write_checksum: sha1:d55e136d72eaa32fad9f2da6a85c778541354089 + pristine_git_object: baa1fc4831a3a02bf0ff938a7dc3139964f34bd1 docs/models/components/traceconfig.md: id: 149014ae4d57 last_write_checksum: sha1:6076a8e37f7a987bbbd464fcf9792ab37aeeefcf pristine_git_object: 90b40e57f2b49bff86ad9009f8a0481cdcba1340 + docs/models/components/trigger.md: + id: a5cba760fe3c + last_write_checksum: sha1:14b01853e04e022120ddd75acb5e514bd1bb9457 + pristine_git_object: 256e80189510dbbf761cfca38d215530db378a66 + docs/models/components/triggerinputtokens.md: + id: c7c8966d0c11 + last_write_checksum: sha1:8bb17fe7df7537f0f0d6308cbbf67ff0eab191b7 + pristine_git_object: 047250e8c539736ffd35e6af3f62426b3b2db5e3 docs/models/components/truncation.md: id: fb4aefe7bbd5 last_write_checksum: sha1:1d281fe74e4333cdc0e0ccdd512a8c103f6237b6 @@ -2580,6 +4381,30 @@ trackedFiles: id: 9f07f2d18a9f last_write_checksum: sha1:d87724d43e3d1a25f8a665fe8737990fa945fc3f pristine_git_object: 725cbc459c8fadcb307ee5af17708f2cf704eddd + docs/models/components/typeadaptive.md: + id: 56d946c9a5a3 + last_write_checksum: sha1:524e1adf50f3f616c7cd034461fc31d6b91c7c4a + pristine_git_object: e086e37c894496f347a4c88b1a7afce20a05a39f + docs/models/components/typeadvisor20260301.md: + id: 7df1fafb45da + last_write_checksum: sha1:b85b55919d6a7771876e21ef1713bc95b5faff84 + pristine_git_object: bf2330c4f4bba21ae43d9a64aaa52ca30ed48e36 + docs/models/components/typeany.md: + id: ebf225178030 + last_write_checksum: sha1:8cdccd8fd98785eeebcef8bd3441de018c6e7b6e + pristine_git_object: f81784878bf52e24a6d737e9090bff7cdbcca769 + docs/models/components/typebash20250124.md: + id: 40ffb9eb302d + last_write_checksum: sha1:58a566cd1431d2969b96b26465c0e9801bfce50c + pristine_git_object: 4d03d5f9ab38078da304ca542e92533fbaad0088 + docs/models/components/typeclearthinking20251015.md: + id: 6081a333453a + last_write_checksum: sha1:6008ffbe58d8e00cb3c3f60b7b0cfc81a640cc58 + pristine_git_object: 901bddbc96c24d560f110f2f84f3019806a60e37 + docs/models/components/typecleartooluses20250919.md: + id: bbe4bd3a4fbe + last_write_checksum: sha1:bded3473fbfe783c624b62194d94782c2c178a74 + pristine_git_object: 364c245c25c7c5506cb54f2109a2095ca3d05f9c docs/models/components/typecodeinterpreter.md: id: d9cd9bad1e51 last_write_checksum: sha1:d0ad698cab6a41e8b7a599ee1b9d6c8ca9de7ffb @@ -2588,10 +4413,30 @@ trackedFiles: id: 30c9658433e8 last_write_checksum: sha1:840cd552aff7e0e44d1b53d2419ea12d0ce8e358 pristine_git_object: 825c50a14a0d9fce95c7632bc88e3523465c903e - docs/models/components/typecustom.md: - id: a0b2cff1389e - last_write_checksum: sha1:5e9363bd74b1b2039caf0e2f0d57415801078d37 - pristine_git_object: dacb60d8673b9fcb2c4cf9bc60350a4f01f5ce76 + docs/models/components/typecompact20260112.md: + id: f9abb0b94ebd + last_write_checksum: sha1:d173a9a251e9c48fc8c33131473d9875bf7a2f46 + pristine_git_object: 3d40a15adf238db49e58b7445e77cc23d0b7d767 + docs/models/components/typedisabled.md: + id: 149d2e1c651a + last_write_checksum: sha1:c26d0e507571a5522b212f09ca22c3f7ba8a7cc7 + pristine_git_object: 9d98160ccbdce4bdfc12dd65ffe7abca402e5250 + docs/models/components/typedocument.md: + id: fab387a4e14d + last_write_checksum: sha1:833f54b90a384aa47002226d3df8e6c0692011a7 + pristine_git_object: b0bae218b99ceb628309fca2c9dcc9134ca27139 + docs/models/components/typeenabled.md: + id: 4043f1d89046 + last_write_checksum: sha1:7c0cc2799ac3a6f1fb6bd1acac48f45aff9fa935 + pristine_git_object: e1789413f0e668cd54f364bb1980954b401c7638 + docs/models/components/typeexec.md: + id: ad345569b52a + last_write_checksum: sha1:2c1f078bed441d61e07251e458bd20f7204036fc + pristine_git_object: fdf7666a8f35be0c6180adb69afeac0e12b125fc + docs/models/components/typeexit.md: + id: 2b8ff20f0e94 + last_write_checksum: sha1:3b66ab51788b62bac2bd401fd46808242100a283 + pristine_git_object: 16ad0846cced33a4bc8fac2f4493a042e6c37416 docs/models/components/typefilesearch.md: id: 6cddca717e1e last_write_checksum: sha1:ce45df4418bfa989fbf55ef1317fa44432a1a96e @@ -2600,70 +4445,146 @@ trackedFiles: id: 9bced3910201 last_write_checksum: sha1:559951291c92cbd5b131d5cfcb88a5c333721462 pristine_git_object: 0f4f4be0d9e7e9dc5001ed22abe79784a651ad51 - docs/models/components/typeimage.md: - id: d6c3ae0e5244 - last_write_checksum: sha1:e188c8e998b902974e41476aaa0777d451c815f9 - pristine_git_object: 92d543e2445721b1ad9ae5c03a1a4e947dfef257 + docs/models/components/typelocalshellcall.md: + id: e8bdff527b0f + last_write_checksum: sha1:0687ed0c99b44a0ed637c37caf2250c8d0d5e2c0 + pristine_git_object: 9c48d27f259d7348b66bbdd4bf8e80d7931f1590 docs/models/components/typelogs.md: id: 5976c0047fea last_write_checksum: sha1:b1821581a06bb6e44c379bdb274e275ac67ff6c1 pristine_git_object: 9734f71b4ced0c4d497a24f980c9c1182c962add + docs/models/components/typenone.md: + id: 0953ac4c095c + last_write_checksum: sha1:de823d6ad3f4ad405d5bdd37ef93a11648ef340b + pristine_git_object: 725ae3705cd32803779c2137c5ea4a8283c6366f docs/models/components/typeopenpage.md: id: 83c76025f161 last_write_checksum: sha1:07ef065909aa59a1a76b97b7508714a4617cc393 pristine_git_object: f7da6a276b167d210a56b906ff674f0e57aa8ca4 - docs/models/components/typesearch.md: - id: 1870ad47908a - last_write_checksum: sha1:9c22c3e979970703bddd00fc745c90612db078fd - pristine_git_object: 3601265acef0f7675051231d39b4e7c20f3586fd + docs/models/components/typeredactedthinking.md: + id: d21907740561 + last_write_checksum: sha1:ce7e94c0b5021772628416ce479a9ad1ec9006c6 + pristine_git_object: c584713536025bf959696e75ed509ab87e66b456 + docs/models/components/typeservertooluse.md: + id: 0c9bbe47d75c + last_write_checksum: sha1:fb378d42cffca15b1777b5f46acae88d037967b7 + pristine_git_object: f6f127c8bf52328b55dde35becf34f464cb096eb + docs/models/components/typetexteditor20250124.md: + id: 2fa9cc3c8ac3 + last_write_checksum: sha1:0666a50e384d1b74f37a8de64a88c2037d5909ae + pristine_git_object: b5683c44f123d405b460d63f1198e2f89bc8a757 + docs/models/components/typethinking.md: + id: 7c70c766d4ea + last_write_checksum: sha1:3dea697dad965225a6b2c52e09182c4d51e090a6 + pristine_git_object: e235c19876513e52cd0506a39a77b77c70fa0fa2 + docs/models/components/typetimeout.md: + id: 113ed0e879b7 + last_write_checksum: sha1:daa46d475ef7924ce2e2d3ec3d34303a0387fe92 + pristine_git_object: acb1a418a40ae519a43415ce4c2ccc500f2e12f9 + docs/models/components/typetokens.md: + id: 4b2380680eff + last_write_checksum: sha1:f03f9b644a6ba71830f332dd0439994c72af15f3 + pristine_git_object: 7817f599b4b7b92ece9de87fc3b609708e011e2b + docs/models/components/typetool.md: + id: 9b380cda7119 + last_write_checksum: sha1:a37d2e9f2fa551963a271edd26435b0e29caa962 + pristine_git_object: 04d932cc0dd2d0db0ef34e3867fa2ca3aacc4e1b + docs/models/components/typetoolreference.md: + id: 82e993d9156b + last_write_checksum: sha1:4c5bb532d36a4052bcd4151f6fca31316b245640 + pristine_git_object: 95bbdc911d38b0d8da19e72d439020a0646e6250 + docs/models/components/typetoolresult.md: + id: e30ff11f35af + last_write_checksum: sha1:559ea49642302120b3c5cb49c310daa95efc8ce1 + pristine_git_object: fc81170eff6d4378b168c338667e06f9d971a197 + docs/models/components/typetooluse.md: + id: b6bc86f711f8 + last_write_checksum: sha1:127f778942e6777ad32d555f95426344cd98b0ca + pristine_git_object: 7027b4c5e6b23109961fb7f6f8bf4233745f3847 + docs/models/components/typewebsearch20250305.md: + id: c3564f334cc6 + last_write_checksum: sha1:776f86b105db190ea1ef1c68556910424c9af767 + pristine_git_object: dd4cdeb5ff43c867b47e121ea3ddf4c53b423a71 + docs/models/components/typewebsearch20260209.md: + id: 4051a0bf813f + last_write_checksum: sha1:a3339a62cd8b8c326929dc3a30ed43b90c14a44f + pristine_git_object: f46930e3f7febd7a1978d7c5860cd189fb8693f6 docs/models/components/typewebsearchcall.md: id: 29293168ae43 last_write_checksum: sha1:8ea9c4e5f597e92819e68994fe649d1583782700 pristine_git_object: a646ebca57eccdd34de89974002c72802e785b22 + docs/models/components/typewebsearchtoolresult.md: + id: d58bf1e12c3f + last_write_checksum: sha1:46571b9fc8a2cce4229591d118de1e9b6b06c671 + pristine_git_object: d5420446506fc8217a40532c43d6673c0753317c + docs/models/components/typewebsearchtoolresulterror.md: + id: b63a390d4a5c + last_write_checksum: sha1:aa3aee276bc5fe5b5f2ed8af79d7c0e43a29a537 + pristine_git_object: 96182c70ed39c38c13782e5f9bd0de0ec16c2eda docs/models/components/unauthorizedresponseerrordata.md: id: d0463c62ffdb last_write_checksum: sha1:ed17d69bca64692460f9470d27214562bcd8ca27 pristine_git_object: a8da92547b90f1d9b721d6694dc4e859b718ab7c + docs/models/components/uniqueinsight.md: + id: f5a031084659 + last_write_checksum: sha1:5ea016900b17a15d6082bc1b63cc15210d006b94 + pristine_git_object: 4a226787e0ee6e617dfb489d03198bd1f8f82b94 docs/models/components/unprocessableentityresponseerrordata.md: id: abbf51e08d30 last_write_checksum: sha1:204aca5b0a82d0cc49f12b707d08132d199288ba pristine_git_object: 16118a8a90aa446d1050c3dbce333ff894ab742e + docs/models/components/updatebyokkeyrequest.md: + id: 3cd8be7ea3cb + last_write_checksum: sha1:70185034effc9449d7382d4fa23b6c1a6de0e014 + pristine_git_object: b4403546e7a991c492fedbdf2ad984c624bb93f8 + docs/models/components/updatebyokkeyresponse.md: + id: 8fa0891f420d + last_write_checksum: sha1:50fccf7cffe7eccbe809e0d3eab2d801ccaa13f1 + pristine_git_object: 45aaa004552bce6d0bf14a8e06c6ae79d135c7e3 docs/models/components/updateguardrailrequest.md: id: ebcb49eb1b29 - last_write_checksum: sha1:f8d3ab9d349bf2a952c542d80b29b6e19592b186 - pristine_git_object: 2966bd91fa71fab7443ace5cb6e08c2462efda5c + last_write_checksum: sha1:27c9875029b28825f76a37add7eacccb8794c9c2 + pristine_git_object: c01373206d59193cd221b8ecb0ccf05378b09d5b docs/models/components/updateguardrailresponse.md: id: cec59127597f - last_write_checksum: sha1:67560c1b3a30742d7e7a9def31552146ae22cdcd - pristine_git_object: 44498fdbc557df7a2794dff77663aa834dd0fd6e + last_write_checksum: sha1:d68517d22b52e46a6385299d9493129483fb013a + pristine_git_object: b3ade8c30970d70a938ec78601718f23f3fc10ea + docs/models/components/updateobservabilitydestinationrequest.md: + id: 806a2afce075 + last_write_checksum: sha1:823f7db711ac1e1e9b65038be91e823a6f60f810 + pristine_git_object: 3aa8de7cd2c07411db682231acfb8db56484cc5b + docs/models/components/updateobservabilitydestinationresponse.md: + id: c5de55115975 + last_write_checksum: sha1:08f445901204587a44e5936bd1295dd2fd77cf21 + pristine_git_object: fa1ecfdb17a383205deeadca3f72011b06ed87da docs/models/components/updateworkspacerequest.md: id: 4cb886ed6c9f - last_write_checksum: sha1:eeb866d46f723d583c872581a6ac86aca9bbcd45 - pristine_git_object: a1d4a1671f6d88da6344f40bc4d97794b92fdaf9 + last_write_checksum: sha1:7a6347b8c56a4d7cf8bba1994f601456823876ee + pristine_git_object: 83b157b5687a25ca5a10821ddc567890cad3aa10 docs/models/components/updateworkspaceresponse.md: id: 7c1800127dc6 - last_write_checksum: sha1:1e2f43fa5fff188cb1d5c43459cca530c3c3cecf - pristine_git_object: 42d3881325f44107ec064eba2ec3e344cd5d01c6 + last_write_checksum: sha1:1bfc8362e5f905e7745e741f6d1252d6478c3e17 + pristine_git_object: 996da2b8ea33b0182aa8b85327d8cb618d1b408f docs/models/components/urlcitation.md: id: 66c2ca1e64c6 - last_write_checksum: sha1:b3e79b15d13adfb012d065c76b07f60f0c0fb531 - pristine_git_object: 3914a62651ee8697cb6a39eec4a69fb88be3bd3e + last_write_checksum: sha1:84f5f90a99d349e30a7560260c45ff382a2ee8d5 + pristine_git_object: eb835845c9433daf1916b309eba9233e4442b367 docs/models/components/urlcitationtype.md: id: edde8ba19aab last_write_checksum: sha1:c35cc41839d70a26740722d5c1ddc9d94670e2bc pristine_git_object: c015ab370acfa659f26d31e187cd61022a3ebfbb docs/models/components/usage.md: id: 3c67b180408f - last_write_checksum: sha1:870719511c8127b9c8e1a1aa221897a929f9c068 - pristine_git_object: 594806ccbb9bb8815125e9b88b1f92e2e6405ded - docs/models/components/value1.md: - id: a0306f507cfc - last_write_checksum: sha1:71201610497c9f2648d256a211f54af2784b7558 - pristine_git_object: bc734a31f1358ba7825f37a3e39537f4682a09d1 - docs/models/components/value2.md: - id: 168a471e9b89 - last_write_checksum: sha1:9396b71770e95e631e8d651cb3ff2cbffbbdb734 - pristine_git_object: d24c0fd7fb558327e9282c1bbdfae960f995f543 + last_write_checksum: sha1:038440310cbcfded13b09fb2d20e7a0b1adec239 + pristine_git_object: 9d66fbbdab60696eac41ee070dceebfa04fc6d18 + docs/models/components/usagecostdetails.md: + id: f9182a2f508b + last_write_checksum: sha1:807dabc8192d2488d92f1863684341aa83027e9f + pristine_git_object: 467b7a4ba64f0d0df69669572f274238981312c4 + docs/models/components/userlocation.md: + id: 72dc00ed7919 + last_write_checksum: sha1:8132710f7b4df0e343418299f77aff6aa9875986 + pristine_git_object: 6dc967cd37a7abb03ebcffa82b4183bd6e08d536 docs/models/components/variables.md: id: 37b35554963d last_write_checksum: sha1:a0f88d3fce7258b19b64f0e9e81cb01b990f9e6d @@ -2674,16 +4595,12 @@ trackedFiles: pristine_git_object: 04ba5e4bbad1c644ffbca571d8403d7402759d52 docs/models/components/videogenerationrequest.md: id: 5522e99e875e - last_write_checksum: sha1:1ef9fe9fe7e1919dde6abab6478c0d471b8736e5 - pristine_git_object: 5eb30ea02da633c340c624102a21d5da83cbeb77 - docs/models/components/videogenerationrequestoptions.md: - id: dac33c2710a2 - last_write_checksum: sha1:6ee757f074349e19650f843f8ba2f39c58c59b86 - pristine_git_object: 0603e7403d3aa8df90a97e2101083476680fac06 + last_write_checksum: sha1:5f939c97efba30490ba066d02eb893a5d40c2226 + pristine_git_object: 42fffa6be2fa4300c7555eaa59495d4a4e7c27a0 docs/models/components/videogenerationrequestprovider.md: id: bb4a860baf13 - last_write_checksum: sha1:bb947bd166b58d6be3b511d3d5fb67e00b9dd0e6 - pristine_git_object: d5b125be55afe24bd81ba535d8ed63a4634c0343 + last_write_checksum: sha1:5fd35182a7ebcea734f365934a51d24b1c04dcec + pristine_git_object: 49a8222abc5e373f752718dfbf037a50479a54a7 docs/models/components/videogenerationresponse.md: id: f0752d2b17db last_write_checksum: sha1:ea3ac8c1fa9d7bdc8ea62071a3737bcfe443e805 @@ -2704,6 +4621,34 @@ trackedFiles: id: 796658ab41da last_write_checksum: sha1:1b932d5299b136393cb47796359f0958e960a791 pristine_git_object: d06e2da18ee25d5238da84c7d54a517b58b084b9 + docs/models/components/videourl.md: + id: 873e264e86cb + last_write_checksum: sha1:f02edbb956620ddf9168d237f4c6ee6e0118f4fe + pristine_git_object: 860df93d62e65e8d07f7028d270e9295bf3fd589 + docs/models/components/webfetchengineenum.md: + id: 6fcb211b9a28 + last_write_checksum: sha1:9940a500e94b0196912ae93d7a8a68751a05836f + pristine_git_object: b7d5a91547403299015561102f3d53fc92b79ac0 + docs/models/components/webfetchplugin.md: + id: c721ba1f5d7b + last_write_checksum: sha1:5f753fdc6e13e62123042cb04f392df47da72d7f + pristine_git_object: 87adf48e135ebf61d2ab7c7ed94ea3504819cbb2 + docs/models/components/webfetchpluginid.md: + id: f902bd7b0381 + last_write_checksum: sha1:6816f987a820fb51392ffa647a65778e3434fe52 + pristine_git_object: 279056e5ed2605f6b05b6807b8de10daae469d2e + docs/models/components/webfetchservertool.md: + id: 30e1575be586 + last_write_checksum: sha1:f36566ad9639312b3e6642d77ecf54c5d82de7be + pristine_git_object: b846c09a8c3b79525b4b917eb36069533e2044a5 + docs/models/components/webfetchservertoolconfig.md: + id: 0b421e3b9236 + last_write_checksum: sha1:ff26ac0733aec4cc0b2371e2f1415e252baa9b40 + pristine_git_object: b4febd02de6d1ccd49555b4409ae09ffff82bb0b + docs/models/components/webfetchservertooltype.md: + id: c8338a8b1b2c + last_write_checksum: sha1:3f54a4d8bdb1f448e78d3e7797cc7a7c99d52dbb + pristine_git_object: e5689fe09508643ba4bc8a79b283b7fd02f69e75 docs/models/components/websearchcallcompletedevent.md: id: 895021c35379 last_write_checksum: sha1:c785ef5224926ef8e336890c2d8fa3b8bc3e8710 @@ -2730,36 +4675,44 @@ trackedFiles: pristine_git_object: d962e4f40190418738b0058910b123717dcbb506 docs/models/components/websearchconfig.md: id: c51df06abb46 - last_write_checksum: sha1:6251bf564f91d967160e8371be15f680f989bc5a - pristine_git_object: a981df87c5ab84ec03f9c9cb4f89bb0c4b51a011 + last_write_checksum: sha1:0c58175f7a841ede38451194e1feb548df1aaca8 + pristine_git_object: 61fea616ffe8421fa769b981875204425a87665d docs/models/components/websearchdomainfilter.md: id: a5f82df8f4cb last_write_checksum: sha1:0ebbfe95b7e3d06a3c0fecd3ea872c674f26bc89 pristine_git_object: ccdc31d8315cc653265a019fb2a361aeb192ccd9 docs/models/components/websearchengine.md: id: a18b4f4b1125 - last_write_checksum: sha1:8065933430b80a69ca97a6b36cca3bc716af055c - pristine_git_object: 5a417e4b66729c4aaa2df98939ac0171c7347048 + last_write_checksum: sha1:8cd9f825caffca91f6b330005bab71174e016234 + pristine_git_object: bb96a4bc7eec39c0f514a747e0e0efda6c1e822d docs/models/components/websearchengineenum.md: id: 89049b3a9333 - last_write_checksum: sha1:d50aa9f84d5c52008a85346736455fc893370504 - pristine_git_object: 7304d6898bca2a626842bf2b0f219d11b187b455 + last_write_checksum: sha1:ab6617e77c37f175d3f97099d1a5e7fc1317d79f + pristine_git_object: e3979eab951c104a39b1edea6f6aa5034bf3569a docs/models/components/websearchplugin.md: id: 79fe580fb4bd - last_write_checksum: sha1:49a392237bf3e62c81488eb75c4844ea6adf637f - pristine_git_object: ddf8ec7b9a5bab0d8543c3169830f415f5c786fc + last_write_checksum: sha1:90bb23f53a183c907ee75c225ce37fb9754cbcc6 + pristine_git_object: 6e50e3b8fe4eae9c9887c20df476d2079bedbd2b docs/models/components/websearchpluginid.md: id: e60aabcc0ab7 last_write_checksum: sha1:438363cbf419e53546cbf65a96b8a7991de9e166 pristine_git_object: 03f4b97b53a5f3312cbf3ec79914075c27adb813 + docs/models/components/websearchplugintype.md: + id: a3d8c56edd4e + last_write_checksum: sha1:0031778ae19951c93bf62379184d9176d84dfdd5 + pristine_git_object: 0b97848fffd0612cc503c5e60ec53f2a11c58bd3 docs/models/components/websearchservertool.md: id: 5ab4438a4fdc - last_write_checksum: sha1:41d7be6390f7d5bc739741336a40a2b14a610643 - pristine_git_object: b4accd16491f9a72504ec03324a9a27332fc99c0 + last_write_checksum: sha1:0dbdf886860ef2e8db45c26d615419641e7c5b64 + pristine_git_object: 8d7df2c06b389fcd9c78288c4d5fa84d3a2d7a33 + docs/models/components/websearchservertoolconfig.md: + id: 5dc4dcc787a6 + last_write_checksum: sha1:ffd22c89464c435b59bb6c20ef0033e185ac1591 + pristine_git_object: 5c15835ad7f70c9cf3120945b3044e65eb1a95ee docs/models/components/websearchservertoolopenrouter.md: id: 47dfc491b6b6 - last_write_checksum: sha1:d267095b973cd5b4678c0f516bd188251ce39c00 - pristine_git_object: 0848bf47de48c9770ba6c665115fe02763a669cf + last_write_checksum: sha1:38d2be9a08e6db7208004b81359897712b17a8e2 + pristine_git_object: 2d1ef0cffedba0734df7df944491ce0419a3b150 docs/models/components/websearchservertoolopenroutertype.md: id: 658ccc86e15a last_write_checksum: sha1:f7a9b213fb53b44e7b4525967868bc983acb21ea @@ -2786,8 +4739,8 @@ trackedFiles: pristine_git_object: bcb390d8b401dd3240cbb419ecaa96baa4cbf937 docs/models/components/websearchuserlocationservertool.md: id: 01a78f45c6d7 - last_write_checksum: sha1:c050b607644ad603e92f6002b10bf651f5f26b31 - pristine_git_object: 7b6bff2d8177a745b4ba503987c4b033327be292 + last_write_checksum: sha1:cac02d71efd2ef949cde9cd087780c882c187194 + pristine_git_object: ddb0cbfeab51ca9a9e150a94d1b8a162be3e0eca docs/models/components/websearchuserlocationservertooltype.md: id: 76cef7144938 last_write_checksum: sha1:6845d9280f1b10bf063ebcb2aeb98ae702afb99e @@ -2798,8 +4751,8 @@ trackedFiles: pristine_git_object: 91639db9047dd143c71d657f7dab81a12b456c1c docs/models/components/workspace.md: id: 94cbd88122e7 - last_write_checksum: sha1:40dae57b977494e5486a9a4b224c7218ef0f0135 - pristine_git_object: d61220609d9bc8cd735b3346a35185a50e2a0f40 + last_write_checksum: sha1:6f6e6de4a055b95f057ceff8d7b8808a054cbfe8 + pristine_git_object: d478812b337159f881bb6c95bd43ed9987ef9a4e docs/models/components/workspacemember.md: id: e028587a2b15 last_write_checksum: sha1:0fcb42cdbdf101848f60b0791d14b2df0635bb70 @@ -2808,6 +4761,10 @@ trackedFiles: id: 8551acddd9ff last_write_checksum: sha1:21570a686d0296f0e84bfdf2cc35c27c0a6092d8 pristine_git_object: 92fc9b715b70cf57ec33776b976bb436dca653ab + docs/models/operations/arena.md: + id: 18236c4c4904 + last_write_checksum: sha1:dd3671f40051ffa438c9e525498e955d597fa136 + pristine_git_object: dbf198a11759c8a7fbb5040c3e1b1f65d3ea93ed docs/models/operations/bulkaddworkspacemembersrequest.md: id: bb82d64c2ba6 last_write_checksum: sha1:dfb166457bbaa86d04d88731e4fc64521b961bb3 @@ -2832,14 +4789,10 @@ trackedFiles: id: 18d0efe64297 last_write_checksum: sha1:f8d5bc3c91f8ac4165290e9ee77ca791e6201f0c pristine_git_object: ac02c9ff8e65f4029effbdb96a9b85419b668447 - docs/models/operations/category.md: - id: 38b5d89ba971 - last_write_checksum: sha1:df21e1e61eef60b1a8763dfafeb91bdcf6b3688f - pristine_git_object: ed303e08cd01e867cc61d2b0095e32d964e143f9 docs/models/operations/content.md: id: d236fe045b84 - last_write_checksum: sha1:c61452703d8ff80efcf721695951411af8e82786 - pristine_git_object: 5c8d1e8e341f93b045901e0eaa37b72764edb922 + last_write_checksum: sha1:602102c7eeed16ddba206d2b0c31fe5fd1d83d0b + pristine_git_object: efcacc5844bd3132d18596dea6198083ba60cb21 docs/models/operations/contentimageurl.md: id: 50586e6fa167 last_write_checksum: sha1:33fdeae6c7d6b5be489dfe0d80897d84407989b8 @@ -2858,8 +4811,8 @@ trackedFiles: pristine_git_object: 5f9d9ce51628a0c1a6a23070d00c90ea8523c36c docs/models/operations/createauthkeyscoderequest.md: id: 3501ca5b0d29 - last_write_checksum: sha1:a35991c2c19086be412e00fa50dc1ea146733ae4 - pristine_git_object: 75a6a036b9a165a1a76ae06c9f827cb0556b4918 + last_write_checksum: sha1:353e8bf362de47e35f7644cae7f651e229621de2 + pristine_git_object: b199fc6b55594154f0ab8a8c6ae20e0d70580dfa docs/models/operations/createauthkeyscoderesponse.md: id: 94a1e2c0f03a last_write_checksum: sha1:1f3dc5dbb870b09df2f49831204b0564b83389a2 @@ -2900,10 +4853,22 @@ trackedFiles: id: dacec48ccb70 last_write_checksum: sha1:3c16cde44fbcebf7be2adeb130256b8f23c19285 pristine_git_object: acc01ac7775f0ca7a58999b82722f02bdc355150 + docs/models/operations/createpresetschatcompletionsrequest.md: + id: ae47c597db2a + last_write_checksum: sha1:15c77f28e0c52cc91a555cfb471fceb72bb53e2b + pristine_git_object: 8f36bedc308d27d20360915f80778795d736e76c + docs/models/operations/createpresetsmessagesrequest.md: + id: 39bba3842509 + last_write_checksum: sha1:65dd09187a7c5c37002e2140f14a498eafb0b930 + pristine_git_object: bc20b47754b7107fdfd27744cef40fdc0d11398f + docs/models/operations/createpresetsresponsesrequest.md: + id: 84acddd55e0c + last_write_checksum: sha1:fa06122012298580cecb8309c0b006da72772029 + pristine_git_object: 4dc0d4034498c42a960c2653b25857b9aa5bd694 docs/models/operations/creatererankrequest.md: id: 9aacc054ae93 - last_write_checksum: sha1:ef3a98d4d5ef8d750fa5187bc297bcb4972e371b - pristine_git_object: e81ec4a550cc1447e3c2cc78d7853e5c80286a1c + last_write_checksum: sha1:afc88bb414dee2434432e2d07f0344d34ce112f2 + pristine_git_object: f7ebc86e08e3560fcdf372fe8cc7cc905a8c7875 docs/models/operations/creatererankresponse.md: id: 4ef868bdb264 last_write_checksum: sha1:e89e52e1486aa936f7580a5a8b6e177cda9b8317 @@ -2916,18 +4881,26 @@ trackedFiles: id: 3a5bad0b926e last_write_checksum: sha1:c55af5e3ff2cea0d657ba69f920da2fa90bdf803 pristine_git_object: 980be72000314b22206a8f8406de71447c6a11c4 + docs/models/operations/createresponsesrequest.md: + id: 5370180b8635 + last_write_checksum: sha1:0940b33389766dc0d9c1cca8be4cd91dfeca2a67 + pristine_git_object: 50f05ab8ae178ae9a481bcb5bc7992a26ed9261c docs/models/operations/createresponsesresponse.md: id: c55a819f0ab5 - last_write_checksum: sha1:ba18515207ba20cbea7316fcfe15a6c2a7ad31d6 - pristine_git_object: abb70753b8891b951917e256a24d09b055925b53 - docs/models/operations/createresponsesresponsebody.md: - id: c0639e97c684 - last_write_checksum: sha1:9ca171a4f55391c74b185222c70fe6846c892d72 - pristine_git_object: bcf31ee73578cd7569201955bcdea10de394127e + last_write_checksum: sha1:1874514df46928e883ae4bfd7a1376ab7ed62651 + pristine_git_object: 0a9f53cdde6318e97a2a13911cbc872702dd3db0 docs/models/operations/datacenter.md: id: 7a9819bf0f2b last_write_checksum: sha1:520144ba3d9c29a80e771bb1ab7076a8f257f969 pristine_git_object: 9de7c2f3d60c1944808b88282be662804c0cc429 + docs/models/operations/deletebyokkeyrequest.md: + id: 813dbc40d06b + last_write_checksum: sha1:e30f50a3dd0ff2ee761cc65a1cb9a6ccfa58f460 + pristine_git_object: 8561fa22bb26b568d0fae4b2a81102b1ea200717 + docs/models/operations/deletefilerequest.md: + id: 5b901b4a4a7d + last_write_checksum: sha1:161fce1d42bfa35f27947f9cda623e9a5a89d972 + pristine_git_object: 487dd20270e2cac42a3d2ca4432b7c74ed72c6ab docs/models/operations/deleteguardrailrequest.md: id: 1bd1d6b15de5 last_write_checksum: sha1:9f9a4b2cf6d425f85839876613fba7cdb251df65 @@ -2940,14 +4913,46 @@ trackedFiles: id: b7cb4fb91f4a last_write_checksum: sha1:4d4dcf2108f7c2301534423a7ca4845bfc33d2e4 pristine_git_object: 763adc8867159e833b6bae476b5d8e1318e59eb1 + docs/models/operations/deleteobservabilitydestinationrequest.md: + id: a70703e67396 + last_write_checksum: sha1:8804103c6442495898f2e7046598a974d4cef4c7 + pristine_git_object: 83ec94352d5eee2e693617821d45143f3624362c docs/models/operations/deleteworkspacerequest.md: id: c3a6fd8ac219 last_write_checksum: sha1:1a8b25503c486b0794326c0796504663906bb02f pristine_git_object: 7e0cbebfa34dfce2925af8e5311f470bf90541d0 + docs/models/operations/dimension.md: + id: 2298189a2a16 + last_write_checksum: sha1:2f007437a0489c4a834447fff1f77a1fa378871b + pristine_git_object: bcd1f4c7b968343ac2e7cc9fe22afafdb964421e + docs/models/operations/direction.md: + id: 9a36eca7275b + last_write_checksum: sha1:547f41a8b1da47d360b5219dafc23c2c17a62934 + pristine_git_object: 5256f72ea6ae19681add4d0f7db35fe809ecbf17 + docs/models/operations/displayformat.md: + id: 93647ce5b476 + last_write_checksum: sha1:2ec343770ed6a228d8abe9c4929fa84965eba97e + pristine_git_object: 7cebb69db0cf74f9bea54ad59967e5626a5f5828 + docs/models/operations/distillable.md: + id: 27b2e2e603ee + last_write_checksum: sha1:5e188ffcf1c3cbd96783a19a3fef711bbdca90af + pristine_git_object: 458de901fd437aa183e500058ddce0477a25e3d9 docs/models/operations/document.md: id: 20633c7fa04e - last_write_checksum: sha1:a7677aa309492ebccebca0f43b118c43c58140fa - pristine_git_object: 835610de07b1b74d37e2a168cab90c30cfa48f34 + last_write_checksum: sha1:deaf9267f3549dd03d47d8c29229d3538ce7d40f + pristine_git_object: af7226de366c2b08820243faf69c0dbd44b5a193 + docs/models/operations/documentrequest.md: + id: fd80497802ac + last_write_checksum: sha1:80c1fb95818a295b6aed0b7fb07ecc170b600871 + pristine_git_object: ee41677a88663a0e1a47b75a5575be014bbc4904 + docs/models/operations/documentresponse.md: + id: 089ffbaea2a2 + last_write_checksum: sha1:7d8f022486aaefa643b112d18c0b5a1697d94893 + pristine_git_object: 5374ba539d88718fce2697444bd24751929ddb9b + docs/models/operations/downloadfilecontentrequest.md: + id: ed0173771724 + last_write_checksum: sha1:905cbbf3b491bd753d82e58eeb5fe51968a9133e + pristine_git_object: 3a696c0600a544ea24db86710ed56813ed275921 docs/models/operations/embedding.md: id: 78fbe8e6e84d last_write_checksum: sha1:1482cb8e3d6788b7aa491719ccc36db376e22c54 @@ -2968,6 +4973,50 @@ trackedFiles: id: 1896f7f46185 last_write_checksum: sha1:153f242cdce9dcac0131ebe096951588819081aa pristine_git_object: d5cdffcd26af9a5b38c129ae8cbe45e7a18f05f8 + docs/models/operations/file.md: + id: d791b792f60f + last_write_checksum: sha1:514335a2e50175dff692641331f166ef1775d7b8 + pristine_git_object: cde537f245c884f4055a65b38e4bfe61478d1706 + docs/models/operations/filter.md: + id: af1deb54d54b + last_write_checksum: sha1:bf04ddb203486b6f3faa0b370dc27d7446d4086a + pristine_git_object: 271d3b5323a00144a89dc25a919c7f0a97921fac + docs/models/operations/getanalyticsmetadata.md: + id: 1b2cf59402e0 + last_write_checksum: sha1:79ffd6769c74daa69056d51964502993ab4bde6a + pristine_git_object: 0256765d67056b45f372b5a0a04cb0d601797c60 + docs/models/operations/getanalyticsmetaresponse.md: + id: 07c515f21574 + last_write_checksum: sha1:9de8aba8d322542d637a0681e9833fe86c803deb + pristine_git_object: d1ad1abe20e86f75a27e0d02f609b77d60fdd6e6 + docs/models/operations/getapprankingscategory.md: + id: e65ac00171d5 + last_write_checksum: sha1:96c1c02af55d1357f9bbc9d4edf11a8c53072bb9 + pristine_git_object: e839e72fba555bfe69c84e52722b1c67bdd3274a + docs/models/operations/getapprankingsrequest.md: + id: 57860f352b20 + last_write_checksum: sha1:8ade12f966fddbfc6f2cfbf253f4fe306a616421 + pristine_git_object: 90758f36b92d3c965ba001e9fb1942bc879b6333 + docs/models/operations/getapprankingsresponse.md: + id: debbd9182038 + last_write_checksum: sha1:e4a055347883590be3585af79f25dda166127d03 + pristine_git_object: bf0c385fc138e82b66a684e1ca7ee7689ccebbad + docs/models/operations/getapprankingssort.md: + id: a3c13382631d + last_write_checksum: sha1:67f5a2436c2c3ca7d4c2cc923687f956d17c2c00 + pristine_git_object: ab76ec61f3f8a714142efd8ea3f02cbfd0182533 + docs/models/operations/getbenchmarksartificialanalysisrequest.md: + id: b8fef1161cb2 + last_write_checksum: sha1:fe89c18cd73d66f08fcd307de22d35238d756cda + pristine_git_object: c539db4be9ad097bf20ef8080b8db7f05f4f649d + docs/models/operations/getbenchmarksdesignarenarequest.md: + id: 752ce897b5f4 + last_write_checksum: sha1:a2123574a3b7ebf2abc03ddb5bc80cee63b6920e + pristine_git_object: 4499b65db08cad021ec209e1af1e443576919a7a + docs/models/operations/getbyokkeyrequest.md: + id: 893f571066a3 + last_write_checksum: sha1:ac0818f7aada9cef85ccc4309d1b9004ee91a553 + pristine_git_object: 1af3cbf35abecf033d6ea71febcb66e011c4a44a docs/models/operations/getcreditsdata.md: id: 2e909479cadd last_write_checksum: sha1:4cf9dac60f3580e2ff158ad3d06ca6599b6d8ad1 @@ -2984,6 +5033,10 @@ trackedFiles: id: 9477562332d8 last_write_checksum: sha1:ccb544c82bd4a3f48234e1b381982d3afb136028 pristine_git_object: 5000f777f8d3d3ccb7d501a6016fa0da27eba83e + docs/models/operations/getfilemetadatarequest.md: + id: fb0b2021cbd6 + last_write_checksum: sha1:702696cf03be0a87fda8075fb49e56b1070fb8b5 + pristine_git_object: bb9bd54a7229167f66489dd51d29b8f9005fedf3 docs/models/operations/getgenerationrequest.md: id: fe98f4f7a718 last_write_checksum: sha1:c1428240ed798afd25a046c1503676d46ba82671 @@ -3004,10 +5057,38 @@ trackedFiles: id: f5617e59330f last_write_checksum: sha1:96c68b52c99776a337509271f21f2c89c5845dae pristine_git_object: f664fe4278f87a201268d9b32891b7c51e7f5697 + docs/models/operations/getmodelrequest.md: + id: 9891a8e2039c + last_write_checksum: sha1:f8887a4976f59a5d98de545c1798ff27fe5f3e83 + pristine_git_object: 3d762a2758c94750a58a3e33274b2fad1024ce9c + docs/models/operations/getmodelscategory.md: + id: 3956d91c1d30 + last_write_checksum: sha1:6a2fc022b6fc38f7b371cb28b1e0c6f0acc83281 + pristine_git_object: 355ad994945da9cd9944049957198dfaf2c25800 docs/models/operations/getmodelsrequest.md: id: 801c51f5ac65 - last_write_checksum: sha1:623bb8b6f1f37ec473fe2d1c4e721163f2f252ee - pristine_git_object: 5cf808a2edfc91cbfecc0a73680fbc7f1aace0b9 + last_write_checksum: sha1:1387b466b8e1a0ddd4a006adea1a9b8be9feee1b + pristine_git_object: 3dcd88a3f77a7db25b5a6dd139a8371fc0a3ff29 + docs/models/operations/getmodelssort.md: + id: 3f59089363cd + last_write_checksum: sha1:598e374d32ba990bd4c97b8553862cb6e0ba9529 + pristine_git_object: 9c4e8dc95b9b4439baaeb8092b78bc186d47041c + docs/models/operations/getobservabilitydestinationrequest.md: + id: 0bc592c99466 + last_write_checksum: sha1:a16be6ad76d04cd75243616a66392243bf516685 + pristine_git_object: 7b435f1f4974e1b74aafb08e7430044eaa791b0b + docs/models/operations/getpresetrequest.md: + id: cffa12e25fb3 + last_write_checksum: sha1:02e97896b326cf5045844433aa8fca33a64aee7f + pristine_git_object: 42cf01fe4f0e4f190ceb49db78003678b65f51d5 + docs/models/operations/getpresetversionrequest.md: + id: c7570c95c5b8 + last_write_checksum: sha1:122f77cfbdf891da6fdc2f22ddfc0a3d272faa95 + pristine_git_object: c5172c6d6e16b90b753cb5584e2ef1abe43f2597 + docs/models/operations/getrankingsdailyrequest.md: + id: 9cca6989590a + last_write_checksum: sha1:edd4e582a9484ba91e8cdce06bd14d4a4d4295d9 + pristine_git_object: 1c4ba3446f26aedbaf39f1f6f1f803fc1cc68f0f docs/models/operations/getuseractivityrequest.md: id: 094eba1cffb3 last_write_checksum: sha1:70caba64565a8cc2251e8f0a0eaad87ed1c4a8ad @@ -3020,6 +5101,14 @@ trackedFiles: id: 2d440111adab last_write_checksum: sha1:d39d0953397dec988dc2ab6029b86754fb1510d8 pristine_git_object: 3e4c614bb3cc7feb48c0eb156a583c72144cbac5 + docs/models/operations/granularity.md: + id: 22f3b5e85091 + last_write_checksum: sha1:b3559dc343314eedb507543e7efc02fefe8855a8 + pristine_git_object: 0ad18e8381831778ba47e472be3db495c4009041 + docs/models/operations/granularityname.md: + id: 9d91524b2b83 + last_write_checksum: sha1:237d1f22efb8384fd8c2e0ad07e89e09aeb2d8d7 + pristine_git_object: fb236a6649072aa249033e003a30afeaf0eeb70b docs/models/operations/headquarters.md: id: 6d8d0f5b8582 last_write_checksum: sha1:841aa4b0e5cf27fcea2c5bb72176e27215433be5 @@ -3036,6 +5125,14 @@ trackedFiles: id: eed9590d62a8 last_write_checksum: sha1:e85b49b3ed9cb1c771bad885a38cf8c360859b1e pristine_git_object: 71c9a1c4485192bd3ec0ce1c4184c3d42721a65f + docs/models/operations/listbyokkeysrequest.md: + id: 02afaa8f184d + last_write_checksum: sha1:05dbad8a9e5e470325bbbe83f2cee4c2416a162b + pristine_git_object: 68a7ae5c090a845c3b3768b18549ae3be9a83ea0 + docs/models/operations/listbyokkeysresponse.md: + id: e5af9eeb3679 + last_write_checksum: sha1:f2ccfcb0428a01614243e69e421f33ef896ce164 + pristine_git_object: 2d9ee5de89729d77b221c7dcd6f8c5b98d7f6fef docs/models/operations/listdata.md: id: d80bed3b167e last_write_checksum: sha1:2125f92b3d45e9b6a3ef8dc5b0f7f744ba3ea2ae @@ -3052,6 +5149,14 @@ trackedFiles: id: 5c9c93477484 last_write_checksum: sha1:55b07bbc89f750545a89e9adb002342e9358dede pristine_git_object: 89e7b6556716b34d11770ca694c6fa6f2374d3fc + docs/models/operations/listfilesrequest.md: + id: d8bd2ae499d3 + last_write_checksum: sha1:2f7ec8e628e333ef1c147f4b78f40e5d7031ddd8 + pristine_git_object: a10f432e84007fefabdeceed4b9ce0db72234d54 + docs/models/operations/listfilesresponse.md: + id: 391e4b2a0ab6 + last_write_checksum: sha1:a7361ac1962710fa5a63d0a4d64067d8688f393e + pristine_git_object: ce89761c70b687ecb6ffcf26a20cbe9237e1a7d2 docs/models/operations/listgenerationcontentrequest.md: id: 863f1fa7b9ad last_write_checksum: sha1:30f06e2dbf345deedfcfd1a57d77501630a32393 @@ -3078,8 +5183,8 @@ trackedFiles: pristine_git_object: 72955faaefbb891c2138c414bc952468eb0ca549 docs/models/operations/listguardrailsresponse.md: id: 3d55593e8311 - last_write_checksum: sha1:a05b1dded3a245d92c33b9b251414f72b5ef3b51 - pristine_git_object: cb6dd7f268e7a5dc44dca30f0dee28850bac6bbb + last_write_checksum: sha1:e0751ed4d82f5bb2ba505501f9f387f681803b58 + pristine_git_object: 9b52aa70c7255e0afe849c09225362794a719c15 docs/models/operations/listkeyassignmentsrequest.md: id: cf678e788175 last_write_checksum: sha1:03e51ce6d7bcacb79d4d940f1e80499815689180 @@ -3104,6 +5209,14 @@ trackedFiles: id: 07a43f294881 last_write_checksum: sha1:8ca78c28f5366c3e5e849fbefaf7b20b23f974fb pristine_git_object: e602add329de2fe902290d999d3b467914d78876 + docs/models/operations/listobservabilitydestinationsrequest.md: + id: 0cd681fd013e + last_write_checksum: sha1:b5ab2c34cdb3ad7b2e4df6f7f71a8c619a401cb6 + pristine_git_object: 9ea5a8be0346605fa1f6270e978bf025f26f3863 + docs/models/operations/listobservabilitydestinationsresponse.md: + id: 143a19e4c7bd + last_write_checksum: sha1:1ae9f8246cf21b9404bed81bfc1642e65c6e621a + pristine_git_object: 892bd15b326015b9ef5df2f3e67701ec818d9b7f docs/models/operations/listorganizationmembersdata.md: id: 8e9af7c7ecf0 last_write_checksum: sha1:777b153834e39ecfafeb68e8ea8b5963008bb79e @@ -3120,6 +5233,22 @@ trackedFiles: id: ae9cc6ec886a last_write_checksum: sha1:bbd21575b1cf5f21a9d5675303b921dc3b9b53a9 pristine_git_object: 2ddf2ae55332fea7ac1ea31a5831ad48d0757b6b + docs/models/operations/listpresetsrequest.md: + id: 085005aa0ae0 + last_write_checksum: sha1:05e6f6c2d53b74f2beb6b687f68af3c0f66bf4e2 + pristine_git_object: 4000ca3a1a570e9f95f44eb9350f08317494b66a + docs/models/operations/listpresetsresponse.md: + id: e560356cc4c0 + last_write_checksum: sha1:b21e18e57890aed55ad6a7999109bf78a5e474c7 + pristine_git_object: bc60bff4203be6604d1ce5fd55e5ec85b7a848b0 + docs/models/operations/listpresetversionsrequest.md: + id: bf4e035b07b9 + last_write_checksum: sha1:04e0c01e0c30e6ef4b628e1fc7aae54a89d58d2c + pristine_git_object: aa97f56641a1acaccb32b540432ab3c9e7903ccc + docs/models/operations/listpresetversionsresponse.md: + id: 23490058dd4c + last_write_checksum: sha1:ea5770d891783522a4b39193e0431f46c6644fa3 + pristine_git_object: 6cfe4deab5bc6deef579108b8b4dcf1ab81c1c9f docs/models/operations/listprovidersdata.md: id: 97edf5a3cd2e last_write_checksum: sha1:a09364858ddf51258ba8900531c4f7e81dc2d08b @@ -3146,8 +5275,16 @@ trackedFiles: pristine_git_object: ef5862b2b63488cd34b6ea450e0c88cf18ba7b92 docs/models/operations/listworkspacesresponse.md: id: 056a8d647475 - last_write_checksum: sha1:c5005629c32483ab1885083202bb094564c5930c - pristine_git_object: d0729cee4318fb6116dc80a81728b602b4653817 + last_write_checksum: sha1:c81063b4f54a1c656cfc17f29ea58f18bf340ff7 + pristine_git_object: c90db8b415182661d2dce858fb95c554dde41d73 + docs/models/operations/metadata.md: + id: 4c22404ca93c + last_write_checksum: sha1:5c5daefbd985df71b71dc058490e4e9dd46b0586 + pristine_git_object: de56094c2644601369e24cf30941c8fa3d365ce1 + docs/models/operations/metric.md: + id: 378ed3423ea1 + last_write_checksum: sha1:fd7f9618c88a54f13727a1f08b20c681231671e9 + pristine_git_object: 92dbb3fa7878c43dc5151f43278f99d3a2e621b4 docs/models/operations/object.md: id: 1ca5f9e973b6 last_write_checksum: sha1:a4be95057e0edc6ce2a7ab3314373110d82d703b @@ -3156,34 +5293,78 @@ trackedFiles: id: a02a569169a0 last_write_checksum: sha1:771d26bdeef985effd22cd2dced2d311da9c13d1 pristine_git_object: 6685f7d982e8b11ffea8fdeac0af4b63f56a7dfa + docs/models/operations/operator.md: + id: 76c4a368a54e + last_write_checksum: sha1:90eb498f6a75c6e04a27b4362c79e257dbf6765f + pristine_git_object: 6c5ff9089559414c5280bda4214752e4aee39233 + docs/models/operations/operatorname.md: + id: 793e3efb0d4d + last_write_checksum: sha1:689ce6f721ee4609b74055d733136250e46281b8 + pristine_git_object: d8083538e5b3d128f9068426d668f2bea98c892a docs/models/operations/option.md: id: 2ac1bd52a5fb last_write_checksum: sha1:b8d5d5bb03c99a0bbb94d4f5b4000588eb08845f pristine_git_object: 5af5f236276c5bd08eb7725e47f044db2ecc0228 + docs/models/operations/orderby.md: + id: 45cf0fb75be6 + last_write_checksum: sha1:bdc762140481a1af53b269358430f356fe23854c + pristine_git_object: a8a0d05f09c0d65cf381d856d89a1cb22a90fd4f docs/models/operations/prompttokensdetails.md: id: ed0db1d0b1b5 - last_write_checksum: sha1:663788ef1c0a7fd3d069da55fd30f14478df3132 - pristine_git_object: 5cfad8f89dd5f01b095ff19fa24f726624f5023a + last_write_checksum: sha1:9987b12f759f4c13f5fd6e47b6fa19a04a7ef803 + pristine_git_object: d032d3ee22532bb48bca0569e1fcf47e6a569e2d + docs/models/operations/provider.md: + id: c28b3c085f4e + last_write_checksum: sha1:1a6c861e8dc018a308bc4e095d4b0f61a95e322d + pristine_git_object: c4fb2f323b7fb15f5f65bf9afb76ec83ebe80cd2 + docs/models/operations/queryanalyticsdata1.md: + id: ecb6e11852f5 + last_write_checksum: sha1:a55813c57010d0613c1e70ee1a9232fdcf98775c + pristine_git_object: 055291f2e192b8c846b85f04ac19212389d227f0 + docs/models/operations/queryanalyticsdata2.md: + id: a5a7212a7eee + last_write_checksum: sha1:e96a8387b2692f9fc48c8b3695e18f01d232ceeb + pristine_git_object: 8b00559b444c7e5c161b8ce52a68c3058dd7abbc + docs/models/operations/queryanalyticsrequest.md: + id: bb134da4457f + last_write_checksum: sha1:950bf8d214ca2e5432a19ccc7c62482dce77c238 + pristine_git_object: 021e26bcc7dc91d491ee7b0debe768a2a46da3d1 + docs/models/operations/queryanalyticsresponse.md: + id: 4706b1ab5bf4 + last_write_checksum: sha1:389b2ad323d20cdd47dea41c83afb539c5a1d72b + pristine_git_object: 3b6b47fce2fbce9857cd4d218a5edd871b1969b0 docs/models/operations/ratelimit.md: id: 94a6ae30f279 last_write_checksum: sha1:7085a60d83b27cbdfd973b0decbdffb2bf4427d6 pristine_git_object: 2bbc18561d5426303a92b2b5901ebc3a6ec1074e + docs/models/operations/region.md: + id: 733ab7b0c94c + last_write_checksum: sha1:9ca5cb57688f2dbf0663b06a01492cde71162d7a + pristine_git_object: b685f321bdf9fe29a0d7be882b5af9cb09840347 docs/models/operations/result.md: id: 6953cabb9266 - last_write_checksum: sha1:7f627c458fc5b7b73cb82831b8342750b48cb1cf - pristine_git_object: 45f71a86cc61e7376874bcb90ed2ab44255f4fdc + last_write_checksum: sha1:475dd539381caf22e6294027c9646ed6967771bc + pristine_git_object: b5f74db03448e495925fff87969e9ea1bd196b0d docs/models/operations/role.md: id: da2c36811787 last_write_checksum: sha1:c61d5fc836710afb189bb5e0598b6de1881d4170 pristine_git_object: 4e97fdef41e27792d658a481ca890dd705173a8d + docs/models/operations/sendchatcompletionrequestrequest.md: + id: 20682772581d + last_write_checksum: sha1:2f50a620d03c704293b6ad0fc67712681c6fb129 + pristine_git_object: 613d868e4a133a0c8edb42b8dab949bc53dab1ec docs/models/operations/sendchatcompletionrequestresponse.md: id: 3ca0009c143d - last_write_checksum: sha1:b153dd6a1379f019fb28fdba73916fe6fa1e576f - pristine_git_object: 1ea9ffd3160abbb7aaf7836d91f689c7f4e6801d - docs/models/operations/sendchatcompletionrequestresponsebody.md: - id: fb7605216c3b - last_write_checksum: sha1:9ce3cd310540efbf466108876d62795dae3389c4 - pristine_git_object: c33332682645b2c4fa9e2bb808e622cab119f20c + last_write_checksum: sha1:2b83523f997c5e1fba47d4fe4a923d9b66f01c9d + pristine_git_object: 7846dda337fb0a5308972b8df99d5c9df6618210 + docs/models/operations/subcategory.md: + id: 8bb0b30b82e2 + last_write_checksum: sha1:81fd25cebef75d4992a0baeb28c280186ea80883 + pristine_git_object: ca0251d7db30e462cd6160bb009a0f21f61e4242 + docs/models/operations/timerange.md: + id: 1f5778dd63dd + last_write_checksum: sha1:7c26a813c27e613eddd931f11d9d0cb1ec15d900 + pristine_git_object: 9185beefaaf20d357b779bd5285d20504dc6ef79 docs/models/operations/typeimageurl.md: id: d034f1c6a56f last_write_checksum: sha1:a15829969d5fd8b3293cd9de3e39c6549207e1da @@ -3192,6 +5373,10 @@ trackedFiles: id: 8277917b8438 last_write_checksum: sha1:6a4aff9c7234510845dcec68af7558c637fb9e89 pristine_git_object: 4cf2bb8590882806af920ef6db86b8033b090df0 + docs/models/operations/updatebyokkeyrequest.md: + id: ccaaf7e16888 + last_write_checksum: sha1:a710165ef91781acc163b2c30ed41c18727f8fd8 + pristine_git_object: 22a5584e44631e71baeca3e19d9b738404a7c1b3 docs/models/operations/updateguardrailrequest.md: id: 4750db2d4690 last_write_checksum: sha1:5405c447055cca8cd17bc978b70f3c7b8de547c1 @@ -3216,74 +5401,102 @@ trackedFiles: id: fb4d74ed0adc last_write_checksum: sha1:76e5b9a746afba579c3ee58a4295a62d445287ce pristine_git_object: 9a7303cd04c265ecca91ecd7c2aa2a58fae4105a + docs/models/operations/updateobservabilitydestinationrequest.md: + id: 31b35ffab9f8 + last_write_checksum: sha1:88670f8de38b50163e7ece730e05970dcce0c07b + pristine_git_object: 7ebb41c057f20f19ccc37ad98f52c6b1469084a4 docs/models/operations/updateworkspacerequest.md: id: 7dcbe9bee5b3 last_write_checksum: sha1:4e73c79aa25ce997ef8fce6deaf640d818631236 pristine_git_object: b694d9a162536af8f14d34ccb1cc11e2a3a88b9e + docs/models/operations/uploadfilerequest.md: + id: 47d059eea5f6 + last_write_checksum: sha1:58663db5d59d321bbbc17848371cf3a31b60cf92 + pristine_git_object: 5a893a47730965f9f8dd38e9b076640c3f764742 + docs/models/operations/uploadfilerequestbody.md: + id: c158ebde379b + last_write_checksum: sha1:2c87a31011cf1496533800b33f68865d09508c1f + pristine_git_object: 047e417f4e55553993a9198cf7915cfe2fd50975 docs/models/operations/usagelimittype.md: id: 22ad2742a599 last_write_checksum: sha1:f4aaf105a525df20c1879e3028a9326fcf1dc0a0 pristine_git_object: 106c104c8d0ac29425c8f2de9699a049704b4c5f + docs/models/operations/value1.md: + id: 523d8c155e57 + last_write_checksum: sha1:186537dbd08ffef3b5f5d7d539e0cf0599d55c42 + pristine_git_object: 0dc6a5914c059c7eade71f3c017851f02217dc25 + docs/models/operations/value2.md: + id: ff7c100bc64d + last_write_checksum: sha1:dd219ec77a4a8d4bf4f028fe62fb5aa211e0db2b + pristine_git_object: 459ce85eb2d84ed8a7431f4e6686a00b565cebbb + docs/models/operations/valuetype.md: + id: ad6c1c317816 + last_write_checksum: sha1:de57739a3b3d3198f0f40a4faf2230a25b1037ee + pristine_git_object: b9af9a6d696491f29924b1876d6951a9d17abd94 + docs/models/operations/zdr.md: + id: 6b3f77435a1c + last_write_checksum: sha1:9130af1f02c361724a36d89ea6569dae0ce400cb + pristine_git_object: 06ea53e155fe754baeb032f8edba67e2d89f0b0a docs/models/sdkerrors/badgatewayresponseerror.md: id: f891d532be6a - last_write_checksum: sha1:424d19086c3f3ee8b795af55ebd52462a145faf4 - pristine_git_object: 50473141362a499d1fea848864436a7da29113c8 + last_write_checksum: sha1:753f29aef448fcce7555f869706920c260d64b94 + pristine_git_object: dae1cda511809eb00f87a8249810c82906ca512d docs/models/sdkerrors/badrequestresponseerror.md: id: a646d3d6ffa9 - last_write_checksum: sha1:1357f24bc11fbdabc739f3619465254e928f1a63 - pristine_git_object: 22cc743cf9027ff16faa081967fe98aa14b75b36 + last_write_checksum: sha1:e30c7feac6d3275d3beeb52cff0d3dd6d2eaf856 + pristine_git_object: 01f36be40846072aa668719c7fc313b8d1452ffd docs/models/sdkerrors/conflictresponseerror.md: id: 13ac40b07550 - last_write_checksum: sha1:4908af150c453b402b16a4f45eaf55a6a7c8195c - pristine_git_object: b91f94f5da9babd1692affaa93773afc80f7d659 + last_write_checksum: sha1:88cf7f6fd59cfe3d9a86523ed7408e0f6509701f + pristine_git_object: c14cb120622b8ca29a579ca039348367cfe71b09 docs/models/sdkerrors/edgenetworktimeoutresponseerror.md: id: 54e87167ec22 - last_write_checksum: sha1:f7369e362f041b8ed99f6be6b0d2a5435a6c60ee - pristine_git_object: b46d667742015393f2b40282d5ea475dae9e59ce + last_write_checksum: sha1:690f92fb7396387db21bc88ebc1d939d1fbce64c + pristine_git_object: a65715df7b13db661fb4a49db9e1f74e4d804312 docs/models/sdkerrors/forbiddenresponseerror.md: id: c651771a25f6 - last_write_checksum: sha1:b6cd4814d073a2152fccac92399d1df2655a7fd3 - pristine_git_object: 9b912ad63991ac216738fd61cb4a026490c14c54 + last_write_checksum: sha1:64c12941bec9e5a89c7fa3f161265d48fac28ba2 + pristine_git_object: 128ca10343cc7b5317b93f0e9ba5e124a7923656 docs/models/sdkerrors/internalserverresponseerror.md: id: 17d5b73276cc - last_write_checksum: sha1:e2d92c1df291df1dd36d8c652997f28fbcd31fb9 - pristine_git_object: 24890222c1bd36898830ec9901e042c646a4a40d + last_write_checksum: sha1:1e7b2a2361f34f60f50f252b7b5bc09135585057 + pristine_git_object: e11af301404ce8311910f68aa9d99e0a8fa7be9d docs/models/sdkerrors/notfoundresponseerror.md: id: 63bf79d3bfc6 - last_write_checksum: sha1:ef36bca3e993e6ac04d252e2b489bad313288cba - pristine_git_object: 75d83888a9045de73d6a7fb6e392693127224876 + last_write_checksum: sha1:d3b0a06d98fb68587e9fcae72dd11086a7a738a0 + pristine_git_object: 92bfd23944f7b178bd30d92c2888772c2a6acbc1 docs/models/sdkerrors/payloadtoolargeresponseerror.md: id: 9147585a6f96 - last_write_checksum: sha1:73f3647b73e419ea17caa5782ffbd4e89261bfc5 - pristine_git_object: c94959b6164a0edd4a4afe1a4bde14d5aec01210 + last_write_checksum: sha1:1fd14a157dcfa9efc38eeb7c122328f67dfb6f3f + pristine_git_object: b386559ba841f82f99bd1363b963f15575daba47 docs/models/sdkerrors/paymentrequiredresponseerror.md: id: 7a2ccdf1242e - last_write_checksum: sha1:cf1a1428765c8cf55a5bbf28c937d6b5c0019a09 - pristine_git_object: 1b161ef8168f91f79db4bf487d58f2be876f0755 + last_write_checksum: sha1:34005070a7706e23364accaffa01b01e7828a055 + pristine_git_object: 22241972478242c4af2a03d6e23a1643ae1aad65 docs/models/sdkerrors/provideroverloadedresponseerror.md: id: b182aa7d1aec - last_write_checksum: sha1:5263268eb045744f6526c3978061204c4171a8c9 - pristine_git_object: 7592d31069620d66081da0a89b0c8164d78e3c1b + last_write_checksum: sha1:892173a077bac87b6e4ef2678553b4ee83566916 + pristine_git_object: 2960117deb54a64148b04ea95589c9655c9e15a2 docs/models/sdkerrors/requesttimeoutresponseerror.md: id: 4a92b0cb5d20 - last_write_checksum: sha1:8b250202a3dcac63d3a7c78e3e6e7b6ffd10433b - pristine_git_object: d8fda8c5fcf55932bd0aaf7ddc84d9cf1d89f1a8 + last_write_checksum: sha1:a56fa64931f75669eef608d192d604fe9a1cb4e3 + pristine_git_object: 4c0dbb2ec550443d33d50fc3bcc7ecb307603a7f docs/models/sdkerrors/serviceunavailableresponseerror.md: id: 246c8ebbc59c - last_write_checksum: sha1:595c702e1dba7ca549c59db9c2932c0d50debb73 - pristine_git_object: 1c2fc482f6b6cf97704704e0ec16e02771595eb1 + last_write_checksum: sha1:7236dea5ae99f2173a67a07291875cb6e69c9379 + pristine_git_object: 2c961feec7ef3e9ac312c86de870598f06f22ce9 docs/models/sdkerrors/toomanyrequestsresponseerror.md: id: a43de782ecbe - last_write_checksum: sha1:354d4f76d243ddd1d008005ba0df8315cfc8276f - pristine_git_object: 24555b718f7483312d63a1f2b4d4cea74b47b429 + last_write_checksum: sha1:67e3e94fddd1e5252609f41dc6b3458d000c4c08 + pristine_git_object: 3536e13bf3c2031c41652d31fcc54fabaa2a8979 docs/models/sdkerrors/unauthorizedresponseerror.md: id: bd42d857a53a - last_write_checksum: sha1:d0f581ae639acb2c6089022e8db9a675df1b2989 - pristine_git_object: 30041061b0de01d0e4d934583efcc21a10e8b7fe + last_write_checksum: sha1:f95884de905f0e55c0aa54558c20b85cc2cd8d78 + pristine_git_object: d039f6884745ad5a8e3fd4082378ab00e9af8824 docs/models/sdkerrors/unprocessableentityresponseerror.md: id: 829b6cb198dd - last_write_checksum: sha1:0f065f3eb4d600fa521a6460a1a737980fc6d3b2 - pristine_git_object: b6cb5985252a8e4e1bdf159cdff991d780d4f092 + last_write_checksum: sha1:844a93ff2e75fae04b43ec57354461b60b39614a + pristine_git_object: 1c0a4829554a051287b79925c43f28005f0be112 docs/sdks/analytics/README.md: id: 4c84abb05030 last_write_checksum: sha1:bad929e8d676b0defd28233aacdb0acb1c23b7e8 @@ -3292,14 +5505,26 @@ trackedFiles: id: e2bd25998427 last_write_checksum: sha1:26a7ae261dd8384f2594eb8cfc16f69ec1694afa pristine_git_object: 344a37aa8b9b969f232d1d9b0a0ce579bd8a3e4d + docs/sdks/betaanalytics/README.md: + id: e037af84b386 + last_write_checksum: sha1:f345d541fe94f3055102984d50eeb141007e1af6 + pristine_git_object: 4824b2ed6356ccf51681e798448bc022f20a4e83 + docs/sdks/byok/README.md: + id: 511ba2ae7a1b + last_write_checksum: sha1:e9d414f936e9df519f71f2ea08bfddd0fd18a017 + pristine_git_object: 3d40241401d0db5f86c60f9a490da8721c096509 docs/sdks/chat/README.md: id: 393193527c2c - last_write_checksum: sha1:cdbbffb852399c187b9d688e570bdfd856979281 - pristine_git_object: 2e19d9c726b52a70def2f0d8c675c2c896cfbf96 + last_write_checksum: sha1:b9079c84040f881bcd59bab7d724d5af02fe0fee + pristine_git_object: 99c934ac4f065f1f3c58e51260ae164bba03209b docs/sdks/credits/README.md: id: 81608135c0ff last_write_checksum: sha1:d6765120b556b7f5829821bd5977aa7d0090bba0 pristine_git_object: d7b490e8561ba6e7295b4b1d1168a8b5570ac8fc + docs/sdks/datasets/README.md: + id: deb5d90f4faf + last_write_checksum: sha1:9b7f3dc54db0dd3c5ce16aba440d983a38e69cd8 + pristine_git_object: 4efd8239041e4d0599c332ce021512807d21dce8 docs/sdks/embeddings/README.md: id: 15b5b04486c1 last_write_checksum: sha1:a83edff5061a905313d5aa4312ee9e4dbfa0d792 @@ -3308,42 +5533,58 @@ trackedFiles: id: 80d3fa9f5f5b last_write_checksum: sha1:29ea3a04bbd59d06dd7e31cb960b98deaee6ac73 pristine_git_object: 5314379716bd7af3125e8a4d2e1a652471990b70 + docs/sdks/files/README.md: + id: e576d7a117f0 + last_write_checksum: sha1:5465983d907986fc2d178dd8d4ad27e3a8e37d32 + pristine_git_object: 5a89ea86b282202b37e4546aa1b63b4e387a8c86 docs/sdks/generations/README.md: id: a7d12ae95fb1 last_write_checksum: sha1:464adc276d24c5cd88cfbe6760bea410320cc7d7 pristine_git_object: 604a5e6347df900ef35892cbbb2d9df36f002cac docs/sdks/guardrails/README.md: id: f72b38a5a2a7 - last_write_checksum: sha1:f4a81cda14541117921f6de225c3d11f5c7f7bd2 - pristine_git_object: 88da56c7116d7371617ef0df96b1c639b986fa88 + last_write_checksum: sha1:452cf941859ee44de443893651ae9ad7bc4bc09e + pristine_git_object: 9fdcbcc723ea0b7f2f6344886093a49743755ae8 docs/sdks/models/README.md: id: b35bdf4bc7ed - last_write_checksum: sha1:f07b887cb0590620eb1e4ba2d188202637e2ffbc - pristine_git_object: 9c01c0a03847d302740206e65d6eea088e6fca1a + last_write_checksum: sha1:2d14eb55bcb82982104c71c638d43a10e895a3fe + pristine_git_object: 7e9a21c11ef552fbfc5e2462fde5d48ed401e64a docs/sdks/oauth/README.md: id: 80ad2c1a7b62 - last_write_checksum: sha1:6c70ede4bbfee3cdb222e4595c266ec7c7070ec3 - pristine_git_object: d20c9324e517f5e5b04c039f9b0e1cb7bfb2cecd + last_write_checksum: sha1:fe1ee9ebb1021c6d4e4cd1d531301debb77a340b + pristine_git_object: ec69cb996c8ce5fda2e975519beb9d8a17725412 + docs/sdks/observability/README.md: + id: bab967736831 + last_write_checksum: sha1:b4b9f498743374a2e79554d9555e7a96c1def39b + pristine_git_object: 106234b8727f0640e6fce5848bf5f177e85c9185 docs/sdks/organization/README.md: id: 69e4232b8432 last_write_checksum: sha1:7988a30add8e8be893ab439891f2b18c3eff83bd pristine_git_object: e7ada7f41cc553f35fef0e1ec129fbc5b58fc80d + docs/sdks/presets/README.md: + id: ead9668ae1dd + last_write_checksum: sha1:c9f7d2faedeab7bd639ae44c091a4fee30c27fd2 + pristine_git_object: 8eddf994b843be7b6cd663aac2e3fc57fbc9e7b5 docs/sdks/providers/README.md: id: b02aa45c0093 last_write_checksum: sha1:35b8d65788dcdcf2cc28d70073c4cc01cfecf964 pristine_git_object: 0dab3bcc56cf1e551e576990452ad1b746688af7 docs/sdks/rerank/README.md: id: e2b361cec1dd - last_write_checksum: sha1:b8ddaac3aba415ee29367bea3883088603ba1791 - pristine_git_object: d8ce32dec5be2799ec837a2c57874d80eba5116a + last_write_checksum: sha1:baf9acae6c13c2074f278175aa1c4c2432a80b20 + pristine_git_object: 94daa8329c444838eba895adbc7cbd2f43c6cc38 docs/sdks/responses/README.md: id: e717bad14f63 - last_write_checksum: sha1:2464d5d65dd7154b129caf56207a06058ed7f5d2 - pristine_git_object: 9724e6179b28340e9bd86e45fb9079049ac84504 + last_write_checksum: sha1:c14954ed7ea09a2ea30b04b199eaddb6696aae5d + pristine_git_object: e6e0ccc905159c2d3a3b6fd7ca47d3177043f3f9 + docs/sdks/stt/README.md: + id: 0806154492f9 + last_write_checksum: sha1:496f21b2bc312717857ad73e3f4ff51904cb5c0b + pristine_git_object: ff2f106bbb661cfd5e421759cedc5ae4d6aaadac docs/sdks/tts/README.md: id: 0c425074d09f - last_write_checksum: sha1:94d40a3275305a753cc148b5f221073ea1cd619f - pristine_git_object: ee25e635d38a127eded2339b05c959d16fe3cd76 + last_write_checksum: sha1:fac90937625aa85798337833dadf8729861b7458 + pristine_git_object: 57635c65a31e007d7a2a00ecd905fce5c0d1f3e2 docs/sdks/videogeneration/README.md: id: b6dbf7b0729c last_write_checksum: sha1:7da37bb7afe5662d69a76ebb7b3593181e4c745b @@ -3354,24 +5595,28 @@ trackedFiles: pristine_git_object: f49178d20b00e1e10b43fc5be58f656938c13d15 embeddings.go: id: f7354b2d5b3e - last_write_checksum: sha1:a0ddae9604bdf87b05e111b9e8003be41e5d3967 - pristine_git_object: b5e36e8d08a80ea7842b172d16af6ea6cb2908b8 + last_write_checksum: sha1:a079e4ccd13549c84cd10eedd718c35283799acb + pristine_git_object: 7133eb10d36b0dfcaf8d9f73d60494ba87b6ed72 endpoints.go: id: fca50a3c2336 - last_write_checksum: sha1:a2e70f8a05b15728a461bc93bd31b7dd5335749e - pristine_git_object: ba124e6eae96782b300d0734146b1fd92dfcfe23 + last_write_checksum: sha1:2580761728a9574c87bf7356358889d695467bb6 + pristine_git_object: 2ce8a37c30d493fb7576821d578a2d5a9bc869d6 + files.go: + id: 2321d71bc458 + last_write_checksum: sha1:38b954d0d68ade28ebbcc10007394b71a780d6d4 + pristine_git_object: 8524208f928833d758f04da467d19a0f61f760d8 generations.go: id: ad539e13a3f6 - last_write_checksum: sha1:78b953358c96fe9b4a47f0a20fc0315c19903144 - pristine_git_object: 0fbcab303c1a951e40dc599c5218f91ef710712a + last_write_checksum: sha1:3ea9b2f6c4ab38d0e2e41b0bfc0fbc964eabce75 + pristine_git_object: fb4140bf9321ff9b57a769abe1b3e7ddd61c8542 go.mod: id: c47645c391ad - last_write_checksum: sha1:d8a871c3a4cd788f167dc9d0664372d6b3061bab - pristine_git_object: 798cc5ddb114dd42db1fbc64cdbe27a057dfe3f7 + last_write_checksum: sha1:4d254fc386e7e933f2bae7d9f025c358595d9a15 + pristine_git_object: ddbd7334856b5023884b94fcf190fa263d27bd30 guardrails.go: id: eb364a316712 - last_write_checksum: sha1:74d2bb08e40a29c3ab8adf3cb27d9ca0d3c7d15f - pristine_git_object: d61dc1fa76ec3f34c6f061bf67cd97682d72147e + last_write_checksum: sha1:6b842bd9c562fc48496ec7bdbc9eb6f992818c27 + pristine_git_object: dee013153b6a88fb159efc3d1eb7ed7900111996 internal/config/sdkconfiguration.go: id: 33b8bfac5265 last_write_checksum: sha1:15e41ba496b469915419bb45c537c9f52592e6f1 @@ -3402,8 +5647,8 @@ trackedFiles: pristine_git_object: bcbf1d9eaad67b4c6b29a32a2d3ec389181fe187 internal/utils/json.go: id: ad03e3c502d8 - last_write_checksum: sha1:6e6e382ce62e67a7a5af1fbc92c304d9797d7eb4 - pristine_git_object: 9d1e56ec888487e30c993055af9d0ad6afcaa5ce + last_write_checksum: sha1:b8d30c190d6028adc5a121549d4049073ae3ff16 + pristine_git_object: a5a64183e5295dc9e8aad569a4f3c46d40d9d875 internal/utils/pathparams.go: id: 1f3e0c30fd90 last_write_checksum: sha1:16164be3ad202edc6bdb01e5ca25034ad06d2393 @@ -3426,20 +5671,24 @@ trackedFiles: pristine_git_object: 7c1a372ae314a9d82ab82c3db610e7ffe67ecfab internal/utils/union.go: id: db86c85746b6 - last_write_checksum: sha1:8394658e4013d8453bc2cba3eb7eb22d94bc9fe5 - pristine_git_object: bc6a1ee161cf1b9f28b6a4542d9d7945bc64d10c + last_write_checksum: sha1:aaab8873112425ae55c85d873d6e959dae5dc2dd + pristine_git_object: 12348ff4ff46d50a33f8097eaf8a0aaa4be3019d internal/utils/union_test.go: id: 4b56247171bd - last_write_checksum: sha1:83ac73c1901de4c6db90f65cf5879163f3d47a00 - pristine_git_object: f66814c73ace94d8e71d785fd6161fb405745754 + last_write_checksum: sha1:bd5c7506e1d6238117c1ac4e340314a5a41401b5 + pristine_git_object: 138f7e2a066b10dffd0a9957ecfcab9e00dd26fe internal/utils/utils.go: id: 1133b2a27019 last_write_checksum: sha1:36a3e6fb95d71868d1755dbb3b924a37340c7ea7 pristine_git_object: b32a14db51857aafab25498ba32fa2905c92b5d8 models.go: id: 3af78faf181b - last_write_checksum: sha1:73a31af954255b7afb679ed48db45eb1c7ea6588 - pristine_git_object: 3f933b77d97267cfded40f28a5c649568254e9fb + last_write_checksum: sha1:e20bfd40416909e01bc3548fca8aa913ed3fdce7 + pristine_git_object: 507277c00bde65ee693e18f74170b779de2c10a2 + models/components/aabenchmarkentry.go: + id: 4c2460857b24 + last_write_checksum: sha1:f1dcb4e0a7a18fc3b6c701e6608ac599c5a0f280 + pristine_git_object: 16b9a9eff2f6cf1dad4c2c5bc0a05eef7e92f865 models/components/activityitem.go: id: 11d3801b0dad last_write_checksum: sha1:e0e9d08399ac4c28dab7429ca8ebbd2b680081cc @@ -3448,26 +5697,194 @@ trackedFiles: id: 797c277328a4 last_write_checksum: sha1:3be5b61c5cd92c78d71014892a73b929d091de3e pristine_git_object: e91c09f242c26f8aadd4d7ebb34634aec6613c9a + models/components/advisornestedtool.go: + id: 1644bce8acd1 + last_write_checksum: sha1:7019d573442c316a457286bf5876d0fb662349ff + pristine_git_object: 1b3f6189feac277df2245d637cc2b856efa20c1d + models/components/advisorreasoning.go: + id: 9fc191f04671 + last_write_checksum: sha1:7e7aca95bc8daa20c38587bb26aac61a4b2ad286 + pristine_git_object: 9cd505e6aebf9e63bda32820981840b5ac8d6b4d + models/components/advisorservertoolconfig.go: + id: daeea4cb03ae + last_write_checksum: sha1:cc360b168f52ffcc5c91acbb4b29225515e8aa18 + pristine_git_object: 2990e719948dc2b16dc5e041c01bd52a969d55b2 + models/components/advisorservertoolopenrouter.go: + id: 76e1c03e96f1 + last_write_checksum: sha1:2c004aef9e17e98a2b45886da300c7e33f8fdc9d + pristine_git_object: 72c99e3a7bc8e72834a8146fd8d5efebc9dfc77c models/components/annotationaddedevent.go: id: b6261fd23c6e last_write_checksum: sha1:9be1280533bb1e12ef6191f6b789dadaed69c94e pristine_git_object: 16dec87b497a0783a55317cbe24de3e3cbc751d0 + models/components/anthropicallowedcallers.go: + id: 9a7f596270aa + last_write_checksum: sha1:1eaa424e68f4383f6e594a94f3e1ce5dc22b13d8 + pristine_git_object: d46dcb4f535e00eb73d9b6e5d74c5c2d0c9e5f45 + models/components/anthropicbase64imagesource.go: + id: a757dac991a0 + last_write_checksum: sha1:aee51ac677189914c72625d3c6a2cedadf51f633 + pristine_git_object: c8dd68a416aa7ff8c322de6a6898b89de056409a + models/components/anthropicbase64pdfsource.go: + id: 9f1fea25d774 + last_write_checksum: sha1:17a35ddfd4331f822d08a855cee78a467ca426f3 + pristine_git_object: d2e4cc37be75a5a38561cec382bfcea1c4baf816 models/components/anthropiccachecontroldirective.go: id: 89f109f56ae9 - last_write_checksum: sha1:e566de805163136a15e0071ce6f5fe32736b0eaf - pristine_git_object: 8138027f3dcc248d0781f09301d19a202ef4e061 + last_write_checksum: sha1:89820a41a3bbb2949ae61fb0c6988d1dd6673c28 + pristine_git_object: 6ec1088e8182f1df131440b4d6f2489410a74843 models/components/anthropiccachecontrolttl.go: id: 233ccf691a44 last_write_checksum: sha1:aa0bd6c006c6588b6a9ec2e9e32c2a67141356e8 pristine_git_object: 994a07ba98b8a9ee0b5f8f36f77686176270ffd7 + models/components/anthropiccitationcharlocationparam.go: + id: 88bda600f2e5 + last_write_checksum: sha1:d32497d247290f43b04fed22390aa1059cff36ef + pristine_git_object: 0c8269a5e03b7442d6518470e876d25bef145799 + models/components/anthropiccitationcontentblocklocationparam.go: + id: 2a23c1bfd242 + last_write_checksum: sha1:a1f6041af6ac7457110ea1b3c689577ccfac03a5 + pristine_git_object: 10b724c6320805f028ccfd8be28a1e673a6e6393 + models/components/anthropiccitationpagelocationparam.go: + id: 7855d7a44560 + last_write_checksum: sha1:f37a53d6744553000a3b7b1de3209e5476a33174 + pristine_git_object: dd7252a0e4bbf9c4789dbbbbae967f6366853da8 + models/components/anthropiccitationsearchresultlocation.go: + id: 5f1e49c3ccca + last_write_checksum: sha1:f1264214cd444c89f8060d382b9f2a50b1c72a9e + pristine_git_object: 879e6da59b5c7d020f493df787426a9ffaae8cdf + models/components/anthropiccitationwebsearchresultlocation.go: + id: 4fa55e30264f + last_write_checksum: sha1:354f65d61c30ca9f51132d6043df68f16793c1f8 + pristine_git_object: bf7a4100c50030be9ddff0a383ac07dc83688a15 + models/components/anthropicdocumentblockparam.go: + id: 44795262246c + last_write_checksum: sha1:57e09a044eb4030badf6c0ed03b8798ec4149325 + pristine_git_object: 3a3eff0a5e2d46e4a002d5db69b8d145ecc964c7 + models/components/anthropicimageblockparam.go: + id: 677ab38ef951 + last_write_checksum: sha1:dc8659ce703606cf2218dfa8fe90bde7251e4cac + pristine_git_object: 00c85a2c5567664434e68eb2a3737cba3c82aa4f + models/components/anthropicimagemimetype.go: + id: 3cb5692ea2d8 + last_write_checksum: sha1:4bebcbe9889e4eeb82c31c7a534bd7be50ac7a9b + pristine_git_object: a53a85fe633e2c5d64806433a37de8b0aa79dafb + models/components/anthropicinputtokensclearatleast.go: + id: 3214ae0721ea + last_write_checksum: sha1:cbbecfd011cdbfab3c6a648954b4d81f306e964b + pristine_git_object: 4240f446c857a0a41aa5cc0ec9ad78dc5e29d9d8 + models/components/anthropicinputtokenstrigger.go: + id: ceeec05b0a94 + last_write_checksum: sha1:e926497a5e79a46d73ced3db00a26f8687714575 + pristine_git_object: 601fb13fdd44fe2a1102b27a10f6cf5fcfdae66a + models/components/anthropicplaintextsource.go: + id: 7a6927bf4a51 + last_write_checksum: sha1:576be1dcf563ea9fed9648b13e9873df1a205bbe + pristine_git_object: f855349e6a85add5ee7129cc587ebda61aad13b6 + models/components/anthropicsearchresultblockparam.go: + id: a00bce8c0b7b + last_write_checksum: sha1:ed14bc1bf61e79fd0f384c0256e5e6cb5f10a5c1 + pristine_git_object: 15573d5e93e073736aa5a038b2fa94e79109ad67 + models/components/anthropictextblockparam.go: + id: 4e457a2f98eb + last_write_checksum: sha1:6e57bd725013284a4da318a8287d1815d647a4db + pristine_git_object: 6ac4f6fa48f221b0c85710a807c506b2fc6f036e + models/components/anthropicthinkingdisplay.go: + id: c4ea42dfc432 + last_write_checksum: sha1:b98b1d55699afb91eb276a897bd1ebf795eb866b + pristine_git_object: 7b39877551ee909a9799b7185194a07dba539a7b + models/components/anthropicthinkingturns.go: + id: 0a450f463450 + last_write_checksum: sha1:dfd763e2240944f78c163f483dea621f7332a72d + pristine_git_object: f2f72cce723ca2aa94722982a8f4dba6f3413c38 + models/components/anthropictooluseskeep.go: + id: 4158a577aa8a + last_write_checksum: sha1:d77056f43114b5de9f94dd6a0bc6b56a0f84f904 + pristine_git_object: 38074b4cc59bbeb9a13bca64a50f4f389ed5878f + models/components/anthropictoolusestrigger.go: + id: 6579d723109e + last_write_checksum: sha1:b343a75fbf51ecffc4c46adc945937db76a7855c + pristine_git_object: 6a346067c71ffdaeb7480d03b663b5b7e136b561 + models/components/anthropicurlimagesource.go: + id: 7766af733ad3 + last_write_checksum: sha1:db87c644f65084da510c46a71496172961d57ee3 + pristine_git_object: a049fb0562426c6a55ee23c8efc16f7a44aa8486 + models/components/anthropicurlpdfsource.go: + id: 4d4f0b7b5f1d + last_write_checksum: sha1:1e2eff3f89923f4ecaef7047a6cd1043d8dcddcb + pristine_git_object: 35c61a5847777f2dfb354970d54ad6129b67e538 + models/components/anthropicwebsearchresultblockparam.go: + id: 9d75d0d86f59 + last_write_checksum: sha1:9ebdef5819bf3637d1954ede6e6dec838b8999fb + pristine_git_object: d1ff4c14c79f3f797904bf26f826d81001c51232 + models/components/anthropicwebsearchtooluserlocation.go: + id: 02e0e6c4f7d0 + last_write_checksum: sha1:ccfeb94597d68a62b2d5e44cfa5c2e0352935122 + pristine_git_object: b759f472daadc28ffd4187bc741d277b2bd7644b + models/components/applypatchcallitem.go: + id: 4066ee401823 + last_write_checksum: sha1:9ddc34289f4cdc3014e6bbb050ff5e1ca8303769 + pristine_git_object: afada19a9643aa30cc859ec8b016e35de6405047 + models/components/applypatchcalloperation.go: + id: 598718228c46 + last_write_checksum: sha1:e36e11095411da131082babcaf03c494ae1cdb2d + pristine_git_object: fde9a79e49f7f25b7f7fb3d02027715353238bd2 + models/components/applypatchcalloperationdiffdeltaevent.go: + id: ea8e05ee1cbb + last_write_checksum: sha1:d61130b249bc997c696321dffb3d1d79c04afee9 + pristine_git_object: d8507eeb686cdafdd98ab96c3e549e84cb16352e + models/components/applypatchcalloperationdiffdoneevent.go: + id: eb65841deaad + last_write_checksum: sha1:dc1893f02251d1a8fa549b3c70a87c49cc8719e7 + pristine_git_object: ba3fd5e10dcea0131c4825d8e4578e36ebb5c40d + models/components/applypatchcalloutputitem.go: + id: 0816862b7930 + last_write_checksum: sha1:290a8ff348750058ab51144030d086f365911f21 + pristine_git_object: 60afddeb3ffecde344d96c339fddcb54a8eba15a + models/components/applypatchcallstatus.go: + id: ecfc0f4986fa + last_write_checksum: sha1:4b5b7a373857caf38d783db6d786755dc890241d + pristine_git_object: 047dd8bc88311be720a8a931bad17b638553292c + models/components/applypatchcreatefileoperation.go: + id: eccbe112f686 + last_write_checksum: sha1:9082260374839407310de65e1dc0e15af57c7330 + pristine_git_object: 4701f8bc3e04c49e25628433cd573e7e35403077 + models/components/applypatchdeletefileoperation.go: + id: 0c186d1effad + last_write_checksum: sha1:8038ef2ac87e7e7350cb1c01646be09e12d91224 + pristine_git_object: 68bd055d0efc7c319dcb53deaafd103b74755bc0 + models/components/applypatchengineenum.go: + id: 46ab1b515033 + last_write_checksum: sha1:83d11d97e998f003808a881b8f96f5f4ad5bbdeb + pristine_git_object: dae72e4882f521c1367d4d4252e36c28552b864b models/components/applypatchservertool.go: id: 2a191627b2c8 last_write_checksum: sha1:355cec94e02d77e95db9cb5bcb29e4369189856a pristine_git_object: 949709cbc43590b6940f24d54db7701e7a788f64 + models/components/applypatchservertoolconfig.go: + id: 49b1762a544e + last_write_checksum: sha1:1c0e878435309bff82bdcddf2f25606c422aa0b4 + pristine_git_object: 1f9207e881be7c1b75236df28bbf6f2e6ae2773f + models/components/applypatchservertoolopenrouter.go: + id: a13030ca3ba0 + last_write_checksum: sha1:014e23322114e6955a3f91ba151ed35c96fc755e + pristine_git_object: 462beb261594d3a5917a43e949a0945c581d5b1a + models/components/applypatchupdatefileoperation.go: + id: 1bc61dc75753 + last_write_checksum: sha1:4d8ce03465a62d1460e4bd5c9727d0b53f8fe717 + pristine_git_object: 009277fec15f4bb79e082d22a6a83b8516925c92 + models/components/apprankingsitem.go: + id: 288c64494880 + last_write_checksum: sha1:218494e17d7bd85ba54bbdf92fc232d6eddf9156 + pristine_git_object: 14948421385cc65d1ed364a957ec08b310cf7a0e + models/components/apprankingsresponse.go: + id: e28785f8255b + last_write_checksum: sha1:04a51748334e77359cca73e8e620fe10ec4ace38 + pristine_git_object: 30a273966efab68c24f6ec5b06bd431246021cab models/components/autorouterplugin.go: id: 854f76942e3c - last_write_checksum: sha1:e43f18c31be5ec7ea25b29b7c8442115c26bc639 - pristine_git_object: 8ff53e4a95a110e642335bce126d88cd9eb581f9 + last_write_checksum: sha1:d8d901badf15d922b0b97da03f10493a02a6948b + pristine_git_object: d1f1b575b850e31d45f9a0ba6e41491c353e2df8 models/components/badgatewayresponseerrordata.go: id: 53b7c495de19 last_write_checksum: sha1:c2422191e609c2ed91acd8fe9d908320a28b7839 @@ -3478,12 +5895,56 @@ trackedFiles: pristine_git_object: 9fe5b11f5b0e812ef3d8f3d5f0fb84cc7267d030 models/components/baseinputsunion.go: id: 1639bec7f315 - last_write_checksum: sha1:1524b7414b9e67f19238b627a3c4829e8486a160 - pristine_git_object: 8326149fcf455edec550da0bfa43db42be1a7905 + last_write_checksum: sha1:b26dc0bffb2f7f66789619e59380ac6b68503ffa + pristine_git_object: 395f8d29175202e79a203832b25449fd5155799f models/components/basereasoningconfig.go: id: 28b35bab0d6c last_write_checksum: sha1:3d055df6e1597a8d31f23ac4179d1255ab465461 pristine_git_object: 9c7c6b0bb83323073739403036288e684e00e38b + models/components/bashservertool.go: + id: "926456015418" + last_write_checksum: sha1:c66438d94903fc4b9170d81c11e4522ef8736c6f + pristine_git_object: 93b9aed4e162ff1d1eeaa296768cfab2fcc49bdd + models/components/bashservertoolconfig.go: + id: 71a8c1f31e9c + last_write_checksum: sha1:8f7a5fe8f78ff5b4ed4465be5141be05af4944e2 + pristine_git_object: 8fafac1e645eb6feea84ce39610c967be1755bb2 + models/components/bashservertoolengine.go: + id: beb09aa62c21 + last_write_checksum: sha1:9769054b8e460833b9c833793b7627060d995b90 + pristine_git_object: 779b5ccb39b010669a7852f401c786878fb517c8 + models/components/bashservertoolenvironment.go: + id: 0c7bb0f85f5b + last_write_checksum: sha1:67ba8d37748e51f231882d5c213f4361d10b60c4 + pristine_git_object: 8620c1605cc7ba5cd6c04c51972e48eea4caabc8 + models/components/benchmarkpricing.go: + id: 2ba35fed3293 + last_write_checksum: sha1:0905a7755a3c44f523ac3f1196528018f7ae2155 + pristine_git_object: c09eb349c5acbfd9fbf24544ef9b667acb23425e + models/components/benchmarksaaitem.go: + id: 3cbd54652d85 + last_write_checksum: sha1:7db5f48da9d5a8981065354736e845167467944e + pristine_git_object: 0f7a78942dac8d86de27d917989d4db3e958c012 + models/components/benchmarksaameta.go: + id: d16e67e936c5 + last_write_checksum: sha1:65542d5b9ad1231c13925d9da6a602f075dd3714 + pristine_git_object: a719dc066e6c34ff8d8182b221c70899fe569fa7 + models/components/benchmarksaaresponse.go: + id: 90e35052950a + last_write_checksum: sha1:2f45e0a775cdea7fe884b6d70771b6c63c9d1097 + pristine_git_object: 2ee03e3b6360515937257cd822d17b38b300971e + models/components/benchmarksdaitem.go: + id: b0c4ce44e852 + last_write_checksum: sha1:02e67ba36fcf38789d970c83cc78c1abb0e6268e + pristine_git_object: fea8647b9e9421c4d63001faceb59acc4adb4d71 + models/components/benchmarksdameta.go: + id: 75748931ff52 + last_write_checksum: sha1:a343bbc3a55da10bfbe26565749d928b153f2cac + pristine_git_object: f0e4622877bf7b06791007e534ffcf238a2b26ef + models/components/benchmarksdaresponse.go: + id: afb518fe520a + last_write_checksum: sha1:a1e46cc8c2f69eab9f15a26316406daa4ab06856 + pristine_git_object: 253dfea746fcad4a5e64af0f0ec889de9f75869c models/components/bulkaddworkspacemembersrequest.go: id: 5746ef7e0134 last_write_checksum: sha1:24a4d4d5141fc0d1b60585eaba64d760ddb28e94 @@ -3532,6 +5993,14 @@ trackedFiles: id: 5f5045aa23f0 last_write_checksum: sha1:4958ccd935a684c60af880cc443711480e944365 pristine_git_object: 4488d958d649c85974554a8084a5797a700102e4 + models/components/byokkey.go: + id: 25734078788c + last_write_checksum: sha1:c609a45df5019eb9cad6e3d6659b13b32e4ae939 + pristine_git_object: fe179d527f9b877e8812d18c2c8989ada720c7b8 + models/components/byokproviderslug.go: + id: 13d55e8b344b + last_write_checksum: sha1:ba4e515da13ec806aeed24134acc5587643c01f5 + pristine_git_object: 189516f751f78ec9bc16958a7417fdbb8e9d441f models/components/chatassistantimages.go: id: fea229766390 last_write_checksum: sha1:15bf317741f174be05eddb1c6e3eddb5c597e276 @@ -3610,8 +6079,8 @@ trackedFiles: pristine_git_object: 229607fc482e8f37a16da91b45d761bc4b53362a models/components/chatfunctiontool.go: id: 2404feb24575 - last_write_checksum: sha1:286a6d30577535e1b7246ed14399b18c572b667e - pristine_git_object: a1d901107341ff0c82d6d7b77a7b39c5f71cebe6 + last_write_checksum: sha1:8d6a77abe85e317532bd3f736a779880bc12b50e + pristine_git_object: 2cbb2508cb21b5eb2d4f2b9ba34c399c2da81bc3 models/components/chatjsonschemaconfig.go: id: 927e3d07c53d last_write_checksum: sha1:732bb6d2e0cae555e8794fb0304b17ddc3691ff9 @@ -3630,28 +6099,36 @@ trackedFiles: pristine_git_object: 01d9b75ce8c5d57a84a8b3eb39f6d803c6396116 models/components/chatrequest.go: id: 3e77961c64d1 - last_write_checksum: sha1:5e346ed5846fbd8d741e5e5f7f2f449c7342a626 - pristine_git_object: f03b2cb7f363dd4501c317cccbea4652079de2ec + last_write_checksum: sha1:653993113c26e5206d1c6e917ddb434f0b2029f7 + pristine_git_object: 59fc6d48c76b6c6a3bf74efe3f03ea7230fc1c21 models/components/chatresult.go: id: c5506a624942 - last_write_checksum: sha1:bc44e484260ae72da4c43ee890e06f0357ed5b0c - pristine_git_object: 16a9169cd7fa3352cf6d868383306a8f74a4e041 + last_write_checksum: sha1:fbc9ac21aee30b5929647d10b305707f3168ce53 + pristine_git_object: d368de535cab580a7fe18993570d426821caba19 models/components/chatsearchmodelsservertool.go: id: 0c7d468639f8 last_write_checksum: sha1:b3db9ef43367388b9eae9837792564fc25496b52 pristine_git_object: d30f238a71966ca726bfffe8dc8e7d57d6e908b1 + models/components/chatservertoolchoice.go: + id: 779554b11688 + last_write_checksum: sha1:08fec32cd06197634b0498eab517ba36e0e14303 + pristine_git_object: bd26146988f31798e1b9f280023bb180e080c4a9 models/components/chatstreamchoice.go: id: 5b18988347ff last_write_checksum: sha1:191cd38311559908456f7aa615ed506661091e49 pristine_git_object: f821fbc871d581cf21d7f505082940c7eb284b2a models/components/chatstreamchunk.go: id: 3d9cf5ae4f0a - last_write_checksum: sha1:2b1e87e2fdc0e91dba69d0de77b66ef1f76b5a6f - pristine_git_object: cc54caa79d0bb82f90887709b4107ab0cb1043b3 + last_write_checksum: sha1:65ae462bc60e771a476ab3bc77e7f8b6d4d46749 + pristine_git_object: f371c556318cf044cfc534465a96fe152d054d9d models/components/chatstreamdelta.go: id: e9a27de74b82 last_write_checksum: sha1:8e87f2447cdffd56c4ff700663276521b0b81742 pristine_git_object: b0704fc7d84ebbae5e9c74ff5f9019606f74c77e + models/components/chatstreamingresponse.go: + id: 479b58d2bad4 + last_write_checksum: sha1:f17ac39e03348e3703681eb176c1947717a762e2 + pristine_git_object: affcf3d6435dd9c186421860ec70af6d322b93bb models/components/chatstreamoptions.go: id: c4ff169b5cda last_write_checksum: sha1:29329d4e23a04a8ba15d7b69fccd3828a900f18e @@ -3678,24 +6155,24 @@ trackedFiles: pristine_git_object: 32f54ac2f23ed87b41c2551b9cca9a7b0922b6a5 models/components/chattoolchoice.go: id: 10578f0c717a - last_write_checksum: sha1:5daa0b5a443056e1ca0001bfc0822d5d4b963443 - pristine_git_object: 116bdc4f864de05604f7d0fd876fa2b4ffe99bef + last_write_checksum: sha1:efedc70e50fb1e8adcf3cf33cdfe873f5b1e6431 + pristine_git_object: e81c4499a1d0506733bb7f94a4156b4749857ea4 models/components/chattoolmessage.go: id: 067728a7151a last_write_checksum: sha1:4758d5a53f301afef3a5920c1e84267095a86596 pristine_git_object: de32b6c75b877f725c0b7b8cfa3cfeeffb15d9ca models/components/chatusage.go: id: a16b8067c6dd - last_write_checksum: sha1:53fade4f7f7a642a793d9ab3300b62caeab8f147 - pristine_git_object: be9e58c130b171c3412dd47241f357f7d452ee05 + last_write_checksum: sha1:5a3246e11fa4d44d6275d31251398b3ce46a9cc7 + pristine_git_object: 9bde0130ecea438a5e5a4cae2c33a0d96c204216 models/components/chatusermessage.go: id: a8e46d722323 last_write_checksum: sha1:1086c112d09dfdab87d1493939cfb0b10e248704 pristine_git_object: 0dcfa46f7313951143efcd2a685cd610b1f800fb models/components/chatwebsearchshorthand.go: id: 1b953af26524 - last_write_checksum: sha1:6b33deee4a135bbd147789f881b0cd8d5f5fd309 - pristine_git_object: 1b37b4ae311071470e2135d56699be9b8e40664e + last_write_checksum: sha1:a96c2f1aaf22452b8e01a9ee41b37c8b3837e7a6 + pristine_git_object: b3ccbe5696224fdf7a89d55f4a8f78f321ebc925 models/components/codeinterpreterservertool.go: id: ad944e4f49d4 last_write_checksum: sha1:2070ae6142f9c69f5dda3dcc43e3499b1367e8dc @@ -3704,6 +6181,10 @@ trackedFiles: id: 078d7155772a last_write_checksum: sha1:ab29ac3e34942b5661fc022ce1210610686d3736 pristine_git_object: aeaccae4620e6df5a708c39af12cf1f5acfd7185 + models/components/compactionitem.go: + id: 898916d6d759 + last_write_checksum: sha1:5eb39a84d780749bce4c5cdb9ab878cf5b0eaf64 + pristine_git_object: 69435d265a5464a1a7f31564ddecbc3cf90a441a models/components/compoundfilter.go: id: efeaa599a1d4 last_write_checksum: sha1:e0fa202f2e9d787a7fa834656aee8d8c02bbc4cf @@ -3716,18 +6197,70 @@ trackedFiles: id: a4f0de452a45 last_write_checksum: sha1:b94be708d31641f40a7a2d22b1d7420d5d31d273 pristine_git_object: 1aa8c0ccf361778caa136a334c7e8a660a144cf5 + models/components/containerautoenvironment.go: + id: 2326f1162f1b + last_write_checksum: sha1:ee458a65d7c2f91b422f1bbe4b4c19e2fdb44c94 + pristine_git_object: d98f25405856c31015464471df5814724cb24da4 + models/components/containerreferenceenvironment.go: + id: 4a30b6b0b7e4 + last_write_checksum: sha1:d33c160211d88e2ef22d209428ce803dec384a7e + pristine_git_object: 037441389df4016fe722916259b728cf4df4f7a6 + models/components/contentfilteraction.go: + id: fa2097d13980 + last_write_checksum: sha1:4dc61b5c7336d7e0997dacef2f5990c6ade53114 + pristine_git_object: 84c6e0ca0becedfb84e7501b5a73284d4fed0e17 + models/components/contentfilterbuiltinaction.go: + id: 44d6440d41ce + last_write_checksum: sha1:46e2e750c23b97c89a9a1638b42567a45db7224c + pristine_git_object: 36c43f3a37df996b719e28443ac1135ec5dd777f + models/components/contentfilterbuiltinentry.go: + id: 6915b716f352 + last_write_checksum: sha1:d137907c8056779f348fbc933087ad2b939f0a7a + pristine_git_object: 5c316341a885e9d24460c0d6c6a70b91aaf87a7e + models/components/contentfilterbuiltinentryinput.go: + id: 3798947c4908 + last_write_checksum: sha1:2191b4d859b9553def5622589d99aa77e8a3a945 + pristine_git_object: 90ebdec22fa7cae59934a82249412ed610f6a13c + models/components/contentfilterbuiltinslug.go: + id: 6ff2a62bcc9e + last_write_checksum: sha1:65e9888f478d0aeb5fef29e42c36a9f2539f0e86 + pristine_git_object: 6dd23893ec9e0caa5ac10ed3365557fab0864836 + models/components/contentfilterentry.go: + id: 848c6f11ddcf + last_write_checksum: sha1:e39f44da7bea3a801ec8404fef5ab7efa1a2872c + pristine_git_object: f99162a0d89eac929a65e5483afd6184aa2a2c61 models/components/contentpartaddedevent.go: id: 4d9d6aebfe41 last_write_checksum: sha1:5a349abba3cc711b7171a3734ff8f2ea27da44fd pristine_git_object: 3b78a4343ce66ddbd57f4d76d872f9b3cd814ffd + models/components/contentpartaudio.go: + id: 6c70d4bd7752 + last_write_checksum: sha1:2a44062a1db06d558b5fd91629c81d959f736542 + pristine_git_object: 811ddc3cc9a22e2a8addc17a6ef928cc0cd30417 models/components/contentpartdoneevent.go: id: 5ad4c4c825c3 last_write_checksum: sha1:309775d8bfda61a327d95d2145f622960449b909 pristine_git_object: c9e7f24e8a8630d87c9b39f5c7ad036674099ffd models/components/contentpartimage.go: id: 225d5bf16a08 - last_write_checksum: sha1:b13146d3b57b51cfc9345266139fed4745820eec - pristine_git_object: 346d2d01d8874891b036b39ff16aed84a64f3373 + last_write_checksum: sha1:0b1a7a6e1fb8e0dd03ff2eb00e05d0670c4cd339 + pristine_git_object: beb8d25e051e85ccdb445eca26737136b3088949 + models/components/contentpartinputaudio.go: + id: 13e6166a49d8 + last_write_checksum: sha1:34a31f5662de702058720629ea04d8d30317c76f + pristine_git_object: 55ca54849ff9c633cdb208a274de114cabf3be5a + models/components/contentpartinputfile.go: + id: "87536376e119" + last_write_checksum: sha1:e0301cc79e7de51f19aa47a1fd7394899e96f7d0 + pristine_git_object: 9e8d4bd899c5cfac8bcd9d3314e0b06fe32ec490 + models/components/contentpartinputvideo.go: + id: 8a5709fc3a53 + last_write_checksum: sha1:3184194a3bb4f6b7f50f6192898f3ce642bcda9e + pristine_git_object: 1a389fa18aace1d9b0c33e463ae6185b54c97697 + models/components/contentpartvideo.go: + id: 90b439b9d891 + last_write_checksum: sha1:9a0d08e95fc5063e083b7c3e5bca200238c8e0b1 + pristine_git_object: 53d93bc1a463e05fd978090a01d81e1d1c393bad models/components/contextcompressionengine.go: id: c458a76acd10 last_write_checksum: sha1:0461deef9c719e3a6f2c19f4a2df868f7994e3c6 @@ -3736,26 +6269,70 @@ trackedFiles: id: 44196553d53a last_write_checksum: sha1:44f4370f1443fe5a9e71b00d0e4dae77b7ba24f6 pristine_git_object: 7de09d6f066051f3b912fcbe110cd315e7cc71c4 + models/components/costdetails.go: + id: 7a2de524433d + last_write_checksum: sha1:c3e2b2ef75ac5135767d1e1a756b789d890f415f + pristine_git_object: 67bc4ecb97930b69427d8a9761d2d65f536afd25 + models/components/createbyokkeyrequest.go: + id: 43a54e33e674 + last_write_checksum: sha1:6aca2c75c9c19b16c1822fb6023668f27d627e97 + pristine_git_object: f1cf5771045d55d5f5f305bdeae188af527a2490 + models/components/createbyokkeyresponse.go: + id: d4498c3bef86 + last_write_checksum: sha1:59e90514adc995e655194adfc5b509c057de39b2 + pristine_git_object: c3d386cf733dce28e6f608f75152854d71d909a6 models/components/createguardrailrequest.go: id: a62ed1a0ae01 - last_write_checksum: sha1:c9ca0a480bc62135a7cee6984a73c41e791a8d24 - pristine_git_object: e4be1c9214a1ec35c03691dea2a31f52f27ebf06 + last_write_checksum: sha1:d8eeb32ec865008d6088e01789749d1f72ce7144 + pristine_git_object: 854b2cc06a744b52951fa1c50c1b149ff7e4c32e models/components/createguardrailresponse.go: id: 65e5b5cb6746 last_write_checksum: sha1:53c063df40ab8f40e29a1ed628f4537f21b1cf3f pristine_git_object: a0f649ed0d639a2214ef55010ca43abf69497b7f + models/components/createobservabilitydestinationrequest.go: + id: 04ca6b57e0ab + last_write_checksum: sha1:53f5f31c315122e86ec0afcf9c019085a4ade6de + pristine_git_object: d13d0461d0ff9cc0081d67e87f4847805261602c + models/components/createobservabilitydestinationresponse.go: + id: ceb969937e33 + last_write_checksum: sha1:81e220923fec6553a4e091ecabea21846cbc1239 + pristine_git_object: cd44f16a791255d11ca40a01efdb1223d1289a03 + models/components/createpresetfrominferenceresponse.go: + id: 309dfb140132 + last_write_checksum: sha1:93cbd427e7ecc3ddcbb46fcd6ac2008f86a9de45 + pristine_git_object: f45732edeb348309c2c00f5d8cc71bf2576d7f3c models/components/createworkspacerequest.go: id: f03152fc7ee9 - last_write_checksum: sha1:408cf3a7c5f7720b7a05ed917cd40ca02a6b5602 - pristine_git_object: e713705019c3fc02660803784fb1912563e4f7cf + last_write_checksum: sha1:17c8ae165059207252f4f35d25e5decaac688e43 + pristine_git_object: 9ff94714cf93c9534d349585550bd5557600d4a5 models/components/createworkspaceresponse.go: id: 6007aebeea30 last_write_checksum: sha1:f9deefc65475960d8b663854b57e934298c88d88 pristine_git_object: b8f7ad169e092ab70de9a828b558b937717e5a1d models/components/customtool.go: id: 120512a5ebb0 - last_write_checksum: sha1:280c71d90a41a56e92a9b53e853603dd5ac71d85 - pristine_git_object: 7d68ba640836cb683c31ed2ec6a14945527ec6bd + last_write_checksum: sha1:1bf3251455aa821b5886df1f508e68ee4e226b04 + pristine_git_object: 18cd7bab571fbec95455439ece5b6bede033d669 + models/components/customtoolcallinputdeltaevent.go: + id: dcead5764fc6 + last_write_checksum: sha1:fefe47faf3688e80aff6dcaa8b05f994397257e9 + pristine_git_object: f052db609ca3b85129e942570b1d06aa6d41ef8b + models/components/customtoolcallinputdoneevent.go: + id: 480f514bd42c + last_write_checksum: sha1:e63263c4a391048c9dbc649717343264cb9f9a39 + pristine_git_object: 04d4219fcf2f76238f1b0bbce5b7b9e1ea9f105b + models/components/customtoolcallitem.go: + id: 66b1d557d381 + last_write_checksum: sha1:f3221c2511ca358388e332c561e4a404185322b9 + pristine_git_object: 38dbc3f79c5af1037bc4ef1cb07d93c49cd27400 + models/components/customtoolcalloutputitem.go: + id: 24812b066575 + last_write_checksum: sha1:fd57524d4e609b34dd03226dd7b45450509bcab7 + pristine_git_object: d5f0565445e082e38b637f46806f27ad2b9d1b31 + models/components/dabenchmarkentry.go: + id: afa51fa9cb59 + last_write_checksum: sha1:ff4b84886492f0f2153a0ca6451be1e031547613 + pristine_git_object: 62b4ae07a77f1aabd4890c459d67fd4de453dff6 models/components/datetimeservertool.go: id: d7714bb8f7de last_write_checksum: sha1:933019947c2c23e5af42f8651a71270d19339b3e @@ -3768,22 +6345,38 @@ trackedFiles: id: 10efe2631c2c last_write_checksum: sha1:5b1129447a5d31e9195bc1770335d78de6d96d9a pristine_git_object: 065ba5337fae0d44cdf04065614a602396917b4e + models/components/deletebyokkeyresponse.go: + id: 9539da9aafdd + last_write_checksum: sha1:904dd0b3b734d2b2aac4f4a825868b719fb81b91 + pristine_git_object: 70a06c79f0deeaff593eb7c283e3901e6866b889 models/components/deleteguardrailresponse.go: id: a5ebffcc1604 last_write_checksum: sha1:55a2764939f0a1106c73c5d178ad97ff1cda6b99 pristine_git_object: d69c6ff8c0e7a771c05adf5dc4f24985bff9581d + models/components/deleteobservabilitydestinationresponse.go: + id: 0b3e1c42bae2 + last_write_checksum: sha1:91bef28ec6f2eadbe775c20e3f8603c397fca250 + pristine_git_object: fbf6d743ea2bd022bddfd18327413b2542068a59 models/components/deleteworkspaceresponse.go: id: cc2779b9ed54 last_write_checksum: sha1:db55544eddc54f8fe932612c2fed2a2d129562e6 pristine_git_object: 2a5ef64776feed5ca872a2ae661097fed0d45ccd models/components/easyinputmessage.go: id: e5af693999c1 - last_write_checksum: sha1:80039a385c8e152cb432fe640e6102a310858fbd - pristine_git_object: a3171fb115a8d1480d8e432b876f10ff337f0422 + last_write_checksum: sha1:0a4554248480f1f2f5ffc689a247d644727e65b8 + pristine_git_object: 7ee219bd687733f4d5692905e8e163b172d45567 models/components/edgenetworktimeoutresponseerrordata.go: id: 9f65363c8e00 last_write_checksum: sha1:afdc1280ad549dabaab317d7cf3a51c228b77c89 pristine_git_object: f65c45f9e931b44562939cf5d713b285be949957 + models/components/endpointinfo.go: + id: 31130ea9f3fc + last_write_checksum: sha1:7b716bb956579e5e78bd280dbf8782d43948eac2 + pristine_git_object: a7c755ba96ec694f87f6cf8f9b9f4a430be71703 + models/components/endpointsmetadata.go: + id: 61b064e1f2c2 + last_write_checksum: sha1:ab76b6d06c57d712a4b176f7c02951804f443333 + pristine_git_object: 9bfecae4d1f5c19e4e24bc68fb3bf5085aa5d0ae models/components/endpointstatus.go: id: ebfe36c58a5a last_write_checksum: sha1:f67d681fdb81f324585a35cb03893a9847fac4a9 @@ -3796,6 +6389,18 @@ trackedFiles: id: c9f2b51b2f6b last_write_checksum: sha1:93c78eaaca7f0955470b7ba9c6c68421ee50d4d8 pristine_git_object: 415c6e7daf68099a786fa342c0b76ffbd06c0741 + models/components/filedeleteresponse.go: + id: 756bfb33e13e + last_write_checksum: sha1:000a19cc579341ffb771a63a56fb1a94410e5e5b + pristine_git_object: cd4d25ad524224cb4e4fad2c304d150cd4069021 + models/components/filelistresponse.go: + id: 2a9ff97b197b + last_write_checksum: sha1:e0986094c3323f5e1338ff1016bebb419ff061f1 + pristine_git_object: 11ffe9b72ee5c2b701451a25058b90a68867f68c + models/components/filemetadata.go: + id: 333ee29c6d8c + last_write_checksum: sha1:782b65a992f944333af64e294c4f8a8f5e7bce4f + pristine_git_object: df1cf9b9aa25724ff49a1e71856a1bffbf81ce56 models/components/fileparserplugin.go: id: afecbe3f3de8 last_write_checksum: sha1:09ac8d793ce6a9dde8bad3961607f23e093e2601 @@ -3806,8 +6411,8 @@ trackedFiles: pristine_git_object: 108bc4e1cf435bd48fab2d3289f7c3ca60d82012 models/components/filesearchservertool.go: id: 6cebb45225e3 - last_write_checksum: sha1:07ab7ff667cf8338710f30557ce644a046447cdf - pristine_git_object: eefcb921afbed6d7fd017f146c9489ad9e45b77e + last_write_checksum: sha1:ba200630f463f31fb65c582f4013b7d472a0ff5a + pristine_git_object: a8e115ba6242e280516ed0069ee24f9817cb7ad0 models/components/forbiddenresponseerrordata.go: id: c22e7663c6b8 last_write_checksum: sha1:47738634725c86e3daacf5441d8cdc13618a10ef @@ -3842,12 +6447,64 @@ trackedFiles: pristine_git_object: 9390361e0a89229cf0a4c5f7e26a5954bff6a688 models/components/functioncallitem.go: id: 7fbecf573b92 - last_write_checksum: sha1:2d44eca50aa3d6df136d3afbdf4160aa7f9691bb - pristine_git_object: 6c7282d7dbc8fea2ac65d581e94243349fd1a02a + last_write_checksum: sha1:55d86da30278322e0c198e2d695cba554f254210 + pristine_git_object: fbc6275ee49e11b12d1a7c65b036425f8bcefb47 models/components/functioncalloutputitem.go: id: 24351f3584d7 - last_write_checksum: sha1:e070cfc7bc26a8395d3b47298becad7e9f4a7cc1 - pristine_git_object: 7b549270439939c75b1761a7227361e6526f3192 + last_write_checksum: sha1:31b0035ce84906117519587b5d020dc5bfea1782 + pristine_git_object: 1f04a6e96553d7582ab7c9c9e223435c040c61ed + models/components/fusionanalysisresult.go: + id: e07fb5c0d2b1 + last_write_checksum: sha1:6a182ee0de70a4a1ab47d553e77cfeebaaa4e95f + pristine_git_object: ddaa322d93ca0e328fef39c35f116c5c1c0acfa0 + models/components/fusioncallanalysiscompletedevent.go: + id: 9ddd3dd8a809 + last_write_checksum: sha1:39ffd98636cb190cf9159bfbd9a733f13395d1f7 + pristine_git_object: f9951eca07cc053448caca6f71c714fe77b23a87 + models/components/fusioncallanalysisinprogressevent.go: + id: a0d954541528 + last_write_checksum: sha1:31822906df078ab64544f06f4cb2ca33bf861812 + pristine_git_object: c77b429ec4564cf3c81f4ee42d53825ec2d20c03 + models/components/fusioncallcompletedevent.go: + id: 6177a54bd563 + last_write_checksum: sha1:adab5fbdbf802a858ee406d3cf1cc1e0d0a4b6f2 + pristine_git_object: 58dc5619e499af00c9813366416ddfca60f244d4 + models/components/fusioncallinprogressevent.go: + id: 5068b78c93c1 + last_write_checksum: sha1:42e2598c3fb8636da98c6aa1fc90ac262493a0a5 + pristine_git_object: d98ba13c1b354e37edceed445b9bbf954066b703 + models/components/fusioncallpaneladdedevent.go: + id: e830eed85c88 + last_write_checksum: sha1:4789c48725ac3ec7fc4cd677fa6bc0bbee11d366 + pristine_git_object: 4ca5f533b265ac427b60e52ea65ca410a9114ca9 + models/components/fusioncallpanelcompletedevent.go: + id: dafdb9261b4a + last_write_checksum: sha1:f2b2a0d9c95e145007157af3c45b589e4506265a + pristine_git_object: 958ef2ac8bc2d83a5da1a1b91591f7693fddcb84 + models/components/fusioncallpaneldeltaevent.go: + id: 5ad787d30163 + last_write_checksum: sha1:e233f26db776266a5df5d4ad857642a92ac5e41d + pristine_git_object: 5b8f501770bcfe936597f379dceb865a4310668a + models/components/fusioncallpanelfailedevent.go: + id: a4e08acbcbdc + last_write_checksum: sha1:ce5b2a2f39b4da664f06eef8a51f658d74443cc8 + pristine_git_object: 294d26ed496d0050e4a2da933cfac8e8b4d5a955 + models/components/fusioncallpanelreasoningdeltaevent.go: + id: dd5142b18f2e + last_write_checksum: sha1:d4e1c952ea444a62143289818576b45e016d4a2c + pristine_git_object: 1ea5a756a2a475b432b444907ce37354ad60297d + models/components/fusionplugin.go: + id: ad7a63c688b2 + last_write_checksum: sha1:70ea16709486fcaef6599ffbc705ffb65f0509e9 + pristine_git_object: 79d4b100dad65c96f7741b5312f1f31d90e92497 + models/components/fusionservertoolconfig.go: + id: 11a6494de9f7 + last_write_checksum: sha1:1ebadf8a9792e119ae6c49fe2e25d1a98e45ccc6 + pristine_git_object: ad121f2fd7b04360594808277520a11a4a52baeb + models/components/fusionservertoolopenrouter.go: + id: 71c8e6ea7f3c + last_write_checksum: sha1:4a1e878958fb2c8482b21504335f48f9d729e515 + pristine_git_object: 2b632880f266578dd2fbfd639e97a5b2c0d183dc models/components/generationcontentdata.go: id: 98d05ea3b77f last_write_checksum: sha1:ce7d246b14f8f890dc30293f2e83e223a1d88ed0 @@ -3858,20 +6515,36 @@ trackedFiles: pristine_git_object: 02bc155b320011ad6ea0aad03dd70f0962c39ba6 models/components/generationresponse.go: id: 89ce21b091ac - last_write_checksum: sha1:0feeec424ab0959ea8b318a120e504ff961f0c1b - pristine_git_object: 1669ac4c64b3d39035adc91a261da98823b1e90e + last_write_checksum: sha1:74a43b40de5db6b0a314f4459dc16e3359345a47 + pristine_git_object: 0ff64bcae0728b8b9b9bfac92dadf23e1d41580a + models/components/getbyokkeyresponse.go: + id: 7a2bc074b2e0 + last_write_checksum: sha1:2c730a305b0f4628e664405f1a4f9e23a2285cf4 + pristine_git_object: 532a7ff6cd00dec667fa6556b3357aa34a86165b models/components/getguardrailresponse.go: id: bbc5fafe594a last_write_checksum: sha1:216298dd9641fbbc1f58f133b7f3792cce8d26ca pristine_git_object: 7a98c54cecaaa2d438529e73b937ff6ce5f8dd2f + models/components/getobservabilitydestinationresponse.go: + id: da775681f1e8 + last_write_checksum: sha1:e95fceb1b1f556669661802c01d78af14fd9b29a + pristine_git_object: 7d738474642711bdecfb1a4a61aeab3d2a5b1dd1 + models/components/getpresetresponse.go: + id: 82796b7b8c0d + last_write_checksum: sha1:aa754d2fbd4a1f46a5cd488d7a34481fb8f2a218 + pristine_git_object: 602a6f79456138887c449efdcac9289663e726f9 + models/components/getpresetversionresponse.go: + id: 914d1695556b + last_write_checksum: sha1:9b074035640353af377e11739c9080274f3308bb + pristine_git_object: 1d73f3dbd0716830b014e80979040ace340de939 models/components/getworkspaceresponse.go: id: a1e616b47afd last_write_checksum: sha1:f48de4958863e7c5d175265331762bccaed2efb4 pristine_git_object: 6c4e68cb08973a94e0acb458b22c666a9d8f1c58 models/components/guardrail.go: id: 0a53b6641f18 - last_write_checksum: sha1:51c8f2f05fad3bd5812b013b8094067dc8731614 - pristine_git_object: 94b078070d7538f9f6bd81f1c3d3e20f69aea15e + last_write_checksum: sha1:db0dc37dcc9e5e2d27f53c4fccb0cb717e73af53 + pristine_git_object: 8831bb583f694afa74143956847c6f1f99011695 models/components/guardrailinterval.go: id: 9dfbfe70d468 last_write_checksum: sha1:b7dce0e7eb4f95be28d292d227a6bf3be940bee0 @@ -3930,20 +6603,24 @@ trackedFiles: pristine_git_object: b9838e4476cbec760b2208140cf6594ed37720c2 models/components/inputimage.go: id: 5327a988b234 - last_write_checksum: sha1:f6e55bf1588f57b05cb29fdd4ef53076c858fe58 - pristine_git_object: 6cf7c22d87ce2db21ce2f91aa029824dd6ed244d + last_write_checksum: sha1:2e241bcf10bfb17416446cc0a8bf0f8f2f8c277f + pristine_git_object: dfc6458b87aa32e8ee772002c47b2430433660c5 models/components/inputmessageitem.go: id: d00b0a4b5def - last_write_checksum: sha1:be251e9ef08e4ded6b051c28fc15e48710d31733 - pristine_git_object: 5bebc96238d5c5426426ade04c2790c086def3d3 + last_write_checksum: sha1:ed0251ea535f1b8dcef395ee2ce5fceca0e8c896 + pristine_git_object: 41cf0499fdf3c045621170a7e0e936233f1671ec models/components/inputmodality.go: id: a79febbdeea7 last_write_checksum: sha1:a72c2afa3f670c703b3b66d5728b419816e13e98 pristine_git_object: 995d3c9d915411272b1482d8d0b526096862b5bf + models/components/inputreference.go: + id: 04d0cd9b2ae9 + last_write_checksum: sha1:8be7068c879a5077bf32c287309ae2f3918a11ef + pristine_git_object: 8e38594648004638203af9762846ed39a7d71c6c models/components/inputsunion.go: id: 9cf7a037c7f6 - last_write_checksum: sha1:5fc4b4b737eda9f7e7d9800cd69aeee961b40bec - pristine_git_object: ffabea3d20eff242d290e6002813beb5b798c93b + last_write_checksum: sha1:f3ee0f6e0d026a2516b4f7c057fd15af66e54fff + pristine_git_object: adf74fb63bf48974a74db453fe5ec962def51c80 models/components/inputtext.go: id: f421355aad33 last_write_checksum: sha1:c8b208412179a4220f702325379237fc47d64979 @@ -3960,6 +6637,10 @@ trackedFiles: id: 17e0c79d6a0c last_write_checksum: sha1:e8508d24275d050e8f74f62e6d62973d3e3b7c01 pristine_git_object: 9f9d1f27f137b5938a4419eea68c9e5414c8dc29 + models/components/itemreferenceitem.go: + id: 16d768f20336 + last_write_checksum: sha1:f24a0937bdf5ad2e09da1c5312b43aa4a14dae10 + pristine_git_object: 86de458cf0304749072d79284ad50ab2707bd525 models/components/keyassignment.go: id: 6e32615a3eec last_write_checksum: sha1:683bd140357e1d9c2169453dd76377a078c638fa @@ -3970,8 +6651,12 @@ trackedFiles: pristine_git_object: 12f243851b25ac0dd4997cb7240018aa64de4192 models/components/legacywebsearchservertool.go: id: 368653a391fa - last_write_checksum: sha1:cd9c83f3608052a622c69d109c29ab5d551af33f - pristine_git_object: df521f901c46475d13f6115bcd8dccb7de7722e9 + last_write_checksum: sha1:0ac6bf7d6ca74ec76051623663e84924f8e7982d + pristine_git_object: 508cd8f2f081eed27660772adb1fd5aa96834688 + models/components/listbyokkeysresponse.go: + id: de66268703fa + last_write_checksum: sha1:7aadfa5921ec0dce645fce7b4a62f1260872bc75 + pristine_git_object: 4fcab3d0c214a42758e220911363493fe297fb79 models/components/listendpointsresponse.go: id: 940b4db8db8a last_write_checksum: sha1:9638242c38eddb7f490f2955897ff24802682f8f @@ -3988,10 +6673,46 @@ trackedFiles: id: 941a33140651 last_write_checksum: sha1:0844d8c863e12af4a6e1b814c4508892ae7258a9 pristine_git_object: b9c8f7416be9b11438a3e8f0cd2bb6205f5e89d3 + models/components/listobservabilitydestinationsresponse.go: + id: ccc04a41cc48 + last_write_checksum: sha1:bdca967441310bbb2a21b3a669046f3f746409ad + pristine_git_object: 05133c9cc49745948dada4f39d49e962d6a97476 + models/components/listpresetsresponse.go: + id: 8fc921f35771 + last_write_checksum: sha1:0498f9b347eb7436bd924c9514052b52a88c7394 + pristine_git_object: 6f8d780fbe2c734a2b39a527ca9adf1d6f0b7794 + models/components/listpresetversionsresponse.go: + id: 0a4667273a20 + last_write_checksum: sha1:7f13d13e3741950a5b68a22aa734d196f1ad97a9 + pristine_git_object: 7063932d4e728d0678c901acc8382e7aa25ac0a8 models/components/listworkspacesresponse.go: id: 81eba39ab7bf last_write_checksum: sha1:e8839ef3dee6df2c308da509c447d575ad831558 pristine_git_object: 81e6ae86521f1e5a78f8a3b3a842008fbff1bf96 + models/components/localshellcallitem.go: + id: 02eb8c6cbb85 + last_write_checksum: sha1:250d6c78f014c82f331affa8fb368765bccb54f4 + pristine_git_object: 003ba03f62c6806afcd2e79ee22e77808982bd62 + models/components/localshellcalloutputitem.go: + id: 0a6eb5e89b3c + last_write_checksum: sha1:9dc9c4fdf043f25a352709c48054f86c82b5dfd4 + pristine_git_object: e1a9102e18a2db76da8d75fd284fc68f66711db7 + models/components/mcpapprovalrequestitem.go: + id: 02fba295b47a + last_write_checksum: sha1:2b9b7e78a29bfa9061025e810c5ad2212f2e1336 + pristine_git_object: 1e70c2252ebe5eba03325e45a958155018873340 + models/components/mcpapprovalresponseitem.go: + id: a7f7bbc9150d + last_write_checksum: sha1:6f13d5f1092eefdb29ba0bd7091486642ad0cbe5 + pristine_git_object: daee2fabdda6dfa7f0cd176f0eb89410b34523a7 + models/components/mcpcallitem.go: + id: 5fb22c4cba80 + last_write_checksum: sha1:034afc7e45034cc50a35df31d036fc36f5c0498d + pristine_git_object: 1c889c5613e55ebcaf6d7a8148783a0d49a20f36 + models/components/mcplisttoolsitem.go: + id: 2e0560dcbafe + last_write_checksum: sha1:d9b563da7f01ffb8435ba5a029ebf100d21ed0bf + pristine_git_object: 35419036c4f5fbf9b33c6684e5989fb4a439b6ec models/components/mcpservertool.go: id: cea9c758dcf3 last_write_checksum: sha1:8005b0d57d97b206dea5dd2b4a32f659f328a1c1 @@ -4000,14 +6721,42 @@ trackedFiles: id: 84271882f6bb last_write_checksum: sha1:4cf0435477239b9d3c857f227a0beb1561e19bc0 pristine_git_object: a4861d7ec6e2e499acc868e3cc0d0052d042e5a8 + models/components/messagesadvisortoolresultblock.go: + id: ccbb068c1a06 + last_write_checksum: sha1:5761c304e2a6a6dea5e821079d33132e761aa4d9 + pristine_git_object: 946aa8d73e7a05d55751b50b7db04d2c9fe49ae4 + models/components/messagesfallbackparam.go: + id: 07d8551f6032 + last_write_checksum: sha1:8c1dbb33dc4da0f3618d22c81725f7b39cfd36d6 + pristine_git_object: 42269c455a159a109bd218f5d93297cb5be68db9 + models/components/messagesmessageparam.go: + id: 95d11a0f5285 + last_write_checksum: sha1:843423b5be6ec7ed9480fb69c9e1eea472dde1da + pristine_git_object: 9de01c701ce0b12828edb56ff1827bd50c9bdfe3 + models/components/messagesoutputconfig.go: + id: 6de33a59cf6c + last_write_checksum: sha1:f4769a956721655a58bbd688d79347d0698c63a6 + pristine_git_object: e06eae5ce6d393fe7f279ee8af0509beb2d7c028 + models/components/messagesrequest.go: + id: c3efb31bbd81 + last_write_checksum: sha1:9bd1ad194821e297f0d4c0b430ce76b15d5a6cb0 + pristine_git_object: 4a25c189ecb676e60898348b275da9133e572be7 + models/components/metadatalevel.go: + id: e1cfcf1b9480 + last_write_checksum: sha1:dee5e6934d706fb1d9154b630fbed34b3257e868 + pristine_git_object: 2f70d5178b9ad68926c3a8b23eb16629272dcc04 models/components/model.go: id: 8dd64e4e5c29 - last_write_checksum: sha1:047699d1c295ea8d9fa64fc0ed4f5f9fc37ad252 - pristine_git_object: d4aa769b07c599338426606339cc8c2487f95781 + last_write_checksum: sha1:566677950e7d020b147c8e6ac0367f73dd7ae5b6 + pristine_git_object: de775ae834ad48d5200fb07ebf635cb8473ab3fa models/components/modelarchitecture.go: id: f30d391be6de last_write_checksum: sha1:aa7ddde5b83335509846b95facb4d8826ccccbd2 pristine_git_object: 5e6080ed11bc8d541d253f9a7983b631ee3dffe3 + models/components/modelbenchmarks.go: + id: a83297f4f1da + last_write_checksum: sha1:7e7e48bc43207b1c6d358232f2ce6a0abad354e9 + pristine_git_object: 0f5767128b15f4863275cdb387ff756467025579 models/components/modelgroup.go: id: f6c2729c0fbb last_write_checksum: sha1:93dad4f912412778de6ef830cd824369a652b335 @@ -4016,6 +6765,10 @@ trackedFiles: id: f54a9edc5bed last_write_checksum: sha1:564598c394bc8b823d8105da0ee218f6ec226ae0 pristine_git_object: f6693c8531b1f610b7d460e0a3d77097485b6b08 + models/components/modelresponse.go: + id: 38393d8a034a + last_write_checksum: sha1:e98080ebfd4525128c852a445f1144236c0732af + pristine_git_object: 647212c73b4a2d4281ccce4272af0ec8afcd9455 models/components/modelscountresponse.go: id: 739e7ca1fb23 last_write_checksum: sha1:7ebcf0ffc74d033cbc08db978f2f18ec549d78e2 @@ -4028,14 +6781,102 @@ trackedFiles: id: 264d90fc7675 last_write_checksum: sha1:eb03ee7cce228ccacd0cd63a3def3802e921455f pristine_git_object: 15d0dea2420b9d0a4a5ca8e82caf6d2a81da87f2 + models/components/multimodalmedia.go: + id: 27bcb73fb7f8 + last_write_checksum: sha1:a1654896c4e4a4bd5c1e57351da2a28083ac139f + pristine_git_object: 8a201d6f4420b65948bbb16837a4704ab41ca8ca models/components/notfoundresponseerrordata.go: id: e2afd0ef5513 last_write_checksum: sha1:a3fef3abfc0b05feeb05e38b44408b8acce20988 pristine_git_object: db1ee52fd77b1d1d506e23371cbfb17debe85e1d + models/components/observabilityarizedestination.go: + id: ed55e9edecf9 + last_write_checksum: sha1:338cc5f5d2cb435494c56391959e5cae4c2f9198 + pristine_git_object: 8084d1233fb9e7a707efce3e0f2d59a98cead00f + models/components/observabilitybraintrustdestination.go: + id: d6a2616da4de + last_write_checksum: sha1:2d8deba05dbeeee49198a75b59367cdf386ff3c1 + pristine_git_object: 2a4c1739cc29ef5de33250c85a04c20eb6dda7c5 + models/components/observabilityclickhousedestination.go: + id: 9ed43d42fde0 + last_write_checksum: sha1:6140760a29d182147b72605b82b3adb4dc1376ea + pristine_git_object: edae0635de8331a4907415a1772c59d044db42ea + models/components/observabilitydatadogdestination.go: + id: c49de42b7688 + last_write_checksum: sha1:462a1967b8f15f26b3bff0d23bcd9dd64bde46b3 + pristine_git_object: c042aa9c6abb772fc5e2994807c6c3fe8629e923 + models/components/observabilitydestination.go: + id: 6fa08d2e93a0 + last_write_checksum: sha1:854cbf6f05cef76827eb204c58a9d7fbab6dc660 + pristine_git_object: f3e9e13590cae369699c1f45ba068523084e4bf2 + models/components/observabilityfilterrulesconfig.go: + id: 0616250a6210 + last_write_checksum: sha1:c2842806b6de695b08aea7ac6c33a36ce1bb7cc5 + pristine_git_object: 0541429476e8f05c8855fedb8281718238a2df7e + models/components/observabilitygrafanadestination.go: + id: 686fb7f0fbb3 + last_write_checksum: sha1:f491f27f214b0221097e89b9744153ea0543c17e + pristine_git_object: 27199483a19fd985dd58a0ddf00f5ff81f8ed4ac + models/components/observabilitylangfusedestination.go: + id: 187622cf4a25 + last_write_checksum: sha1:086cd4463776f169a48236c1ae7725f49c0d604f + pristine_git_object: 9cbf91a18b2ef86989d673c9ecd8e74c9794fa04 + models/components/observabilitylangsmithdestination.go: + id: da0e4ec53545 + last_write_checksum: sha1:0d2d475402f98ae54caa45cee466ead8b4d77b32 + pristine_git_object: 410fc1759062d9cec5b57a4cebbdd389ac3bda28 + models/components/observabilitynewrelicdestination.go: + id: f48e254552f2 + last_write_checksum: sha1:d542684a508cc0c18ce21f966bd41e5475c3ee3c + pristine_git_object: cea29f6001e4be89ef249765613b11f5e707028f + models/components/observabilityopikdestination.go: + id: a41ae58e7d92 + last_write_checksum: sha1:8eb0725bb269a242a645c605809d81b172e07b4c + pristine_git_object: 58ba39508705e20b111fa1d2c9981833219a922d + models/components/observabilityotelcollectordestination.go: + id: a917df387e06 + last_write_checksum: sha1:f1dafa778ad12ffc1653eb2d77fadf2719e34a9d + pristine_git_object: be0608093c6347cb47b4c39e6c54e48bdb964397 + models/components/observabilityposthogdestination.go: + id: 4dad2194b618 + last_write_checksum: sha1:9497b6175dfbc055d8342c59a742323abde32d56 + pristine_git_object: 05f5b3ff4e6434d88a0949cb4de9293c9eec23b3 + models/components/observabilityrampdestination.go: + id: 58d1011eef53 + last_write_checksum: sha1:17b117c13292825af7e39e4a80c86d0e2a462e2a + pristine_git_object: 155a0261025915217df73fcce0f88c7f56f5c232 + models/components/observabilitys3destination.go: + id: 5edccceac5ed + last_write_checksum: sha1:1270bcfca1eacb39a863fbee2faa84a2fc6e9a7a + pristine_git_object: 8c67b9630b0863be7e1e63a28ac9ad823b9891a8 + models/components/observabilitysentrydestination.go: + id: 1b8e83bcac45 + last_write_checksum: sha1:db4da65ef89a9cb8388e1da01af8433a036e57fd + pristine_git_object: 6d2df57f93a867b1ced872e2115a3c48a72ca816 + models/components/observabilitysnowflakedestination.go: + id: 5d346f1af7bf + last_write_checksum: sha1:bbd15fb6594275961c2e8e9b7d05456aaef503bf + pristine_git_object: c2905a118eae9e2be55ebdd8d0ccf44fcee82665 + models/components/observabilityweavedestination.go: + id: d08ddab861ad + last_write_checksum: sha1:6cf7baa6cf597ea837a8f6593526b6d4c6a555e9 + pristine_git_object: edc60752d3b942c0ad72896377a45528addda381 + models/components/observabilitywebhookdestination.go: + id: 34ff4bcacd88 + last_write_checksum: sha1:2a60177bf8b8d06833d014916cd7298b77db42e5 + pristine_git_object: a461b6690770b5f3bb101cb5118cadd890ed704a + models/components/openairesponsecustomtoolcall.go: + id: d5f1c0e3d8f6 + last_write_checksum: sha1:0a902050ac391eaab7a211fbd4327c168444d546 + pristine_git_object: 1d0e614b1527b5e99e5f0547587f810d048e06e8 + models/components/openairesponsecustomtoolcalloutput.go: + id: d14a0a98d3e9 + last_write_checksum: sha1:b7544add441e138963d1782d2d0f9ad317234983 + pristine_git_object: 3fecde96b4170bb9570380680a0351ae080db74e models/components/openairesponsefunctiontoolcall.go: id: b07e4b7b97d6 - last_write_checksum: sha1:02f60a8132bfc440438999deaba6e2ba7d03de7b - pristine_git_object: bf32c61cba008549cd1fb9941c51486f1442491f + last_write_checksum: sha1:0e4abb304994f60c97f5f79d3e34f72caf961b86 + pristine_git_object: 7a3f591f4425bdc172ca222c28d743a010bed3c8 models/components/openairesponsefunctiontoolcalloutput.go: id: c5afe5169343 last_write_checksum: sha1:2bfb440d4a88d75862da1e75a3a78ba91888b305 @@ -4058,8 +6899,8 @@ trackedFiles: pristine_git_object: df5b1e48bd75e8dac8d1cd7933f837b8a6a517cc models/components/openairesponsestoolchoiceunion.go: id: 45eb26c1fe6b - last_write_checksum: sha1:f51b07be22ca34f582e477a2707293a914ab20bb - pristine_git_object: 7b59b6584945c19adc0cd825d831249ea885ad20 + last_write_checksum: sha1:03ed6fc3dafc3b524edd7858ebb9d591e0e662b1 + pristine_git_object: a58c2104de47aa742a690b15ab3cf723a4c03609 models/components/openairesponsestruncation.go: id: 0e01ed6f9464 last_write_checksum: sha1:343e3f7992e10abd217c8f3a043f8dfd63628477 @@ -4074,16 +6915,28 @@ trackedFiles: pristine_git_object: 5302aafb24e0e2c27115b7f36c32b49f7fda9ad8 models/components/openresponsesresult.go: id: 0e5a110390b5 - last_write_checksum: sha1:dacc2ce6fa9ea5f7f3a464899e64e5ff14846686 - pristine_git_object: 41869efa114c50d879203fc76bbb999120cc852d + last_write_checksum: sha1:431a5ce9c4334e0067d26b1902253b28958271d3 + pristine_git_object: f9cef544dd9442ded79fa3fa0527c83e62c9253a + models/components/openroutermetadata.go: + id: 507a9ac36dab + last_write_checksum: sha1:6278412ee9fb24864543f185712ed9183705ef83 + pristine_git_object: 1f9ad3573182d33924500ed9f57299076e7cf930 models/components/openrouterwebsearchservertool.go: id: bd02ad554278 last_write_checksum: sha1:e65c37319eb93bc47c0897710216d62e2cd3de5b pristine_git_object: b96711b4131a4f16b71c3e97440601c5810379a5 + models/components/outputadvisorservertoolitem.go: + id: 69bf870221cc + last_write_checksum: sha1:b7f82e573821987c67d5fdf40e67a75dc4f7663d + pristine_git_object: 7432945314007187b85ee80d3d955130c576e375 + models/components/outputapplypatchcallitem.go: + id: 938a0fe85685 + last_write_checksum: sha1:ba60c7d27894651d7ce4d8ea4c895c4b7f4edb0e + pristine_git_object: d9a8b4bd368d005ffcdedd2eeb34592cb24dd6c1 models/components/outputapplypatchservertoolitem.go: id: 4364f4829754 - last_write_checksum: sha1:54da029a49bb2fe9342f692676e93e5b1a234c65 - pristine_git_object: f41a5ca14514b32468c45885490d498ab75e9fc5 + last_write_checksum: sha1:34f8b447b20b539017b6e8c5de1a7eb6dce4c26c + pristine_git_object: f9753fae21bef33d7a7fd7bbcf753819801f4c2a models/components/outputbashservertoolitem.go: id: 9e3cc15a6bcb last_write_checksum: sha1:306e4b7563c7ac470eed08b81e905179b9ee0b75 @@ -4094,8 +6947,8 @@ trackedFiles: pristine_git_object: c520b6579601f47ea2ee76be4f3111aea06932bb models/components/outputcodeinterpretercallitem.go: id: 4fc837c1b2ca - last_write_checksum: sha1:628bfb07d12e5e2784ba8d6c8d089b39325da27a - pristine_git_object: 54138d8738649c2397140b07c8d327e3943e5b2b + last_write_checksum: sha1:cdf6be5915f1cd69db29b6bbcd8230a2abb173bd + pristine_git_object: b39c9f72d8a457f68f54b5f64babc40d596aacef models/components/outputcodeinterpreterservertoolitem.go: id: d45360343c31 last_write_checksum: sha1:86240a8ce3aa91dc89909bf51c68faf1af4fc827 @@ -4104,6 +6957,10 @@ trackedFiles: id: 7679908cb421 last_write_checksum: sha1:3928af5061ee65f66b6a14801a2c4445b86f8ac0 pristine_git_object: 19db2546d7fda944fec26e6b3ca590c4505b5b41 + models/components/outputcustomtoolcallitem.go: + id: 5d463cd730d9 + last_write_checksum: sha1:a68bb4c31086d066b6c8f3d9c9e097e521e09696 + pristine_git_object: a21b33c6dba4346b1a21501ba93d8b6cbe2d75ae models/components/outputdatetimeitem.go: id: b0d073a413d7 last_write_checksum: sha1:42f2c52fac68b2cbc87fb05e9c154e528c5b8276 @@ -4118,8 +6975,12 @@ trackedFiles: pristine_git_object: 465159bfc3561738d4c62db350dd4108c48c21ef models/components/outputfunctioncallitem.go: id: 0cf73fdb6a42 - last_write_checksum: sha1:8a6a312520283a82e381c843ee95d59508183406 - pristine_git_object: 4bddecc110329c112acba2871fa7fbbb30aea5c9 + last_write_checksum: sha1:fab6fb0b6ba5318675ea5c821a7f8296ed502674 + pristine_git_object: 95266edfde27383058c25d408011d94c0633b83b + models/components/outputfusionservertoolitem.go: + id: 6feb234fff56 + last_write_checksum: sha1:f630970d7bcbd640d1eb8d272ab2ad3132e94ec8 + pristine_git_object: daaca2f894214f9786f63636ef2359c62f5180ee models/components/outputimagegenerationcallitem.go: id: 88c7154213e2 last_write_checksum: sha1:407703dda084eeb495f321a3130e8a4ee1cb5078 @@ -4134,8 +6995,8 @@ trackedFiles: pristine_git_object: 997a665ad351c9b2388eaf0592af430c86f961d3 models/components/outputitems.go: id: 4e6d9de43717 - last_write_checksum: sha1:a2e083c6096a5772f923417e22df6031c7dda4a0 - pristine_git_object: c1479c908082c90c33e68b2609f16d72b4c00174 + last_write_checksum: sha1:81f83b006ca198f3a5d69fb034cac49ab5d22c8e + pristine_git_object: 9536c27664f563d1cf1f5ff8332b29dce2ddd884 models/components/outputmcpservertoolitem.go: id: 2c97b528fc50 last_write_checksum: sha1:c58a71a2f773c7dd32d5181266354a79df6b1bb4 @@ -4154,8 +7015,8 @@ trackedFiles: pristine_git_object: 9ac19817dabb56aab388fb25991515978929c985 models/components/outputmodality.go: id: fca98ac51995 - last_write_checksum: sha1:dd670edd0e0bb4ea4f2df538b03ee2c1723ec26f - pristine_git_object: e248871ea85e067f1ac3842c9805c0c55377be81 + last_write_checksum: sha1:8e89e1cc5266132a2eb385e0d053803f97ec3812 + pristine_git_object: 3edcbcd76051dc5c36eb72de3c0d0f37b1419cf5 models/components/outputmodalityenum.go: id: 91b4c1f44860 last_write_checksum: sha1:17bbbffa64e043bb4d5881db1eab914621b4011e @@ -4168,6 +7029,18 @@ trackedFiles: id: 9acd87b5c614 last_write_checksum: sha1:9769e8ee50ba461833c10a4dbbab7763f55f71a4 pristine_git_object: 5f6afaa1a8a1001a0aa92b55c138f359fb03a711 + models/components/outputshellcallitem.go: + id: 99b35f4feab8 + last_write_checksum: sha1:33df07105d0b6f882ed915d946af237f86b47abe + pristine_git_object: 873bc989935d1389365eef9a6e0e96501891aee1 + models/components/outputshellcalloutputitem.go: + id: 0148de32faa4 + last_write_checksum: sha1:eb6365f057eeba9a6934255b4d6b5e3a87c55149 + pristine_git_object: ca228a989b19eba671e6451ad721b033f4940cfa + models/components/outputsubagentservertoolitem.go: + id: 34caaa52aacd + last_write_checksum: sha1:1a0a803dc5df1298b1311d5fe26d78c6dacda793 + pristine_git_object: 9cf56fec2545ccac79710be3d1b592cd06a2642c models/components/outputtexteditorservertoolitem.go: id: 95309e98e767 last_write_checksum: sha1:e7d401ae51b56c4ba059934c2f65f057cfc8f035 @@ -4178,16 +7051,16 @@ trackedFiles: pristine_git_object: a6b79c5f5528f29b369264de6bd39306adc777cc models/components/outputwebfetchservertoolitem.go: id: 7e43b62b570d - last_write_checksum: sha1:574d62125757d25ad7754f662f8616781a16f9d3 - pristine_git_object: 9303e87324ac175b58f918d74aad1410f99e81a8 + last_write_checksum: sha1:49dd5027e9d314568c1565ebcf8c9adc912a4a7b + pristine_git_object: efd3b54929f1c48b4a809aceb1dfe62463068e18 models/components/outputwebsearchcallitem.go: id: 4ce600afdb11 - last_write_checksum: sha1:45fd6b7b4d950fa939f0a108b624cb73e6b7df06 - pristine_git_object: 071a28a0548be403ff18fdd1eeeebc6dc4f42d56 + last_write_checksum: sha1:3db3096c5945dafd0024e5d7f85696397a495719 + pristine_git_object: 881cf83ce1213f747c8792dff7c24c828df70be9 models/components/outputwebsearchservertoolitem.go: id: bf384c5d5af9 - last_write_checksum: sha1:6cc8c6c8ad08b53659e8f8f7caf94f14c81cb975 - pristine_git_object: 81ccc88feaabf41ef516b6f8b5afb5274f1891e2 + last_write_checksum: sha1:88e45fc758195f80b2ced1b3d45390bcef1cd9f9 + pristine_git_object: 0d8d3517da335b8ecfc411413b291da5237cb26f models/components/parameter.go: id: ca048c27e6ea last_write_checksum: sha1:e9d7091f949947726bbebbd1da6bbcd05c49f733 @@ -4228,6 +7101,14 @@ trackedFiles: id: 1bb3a7374b22 last_write_checksum: sha1:bb106e3b25a00a549908e0eddc8aa66a3db5ce46 pristine_git_object: 36d312482275dc1912ade39d47402395bb2a8ae4 + models/components/pipelinestage.go: + id: a504cfa05908 + last_write_checksum: sha1:a8a121f6d3114c84ffa96d99435010802106300b + pristine_git_object: 62e16fffde35b2218526ebcf7e0b79bcfc99da90 + models/components/pipelinestagetype.go: + id: 929395c403db + last_write_checksum: sha1:dfa84ab1c6e6115219c12270d1563ff95fed9997 + pristine_git_object: f1c90d5c2b10642aa80e15612676db57fb039252 models/components/preferredmaxlatency.go: id: 5af0c96d12cb last_write_checksum: sha1:02b67538a8ada5c3fff979a3e8a2d85fa0807797 @@ -4236,22 +7117,46 @@ trackedFiles: id: 8831a9efccc1 last_write_checksum: sha1:0a52e927c67fbe79d35367e7771efbce5a3ea078 pristine_git_object: b97a7e81e162fbecff0d784381da7bcdfe055200 + models/components/preset.go: + id: de5a249a4fb8 + last_write_checksum: sha1:0534f00c0b0d7f5031a14f5eaea8ccc568be7e0b + pristine_git_object: e4b473e5290e1475d5505ada94abcd0513a2865c + models/components/presetdesignatedversion.go: + id: 0f8b3af73c94 + last_write_checksum: sha1:98d9b7edf7addd1607092289239d3098241ac5df + pristine_git_object: 8264fac62a8f6ac91f4080f66b3ac9671345579f + models/components/presetstatus.go: + id: b36559420407 + last_write_checksum: sha1:a78352304065a1b85180ecb66afcdc60b2d50ec1 + pristine_git_object: 3ea7a6e65e7978696ca043b7d6dbb4aba43eb6e8 + models/components/presetwithdesignatedversion.go: + id: e8156693b948 + last_write_checksum: sha1:31c6d78339768be38dc6fa3910a2f67288ee2f53 + pristine_git_object: d12c240e484519e08dcf594aaa48e53219b64f41 models/components/preview20250311websearchservertool.go: id: 2b4bd0b8009f - last_write_checksum: sha1:10a47ca137c10b5a3d672d0a44dbf2d0594337a8 - pristine_git_object: 5551064b7b13c967efe77a0581215ab1f63a08d0 + last_write_checksum: sha1:3573c046f1d9ee182168e8c3ef79d837ecb57ce8 + pristine_git_object: fc6f40e0be51c48bca9606315fa9476ef707b224 models/components/previewwebsearchservertool.go: id: a53edaa8bc47 - last_write_checksum: sha1:c931ce152afc94d010c5cbe87522b4869293b4ee - pristine_git_object: d553bf540c0cb6f122511919e4aae41a366dcf44 + last_write_checksum: sha1:a1505f78c4b50ebc19d874e878b47891e9051e18 + pristine_git_object: f22d7fdfc493cb6cb5b1cfc377b54a4085af84e7 models/components/previewwebsearchuserlocation.go: id: c4cfcd741d0b last_write_checksum: sha1:b22b21f5e3b7584e5c68f03844de38166c2eda9f pristine_git_object: 9c5052dcbd4085210d64680aa3f0137c5f8ee116 + models/components/promptinjectionscanscope.go: + id: 2b74f62f377d + last_write_checksum: sha1:bba9e34f8560668ad9760e9d72157ff160c0c8f8 + pristine_git_object: c50b74b336dc92f3e72e52d5e3954ae9554aeee1 models/components/providername.go: id: 7ecf3a6869c5 - last_write_checksum: sha1:56b181e791445146599e32434e8a20a801e560ee - pristine_git_object: 8af92d73a76cf248418b6a8339196c340a3d7c7f + last_write_checksum: sha1:695536e62b7f1d91f6514aefa92b1eb9b2d246a8 + pristine_git_object: dd2b81e07612dc36a68bc9388ca5c00e1a421d16 + models/components/provideroptions.go: + id: 83f8e5feb563 + last_write_checksum: sha1:8d02af78fb872011e23285b2c9ecb07fd13715be + pristine_git_object: f0b3640b6599a921fb838ff8a8eead39bfe89da2 models/components/provideroverloadedresponseerrordata.go: id: 4e228708c428 last_write_checksum: sha1:4ecd1f1efbdf106340872d720ebb8bb9891be205 @@ -4262,8 +7167,8 @@ trackedFiles: pristine_git_object: 5295c003fb6584b1f083d07ee052e13913b55b58 models/components/providerresponse.go: id: d7f4a6aea47d - last_write_checksum: sha1:e06940cc00509913a9d0da8ed4b01826d34ae565 - pristine_git_object: 7d98e1a0cad6ef36100d2563ce843420baa8a3f3 + last_write_checksum: sha1:a318d1cb76446ee0fc5e545a2f1eb86b8af91921 + pristine_git_object: 78d4b9d2645335ca7e1b004db3a524878ce0c7da models/components/providersort.go: id: c183c158e614 last_write_checksum: sha1:d56d1125483e113e3f1c1cb7dc566ef0837b485e @@ -4284,6 +7189,18 @@ trackedFiles: id: 601f1d07ead7 last_write_checksum: sha1:6908b4e7f3d9ae701504858de96ed83e5d9e9283 pristine_git_object: 294b4f82f847f0fc7f4a5bd6ff7be54ae068e5ac + models/components/rankingsdailyitem.go: + id: 47e0cc69ff3f + last_write_checksum: sha1:68a7f9474646f624844eed7e18417184ec5b2a01 + pristine_git_object: 0a8d025b60a3dba14a86289d591110cb4c0400ca + models/components/rankingsdailymeta.go: + id: d0c2cb42ce3d + last_write_checksum: sha1:b05d211822432dc508bf724fea760a4c5119b5ca + pristine_git_object: 6e2165f6315e2a61156154b4075ca6084da41a5b + models/components/rankingsdailyresponse.go: + id: b8a75b19d5f1 + last_write_checksum: sha1:ee9d06122a16393c69ced94f4199c7b1e1cd7465 + pristine_git_object: b4835e6e36f264ecc9137509309ddf689a8ee82b models/components/reasoningconfig.go: id: 2dcb89d1b461 last_write_checksum: sha1:1ae7205f4b8b04f56f02e84f2f37b00a0ed49b87 @@ -4382,8 +7299,24 @@ trackedFiles: pristine_git_object: 3cf92771c9f58c8259dfda5ea5d91161d0c84519 models/components/responsesrequest.go: id: 3fbf1b29b488 - last_write_checksum: sha1:4c5f38a7c5f6084e311ad99b90f580d941293b8b - pristine_git_object: 568695edba63ce144695bf78267fde7791161210 + last_write_checksum: sha1:2625bda6a167a8e245c044007791a4743bb622a8 + pristine_git_object: 0c731d2c68dd2d105351129664afbf8286c0e8c9 + models/components/responsesstreamingresponse.go: + id: f5d13584dda6 + last_write_checksum: sha1:3d7a6b79b2e44dd826d2a0521c1c8deac009e13b + pristine_git_object: f0261d23c3583aac3cb4adc8649898812aefd678 + models/components/routerattempt.go: + id: ea8721067f84 + last_write_checksum: sha1:d060e192fae82c13cf52f5fcec30d00891ece0ab + pristine_git_object: 8a9b5d2e5d23b0b8a0e6226a5f8a789e9adab2ec + models/components/routerparams.go: + id: 51d91753b81e + last_write_checksum: sha1:5510df1aa482fe9aad5968866e7d520a80081518 + pristine_git_object: d4306ce9e1b99bb133e926c808bb5ee80e1e8ca1 + models/components/routingstrategy.go: + id: e949c36e1173 + last_write_checksum: sha1:8f2423ac7d41d69e2a85db44eba14623fb1ae6ab + pristine_git_object: beb898dfe762b0643b40c3244d8a6527983ef96f models/components/searchcontextsizeenum.go: id: 548a9f82f01b last_write_checksum: sha1:e5a55817b6f6922a0f6d94012de27fca4e0d3e97 @@ -4394,8 +7327,8 @@ trackedFiles: pristine_git_object: 786a805dcc2d395f4f65a947c95dab265c1d2e6b models/components/searchqualitylevel.go: id: 8b0df2f57fb5 - last_write_checksum: sha1:43fd41d5766b2e544f56f553229f504f156f88ae - pristine_git_object: 6a823937032762cf0529cda019813f5feae936b7 + last_write_checksum: sha1:d49bdfed3ecccc00a501d5fc5079a8b999c0ccab + pristine_git_object: 26f48323e292d7f6a8c45434d5457818380d76c3 models/components/security.go: id: 3a5eba5fe9e0 last_write_checksum: sha1:ba147a49efdcf0ada3f56c0bde50f3ec8ec4473e @@ -4404,22 +7337,74 @@ trackedFiles: id: e8859fa947ae last_write_checksum: sha1:f5b26e3f5f7441e79fc9cd0eae45d35fc6cc84bc pristine_git_object: 452e72309788f02528a0b0b573536d188ece0a1e + models/components/shellcallitem.go: + id: f65140825a15 + last_write_checksum: sha1:3a20f36bbd2f36c184fe442119a9c91e5239380c + pristine_git_object: 5f64a9e6a51e4d689b49761475c05a5702354239 + models/components/shellcalloutputitem.go: + id: 74c1673d40cb + last_write_checksum: sha1:dffaed961663bd47ee3c783ea86dd5878455f905 + pristine_git_object: 6c97c8f1717ac2f4a423b85d670590ed22f56c44 + models/components/shellcallstatus.go: + id: 7037ac712ae3 + last_write_checksum: sha1:b1caf665be7cb8e720ad1e8d4f36ad193843e189 + pristine_git_object: 99e7ee4c43fe2411b4e1b8c98272ce0980617ce4 models/components/shellservertool.go: id: a428f350e455 last_write_checksum: sha1:9254bcf2e1986aed14a8d3b32980a443c2a6077a pristine_git_object: ab51cfc61d6b39e99a87a9ddbde3ab72a14c2cd0 + models/components/shellservertoolconfig.go: + id: 3f0a845ace3c + last_write_checksum: sha1:2342ca012af6b132155b2ef9ec9a7ec2f53c779d + pristine_git_object: ca3afac5d2d1cef9f458c7bc8b85a21c05cf7423 + models/components/shellservertoolengine.go: + id: 5a523fe6e866 + last_write_checksum: sha1:f08a4f8aa485bef8bf8bfe58e7918c331624d19f + pristine_git_object: b00e191bfc349e7bc13bb43b2a16eb42bb6c1c0f + models/components/shellservertoolenvironment.go: + id: 1e95910b0f7a + last_write_checksum: sha1:5c75ab682ff739152eca43ae97b3a7e132929d7b + pristine_git_object: 6a3715e4c054abd86601004cf04f246e4c76b9aa + models/components/shellservertoolopenrouter.go: + id: 39591930569e + last_write_checksum: sha1:63e7ab8c1ed737caf24e9d682054667d59a39c5f + pristine_git_object: 696bbae97193bc399544e814a3e9d99a24522909 models/components/speechrequest.go: id: c5f83d3285eb - last_write_checksum: sha1:5e78e2cc071500efdce1df625ce8161ca857c3d1 - pristine_git_object: 059cde13a56877a2777dd0043b8b928b69b92071 + last_write_checksum: sha1:91df23f2e273b23983fc0955b1432d9b8596d3d6 + pristine_git_object: 45925c3ef367f98ef2ab6c5450f7c347f50084e8 + models/components/stopservertoolswhencondition.go: + id: 6c12d61377dc + last_write_checksum: sha1:600037f2c92bb83b31cc6469a5ce9a169ee82b09 + pristine_git_object: 612a6e5e1921affddcea3eb482934eb7fd25c5e3 + models/components/stopservertoolswhenfinishreasonis.go: + id: d3250df2eecb + last_write_checksum: sha1:fd8a6689a06192c9cf4cfc9973f6eb239aab8b47 + pristine_git_object: a6d7fd06a67eca2eaeba68ceb0baf293dc0135a7 + models/components/stopservertoolswhenhastoolcall.go: + id: 47a008bc223c + last_write_checksum: sha1:a0c982be4c7d8de18e8d939e19a4e2c8cece5848 + pristine_git_object: c2521ffa2af921fba52055d8785a064aafdecf07 + models/components/stopservertoolswhenmaxcost.go: + id: 43a5eea145bb + last_write_checksum: sha1:6d9c01d85fc2883dd8fa71ca04fd8ec6151ade50 + pristine_git_object: 4255057249bfee790bb51a35de6c83c3bc564c73 + models/components/stopservertoolswhenmaxtokensused.go: + id: 7931fac89569 + last_write_checksum: sha1:ebf26653d8579b6640200a474b5bf12bd2ddc435 + pristine_git_object: ff512d8c42f29042395568c12c30c4734053e49a + models/components/stopservertoolswhenstepcountis.go: + id: 167e02781a80 + last_write_checksum: sha1:7b5dd8b2870862b3806855dd9a6dab16b1969aad + pristine_git_object: 522d4b3d6a1fc83fc02cff40d4fbabb204550be1 models/components/storedprompttemplate.go: id: 56707ee57256 last_write_checksum: sha1:3309923d8936939196ab4b98fe0172574c73f534 pristine_git_object: 25117e63eff21537e97558a7bc7b4a8a57adaa54 models/components/streamevents.go: id: 35976ae7fd7e - last_write_checksum: sha1:ff886b6ca020460fe0cd5e5e23b8c0c5bf65b06e - pristine_git_object: c6da724da7220a39a26dc999cf09796ef241c6c2 + last_write_checksum: sha1:3a0f5e21adbbd56b2c0884856d6c861775aa3e90 + pristine_git_object: 4bf54407534706d8579e117178864bc948762968 models/components/streameventsresponsecompleted.go: id: 99336b4906b3 last_write_checksum: sha1:ade5a8865c22b50b3101ec4c159a702e2e553643 @@ -4434,12 +7419,12 @@ trackedFiles: pristine_git_object: 448cb03e1ebc450ebba8cfd154f77accc0e9a36a models/components/streameventsresponseoutputitemadded.go: id: 8eada275f56c - last_write_checksum: sha1:cb0d93ee8054c6e0165bf1f9e8f7c8385d38214c - pristine_git_object: 1f6ef081533f51a1b51cf2a4723da81f0a688cfb + last_write_checksum: sha1:f58295acadca42e8719f849c3f57d32b60e1cc9f + pristine_git_object: 46ed9fd8d5cac6433fa6fd32a808b06673597407 models/components/streameventsresponseoutputitemdone.go: id: ec41484eeddb - last_write_checksum: sha1:b93e30cf69dea8feb049e0388abedf9a727e94ee - pristine_git_object: 694b4feb7889e35684b46a3e2418950f030be009 + last_write_checksum: sha1:d04bea74f560d88270090e7f720ababf6e7d29df + pristine_git_object: 0b0cade7bc057ed12c5df851a717288e0299a040 models/components/streamlogprob.go: id: 9ee5a87aae0e last_write_checksum: sha1:ef5fbcdfef3eb5f84e52d76e5f88482520ea8bbf @@ -4448,6 +7433,38 @@ trackedFiles: id: 316c58cdec29 last_write_checksum: sha1:6979cae2a13203f4ff81a1f79ab98e7d83d6e216 pristine_git_object: 600c3aec2dcfffcb2842a553e496eced534f5b66 + models/components/sttinputaudio.go: + id: 6d45969ef45c + last_write_checksum: sha1:6b013bd531544681f08930f39b7ac8ed8fba4d2f + pristine_git_object: a9a3a6b0190833aa00b539c335aa763d8a826525 + models/components/sttrequest.go: + id: 307b6fe641a4 + last_write_checksum: sha1:7365eb3e30c5bf71283fd8d959654156781c111a + pristine_git_object: d54ad24703ee310fcce1c5d9b2f2c6dd6551f6d1 + models/components/sttresponse.go: + id: 7af2c26acdda + last_write_checksum: sha1:a4b1f5e894f1a38e4cbe032f420c4fce3e516f8c + pristine_git_object: d3ba173980524a801eba88bf5402fd32f16b03b9 + models/components/sttusage.go: + id: 8c9fc44ab6ba + last_write_checksum: sha1:b36822eb6077462b082b997927c571cc08580c06 + pristine_git_object: c2794e7a6c13d0b0d6b8febc31083b4573a64e8a + models/components/subagentnestedtool.go: + id: 2970b4baa28b + last_write_checksum: sha1:60e17add4fa32fa30c1bc3b2e602e7b1520800e9 + pristine_git_object: 5149eb70a91f2ea5f2b84be607794051ad907f64 + models/components/subagentreasoning.go: + id: 3df30637fe69 + last_write_checksum: sha1:d454fa724171bc1b3efc17bb98ce131fa3da7c94 + pristine_git_object: dd46843901d96196196a86a5f569d1d3271f7926 + models/components/subagentservertoolconfig.go: + id: 5232e3c874e6 + last_write_checksum: sha1:9dbedb3f519978a85bc605dddcef86701f897179 + pristine_git_object: 7fe309d4677c5a7a611bd5682a5aa06d54c8f557 + models/components/subagentservertoolopenrouter.go: + id: d1d25913d484 + last_write_checksum: sha1:cca047030738c9a9dd88d09ae58f64d5b1a81a28 + pristine_git_object: b3e5b747c8195cea63581f3fc1dd068df8a512b3 models/components/textdeltaevent.go: id: 325b05d9f7a2 last_write_checksum: sha1:99ee62814528e0453c96920c3f515fd12235ae5e @@ -4492,34 +7509,50 @@ trackedFiles: id: a8d1dd41f07f last_write_checksum: sha1:f530d32e638af837f70983e2ea2d148942b7dedb pristine_git_object: 852f8b460e18ce4dbe411fac180b9f990304b26f + models/components/updatebyokkeyrequest.go: + id: ee4b2a330801 + last_write_checksum: sha1:b1a0d6b107ec6bf44156aa5218738473f4e0412a + pristine_git_object: 7f59ea38515f86c7624d1df2e46c96ed0243c2b7 + models/components/updatebyokkeyresponse.go: + id: 13fca4036cb2 + last_write_checksum: sha1:274b66cd5e9faaf66cb1f2bfa2d4f2b1f0415cfb + pristine_git_object: 4184d457a1439036dea36e081982c7fbf26e3635 models/components/updateguardrailrequest.go: id: 0a41a686a6ba - last_write_checksum: sha1:900e4623f4ae5df3ac332574b655a2ead0a511eb - pristine_git_object: 3fe7b87920f1cc802ed7fcfc0b1b4fbce094191a + last_write_checksum: sha1:bf815abe1c1d439be0edc49cd52451293b321fec + pristine_git_object: 89b3796e4205085fd85bc5143c9aa398faa2493d models/components/updateguardrailresponse.go: id: 5a3580ea8a15 last_write_checksum: sha1:e17b7dc763b86b36d0ee259e888303506f220c9c pristine_git_object: 01fc59740a9602a907e838630a85a10bcd44a522 + models/components/updateobservabilitydestinationrequest.go: + id: 8539c3368b29 + last_write_checksum: sha1:23f6477cfc6c91f3e6cf3d1ef0533d1e6d2812d3 + pristine_git_object: 43b5dd3a8f7a57838c05421e887a5838cbaddc4d + models/components/updateobservabilitydestinationresponse.go: + id: f4487a08e3af + last_write_checksum: sha1:251cb54f2643537c0e13f0914604887e3fbeb58c + pristine_git_object: 32b614e8c3843f8fcaf8c2dcd742f75c9a91db7e models/components/updateworkspacerequest.go: id: 056999cd6eac - last_write_checksum: sha1:82e99d770f972446dde565018d628dac9982d663 - pristine_git_object: e7b0d50daadb9378ded61bde01bafa04887f2a07 + last_write_checksum: sha1:b92d11493339f09607a35fefca38babd84416751 + pristine_git_object: d43f9f28bc3b52b9fa3dea4d72435772bbcf2de9 models/components/updateworkspaceresponse.go: id: 878eb246afc8 last_write_checksum: sha1:cb1883a5d50d18a8ec7046dc2b4d8a5ecc3460ab pristine_git_object: c0fdc58cc3b883bf67960e80e21733dc0cf1f3c7 models/components/urlcitation.go: id: 19a2e93fc384 - last_write_checksum: sha1:a98a12fec38c495856a44e3bc7adc496d6db3e0a - pristine_git_object: 15b197f10a22f1a41fc6685a4bd40c86eb9dbed2 + last_write_checksum: sha1:5228e830db457dd3b9178da373cf3470df5f7ba3 + pristine_git_object: f4b994164e03872a8e2ef6d20c8d272dc5861e1c models/components/usage.go: id: 23a67aafefad - last_write_checksum: sha1:9ffb05fbc1ba15c12b534a7d717407b9c1e78ffd - pristine_git_object: aee04f5f5fa142a226c059358eb94252f52872d7 + last_write_checksum: sha1:c1e9fecbf1225ba98121079fc1b1126e16185a01 + pristine_git_object: e97f0f8d1507e076871b9c3644c5fa556157d209 models/components/videogenerationrequest.go: id: 11162ee57e53 - last_write_checksum: sha1:e91d9bed2c542258f268652b983e96a95d732ae6 - pristine_git_object: ac89d6dcbfdf54207bf1d1821f92004f238367d9 + last_write_checksum: sha1:7e5422d41f412675b1bd63d66c68d85365fd332a + pristine_git_object: a4e976c6fe0099f63c7dc01f45457fd96b4f867a models/components/videogenerationresponse.go: id: 5841b7ef3de9 last_write_checksum: sha1:b1196ebd395a89b9f03ce3207738055473c33532 @@ -4530,12 +7563,28 @@ trackedFiles: pristine_git_object: 514ec23a6598fba1b14a018cf3093c5aa8ce8055 models/components/videomodel.go: id: 4e0a4cdffa61 - last_write_checksum: sha1:15897c52453b139cdc56abd047d5428463e1289b - pristine_git_object: 6e41907210a0d089125fd75dad17ff9d6817d59f + last_write_checksum: sha1:99ec01882aa1e1f72d0cea805eed06d256355ae3 + pristine_git_object: 56467fcb4e624e9f2e88e6c9e30258c91ed0eb1f models/components/videomodelslistresponse.go: id: a416eb7a98ab last_write_checksum: sha1:ac70816ce0bd21dd3730e111782e0f3bba8b5d29 pristine_git_object: 70259b9c16e42c5d0f478fd8a200f1a938182ded + models/components/webfetchengineenum.go: + id: 8824cdb714a3 + last_write_checksum: sha1:202601802ef9df7124caddfcc23d22947944c59b + pristine_git_object: 3250fe526deb4f020edb95d2097a598c34a3d20c + models/components/webfetchplugin.go: + id: 4be5e1f33fbb + last_write_checksum: sha1:868c6c785b431467dcf76e156fc2b8be64ad9780 + pristine_git_object: 3050eb7d7eb726013cee80df550ee4f8850c0d8d + models/components/webfetchservertool.go: + id: 7340116512fd + last_write_checksum: sha1:521650d18eb53ca6cd0b9fc0ab17b651c484cd82 + pristine_git_object: cf522f41796cc04f31f395a3d8fd08a18f6ed1f2 + models/components/webfetchservertoolconfig.go: + id: 10e676bb1d28 + last_write_checksum: sha1:a9e80c960ca6484f66f06aacc62d4cf5bee1832b + pristine_git_object: cedce5433afed5cf5d2eec3455a45b31688f7456 models/components/websearchcallcompletedevent.go: id: b46bdd6f5717 last_write_checksum: sha1:d9f9f992e9e9b6d81644b0daec0041cd5b0fb02f @@ -4550,32 +7599,36 @@ trackedFiles: pristine_git_object: 0e22a51a6c62c03461ebdfc1f6599efa446517c4 models/components/websearchconfig.go: id: d3a34a5d31fb - last_write_checksum: sha1:c7df396302eb73f1b4d08cb4462edb8c84c0e07b - pristine_git_object: 590b815ed12c658d001ce3db3734a76e55464d6e + last_write_checksum: sha1:36071cab545bfaf8030d29b2c5e2fb0a3eae9ad7 + pristine_git_object: 333e61f1e8de2397e770996d1262687cdb85a610 models/components/websearchdomainfilter.go: id: 11d415df43eb last_write_checksum: sha1:3c9e152e302d95e428b5d660ebac948d08ab8ef4 pristine_git_object: 72475ba01cd112bc0712b0d6962ab1c70dfe4caa models/components/websearchengine.go: id: 5ad744487759 - last_write_checksum: sha1:87feb996dfc7954e74875c9904ae360452257463 - pristine_git_object: 06c08605b95ef7d177a3290aac036d8974bab78b + last_write_checksum: sha1:29c80318190eef07c3ba7a678a129f5c19b9278e + pristine_git_object: 0ab31cd502d54f08e3d4b47cfa09aa151bd8f6fa models/components/websearchengineenum.go: id: d441b20660d5 - last_write_checksum: sha1:7a74ac5cbac6f561b368b123105a2d288a8cf78a - pristine_git_object: 70ed40d2dd6a8b15a8e72b10f30fafe28be99fd5 + last_write_checksum: sha1:f3cf510c3ae9a1b9827b4dda1e11a030d8373d58 + pristine_git_object: 3e1a8790286d7115eeee059de32bbf43e38a16b8 models/components/websearchplugin.go: id: 25305e26453c - last_write_checksum: sha1:bc742793c4ba95916d2e601ae0676660cf05ac9e - pristine_git_object: ccf8a5db24ac0292f554cb19c1dedfe0803a32d6 + last_write_checksum: sha1:04780f9c4b2366d325d490338d408ca0c862c1a4 + pristine_git_object: 57d22b299a08aa9b656814c0ac63ff868595e4ce models/components/websearchservertool.go: id: ef83237199dd - last_write_checksum: sha1:26d2582e03d5d3b75aac03c1e3cfdf918868cdad - pristine_git_object: 6867e3acf99c01f38d211f41ff8cc59aa9ce1210 + last_write_checksum: sha1:2852a51161d1eef23dd50a96eff20400789b6bea + pristine_git_object: 566ec60c6cd421e76913a02890609fc71ddfe4d0 + models/components/websearchservertoolconfig.go: + id: e1ffef2ac665 + last_write_checksum: sha1:0f38b4b62cf5eaa484be138f5c4806c391b4a94f + pristine_git_object: 95cb53ce3ddcdc5e84a82c2ddbb0b2688a4f17a7 models/components/websearchservertoolopenrouter.go: id: 94059bdab397 - last_write_checksum: sha1:532a115d69c151e592b78222ccc7fb52359c4eea - pristine_git_object: 6563f52563998cc1d8facf95b64b30a81be9c0b6 + last_write_checksum: sha1:14efe1e2bd4fe6643913542d1e82e3f7b3d2b099 + pristine_git_object: 399930db168bfe11dc6909cf8f7ca2f6fa75ed21 models/components/websearchsource.go: id: d19f35e489e5 last_write_checksum: sha1:b8ea2701df8428b8c9962e9f9850461c8b3cb69d @@ -4590,12 +7643,12 @@ trackedFiles: pristine_git_object: 732d56cb09154f7f6058a02ca30b08ab21688e29 models/components/websearchuserlocationservertool.go: id: 2bfa273e3200 - last_write_checksum: sha1:044a62eee1d25d18b209332494765cf61cd82406 - pristine_git_object: 6417cc487e03618913bdb60016c46b0045eda9f0 + last_write_checksum: sha1:2a1d8ccbff0a4c7b4f53bc4ebc0eaf6bff1904f5 + pristine_git_object: 21c0dbc5870aa4c465dea76620e75bf704ae75ef models/components/workspace.go: id: "5823361002e2" - last_write_checksum: sha1:483f6f0eef000b8423a2f861e64be3138e4813c7 - pristine_git_object: 1eefa80d63cff8bdfa47c5273941e00d5257d01e + last_write_checksum: sha1:91369623426b1e7ac18e9e4c069a92981475274b + pristine_git_object: 8044ae4444b356e1d59eb464fa0e2d371a1cc5cd models/components/workspacemember.go: id: 5565c176e512 last_write_checksum: sha1:815c205fdc5811f38e0e912d616af5ebef9207e6 @@ -4626,24 +7679,44 @@ trackedFiles: pristine_git_object: 9635d93e491d737ff59996e20070aa39d2f8050d models/operations/createauthkeyscode.go: id: ae6ada25c1c9 - last_write_checksum: sha1:ae7a500b762bbf4933807b559dfef24e9ceebf27 - pristine_git_object: 9db75bead769277f2999bbcd818c6d64aa096f52 + last_write_checksum: sha1:6951d9dd6d87eb6fa787a828227287e695bf0792 + pristine_git_object: cac06619023d688ec8e4b00396f120c8e8cf6790 models/operations/createembeddings.go: id: 77f55f6edf8b - last_write_checksum: sha1:f20ceef72e03c3afbfd79476dd9684567c7a5538 - pristine_git_object: e211e6e618b5ac5d40c1ceb26a53446a4befd5c0 + last_write_checksum: sha1:184a5b05deaf4b0054d80cd3e36118ea5032547f + pristine_git_object: b652c506a93a3600fffad2e499fd2325da98b062 models/operations/createkeys.go: id: c511faeda898 last_write_checksum: sha1:b97565974c942ccda2e396ffb7082322b50bdc75 pristine_git_object: d840db7401420200b450483f2120f42a51b0ff4e + models/operations/createpresetschatcompletions.go: + id: 46c66731be0e + last_write_checksum: sha1:fd2b99954de027a6886cbec87c82b789c4313fb4 + pristine_git_object: 213022a85ba25996cb85c888fbc93a79489d123e + models/operations/createpresetsmessages.go: + id: 3daba0e26b49 + last_write_checksum: sha1:aa5b5fb4893a45aef2bc5c1e170bc57dcbaecea4 + pristine_git_object: d243032f2c32d7e8f755f640590e7e086b460a94 + models/operations/createpresetsresponses.go: + id: d13a9d1462a8 + last_write_checksum: sha1:07cb85b8d6a6104066da198c5d0feba41a2023b0 + pristine_git_object: 1c31733f07011e5eed25ae005cf1f46296656095 models/operations/creatererank.go: id: 801e27951edc - last_write_checksum: sha1:ce4446a87a91a51c841a2f05a2308610b00e8426 - pristine_git_object: ae60dca13710864bb49d1257ab336e863df1cf13 + last_write_checksum: sha1:efb15386e0309752f028f433ed269cb7b6f65741 + pristine_git_object: fdd9b9bbbc15a72fbc1ace3f2bd4198b27f1e557 models/operations/createresponses.go: id: 6450f3e4367f - last_write_checksum: sha1:2c45474f62588019068483b535a303e9ea5d7e87 - pristine_git_object: 10270c55e464f2544e1c4010b7efbc96f49614ab + last_write_checksum: sha1:30c8667540bc663ff61b8f6375cbac8b6bbcad36 + pristine_git_object: 6d5628d5d80170a05b8ad8988100dfd58548a2a4 + models/operations/deletebyokkey.go: + id: 968ef972d685 + last_write_checksum: sha1:66ad3c165bd3fe9757b39169742ff849eef7267e + pristine_git_object: b8d0012e682c294b06a771d03e2386a1df30d46e + models/operations/deletefile.go: + id: 15ca30b82fbf + last_write_checksum: sha1:f158e4d348a01caa0d0ea14aaf69745136283d3c + pristine_git_object: fc043c118ab0aa51e2be0da6eafc853162bc815c models/operations/deleteguardrail.go: id: 7492c5b1260c last_write_checksum: sha1:ebe85cf6c6331cf3057bff0ed9751208932b7d72 @@ -4652,14 +7725,42 @@ trackedFiles: id: 46ce5eed1bdf last_write_checksum: sha1:712b09428206c69249618439b3a78dd314572b14 pristine_git_object: 7402272fce2b28393af4679521df3a304197f665 + models/operations/deleteobservabilitydestination.go: + id: 75525e08a348 + last_write_checksum: sha1:1becf47af89535f95d2253ffccb6fd88e55ef423 + pristine_git_object: 86343c9e7ccec29d39b9c68480d59f997e98cd8e models/operations/deleteworkspace.go: id: 8f02b59b9869 last_write_checksum: sha1:6c0181481749af01be3d10d14d42c2ebd02dbde2 pristine_git_object: 20af63dfd842ee929546ea2d4f9060e39aa85e9c + models/operations/downloadfilecontent.go: + id: 0687ce8cf88c + last_write_checksum: sha1:40ba42049cbdfc0fe1c95c34189f9009089c25ab + pristine_git_object: 8b43da5aeec1c4188fba70b600a9fb03313aa58c models/operations/exchangeauthcodeforapikey.go: id: 2bddcad643b8 last_write_checksum: sha1:fe2203ecad32f8d8d7b43fe7f5058bb35f91dbbd pristine_git_object: b29bd8981d33ecaedd7a0991003986c0e4180a4c + models/operations/getanalyticsmeta.go: + id: 1085525e846a + last_write_checksum: sha1:363cc3d766c3b4f04ca031fc305b8c89668050a2 + pristine_git_object: 0e98c37a2f70fbb5460a8c1b8805faabde354035 + models/operations/getapprankings.go: + id: 377b248e469a + last_write_checksum: sha1:e15fefa4f49f20d2cd313ccc59568f4a753d4725 + pristine_git_object: 8c787ec067a86e068505e4d2419527601e8cbb3b + models/operations/getbenchmarksartificialanalysis.go: + id: 52f387af0664 + last_write_checksum: sha1:591b12f7a81a8ad1143b6cd2b8417660c8a92c4a + pristine_git_object: 89ace9fc72f7cce42194755da3a969390598297a + models/operations/getbenchmarksdesignarena.go: + id: 99d2e8076edd + last_write_checksum: sha1:e0863c6ba2d3c57ce08b41b50750ab67ac76e1a6 + pristine_git_object: 1034b8ae328e2d663d9f3df1136f17915a0cb158 + models/operations/getbyokkey.go: + id: 6ca6d60dc861 + last_write_checksum: sha1:879b9d77c0f853eee5a4454c8a2acec05a1da3cd + pristine_git_object: bc7defc685a3b8c9d69ddf7d1eb5e3c5c93567d1 models/operations/getcredits.go: id: 956813e76390 last_write_checksum: sha1:af37dfecf13091c063d67d4c05fbbfa3ae805c16 @@ -4668,6 +7769,10 @@ trackedFiles: id: 86ac716d02ab last_write_checksum: sha1:05ec3c8b9057777e0de8fec96194f644b03c9784 pristine_git_object: 812f7b0357b7eaa4ac655664e8f6784c76cc16fd + models/operations/getfilemetadata.go: + id: ac54c1bc940b + last_write_checksum: sha1:e543af6ee70755065c7510c38bddb1009c9f9221 + pristine_git_object: 73ebb9d9d62cf9891b369f727aefb107ae14b991 models/operations/getgeneration.go: id: d287e56665be last_write_checksum: sha1:d28128adba24462862e4a1c9870cb71bf0980713 @@ -4680,10 +7785,30 @@ trackedFiles: id: 69bc377378e8 last_write_checksum: sha1:091dde8576cf682d8a758ea5515458716c390bf4 pristine_git_object: fb35153d398e5a8b57cf42338f438d98a457bc70 + models/operations/getmodel.go: + id: 5328e62e520f + last_write_checksum: sha1:118d0f12c2754ffa81426e4291df6135f47786f7 + pristine_git_object: 421d88083f3b8a66360e11982e797b7fd15fd63a models/operations/getmodels.go: id: da5a1f2b68b2 - last_write_checksum: sha1:152ba5a252eb08182a835c66f615ebb14ade5409 - pristine_git_object: 01d6368eb111bc188f90bc365aace21b0eca1703 + last_write_checksum: sha1:a04e95ee11a18b5041d20d6addad60ed1d726110 + pristine_git_object: e837fd37fb6fa5e8950e24ba88caf1805c9e54ec + models/operations/getobservabilitydestination.go: + id: 1cbf1f722967 + last_write_checksum: sha1:95a9bc65f19d20af5b6311eef329e1e0e9e4737d + pristine_git_object: 01da04e0c83b37562ea6426193302be4dd35d912 + models/operations/getpreset.go: + id: 1da7b78cae37 + last_write_checksum: sha1:8e3d7730b203b2f3be3e5f70cbd74045c36e85ee + pristine_git_object: 66edeb3135286052829fce071b68a5eba4a200c7 + models/operations/getpresetversion.go: + id: a7aa986954bc + last_write_checksum: sha1:35373f374911c0e1a98d1c1020919b9bb8e44bda + pristine_git_object: f3f2f28f8d5fb9d72e2823c147bd1f4fff76ba8a + models/operations/getrankingsdaily.go: + id: 4885c4c3bd9f + last_write_checksum: sha1:a0d6a3f4d142d2195eb361f935bdd6b9568e5ef2 + pristine_git_object: 9b635c46b61a66a0706eb2137854f0db2d03541d models/operations/getuseractivity.go: id: 8a5bc3bac8e8 last_write_checksum: sha1:dfa64fe3a0d92f466c58dc8f11172d1951e2d5ef @@ -4700,6 +7825,10 @@ trackedFiles: id: 5327f0e32b30 last_write_checksum: sha1:f9118558c29d4ee94c2f21cb1126a75d801dd4fc pristine_git_object: 7e8658b39f97e1dfd660939cf59ae0727ae997ba + models/operations/listbyokkeys.go: + id: e40d557d5875 + last_write_checksum: sha1:a74390a0df202fb0e25372fc1f7c52950c27fa10 + pristine_git_object: ce8aef28ce3b41e715c285c34461a131fd07c22f models/operations/listendpoints.go: id: c56c221a535d last_write_checksum: sha1:a233c86cd9e267260fc2f3d33dc8990b805aec53 @@ -4708,6 +7837,10 @@ trackedFiles: id: 340c80c701c2 last_write_checksum: sha1:369fd60ffdadd9a633f3b5086ef9d04c3a1e85c1 pristine_git_object: de2caab374aa9b4b1e8378584e425e4f3a6b252e + models/operations/listfiles.go: + id: dc325e3fde5f + last_write_checksum: sha1:9b950988652e9f17aaf7f3c07aa5861c8ea819d0 + pristine_git_object: cf44caff15e734fe072e8cb8827b861b20069cc7 models/operations/listgenerationcontent.go: id: 149eb7889943 last_write_checksum: sha1:ae48d897d46b1860873e762afa0259675f3375f7 @@ -4740,10 +7873,22 @@ trackedFiles: id: c454494b1752 last_write_checksum: sha1:51e03be99e43d4d8a6bbded7decb9d499b88b081 pristine_git_object: f897bb72f99fb19ca24fdf2739ccade747bb2860 + models/operations/listobservabilitydestinations.go: + id: a7bcd0598f86 + last_write_checksum: sha1:4e422ea01a39d32a1ade6f4935bcdd03b3f93892 + pristine_git_object: 521bdf2a0b8067a23d84e7955708bbaa081d0da6 models/operations/listorganizationmembers.go: id: c16eeed2ad6f last_write_checksum: sha1:cb1905c9908c17123c1298ac96b3a4e51a5fb54a pristine_git_object: c99c455e60b33ccd21fac2f910a7f3e008ffec14 + models/operations/listpresets.go: + id: 436c26ebe332 + last_write_checksum: sha1:e52662bc83d960e23759426ba6d5fdadb12a4d08 + pristine_git_object: ddfc1c4685ecb6005788c9a459d9285d4ffc9c41 + models/operations/listpresetversions.go: + id: 0b8ac6a6f962 + last_write_checksum: sha1:c316bbf89c01f8bf40013854746b226afebf6794 + pristine_git_object: 85b3599c111671c8ebfe743a29ef0492f633629c models/operations/listproviders.go: id: b8e74508ff52 last_write_checksum: sha1:ab861d3e3d64a9656f1da67473948e9a9a9e53ec @@ -4758,12 +7903,20 @@ trackedFiles: pristine_git_object: f1fa3893ba9b432e40eec43270b33823fc5b0880 models/operations/options.go: id: d20dd4db9865 - last_write_checksum: sha1:b83fa7276430e5b08a489b8e93df86d445d52f84 - pristine_git_object: 40355c9bf6d51a67819f9d3481b5c87e86585c5f + last_write_checksum: sha1:490c044328a57e53019ef1e2a97f27a26dd6e958 + pristine_git_object: f95b33b0def230101497eb79b18187d30cb5f19c + models/operations/queryanalytics.go: + id: 988cd2db88c0 + last_write_checksum: sha1:3bf7ed1cbcf1a3afd58f9e8ac0e998efa10b02e6 + pristine_git_object: 98e489c1b84d287980dff11f20f3d4b6dc8d1b38 models/operations/sendchatcompletionrequest.go: id: 9da92c1f7b53 - last_write_checksum: sha1:f612d8cefdce54de7137cca804c2967d449d6603 - pristine_git_object: c53221d0760b5b94946b1495df0521c08964e96d + last_write_checksum: sha1:71b2e7bd747a68d78fbc663d101b0f037e608759 + pristine_git_object: 33f53b6f4b818e200a1084ee76be6eb34d40cc0f + models/operations/updatebyokkey.go: + id: ca59c2a6f790 + last_write_checksum: sha1:439549009f560be6ff40542adc19c9ff812fa2eb + pristine_git_object: f5af8797b9e96618655d8e4a59bcc96d00204f2f models/operations/updateguardrail.go: id: 91384d66e9d9 last_write_checksum: sha1:4fa2ac4f720341443020c99695abecbbd9367cf3 @@ -4772,82 +7925,94 @@ trackedFiles: id: b9d605aa7df2 last_write_checksum: sha1:677a91b394046b956d8bddb8451905a5fa293f70 pristine_git_object: bc4a68c72ce287d6edf25b049a5774b787ab7b6c + models/operations/updateobservabilitydestination.go: + id: d288ea102434 + last_write_checksum: sha1:b4741c8163851ead75a9b63f1272cf4c1b5195cc + pristine_git_object: c8d3a3b14f05e1960d8fde6989c54fd9ccbfc34c models/operations/updateworkspace.go: id: 934a2a29355f last_write_checksum: sha1:6dd2f10642a3db5001743d01ccf3e2969840976f pristine_git_object: f5710fa2d26c55482617d152ca4ba2fec5e7b6de + models/operations/uploadfile.go: + id: 7cc87dd76f89 + last_write_checksum: sha1:b4f14143609a257e02e7f9e90b20d9b7b570bbba + pristine_git_object: 58ef1a968b82b84e04b0dff09d6ac83dcb911601 models/sdkerrors/apierror.go: id: 6571d980f036 last_write_checksum: sha1:ceb1673e00bedaaf6b3f1f986bdc68d7f2ea2a71 pristine_git_object: 4f63ad9ecfce56db61c17e16fee42c2889615fe2 models/sdkerrors/badgatewayresponseerror.go: id: 35b3433812f3 - last_write_checksum: sha1:bf575c400f6ca1b921e269dfc1e304a4b42fb5c5 - pristine_git_object: 4e1b6c20a8b8f6743d765a540125df77c6fafa81 + last_write_checksum: sha1:3fa789f6f99326e13c19af00988e0abc6751de0c + pristine_git_object: 45efaed769fd266f803e6f49172c8f629c471e62 models/sdkerrors/badrequestresponseerror.go: id: c19ef4c157cd - last_write_checksum: sha1:001b4e11008bfbf7fcafb94521d9e94ba057039d - pristine_git_object: 116963d8d1e9fdbdda484b20293b5855dc54b5a4 + last_write_checksum: sha1:a9468b7deacb3fc8081620cb6c2c93a7b8a2d599 + pristine_git_object: b35c26f8339da5102c64f23ab26a6c62e3936fc9 models/sdkerrors/conflictresponseerror.go: id: 49b18bd3a030 - last_write_checksum: sha1:2309cf3eee81e24776e6bfbf0561fa520b8804f7 - pristine_git_object: 20e498e5d14ac4b2e43c04f9053d9e84450a4981 + last_write_checksum: sha1:28c923cc4bbe99541e827f1ba507d11424a5b048 + pristine_git_object: 266bec80c9319f7eaf7b2cc2b6d2a5e29a2f2a62 models/sdkerrors/edgenetworktimeoutresponseerror.go: id: "764506057175" - last_write_checksum: sha1:ea086fe024a5422739775f2383985d03ed47ecc5 - pristine_git_object: 69e96cc9702f376ed32e5705c4795a6eb590ad5b + last_write_checksum: sha1:6495af98473f71318365bcee79f0a5a33fbd1e3d + pristine_git_object: dc2639bba78ea200f946821787c5cba93ac4ea66 models/sdkerrors/forbiddenresponseerror.go: id: 7a8ee74ef09a - last_write_checksum: sha1:d054e3fb114dbff927d72740294ad20371cba7b8 - pristine_git_object: fc8bdef4a04c53fe401b5a73a71fbee5253e6d4d + last_write_checksum: sha1:fcd9a8220a84c022ac078f1ef1ed15830912096b + pristine_git_object: aab1977347011881f86f909fae805c0ed42c40ae models/sdkerrors/internalserverresponseerror.go: id: 13ce339a83c1 - last_write_checksum: sha1:2e2dc4f82a4d9e4e325ca32bd37baf5f97fbce6f - pristine_git_object: b1ba8bea4105a8f1e273d6ac35e2c011fe891748 + last_write_checksum: sha1:42902769b372a57747f5e54500d23ddf940d30d6 + pristine_git_object: 8c9ead451a3fbfb0f9f5d4c5258eb820d7aea982 models/sdkerrors/notfoundresponseerror.go: id: bef59d0b2512 - last_write_checksum: sha1:23b6f45d7c5156b17bc45e2f75557882e05366d1 - pristine_git_object: b672d12b64c93f8b5057e081e9329cf90d8e76e3 + last_write_checksum: sha1:da0c93b907c74832753eaa1ee0c0305570d60d4e + pristine_git_object: 44e219b96adb3e0632c94dd69babee412cb9f279 models/sdkerrors/payloadtoolargeresponseerror.go: id: d5b0dc9b12f3 - last_write_checksum: sha1:b57bbcfe16a87fb2f7948db21c9c87a3fb06369e - pristine_git_object: ecf8abbdb54b31af6c8346bddd9e61c28c0acfe2 + last_write_checksum: sha1:6dbf9c60e49b95151b371bfa60527f85b651b150 + pristine_git_object: 6bc7699e371fdbbbad541bd75e35153ead18f1d3 models/sdkerrors/paymentrequiredresponseerror.go: id: e90b16ec7455 - last_write_checksum: sha1:6677e0aca0e09b5fd8e4b31600ce7dffc448630c - pristine_git_object: e9ed0fb7dd0d1e2e2c19c62eaa2028c188d313ae + last_write_checksum: sha1:1a40e705bc561e90e0404d02da7f7238fd149fc9 + pristine_git_object: d9b70485d667dd2978a461a4aaf57ed2d0caddb7 models/sdkerrors/provideroverloadedresponseerror.go: id: c5fff88bf13d - last_write_checksum: sha1:98ddf43feb49903c2b4947267bd708107750baa2 - pristine_git_object: d94d5fcba4383e53d7d6b2074940f50352b18f78 + last_write_checksum: sha1:447efc368cb8ee0a73fef6f427cc8d4a769dcfa5 + pristine_git_object: 29d399fafc4102385be38cc47fc148b6135e9788 models/sdkerrors/requesttimeoutresponseerror.go: id: 7748c085ef15 - last_write_checksum: sha1:5359c29fc7c94890d6ba7127102e8d44118f2c87 - pristine_git_object: d302c2ea38e994b6bd4d6ff78117648d6d22b681 + last_write_checksum: sha1:14b963af0202c493e9f9975f44f8fee572f559d8 + pristine_git_object: ecab326fad76fe0d97f3a9060365279bbfa987f3 models/sdkerrors/serviceunavailableresponseerror.go: id: 89b1775997ab - last_write_checksum: sha1:644fcb24ae80b2861557c864f4f2a72b4cd3da01 - pristine_git_object: 76602b8280938d508a3be5a0e365d846f6b1f503 + last_write_checksum: sha1:2b1ba2f2e74daa400c3a9dfd2ae44e7022d72e28 + pristine_git_object: 3a52ac7fd3df5313f3ad76bb9374988a561ef03a models/sdkerrors/toomanyrequestsresponseerror.go: id: 42f1e2281a09 - last_write_checksum: sha1:d6de87866317a34e7ce8430c409036361e2e53e4 - pristine_git_object: 2264435c810c5cc6917077471b750d59d4977640 + last_write_checksum: sha1:b2364a900fc71c4adda5274bcac10261544bb46b + pristine_git_object: 492a5c0dccf34e013c34ea5ea973fba5f4dd4276 models/sdkerrors/unauthorizedresponseerror.go: id: ff7cd58486f8 - last_write_checksum: sha1:2be3970bab14e1c540114cfa7f3ead5d60523980 - pristine_git_object: 4abeb4a352b6debc1e8255b45d7e3d57a46e00fc + last_write_checksum: sha1:90d3e29b629c4bac35361917f93d075f58d8991a + pristine_git_object: b3a4b8212197ce8b5714a6c88990cd46a86c1b2e models/sdkerrors/unprocessableentityresponseerror.go: id: 1526674fc27d - last_write_checksum: sha1:87530db9ec8578c54195729cd0cbe1a5e9c5a1f1 - pristine_git_object: 22440c0009532b9a1899ffd163fe65bdb27454d6 + last_write_checksum: sha1:a5fef8fd03bf1b76f97eca969b97eed29e5400e1 + pristine_git_object: dc9953e251f160ae1ddebc4edbaa75611d77ced1 oauth.go: id: a9cad7eb3094 - last_write_checksum: sha1:633ae2a267c1c3b111c631a48ebcaa74d3ea382f - pristine_git_object: 3199c027702fc48126d1f5e38888a01bd5d4efed + last_write_checksum: sha1:9f6b1d3e3efe6eff1d5f33dd26990a04ddb94397 + pristine_git_object: 2fe4b5d896597641c3f908fdc0a441ffbded4f8b + observability.go: + id: 38f7e1f491fb + last_write_checksum: sha1:487b3d35312af87dde69426e38b939b7749fdf16 + pristine_git_object: 3dc1d1bf3c5e7387b73f1bbb0b6b456dd5e7ee9d openrouter.go: id: 207ad004b774 - last_write_checksum: sha1:39dfc6cada5ff28bdee47b1deed491bec886502b - pristine_git_object: b955a99c659fbbbc6bba38d5290ec74a9ee4284f + last_write_checksum: sha1:869f39b7b7903d7a2e64fc195e9377279007811b + pristine_git_object: 8a4e3724fa6b6279a234ab82b387fd7cfecd9848 optionalnullable/optionalnullable.go: id: ce60f259ead3 last_write_checksum: sha1:d6aff1a420c31e025ea21d46cf056e305ae76fe8 @@ -4858,28 +8023,36 @@ trackedFiles: pristine_git_object: e6e5a01c6e721e879e24a38a1f97e3e27d4686d4 organization.go: id: 041fecce87b2 - last_write_checksum: sha1:5375171e6bb36dbb57b54dfdf0cfea082f738fcf - pristine_git_object: 6f6fcf1e6d8c649407c42e75e1e730ff9065b6bf + last_write_checksum: sha1:0ce37cd69d5506814b1224d2cdaaae535911c6ee + pristine_git_object: ffd0ec3265dcce99106ef95bbe02ea3aca1292ab + presets.go: + id: e1866fc48c6b + last_write_checksum: sha1:b69e250319a32b3cedd523aee0dbaab40455b2c3 + pristine_git_object: dfd0ed5ce40a478bee230bd839ea5bf4cf92d9bd providers.go: id: e89bb17ecd7b - last_write_checksum: sha1:b4dfaa8a3af0b7d68328b248dd88e9d83e96aefe - pristine_git_object: 2af1cb36de24a000451356888c51e0742f2779fc + last_write_checksum: sha1:18b0624b4cd205dd08316121e303572a7fdb2f44 + pristine_git_object: 1faa9d7a14b0bced00bd3371a544700a7dbab279 rerank.go: id: a0df6c09f740 - last_write_checksum: sha1:207c567b67237ba308ce2f2747d0a1fc469e52fe - pristine_git_object: d052db0a8fc3b21e2cf39d924db519c1f895cc1c + last_write_checksum: sha1:6aeaea4b0b3ef8daa31600ce8cd8d43fa5264761 + pristine_git_object: 8a8bfc2f563f7f08b46927f547e25216cc35334e responses.go: id: 1e889220bc3b - last_write_checksum: sha1:ed712010ce9ac548e9c426332efb61baa4322fd2 - pristine_git_object: c001ecf0624f7981222dddf7a55dd6d3a1593c6e + last_write_checksum: sha1:4e8411138a3cd61214616ac69dd9656f50f80055 + pristine_git_object: 02ef24cc99adfe0b8b7721b1428e8ea6d3852082 retry/config.go: id: 82d673cb0389 last_write_checksum: sha1:7f7d96b59a18e95bac847ae09c63bbd911ee8432 pristine_git_object: 5b3dc7c122d8ab08905485342d7474f8f163888d + stt.go: + id: 04852909348f + last_write_checksum: sha1:c297d6d12f22e9df8b086d517699a04ab2b2ac80 + pristine_git_object: fbedf08ea6b782a62c31f48d3598ced42ccc5b85 tts.go: id: 9feb76579e2d - last_write_checksum: sha1:820b78e5c958d68d1db008a824008345ccc5234c - pristine_git_object: 4610dbf0516a34e7deeee0c0f95b3da6ff453fb4 + last_write_checksum: sha1:f6fe4448d9c98d380dce16a84b586e65c45501c2 + pristine_git_object: 03d77d7930ce63d972d33fe9a4721d41cd09d4fb types/bigint.go: id: 6f911e1a03c3 last_write_checksum: sha1:49b004005d0461fb04b846eca062b070b0360b31 @@ -4898,16 +8071,16 @@ trackedFiles: pristine_git_object: 35c439d2661e08fcb6a854096fd7b9a8561b3938 types/stream/stream.go: id: acfb7ceec2c9 - last_write_checksum: sha1:a93d55dd6863059b21f647a016747a4a60bfc839 - pristine_git_object: dcc0d374709530364d2bf27ea59cad64b0c3207d + last_write_checksum: sha1:6d127e5cb94378b3e97640d6bbd004522f8a4bb7 + pristine_git_object: f590f26543adbbb82e2fe183b8051b1ff1ab49c6 videogeneration.go: id: cb32a6d68bf0 - last_write_checksum: sha1:1776b0cd158e7545f53a2c64cb4be7e752c4e340 - pristine_git_object: aec763c42c7a623b57b675b249cfccb3b27c93d2 + last_write_checksum: sha1:094f30bc2a9fa48838c6d7812438dc9054e23d36 + pristine_git_object: f0a742ea39355b30db71e190c8ad67279e17a3d1 workspaces.go: id: 643517773c6f - last_write_checksum: sha1:ef409d65ccf5d470b1a1349eda88f8612abdb9f0 - pristine_git_object: 09021a19aab99cfd0332c72d3e599b85a60e2224 + last_write_checksum: sha1:c619c2771ff999b6fb4970d5730a1d57fea24639 + pristine_git_object: 1a1aa836bdf53da67f9683098d55940e66529dbb examples: createResponses: speakeasy-default-create-responses: @@ -4942,6 +8115,20 @@ examples: application/json: {"error": {"code": 524, "message": "Request timed out. Please try again later."}} "529": application/json: {"error": {"code": 529, "message": "Provider returned error"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + guardrail-blocked: + requestBody: + application/json: {"service_tier": "auto", "store": false, "stream": false} + responses: + "403": + application/json: {"error": {"code": 403, "message": "Request blocked: prompt injection patterns detected"}} + insufficient-permissions: + requestBody: + application/json: {"service_tier": "auto", "store": false, "stream": false} + responses: + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} getUserActivity: speakeasy-default-get-user-activity: responses: @@ -5017,7 +8204,7 @@ examples: speakeasy-default-list-embeddings-models: responses: "200": - application/json: {"data": [{"architecture": {"input_modalities": ["text"], "modality": "text->text", "output_modalities": ["text"]}, "canonical_slug": "openai/gpt-4", "context_length": 8192, "created": 1692901234, "default_parameters": null, "id": "openai/gpt-4", "links": {"details": "/api/v1/models/openai/gpt-5.4/endpoints"}, "name": "GPT-4", "per_request_limits": null, "pricing": {"completion": "0.00006", "prompt": "0.00003"}, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "top_provider": {"is_moderated": true}}]} + application/json: {"data": [{"architecture": {"input_modalities": ["text"], "modality": "text->text", "output_modalities": ["text"]}, "canonical_slug": "openai/gpt-4", "context_length": 8192, "created": 1692901234, "default_parameters": null, "id": "openai/gpt-4", "links": {"details": "/api/v1/models/openai/gpt-5.4/endpoints"}, "name": "GPT-4", "per_request_limits": null, "pricing": {"completion": "0.00006", "prompt": "0.00003"}, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "supported_voices": null, "top_provider": {"is_moderated": true}}]} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "500": @@ -5029,7 +8216,7 @@ examples: id: "" responses: "200": - application/json: {"data": {"api_type": "completions", "app_id": 12345, "cache_discount": null, "cancelled": false, "created_at": "2024-07-15T23:33:19.433273+00:00", "external_user": "user-123", "finish_reason": "stop", "generation_time": 1200, "http_referer": "https://openrouter.ai/", "id": "gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG", "is_byok": false, "latency": 1250, "model": "sao10k/l3-stheno-8b", "moderation_latency": 50, "native_finish_reason": "stop", "native_tokens_cached": 3, "native_tokens_completion": 25, "native_tokens_completion_images": 0, "native_tokens_prompt": 10, "native_tokens_reasoning": 5, "num_input_audio_prompt": 0, "num_media_completion": 0, "num_media_prompt": 1, "num_search_results": 5, "origin": "https://openrouter.ai/", "provider_name": "Infermatic", "provider_responses": null, "router": "openrouter/auto", "streamed": true, "tokens_completion": 25, "tokens_prompt": 10, "total_cost": 0.0015, "upstream_id": "chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946", "upstream_inference_cost": 0.0012, "usage": 0.0015, "user_agent": "Mozilla/5.0", "web_search_engine": "exa"}} + application/json: {"data": {"api_type": "completions", "app_id": 12345, "cache_discount": null, "cancelled": false, "created_at": "2024-07-15T23:33:19.433273+00:00", "data_region": "global", "external_user": "user-123", "finish_reason": "stop", "generation_time": 1200, "http_referer": "https://openrouter.ai/", "id": "gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG", "is_byok": false, "latency": 1250, "model": "sao10k/l3-stheno-8b", "moderation_latency": 50, "native_finish_reason": "stop", "native_tokens_cached": 3, "native_tokens_completion": 25, "native_tokens_completion_images": 0, "native_tokens_prompt": 10, "native_tokens_reasoning": 5, "num_fetches": 0, "num_input_audio_prompt": 0, "num_media_completion": 0, "num_media_prompt": 1, "num_search_results": 5, "origin": "https://openrouter.ai/", "preset_id": "a9e8d400-592a-494f-908c-375efa66cafd", "provider_name": "Infermatic", "provider_responses": null, "router": "openrouter/auto", "service_tier": "priority", "streamed": true, "tokens_completion": 25, "tokens_prompt": 10, "total_cost": 0.0015, "upstream_id": "chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946", "upstream_inference_cost": 0.0012, "usage": 0.0015, "user_agent": "Mozilla/5.0", "web_search_engine": "exa"}} "401": application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} "402": @@ -5059,7 +8246,7 @@ examples: speakeasy-default-get-models: responses: "200": - application/json: {"data": [{"architecture": {"input_modalities": ["text"], "modality": "text->text", "output_modalities": ["text"]}, "canonical_slug": "openai/gpt-4", "context_length": 8192, "created": 1692901234, "default_parameters": null, "id": "openai/gpt-4", "links": {"details": "/api/v1/models/openai/gpt-5.4/endpoints"}, "name": "GPT-4", "per_request_limits": null, "pricing": {"completion": "0.00006", "prompt": "0.00003"}, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "top_provider": {"is_moderated": true}}]} + application/json: {"data": [{"architecture": {"input_modalities": ["text"], "modality": "text->text", "output_modalities": ["text"]}, "canonical_slug": "openai/gpt-4", "context_length": 8192, "created": 1692901234, "default_parameters": null, "id": "openai/gpt-4", "links": {"details": "/api/v1/models/openai/gpt-5.4/endpoints"}, "name": "GPT-4", "per_request_limits": null, "pricing": {"completion": "0.00006", "prompt": "0.00003"}, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "supported_voices": null, "top_provider": {"is_moderated": true}}]} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "500": @@ -5068,7 +8255,7 @@ examples: speakeasy-default-list-models-user: responses: "200": - application/json: {"data": [{"architecture": {"input_modalities": ["text"], "modality": "text->text", "output_modalities": ["text"]}, "canonical_slug": "openai/gpt-4", "context_length": 8192, "created": 1692901234, "default_parameters": null, "id": "openai/gpt-4", "links": {"details": "/api/v1/models/openai/gpt-5.4/endpoints"}, "name": "GPT-4", "per_request_limits": null, "pricing": {"completion": "0.00006", "prompt": "0.00003"}, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "top_provider": {"is_moderated": true}}]} + application/json: {"data": [{"architecture": {"input_modalities": ["text"], "modality": "text->text", "output_modalities": ["text"]}, "canonical_slug": "openai/gpt-4", "context_length": 8192, "created": 1692901234, "default_parameters": null, "id": "openai/gpt-4", "links": {"details": "/api/v1/models/openai/gpt-5.4/endpoints"}, "name": "GPT-4", "per_request_limits": null, "pricing": {"completion": "0.00006", "prompt": "0.00003"}, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "supported_voices": null, "top_provider": {"is_moderated": true}}]} "401": application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} "404": @@ -5407,6 +8594,8 @@ examples: application/json: {"error": {"code": 500, "message": "Internal Server Error"}} "409": application/json: {"error": {"code": 409, "message": "Resource conflict. Please try again later."}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} sendChatCompletionRequest: speakeasy-default-send-chat-completion-request: requestBody: @@ -5440,6 +8629,20 @@ examples: application/json: {"error": {"code": 524, "message": "Request timed out. Please try again later."}} "529": application/json: {"error": {"code": 529, "message": "Provider returned error"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + guardrail-blocked: + requestBody: + application/json: {"messages": [{"content": "You are a helpful assistant.", "role": "system"}, {"content": "What is the capital of France?", "role": "user"}], "stream": false} + responses: + "403": + application/json: {"error": {"code": 403, "message": "Request blocked: prompt injection patterns detected"}} + insufficient-permissions: + requestBody: + application/json: {"messages": [{"content": "You are a helpful assistant.", "role": "system"}, {"content": "What is the capital of France?", "role": "user"}], "stream": false} + responses: + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} listOrganizationMembers: speakeasy-default-list-organization-members: responses: @@ -5457,7 +8660,7 @@ examples: application/json: {"documents": ["Paris is the capital of France.", "Berlin is the capital of Germany."], "model": "cohere/rerank-v3.5", "query": "What is the capital of France?"} responses: "200": - application/json: {"model": "cohere/rerank-v3.5", "results": [{"document": {"text": "Paris is the capital of France."}, "index": 0, "relevance_score": 0.98}]} + application/json: {"model": "cohere/rerank-v3.5", "results": [{"document": {}, "index": 0, "relevance_score": 0.98}]} text/event-stream: "" "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} @@ -5596,7 +8799,7 @@ examples: speakeasy-default-list-workspaces: responses: "200": - application/json: {"data": [{"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_image_model": "openai/dall-e-3", "default_provider_sort": "price", "default_text_model": "openai/gpt-4o", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "is_data_discount_logging_enabled": true, "is_observability_broadcast_enabled": false, "is_observability_io_logging_enabled": false, "name": "Production", "slug": "production", "updated_at": "2025-08-24T15:45:00Z"}], "total_count": 1} + application/json: {"data": [{"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_image_model": "openai/dall-e-3", "default_provider_sort": "price", "default_text_model": "openai/gpt-4o", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "io_logging_api_key_ids": null, "io_logging_sampling_rate": 1, "is_data_discount_logging_enabled": true, "is_observability_broadcast_enabled": false, "is_observability_io_logging_enabled": false, "name": "Production", "slug": "production", "updated_at": "2025-08-24T15:45:00Z"}], "total_count": 1} "401": application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} "500": @@ -5607,7 +8810,7 @@ examples: application/json: {"name": "Production", "slug": "production"} responses: "201": - application/json: {"data": {"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_image_model": "openai/dall-e-3", "default_provider_sort": "price", "default_text_model": "openai/gpt-4o", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "is_data_discount_logging_enabled": true, "is_observability_broadcast_enabled": false, "is_observability_io_logging_enabled": false, "name": "Production", "slug": "production", "updated_at": null}} + application/json: {"data": {"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_image_model": "openai/dall-e-3", "default_provider_sort": "price", "default_text_model": "openai/gpt-4o", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "io_logging_api_key_ids": null, "io_logging_sampling_rate": 1, "is_data_discount_logging_enabled": true, "is_observability_broadcast_enabled": false, "is_observability_io_logging_enabled": false, "name": "Production", "slug": "production", "updated_at": null}} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "401": @@ -5641,7 +8844,7 @@ examples: id: "production" responses: "200": - application/json: {"data": {"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_image_model": "openai/dall-e-3", "default_provider_sort": "price", "default_text_model": "openai/gpt-4o", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "is_data_discount_logging_enabled": true, "is_observability_broadcast_enabled": false, "is_observability_io_logging_enabled": false, "name": "Production", "slug": "production", "updated_at": "2025-08-24T15:45:00Z"}} + application/json: {"data": {"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_image_model": "openai/dall-e-3", "default_provider_sort": "price", "default_text_model": "openai/gpt-4o", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "io_logging_api_key_ids": null, "io_logging_sampling_rate": 1, "is_data_discount_logging_enabled": true, "is_observability_broadcast_enabled": false, "is_observability_io_logging_enabled": false, "name": "Production", "slug": "production", "updated_at": "2025-08-24T15:45:00Z"}} "401": application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} "404": @@ -5657,7 +8860,7 @@ examples: application/json: {} responses: "200": - application/json: {"data": {"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_image_model": "openai/dall-e-3", "default_provider_sort": "price", "default_text_model": "openai/gpt-4o", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "is_data_discount_logging_enabled": true, "is_observability_broadcast_enabled": false, "is_observability_io_logging_enabled": false, "name": "Updated Workspace", "slug": "updated-workspace", "updated_at": "2025-08-25T10:00:00Z"}} + application/json: {"data": {"created_at": "2025-08-24T10:30:00Z", "created_by": "user_abc123", "default_image_model": "openai/dall-e-3", "default_provider_sort": "price", "default_text_model": "openai/gpt-4o", "description": "Production environment workspace", "id": "550e8400-e29b-41d4-a716-446655440000", "io_logging_api_key_ids": null, "io_logging_sampling_rate": 1, "is_data_discount_logging_enabled": true, "is_observability_broadcast_enabled": false, "is_observability_io_logging_enabled": false, "name": "Updated Workspace", "slug": "updated-workspace", "updated_at": "2025-08-25T10:00:00Z"}} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "401": @@ -5708,5 +8911,489 @@ examples: application/json: {"error": {"code": 404, "message": "Resource not found"}} "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + getAnalyticsMeta: + speakeasy-default-get-analytics-meta: + responses: + "200": + application/json: {"data": {"dimensions": [{"display_label": "Model", "name": "model"}], "granularities": [{"display_label": "Day", "name": "day"}], "metrics": [{"display_format": "number", "display_label": "Request Count", "is_rate": false, "name": "request_count"}], "operators": [{"name": "eq", "value_type": "scalar"}]}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + queryAnalytics: + speakeasy-default-query-analytics: + requestBody: + application/json: {"metrics": ["request_count"]} + responses: + "200": + application/json: {"data": {"data": [{}], "metadata": {"query_time_ms": 1416.73, "row_count": 771694, "truncated": false}}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "408": + application/json: {"error": {"code": 408, "message": "Operation timed out. Please try again later."}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + createAudioTranscriptions: + speakeasy-default-create-audio-transcriptions: + requestBody: + application/json: {"input_audio": {"data": "UklGRiQA...", "format": "wav"}, "model": "openai/whisper-large-v3"} + responses: + "200": + application/json: {"text": "Hello, this is a test of OpenAI speech-to-text transcription."} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "402": + application/json: {"error": {"code": 402, "message": "Insufficient credits. Add more using https://openrouter.ai/credits"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + "502": + application/json: {"error": {"code": 502, "message": "Provider returned error"}} + "503": + application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}} + "524": + application/json: {"error": {"code": 524, "message": "Request timed out. Please try again later."}} + "529": + application/json: {"error": {"code": 529, "message": "Provider returned error"}} + listBYOKKeys: + speakeasy-default-list-BYOK-keys: + responses: + "200": + application/json: {"data": [{"allowed_api_key_hashes": null, "allowed_models": null, "allowed_user_ids": null, "created_at": "2025-08-24T10:30:00Z", "disabled": false, "id": "11111111-2222-3333-4444-555555555555", "is_fallback": false, "label": "sk-...AbCd", "provider": "openai", "sort_order": 0, "workspace_id": "550e8400-e29b-41d4-a716-446655440000"}], "total_count": 1} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + createBYOKKey: + speakeasy-default-create-BYOK-key: + requestBody: + application/json: {"key": "sk-proj-abc123...", "provider": "openai"} + responses: + "201": + application/json: {"data": {"allowed_api_key_hashes": null, "allowed_models": null, "allowed_user_ids": null, "created_at": "2025-08-24T10:30:00Z", "disabled": false, "id": "11111111-2222-3333-4444-555555555555", "is_fallback": false, "label": "sk-...AbCd", "provider": "openai", "sort_order": 0, "workspace_id": "550e8400-e29b-41d4-a716-446655440000"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + deleteBYOKKey: + speakeasy-default-delete-BYOK-key: + parameters: + path: + id: "11111111-2222-3333-4444-555555555555" + responses: + "200": + application/json: {"deleted": true} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + getBYOKKey: + speakeasy-default-get-BYOK-key: + parameters: + path: + id: "11111111-2222-3333-4444-555555555555" + responses: + "200": + application/json: {"data": {"allowed_api_key_hashes": null, "allowed_models": null, "allowed_user_ids": null, "created_at": "2025-08-24T10:30:00Z", "disabled": false, "id": "11111111-2222-3333-4444-555555555555", "is_fallback": false, "label": "sk-...AbCd", "provider": "openai", "sort_order": 0, "workspace_id": "550e8400-e29b-41d4-a716-446655440000"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + updateBYOKKey: + speakeasy-default-update-BYOK-key: + parameters: + path: + id: "11111111-2222-3333-4444-555555555555" + requestBody: + application/json: {} + responses: + "200": + application/json: {"data": {"allowed_api_key_hashes": null, "allowed_models": null, "allowed_user_ids": null, "created_at": "2025-08-24T10:30:00Z", "disabled": false, "id": "11111111-2222-3333-4444-555555555555", "is_fallback": false, "label": "sk-...AbCd", "provider": "openai", "sort_order": 0, "workspace_id": "550e8400-e29b-41d4-a716-446655440000"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + getAppRankings: + speakeasy-default-get-app-rankings: + parameters: + query: + sort: "popular" + limit: 50 + offset: 0 + responses: + "200": + application/json: {"data": [{"app_id": 12345, "app_name": "Cline", "rank": 1, "total_requests": 4321, "total_tokens": "12345678"}, {"app_id": 67890, "app_name": "Roo Code", "rank": 2, "total_requests": 2109, "total_tokens": "9876543"}], "meta": {"as_of": "2026-05-12T02:00:00Z", "end_date": "2026-05-11", "start_date": "2026-04-12", "version": "v1"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + getBenchmarksArtificialAnalysis: + speakeasy-default-get-benchmarks-artificial-analysis: + parameters: + query: + max_results: 20 + responses: + "200": + application/json: {"data": [{"aa_name": "GPT-4o", "agentic_index": 58.3, "coding_index": 65.8, "intelligence_index": 71.2, "model_permaslug": "openai/gpt-4o", "pricing": {"completion": "0.00001", "prompt": "0.0000025"}}], "meta": {"as_of": "2026-06-03T12:00:00Z", "citation": "Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).", "model_count": 1, "source": "artificial-analysis", "source_url": "https://artificialanalysis.ai", "version": "v1"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + getBenchmarksDesignArena: + speakeasy-default-get-benchmarks-design-arena: + parameters: + query: + arena: "models" + max_results: 20 + responses: + "200": + application/json: {"data": [{"arena": "models", "avg_generation_time_ms": 3200, "category": "codecategories", "display_name": "Claude Sonnet 4", "elo": 1423, "model_permaslug": "anthropic/claude-sonnet-4", "pricing": {"completion": "0.000015", "prompt": "0.000003"}, "tournament_stats": {"first_place": 12, "fourth_place": 2, "second_place": 8, "third_place": 5, "total": 27}, "win_rate": 72}], "meta": {"arena": "models", "as_of": "2026-06-03T12:00:00Z", "category": null, "citation": "Source: Design Arena (www.designarena.ai) via OpenRouter (openrouter.ai/rankings).", "elo_bounds": {"max": 1600, "min": 900}, "model_count": 1, "source": "design-arena", "source_url": "https://www.designarena.ai", "version": "v1"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + getRankingsDaily: + speakeasy-default-get-rankings-daily: + responses: + "200": + application/json: {"data": [{"date": "2026-05-11", "model_permaslug": "openai/gpt-4o-2024-05-13", "total_tokens": "12345678"}, {"date": "2026-05-11", "model_permaslug": "anthropic/claude-3.5-sonnet-20241022", "total_tokens": "9876543"}], "meta": {"as_of": "2026-05-12T02:00:00Z", "end_date": "2026-05-11", "start_date": "2026-04-12", "version": "v1"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + listFiles: + speakeasy-default-list-files: + responses: + "200": + application/json: {"cursor": null, "data": [{"created_at": "2025-01-01T00:00:00Z", "downloadable": false, "filename": "document.pdf", "id": "file_011CNha8iCJcU1wXNR6q4V8w", "mime_type": "application/pdf", "size_bytes": 1024000, "type": "file"}], "first_id": "file_011CNha8iCJcU1wXNR6q4V8w", "has_more": false, "last_id": "file_011CNha8iCJcU1wXNR6q4V8w"} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + uploadFile: + speakeasy-default-upload-file: + requestBody: + multipart/form-data: {"file": "x-file: example.file"} + responses: + "200": + application/json: {"created_at": "2025-01-01T00:00:00Z", "downloadable": false, "filename": "document.pdf", "id": "file_011CNha8iCJcU1wXNR6q4V8w", "mime_type": "application/pdf", "size_bytes": 1024000, "type": "file"} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "413": + application/json: {"error": {"code": 413, "message": "Request payload too large"}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + deleteFile: + speakeasy-default-delete-file: + parameters: + path: + file_id: "file_011CNha8iCJcU1wXNR6q4V8w" + responses: + "200": + application/json: {"id": "file_011CNha8iCJcU1wXNR6q4V8w", "type": "file_deleted"} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + getFileMetadata: + speakeasy-default-get-file-metadata: + parameters: + path: + file_id: "file_011CNha8iCJcU1wXNR6q4V8w" + responses: + "200": + application/json: {"created_at": "2025-01-01T00:00:00Z", "downloadable": false, "filename": "document.pdf", "id": "file_011CNha8iCJcU1wXNR6q4V8w", "mime_type": "application/pdf", "size_bytes": 1024000, "type": "file"} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + downloadFileContent: + speakeasy-default-download-file-content: + parameters: + path: + file_id: "file_011CNha8iCJcU1wXNR6q4V8w" + responses: + "200": + application/octet-stream: "x-file: example.file" + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "429": + application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + getModel: + speakeasy-default-get-model: + parameters: + path: + author: "openai" + slug: "gpt-4" + responses: + "200": + application/json: {"data": {"architecture": {"input_modalities": ["text"], "modality": "text->text", "output_modalities": ["text"]}, "canonical_slug": "openai/gpt-4", "context_length": 8192, "created": 1692901234, "default_parameters": {}, "id": "openai/gpt-4", "links": {"details": "/api/v1/models/openai/gpt-5.4/endpoints"}, "name": "GPT-4", "per_request_limits": null, "pricing": {"completion": "0.00006", "prompt": "0.00003"}, "supported_parameters": ["temperature", "top_p", "max_tokens"], "supported_voices": null, "top_provider": {"is_moderated": true}}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + listObservabilityDestinations: + speakeasy-default-list-observability-destinations: + responses: + "200": + application/json: {"data": [{"api_key_hashes": null, "config": {"baseUrl": "https://us.cloud.langfuse.com", "publicKey": "pk-l...EfGh", "secretKey": "sk-l...AbCd"}, "created_at": "2025-08-24T10:30:00Z", "enabled": true, "filter_rules": null, "id": "99999999-aaaa-bbbb-cccc-dddddddddddd", "name": "Production Langfuse", "privacy_mode": false, "sampling_rate": 1, "type": "langfuse", "updated_at": "2025-08-24T15:45:00Z", "workspace_id": "550e8400-e29b-41d4-a716-446655440000"}], "total_count": 1} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + createObservabilityDestination: + speakeasy-default-create-observability-destination: + requestBody: + application/json: {"config": {"baseUrl": "https://us.cloud.langfuse.com", "publicKey": "pk-l...EfGh", "secretKey": "sk-l...AbCd"}, "enabled": true, "name": "Production Langfuse", "privacy_mode": false, "type": "langfuse"} + responses: + "201": + application/json: {"data": {"api_key_hashes": null, "config": {"baseUrl": "https://us.cloud.langfuse.com", "publicKey": "pk-l...EfGh", "secretKey": "sk-l...AbCd"}, "created_at": "2025-08-24T10:30:00Z", "enabled": true, "filter_rules": null, "id": "99999999-aaaa-bbbb-cccc-dddddddddddd", "name": "Production Langfuse", "privacy_mode": false, "sampling_rate": 1, "type": "langfuse", "updated_at": "2025-08-24T15:45:00Z", "workspace_id": "550e8400-e29b-41d4-a716-446655440000"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "409": + application/json: {"error": {"code": 409, "message": "Resource conflict. Please try again later."}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + deleteObservabilityDestination: + speakeasy-default-delete-observability-destination: + parameters: + path: + id: "99999999-aaaa-bbbb-cccc-dddddddddddd" + responses: + "200": + application/json: {"deleted": true} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + getObservabilityDestination: + speakeasy-default-get-observability-destination: + parameters: + path: + id: "99999999-aaaa-bbbb-cccc-dddddddddddd" + responses: + "200": + application/json: {"data": {"api_key_hashes": null, "config": {"baseUrl": "https://us.cloud.langfuse.com", "publicKey": "pk-l...EfGh", "secretKey": "sk-l...AbCd"}, "created_at": "2025-08-24T10:30:00Z", "enabled": true, "filter_rules": null, "id": "99999999-aaaa-bbbb-cccc-dddddddddddd", "name": "Production Langfuse", "privacy_mode": false, "sampling_rate": 1, "type": "langfuse", "updated_at": "2025-08-24T15:45:00Z", "workspace_id": "550e8400-e29b-41d4-a716-446655440000"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + updateObservabilityDestination: + speakeasy-default-update-observability-destination: + parameters: + path: + id: "99999999-aaaa-bbbb-cccc-dddddddddddd" + requestBody: + application/json: {} + responses: + "200": + application/json: {"data": {"api_key_hashes": null, "config": {"baseUrl": "https://us.cloud.langfuse.com", "publicKey": "pk-l...EfGh", "secretKey": "sk-l...AbCd"}, "created_at": "2025-08-24T10:30:00Z", "enabled": true, "filter_rules": null, "id": "99999999-aaaa-bbbb-cccc-dddddddddddd", "name": "Production Langfuse", "privacy_mode": false, "sampling_rate": 1, "type": "langfuse", "updated_at": "2025-08-24T15:45:00Z", "workspace_id": "550e8400-e29b-41d4-a716-446655440000"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "409": + application/json: {"error": {"code": 409, "message": "Resource conflict. Please try again later."}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + listPresets: + speakeasy-default-list-presets: + responses: + "200": + application/json: {"data": [{"created_at": "2026-04-20T10:00:00Z", "creator_user_id": "user_2dHFtVWx2n56w6HkM0000000000", "description": null, "designated_version_id": "550e8400-e29b-41d4-a716-446655440000", "id": "650e8400-e29b-41d4-a716-446655440001", "name": "my-preset", "slug": "my-preset", "status": "active", "status_updated_at": null, "updated_at": "2026-04-20T10:00:00Z", "workspace_id": "750e8400-e29b-41d4-a716-446655440002"}], "total_count": 1} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + getPreset: + speakeasy-default-get-preset: + parameters: + path: + slug: "my-preset" + responses: + "200": + application/json: {"data": {"created_at": "2026-04-20T10:00:00Z", "creator_user_id": "user_2dHFtVWx2n56w6HkM0000000000", "description": null, "designated_version_id": "550e8400-e29b-41d4-a716-446655440000", "id": "650e8400-e29b-41d4-a716-446655440001", "name": "my-preset", "slug": "my-preset", "status": "active", "status_updated_at": null, "updated_at": "2026-04-20T10:00:00Z", "workspace_id": "750e8400-e29b-41d4-a716-446655440002", "designated_version": {"config": {"model": "openai/gpt-4o", "temperature": 0.7}, "created_at": "2026-04-20T10:00:00Z", "creator_id": "user_2dHFtVWx2n56w6HkM0000000000", "id": "550e8400-e29b-41d4-a716-446655440000", "preset_id": "650e8400-e29b-41d4-a716-446655440001", "system_prompt": "You are a helpful assistant.", "updated_at": "2026-04-20T10:00:00Z", "version": 1}}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + createPresetsChatCompletions: + speakeasy-default-create-presets-chat-completions: + parameters: + path: + slug: "my-preset" + requestBody: + application/json: {"messages": [{"content": "You are a helpful assistant.", "role": "system"}, {"content": "What is the capital of France?", "role": "user"}], "stream": false} + responses: + "200": + application/json: {"data": {"created_at": "2026-04-20T10:00:00Z", "creator_user_id": "user_2dHFtVWx2n56w6HkM0000000000", "description": null, "designated_version_id": "550e8400-e29b-41d4-a716-446655440000", "id": "650e8400-e29b-41d4-a716-446655440001", "name": "my-preset", "slug": "my-preset", "status": "active", "status_updated_at": null, "updated_at": "2026-04-20T10:00:00Z", "workspace_id": "750e8400-e29b-41d4-a716-446655440002", "designated_version": {"config": {"model": "openai/gpt-4o", "temperature": 0.7}, "created_at": "2026-04-20T10:00:00Z", "creator_id": "user_2dHFtVWx2n56w6HkM0000000000", "id": "550e8400-e29b-41d4-a716-446655440000", "preset_id": "650e8400-e29b-41d4-a716-446655440001", "system_prompt": "You are a helpful assistant.", "updated_at": "2026-04-20T10:00:00Z", "version": 1}}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "409": + application/json: {"error": {"code": 409, "message": "Resource conflict. Please try again later."}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + createPresetsMessages: + speakeasy-default-create-presets-messages: + parameters: + path: + slug: "my-preset" + requestBody: + application/json: {"messages": [{"content": "Hello, how are you?", "role": "user"}], "model": "anthropic/claude-4.5-sonnet-20250929"} + responses: + "200": + application/json: {"data": {"created_at": "2026-04-20T10:00:00Z", "creator_user_id": "user_2dHFtVWx2n56w6HkM0000000000", "description": null, "designated_version_id": "550e8400-e29b-41d4-a716-446655440000", "id": "650e8400-e29b-41d4-a716-446655440001", "name": "my-preset", "slug": "my-preset", "status": "active", "status_updated_at": null, "updated_at": "2026-04-20T10:00:00Z", "workspace_id": "750e8400-e29b-41d4-a716-446655440002", "designated_version": {"config": {"model": "openai/gpt-4o", "temperature": 0.7}, "created_at": "2026-04-20T10:00:00Z", "creator_id": "user_2dHFtVWx2n56w6HkM0000000000", "id": "550e8400-e29b-41d4-a716-446655440000", "preset_id": "650e8400-e29b-41d4-a716-446655440001", "system_prompt": "You are a helpful assistant.", "updated_at": "2026-04-20T10:00:00Z", "version": 1}}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "409": + application/json: {"error": {"code": 409, "message": "Resource conflict. Please try again later."}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + createPresetsResponses: + speakeasy-default-create-presets-responses: + parameters: + path: + slug: "my-preset" + requestBody: + application/json: {"service_tier": "auto", "store": false, "stream": false} + responses: + "200": + application/json: {"data": {"created_at": "2026-04-20T10:00:00Z", "creator_user_id": "user_2dHFtVWx2n56w6HkM0000000000", "description": null, "designated_version_id": "550e8400-e29b-41d4-a716-446655440000", "id": "650e8400-e29b-41d4-a716-446655440001", "name": "my-preset", "slug": "my-preset", "status": "active", "status_updated_at": null, "updated_at": "2026-04-20T10:00:00Z", "workspace_id": "750e8400-e29b-41d4-a716-446655440002", "designated_version": {"config": {"model": "openai/gpt-4o", "temperature": 0.7}, "created_at": "2026-04-20T10:00:00Z", "creator_id": "user_2dHFtVWx2n56w6HkM0000000000", "id": "550e8400-e29b-41d4-a716-446655440000", "preset_id": "650e8400-e29b-41d4-a716-446655440001", "system_prompt": "You are a helpful assistant.", "updated_at": "2026-04-20T10:00:00Z", "version": 1}}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "403": + application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "409": + application/json: {"error": {"code": 409, "message": "Resource conflict. Please try again later."}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + listPresetVersions: + speakeasy-default-list-preset-versions: + parameters: + path: + slug: "my-preset" + responses: + "200": + application/json: {"data": [{"config": {"model": "openai/gpt-4o", "temperature": 0.7}, "created_at": "2026-04-20T10:00:00Z", "creator_id": "user_2dHFtVWx2n56w6HkM0000000000", "id": "550e8400-e29b-41d4-a716-446655440000", "preset_id": "650e8400-e29b-41d4-a716-446655440001", "system_prompt": "You are a helpful assistant.", "updated_at": "2026-04-20T10:00:00Z", "version": 1}], "total_count": 1} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + getPresetVersion: + speakeasy-default-get-preset-version: + parameters: + path: + slug: "my-preset" + version: "1" + responses: + "200": + application/json: {"data": {"config": {"model": "openai/gpt-4o", "temperature": 0.7}, "created_at": "2026-04-20T10:00:00Z", "creator_id": "user_2dHFtVWx2n56w6HkM0000000000", "id": "550e8400-e29b-41d4-a716-446655440000", "preset_id": "650e8400-e29b-41d4-a716-446655440001", "system_prompt": "You are a helpful assistant.", "updated_at": "2026-04-20T10:00:00Z", "version": 1}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 -releaseNotes: "## Go SDK Changes:\n* `OpenRouter.Guardrails.Update()`: \n * `request.UpdateGuardrailRequest` **Changed**\n * `response.Data` **Changed** (Breaking ⚠️)\n* `OpenRouter.ApiKeys.Create()`: \n * `request.Request` **Changed**\n * `response.Data` **Changed** (Breaking ⚠️)\n * `error.status[403]` **Added**\n* `OpenRouter.VideoGeneration.GetGeneration()`: `response.Usage.Cost` **Changed** (Breaking ⚠️)\n* `OpenRouter.VideoGeneration.Generate()`: \n * `request.Request` **Changed**\n * `response.Usage.Cost` **Changed** (Breaking ⚠️)\n* `OpenRouter.Beta.Responses.Send()`: \n * `request.Request` **Changed**\n * `response` **Changed** (Breaking ⚠️)\n* `OpenRouter.Models.ListForUser()`: `response.Data[]` **Changed** (Breaking ⚠️)\n* `OpenRouter.ApiKeys.Update()`: \n * `request.RequestBody.Limit` **Changed**\n * `response.Data` **Changed** (Breaking ⚠️)\n* `OpenRouter.ApiKeys.Get()`: `response.Data` **Changed** (Breaking ⚠️)\n* `OpenRouter.Guardrails.Create()`: \n * `request.Request` **Changed**\n * `response.Data` **Changed** (Breaking ⚠️)\n * `error.status[403]` **Added**\n* `OpenRouter.Chat.Send()`: \n * `request.Request` **Changed**\n * `response` **Changed** (Breaking ⚠️)\n* `OpenRouter.ApiKeys.List()`: \n * `request` **Changed**\n * `response.Data[]` **Changed** (Breaking ⚠️)\n* `OpenRouter.Embeddings.ListModels()`: `response.Data[]` **Changed** (Breaking ⚠️)\n* `OpenRouter.Endpoints.ListZdrEndpoints()`: `response.Data[]` **Changed** (Breaking ⚠️)\n* `OpenRouter.Endpoints.List()`: `response.Data` **Changed** (Breaking ⚠️)\n* `OpenRouter.Generations.GetGeneration()`: `response.Data` **Changed** (Breaking ⚠️)\n* `OpenRouter.Guardrails.List()`: \n * `request` **Changed**\n * `response.Data[]` **Changed** (Breaking ⚠️)\n* `OpenRouter.Guardrails.Get()`: `response.Data` **Changed** (Breaking ⚠️)\n* `OpenRouter.ApiKeys.GetCurrentKeyMetadata()`: `response.Data` **Changed** (Breaking ⚠️)\n* `OpenRouter.Models.List()`: `response.Data[]` **Changed** (Breaking ⚠️)\n* `OpenRouter.Tts.CreateSpeech()`: **Added**\n* `OpenRouter.Workspaces.Update()`: **Added**\n* `OpenRouter.Guardrails.ListKeyAssignments()`: `request.Offset` **Changed**\n* `OpenRouter.Guardrails.ListMemberAssignments()`: `request.Offset` **Changed**\n* `OpenRouter.Generations.ListGenerationContent()`: **Added**\n* `OpenRouter.Embeddings.Generate()`: \n * `request.Request.Provider` **Changed**\n * `response.Usage.PromptTokensDetails` **Added**\n* `OpenRouter.Workspaces.BulkRemoveMembers()`: **Added**\n* `OpenRouter.Guardrails.ListGuardrailKeyAssignments()`: `request.Offset` **Changed**\n* `OpenRouter.Guardrails.ListGuardrailMemberAssignments()`: `request.Offset` **Changed**\n* `OpenRouter.Workspaces.Get()`: **Added**\n* `OpenRouter.Workspaces.BulkAddMembers()`: **Added**\n* `OpenRouter.Organization.ListMembers()`: `request.Offset` **Changed**\n* `OpenRouter.Rerank.Rerank()`: \n * `request.Request.Provider` **Changed**\n* `OpenRouter.Workspaces.Delete()`: **Added**\n* `OpenRouter.Workspaces.Create()`: **Added**\n* `OpenRouter.Workspaces.List()`: **Added**\n* `OpenRouter.VideoGeneration.ListVideosModels()`: `response.Data[]` **Changed**\n" +releaseNotes: "## Go SDK Changes:\n* `OpenRouter.Chat.Send()`: \n * `request` **Changed** (Breaking ⚠️)\n * `response` **Changed**\n * `error` **Changed**\n* `OpenRouter.VideoGeneration.Generate()`: \n * `request.Request` **Changed** (Breaking ⚠️)\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Beta.Responses.Send()`: \n * `request` **Changed** (Breaking ⚠️)\n * `response` **Changed** (Breaking ⚠️)\n * `error` **Changed**\n* `OpenRouter.Rerank.Rerank()`: \n * `request.Request` **Changed** (Breaking ⚠️)\n * `response.Results[].Document` **Changed**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Models.ListForUser()`: \n * `response.Data[]` **Changed** (Breaking ⚠️)\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Models.List()`: \n * `request` **Changed** (Breaking ⚠️)\n * `response.Data[]` **Changed** (Breaking ⚠️)\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Generations.GetGeneration()`: \n * `response.Data` **Changed** (Breaking ⚠️)\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Endpoints.List()`: \n * `response.Data` **Changed** (Breaking ⚠️)\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Endpoints.ListZdrEndpoints()`: \n * `response.Data[].ProviderName` **Changed** (Breaking ⚠️)\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Embeddings.ListModels()`: \n * `response.Data[]` **Changed** (Breaking ⚠️)\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Embeddings.Generate()`: \n * `request.Request` **Changed** (Breaking ⚠️)\n * `response.Usage.PromptTokensDetails.FileTokens` **Added**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Observability.Create()`: **Added**\n* `OpenRouter.Guardrails.Delete()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Files.Upload()`: **Added**\n* `OpenRouter.Files.Delete()`: **Added**\n* `OpenRouter.Files.Retrieve()`: **Added**\n* `OpenRouter.Files.Download()`: **Added**\n* `OpenRouter.Models.Get()`: **Added**\n* `OpenRouter.Observability.List()`: **Added**\n* `OpenRouter.Beta.Analytics.GetAnalyticsMeta()`: **Added**\n* `OpenRouter.Observability.Delete()`: **Added**\n* `OpenRouter.Observability.Get()`: **Added**\n* `OpenRouter.Observability.Update()`: **Added**\n* `OpenRouter.Presets.List()`: **Added**\n* `OpenRouter.Presets.Get()`: **Added**\n* `OpenRouter.Presets.CreatePresetsChatCompletions()`: **Added**\n* `OpenRouter.Presets.CreatePresetsMessages()`: **Added**\n* `OpenRouter.Presets.CreatePresetsResponses()`: **Added**\n* `OpenRouter.Presets.ListVersions()`: **Added**\n* `OpenRouter.Presets.GetVersion()`: **Added**\n* `OpenRouter.Analytics.GetUserActivity()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Tts.CreateSpeech()`: \n * `request.Request.Provider.Options` **Changed**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.OAuth.ExchangeAuthCodeForApiKey()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.OAuth.CreateAuthCode()`: \n * `request.Request.WorkspaceId` **Added**\n * `error` **Changed**\n* `OpenRouter.Datasets.GetRankingsDaily()`: **Added**\n* `OpenRouter.Credits.GetCredits()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Datasets.GetBenchmarksDesignArena()`: **Added**\n* `OpenRouter.Datasets.GetBenchmarksArtificialAnalysis()`: **Added**\n* `OpenRouter.Datasets.GetAppRankings()`: **Added**\n* `OpenRouter.Byok.Update()`: **Added**\n* `OpenRouter.Byok.Get()`: **Added**\n* `OpenRouter.Generations.ListGenerationContent()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Guardrails.List()`: \n * `response.Data[]` **Changed**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Guardrails.Create()`: \n * `request.Request` **Changed**\n * `response.Data` **Changed**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Files.List()`: **Added**\n* `OpenRouter.Guardrails.Get()`: \n * `response.Data` **Changed**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Guardrails.Update()`: \n * `request.UpdateGuardrailRequest` **Changed**\n * `response.Data` **Changed**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Guardrails.ListGuardrailKeyAssignments()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Guardrails.BulkAssignKeys()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Guardrails.BulkUnassignKeys()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Guardrails.ListGuardrailMemberAssignments()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Guardrails.BulkAssignMembers()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Guardrails.BulkUnassignMembers()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Guardrails.ListKeyAssignments()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Guardrails.ListMemberAssignments()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.ApiKeys.GetCurrentKeyMetadata()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.ApiKeys.List()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.ApiKeys.Create()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.ApiKeys.Delete()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.ApiKeys.Get()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.ApiKeys.Update()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Byok.Delete()`: **Added**\n* `OpenRouter.Models.Count()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Byok.Create()`: **Added**\n* `OpenRouter.Organization.ListMembers()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Providers.List()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Byok.List()`: **Added**\n* `OpenRouter.Stt.CreateTranscription()`: **Added**\n* `OpenRouter.Beta.Analytics.QueryAnalytics()`: **Added**\n* `OpenRouter.VideoGeneration.GetGeneration()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.VideoGeneration.GetVideoContent()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.VideoGeneration.ListVideosModels()`: \n * `response.Data[]` **Changed**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Workspaces.List()`: \n * `response.Data[]` **Changed**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Workspaces.Create()`: \n * `request.Request` **Changed**\n * `response.Data` **Changed**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Workspaces.Delete()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Workspaces.Get()`: \n * `response.Data` **Changed**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Workspaces.Update()`: \n * `request.UpdateWorkspaceRequest` **Changed**\n * `response.Data` **Changed**\n * `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Workspaces.BulkAddMembers()`: `error.OpenrouterMetadata` **Added**\n* `OpenRouter.Workspaces.BulkRemoveMembers()`: `error.OpenrouterMetadata` **Added**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 3ec8c635..26b11705 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -35,7 +35,7 @@ generation: skipResponseBodyAssertions: false preApplyUnionDiscriminators: true go: - version: 0.4.1 + version: 0.5.0 additionalDependencies: {} baseErrorName: OpenRouterError clientServerStatusCodesAsErrors: true diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 044ee507..d89c5db4 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -16,6 +16,36 @@ components: description: | The app display name allows you to customize how your app appears in OpenRouter's dashboard. schemas: + AABenchmarkEntry: + description: Artificial Analysis benchmark index scores. + example: + agentic_index: 55.8 + coding_index: 63.2 + intelligence_index: 71.4 + properties: + agentic_index: + description: Artificial Analysis Agentic Index score + example: 55.8 + format: double + nullable: true + type: number + coding_index: + description: Artificial Analysis Coding Index score + example: 63.2 + format: double + nullable: true + type: number + intelligence_index: + description: Artificial Analysis Intelligence Index score + example: 71.4 + format: double + nullable: true + type: number + required: + - intelligence_index + - coding_index + - agentic_index + type: object ActivityItem: example: byok_usage_inference: 0.012 @@ -112,6 +142,122 @@ components: required: - data type: object + AdvisorNestedTool: + additionalProperties: + nullable: true + description: >- + A tool made available to the advisor sub-agent. Only OpenRouter server tools (e.g. openrouter:web_search) are supported; function tools are rejected because the advisor has no way to execute them. The advisor tool may not list itself. + example: + type: openrouter:web_search + properties: + parameters: + additionalProperties: + nullable: true + type: object + type: + type: string + required: + - type + type: object + AdvisorReasoning: + description: >- + Reasoning configuration forwarded to the advisor call. Use this to control reasoning effort and token budget for models that support extended thinking. + example: + effort: high + properties: + effort: + description: Reasoning effort level for the advisor call. + enum: + - xhigh + - high + - medium + - low + - minimal + - none + type: string + x-speakeasy-unknown-values: allow + max_tokens: + description: Maximum number of reasoning tokens the advisor may use. + type: integer + type: object + AdvisorServerTool_OpenRouter: + description: >- + OpenRouter built-in server tool: consults a higher-intelligence advisor model (any OpenRouter model) for guidance mid-generation and returns its response. The advisor may run as a sub-agent with its own tools. Include multiple entries to offer several named advisors; at most one entry may omit `name` to act as the default advisor. + example: + parameters: + model: ~anthropic/claude-opus-latest + name: reviewer + type: openrouter:advisor + properties: + parameters: + $ref: '#/components/schemas/AdvisorServerToolConfig' + type: + enum: + - openrouter:advisor + type: string + required: + - type + type: object + AdvisorServerToolConfig: + description: Configuration for one openrouter:advisor server tool entry. + example: + model: ~anthropic/claude-opus-latest + name: reviewer + properties: + forward_transcript: + description: >- + When true, the full parent conversation is forwarded to the advisor so it sees the same context the executor does (and the tool-call `prompt`, if given, is appended as a final user turn). When false or omitted, the advisor receives only the `prompt` the executor passes in the tool call. + example: false + type: boolean + instructions: + description: >- + System instructions for the advisor sub-agent. When omitted, the advisor responds with no system prompt of its own. + example: You are a senior staff engineer. Give a focused, decisive plan. + type: string + max_completion_tokens: + description: >- + Maximum number of output tokens (including reasoning) the advisor may produce. When omitted, the provider's default applies. + example: 2048 + type: integer + max_tool_calls: + description: >- + Maximum number of tool-calling steps the advisor sub-agent may take during its agentic loop. Capped at 25. Only relevant when the advisor is given tools. + example: 5 + maximum: 25 + minimum: 1 + type: integer + model: + description: >- + Slug of the advisor model to consult (any OpenRouter model). When omitted, the executor can choose it via the tool call's `model` argument; if neither is set, the model from the outer API request is used. The advisor tool itself cannot be the advisor model. + example: ~anthropic/claude-opus-latest + type: string + name: + description: >- + Optional name for this advisor. The model sees one tool per named advisor (and one default for an unnamed entry). Names must be unique across advisor entries. Letters, digits, spaces, underscores, and dashes; trimmed; 1–64 chars. + example: reviewer + maxLength: 64 + minLength: 1 + pattern: ^[a-zA-Z0-9 _-]+$ + type: string + reasoning: + $ref: '#/components/schemas/AdvisorReasoning' + stream: + description: >- + When true, the advisor's advice streams incrementally as it is produced. In the Responses API this emits `response.output_text.delta` events targeting the advisor output item; the final `advice` field is still set on the completed item. Has no effect on the Chat Completions API (where the advice arrives only as the final tool result). When false or omitted, the advice arrives only as the final result. + example: false + type: boolean + temperature: + description: Sampling temperature forwarded to the advisor call. When omitted, the provider's default applies. + example: 0.7 + format: double + type: number + tools: + description: >- + Tools the advisor sub-agent may use while forming its advice. The advisor runs as an agentic sub-agent over these tools, then returns its text. Only OpenRouter server tools are supported — function tools are rejected — and the list must not include the advisor tool itself. + items: + $ref: '#/components/schemas/AdvisorNestedTool' + type: array + type: object AnnotationAddedEvent: allOf: - $ref: '#/components/schemas/BaseAnnotationAddedEvent' @@ -131,6 +277,62 @@ components: output_index: 0 sequence_number: 5 type: response.output_text.annotation.added + AnthropicAdvisorMessageUsageIteration: + allOf: + - $ref: '#/components/schemas/AnthropicBaseUsageIteration' + - properties: + model: + type: string + type: + enum: + - advisor_message + type: string + required: + - type + - model + type: object + example: + cache_creation: null + cache_creation_input_tokens: 0 + cache_read_input_tokens: 0 + input_tokens: 823 + model: claude-opus-4-6 + output_tokens: 1612 + type: advisor_message + AnthropicAdvisorToolResult: + example: + content: + text: Advisor response text + type: advisor_result + tool_use_id: srvtoolu_01abc + type: advisor_tool_result + properties: + content: + additionalProperties: + nullable: true + type: object + tool_use_id: + type: string + type: + enum: + - advisor_tool_result + type: string + required: + - type + - tool_use_id + - content + type: object + AnthropicAllowedCallers: + example: + - direct + items: + enum: + - direct + - code_execution_20250825 + - code_execution_20260120 + type: string + x-speakeasy-unknown-values: allow + type: array AnthropicBase64ImageSource: example: data: /9j/4AAQ... @@ -296,6 +498,8 @@ components: - type type: object AnthropicCacheControlDirective: + description: >- + Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. example: type: ephemeral properties: @@ -550,6 +754,7 @@ components: - end_page_number type: object AnthropicCitationsConfig: + default: null example: enabled: true nullable: true @@ -851,7 +1056,6 @@ components: - document type: string required: - - citations - source - title - type @@ -1025,6 +1229,8 @@ components: allOf: - $ref: '#/components/schemas/AnthropicBaseUsageIteration' - properties: + model: + type: string type: enum: - message @@ -1039,6 +1245,16 @@ components: input_tokens: 100 output_tokens: 50 type: message + AnthropicOutputTokensDetails: + example: + thinking_tokens: 0 + nullable: true + properties: + thinking_tokens: + type: integer + required: + - thinking_tokens + type: object AnthropicPlainTextSource: example: data: Hello, world! @@ -1146,18 +1362,6 @@ components: example: unavailable type: string x-speakeasy-unknown-values: allow - AnthropicServerToolName: - enum: - - web_search - - web_fetch - - code_execution - - bash_code_execution - - text_editor_code_execution - - tool_search_tool_regex - - tool_search_tool_bm25 - example: web_search - type: string - x-speakeasy-unknown-values: allow AnthropicServerToolUsage: example: web_fetch_requests: 0 @@ -1172,34 +1376,6 @@ components: - web_search_requests - web_fetch_requests type: object - AnthropicServerToolUseBlock: - example: - caller: - type: direct - id: srvtoolu_01abc - input: - query: latest news - name: web_search - type: server_tool_use - properties: - caller: - $ref: '#/components/schemas/AnthropicCaller' - id: - type: string - input: - nullable: true - name: - $ref: '#/components/schemas/AnthropicServerToolName' - type: - enum: - - server_tool_use - type: string - required: - - type - - id - - caller - - name - type: object AnthropicServiceTier: enum: - standard @@ -1709,6 +1885,7 @@ components: inference_geo: null input_tokens: 100 output_tokens: 50 + output_tokens_details: null server_tool_use: null service_tier: standard properties: @@ -1727,6 +1904,8 @@ components: type: integer output_tokens: type: integer + output_tokens_details: + $ref: '#/components/schemas/AnthropicOutputTokensDetails' server_tool_use: $ref: '#/components/schemas/AnthropicServerToolUsage' service_tier: @@ -1734,6 +1913,7 @@ components: required: - input_tokens - output_tokens + - output_tokens_details - cache_creation_input_tokens - cache_read_input_tokens - cache_creation @@ -1745,6 +1925,7 @@ components: anyOf: - $ref: '#/components/schemas/AnthropicCompactionUsageIteration' - $ref: '#/components/schemas/AnthropicMessageUsageIteration' + - $ref: '#/components/schemas/AnthropicAdvisorMessageUsageIteration' - $ref: '#/components/schemas/AnthropicUnknownUsageIteration' example: cache_creation: null @@ -1998,65 +2179,396 @@ components: required: - type type: object - ApplyPatchServerTool: - description: Apply patch tool configuration - example: - type: apply_patch + ApplyPatchCallItem: + description: >- + A tool call emitted by the model requesting a V4A patch operation. The client applies the patch and echoes an `apply_patch_call_output` on the next turn. + example: + call_id: call_abc123 + id: apc_abc123 + operation: + diff: |- + @@ function main() { + + console.log("hi"); + } + path: /src/main.ts + type: update_file + status: completed + type: apply_patch_call properties: + call_id: + type: string + id: + nullable: true + type: string + operation: + $ref: '#/components/schemas/ApplyPatchCallOperation' + status: + $ref: '#/components/schemas/ApplyPatchCallStatus' type: enum: - - apply_patch + - apply_patch_call type: string required: - type + - call_id + - status + - operation type: object - AutoRouterPlugin: + ApplyPatchCallOperation: + description: >- + The patch operation requested by an `apply_patch_call`. `create_file` and `update_file` carry a V4A diff; `delete_file` omits it. + discriminator: + mapping: + create_file: '#/components/schemas/ApplyPatchCreateFileOperation' + delete_file: '#/components/schemas/ApplyPatchDeleteFileOperation' + update_file: '#/components/schemas/ApplyPatchUpdateFileOperation' + propertyName: type example: - allowed_models: - - anthropic/* - - openai/gpt-4o - enabled: true - id: auto-router + diff: |- + @@ function main() { + + console.log("hi"); + } + path: /src/main.ts + type: update_file + oneOf: + - $ref: '#/components/schemas/ApplyPatchCreateFileOperation' + - $ref: '#/components/schemas/ApplyPatchUpdateFileOperation' + - $ref: '#/components/schemas/ApplyPatchDeleteFileOperation' + ApplyPatchCallOperationDiffDeltaEvent: + description: Incremental chunk of `operation.diff` for an `apply_patch_call`. Matches OpenAI's streaming shape. + example: + delta: | + +console.log("hi"); + item_id: apc_abc123 + output_index: 0 + sequence_number: 5 + type: response.apply_patch_call_operation_diff.delta properties: - allowed_models: - description: >- - List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, uses the default supported models list. - example: - - anthropic/* - - openai/gpt-4o - - google/* - items: - type: string - type: array - enabled: - description: Set to false to disable the auto-router plugin for this request. Defaults to true. - type: boolean - id: + delta: + type: string + item_id: + type: string + output_index: + type: integer + sequence_number: + type: integer + type: enum: - - auto-router + - response.apply_patch_call_operation_diff.delta type: string required: - - id + - type + - item_id + - output_index + - delta + - sequence_number type: object - BadGatewayResponse: - description: Bad Gateway - Provider/upstream API failure + ApplyPatchCallOperationDiffDoneEvent: + description: Emitted when `operation.diff` streaming completes for an `apply_patch_call`. example: - error: - code: 502 - message: Provider returned error + diff: | + @@ + +console.log("hi"); + item_id: apc_abc123 + output_index: 0 + sequence_number: 12 + type: response.apply_patch_call_operation_diff.done properties: - error: - $ref: '#/components/schemas/BadGatewayResponseErrorData' - user_id: - nullable: true + diff: + type: string + item_id: + type: string + output_index: + type: integer + sequence_number: + type: integer + type: + enum: + - response.apply_patch_call_operation_diff.done type: string required: - - error + - type + - item_id + - output_index + - diff + - sequence_number type: object - BadGatewayResponseErrorData: - description: Error data for BadGatewayResponse + ApplyPatchCallOutputItem: + description: >- + The client's echo of an `apply_patch_call` after applying the patch. `output` is an optional human-readable log; `status` is `completed` when the patch was applied successfully, `failed` otherwise. example: - code: 502 + call_id: call_abc123 + output: Applied patch to /src/main.ts + status: completed + type: apply_patch_call_output + properties: + call_id: + type: string + id: + nullable: true + type: string + output: + nullable: true + type: string + status: + enum: + - completed + - failed + type: string + x-speakeasy-unknown-values: allow + type: + enum: + - apply_patch_call_output + type: string + required: + - type + - call_id + - status + type: object + ApplyPatchCallStatus: + description: Lifecycle state of an `apply_patch_call` output item. + enum: + - in_progress + - completed + example: completed + type: string + x-speakeasy-unknown-values: allow + ApplyPatchCreateFileOperation: + description: >- + The `create_file` variant of an `apply_patch_call.operation`. Carries a V4A diff describing the new file contents. + example: + diff: | + @@ + +console.log("hi"); + path: /src/main.ts + type: create_file + properties: + diff: + type: string + path: + type: string + type: + enum: + - create_file + type: string + required: + - type + - path + - diff + type: object + ApplyPatchDeleteFileOperation: + description: >- + The `delete_file` variant of an `apply_patch_call.operation`. Identifies the file to remove; no diff is required. + example: + path: /src/main.ts + type: delete_file + properties: + path: + type: string + type: + enum: + - delete_file + type: string + required: + - type + - path + type: object + ApplyPatchEngineEnum: + description: >- + Which apply_patch engine to use. "auto" (default) uses native passthrough when the endpoint advertises native apply_patch support, otherwise falls back to OpenRouter's HITL validator. "native" forces native passthrough — when the endpoint does not support native, the request falls back to HITL. "openrouter" always runs the HITL validator. Native passthrough streams the diff incrementally via `apply_patch_call_operation_diff.delta` events; HITL buffers the diff for atomic delivery as a single delta. + enum: + - auto + - native + - openrouter + example: auto + type: string + x-speakeasy-unknown-values: allow + ApplyPatchServerTool: + description: Apply patch tool configuration + example: + type: apply_patch + properties: + type: + enum: + - apply_patch + type: string + required: + - type + type: object + ApplyPatchServerTool_OpenRouter: + description: >- + OpenRouter built-in server tool: validates V4A diff patches for file operations (create, update, delete). Restricted to the Responses API. + example: + type: openrouter:apply_patch + properties: + parameters: + $ref: '#/components/schemas/ApplyPatchServerToolConfig' + type: + enum: + - openrouter:apply_patch + type: string + required: + - type + type: object + ApplyPatchServerToolConfig: + description: Configuration for the openrouter:apply_patch server tool + example: + engine: auto + properties: + engine: + $ref: '#/components/schemas/ApplyPatchEngineEnum' + type: object + ApplyPatchUpdateFileOperation: + description: >- + The `update_file` variant of an `apply_patch_call.operation`. Carries a V4A diff describing edits to an existing file. + example: + diff: |- + @@ function main() { + + console.log("hi"); + } + path: /src/main.ts + type: update_file + properties: + diff: + type: string + path: + type: string + type: + enum: + - update_file + type: string + required: + - type + - path + - diff + type: object + AppRankingsItem: + example: + app_id: 12345 + app_name: Cline + rank: 1 + total_requests: 4321 + total_tokens: '12345678' + properties: + app_id: + description: Stable numeric identifier of the app on OpenRouter. + example: 12345 + type: integer + app_name: + description: Public display name of the app. + example: Cline + type: string + rank: + description: 1-based position of the app within this response, per the requested `sort`. + example: 1 + type: integer + total_requests: + description: Number of requests attributed to the app inside the date window. + example: 4321 + type: integer + total_tokens: + description: >- + Sum of `prompt_tokens + completion_tokens` attributed to the app inside the date window, returned as a decimal string so 64-bit values are not truncated. + example: '12345678' + type: string + required: + - rank + - app_id + - app_name + - total_tokens + - total_requests + type: object + AppRankingsResponse: + example: + data: + - app_id: 12345 + app_name: Cline + rank: 1 + total_requests: 4321 + total_tokens: '12345678' + - app_id: 67890 + app_name: Roo Code + rank: 2 + total_requests: 2109 + total_tokens: '9876543' + meta: + as_of: '2026-05-12T02:00:00Z' + end_date: '2026-05-11' + start_date: '2026-04-12' + version: v1 + properties: + data: + description: >- + Apps ranked per the requested `sort`, re-numbered 1..N after category filtering. `popular` sorts by `total_tokens` descending; `trending` sorts by absolute excess token growth descending and may return fewer than `limit` rows when few apps are growing. + items: + $ref: '#/components/schemas/AppRankingsItem' + type: array + meta: + $ref: '#/components/schemas/RankingsDailyMeta' + required: + - data + - meta + type: object + AutoRouterPlugin: + example: + allowed_models: + - anthropic/* + - openai/gpt-4o + cost_quality_tradeoff: 7 + enabled: true + id: auto-router + properties: + allowed_models: + description: >- + List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, uses the default supported models list. + example: + - anthropic/* + - openai/gpt-4o + - google/* + items: + type: string + type: array + cost_quality_tradeoff: + description: >- + Controls cost vs. quality routing tradeoff (0–10). 0 = pure quality (best model regardless of cost), 10 = maximize for cost (cheapest model wins). Intermediate values blend quality and cost signals continuously. Defaults to 7. + example: 7 + maximum: 10 + minimum: 0 + type: integer + enabled: + description: Set to false to disable the auto-router plugin for this request. Defaults to true. + type: boolean + id: + enum: + - auto-router + type: string + required: + - id + type: object + BadGatewayResponse: + description: Bad Gateway - Provider/upstream API failure + example: + error: + code: 502 + message: Provider returned error + properties: + error: + $ref: '#/components/schemas/BadGatewayResponseErrorData' + openrouter_metadata: + additionalProperties: + nullable: true + nullable: true + type: object + user_id: + nullable: true + type: string + required: + - error + type: object + BadGatewayResponseErrorData: + description: Error data for BadGatewayResponse + example: + code: 502 message: Provider returned error properties: code: @@ -2081,6 +2593,11 @@ components: properties: error: $ref: '#/components/schemas/BadRequestResponseErrorData' + openrouter_metadata: + additionalProperties: + nullable: true + nullable: true + type: object user_id: nullable: true type: string @@ -2221,6 +2738,66 @@ components: - part - sequence_number type: object + BaseCustomToolCallInputDeltaEvent: + description: >- + Event emitted when a custom tool call's freeform input is being streamed. Mirrors `response.function_call_arguments.delta` but for `custom` tools whose input is opaque text rather than JSON arguments. + example: + delta: '*** Begin Patch' + item_id: item-1 + output_index: 0 + sequence_number: 4 + type: response.custom_tool_call_input.delta + properties: + delta: + type: string + item_id: + type: string + output_index: + type: integer + sequence_number: + type: integer + type: + enum: + - response.custom_tool_call_input.delta + type: string + required: + - type + - item_id + - output_index + - delta + - sequence_number + type: object + BaseCustomToolCallInputDoneEvent: + description: >- + Event emitted when a custom tool call's freeform input streaming is complete. Mirrors `response.function_call_arguments.done` but for `custom` tools. + example: + input: |- + *** Begin Patch + *** End Patch + item_id: item-1 + output_index: 0 + sequence_number: 6 + type: response.custom_tool_call_input.done + properties: + input: + type: string + item_id: + type: string + output_index: + type: integer + sequence_number: + type: integer + type: + enum: + - response.custom_tool_call_input.done + type: string + required: + - type + - item_id + - output_index + - input + - sequence_number + type: object BaseErrorEvent: description: Event emitted when an error occurs during streaming example: @@ -2370,6 +2947,10 @@ components: - $ref: '#/components/schemas/OpenAIResponseFunctionToolCall' - $ref: '#/components/schemas/OutputItemImageGenerationCall' - $ref: '#/components/schemas/OutputMessage' + - $ref: '#/components/schemas/OpenAIResponseCustomToolCall' + - $ref: '#/components/schemas/OpenAIResponseCustomToolCallOutput' + - $ref: '#/components/schemas/ApplyPatchCallItem' + - $ref: '#/components/schemas/ApplyPatchCallOutputItem' type: array - nullable: true example: @@ -2380,7 +2961,7 @@ components: example: container: null content: - - citations: null + - citations: [] text: Hello! type: text id: msg_01XFDUDYJgAACzvnptvVoYEL @@ -2439,6 +3020,7 @@ components: inference_geo: null input_tokens: 100 output_tokens: 50 + output_tokens_details: null server_tool_use: null service_tier: standard required: @@ -2782,6 +3364,8 @@ components: items: discriminator: mapping: + apply_patch_call: '#/components/schemas/OutputItemApplyPatchCall' + custom_tool_call: '#/components/schemas/OutputItemCustomToolCall' file_search_call: '#/components/schemas/OutputItemFileSearchCall' function_call: '#/components/schemas/OutputItemFunctionCall' image_generation_call: '#/components/schemas/OutputItemImageGenerationCall' @@ -2793,9 +3377,11 @@ components: - $ref: '#/components/schemas/OutputMessage' - $ref: '#/components/schemas/OutputItemReasoning' - $ref: '#/components/schemas/OutputItemFunctionCall' + - $ref: '#/components/schemas/OutputItemCustomToolCall' - $ref: '#/components/schemas/OutputItemWebSearchCall' - $ref: '#/components/schemas/OutputItemFileSearchCall' - $ref: '#/components/schemas/OutputItemImageGenerationCall' + - $ref: '#/components/schemas/OutputItemApplyPatchCall' type: array output_text: type: string @@ -2981,32 +3567,427 @@ components: - sequence_number - logprobs type: object - BigNumberUnion: - description: Price per million prompt tokens - example: 1000 - type: string - BulkAddWorkspaceMembersRequest: + BashServerTool: + description: 'OpenRouter built-in server tool: runs shell commands server-side in a sandboxed container' example: - user_ids: - - user_abc123 - - user_def456 + parameters: + environment: + type: container_auto + type: openrouter:bash properties: - user_ids: - description: List of user IDs to add to the workspace. Members are assigned the same role they hold in the organization. - example: - - user_abc123 - - user_def456 - items: - type: string - maxItems: 100 - minItems: 1 - type: array + parameters: + $ref: '#/components/schemas/BashServerToolConfig' + type: + enum: + - openrouter:bash + type: string required: - - user_ids + - type type: object - BulkAddWorkspaceMembersResponse: + BashServerToolConfig: + description: Configuration for the openrouter:bash server tool example: - added_count: 1 + environment: + type: container_auto + properties: + engine: + $ref: '#/components/schemas/BashServerToolEngine' + environment: + $ref: '#/components/schemas/BashServerToolEnvironment' + sleep_after_seconds: + $ref: '#/components/schemas/SandboxSleepAfterSeconds' + type: object + BashServerToolEngine: + description: >- + Which bash engine to use. "openrouter" runs commands server-side in the OpenRouter sandbox. "auto" (default) and "native" use native passthrough, returning the tool call to your application to run client-side; OpenRouter does not execute the commands. + enum: + - auto + - native + - openrouter + example: auto + type: string + x-speakeasy-unknown-values: allow + BashServerToolEnvironment: + description: Execution environment for the bash server tool. + discriminator: + mapping: + container_auto: '#/components/schemas/ContainerAutoEnvironment' + container_reference: '#/components/schemas/ContainerReferenceEnvironment' + propertyName: type + example: + type: container_auto + oneOf: + - $ref: '#/components/schemas/ContainerAutoEnvironment' + - $ref: '#/components/schemas/ContainerReferenceEnvironment' + BenchmarkPricing: + description: OpenRouter pricing per token for this model. Null if pricing is unavailable. + example: + completion: '0.000015' + prompt: '0.000003' + nullable: true + properties: + completion: + description: Cost per output token (USD, decimal string). + example: '0.000015' + type: string + prompt: + description: Cost per input token (USD, decimal string). + example: '0.000003' + type: string + required: + - prompt + - completion + type: object + BenchmarksAAItem: + example: + aa_name: GPT-4o + agentic_index: 58.3 + coding_index: 65.8 + intelligence_index: 71.2 + model_permaslug: openai/gpt-4o + pricing: + completion: '0.00001' + prompt: '0.0000025' + properties: + aa_name: + description: Model name as listed on Artificial Analysis. + example: GPT-4o + type: string + agentic_index: + description: Artificial Analysis Agentic Index composite score. Higher is better. + example: 58.3 + format: double + nullable: true + type: number + coding_index: + description: Artificial Analysis Coding Index composite score. Higher is better. + example: 65.8 + format: double + nullable: true + type: number + intelligence_index: + description: Artificial Analysis Intelligence Index composite score. Higher is better. + example: 71.2 + format: double + nullable: true + type: number + model_permaslug: + description: Stable OpenRouter model identifier. + example: openai/gpt-4o + type: string + pricing: + $ref: '#/components/schemas/BenchmarkPricing' + required: + - model_permaslug + - aa_name + - intelligence_index + - coding_index + - agentic_index + - pricing + type: object + BenchmarksAAMeta: + example: + as_of: '2026-06-03T12:00:00Z' + citation: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' + model_count: 50 + source: artificial-analysis + source_url: https://artificialanalysis.ai + version: v1 + properties: + as_of: + description: ISO-8601 timestamp of when this data was last updated. + example: '2026-06-03T12:00:00Z' + type: string + citation: + description: Required attribution when republishing this data. + example: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' + type: string + model_count: + description: Number of unique models in the response. + type: integer + source: + description: Data source identifier. + enum: + - artificial-analysis + type: string + source_url: + description: URL of the upstream data source. + enum: + - https://artificialanalysis.ai + type: string + version: + description: Dataset version. + enum: + - v1 + type: string + required: + - as_of + - version + - source + - source_url + - citation + - model_count + type: object + BenchmarksAAResponse: + example: + data: + - aa_name: GPT-4o + agentic_index: 58.3 + coding_index: 65.8 + intelligence_index: 71.2 + model_permaslug: openai/gpt-4o + pricing: + completion: '0.00001' + prompt: '0.0000025' + meta: + as_of: '2026-06-03T12:00:00Z' + citation: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' + model_count: 1 + source: artificial-analysis + source_url: https://artificialanalysis.ai + version: v1 + properties: + data: + items: + $ref: '#/components/schemas/BenchmarksAAItem' + type: array + meta: + $ref: '#/components/schemas/BenchmarksAAMeta' + required: + - data + - meta + type: object + BenchmarksDAItem: + example: + arena: models + avg_generation_time_ms: 3200 + category: codecategories + display_name: Claude Sonnet 4 + elo: 1423 + model_permaslug: anthropic/claude-sonnet-4 + pricing: + completion: '0.000015' + prompt: '0.000003' + tournament_stats: + first_place: 12 + fourth_place: 2 + second_place: 8 + third_place: 5 + total: 27 + win_rate: 72 + properties: + arena: + description: Arena this ranking belongs to. + example: models + type: string + avg_generation_time_ms: + description: Average generation time in milliseconds. + example: 3200 + format: double + nullable: true + type: number + category: + description: Category within the arena. + example: codecategories + type: string + display_name: + description: Human-readable model name from Design Arena. + example: Claude Sonnet 4 + type: string + elo: + description: ELO rating from head-to-head arena battles. + example: 1423 + format: double + type: number + model_permaslug: + description: >- + Stable OpenRouter model identifier when the model is on OpenRouter; otherwise the upstream Design Arena model id. Use pricing != null to detect OpenRouter-mapped models. + example: anthropic/claude-sonnet-4 + type: string + pricing: + $ref: '#/components/schemas/BenchmarkPricing' + tournament_stats: + description: Placement distribution from tournament matches. + properties: + first_place: + nullable: true + type: integer + fourth_place: + nullable: true + type: integer + second_place: + nullable: true + type: integer + third_place: + nullable: true + type: integer + total: + nullable: true + type: integer + required: + - first_place + - second_place + - third_place + - fourth_place + - total + type: object + win_rate: + description: Win rate as a percentage (0–100). + example: 72 + format: double + type: number + required: + - model_permaslug + - display_name + - arena + - category + - elo + - win_rate + - avg_generation_time_ms + - tournament_stats + - pricing + type: object + BenchmarksDAMeta: + example: + arena: models + as_of: '2026-06-03T12:00:00Z' + category: null + citation: 'Source: Design Arena (www.designarena.ai) via OpenRouter (openrouter.ai/rankings).' + elo_bounds: + max: 1600 + min: 900 + model_count: 50 + source: design-arena + source_url: https://www.designarena.ai + version: v1 + properties: + arena: + description: The arena filter applied. + type: string + as_of: + description: ISO-8601 timestamp of when this data was generated. + example: '2026-06-03T12:00:00Z' + type: string + category: + description: The category filter applied, or null if showing all. + nullable: true + type: string + citation: + description: Required attribution when republishing this data. + example: 'Source: Design Arena (www.designarena.ai) via OpenRouter (openrouter.ai/rankings).' + type: string + elo_bounds: + description: ELO range across all returned models for normalization. + properties: + max: + description: Maximum ELO in the result set. + format: double + type: number + min: + description: Minimum ELO in the result set. + format: double + type: number + required: + - min + - max + type: object + model_count: + description: Number of unique models in the response. + type: integer + source: + description: Data source identifier. + enum: + - design-arena + type: string + source_url: + description: URL of the upstream data source. + enum: + - https://www.designarena.ai + type: string + version: + description: Dataset version. + enum: + - v1 + type: string + required: + - as_of + - version + - source + - source_url + - citation + - model_count + - arena + - category + - elo_bounds + type: object + BenchmarksDAResponse: + example: + data: + - arena: models + avg_generation_time_ms: 3200 + category: codecategories + display_name: Claude Sonnet 4 + elo: 1423 + model_permaslug: anthropic/claude-sonnet-4 + pricing: + completion: '0.000015' + prompt: '0.000003' + tournament_stats: + first_place: 12 + fourth_place: 2 + second_place: 8 + third_place: 5 + total: 27 + win_rate: 72 + meta: + arena: models + as_of: '2026-06-03T12:00:00Z' + category: null + citation: 'Source: Design Arena (www.designarena.ai) via OpenRouter (openrouter.ai/rankings).' + elo_bounds: + max: 1600 + min: 900 + model_count: 1 + source: design-arena + source_url: https://www.designarena.ai + version: v1 + properties: + data: + items: + $ref: '#/components/schemas/BenchmarksDAItem' + type: array + meta: + $ref: '#/components/schemas/BenchmarksDAMeta' + required: + - data + - meta + type: object + BigNumberUnion: + description: Price per million prompt tokens + example: 1000 + type: string + BulkAddWorkspaceMembersRequest: + example: + user_ids: + - user_abc123 + - user_def456 + properties: + user_ids: + description: List of user IDs to add to the workspace. Members are assigned the same role they hold in the organization. + example: + - user_abc123 + - user_def456 + items: + type: string + maxItems: 100 + minItems: 1 + type: array + required: + - user_ids + type: object + BulkAddWorkspaceMembersResponse: + example: + added_count: 1 data: - created_at: '2025-08-24T10:30:00Z' id: 660e8400-e29b-41d4-a716-446655440000 @@ -3173,6 +4154,188 @@ components: required: - unassigned_count type: object + BYOKKey: + example: + allowed_api_key_hashes: null + allowed_models: null + allowed_user_ids: null + created_at: '2025-08-24T10:30:00Z' + disabled: false + id: 11111111-2222-3333-4444-555555555555 + is_fallback: false + label: sk-...AbCd + name: Production OpenAI Key + provider: openai + sort_order: 0 + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + properties: + allowed_api_key_hashes: + description: >- + Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) that may use this credential. `null` means no restriction. + example: + - f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 + items: + type: string + maxItems: 100 + nullable: true + type: array + allowed_models: + description: Optional allowlist of model slugs this credential may be used for. `null` means no restriction. + example: null + items: + type: string + maxItems: 100 + nullable: true + type: array + allowed_user_ids: + description: Optional allowlist of user IDs that may use this credential. `null` means no restriction. + example: null + items: + type: string + maxItems: 100 + nullable: true + type: array + created_at: + description: ISO timestamp of when the credential was created. + example: '2025-08-24T10:30:00Z' + type: string + disabled: + description: Whether this credential is currently disabled. + example: false + type: boolean + id: + description: Stable public identifier for this BYOK credential. + example: 11111111-2222-3333-4444-555555555555 + format: uuid + type: string + is_fallback: + description: >- + Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried. + example: false + type: boolean + label: + description: Short masked snippet of the key (e.g. the first/last few characters) used to identify it in the UI. + example: sk-...AbCd + type: string + name: + description: Optional human-readable name for the credential. + example: Production OpenAI Key + nullable: true + type: string + provider: + $ref: '#/components/schemas/BYOKProviderSlug' + sort_order: + description: Position within the provider — credentials are tried in ascending sort order. + example: 0 + type: integer + workspace_id: + description: ID of the workspace this credential belongs to. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + required: + - id + - provider + - workspace_id + - label + - disabled + - is_fallback + - allowed_models + - allowed_api_key_hashes + - allowed_user_ids + - sort_order + - created_at + type: object + BYOKProviderSlug: + description: >- + The upstream provider this credential authenticates against, as a lowercase slug (e.g. `openai`, `anthropic`, `amazon-bedrock`). + enum: + - ai21 + - aion-labs + - akashml + - alibaba + - amazon-bedrock + - amazon-nova + - ambient + - anthropic + - arcee-ai + - atlas-cloud + - avian + - azure + - baidu + - baseten + - black-forest-labs + - byteplus + - cerebras + - chutes + - cirrascale + - clarifai + - cloudflare + - cohere + - crusoe + - darkbloom + - decart + - deepinfra + - deepseek + - dekallm + - digitalocean + - featherless + - fireworks + - friendli + - gmicloud + - google-ai-studio + - google-vertex + - groq + - inception + - inceptron + - inference-net + - infermatic + - inflection + - io-net + - ionstream + - liquid + - mancer + - mara + - minimax + - mistral + - modelrun + - modular + - moonshotai + - morph + - ncompass + - nebius + - nex-agi + - nextbit + - novita + - nvidia + - open-inference + - openai + - parasail + - perceptron + - perplexity + - phala + - poolside + - recraft + - reka + - relace + - sambanova + - seed + - siliconflow + - sourceful + - stepfun + - streamlake + - switchpoint + - together + - upstage + - venice + - wafer + - wandb + - xai + - xiaomi + - z-ai + example: openai + type: string + x-speakeasy-unknown-values: allow ChatAssistantImages: description: Generated images from image generation models example: @@ -3618,9 +4781,13 @@ components: - type - function type: object + - $ref: '#/components/schemas/AdvisorServerTool_OpenRouter' + - $ref: '#/components/schemas/BashServerTool' - $ref: '#/components/schemas/DatetimeServerTool' - $ref: '#/components/schemas/ImageGenerationServerTool_OpenRouter' - $ref: '#/components/schemas/ChatSearchModelsServerTool' + - $ref: '#/components/schemas/SubagentServerTool_OpenRouter' + - $ref: '#/components/schemas/WebFetchServerTool' - $ref: '#/components/schemas/OpenRouterWebSearchServerTool' - $ref: '#/components/schemas/ChatWebSearchShorthand' description: Tool definition for function calling (regular function or OpenRouter built-in server tool) @@ -3770,10 +4937,7 @@ components: temperature: 0.7 properties: cache_control: - allOf: - - $ref: '#/components/schemas/AnthropicCacheControlDirective' - - description: >- - Enable automatic prompt caching. When set, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + $ref: '#/components/schemas/AnthropicCacheControlDirective' debug: $ref: '#/components/schemas/ChatDebugOptions' frequency_penalty: @@ -3825,6 +4989,13 @@ components: session_id: session-456 user_id: user-123 type: object + min_p: + description: >- + Minimum probability threshold relative to the most likely token. Tokens with probability below min_p * (probability of top token) are filtered out. Not all providers support this parameter. + example: 0.1 + format: double + nullable: true + type: number modalities: description: Output modalities for the response. Supported values are "text", "image", and "audio". example: @@ -3856,19 +5027,23 @@ components: auto-router: '#/components/schemas/AutoRouterPlugin' context-compression: '#/components/schemas/ContextCompressionPlugin' file-parser: '#/components/schemas/FileParserPlugin' + fusion: '#/components/schemas/FusionPlugin' moderation: '#/components/schemas/ModerationPlugin' pareto-router: '#/components/schemas/ParetoRouterPlugin' response-healing: '#/components/schemas/ResponseHealingPlugin' web: '#/components/schemas/WebSearchPlugin' + web-fetch: '#/components/schemas/WebFetchPlugin' propertyName: id oneOf: - $ref: '#/components/schemas/AutoRouterPlugin' - $ref: '#/components/schemas/ModerationPlugin' - $ref: '#/components/schemas/WebSearchPlugin' + - $ref: '#/components/schemas/WebFetchPlugin' - $ref: '#/components/schemas/FileParserPlugin' - $ref: '#/components/schemas/ResponseHealingPlugin' - $ref: '#/components/schemas/ContextCompressionPlugin' - $ref: '#/components/schemas/ParetoRouterPlugin' + - $ref: '#/components/schemas/FusionPlugin' type: array presence_penalty: description: Presence penalty (-2.0 to 2.0) @@ -3901,22 +5076,44 @@ components: summary: $ref: '#/components/schemas/ChatReasoningSummaryVerbosityEnum' type: object - response_format: - description: Response format configuration - discriminator: - mapping: - grammar: '#/components/schemas/ChatFormatGrammarConfig' - json_object: '#/components/schemas/FormatJsonObjectConfig' - json_schema: '#/components/schemas/ChatFormatJsonSchemaConfig' - python: '#/components/schemas/ChatFormatPythonConfig' - text: '#/components/schemas/ChatFormatTextConfig' - propertyName: type - example: - type: json_object - oneOf: - - $ref: '#/components/schemas/ChatFormatTextConfig' - - $ref: '#/components/schemas/FormatJsonObjectConfig' - - $ref: '#/components/schemas/ChatFormatJsonSchemaConfig' + reasoning_effort: + description: >- + Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. + enum: + - xhigh + - high + - medium + - low + - minimal + - none + - null + example: medium + nullable: true + type: string + x-speakeasy-unknown-values: allow + repetition_penalty: + description: >- + Penalizes tokens based on how much they have already appeared in the text. A value of 1.0 means no penalty. Values above 1.0 penalize repeated tokens more strongly. Not all providers support this parameter. + example: 1 + format: double + nullable: true + type: number + response_format: + description: Response format configuration + discriminator: + mapping: + grammar: '#/components/schemas/ChatFormatGrammarConfig' + json_object: '#/components/schemas/FormatJsonObjectConfig' + json_schema: '#/components/schemas/ChatFormatJsonSchemaConfig' + python: '#/components/schemas/ChatFormatPythonConfig' + text: '#/components/schemas/ChatFormatTextConfig' + propertyName: type + example: + type: json_object + oneOf: + - $ref: '#/components/schemas/ChatFormatTextConfig' + - $ref: '#/components/schemas/FormatJsonObjectConfig' + - $ref: '#/components/schemas/ChatFormatJsonSchemaConfig' - $ref: '#/components/schemas/ChatFormatGrammarConfig' - $ref: '#/components/schemas/ChatFormatPythonConfig' route: @@ -3941,7 +5138,7 @@ components: x-speakeasy-unknown-values: allow session_id: description: >- - A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. + A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. maxLength: 256 type: string stop: @@ -3955,6 +5152,8 @@ components: description: Stop sequences (up to 4) example: - "" + stop_server_tools_when: + $ref: '#/components/schemas/StopServerToolsWhen' stream: default: false description: Enable streaming response @@ -3980,6 +5179,19 @@ components: items: $ref: '#/components/schemas/ChatFunctionTool' type: array + top_a: + description: >- + Consider only tokens with "sufficiently high" probabilities based on the probability of the most likely token. Not all providers support this parameter. + example: 0 + format: double + nullable: true + type: number + top_k: + description: >- + Limits the model to choose from the top K most likely tokens at each step. A value of 1 means the model will always pick the most likely next token. Not all providers support this parameter. + example: 40 + nullable: true + type: integer top_logprobs: description: Number of top log probabilities to return (0-20) example: 5 @@ -4039,6 +5251,8 @@ components: enum: - chat.completion type: string + openrouter_metadata: + $ref: '#/components/schemas/OpenRouterMetadata' service_tier: description: The service tier used by the upstream provider for this request example: default @@ -4075,6 +5289,19 @@ components: required: - type type: object + ChatServerToolChoice: + description: >- + OpenRouter extension: force a specific server tool by naming it directly in `tool_choice.type` instead of wrapping it in `{ type: "function", function: { name } }`. + example: + type: openrouter:web_search + properties: + type: + description: OpenRouter server-tool type to force (e.g. `openrouter:web_search`, `web_search`, `web_search_preview`). + example: openrouter:web_search + type: string + required: + - type + type: object ChatStreamChoice: description: Streaming completion choice chunk example: @@ -4153,6 +5380,8 @@ components: enum: - chat.completion.chunk type: string + openrouter_metadata: + $ref: '#/components/schemas/OpenRouterMetadata' service_tier: description: The service tier used by the upstream provider for this request example: default @@ -4211,6 +5440,25 @@ components: $ref: '#/components/schemas/ChatStreamToolCall' type: array type: object + ChatStreamingResponse: + example: + data: + choices: + - delta: + content: Hello + role: assistant + finish_reason: null + index: 0 + created: 1677652288 + id: chatcmpl-123 + model: openai/gpt-4 + object: chat.completion.chunk + properties: + data: + $ref: '#/components/schemas/ChatStreamChunk' + required: + - data + type: object ChatStreamOptions: description: Streaming configuration options example: @@ -4418,6 +5666,7 @@ components: - required type: string - $ref: '#/components/schemas/ChatNamedToolChoice' + - $ref: '#/components/schemas/ChatServerToolChoice' description: Tool choice configuration example: auto ChatToolMessage: @@ -4454,6 +5703,12 @@ components: completion_tokens: 15 completion_tokens_details: reasoning_tokens: 5 + cost: 0.0012 + cost_details: + upstream_inference_completions_cost: 0.0004 + upstream_inference_cost: null + upstream_inference_prompt_cost: 0.0008 + is_byok: false prompt_tokens: 10 prompt_tokens_details: cached_tokens: 2 @@ -4483,6 +5738,16 @@ components: nullable: true type: integer type: object + cost: + description: Cost of the completion + format: double + nullable: true + type: number + cost_details: + $ref: '#/components/schemas/CostDetails' + is_byok: + description: Whether a request was made using a Bring Your Own Key configuration + type: boolean prompt_tokens: description: Number of tokens in the prompt type: integer @@ -4544,7 +5809,7 @@ components: properties: allowed_domains: description: >- - Limit search results to these domains. Supported by Exa, Parallel, and most native providers (Anthropic, OpenAI, xAI). Not supported with Firecrawl or Perplexity. + Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI, xAI). Cannot be used with excluded_domains. items: type: string type: array @@ -4552,19 +5817,24 @@ components: $ref: '#/components/schemas/WebSearchEngineEnum' excluded_domains: description: >- - Exclude search results from these domains. Supported by Exa, Parallel, Anthropic, and xAI. Not supported with Firecrawl, OpenAI (silently ignored), or Perplexity. + Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, and xAI. Not supported with OpenAI (silently ignored). Cannot be used with allowed_domains. items: type: string type: array + max_characters: + description: >- + Exact maximum number of characters of content per search result. Applies to the Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, caps highlight content per result. For Parallel, caps excerpt content per result (default 1,500 when omitted). For Perplexity, maps to the native `max_tokens_per_page` parameter (converted from characters to tokens) and trims the response to the exact character cap. When both `max_characters` and `search_context_size` are set, `max_characters` takes precedence. When omitted, falls back to `search_context_size` mapping (Exa) or engine defaults (Parallel, Perplexity). + example: 2000 + type: integer max_results: description: >- - Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and Parallel engines; ignored with native provider search. + Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. example: 5 type: integer max_total_results: description: >- - Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. - example: 20 + Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. Defaults to 50 when not specified. + example: 50 type: integer parameters: $ref: '#/components/schemas/WebSearchConfig' @@ -4694,6 +5964,25 @@ components: required: - type type: object + CompactionItem: + description: A context compaction marker with encrypted summary + example: + encrypted_content: enc_abc123... + type: compaction + properties: + encrypted_content: + type: string + id: + nullable: true + type: string + type: + enum: + - compaction + type: string + required: + - type + - encrypted_content + type: object CompletedEvent: description: Event emitted when a response has completed successfully example: @@ -4803,6 +6092,11 @@ components: properties: error: $ref: '#/components/schemas/ConflictResponseErrorData' + openrouter_metadata: + additionalProperties: + nullable: true + nullable: true + type: object user_id: nullable: true type: string @@ -4828,6 +6122,141 @@ components: - code - message type: object + ContainerAutoEnvironment: + description: An OpenRouter-managed, auto-provisioned ephemeral container. + example: + type: container_auto + properties: + type: + enum: + - container_auto + type: string + required: + - type + type: object + ContainerReferenceEnvironment: + description: Reference to a previously created container to reuse. + example: + container_id: cntr_abc123 + type: container_reference + properties: + container_id: + description: Identifier of an existing container to reuse (max 20 characters). + example: cntr_abc123 + maxLength: 20 + minLength: 1 + pattern: ^[\w-]+$ + type: string + type: + enum: + - container_reference + type: string + required: + - type + - container_id + type: object + ContentFilterAction: + description: Action taken when the pattern matches + enum: + - redact + - block + example: block + type: string + x-speakeasy-unknown-values: allow + ContentFilterBuiltinAction: + description: Action taken when the builtin filter triggers + enum: + - redact + - block + - flag + example: block + type: string + x-speakeasy-unknown-values: allow + ContentFilterBuiltinEntry: + description: >- + A builtin content filter entry. Builtin filters include PII detectors and the regex-based prompt injection detector. + example: + action: redact + label: '[EMAIL]' + slug: email + properties: + action: + $ref: '#/components/schemas/ContentFilterBuiltinAction' + label: + description: >- + Read-only, system-assigned redaction placeholder derived from the slug (e.g. "[EMAIL]", "[PHONE]"). Not settable by the caller. + example: '[EMAIL]' + maxLength: 100 + type: string + scan_scope: + $ref: '#/components/schemas/PromptInjectionScanScope' + slug: + $ref: '#/components/schemas/ContentFilterBuiltinSlug' + required: + - slug + - action + type: object + ContentFilterBuiltinEntryInput: + description: >- + A builtin content filter entry for create/update requests. Labels are system-assigned and cannot be set by the caller. + example: + action: redact + slug: email + properties: + action: + $ref: '#/components/schemas/ContentFilterBuiltinAction' + label: + deprecated: true + description: >- + Deprecated: labels are system-assigned and cannot be set by the caller. Accepted for backward compatibility but silently ignored. + maxLength: 100 + type: string + scan_scope: + $ref: '#/components/schemas/PromptInjectionScanScope' + slug: + $ref: '#/components/schemas/ContentFilterBuiltinSlug' + required: + - slug + - action + type: object + ContentFilterBuiltinSlug: + description: The builtin filter identifier + enum: + - email + - phone + - ssn + - credit-card + - ip-address + - person-name + - address + - regex-prompt-injection + example: regex-prompt-injection + type: string + x-speakeasy-unknown-values: allow + ContentFilterEntry: + description: A custom regex content filter that scans request messages for matching patterns. + example: + action: redact + label: '[API_KEY]' + pattern: \b(sk-[a-zA-Z0-9]{48})\b + properties: + action: + $ref: '#/components/schemas/ContentFilterAction' + label: + description: Optional label used in redaction placeholders or error messages + example: '[API_KEY]' + maxLength: 100 + nullable: true + type: string + pattern: + description: A regex pattern to match against request content + example: \b(sk-[a-zA-Z0-9]{48})\b + minLength: 1 + type: string + required: + - pattern + - action + type: object ContentPartAddedEvent: allOf: - $ref: '#/components/schemas/BaseContentPartAddedEvent' @@ -4849,6 +6278,27 @@ components: type: output_text sequence_number: 3 type: response.content_part.added + ContentPartAudio: + example: + audio_url: + url: https://example.com/audio.mp3 + type: audio_url + properties: + audio_url: + properties: + url: + type: string + required: + - url + type: object + type: + enum: + - audio_url + type: string + required: + - type + - audio_url + type: object ContentPartDoneEvent: allOf: - $ref: '#/components/schemas/BaseContentPartDoneEvent' @@ -4891,6 +6341,78 @@ components: - type - image_url type: object + ContentPartInputAudio: + example: + input_audio: + data: data:audio/wav;base64,UklGRiQAAABXQVZFZm10IBAAAAA... + format: wav + type: input_audio + properties: + input_audio: + $ref: '#/components/schemas/MultimodalMedia' + type: + enum: + - input_audio + type: string + required: + - type + - input_audio + type: object + ContentPartInputFile: + example: + input_file: + data: data:application/pdf;base64,JVBERi0xLjQKJeLjz9MKMyAw... + format: pdf + type: input_file + properties: + input_file: + $ref: '#/components/schemas/MultimodalMedia' + type: + enum: + - input_file + type: string + required: + - type + - input_file + type: object + ContentPartInputVideo: + example: + input_video: + data: data:video/mp4;base64,AAAAGGZ0eXBtcDQyAAAAAGlzb21tcDQy... + format: mp4 + type: input_video + properties: + input_video: + $ref: '#/components/schemas/MultimodalMedia' + type: + enum: + - input_video + type: string + required: + - type + - input_video + type: object + ContentPartVideo: + example: + type: video_url + video_url: + url: https://example.com/clip.mp4 + properties: + type: + enum: + - video_url + type: string + video_url: + properties: + url: + type: string + required: + - url + type: object + required: + - type + - video_url + type: object ContextCompressionEngine: description: The compression engine to use. Defaults to "middle-out". enum: @@ -4915,37 +6437,135 @@ components: required: - id type: object - CreatedEvent: - description: Event emitted when a response is created + CostDetails: + description: Breakdown of upstream inference costs example: - response: - created_at: 1704067200 - error: null - id: resp-abc123 - incomplete_details: null - instructions: null - max_output_tokens: null - metadata: null - model: gpt-4 - object: response - output: [] - parallel_tool_calls: true - status: in_progress - temperature: null - tool_choice: auto - tools: [] - top_p: null - sequence_number: 0 - type: response.created + upstream_inference_completions_cost: 0.0004 + upstream_inference_cost: null + upstream_inference_prompt_cost: 0.0008 + nullable: true properties: - response: - $ref: '#/components/schemas/BaseResponsesResult' - sequence_number: - type: integer - type: - enum: - - response.created - type: string + upstream_inference_completions_cost: + format: double + type: number + upstream_inference_cost: + format: double + nullable: true + type: number + upstream_inference_prompt_cost: + format: double + type: number + required: + - upstream_inference_prompt_cost + - upstream_inference_completions_cost + type: object + CreateBYOKKeyRequest: + example: + key: sk-proj-abc123... + name: Production OpenAI Key + provider: openai + properties: + allowed_models: + description: Optional allowlist of model slugs this credential may be used for. `null` means no restriction. + example: null + items: + type: string + maxItems: 100 + nullable: true + type: array + allowed_user_ids: + description: Optional allowlist of user IDs that may use this credential. `null` means no restriction. + example: null + items: + type: string + maxItems: 100 + nullable: true + type: array + disabled: + description: Whether this credential should be created in a disabled state. + example: false + type: boolean + is_fallback: + description: >- + Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried. + example: false + type: boolean + key: + description: The raw provider API key or credential. This value is encrypted at rest and never returned in API responses. + example: sk-proj-abc123... + minLength: 1 + type: string + name: + description: Optional human-readable name for the credential. + example: Production OpenAI Key + maxLength: 255 + nullable: true + type: string + provider: + $ref: '#/components/schemas/BYOKProviderSlug' + workspace_id: + description: Optional workspace ID. Defaults to the authenticated entity's default workspace. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + required: + - provider + - key + type: object + CreateBYOKKeyResponse: + example: + data: + allowed_api_key_hashes: null + allowed_models: null + allowed_user_ids: null + created_at: '2025-08-24T10:30:00Z' + disabled: false + id: 11111111-2222-3333-4444-555555555555 + is_fallback: false + label: sk-...AbCd + name: Production OpenAI Key + provider: openai + sort_order: 0 + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + properties: + data: + allOf: + - $ref: '#/components/schemas/BYOKKey' + - description: The created BYOK credential. + required: + - data + type: object + CreatedEvent: + description: Event emitted when a response is created + example: + response: + created_at: 1704067200 + error: null + id: resp-abc123 + incomplete_details: null + instructions: null + max_output_tokens: null + metadata: null + model: gpt-4 + object: response + output: [] + parallel_tool_calls: true + status: in_progress + temperature: null + tool_choice: auto + tools: [] + top_p: null + sequence_number: 0 + type: response.created + properties: + response: + $ref: '#/components/schemas/BaseResponsesResult' + sequence_number: + type: integer + type: + enum: + - response.created + type: string required: - type - response @@ -4958,8 +6578,15 @@ components: - openai - anthropic - deepseek + content_filter_builtins: + - action: block + slug: regex-prompt-injection + content_filters: null description: A guardrail for limiting API usage - enforce_zdr: false + enforce_zdr_anthropic: true + enforce_zdr_google: false + enforce_zdr_openai: true + enforce_zdr_other: false ignored_models: null ignored_providers: null limit_usd: 50 @@ -4988,6 +6615,26 @@ components: minItems: 1 nullable: true type: array + content_filter_builtins: + description: >- + Builtin content filters to apply. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only. + example: + - action: block + slug: regex-prompt-injection + items: + $ref: '#/components/schemas/ContentFilterBuiltinEntryInput' + nullable: true + type: array + content_filters: + description: Custom regex content filters to apply to request messages + example: + - action: redact + label: '[API_KEY]' + pattern: \b(sk-[a-zA-Z0-9]{48})\b + items: + $ref: '#/components/schemas/ContentFilterEntry' + nullable: true + type: array description: description: Description of the guardrail example: A guardrail for limiting API usage @@ -4995,7 +6642,30 @@ components: nullable: true type: string enforce_zdr: - description: Whether to enforce zero data retention + deprecated: true + description: >- + Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. + example: false + nullable: true + type: boolean + enforce_zdr_anthropic: + description: Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. + example: false + nullable: true + type: boolean + enforce_zdr_google: + description: Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. + example: false + nullable: true + type: boolean + enforce_zdr_openai: + description: Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. + example: false + nullable: true + type: boolean + enforce_zdr_other: + description: >- + Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided. example: false nullable: true type: boolean @@ -5047,9 +6717,18 @@ components: - openai - anthropic - google + content_filter_builtins: + - action: redact + label: '[EMAIL]' + slug: email + content_filters: null created_at: '2025-08-24T10:30:00Z' description: A guardrail for limiting API usage - enforce_zdr: false + enforce_zdr: null + enforce_zdr_anthropic: true + enforce_zdr_google: false + enforce_zdr_openai: true + enforce_zdr_other: false id: 550e8400-e29b-41d4-a716-446655440000 ignored_models: null ignored_providers: null @@ -5066,6 +6745,145 @@ components: required: - data type: object + CreateObservabilityDestinationRequest: + example: + config: + baseUrl: https://us.cloud.langfuse.com + publicKey: pk-l...EfGh + secretKey: sk-l...AbCd + name: Production Langfuse + type: langfuse + properties: + api_key_hashes: + description: >- + Optional allowlist of OpenRouter API key hashes whose traffic is forwarded. `null` or omitted means all keys. Must contain at least one hash if provided. + example: null + items: + type: string + minItems: 1 + nullable: true + type: array + config: + additionalProperties: + nullable: true + description: Provider-specific configuration. The shape depends on `type` and is validated server-side. + example: + baseUrl: https://us.cloud.langfuse.com + publicKey: pk-l...EfGh + secretKey: sk-l...AbCd + type: object + enabled: + default: true + description: Whether this destination should be enabled immediately. + example: true + type: boolean + filter_rules: + $ref: '#/components/schemas/ObservabilityFilterRulesConfig' + name: + description: Human-readable name for the destination. + example: Production Langfuse + type: string + privacy_mode: + default: false + description: When true, request/response bodies are not forwarded — only metadata. + example: false + type: boolean + sampling_rate: + description: Sampling rate between 0.0001 and 1 (1 = 100%). + example: 1 + format: double + type: number + type: + description: The destination type. Only stable destination types are accepted. + enum: + - arize + - braintrust + - clickhouse + - datadog + - grafana + - langfuse + - langsmith + - newrelic + - opik + - otel-collector + - posthog + - ramp + - s3 + - sentry + - snowflake + - weave + - webhook + example: langfuse + type: string + x-speakeasy-unknown-values: allow + workspace_id: + description: Optional workspace ID. Defaults to the authenticated entity's default workspace. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + required: + - type + - name + - config + type: object + CreateObservabilityDestinationResponse: + example: + data: + api_key_hashes: null + config: + baseUrl: https://us.cloud.langfuse.com + publicKey: pk-l...EfGh + secretKey: sk-l...AbCd + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production Langfuse + privacy_mode: false + sampling_rate: 1 + type: langfuse + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + properties: + data: + allOf: + - $ref: '#/components/schemas/ObservabilityDestination' + - description: The newly created observability destination. + required: + - data + type: object + CreatePresetFromInferenceResponse: + description: Response containing the created preset with its designated version. + example: + data: + created_at: '2026-04-20T10:00:00Z' + creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 + description: null + designated_version: + config: + model: openai/gpt-4o + temperature: 0.7 + created_at: '2026-04-20T10:00:00Z' + creator_id: user_2dHFtVWx2n56w6HkM0000000000 + id: 550e8400-e29b-41d4-a716-446655440000 + preset_id: 650e8400-e29b-41d4-a716-446655440001 + system_prompt: You are a helpful assistant. + updated_at: '2026-04-20T10:00:00Z' + version: 1 + designated_version_id: 550e8400-e29b-41d4-a716-446655440000 + id: 650e8400-e29b-41d4-a716-446655440001 + name: my-preset + slug: my-preset + status: active + status_updated_at: null + updated_at: '2026-04-20T10:00:00Z' + workspace_id: 750e8400-e29b-41d4-a716-446655440002 + properties: + data: + $ref: '#/components/schemas/PresetWithDesignatedVersion' + required: + - data + type: object CreateWorkspaceRequest: example: default_image_model: openai/dall-e-3 @@ -5096,6 +6914,18 @@ components: maxLength: 500 nullable: true type: string + io_logging_api_key_ids: + description: Optional array of API key IDs to filter I/O logging + example: null + items: + type: integer + nullable: true + type: array + io_logging_sampling_rate: + description: Sampling rate for I/O logging (0.0001-1) + example: 1 + format: double + type: number is_data_discount_logging_enabled: description: Whether data discount logging is enabled example: true @@ -5115,11 +6945,11 @@ components: minLength: 1 type: string slug: - description: URL-friendly slug (lowercase alphanumeric and hyphens only) + description: URL-friendly slug (lowercase alphanumeric segments separated by single hyphens, no leading/trailing hyphens) example: production maxLength: 50 minLength: 1 - pattern: ^[a-z0-9-]+$ + pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$ type: string required: - name @@ -5135,6 +6965,8 @@ components: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false @@ -5195,6 +7027,134 @@ components: - type - name type: object + CustomToolCallInputDeltaEvent: + allOf: + - $ref: '#/components/schemas/BaseCustomToolCallInputDeltaEvent' + - properties: {} + type: object + description: >- + Event emitted when a custom tool call's freeform input is being streamed. Mirrors `response.function_call_arguments.delta` but for `custom` tools whose input is opaque text rather than JSON arguments. + example: + delta: '*** Begin Patch' + item_id: item-1 + output_index: 0 + sequence_number: 4 + type: response.custom_tool_call_input.delta + CustomToolCallInputDoneEvent: + allOf: + - $ref: '#/components/schemas/BaseCustomToolCallInputDoneEvent' + - properties: {} + type: object + description: >- + Event emitted when a custom tool call's freeform input streaming is complete. Mirrors `response.function_call_arguments.done` but for `custom` tools. + example: + input: |- + *** Begin Patch + *** End Patch + item_id: item-1 + output_index: 0 + sequence_number: 6 + type: response.custom_tool_call_input.done + CustomToolCallItem: + description: >- + A call to a custom (freeform-grammar) tool created by the model — distinct from `function_call`. Used for tools like Codex CLI's `apply_patch` whose payload is opaque text rather than JSON arguments. + example: + call_id: call-abc123 + id: ctc-abc123 + input: |- + *** Begin Patch + *** End Patch + name: apply_patch + type: custom_tool_call + properties: + call_id: + type: string + id: + type: string + input: + type: string + name: + type: string + namespace: + description: Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) + type: string + type: + enum: + - custom_tool_call + type: string + required: + - type + - call_id + - name + - input + type: object + CustomToolCallOutputItem: + allOf: + - $ref: '#/components/schemas/OpenAIResponseCustomToolCallOutput' + - properties: + output: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/InputText' + - allOf: + - $ref: '#/components/schemas/InputImage' + - properties: {} + type: object + description: Image input content item + example: + detail: auto + image_url: https://example.com/image.jpg + type: input_image + - $ref: '#/components/schemas/InputFile' + type: array + type: object + description: >- + The output from a custom (freeform-grammar) tool call execution. Mirrors `function_call_output` but is matched to a `custom_tool_call` rather than a `function_call`. + example: + call_id: call-abc123 + id: ctco-abc123 + output: patch applied successfully + type: custom_tool_call_output + DABenchmarkEntry: + description: A single Design Arena benchmark entry for a specific arena+category + example: + arena: models + category: website + elo: 1385.2 + rank: 5 + win_rate: 62.5 + properties: + arena: + description: Arena type (e.g. models, builders, agents) + example: models + type: string + category: + description: Category within the arena (e.g. website, gamedev, uicomponent) + example: website + type: string + elo: + description: ELO rating from head-to-head arena battles + example: 1385.2 + format: double + type: number + rank: + description: Rank position within this arena+category among models available on OpenRouter (1 = highest ELO) + example: 5 + type: integer + win_rate: + description: Win rate percentage in arena battles + example: 62.5 + format: double + type: number + required: + - arena + - category + - elo + - win_rate + - rank + type: object DatetimeServerTool: description: 'OpenRouter built-in server tool: returns the current date and time' example: @@ -5257,36 +7217,59 @@ components: nullable: true type: number type: object - DeleteGuardrailResponse: + DeleteBYOKKeyResponse: example: deleted: true properties: deleted: const: true - description: Confirmation that the guardrail was deleted + description: Confirmation that the BYOK credential was deleted. example: true type: boolean required: - deleted type: object - DeleteWorkspaceResponse: + DeleteGuardrailResponse: example: deleted: true properties: deleted: const: true - description: Confirmation that the workspace was deleted + description: Confirmation that the guardrail was deleted example: true type: boolean required: - deleted type: object - DeprecatedRoute: - deprecated: true - description: >- - **DEPRECATED** Use providers.sort.partition instead. Backwards-compatible alias for providers.sort.partition. Accepts legacy values: "fallback" (maps to "model"), "sort" (maps to "none"). - enum: - - fallback + DeleteObservabilityDestinationResponse: + example: + deleted: true + properties: + deleted: + const: true + description: Always `true` on success. + type: boolean + required: + - deleted + type: object + DeleteWorkspaceResponse: + example: + deleted: true + properties: + deleted: + const: true + description: Confirmation that the workspace was deleted + example: true + type: boolean + required: + - deleted + type: object + DeprecatedRoute: + deprecated: true + description: >- + **DEPRECATED** Use providers.sort.partition instead. Backwards-compatible alias for providers.sort.partition. Accepts legacy values: "fallback" (maps to "model"), "sort" (maps to "none"). + enum: + - fallback - sort - null example: fallback @@ -5363,6 +7346,11 @@ components: properties: error: $ref: '#/components/schemas/EdgeNetworkTimeoutResponseErrorData' + openrouter_metadata: + additionalProperties: + nullable: true + nullable: true + type: object user_id: nullable: true type: string @@ -5388,6 +7376,41 @@ components: - code - message type: object + EndpointInfo: + example: + model: openai/gpt-4o + provider: OpenAI + selected: true + properties: + model: + type: string + provider: + type: string + selected: + type: boolean + required: + - provider + - model + - selected + type: object + EndpointsMetadata: + example: + available: + - model: openai/gpt-4o + provider: OpenAI + selected: true + total: 3 + properties: + available: + items: + $ref: '#/components/schemas/EndpointInfo' + type: array + total: + type: integer + required: + - total + - available + type: object EndpointStatus: enum: - 0 @@ -5470,6 +7493,97 @@ components: - filename - index type: object + FileDeleteResponse: + description: Confirmation that a file was deleted. + example: + id: file_011CNha8iCJcU1wXNR6q4V8w + type: file_deleted + properties: + id: + type: string + type: + enum: + - file_deleted + type: string + required: + - id + - type + type: object + FileListResponse: + description: A page of files belonging to the requesting workspace. + example: + cursor: null + data: + - created_at: '2025-01-01T00:00:00Z' + downloadable: false + filename: document.pdf + id: file_011CNha8iCJcU1wXNR6q4V8w + mime_type: application/pdf + size_bytes: 1024000 + type: file + first_id: file_011CNha8iCJcU1wXNR6q4V8w + has_more: false + last_id: file_011CNha8iCJcU1wXNR6q4V8w + properties: + cursor: + description: Opaque cursor for the next page; null when there are no more results. + nullable: true + type: string + data: + items: + $ref: '#/components/schemas/FileMetadata' + type: array + first_id: + nullable: true + type: string + has_more: + type: boolean + last_id: + nullable: true + type: string + required: + - data + - has_more + - first_id + - last_id + - cursor + type: object + FileMetadata: + description: Metadata describing a stored file. + example: + created_at: '2025-01-01T00:00:00Z' + downloadable: false + filename: document.pdf + id: file_011CNha8iCJcU1wXNR6q4V8w + mime_type: application/pdf + size_bytes: 1024000 + type: file + properties: + created_at: + type: string + downloadable: + type: boolean + filename: + type: string + id: + type: string + mime_type: + type: string + size_bytes: + type: integer + type: + enum: + - file + type: string + required: + - id + - type + - filename + - mime_type + - size_bytes + - created_at + - downloadable + type: object FileParserPlugin: example: enabled: true @@ -5584,6 +7698,11 @@ components: properties: error: $ref: '#/components/schemas/ForbiddenResponseErrorData' + openrouter_metadata: + additionalProperties: + nullable: true + nullable: true + type: object user_id: nullable: true type: string @@ -5808,4884 +7927,4585 @@ components: - name - parameters type: object - GenerationContentData: - description: Stored prompt and completion content + FusionAnalysisResult: + description: Structured analysis produced by the fusion judge model. + example: + blind_spots: + - No model considered the impact on existing API consumers. + consensus: + - All panel models agree the request is asking for a concise summary. + contradictions: + - stances: + - model: openai/gpt-5 + stance: Favors an incremental rollout. + - model: anthropic/claude-sonnet-4.5 + stance: Favors a single coordinated migration. + topic: Recommended approach + partial_coverage: + - models: + - openai/gpt-5 + point: Only one model addressed the rollback strategy. + unique_insights: + - insight: Highlighted a backwards-compatibility risk the other models missed. + model: anthropic/claude-sonnet-4.5 + properties: + blind_spots: + items: + type: string + type: array + consensus: + items: + type: string + type: array + contradictions: + items: + properties: + stances: + items: + properties: + model: + type: string + stance: + type: string + required: + - model + - stance + type: object + type: array + topic: + type: string + required: + - topic + - stances + type: object + type: array + partial_coverage: + items: + properties: + models: + items: + type: string + type: array + point: + type: string + required: + - models + - point + type: object + type: array + unique_insights: + items: + properties: + insight: + type: string + model: + type: string + required: + - model + - insight + type: object + type: array + required: + - consensus + - contradictions + - partial_coverage + - unique_insights + - blind_spots + type: object + FusionCallAnalysisCompletedEvent: + description: Emitted when the fusion judge completes with the structured analysis. + example: + analysis: + blind_spots: [] + consensus: [] + contradictions: [] + partial_coverage: [] + unique_insights: [] + item_id: st_fusion_abc + output_index: 0 + sequence_number: 40 + type: response.fusion_call.analysis.completed + properties: + analysis: + $ref: '#/components/schemas/FusionAnalysisResult' + item_id: + type: string + output_index: + type: integer + sequence_number: + type: integer + type: + enum: + - response.fusion_call.analysis.completed + type: string + required: + - type + - analysis + - output_index + - item_id + - sequence_number + type: object + FusionCallAnalysisInProgressEvent: + description: Emitted when the fusion judge starts producing the structured analysis. example: - input: - messages: - - content: What is the meaning of life? - role: user - output: - completion: The meaning of life is a philosophical question... - reasoning: null + item_id: st_fusion_abc + judge_model: openai/gpt-5 + output_index: 0 + sequence_number: 25 + type: response.fusion_call.analysis.in_progress properties: - input: - anyOf: - - properties: - prompt: - example: What is the meaning of life? - type: string - required: - - prompt - type: object - - properties: - messages: - example: - - content: What is the meaning of life? - role: user - items: - nullable: true - type: array - required: - - messages - type: object - description: The input to the generation — either a prompt string or an array of messages - output: - description: The output from the generation - properties: - completion: - description: The completion output - example: The meaning of life is a philosophical question... - nullable: true - type: string - reasoning: - description: Reasoning/thinking output, if any - example: null - nullable: true - type: string - required: - - reasoning - - completion - type: object + item_id: + type: string + judge_model: + type: string + output_index: + type: integer + sequence_number: + type: integer + type: + enum: + - response.fusion_call.analysis.in_progress + type: string required: - - input - - output + - type + - judge_model + - output_index + - item_id + - sequence_number type: object - GenerationContentResponse: - description: Stored prompt and completion content for a generation + FusionCallCompletedEvent: + description: Emitted when the openrouter:fusion tool call finishes. example: - data: - input: - messages: - - content: What is the meaning of life? - role: user - output: - completion: The meaning of life is a philosophical question... - reasoning: null + item_id: st_fusion_abc + output_index: 0 + sequence_number: 41 + type: response.fusion_call.completed properties: - data: - $ref: '#/components/schemas/GenerationContentData' + item_id: + type: string + output_index: + type: integer + sequence_number: + type: integer + type: + enum: + - response.fusion_call.completed + type: string required: - - data + - type + - output_index + - item_id + - sequence_number type: object - GenerationResponse: - description: Generation response + FusionCallInProgressEvent: + description: Emitted when an openrouter:fusion tool call begins executing. example: - data: - api_type: completions - app_id: 12345 - cache_discount: null - cancelled: false - created_at: '2024-07-15T23:33:19.433273+00:00' - external_user: user-123 - finish_reason: stop - generation_time: 1200 - http_referer: https://openrouter.ai/ - id: gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG - is_byok: false - latency: 1250 - model: sao10k/l3-stheno-8b - moderation_latency: 50 - native_finish_reason: stop - native_tokens_cached: 3 - native_tokens_completion: 25 - native_tokens_completion_images: 0 - native_tokens_prompt: 10 - native_tokens_reasoning: 5 - num_input_audio_prompt: 0 - num_media_completion: 0 - num_media_prompt: 1 - num_search_results: 5 - origin: https://openrouter.ai/ - provider_name: Infermatic - provider_responses: null - request_id: req-1727282430-aBcDeFgHiJkLmNoPqRsT - router: openrouter/auto - session_id: null - streamed: true - tokens_completion: 25 - tokens_prompt: 10 - total_cost: 0.0015 - upstream_id: chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946 - upstream_inference_cost: 0.0012 - usage: 0.0015 - user_agent: Mozilla/5.0 + item_id: st_fusion_abc + output_index: 0 + sequence_number: 3 + type: response.fusion_call.in_progress properties: - data: - description: Generation data - properties: - api_type: - description: Type of API used for the generation - enum: - - completions - - embeddings - - rerank - - tts - - video - - null - nullable: true - type: string - x-speakeasy-unknown-values: allow - app_id: - description: ID of the app that made the request - example: 12345 - nullable: true - type: integer - cache_discount: - description: Discount applied due to caching - example: 0.0002 - format: double - nullable: true - type: number - cancelled: - description: Whether the generation was cancelled - example: false - nullable: true - type: boolean - created_at: - description: ISO 8601 timestamp of when the generation was created - example: '2024-07-15T23:33:19.433273+00:00' - type: string - external_user: - description: External user identifier - example: user-123 - nullable: true - type: string - finish_reason: - description: Reason the generation finished - example: stop - nullable: true - type: string - generation_time: - description: Time taken for generation in milliseconds - example: 1200 - format: double - nullable: true - type: number - http_referer: - description: Referer header from the request - nullable: true - type: string - id: - description: Unique identifier for the generation - example: gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG - type: string - is_byok: - description: Whether this used bring-your-own-key - example: false - type: boolean - latency: - description: Total latency in milliseconds - example: 1250 - format: double - nullable: true - type: number - model: - description: Model used for the generation - example: sao10k/l3-stheno-8b - type: string - moderation_latency: - description: Moderation latency in milliseconds - example: 50 - format: double - nullable: true - type: number - native_finish_reason: - description: Native finish reason as reported by provider - example: stop - nullable: true - type: string - native_tokens_cached: - description: Native cached tokens as reported by provider - example: 3 - nullable: true - type: integer - native_tokens_completion: - description: Native completion tokens as reported by provider - example: 25 - nullable: true - type: integer - native_tokens_completion_images: - description: Native completion image tokens as reported by provider - example: 0 - nullable: true - type: integer - native_tokens_prompt: - description: Native prompt tokens as reported by provider - example: 10 - nullable: true - type: integer - native_tokens_reasoning: - description: Native reasoning tokens as reported by provider - example: 5 - nullable: true - type: integer - num_input_audio_prompt: - description: Number of audio inputs in the prompt - example: 0 - nullable: true - type: integer - num_media_completion: - description: Number of media items in the completion - example: 0 - nullable: true - type: integer - num_media_prompt: - description: Number of media items in the prompt - example: 1 - nullable: true - type: integer - num_search_results: - description: Number of search results included - example: 5 - nullable: true - type: integer - origin: - description: Origin URL of the request - example: https://openrouter.ai/ - type: string - provider_name: - description: Name of the provider that served the request - example: Infermatic - nullable: true - type: string - provider_responses: - description: List of provider responses for this generation, including fallback attempts - items: - $ref: '#/components/schemas/ProviderResponse' - nullable: true - type: array - request_id: - description: Unique identifier grouping all generations from a single API request - example: req-1727282430-aBcDeFgHiJkLmNoPqRsT - nullable: true - type: string - router: - description: Router used for the request (e.g., openrouter/auto) - example: openrouter/auto - nullable: true - type: string - session_id: - description: Session identifier grouping multiple generations in the same session - nullable: true - type: string - streamed: - description: Whether the response was streamed - example: true - nullable: true - type: boolean - tokens_completion: - description: Number of tokens in the completion - example: 25 - nullable: true - type: integer - tokens_prompt: - description: Number of tokens in the prompt - example: 10 - nullable: true - type: integer - total_cost: - description: Total cost of the generation in USD - example: 0.0015 - format: double - type: number - upstream_id: - description: Upstream provider's identifier for this generation - example: chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946 - nullable: true - type: string - upstream_inference_cost: - description: Cost charged by the upstream provider - example: 0.0012 - format: double - nullable: true - type: number - usage: - description: Usage amount in USD - example: 0.0015 - format: double - type: number - user_agent: - description: User-Agent header from the request - nullable: true - type: string - web_search_engine: - description: The resolved web search engine used for this generation (e.g. exa, firecrawl, parallel) - example: exa - nullable: true - type: string - required: - - id - - upstream_id - - total_cost - - cache_discount - - upstream_inference_cost - - created_at - - model - - app_id - - streamed - - cancelled - - provider_name - - latency - - moderation_latency - - generation_time - - finish_reason - - tokens_prompt - - tokens_completion - - native_tokens_prompt - - native_tokens_completion - - native_tokens_completion_images - - native_tokens_reasoning - - native_tokens_cached - - num_media_prompt - - num_input_audio_prompt - - num_media_completion - - num_search_results - - web_search_engine - - origin - - usage - - is_byok - - native_finish_reason - - external_user - - api_type - - router - - provider_responses - - user_agent - - http_referer - type: object + item_id: + type: string + output_index: + type: integer + sequence_number: + type: integer + type: + enum: + - response.fusion_call.in_progress + type: string required: - - data + - type + - output_index + - item_id + - sequence_number type: object - GetGuardrailResponse: + FusionCallPanelAddedEvent: + description: Emitted when a fusion analysis-panel model starts. example: - data: - allowed_models: null - allowed_providers: - - openai - - anthropic - - google - created_at: '2025-08-24T10:30:00Z' - description: Guardrail for production environment - enforce_zdr: false - id: 550e8400-e29b-41d4-a716-446655440000 - ignored_models: null - ignored_providers: null - limit_usd: 100 - name: Production Guardrail - reset_interval: monthly - updated_at: '2025-08-24T15:45:00Z' - workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 + item_id: st_fusion_abc + model: openai/gpt-5 + output_index: 0 + sequence_number: 4 + type: response.fusion_call.panel.added properties: - data: - allOf: - - $ref: '#/components/schemas/Guardrail' - - description: The guardrail + item_id: + type: string + model: + type: string + output_index: + type: integer + sequence_number: + type: integer + type: + enum: + - response.fusion_call.panel.added + type: string required: - - data + - type + - model + - output_index + - item_id + - sequence_number type: object - GetWorkspaceResponse: + FusionCallPanelCompletedEvent: + description: Emitted when a fusion panel model finishes with its full content. example: - data: - created_at: '2025-08-24T10:30:00Z' - created_by: user_abc123 - default_image_model: openai/dall-e-3 - default_provider_sort: price - default_text_model: openai/gpt-4o - description: Production environment workspace - id: 550e8400-e29b-41d4-a716-446655440000 - is_data_discount_logging_enabled: true - is_observability_broadcast_enabled: false - is_observability_io_logging_enabled: false - name: Production - slug: production - updated_at: '2025-08-24T15:45:00Z' + content: Full panel response text... + item_id: st_fusion_abc + model: openai/gpt-5 + output_index: 0 + sequence_number: 20 + type: response.fusion_call.panel.completed properties: - data: - allOf: - - $ref: '#/components/schemas/Workspace' - - description: The workspace + content: + type: string + item_id: + type: string + model: + type: string + output_index: + type: integer + sequence_number: + type: integer + type: + enum: + - response.fusion_call.panel.completed + type: string required: - - data + - type + - model + - content + - output_index + - item_id + - sequence_number type: object - GoneResponse: - description: Gone - Endpoint has been permanently removed or deprecated + FusionCallPanelDeltaEvent: + description: Incremental content token from a fusion panel model. example: - error: - code: 410 - message: >- - The Coinbase APIs used by this endpoint have been deprecated, so the Coinbase Commerce credits API has been removed. Use the web credits purchase flow instead. + delta: Carbon taxes + item_id: st_fusion_abc + model: openai/gpt-5 + output_index: 0 + sequence_number: 5 + type: response.fusion_call.panel.delta + properties: + delta: + type: string + item_id: + type: string + model: + type: string + output_index: + type: integer + sequence_number: + type: integer + type: + enum: + - response.fusion_call.panel.delta + type: string + required: + - type + - model + - delta + - output_index + - item_id + - sequence_number + type: object + FusionCallPanelFailedEvent: + description: Emitted when a fusion panel model fails. + example: + error: Upstream provider error + item_id: st_fusion_abc + model: openai/gpt-5 + output_index: 0 + sequence_number: 18 + status_code: 502 + type: response.fusion_call.panel.failed properties: error: - $ref: '#/components/schemas/GoneResponseErrorData' - user_id: - nullable: true + type: string + item_id: + type: string + model: + type: string + output_index: + type: integer + sequence_number: + type: integer + status_code: + type: integer + type: + enum: + - response.fusion_call.panel.failed type: string required: + - type + - model - error + - output_index + - item_id + - sequence_number type: object - GoneResponseErrorData: - description: Error data for GoneResponse + FusionCallPanelReasoningDeltaEvent: + description: Incremental reasoning token from a fusion panel model. example: - code: 410 - message: >- - The Coinbase APIs used by this endpoint have been deprecated, so the Coinbase Commerce credits API has been removed. Use the web credits purchase flow instead. + delta: Considering both sides + item_id: st_fusion_abc + model: openai/gpt-5 + output_index: 0 + sequence_number: 6 + type: response.fusion_call.panel.reasoning.delta properties: - code: + delta: + type: string + item_id: + type: string + model: + type: string + output_index: type: integer - message: + sequence_number: + type: integer + type: + enum: + - response.fusion_call.panel.reasoning.delta type: string - metadata: - additionalProperties: - nullable: true - nullable: true - type: object required: - - code - - message + - type + - model + - delta + - output_index + - item_id + - sequence_number type: object - Guardrail: + FusionPlugin: example: - allowed_models: null - allowed_providers: - - openai - - anthropic - - google - created_at: '2025-08-24T10:30:00Z' - description: Guardrail for production environment - enforce_zdr: false - id: 550e8400-e29b-41d4-a716-446655440000 - ignored_models: null - ignored_providers: null - limit_usd: 100 - name: Production Guardrail - reset_interval: monthly - updated_at: '2025-08-24T15:45:00Z' - workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 + analysis_models: + - ~anthropic/claude-opus-latest + - ~openai/gpt-latest + - ~google/gemini-pro-latest + enabled: true + id: fusion + model: ~anthropic/claude-opus-latest properties: - allowed_models: - description: Array of model canonical_slugs (immutable identifiers) - example: - - openai/gpt-5.2-20251211 - - anthropic/claude-4.5-opus-20251124 - - deepseek/deepseek-r1-0528:free - items: - type: string - nullable: true - type: array - allowed_providers: - description: List of allowed provider IDs + analysis_models: + description: >- + Slugs of models to run in parallel as the "expert panel" the judge analyzes. Each model receives the same user prompt with web_search + web_fetch enabled. Capped at 8 models to bound cost amplification. When omitted, defaults to the Quality preset from the /labs/fusion UI (~anthropic/claude-opus-latest, ~openai/gpt-latest, ~google/gemini-pro-latest). example: - - openai - - anthropic - - google + - ~anthropic/claude-opus-latest + - ~openai/gpt-latest + - ~google/gemini-pro-latest items: type: string - nullable: true + maxItems: 8 + minItems: 1 type: array - created_at: - description: ISO 8601 timestamp of when the guardrail was created - example: '2025-08-24T10:30:00Z' - type: string - description: - description: Description of the guardrail - example: Guardrail for production environment - nullable: true - type: string - enforce_zdr: - description: Whether to enforce zero data retention - example: false - nullable: true + enabled: + description: Set to false to disable the fusion plugin for this request. Defaults to true. type: boolean id: - description: Unique identifier for the guardrail - example: 550e8400-e29b-41d4-a716-446655440000 - format: uuid + enum: + - fusion type: string - ignored_models: - description: Array of model canonical_slugs to exclude from routing - example: - - openai/gpt-4o-mini-2024-07-18 - items: - type: string - nullable: true - type: array - ignored_providers: - description: List of provider IDs to exclude from routing + max_tool_calls: + description: >- + Maximum number of tool-calling steps each panelist (analysis model) and the judge model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to 8. Capped at 16. + example: 12 + maximum: 16 + minimum: 1 + type: integer + model: + description: >- + Slug of the model that performs both the judge step (with web_search + web_fetch) and the final synthesis. When omitted, defaults to the first model in the Quality preset. + example: ~anthropic/claude-opus-latest + type: string + tools: + description: >- + Server tools available to panelist and judge inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: "openrouter:web_search" }, { type: "openrouter:web_fetch" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only). example: - - azure + - parameters: + excluded_domains: + - example.com + type: openrouter:web_search + - type: openrouter:web_fetch items: - type: string - nullable: true + properties: + parameters: + additionalProperties: + anyOf: + - type: string + - format: double + type: number + - type: boolean + - nullable: true + - items: + anyOf: + - type: string + - format: double + type: number + - type: boolean + - nullable: true + - nullable: true + type: array + - additionalProperties: + anyOf: + - type: string + - format: double + type: number + - type: boolean + - nullable: true + - nullable: true + type: object + - nullable: true + description: Optional configuration forwarded as the tool's `parameters` object. + type: object + type: + description: Server tool type identifier (e.g. "openrouter:web_search", "openrouter:web_fetch"). + type: string + required: + - type + type: object + maxItems: 8 type: array - limit_usd: - description: Spending limit in USD - example: 100 - format: double - nullable: true - type: number - name: - description: Name of the guardrail - example: Production Guardrail - type: string - reset_interval: - $ref: '#/components/schemas/GuardrailInterval' - updated_at: - description: ISO 8601 timestamp of when the guardrail was last updated - example: '2025-08-24T15:45:00Z' - nullable: true - type: string - workspace_id: - description: The workspace ID this guardrail belongs to. - example: 0df9e665-d932-5740-b2c7-b52af166bc11 - type: string required: - id - - name - - created_at - - workspace_id type: object - GuardrailInterval: - description: Interval at which the limit resets (daily, weekly, monthly) - enum: - - daily - - weekly - - monthly - - null - example: monthly - nullable: true - type: string - x-speakeasy-unknown-values: allow - ImageConfig: - additionalProperties: - anyOf: - - type: string - - format: double - type: number - - items: - nullable: true - type: array + FusionServerTool_OpenRouter: description: >- - Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. - example: - aspect_ratio: '16:9' - quality: high - type: object - ImageGenCallCompletedEvent: - allOf: - - $ref: '#/components/schemas/OpenAIResponsesImageGenCallCompleted' - - properties: {} - type: object - description: Image generation call completed - example: - item_id: call-123 - output_index: 0 - sequence_number: 4 - type: response.image_generation_call.completed - ImageGenCallGeneratingEvent: - allOf: - - $ref: '#/components/schemas/OpenAIResponsesImageGenCallGenerating' - - properties: {} - type: object - description: Image generation call is generating - example: - item_id: call-123 - output_index: 0 - sequence_number: 2 - type: response.image_generation_call.generating - ImageGenCallInProgressEvent: - allOf: - - $ref: '#/components/schemas/OpenAIResponsesImageGenCallInProgress' - - properties: {} - type: object - description: Image generation call in progress - example: - item_id: call-123 - output_index: 0 - sequence_number: 1 - type: response.image_generation_call.in_progress - ImageGenCallPartialImageEvent: - allOf: - - $ref: '#/components/schemas/OpenAIResponsesImageGenCallPartialImage' - - properties: {} - type: object - description: Image generation call with partial image - example: - item_id: call-123 - output_index: 0 - partial_image_b64: base64encodedimage... - partial_image_index: 0 - sequence_number: 3 - type: response.image_generation_call.partial_image - ImageGenerationServerTool: - description: Image generation tool configuration - example: - quality: high - type: image_generation - properties: - background: - enum: - - transparent - - opaque - - auto - type: string - x-speakeasy-unknown-values: allow - input_fidelity: - enum: - - high - - low - - null - nullable: true - type: string - x-speakeasy-unknown-values: allow - input_image_mask: - properties: - file_id: - type: string - image_url: - type: string - type: object - model: - enum: - - gpt-image-1 - - gpt-image-1-mini - type: string - x-speakeasy-unknown-values: allow - moderation: - enum: - - auto - - low - type: string - x-speakeasy-unknown-values: allow - output_compression: - type: integer - output_format: - enum: - - png - - webp - - jpeg - type: string - x-speakeasy-unknown-values: allow - partial_images: - type: integer - quality: - enum: - - low - - medium - - high - - auto - type: string - x-speakeasy-unknown-values: allow - size: - enum: - - 1024x1024 - - 1024x1536 - - 1536x1024 - - auto - type: string - x-speakeasy-unknown-values: allow - type: - enum: - - image_generation - type: string - required: - - type - type: object - ImageGenerationServerTool_OpenRouter: - description: 'OpenRouter built-in server tool: generates images from text prompts using an image generation model' + OpenRouter built-in server tool: fans out the user prompt to a panel of analysis models, then asks a judge model to summarize their collective output as structured JSON the outer model can synthesize from. example: parameters: - model: openai/gpt-image-1 - quality: high - size: 1024x1024 - type: openrouter:image_generation + analysis_models: + - ~anthropic/claude-opus-latest + - ~openai/gpt-latest + type: openrouter:fusion properties: parameters: - $ref: '#/components/schemas/ImageGenerationServerToolConfig' + $ref: '#/components/schemas/FusionServerToolConfig' type: enum: - - openrouter:image_generation + - openrouter:fusion type: string required: - type type: object - ImageGenerationServerToolConfig: - additionalProperties: - anyOf: - - type: string - - format: double - type: number - - items: - nullable: true - type: array - description: >- - Configuration for the openrouter:image_generation server tool. Accepts all image_config params (aspect_ratio, quality, size, background, output_format, output_compression, moderation, etc.) plus a model field. + FusionServerToolConfig: + description: Configuration for the openrouter:fusion server tool. example: - aspect_ratio: '16:9' - model: openai/gpt-5-image - quality: high + analysis_models: + - ~anthropic/claude-opus-latest + - ~openai/gpt-latest + - ~google/gemini-pro-latest properties: + analysis_models: + description: >- + Slugs of models to run in parallel as the analysis panel. Each model receives the user prompt with openrouter:web_search and openrouter:web_fetch enabled, then a judge model summarizes the collective output into structured analysis JSON. Capped at 8 models to bound cost amplification. Defaults to the Quality preset from /labs/fusion. + example: + - ~anthropic/claude-opus-latest + - ~openai/gpt-latest + - ~google/gemini-pro-latest + items: + type: string + maxItems: 8 + minItems: 1 + type: array + max_completion_tokens: + description: >- + Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, the provider's default applies. + example: 16384 + type: integer + max_tool_calls: + description: >- + Maximum number of tool-calling steps each panelist (analysis model) and the judge model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to 8. Capped at 16. + example: 12 + maximum: 16 + minimum: 1 + type: integer model: - description: Which image generation model to use (e.g. "openai/gpt-5-image"). Defaults to "openai/gpt-5-image". - example: openai/gpt-5-image + description: >- + Slug of the judge model that produces the structured analysis JSON. Defaults to the model used in the outer API request. + example: ~anthropic/claude-opus-latest type: string - type: object - ImageGenerationStatus: - enum: - - in_progress - - completed - - generating - - failed - example: completed - type: string - x-speakeasy-unknown-values: allow - IncompleteDetails: - example: - reason: max_output_tokens - nullable: true - properties: - reason: - enum: - - max_output_tokens - - content_filter - type: string - x-speakeasy-unknown-values: allow - type: object - IncompleteEvent: - description: Event emitted when a response is incomplete - example: - response: - created_at: 1704067200 - error: null - id: resp-abc123 - incomplete_details: null - instructions: null - max_output_tokens: null - metadata: null - model: gpt-4 - object: response - output: [] - parallel_tool_calls: true - status: incomplete - temperature: null - tool_choice: auto - tools: [] - top_p: null - sequence_number: 5 - type: response.incomplete - properties: - response: - $ref: '#/components/schemas/BaseResponsesResult' - sequence_number: - type: integer - type: - enum: - - response.incomplete - type: string - required: - - type - - response - - sequence_number - type: object - InProgressEvent: - description: Event emitted when a response is in progress - example: - response: - created_at: 1704067200 - error: null - id: resp-abc123 - incomplete_details: null - instructions: null - max_output_tokens: null - metadata: null - model: gpt-4 - object: response - output: [] - parallel_tool_calls: true - status: in_progress - temperature: null - tool_choice: auto - tools: [] - top_p: null - sequence_number: 1 - type: response.in_progress - properties: - response: - $ref: '#/components/schemas/BaseResponsesResult' - sequence_number: - type: integer - type: - enum: - - response.in_progress - type: string - required: - - type - - response - - sequence_number - type: object - InputAudio: - description: Audio input content item - example: - input_audio: - data: SGVsbG8gV29ybGQ= - format: mp3 - type: input_audio - properties: - input_audio: + reasoning: + description: >- + Reasoning configuration forwarded to panelist and judge inner calls. Use this to control reasoning effort and token budget for models that support extended thinking. properties: - data: - type: string - format: + effort: + description: Reasoning effort level for panelist and judge inner calls. enum: - - mp3 - - wav + - xhigh + - high + - medium + - low + - minimal + - none type: string x-speakeasy-unknown-values: allow - required: - - data - - format + max_tokens: + description: >- + Maximum number of reasoning tokens each panelist and judge model may use. Helps bound cost when models allocate too much budget to chain-of-thought. + type: integer type: object - type: - enum: - - input_audio - type: string - required: - - type - - input_audio + temperature: + description: >- + Sampling temperature forwarded to panelist and judge inner calls. When omitted, the provider's default applies. + example: 0.7 + format: double + type: number + tools: + description: >- + Server tools available to panelist and judge inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: "openrouter:web_search" }, { type: "openrouter:web_fetch" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only). + example: + - parameters: + excluded_domains: + - example.com + type: openrouter:web_search + - type: openrouter:web_fetch + items: + properties: + parameters: + additionalProperties: + nullable: true + description: Optional configuration forwarded as the tool's `parameters` object. + type: object + type: + description: Server tool type identifier (e.g. "openrouter:web_search", "openrouter:web_fetch"). + type: string + required: + - type + type: object + maxItems: 8 + type: array type: object - InputFile: - description: File input content item + GenerationContentData: + description: Stored prompt and completion content example: - file_id: file-abc123 - filename: document.pdf - type: input_file + input: + messages: + - content: What is the meaning of life? + role: user + output: + completion: The meaning of life is a philosophical question... + reasoning: null properties: - file_data: - type: string - file_id: - nullable: true - type: string - file_url: - type: string - filename: - type: string - type: - enum: - - input_file - type: string + input: + anyOf: + - properties: + prompt: + example: What is the meaning of life? + type: string + required: + - prompt + type: object + - properties: + messages: + example: + - content: What is the meaning of life? + role: user + items: + nullable: true + type: array + required: + - messages + type: object + description: The input to the generation — either a prompt string or an array of messages + output: + description: The output from the generation + properties: + completion: + description: The completion output + example: The meaning of life is a philosophical question... + nullable: true + type: string + reasoning: + description: Reasoning/thinking output, if any + example: null + nullable: true + type: string + required: + - reasoning + - completion + type: object required: - - type + - input + - output type: object - InputImage: - description: Image input content item + GenerationContentResponse: + description: Stored prompt and completion content for a generation example: - detail: auto - image_url: https://example.com/image.jpg - type: input_image + data: + input: + messages: + - content: What is the meaning of life? + role: user + output: + completion: The meaning of life is a philosophical question... + reasoning: null properties: - detail: - enum: - - auto - - high - - low - type: string - x-speakeasy-unknown-values: allow - image_url: - nullable: true - type: string - type: - enum: - - input_image - type: string + data: + $ref: '#/components/schemas/GenerationContentData' required: - - type - - detail + - data type: object - InputMessageItem: + GenerationResponse: + description: Generation response example: - content: - - text: Hello, how are you? - type: input_text - id: msg-abc123 - role: user - type: message - properties: - content: - items: - oneOf: - - $ref: '#/components/schemas/InputText' - - allOf: - - $ref: '#/components/schemas/InputImage' - - properties: {} - type: object - description: Image input content item - example: - detail: auto - image_url: https://example.com/image.jpg - type: input_image - - $ref: '#/components/schemas/InputFile' - - $ref: '#/components/schemas/InputAudio' - - $ref: '#/components/schemas/InputVideo' - nullable: true - type: array - id: - type: string - role: - anyOf: - - enum: - - user + data: + api_type: completions + app_id: 12345 + cache_discount: null + cancelled: false + created_at: '2024-07-15T23:33:19.433273+00:00' + external_user: user-123 + finish_reason: stop + generation_time: 1200 + http_referer: https://openrouter.ai/ + id: gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG + is_byok: false + latency: 1250 + model: sao10k/l3-stheno-8b + moderation_latency: 50 + native_finish_reason: stop + native_tokens_cached: 3 + native_tokens_completion: 25 + native_tokens_completion_images: 0 + native_tokens_prompt: 10 + native_tokens_reasoning: 5 + num_input_audio_prompt: 0 + num_media_completion: 0 + num_media_prompt: 1 + num_search_results: 5 + origin: https://openrouter.ai/ + provider_name: Infermatic + provider_responses: null + request_id: req-1727282430-aBcDeFgHiJkLmNoPqRsT + router: openrouter/auto + service_tier: priority + session_id: null + streamed: true + tokens_completion: 25 + tokens_prompt: 10 + total_cost: 0.0015 + upstream_id: chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946 + upstream_inference_cost: 0.0012 + usage: 0.0015 + user_agent: Mozilla/5.0 + properties: + data: + description: Generation data + properties: + api_type: + description: Type of API used for the generation + enum: + - completions + - embeddings + - rerank + - tts + - stt + - video + - image + - null + nullable: true type: string - - enum: - - system + x-speakeasy-unknown-values: allow + app_id: + description: ID of the app that made the request + example: 12345 + nullable: true + type: integer + cache_discount: + description: Discount applied due to caching + example: 0.0002 + format: double + nullable: true + type: number + cancelled: + description: Whether the generation was cancelled + example: false + nullable: true + type: boolean + created_at: + description: ISO 8601 timestamp of when the generation was created + example: '2024-07-15T23:33:19.433273+00:00' type: string - - enum: - - developer + data_region: + description: The data region this generation was routed through. 'europe' for EU-routed requests, 'global' otherwise. + enum: + - global + - europe + example: global type: string - type: - enum: - - message - type: string - required: - - role - type: object - InputModality: - enum: - - text - - image - - file - - audio - - video - example: text - type: string - x-speakeasy-unknown-values: allow - Inputs: - anyOf: - - type: string - - items: - anyOf: - - $ref: '#/components/schemas/ReasoningItem' - - $ref: '#/components/schemas/EasyInputMessage' - - $ref: '#/components/schemas/InputMessageItem' - - $ref: '#/components/schemas/FunctionCallItem' - - $ref: '#/components/schemas/FunctionCallOutputItem' - - allOf: - - $ref: '#/components/schemas/OutputMessageItem' - - properties: - content: - anyOf: - - items: - anyOf: - - $ref: '#/components/schemas/ResponseOutputText' - - $ref: '#/components/schemas/OpenAIResponsesRefusalContent' - type: array - - type: string - - nullable: true - type: object - description: An output message item - example: - content: - - annotations: [] - text: Hello! How can I help you? - type: output_text - id: msg-123 - role: assistant - status: completed - type: message - - allOf: - - $ref: '#/components/schemas/OutputReasoningItem' - - properties: - summary: - items: - $ref: '#/components/schemas/ReasoningSummaryText' - nullable: true - type: array - type: object - description: An output item containing reasoning - example: - content: - - text: First, we analyze the problem... - type: reasoning_text - format: anthropic-claude-v1 - id: reasoning-123 - signature: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj... - status: completed - summary: - - text: Analyzed the problem and found the optimal solution. - type: summary_text - type: reasoning - - $ref: '#/components/schemas/OutputFunctionCallItem' - - $ref: '#/components/schemas/OutputWebSearchCallItem' - - $ref: '#/components/schemas/OutputFileSearchCallItem' - - $ref: '#/components/schemas/OutputImageGenerationCallItem' - - $ref: '#/components/schemas/OutputDatetimeItem' - - $ref: '#/components/schemas/OutputWebSearchServerToolItem' - type: array - description: Input for a response request - can be a string or array of items - example: - - content: What is the weather today? - role: user - InputText: - description: Text input content item - example: - text: Hello, how can I help you? - type: input_text - properties: - text: - type: string - type: - enum: - - input_text - type: string - required: - - type - - text - type: object - InputVideo: - description: Video input content item - example: - type: input_video - video_url: https://example.com/video.mp4 - properties: - type: - enum: - - input_video - type: string - video_url: - description: A base64 data URL or remote URL that resolves to a video file - type: string - required: - - type - - video_url - type: object - InstructType: - description: Instruction format type - enum: - - none - - airoboros - - alpaca - - alpaca-modif - - chatml - - claude - - code-llama - - gemma - - llama2 - - llama3 - - mistral - - nemotron - - neural - - openchat - - phi3 - - rwkv - - vicuna - - zephyr - - deepseek-r1 - - deepseek-v3.1 - - qwq - - qwen3 - - null - example: chatml - nullable: true - type: string - x-speakeasy-unknown-values: allow - InternalServerResponse: - description: Internal Server Error - Unexpected server error - example: - error: - code: 500 - message: Internal Server Error - properties: - error: - $ref: '#/components/schemas/InternalServerResponseErrorData' - user_id: - nullable: true - type: string + x-speakeasy-unknown-values: allow + external_user: + description: External user identifier + example: user-123 + nullable: true + type: string + finish_reason: + description: Reason the generation finished + example: stop + nullable: true + type: string + generation_time: + description: Time taken for generation in milliseconds + example: 1200 + format: double + nullable: true + type: number + http_referer: + description: Referer header from the request + nullable: true + type: string + id: + description: Unique identifier for the generation + example: gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG + type: string + is_byok: + description: Whether this used bring-your-own-key + example: false + type: boolean + latency: + description: Total latency in milliseconds + example: 1250 + format: double + nullable: true + type: number + model: + description: Model used for the generation + example: sao10k/l3-stheno-8b + type: string + moderation_latency: + description: Moderation latency in milliseconds + example: 50 + format: double + nullable: true + type: number + native_finish_reason: + description: Native finish reason as reported by provider + example: stop + nullable: true + type: string + native_tokens_cached: + description: Native cached tokens as reported by provider + example: 3 + nullable: true + type: integer + native_tokens_completion: + description: Native completion tokens as reported by provider + example: 25 + nullable: true + type: integer + native_tokens_completion_images: + description: Native completion image tokens as reported by provider + example: 0 + nullable: true + type: integer + native_tokens_prompt: + description: Native prompt tokens as reported by provider + example: 10 + nullable: true + type: integer + native_tokens_reasoning: + description: Native reasoning tokens as reported by provider + example: 5 + nullable: true + type: integer + num_fetches: + description: Number of web fetches performed + example: 0 + nullable: true + type: integer + num_input_audio_prompt: + description: Number of audio inputs in the prompt + example: 0 + nullable: true + type: integer + num_media_completion: + description: Number of media items in the completion + example: 0 + nullable: true + type: integer + num_media_prompt: + description: Number of media items in the prompt + example: 1 + nullable: true + type: integer + num_search_results: + description: Number of search results included + example: 5 + nullable: true + type: integer + origin: + description: Origin URL of the request + example: https://openrouter.ai/ + type: string + preset_id: + description: ID of the preset used for this generation, null if no preset was used + example: a9e8d400-592a-494f-908c-375efa66cafd + nullable: true + type: string + provider_name: + description: Name of the provider that served the request + example: Infermatic + nullable: true + type: string + provider_responses: + description: List of provider responses for this generation, including fallback attempts + items: + $ref: '#/components/schemas/ProviderResponse' + nullable: true + type: array + request_id: + description: Unique identifier grouping all generations from a single API request + example: req-1727282430-aBcDeFgHiJkLmNoPqRsT + nullable: true + type: string + response_cache_source_id: + description: If this generation was served from response cache, contains the original generation ID. Null otherwise. + nullable: true + type: string + router: + description: Router used for the request (e.g., openrouter/auto) + example: openrouter/auto + nullable: true + type: string + service_tier: + description: Service tier the upstream provider reported running this request on, or null if it did not report one. + example: priority + nullable: true + type: string + session_id: + description: Session identifier grouping multiple generations in the same session + nullable: true + type: string + streamed: + description: Whether the response was streamed + example: true + nullable: true + type: boolean + tokens_completion: + description: Number of tokens in the completion + example: 25 + nullable: true + type: integer + tokens_prompt: + description: Number of tokens in the prompt + example: 10 + nullable: true + type: integer + total_cost: + description: Total cost of the generation in USD + example: 0.0015 + format: double + type: number + upstream_id: + description: Upstream provider's identifier for this generation + example: chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946 + nullable: true + type: string + upstream_inference_cost: + description: Cost charged by the upstream provider + example: 0.0012 + format: double + nullable: true + type: number + usage: + description: Usage amount in USD + example: 0.0015 + format: double + type: number + user_agent: + description: User-Agent header from the request + nullable: true + type: string + web_search_engine: + description: The resolved web search engine used for this generation (e.g. exa, firecrawl, parallel) + example: exa + nullable: true + type: string + required: + - id + - upstream_id + - total_cost + - cache_discount + - upstream_inference_cost + - created_at + - model + - app_id + - streamed + - cancelled + - provider_name + - latency + - moderation_latency + - generation_time + - finish_reason + - service_tier + - tokens_prompt + - tokens_completion + - native_tokens_prompt + - native_tokens_completion + - native_tokens_completion_images + - native_tokens_reasoning + - native_tokens_cached + - num_media_prompt + - num_input_audio_prompt + - num_media_completion + - num_search_results + - num_fetches + - web_search_engine + - origin + - usage + - is_byok + - native_finish_reason + - external_user + - api_type + - preset_id + - router + - provider_responses + - user_agent + - http_referer + - data_region + type: object required: - - error + - data type: object - InternalServerResponseErrorData: - description: Error data for InternalServerResponse + GetBYOKKeyResponse: example: - code: 500 - message: Internal Server Error + data: + allowed_api_key_hashes: null + allowed_models: null + allowed_user_ids: null + created_at: '2025-08-24T10:30:00Z' + disabled: false + id: 11111111-2222-3333-4444-555555555555 + is_fallback: false + label: sk-...AbCd + name: Production OpenAI Key + provider: openai + sort_order: 0 + workspace_id: 550e8400-e29b-41d4-a716-446655440000 properties: - code: - type: integer - message: - type: string - metadata: - additionalProperties: - nullable: true - nullable: true - type: object + data: + allOf: + - $ref: '#/components/schemas/BYOKKey' + - description: The BYOK credential. required: - - code - - message + - data type: object - KeyAssignment: + GetGuardrailResponse: example: - assigned_by: user_abc123 - created_at: '2025-08-24T10:30:00Z' - guardrail_id: 550e8400-e29b-41d4-a716-446655440001 - id: 550e8400-e29b-41d4-a716-446655440000 - key_hash: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 - key_label: prod-key - key_name: Production Key - properties: - assigned_by: - description: User ID of who made the assignment - example: user_abc123 - nullable: true - type: string - created_at: - description: ISO 8601 timestamp of when the assignment was created - example: '2025-08-24T10:30:00Z' - type: string - guardrail_id: - description: ID of the guardrail - example: 550e8400-e29b-41d4-a716-446655440001 - format: uuid - type: string - id: - description: Unique identifier for the assignment - example: 550e8400-e29b-41d4-a716-446655440000 - format: uuid - type: string - key_hash: - description: Hash of the assigned API key - example: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 - type: string - key_label: - description: Label of the API key - example: prod-key - type: string - key_name: - description: Name of the API key - example: Production Key - type: string - required: - - id - - key_hash - - guardrail_id - - key_name - - key_label - - assigned_by - - created_at - type: object - Legacy_ChatContentVideo: - deprecated: true - description: Video input content part (legacy format - deprecated) - example: - type: input_video - video_url: - url: https://example.com/video.mp4 - properties: - type: - enum: - - input_video - type: string - video_url: - $ref: '#/components/schemas/ChatContentVideoInput' - required: - - type - - video_url - type: object - Legacy_WebSearchServerTool: - description: Web search tool configuration - example: - engine: auto - filters: - allowed_domains: - - example.com - type: web_search + data: + allowed_models: null + allowed_providers: + - openai + - anthropic + - google + content_filter_builtins: + - action: redact + label: '[EMAIL]' + slug: email + content_filters: null + created_at: '2025-08-24T10:30:00Z' + description: Guardrail for production environment + enforce_zdr: null + enforce_zdr_anthropic: true + enforce_zdr_google: false + enforce_zdr_openai: true + enforce_zdr_other: false + id: 550e8400-e29b-41d4-a716-446655440000 + ignored_models: null + ignored_providers: null + limit_usd: 100 + name: Production Guardrail + reset_interval: monthly + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 properties: - engine: - $ref: '#/components/schemas/WebSearchEngineEnum' - filters: - $ref: '#/components/schemas/WebSearchDomainFilter' - max_results: - description: >- - Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and Parallel engines; ignored with native provider search. - example: 5 - type: integer - search_context_size: - $ref: '#/components/schemas/SearchContextSizeEnum' - type: - enum: - - web_search - type: string - user_location: - $ref: '#/components/schemas/WebSearchUserLocation' + data: + allOf: + - $ref: '#/components/schemas/Guardrail' + - description: The guardrail required: - - type + - data type: object - ListEndpointsResponse: - description: List of available endpoints for a model + GetObservabilityDestinationResponse: example: - architecture: - input_modalities: - - text - instruct_type: chatml - modality: text->text - output_modalities: - - text - tokenizer: GPT - created: 1692901234 - description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. - endpoints: - - context_length: 8192 - latency_last_30m: - p50: 0.25 - p75: 0.35 - p90: 0.48 - p99: 0.85 - max_completion_tokens: 4096 - max_prompt_tokens: 8192 - model_name: GPT-4 - name: 'OpenAI: GPT-4' - pricing: - completion: '0.00006' - image: '0' - prompt: '0.00003' - request: '0' - provider_name: OpenAI - quantization: fp16 - status: default - supported_parameters: - - temperature - - top_p - - max_tokens - - frequency_penalty - - presence_penalty - supports_implicit_caching: true - tag: openai - throughput_last_30m: - p50: 45.2 - p75: 38.5 - p90: 28.3 - p99: 15.1 - uptime_last_1d: 99.8 - uptime_last_30m: 99.5 - uptime_last_5m: 100 - id: openai/gpt-4 - name: GPT-4 + data: + api_key_hashes: null + config: + baseUrl: https://us.cloud.langfuse.com + publicKey: pk-l...EfGh + secretKey: sk-l...AbCd + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production Langfuse + privacy_mode: false + sampling_rate: 1 + type: langfuse + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 properties: - architecture: + data: allOf: - - $ref: '#/components/schemas/ModelArchitecture' - - example: - instruct_type: chatml - modality: text - tokenizer: GPT - properties: - input_modalities: - description: Supported input modalities - items: - $ref: '#/components/schemas/InputModality' - type: array - instruct_type: - $ref: '#/components/schemas/InstructType' - modality: - description: Primary modality of the model - example: text - nullable: true - type: string - output_modalities: - description: Supported output modalities - items: - $ref: '#/components/schemas/OutputModality' - type: array - tokenizer: - allOf: - - $ref: '#/components/schemas/ModelGroup' - - nullable: true - required: - - tokenizer - - instruct_type - - modality - - input_modalities - - output_modalities - created: - description: Unix timestamp of when the model was created - example: 1692901234 - type: integer - description: - description: Description of the model - example: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. - type: string - endpoints: - description: List of available endpoints for this model - items: - $ref: '#/components/schemas/PublicEndpoint' - type: array - id: - description: Unique identifier for the model - example: openai/gpt-4 - type: string - name: - description: Display name of the model - example: GPT-4 - type: string + - $ref: '#/components/schemas/ObservabilityDestination' + - description: The observability destination. required: - - id - - name - - created - - description - - architecture - - endpoints + - data type: object - ListGuardrailsResponse: + GetPresetResponse: + description: A preset with its currently designated version. example: data: - - allowed_models: null - allowed_providers: - - openai - - anthropic - - google - created_at: '2025-08-24T10:30:00Z' - description: Guardrail for production environment - enforce_zdr: false + created_at: '2026-04-20T10:00:00Z' + creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 + description: null + designated_version: + config: + model: openai/gpt-4o + temperature: 0.7 + created_at: '2026-04-20T10:00:00Z' + creator_id: user_2dHFtVWx2n56w6HkM0000000000 id: 550e8400-e29b-41d4-a716-446655440000 - ignored_models: null - ignored_providers: null - limit_usd: 100 - name: Production Guardrail - reset_interval: monthly - updated_at: '2025-08-24T15:45:00Z' - workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 - total_count: 1 + preset_id: 650e8400-e29b-41d4-a716-446655440001 + system_prompt: You are a helpful assistant. + updated_at: '2026-04-20T10:00:00Z' + version: 1 + designated_version_id: 550e8400-e29b-41d4-a716-446655440000 + id: 650e8400-e29b-41d4-a716-446655440001 + name: my-preset + slug: my-preset + status: active + status_updated_at: null + updated_at: '2026-04-20T10:00:00Z' + workspace_id: 750e8400-e29b-41d4-a716-446655440002 properties: data: - description: List of guardrails - items: - $ref: '#/components/schemas/Guardrail' - type: array - total_count: - description: Total number of guardrails - example: 25 - type: integer + $ref: '#/components/schemas/PresetWithDesignatedVersion' required: - data - - total_count type: object - ListKeyAssignmentsResponse: + GetPresetVersionResponse: + description: A single version of a preset. example: data: - - assigned_by: user_abc123 - created_at: '2025-08-24T10:30:00Z' - guardrail_id: 550e8400-e29b-41d4-a716-446655440001 - id: 550e8400-e29b-41d4-a716-446655440000 - key_hash: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 - key_label: prod-key - key_name: Production Key - total_count: 1 + config: + model: openai/gpt-4o + temperature: 0.7 + created_at: '2026-04-20T10:00:00Z' + creator_id: user_2dHFtVWx2n56w6HkM0000000000 + id: 550e8400-e29b-41d4-a716-446655440000 + preset_id: 650e8400-e29b-41d4-a716-446655440001 + system_prompt: You are a helpful assistant. + updated_at: '2026-04-20T10:00:00Z' + version: 1 properties: data: - description: List of key assignments - items: - $ref: '#/components/schemas/KeyAssignment' - type: array - total_count: - description: Total number of key assignments for this guardrail - example: 25 - type: integer + $ref: '#/components/schemas/PresetDesignatedVersion' required: - data - - total_count type: object - ListMemberAssignmentsResponse: + GetWorkspaceResponse: example: data: - - assigned_by: user_abc123 - created_at: '2025-08-24T10:30:00Z' - guardrail_id: 550e8400-e29b-41d4-a716-446655440001 - id: 550e8400-e29b-41d4-a716-446655440000 - organization_id: org_xyz789 - user_id: user_abc123 - total_count: 1 + created_at: '2025-08-24T10:30:00Z' + created_by: user_abc123 + default_image_model: openai/dall-e-3 + default_provider_sort: price + default_text_model: openai/gpt-4o + description: Production environment workspace + id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 + is_data_discount_logging_enabled: true + is_observability_broadcast_enabled: false + is_observability_io_logging_enabled: false + name: Production + slug: production + updated_at: '2025-08-24T15:45:00Z' properties: data: - description: List of member assignments - items: - $ref: '#/components/schemas/MemberAssignment' - type: array - total_count: - description: Total number of member assignments - example: 10 - type: integer + allOf: + - $ref: '#/components/schemas/Workspace' + - description: The workspace required: - data - - total_count type: object - ListWorkspacesResponse: + GoneResponse: + description: Gone - Endpoint has been permanently removed or deprecated example: - data: - - created_at: '2025-08-24T10:30:00Z' - created_by: user_abc123 - default_image_model: openai/dall-e-3 - default_provider_sort: price - default_text_model: openai/gpt-4o - description: Production environment workspace - id: 550e8400-e29b-41d4-a716-446655440000 - is_data_discount_logging_enabled: true - is_observability_broadcast_enabled: false - is_observability_io_logging_enabled: false - name: Production - slug: production - updated_at: '2025-08-24T15:45:00Z' - total_count: 1 + error: + code: 410 + message: >- + The Coinbase APIs used by this endpoint have been deprecated, so the Coinbase Commerce credits API has been removed. Use the web credits purchase flow instead. properties: - data: - description: List of workspaces - items: - $ref: '#/components/schemas/Workspace' - type: array - total_count: - description: Total number of workspaces - example: 5 - type: integer + error: + $ref: '#/components/schemas/GoneResponseErrorData' + openrouter_metadata: + additionalProperties: + nullable: true + nullable: true + type: object + user_id: + nullable: true + type: string required: - - data - - total_count + - error type: object - McpServerTool: - description: MCP (Model Context Protocol) tool configuration + GoneResponseErrorData: + description: Error data for GoneResponse example: - server_label: my-server - server_url: https://example.com/mcp - type: mcp + code: 410 + message: >- + The Coinbase APIs used by this endpoint have been deprecated, so the Coinbase Commerce credits API has been removed. Use the web credits purchase flow instead. properties: - allowed_tools: - anyOf: - - items: - type: string - type: array - - properties: - read_only: - type: boolean - tool_names: - items: - type: string - type: array - type: object - - nullable: true - authorization: - type: string - connector_id: - enum: - - connector_dropbox - - connector_gmail - - connector_googlecalendar - - connector_googledrive - - connector_microsoftteams - - connector_outlookcalendar - - connector_outlookemail - - connector_sharepoint + code: + type: integer + message: type: string - x-speakeasy-unknown-values: allow - headers: + metadata: additionalProperties: - type: string + nullable: true nullable: true type: object - require_approval: - anyOf: - - properties: - always: - properties: - tool_names: - items: - type: string - type: array - type: object - never: - properties: - tool_names: - items: - type: string - type: array - type: object - type: object - - enum: - - always - type: string - - enum: - - never - type: string - - nullable: true - server_description: - type: string - server_label: - type: string - server_url: - type: string - type: - enum: - - mcp - type: string required: - - type - - server_label + - code + - message type: object - MemberAssignment: + Guardrail: example: - assigned_by: user_abc123 + allowed_models: null + allowed_providers: + - openai + - anthropic + - google + content_filter_builtins: + - action: redact + label: '[EMAIL]' + slug: email + content_filters: null created_at: '2025-08-24T10:30:00Z' - guardrail_id: 550e8400-e29b-41d4-a716-446655440001 + description: Guardrail for production environment + enforce_zdr: null + enforce_zdr_anthropic: true + enforce_zdr_google: false + enforce_zdr_openai: true + enforce_zdr_other: false id: 550e8400-e29b-41d4-a716-446655440000 - organization_id: org_xyz789 - user_id: user_abc123 + ignored_models: null + ignored_providers: null + limit_usd: 100 + name: Production Guardrail + reset_interval: monthly + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 properties: - assigned_by: - description: User ID of who made the assignment - example: user_abc123 + allowed_models: + description: Array of model canonical_slugs (immutable identifiers) + example: + - openai/gpt-5.2-20251211 + - anthropic/claude-4.5-opus-20251124 + - deepseek/deepseek-r1-0528:free + items: + type: string nullable: true - type: string + type: array + allowed_providers: + description: List of allowed provider IDs + example: + - openai + - anthropic + - google + items: + type: string + nullable: true + type: array + content_filter_builtins: + description: >- + Builtin content filters applied to requests. Includes PII detectors and the regex-based prompt injection detector. + example: + - action: redact + label: '[EMAIL]' + slug: email + items: + $ref: '#/components/schemas/ContentFilterBuiltinEntry' + nullable: true + type: array + content_filters: + description: Custom regex content filters applied to request messages + example: + - action: redact + label: '[API_KEY]' + pattern: \b(sk-[a-zA-Z0-9]{48})\b + items: + $ref: '#/components/schemas/ContentFilterEntry' + nullable: true + type: array created_at: - description: ISO 8601 timestamp of when the assignment was created + description: ISO 8601 timestamp of when the guardrail was created example: '2025-08-24T10:30:00Z' type: string - guardrail_id: - description: ID of the guardrail - example: 550e8400-e29b-41d4-a716-446655440001 - format: uuid + description: + description: Description of the guardrail + example: Guardrail for production environment + nullable: true type: string + enforce_zdr: + deprecated: true + description: >- + Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. + example: false + nullable: true + type: boolean + enforce_zdr_anthropic: + description: Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. + example: false + nullable: true + type: boolean + enforce_zdr_google: + description: Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. + example: false + nullable: true + type: boolean + enforce_zdr_openai: + description: Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. + example: false + nullable: true + type: boolean + enforce_zdr_other: + description: >- + Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided. + example: false + nullable: true + type: boolean id: - description: Unique identifier for the assignment + description: Unique identifier for the guardrail example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string - organization_id: - description: Organization ID - example: org_xyz789 - type: string - user_id: - description: Clerk user ID of the assigned member - example: user_abc123 - type: string - required: + ignored_models: + description: Array of model canonical_slugs to exclude from routing + example: + - openai/gpt-4o-mini-2024-07-18 + items: + type: string + nullable: true + type: array + ignored_providers: + description: List of provider IDs to exclude from routing + example: + - azure + items: + type: string + nullable: true + type: array + limit_usd: + description: Spending limit in USD + example: 100 + format: double + nullable: true + type: number + name: + description: Name of the guardrail + example: Production Guardrail + type: string + reset_interval: + $ref: '#/components/schemas/GuardrailInterval' + updated_at: + description: ISO 8601 timestamp of when the guardrail was last updated + example: '2025-08-24T15:45:00Z' + nullable: true + type: string + workspace_id: + description: The workspace ID this guardrail belongs to. + example: 0df9e665-d932-5740-b2c7-b52af166bc11 + type: string + required: - id - - user_id - - organization_id - - guardrail_id - - assigned_by + - name - created_at + - workspace_id type: object - MessagesContentBlockDeltaEvent: - description: Event sent when content is added to a content block + GuardrailInterval: + description: Interval at which the limit resets (daily, weekly, monthly) + enum: + - daily + - weekly + - monthly + - null + example: monthly + nullable: true + type: string + x-speakeasy-unknown-values: allow + ImageConfig: + additionalProperties: + anyOf: + - type: string + - format: double + type: number + - items: + nullable: true + type: array + description: >- + Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. example: - delta: - text: Hello - type: text_delta - index: 0 - type: content_block_delta - properties: - delta: - oneOf: - - properties: - text: - type: string - type: - enum: - - text_delta - type: string - required: - - type - - text - type: object - - properties: - partial_json: - type: string - type: - enum: - - input_json_delta - type: string - required: - - type - - partial_json - type: object - - properties: - thinking: - type: string - type: - enum: - - thinking_delta - type: string - required: - - type - - thinking - type: object - - properties: - signature: - type: string - type: - enum: - - signature_delta - type: string - required: - - type - - signature - type: object - - properties: - citation: - discriminator: - mapping: - char_location: '#/components/schemas/AnthropicCitationCharLocation' - content_block_location: '#/components/schemas/AnthropicCitationContentBlockLocation' - page_location: '#/components/schemas/AnthropicCitationPageLocation' - search_result_location: '#/components/schemas/AnthropicCitationSearchResultLocation' - web_search_result_location: '#/components/schemas/AnthropicCitationWebSearchResultLocation' - propertyName: type - oneOf: - - $ref: '#/components/schemas/AnthropicCitationCharLocation' - - $ref: '#/components/schemas/AnthropicCitationPageLocation' - - $ref: '#/components/schemas/AnthropicCitationContentBlockLocation' - - $ref: '#/components/schemas/AnthropicCitationWebSearchResultLocation' - - $ref: '#/components/schemas/AnthropicCitationSearchResultLocation' - type: - enum: - - citations_delta - type: string - required: - - type - - citation - type: object - - properties: - content: - nullable: true - type: string - type: - enum: - - compaction_delta - type: string - required: - - type - - content - type: object - index: - type: integer - type: - enum: - - content_block_delta - type: string - required: - - type - - index - - delta + aspect_ratio: '16:9' + quality: high type: object - MessagesContentBlockStartEvent: - description: Event sent when a new content block starts + ImageGenCallCompletedEvent: + allOf: + - $ref: '#/components/schemas/OpenAIResponsesImageGenCallCompleted' + - properties: {} + type: object + description: Image generation call completed example: - content_block: - text: '' - type: text - index: 0 - type: content_block_start - properties: - content_block: - anyOf: - - $ref: '#/components/schemas/AnthropicTextBlock' - - $ref: '#/components/schemas/AnthropicToolUseBlock' - - $ref: '#/components/schemas/AnthropicThinkingBlock' - - $ref: '#/components/schemas/AnthropicRedactedThinkingBlock' - - $ref: '#/components/schemas/AnthropicServerToolUseBlock' - - $ref: '#/components/schemas/AnthropicWebSearchToolResult' - - $ref: '#/components/schemas/AnthropicWebFetchToolResult' - - $ref: '#/components/schemas/AnthropicCodeExecutionToolResult' - - $ref: '#/components/schemas/AnthropicBashCodeExecutionToolResult' - - $ref: '#/components/schemas/AnthropicTextEditorCodeExecutionToolResult' - - $ref: '#/components/schemas/AnthropicToolSearchToolResult' - - $ref: '#/components/schemas/AnthropicContainerUpload' - - $ref: '#/components/schemas/AnthropicCompactionBlock' - - properties: - content: - nullable: true - type: string - type: - enum: - - compaction - type: string - required: - - type - - content - type: object - index: - type: integer - type: - enum: - - content_block_start - type: string - required: - - type - - index - - content_block - type: object - MessagesContentBlockStopEvent: - description: Event sent when a content block is complete + item_id: call-123 + output_index: 0 + sequence_number: 4 + type: response.image_generation_call.completed + ImageGenCallGeneratingEvent: + allOf: + - $ref: '#/components/schemas/OpenAIResponsesImageGenCallGenerating' + - properties: {} + type: object + description: Image generation call is generating example: - index: 0 - type: content_block_stop - properties: - index: - type: integer - type: - enum: - - content_block_stop - type: string - required: - - type - - index - type: object - MessagesDeltaEvent: - description: Event sent when the message metadata changes (e.g., stop_reason) + item_id: call-123 + output_index: 0 + sequence_number: 2 + type: response.image_generation_call.generating + ImageGenCallInProgressEvent: + allOf: + - $ref: '#/components/schemas/OpenAIResponsesImageGenCallInProgress' + - properties: {} + type: object + description: Image generation call in progress example: - delta: - stop_details: null - stop_reason: end_turn - stop_sequence: null - type: message_delta - usage: - output_tokens: 15 + item_id: call-123 + output_index: 0 + sequence_number: 1 + type: response.image_generation_call.in_progress + ImageGenCallPartialImageEvent: + allOf: + - $ref: '#/components/schemas/OpenAIResponsesImageGenCallPartialImage' + - properties: {} + type: object + description: Image generation call with partial image + example: + item_id: call-123 + output_index: 0 + partial_image_b64: base64encodedimage... + partial_image_index: 0 + sequence_number: 3 + type: response.image_generation_call.partial_image + ImageGenerationServerTool: + description: Image generation tool configuration + example: + quality: high + type: image_generation properties: - delta: + background: + enum: + - transparent + - opaque + - auto + type: string + x-speakeasy-unknown-values: allow + input_fidelity: + enum: + - high + - low + - null + nullable: true + type: string + x-speakeasy-unknown-values: allow + input_image_mask: properties: - container: - $ref: '#/components/schemas/AnthropicContainer' - stop_details: - $ref: '#/components/schemas/AnthropicRefusalStopDetails' - stop_reason: - $ref: '#/components/schemas/ORAnthropicStopReason' - stop_sequence: - nullable: true + file_id: + type: string + image_url: type: string - required: - - container - - stop_details - - stop_reason - - stop_sequence type: object + model: + enum: + - gpt-image-1 + - gpt-image-1-mini + type: string + x-speakeasy-unknown-values: allow + moderation: + enum: + - auto + - low + type: string + x-speakeasy-unknown-values: allow + output_compression: + type: integer + output_format: + enum: + - png + - webp + - jpeg + type: string + x-speakeasy-unknown-values: allow + partial_images: + type: integer + quality: + enum: + - low + - medium + - high + - auto + type: string + x-speakeasy-unknown-values: allow + size: + enum: + - 1024x1024 + - 1024x1536 + - 1536x1024 + - auto + type: string + x-speakeasy-unknown-values: allow type: enum: - - message_delta + - image_generation type: string - usage: - properties: - cache_creation_input_tokens: - nullable: true - type: integer - cache_read_input_tokens: - nullable: true - type: integer - input_tokens: - nullable: true - type: integer - iterations: - items: - $ref: '#/components/schemas/AnthropicUsageIteration' - type: array - output_tokens: - type: integer - server_tool_use: - nullable: true - properties: - web_fetch_requests: - type: integer - web_search_requests: - type: integer - required: - - web_search_requests - - web_fetch_requests - type: object - required: - - input_tokens - - output_tokens - - cache_creation_input_tokens - - cache_read_input_tokens - - server_tool_use - type: object required: - type - - delta - - usage type: object - MessagesErrorDetail: + ImageGenerationServerTool_OpenRouter: + description: 'OpenRouter built-in server tool: generates images from text prompts using an image generation model' example: - message: Invalid request parameters - type: invalid_request_error + parameters: + model: openai/gpt-5-image + quality: high + size: 1024x1024 + type: openrouter:image_generation properties: - message: - type: string + parameters: + $ref: '#/components/schemas/ImageGenerationServerToolConfig' type: + enum: + - openrouter:image_generation type: string required: - type - - message type: object - MessagesErrorEvent: - description: Error event in the stream + ImageGenerationServerToolConfig: + additionalProperties: + anyOf: + - type: string + - format: double + type: number + - items: + nullable: true + type: array + description: >- + Configuration for the openrouter:image_generation server tool. Accepts all image_config params (aspect_ratio, quality, size, background, output_format, output_compression, moderation, etc.) plus a model field. example: - error: - message: Overloaded - type: overloaded_error - type: error + aspect_ratio: '16:9' + model: openai/gpt-5-image + quality: high properties: - error: - properties: - message: - type: string - type: - type: string - required: - - type - - message - type: object - type: + model: + description: Which image generation model to use (e.g. "openai/gpt-5-image"). Defaults to "openai/gpt-5-image". + example: openai/gpt-5-image + type: string + type: object + ImageGenerationStatus: + enum: + - in_progress + - completed + - generating + - failed + example: completed + type: string + x-speakeasy-unknown-values: allow + IncompleteDetails: + example: + reason: max_output_tokens + nullable: true + properties: + reason: enum: - - error + - max_output_tokens + - content_filter type: string - required: - - type - - error + x-speakeasy-unknown-values: allow type: object - MessagesErrorResponse: + IncompleteEvent: + description: Event emitted when a response is incomplete example: - error: - message: Invalid request parameters - type: invalid_request_error - type: error + response: + created_at: 1704067200 + error: null + id: resp-abc123 + incomplete_details: null + instructions: null + max_output_tokens: null + metadata: null + model: gpt-4 + object: response + output: [] + parallel_tool_calls: true + status: incomplete + temperature: null + tool_choice: auto + tools: [] + top_p: null + sequence_number: 5 + type: response.incomplete properties: - error: - $ref: '#/components/schemas/MessagesErrorDetail' + response: + $ref: '#/components/schemas/BaseResponsesResult' + sequence_number: + type: integer type: enum: - - error + - response.incomplete type: string required: - type - - error + - response + - sequence_number type: object - MessagesMessageParam: - description: Anthropic message with OpenRouter extensions + InProgressEvent: + description: Event emitted when a response is in progress example: - content: Hello, how are you? - role: user + response: + created_at: 1704067200 + error: null + id: resp-abc123 + incomplete_details: null + instructions: null + max_output_tokens: null + metadata: null + model: gpt-4 + object: response + output: [] + parallel_tool_calls: true + status: in_progress + temperature: null + tool_choice: auto + tools: [] + top_p: null + sequence_number: 1 + type: response.in_progress properties: - content: - anyOf: - - type: string - - items: - oneOf: - - $ref: '#/components/schemas/AnthropicTextBlockParam' - - $ref: '#/components/schemas/AnthropicImageBlockParam' - - $ref: '#/components/schemas/AnthropicDocumentBlockParam' - - properties: - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - id: - type: string - input: - nullable: true - name: - type: string - type: - enum: - - tool_use - type: string - required: - - type - - id - - name - type: object - - properties: - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - content: - anyOf: - - type: string - - items: - anyOf: - - $ref: '#/components/schemas/AnthropicTextBlockParam' - - $ref: '#/components/schemas/AnthropicImageBlockParam' - - properties: - tool_name: - type: string - type: - enum: - - tool_reference - type: string - required: - - type - - tool_name - type: object - - $ref: '#/components/schemas/AnthropicSearchResultBlockParam' - - $ref: '#/components/schemas/AnthropicDocumentBlockParam' - type: array - is_error: - type: boolean - tool_use_id: - type: string - type: - enum: - - tool_result - type: string - required: - - type - - tool_use_id - type: object - - properties: - signature: - type: string - thinking: - type: string - type: - enum: - - thinking - type: string - required: - - type - - thinking - - signature - type: object - - properties: - data: - type: string - type: - enum: - - redacted_thinking - type: string - required: - - type - - data - type: object - - properties: - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - id: - type: string - input: - nullable: true - name: - $ref: '#/components/schemas/AnthropicServerToolName' - type: - enum: - - server_tool_use - type: string - required: - - type - - id - - name - type: object - - properties: - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - content: - anyOf: - - items: - $ref: '#/components/schemas/AnthropicWebSearchResultBlockParam' - type: array - - properties: - error_code: - enum: - - invalid_tool_input - - unavailable - - max_uses_exceeded - - too_many_requests - - query_too_long - type: string - x-speakeasy-unknown-values: allow - type: - enum: - - web_search_tool_result_error - type: string - required: - - type - - error_code - type: object - tool_use_id: - type: string - type: - enum: - - web_search_tool_result - type: string - required: - - type - - tool_use_id - - content - type: object - - $ref: '#/components/schemas/AnthropicSearchResultBlockParam' - - properties: - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - content: - nullable: true - type: string - type: - enum: - - compaction - type: string - required: - - type - - content - type: object - type: array - role: + response: + $ref: '#/components/schemas/BaseResponsesResult' + sequence_number: + type: integer + type: enum: - - user - - assistant + - response.in_progress type: string - x-speakeasy-unknown-values: allow required: - - role - - content + - type + - response + - sequence_number type: object - MessagesOutputConfig: - description: Configuration for controlling output behavior. Supports the effort parameter and structured output format. + InputAudio: + description: Audio input content item example: - effort: medium + input_audio: + data: SGVsbG8gV29ybGQ= + format: mp3 + type: input_audio properties: - effort: - description: >- - How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer. Valid values are `low`, `medium`, `high`, `xhigh`, or `max`. - enum: - - low - - medium - - high - - xhigh - - max - - null - example: medium - nullable: true - type: string - x-speakeasy-unknown-values: allow - format: - description: >- - A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs). - nullable: true + input_audio: properties: - schema: - additionalProperties: - nullable: true - type: object - type: - enum: - - json_schema + data: type: string - required: - - type - - schema - type: object - task_budget: - description: >- - Task budget for an agentic turn. The model sees a countdown of remaining tokens and uses it to prioritize work and wind down gracefully. Advisory — does not enforce a hard cap. - example: - total: 400000 - type: tokens - nullable: true - properties: - remaining: - minimum: 0 - nullable: true - type: integer - total: - minimum: 20000 - type: integer - type: + format: enum: - - tokens + - mp3 + - wav type: string + x-speakeasy-unknown-values: allow required: - - type - - total - type: object + - data + - format + type: object + type: + enum: + - input_audio + type: string + required: + - type + - input_audio type: object - MessagesPingEvent: - description: Keep-alive ping event + InputFile: + description: File input content item example: - type: ping + file_id: file-abc123 + filename: document.pdf + type: input_file properties: + file_data: + type: string + file_id: + nullable: true + type: string + file_url: + type: string + filename: + type: string type: enum: - - ping + - input_file type: string required: - type type: object - MessagesRequest: - description: Request schema for Anthropic Messages API endpoint + InputImage: + description: Image input content item example: - max_tokens: 1024 - messages: - - content: Hello, how are you? - role: user - model: anthropic/claude-4.5-sonnet-20250929 - temperature: 0.7 + detail: auto + image_url: https://example.com/image.jpg + type: input_image properties: - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - context_management: + detail: + enum: + - auto + - high + - low + - original + type: string + x-speakeasy-unknown-values: allow + image_url: nullable: true - properties: - edits: - items: - oneOf: + type: string + type: + enum: + - input_image + type: string + required: + - type + - detail + type: object + InputMessageItem: + example: + content: + - text: Hello, how are you? + type: input_text + id: msg-abc123 + role: user + type: message + properties: + content: + items: + oneOf: + - $ref: '#/components/schemas/InputText' + - allOf: + - $ref: '#/components/schemas/InputImage' + - properties: {} + type: object + description: Image input content item + example: + detail: auto + image_url: https://example.com/image.jpg + type: input_image + - $ref: '#/components/schemas/InputFile' + - $ref: '#/components/schemas/InputAudio' + - $ref: '#/components/schemas/InputVideo' + nullable: true + type: array + id: + type: string + role: + anyOf: + - enum: + - user + type: string + - enum: + - system + type: string + - enum: + - developer + type: string + type: + enum: + - message + type: string + required: + - role + type: object + InputModality: + enum: + - text + - image + - file + - audio + - video + example: text + type: string + x-speakeasy-unknown-values: allow + InputReference: + description: >- + A reference asset used to guide video generation. Image references are supported by all providers; audio and video references are only honored by providers that support them (currently BytePlus Seedance 2.0). + discriminator: + mapping: + audio_url: '#/components/schemas/ContentPartAudio' + image_url: '#/components/schemas/ContentPartImage' + video_url: '#/components/schemas/ContentPartVideo' + propertyName: type + example: + image_url: + url: https://example.com/image.png + type: image_url + oneOf: + - $ref: '#/components/schemas/ContentPartImage' + - $ref: '#/components/schemas/ContentPartAudio' + - $ref: '#/components/schemas/ContentPartVideo' + Inputs: + anyOf: + - type: string + - items: + anyOf: + - $ref: '#/components/schemas/ReasoningItem' + - $ref: '#/components/schemas/EasyInputMessage' + - $ref: '#/components/schemas/InputMessageItem' + - $ref: '#/components/schemas/FunctionCallItem' + - $ref: '#/components/schemas/FunctionCallOutputItem' + - $ref: '#/components/schemas/ApplyPatchCallItem' + - $ref: '#/components/schemas/ApplyPatchCallOutputItem' + - allOf: + - $ref: '#/components/schemas/OutputMessageItem' - properties: - clear_at_least: - $ref: '#/components/schemas/AnthropicInputTokensClearAtLeast' - clear_tool_inputs: + content: anyOf: - - type: boolean - items: - type: string + anyOf: + - $ref: '#/components/schemas/ResponseOutputText' + - $ref: '#/components/schemas/OpenAIResponsesRefusalContent' type: array + - type: string - nullable: true - exclude_tools: - items: - type: string - nullable: true - type: array - keep: - $ref: '#/components/schemas/AnthropicToolUsesKeep' - trigger: - discriminator: - mapping: - input_tokens: '#/components/schemas/AnthropicInputTokensTrigger' - tool_uses: '#/components/schemas/AnthropicToolUsesTrigger' - propertyName: type - oneOf: - - $ref: '#/components/schemas/AnthropicInputTokensTrigger' - - $ref: '#/components/schemas/AnthropicToolUsesTrigger' - type: - enum: - - clear_tool_uses_20250919 - type: string - required: - - type - type: object - - properties: - keep: - anyOf: - - $ref: '#/components/schemas/AnthropicThinkingTurns' - - properties: - type: - enum: - - all - type: string - required: - - type - type: object - - enum: - - all - type: string - type: - enum: - - clear_thinking_20251015 - type: string - required: - - type type: object + description: An output message item + example: + content: + - annotations: [] + text: Hello! How can I help you? + type: output_text + id: msg-123 + role: assistant + status: completed + type: message + - allOf: + - $ref: '#/components/schemas/OutputReasoningItem' - properties: - instructions: + summary: + items: + $ref: '#/components/schemas/ReasoningSummaryText' nullable: true - type: string - pause_after_compaction: - type: boolean - trigger: - allOf: - - $ref: '#/components/schemas/AnthropicInputTokensTrigger' - - nullable: true - properties: {} - type: object - example: - type: input_tokens - value: 100000 - type: - enum: - - compact_20260112 - type: string - required: - - type + type: array type: object - type: array - type: object - max_tokens: - type: integer - messages: - items: - $ref: '#/components/schemas/MessagesMessageParam' - nullable: true - type: array - metadata: - properties: - user_id: - nullable: true - type: string - type: object - model: - type: string - models: - items: - type: string - type: array - output_config: - $ref: '#/components/schemas/MessagesOutputConfig' - plugins: - description: Plugins you want to enable for this request, including their settings. - items: - discriminator: - mapping: - auto-router: '#/components/schemas/AutoRouterPlugin' - context-compression: '#/components/schemas/ContextCompressionPlugin' - file-parser: '#/components/schemas/FileParserPlugin' - moderation: '#/components/schemas/ModerationPlugin' - pareto-router: '#/components/schemas/ParetoRouterPlugin' - response-healing: '#/components/schemas/ResponseHealingPlugin' - web: '#/components/schemas/WebSearchPlugin' - propertyName: id - oneOf: - - $ref: '#/components/schemas/AutoRouterPlugin' - - $ref: '#/components/schemas/ModerationPlugin' - - $ref: '#/components/schemas/WebSearchPlugin' - - $ref: '#/components/schemas/FileParserPlugin' - - $ref: '#/components/schemas/ResponseHealingPlugin' - - $ref: '#/components/schemas/ContextCompressionPlugin' - - $ref: '#/components/schemas/ParetoRouterPlugin' + description: An output item containing reasoning + example: + content: + - text: First, we analyze the problem... + type: reasoning_text + format: anthropic-claude-v1 + id: reasoning-123 + signature: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj... + status: completed + summary: + - text: Analyzed the problem and found the optimal solution. + type: summary_text + type: reasoning + - $ref: '#/components/schemas/OutputFunctionCallItem' + - $ref: '#/components/schemas/OutputCustomToolCallItem' + - $ref: '#/components/schemas/OutputWebSearchCallItem' + - $ref: '#/components/schemas/OutputFileSearchCallItem' + - $ref: '#/components/schemas/OutputImageGenerationCallItem' + - $ref: '#/components/schemas/OutputCodeInterpreterCallItem' + - $ref: '#/components/schemas/OutputComputerCallItem' + - $ref: '#/components/schemas/OutputDatetimeItem' + - $ref: '#/components/schemas/OutputWebSearchServerToolItem' + - $ref: '#/components/schemas/OutputCodeInterpreterServerToolItem' + - $ref: '#/components/schemas/OutputFileSearchServerToolItem' + - $ref: '#/components/schemas/OutputImageGenerationServerToolItem' + - $ref: '#/components/schemas/OutputBrowserUseServerToolItem' + - $ref: '#/components/schemas/OutputBashServerToolItem' + - $ref: '#/components/schemas/OutputTextEditorServerToolItem' + - $ref: '#/components/schemas/OutputApplyPatchServerToolItem' + - $ref: '#/components/schemas/OutputWebFetchServerToolItem' + - $ref: '#/components/schemas/OutputToolSearchServerToolItem' + - $ref: '#/components/schemas/OutputMemoryServerToolItem' + - $ref: '#/components/schemas/OutputMcpServerToolItem' + - $ref: '#/components/schemas/OutputSearchModelsServerToolItem' + - $ref: '#/components/schemas/OutputAdvisorServerToolItem' + - $ref: '#/components/schemas/OutputSubagentServerToolItem' + - $ref: '#/components/schemas/LocalShellCallItem' + - $ref: '#/components/schemas/LocalShellCallOutputItem' + - $ref: '#/components/schemas/ShellCallItem' + - $ref: '#/components/schemas/ShellCallOutputItem' + - $ref: '#/components/schemas/McpListToolsItem' + - $ref: '#/components/schemas/McpApprovalRequestItem' + - $ref: '#/components/schemas/McpApprovalResponseItem' + - $ref: '#/components/schemas/McpCallItem' + - $ref: '#/components/schemas/CustomToolCallItem' + - $ref: '#/components/schemas/CustomToolCallOutputItem' + - $ref: '#/components/schemas/CompactionItem' + - $ref: '#/components/schemas/ItemReferenceItem' type: array - provider: - $ref: '#/components/schemas/ProviderPreferences' - route: - $ref: '#/components/schemas/DeprecatedRoute' - service_tier: + description: Input for a response request - can be a string or array of items + example: + - content: What is the weather today? + role: user + InputText: + description: Text input content item + example: + text: Hello, how can I help you? + type: input_text + properties: + text: + type: string + type: enum: - - auto - - standard_only + - input_text type: string - x-speakeasy-unknown-values: allow - session_id: + required: + - type + - text + type: object + InputVideo: + description: Video input content item + example: + type: input_video + video_url: https://example.com/video.mp4 + properties: + type: + enum: + - input_video + type: string + video_url: + description: A base64 data URL or remote URL that resolves to a video file + type: string + required: + - type + - video_url + type: object + InstructType: + description: Instruction format type + enum: + - none + - airoboros + - alpaca + - alpaca-modif + - chatml + - claude + - code-llama + - gemma + - llama2 + - llama3 + - mistral + - nemotron + - neural + - openchat + - phi3 + - rwkv + - vicuna + - zephyr + - deepseek-r1 + - deepseek-v3.1 + - qwq + - qwen3 + - null + example: chatml + nullable: true + type: string + x-speakeasy-unknown-values: allow + InternalServerResponse: + description: Internal Server Error - Unexpected server error + example: + error: + code: 500 + message: Internal Server Error + properties: + error: + $ref: '#/components/schemas/InternalServerResponseErrorData' + openrouter_metadata: + additionalProperties: + nullable: true + nullable: true + type: object + user_id: + nullable: true + type: string + required: + - error + type: object + InternalServerResponseErrorData: + description: Error data for InternalServerResponse + example: + code: 500 + message: Internal Server Error + properties: + code: + type: integer + message: + type: string + metadata: + additionalProperties: + nullable: true + nullable: true + type: object + required: + - code + - message + type: object + ItemReferenceItem: + description: A reference to a previous response item by ID + example: + id: msg-abc123 + type: item_reference + properties: + id: + type: string + type: + enum: + - item_reference + type: string + required: + - type + - id + type: object + KeyAssignment: + example: + assigned_by: user_abc123 + created_at: '2025-08-24T10:30:00Z' + guardrail_id: 550e8400-e29b-41d4-a716-446655440001 + id: 550e8400-e29b-41d4-a716-446655440000 + key_hash: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + key_label: prod-key + key_name: Production Key + properties: + assigned_by: + description: User ID of who made the assignment + example: user_abc123 + nullable: true + type: string + created_at: + description: ISO 8601 timestamp of when the assignment was created + example: '2025-08-24T10:30:00Z' + type: string + guardrail_id: + description: ID of the guardrail + example: 550e8400-e29b-41d4-a716-446655440001 + format: uuid + type: string + id: + description: Unique identifier for the assignment + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + key_hash: + description: Hash of the assigned API key + example: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + type: string + key_label: + description: Label of the API key + example: prod-key + type: string + key_name: + description: Name of the API key + example: Production Key + type: string + required: + - id + - key_hash + - guardrail_id + - key_name + - key_label + - assigned_by + - created_at + type: object + Legacy_ChatContentVideo: + deprecated: true + description: Video input content part (legacy format - deprecated) + example: + type: input_video + video_url: + url: https://example.com/video.mp4 + properties: + type: + enum: + - input_video + type: string + video_url: + $ref: '#/components/schemas/ChatContentVideoInput' + required: + - type + - video_url + type: object + Legacy_WebSearchServerTool: + description: Web search tool configuration + example: + engine: auto + filters: + allowed_domains: + - example.com + type: web_search + properties: + engine: + $ref: '#/components/schemas/WebSearchEngineEnum' + filters: + $ref: '#/components/schemas/WebSearchDomainFilter' + max_results: description: >- - A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. - maxLength: 256 + Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. + example: 5 + type: integer + search_context_size: + $ref: '#/components/schemas/SearchContextSizeEnum' + type: + enum: + - web_search type: string - speed: - allOf: - - $ref: '#/components/schemas/AnthropicSpeed' - - description: >- - Controls output generation speed. When set to `fast`, uses a higher-speed inference configuration at premium pricing. Defaults to `standard` when omitted. - example: fast - stop_sequences: - items: - type: string - type: array - stream: - type: boolean - system: - anyOf: - - type: string - - items: - $ref: '#/components/schemas/AnthropicTextBlockParam' - type: array - temperature: - format: double - type: number - thinking: - oneOf: - - properties: - budget_tokens: - type: integer - display: - $ref: '#/components/schemas/AnthropicThinkingDisplay' - type: - enum: - - enabled - type: string - required: - - type - - budget_tokens - type: object - - properties: - type: - enum: - - disabled - type: string - required: - - type - type: object - - properties: - display: - $ref: '#/components/schemas/AnthropicThinkingDisplay' - type: - enum: - - adaptive - type: string - required: - - type - type: object - tool_choice: - oneOf: - - properties: - disable_parallel_tool_use: - type: boolean - type: - enum: - - auto - type: string - required: - - type - type: object - - properties: - disable_parallel_tool_use: - type: boolean - type: - enum: - - any - type: string - required: - - type - type: object - - properties: - type: - enum: - - none - type: string - required: - - type - type: object - - properties: - disable_parallel_tool_use: - type: boolean - name: - type: string - type: - enum: - - tool - type: string - required: - - type - - name - type: object - tools: + user_location: + $ref: '#/components/schemas/WebSearchUserLocation' + required: + - type + type: object + ListBYOKKeysResponse: + example: + data: + - allowed_api_key_hashes: null + allowed_models: null + allowed_user_ids: null + created_at: '2025-08-24T10:30:00Z' + disabled: false + id: 11111111-2222-3333-4444-555555555555 + is_fallback: false + label: sk-...AbCd + name: Production OpenAI Key + provider: openai + sort_order: 0 + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + total_count: 1 + properties: + data: + description: List of BYOK credentials. items: - anyOf: - - properties: - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - description: - type: string - input_schema: - additionalProperties: - nullable: true - properties: - properties: - nullable: true - required: - items: - type: string - nullable: true - type: array - type: - default: object - type: string - type: object - name: - type: string - type: - enum: - - custom - type: string - required: - - name - - input_schema - type: object - - properties: - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - name: - enum: - - bash - type: string - type: - enum: - - bash_20250124 - type: string - required: - - type - - name - type: object - - properties: - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - name: - enum: - - str_replace_editor - type: string - type: - enum: - - text_editor_20250124 - type: string - required: - - type - - name - type: object - - properties: - allowed_domains: - items: - type: string - nullable: true - type: array - blocked_domains: - items: - type: string - nullable: true - type: array - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - max_uses: - nullable: true - type: integer - name: - enum: - - web_search - type: string - type: - enum: - - web_search_20250305 - type: string - user_location: - $ref: '#/components/schemas/AnthropicWebSearchToolUserLocation' - required: - - type - - name - type: object - - properties: - allowed_callers: - items: - enum: - - direct - - code_execution_20250825 - - code_execution_20260120 - type: string - x-speakeasy-unknown-values: allow - type: array - allowed_domains: - items: - type: string - nullable: true - type: array - blocked_domains: - items: - type: string - nullable: true - type: array - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - max_uses: - nullable: true - type: integer - name: - enum: - - web_search - type: string - type: - enum: - - web_search_20260209 - type: string - user_location: - $ref: '#/components/schemas/AnthropicWebSearchToolUserLocation' - required: - - type - - name - type: object - - $ref: '#/components/schemas/DatetimeServerTool' - - $ref: '#/components/schemas/ImageGenerationServerTool_OpenRouter' - - $ref: '#/components/schemas/ChatSearchModelsServerTool' - - $ref: '#/components/schemas/OpenRouterWebSearchServerTool' + $ref: '#/components/schemas/BYOKKey' type: array - top_k: + total_count: + description: Total number of BYOK credentials matching the filters. + example: 1 type: integer - top_p: - format: double - type: number - trace: - $ref: '#/components/schemas/TraceConfig' - user: - description: >- - A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 256 characters. - maxLength: 256 - type: string required: - - model - - messages + - data + - total_count type: object - MessagesResult: - allOf: - - $ref: '#/components/schemas/BaseMessagesResult' - - properties: - context_management: - nullable: true + ListEndpointsResponse: + description: List of available endpoints for a model + example: + architecture: + input_modalities: + - text + instruct_type: chatml + modality: text->text + output_modalities: + - text + tokenizer: GPT + created: 1692901234 + description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. + endpoints: + - context_length: 8192 + latency_last_30m: + p50: 0.25 + p75: 0.35 + p90: 0.48 + p99: 0.85 + max_completion_tokens: 4096 + max_prompt_tokens: 8192 + model_name: GPT-4 + name: 'OpenAI: GPT-4' + pricing: + completion: '0.00006' + image: '0' + prompt: '0.00003' + request: '0' + provider_name: OpenAI + quantization: fp16 + status: default + supported_parameters: + - temperature + - top_p + - max_tokens + - frequency_penalty + - presence_penalty + supports_implicit_caching: true + tag: openai + throughput_last_30m: + p50: 45.2 + p75: 38.5 + p90: 28.3 + p99: 15.1 + uptime_last_1d: 99.8 + uptime_last_30m: 99.5 + uptime_last_5m: 100 + id: openai/gpt-4 + name: GPT-4 + properties: + architecture: + allOf: + - $ref: '#/components/schemas/ModelArchitecture' + - example: + instruct_type: chatml + modality: text + tokenizer: GPT properties: - applied_edits: + input_modalities: + description: Supported input modalities items: - additionalProperties: - nullable: true - properties: - type: - type: string - required: - - type - type: object + $ref: '#/components/schemas/InputModality' + type: array + instruct_type: + $ref: '#/components/schemas/InstructType' + modality: + description: Primary modality of the model + example: text + nullable: true + type: string + output_modalities: + description: Supported output modalities + items: + $ref: '#/components/schemas/OutputModality' type: array + tokenizer: + allOf: + - $ref: '#/components/schemas/ModelGroup' + - nullable: true required: - - applied_edits - type: object - provider: - $ref: '#/components/schemas/ProviderName' - usage: - allOf: - - $ref: '#/components/schemas/AnthropicUsage' - - properties: - cost: - format: double - nullable: true - type: number - cost_details: - nullable: true - properties: - upstream_inference_completions_cost: - format: double - type: number - upstream_inference_cost: - format: double - nullable: true - type: number - upstream_inference_prompt_cost: - format: double - type: number - required: - - upstream_inference_prompt_cost - - upstream_inference_completions_cost - type: object - is_byok: - type: boolean - iterations: - items: - $ref: '#/components/schemas/AnthropicUsageIteration' - type: array - service_tier: - nullable: true - type: string - speed: - $ref: '#/components/schemas/AnthropicSpeed' - type: object - example: - cache_creation: null - cache_creation_input_tokens: null - cache_read_input_tokens: null - inference_geo: null - input_tokens: 100 - output_tokens: 50 - server_tool_use: null - service_tier: standard - type: object - description: Non-streaming response from the Anthropic Messages API with OpenRouter extensions + - tokenizer + - instruct_type + - modality + - input_modalities + - output_modalities + created: + description: Unix timestamp of when the model was created + example: 1692901234 + type: integer + description: + description: Description of the model + example: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. + type: string + endpoints: + description: List of available endpoints for this model + items: + $ref: '#/components/schemas/PublicEndpoint' + type: array + id: + description: Unique identifier for the model + example: openai/gpt-4 + type: string + name: + description: Display name of the model + example: GPT-4 + type: string + required: + - id + - name + - created + - description + - architecture + - endpoints + type: object + ListGuardrailsResponse: example: - container: null - content: - - citations: null - text: Hello! I'm doing well, thank you for asking. - type: text - id: msg_01XFDUDYJgAACzvnptvVoYEL - model: claude-sonnet-4-5-20250929 - role: assistant - stop_details: null - stop_reason: end_turn - stop_sequence: null - type: message - usage: - cache_creation: null - cache_creation_input_tokens: null - cache_read_input_tokens: null - inference_geo: null - input_tokens: 12 - output_tokens: 15 - server_tool_use: null - service_tier: standard - MessagesStartEvent: - description: Event sent at the start of a streaming message + data: + - allowed_models: null + allowed_providers: + - openai + - anthropic + - google + content_filter_builtins: + - action: redact + label: '[EMAIL]' + slug: email + content_filters: null + created_at: '2025-08-24T10:30:00Z' + description: Guardrail for production environment + enforce_zdr: null + enforce_zdr_anthropic: true + enforce_zdr_google: false + enforce_zdr_openai: true + enforce_zdr_other: false + id: 550e8400-e29b-41d4-a716-446655440000 + ignored_models: null + ignored_providers: null + limit_usd: 100 + name: Production Guardrail + reset_interval: monthly + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 + total_count: 1 + properties: + data: + description: List of guardrails + items: + $ref: '#/components/schemas/Guardrail' + type: array + total_count: + description: Total number of guardrails + example: 25 + type: integer + required: + - data + - total_count + type: object + ListKeyAssignmentsResponse: example: - message: - content: [] - id: msg_01XFDUDYJgAACzvnptvVoYEL - model: claude-sonnet-4-5-20250929 - role: assistant - stop_details: null - stop_reason: null - stop_sequence: null - type: message - usage: - input_tokens: 12 - output_tokens: 0 - type: message_start + data: + - assigned_by: user_abc123 + created_at: '2025-08-24T10:30:00Z' + guardrail_id: 550e8400-e29b-41d4-a716-446655440001 + id: 550e8400-e29b-41d4-a716-446655440000 + key_hash: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + key_label: prod-key + key_name: Production Key + total_count: 1 properties: - message: - properties: - container: - $ref: '#/components/schemas/AnthropicContainer' - content: - items: - $ref: '#/components/schemas/ORAnthropicContentBlock' - type: array - id: - type: string - model: - type: string - provider: - enum: - - AnyScale - - Atoma - - Cent-ML - - CrofAI - - Enfer - - GoPomelo - - HuggingFace - - Hyperbolic 2 - - InoCloud - - Kluster - - Lambda - - Lepton - - Lynn 2 - - Lynn - - Mancer - - Meta - - Modal - - Nineteen - - OctoAI - - Recursal - - Reflection - - Replicate - - SambaNova 2 - - SF Compute - - Targon - - Together 2 - - Ubicloud - - 01.AI - - AkashML - - AI21 - - AionLabs - - Alibaba - - Ambient - - Baidu - - Amazon Bedrock - - Amazon Nova - - Anthropic - - Arcee AI - - AtlasCloud - - Avian - - Azure - - BaseTen - - BytePlus - - Black Forest Labs - - Cerebras - - Chutes - - Cirrascale - - Clarifai - - Cloudflare - - Cohere - - Crusoe - - DeepInfra - - DeepSeek - - DekaLLM - - Featherless - - Fireworks - - Friendli - - GMICloud - - Google - - Google AI Studio - - Groq - - Hyperbolic - - Inception - - Inceptron - - InferenceNet - - Ionstream - - Infermatic - - Io Net - - Inflection - - Liquid - - Mara - - Mancer 2 - - Minimax - - ModelRun - - Mistral - - Modular - - Moonshot AI - - Morph - - NCompass - - Nebius - - NextBit - - Novita - - Nvidia - - OpenAI - - OpenInference - - Parasail - - Perplexity - - Phala - - Recraft - - Reka - - Relace - - SambaNova - - Seed - - SiliconFlow - - Sourceful - - StepFun - - Stealth - - StreamLake - - Switchpoint - - Together - - Upstage - - Venice - - WandB - - Xiaomi - - xAI - - Z.AI - - FakeProvider - type: string - x-speakeasy-unknown-values: allow - role: - enum: - - assistant - type: string - stop_details: - $ref: '#/components/schemas/AnthropicRefusalStopDetails' - stop_reason: - nullable: true - stop_sequence: - nullable: true - type: - enum: - - message - type: string - usage: - allOf: - - $ref: '#/components/schemas/AnthropicUsage' - - properties: - iterations: - items: - $ref: '#/components/schemas/AnthropicUsageIteration' - type: array - speed: - $ref: '#/components/schemas/AnthropicSpeed' - type: object - example: - cache_creation: null - cache_creation_input_tokens: null - cache_read_input_tokens: null - inference_geo: null - input_tokens: 100 - output_tokens: 50 - server_tool_use: null - service_tier: standard - required: - - id - - type - - role - - container - - content - - model - - stop_reason - - stop_details - - stop_sequence - - usage - type: object - type: - enum: - - message_start - type: string + data: + description: List of key assignments + items: + $ref: '#/components/schemas/KeyAssignment' + type: array + total_count: + description: Total number of key assignments for this guardrail + example: 25 + type: integer required: - - type - - message + - data + - total_count type: object - MessagesStopEvent: - description: Event sent when the message is complete + ListMemberAssignmentsResponse: example: - type: message_stop + data: + - assigned_by: user_abc123 + created_at: '2025-08-24T10:30:00Z' + guardrail_id: 550e8400-e29b-41d4-a716-446655440001 + id: 550e8400-e29b-41d4-a716-446655440000 + organization_id: org_xyz789 + user_id: user_abc123 + total_count: 1 properties: - type: - enum: - - message_stop - type: string + data: + description: List of member assignments + items: + $ref: '#/components/schemas/MemberAssignment' + type: array + total_count: + description: Total number of member assignments + example: 10 + type: integer required: - - type + - data + - total_count type: object - MessagesStreamEvents: - description: Union of all possible streaming events - discriminator: - mapping: - content_block_delta: '#/components/schemas/MessagesContentBlockDeltaEvent' - content_block_start: '#/components/schemas/MessagesContentBlockStartEvent' - content_block_stop: '#/components/schemas/MessagesContentBlockStopEvent' - error: '#/components/schemas/MessagesErrorEvent' - message_delta: '#/components/schemas/MessagesDeltaEvent' - message_start: '#/components/schemas/MessagesStartEvent' - message_stop: '#/components/schemas/MessagesStopEvent' - ping: '#/components/schemas/MessagesPingEvent' - propertyName: type + ListObservabilityDestinationsResponse: example: - delta: - text: Hello - type: text_delta - index: 0 - type: content_block_delta - oneOf: - - $ref: '#/components/schemas/MessagesStartEvent' - - $ref: '#/components/schemas/MessagesDeltaEvent' - - $ref: '#/components/schemas/MessagesStopEvent' - - $ref: '#/components/schemas/MessagesContentBlockStartEvent' - - $ref: '#/components/schemas/MessagesContentBlockDeltaEvent' - - $ref: '#/components/schemas/MessagesContentBlockStopEvent' - - $ref: '#/components/schemas/MessagesPingEvent' - - $ref: '#/components/schemas/MessagesErrorEvent' - Model: - description: Information about an AI model available on OpenRouter + data: + - api_key_hashes: null + config: + baseUrl: https://us.cloud.langfuse.com + publicKey: pk-l...EfGh + secretKey: sk-l...AbCd + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production Langfuse + privacy_mode: false + sampling_rate: 1 + type: langfuse + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + total_count: 1 + properties: + data: + description: List of observability destinations. + items: + $ref: '#/components/schemas/ObservabilityDestination' + type: array + total_count: + description: Total number of destinations matching the filters. + example: 1 + type: integer + required: + - data + - total_count + type: object + ListPresetsResponse: + description: A paginated list of presets. example: - architecture: - input_modalities: - - text - instruct_type: chatml - modality: text->text - output_modalities: - - text - tokenizer: GPT - canonical_slug: openai/gpt-4 - context_length: 8192 - created: 1692901234 - default_parameters: null - description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. - expiration_date: null - id: openai/gpt-4 - knowledge_cutoff: null - links: - details: /api/v1/models/openai/gpt-5.4/endpoints - name: GPT-4 - per_request_limits: null - pricing: - completion: '0.00006' - image: '0' - prompt: '0.00003' - request: '0' - supported_parameters: - - temperature - - top_p - - max_tokens - top_provider: - context_length: 8192 - is_moderated: true - max_completion_tokens: 4096 + data: + - created_at: '2026-04-20T10:00:00Z' + creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 + description: null + designated_version_id: 550e8400-e29b-41d4-a716-446655440000 + id: 650e8400-e29b-41d4-a716-446655440001 + name: my-preset + slug: my-preset + status: active + status_updated_at: null + updated_at: '2026-04-20T10:00:00Z' + workspace_id: 750e8400-e29b-41d4-a716-446655440002 + total_count: 1 properties: - architecture: - $ref: '#/components/schemas/ModelArchitecture' - canonical_slug: - description: Canonical slug for the model - example: openai/gpt-4 - type: string - context_length: - description: Maximum context length in tokens - example: 8192 - nullable: true - type: integer - created: - description: Unix timestamp of when the model was created - example: 1692901234 - type: integer - default_parameters: - $ref: '#/components/schemas/DefaultParameters' - description: - description: Description of the model - example: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. - type: string - expiration_date: - description: The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration. - example: '2025-06-01' - nullable: true - type: string - hugging_face_id: - description: Hugging Face model identifier, if applicable - example: microsoft/DialoGPT-medium - nullable: true - type: string - id: - description: Unique identifier for the model - example: openai/gpt-4 - type: string - knowledge_cutoff: - description: The date up to which the model was trained on data. ISO 8601 date string (YYYY-MM-DD) or null if unknown. - example: '2024-10-01' - nullable: true - type: string - links: - $ref: '#/components/schemas/ModelLinks' - name: - description: Display name of the model - example: GPT-4 - type: string - per_request_limits: - $ref: '#/components/schemas/PerRequestLimits' - pricing: - $ref: '#/components/schemas/PublicPricing' - supported_parameters: - description: List of supported parameters for this model + data: items: - $ref: '#/components/schemas/Parameter' + $ref: '#/components/schemas/Preset' type: array - top_provider: - $ref: '#/components/schemas/TopProviderInfo' + total_count: + type: integer required: - - id - - canonical_slug - - name - - created - - pricing - - context_length - - architecture - - top_provider - - per_request_limits - - supported_parameters - - default_parameters - - links + - data + - total_count type: object - ModelArchitecture: - description: Model architecture information + ListPresetVersionsResponse: + description: A paginated list of preset versions. example: - input_modalities: - - text - instruct_type: chatml - modality: text->text - output_modalities: - - text - tokenizer: GPT + data: + - config: + model: openai/gpt-4o + temperature: 0.7 + created_at: '2026-04-20T10:00:00Z' + creator_id: user_2dHFtVWx2n56w6HkM0000000000 + id: 550e8400-e29b-41d4-a716-446655440000 + preset_id: 650e8400-e29b-41d4-a716-446655440001 + system_prompt: You are a helpful assistant. + updated_at: '2026-04-20T10:00:00Z' + version: 1 + total_count: 1 properties: - input_modalities: - description: Supported input modalities - items: - $ref: '#/components/schemas/InputModality' - type: array - instruct_type: - description: Instruction format type - enum: - - none - - airoboros - - alpaca - - alpaca-modif - - chatml - - claude - - code-llama - - gemma - - llama2 - - llama3 - - mistral - - nemotron - - neural - - openchat - - phi3 - - rwkv - - vicuna - - zephyr - - deepseek-r1 - - deepseek-v3.1 - - qwq - - qwen3 - - null - example: chatml - nullable: true - type: string - x-speakeasy-unknown-values: allow - modality: - description: Primary modality of the model - example: text->text - nullable: true - type: string - output_modalities: - description: Supported output modalities + data: items: - $ref: '#/components/schemas/OutputModality' + $ref: '#/components/schemas/PresetDesignatedVersion' type: array - tokenizer: - $ref: '#/components/schemas/ModelGroup' - required: - - modality - - input_modalities - - output_modalities - type: object - ModelGroup: - description: Tokenizer type used by the model - enum: - - Router - - Media - - Other - - GPT - - Claude - - Gemini - - Gemma - - Grok - - Cohere - - Nova - - Qwen - - Yi - - DeepSeek - - Mistral - - Llama2 - - Llama3 - - Llama4 - - PaLM - - RWKV - - Qwen3 - example: GPT - type: string - x-speakeasy-unknown-values: allow - ModelLinks: - description: Related API endpoints and resources for this model. - example: - details: /api/v1/models/openai/gpt-5.4/endpoints - properties: - details: - description: URL for the model details/endpoints API - example: /api/v1/models/openai/gpt-5.4/endpoints - type: string + total_count: + type: integer required: - - details + - data + - total_count type: object - ModelName: - description: Model to use for completion - example: openai/gpt-4 - type: string - ModelsCountResponse: - description: Model count data + ListWorkspacesResponse: example: data: - count: 150 + - created_at: '2025-08-24T10:30:00Z' + created_by: user_abc123 + default_image_model: openai/dall-e-3 + default_provider_sort: price + default_text_model: openai/gpt-4o + description: Production environment workspace + id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 + is_data_discount_logging_enabled: true + is_observability_broadcast_enabled: false + is_observability_io_logging_enabled: false + name: Production + slug: production + updated_at: '2025-08-24T15:45:00Z' + total_count: 1 properties: data: - description: Model count data - example: - count: 150 - properties: - count: - description: Total number of available models - example: 150 - type: integer - required: - - count - type: object + description: List of workspaces + items: + $ref: '#/components/schemas/Workspace' + type: array + total_count: + description: Total number of workspaces + example: 5 + type: integer required: - data + - total_count type: object - ModelsListResponse: - description: List of available models + LocalShellCallItem: + description: A local shell command execution call example: - data: - - architecture: - input_modalities: - - text - instruct_type: chatml - modality: text->text - output_modalities: - - text - tokenizer: GPT - canonical_slug: openai/gpt-4 - context_length: 8192 - created: 1692901234 - default_parameters: null - description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. - expiration_date: null - id: openai/gpt-4 - knowledge_cutoff: null - links: - details: /api/v1/models/openai/gpt-5.4/endpoints - name: GPT-4 - per_request_limits: null - pricing: - completion: '0.00006' - image: '0' - prompt: '0.00003' - request: '0' - supported_parameters: - - temperature - - top_p - - max_tokens - - frequency_penalty - - presence_penalty - top_provider: - context_length: 8192 - is_moderated: true - max_completion_tokens: 4096 + action: + command: + - ls + - '-la' + env: + PATH: /usr/bin + timeout_ms: 5000 + type: exec + call_id: call-abc123 + id: shell-abc123 + status: completed + type: local_shell_call properties: - data: - $ref: '#/components/schemas/ModelsListResponseData' + action: + properties: + command: + items: + type: string + type: array + env: + additionalProperties: + type: string + type: object + timeout_ms: + nullable: true + type: integer + type: + enum: + - exec + type: string + user: + nullable: true + type: string + working_directory: + nullable: true + type: string + required: + - type + - command + - env + type: object + call_id: + type: string + id: + type: string + status: + $ref: '#/components/schemas/ToolCallStatus' + type: + enum: + - local_shell_call + type: string required: - - data + - type + - id + - call_id + - action + - status type: object - ModelsListResponseData: - description: List of available models - example: - - architecture: - input_modalities: - - text - instruct_type: chatml - modality: text->text - output_modalities: - - text - tokenizer: GPT - canonical_slug: openai/gpt-4 - context_length: 8192 - created: 1692901234 - default_parameters: null - description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. - expiration_date: null - id: openai/gpt-4 - knowledge_cutoff: null - links: - details: /api/v1/models/openai/gpt-5.4/endpoints - name: GPT-4 - per_request_limits: null - pricing: - completion: '0.00006' - image: '0' - prompt: '0.00003' - request: '0' - supported_parameters: - - temperature - - top_p - - max_tokens - top_provider: - context_length: 8192 - is_moderated: true - max_completion_tokens: 4096 - items: - $ref: '#/components/schemas/Model' - type: array - ModerationPlugin: + LocalShellCallOutputItem: + description: Output from a local shell command execution example: - id: moderation + id: output-abc123 + output: |- + total 24 + drwxr-xr-x 5 user staff 160 Jan 1 12:00 . + status: completed + type: local_shell_call_output properties: id: + type: string + output: + type: string + status: + allOf: + - $ref: '#/components/schemas/ToolCallStatus' + - nullable: true + type: enum: - - moderation + - local_shell_call_output type: string required: + - type - id + - output type: object - NotFoundResponse: - description: Not Found - Resource does not exist + McpApprovalRequestItem: + description: Request for approval to execute an MCP tool example: - error: - code: 404 - message: Resource not found + arguments: '{"id":"123"}' + id: approval-abc123 + name: delete_record + server_label: database-server + type: mcp_approval_request properties: - error: - $ref: '#/components/schemas/NotFoundResponseErrorData' - user_id: - nullable: true + arguments: + type: string + id: + type: string + name: + type: string + server_label: + type: string + type: + enum: + - mcp_approval_request type: string required: - - error + - type + - id + - name + - arguments + - server_label type: object - NotFoundResponseErrorData: - description: Error data for NotFoundResponse + McpApprovalResponseItem: + description: User response to an MCP tool approval request example: - code: 404 - message: Resource not found + approval_request_id: approval-abc123 + approve: true + reason: Approved for execution + type: mcp_approval_response properties: - code: - type: integer - message: + approval_request_id: type: string - metadata: - additionalProperties: - nullable: true + approve: + type: boolean + id: nullable: true - type: object + type: string + reason: + nullable: true + type: string + type: + enum: + - mcp_approval_response + type: string required: - - code - - message + - type + - approval_request_id + - approve type: object - OpenAIResponseFunctionToolCall: + McpCallItem: + description: An MCP tool call with its output or error example: - arguments: '{"location":"San Francisco"}' - call_id: call-abc123 - id: fc-abc123 - name: get_weather - status: completed - type: function_call + arguments: '{"query":"SELECT * FROM users"}' + id: mcp-call-abc123 + name: query_database + output: '[{"id":1,"name":"Alice"}]' + server_label: database-server + type: mcp_call properties: arguments: type: string - call_id: + error: + nullable: true type: string id: type: string name: type: string - status: - $ref: '#/components/schemas/ToolCallStatus' + output: + nullable: true + type: string + server_label: + type: string type: enum: - - function_call + - mcp_call type: string required: - type - - call_id + - id - name - arguments + - server_label type: object - OpenAIResponseFunctionToolCallOutput: + McpListToolsItem: + description: List of available MCP tools from a server example: - call_id: call-abc123 - output: '{"temperature":72,"conditions":"sunny"}' - type: function_call_output + id: mcp-list-abc123 + server_label: database-server + tools: + - description: Execute a database query + input_schema: + properties: + query: + type: string + type: object + name: query_database + type: mcp_list_tools properties: - call_id: + error: + nullable: true type: string id: - nullable: true type: string - output: - anyOf: - - type: string - - items: - discriminator: - mapping: - input_file: '#/components/schemas/InputFile' - input_image: '#/components/schemas/InputImage' - input_text: '#/components/schemas/InputText' - propertyName: type - oneOf: - - $ref: '#/components/schemas/InputText' - - $ref: '#/components/schemas/InputImage' - - $ref: '#/components/schemas/InputFile' - type: array - status: - allOf: - - $ref: '#/components/schemas/ToolCallStatus' - - nullable: true + server_label: + type: string + tools: + items: + properties: + annotations: + nullable: true + description: + nullable: true + type: string + input_schema: + additionalProperties: + nullable: true + type: object + name: + type: string + required: + - name + - input_schema + type: object + type: array type: enum: - - function_call_output + - mcp_list_tools type: string required: - type - - call_id - - output + - id + - server_label + - tools type: object - OpenAIResponseInputMessageItem: + McpServerTool: + description: MCP (Model Context Protocol) tool configuration example: - content: - - text: Hello, how are you? - type: input_text - id: msg-abc123 - role: user - type: message + server_label: my-server + server_url: https://example.com/mcp + type: mcp properties: - content: - items: - discriminator: - mapping: - input_audio: '#/components/schemas/InputAudio' - input_file: '#/components/schemas/InputFile' - input_image: '#/components/schemas/InputImage' - input_text: '#/components/schemas/InputText' - propertyName: type - oneOf: - - $ref: '#/components/schemas/InputText' - - $ref: '#/components/schemas/InputImage' - - $ref: '#/components/schemas/InputFile' - - $ref: '#/components/schemas/InputAudio' - type: array - id: + allowed_tools: + anyOf: + - items: + type: string + type: array + - properties: + read_only: + type: boolean + tool_names: + items: + type: string + type: array + type: object + - nullable: true + authorization: type: string - role: + connector_id: + enum: + - connector_dropbox + - connector_gmail + - connector_googlecalendar + - connector_googledrive + - connector_microsoftteams + - connector_outlookcalendar + - connector_outlookemail + - connector_sharepoint + type: string + x-speakeasy-unknown-values: allow + headers: + additionalProperties: + type: string + nullable: true + type: object + require_approval: anyOf: + - properties: + always: + properties: + tool_names: + items: + type: string + type: array + type: object + never: + properties: + tool_names: + items: + type: string + type: array + type: object + type: object - enum: - - user - type: string - - enum: - - system + - always type: string - enum: - - developer + - never type: string - type: - enum: - - message - type: string - required: - - id - - role - - content - type: object - OpenAIResponsesAnnotation: - anyOf: - - $ref: '#/components/schemas/FileCitation' - - $ref: '#/components/schemas/URLCitation' - - $ref: '#/components/schemas/FilePath' - example: - file_id: file-abc123 - filename: research_paper.pdf - index: 0 - type: file_citation - OpenAIResponsesImageGenCallCompleted: - example: - item_id: ig_abc123 - output_index: 0 - sequence_number: 4 - type: response.image_generation_call.completed - properties: - item_id: + - nullable: true + server_description: type: string - output_index: - type: integer - sequence_number: - type: integer - type: - enum: - - response.image_generation_call.completed + server_label: type: string - required: - - type - - item_id - - output_index - - sequence_number - type: object - OpenAIResponsesImageGenCallGenerating: - example: - item_id: ig_abc123 - output_index: 0 - sequence_number: 2 - type: response.image_generation_call.generating - properties: - item_id: + server_url: type: string - output_index: - type: integer - sequence_number: - type: integer type: enum: - - response.image_generation_call.generating + - mcp type: string required: - type - - item_id - - output_index - - sequence_number + - server_label type: object - OpenAIResponsesImageGenCallInProgress: + MemberAssignment: example: - item_id: ig_abc123 - output_index: 0 - sequence_number: 1 - type: response.image_generation_call.in_progress + assigned_by: user_abc123 + created_at: '2025-08-24T10:30:00Z' + guardrail_id: 550e8400-e29b-41d4-a716-446655440001 + id: 550e8400-e29b-41d4-a716-446655440000 + organization_id: org_xyz789 + user_id: user_abc123 properties: - item_id: + assigned_by: + description: User ID of who made the assignment + example: user_abc123 + nullable: true type: string - output_index: - type: integer - sequence_number: - type: integer - type: - enum: - - response.image_generation_call.in_progress + created_at: + description: ISO 8601 timestamp of when the assignment was created + example: '2025-08-24T10:30:00Z' type: string - required: - - type - - item_id - - output_index - - sequence_number - type: object - OpenAIResponsesImageGenCallPartialImage: - example: - item_id: ig_abc123 - output_index: 0 - partial_image_b64: iVBORw0KGgo... - partial_image_index: 0 - sequence_number: 3 - type: response.image_generation_call.partial_image - properties: - item_id: + guardrail_id: + description: ID of the guardrail + example: 550e8400-e29b-41d4-a716-446655440001 + format: uuid type: string - output_index: - type: integer - partial_image_b64: + id: + description: Unique identifier for the assignment + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid type: string - partial_image_index: - type: integer - sequence_number: - type: integer - type: - enum: - - response.image_generation_call.partial_image + organization_id: + description: Organization ID + example: org_xyz789 + type: string + user_id: + description: Clerk user ID of the assigned member + example: user_abc123 type: string required: - - type - - item_id - - output_index - - sequence_number - - partial_image_b64 - - partial_image_index + - id + - user_id + - organization_id + - guardrail_id + - assigned_by + - created_at type: object - OpenAIResponsesRefusalContent: + MessagesAdvisorToolResultBlock: + description: >- + Advisor tool result from a prior assistant turn, replayed back to the model on the next turn. Mirrors the block Anthropic returns in assistant content when the `advisor_20260301` tool runs. example: - refusal: I'm sorry, I cannot assist with that request - type: refusal + content: + text: Advisor response text + type: advisor_result + tool_use_id: srvtoolu_01abc + type: advisor_tool_result properties: - refusal: + content: + additionalProperties: + nullable: true + type: object + tool_use_id: type: string type: enum: - - refusal + - advisor_tool_result type: string required: - type - - refusal + - tool_use_id + - content type: object - OpenAIResponsesResponseStatus: - enum: - - completed - - incomplete - - in_progress - - failed - - cancelled - - queued - example: completed - type: string - x-speakeasy-unknown-values: allow - OpenAIResponsesSearchCompleted: + MessagesContentBlockDeltaEvent: + description: Event sent when content is added to a content block example: - item_id: ws_abc123 - output_index: 0 - sequence_number: 5 - type: response.web_search_call.completed - properties: - item_id: - type: string - output_index: - type: integer - sequence_number: + delta: + text: Hello + type: text_delta + index: 0 + type: content_block_delta + properties: + delta: + oneOf: + - properties: + text: + type: string + type: + enum: + - text_delta + type: string + required: + - type + - text + type: object + - properties: + partial_json: + type: string + type: + enum: + - input_json_delta + type: string + required: + - type + - partial_json + type: object + - properties: + thinking: + type: string + type: + enum: + - thinking_delta + type: string + required: + - type + - thinking + type: object + - properties: + signature: + type: string + type: + enum: + - signature_delta + type: string + required: + - type + - signature + type: object + - properties: + citation: + discriminator: + mapping: + char_location: '#/components/schemas/AnthropicCitationCharLocation' + content_block_location: '#/components/schemas/AnthropicCitationContentBlockLocation' + page_location: '#/components/schemas/AnthropicCitationPageLocation' + search_result_location: '#/components/schemas/AnthropicCitationSearchResultLocation' + web_search_result_location: '#/components/schemas/AnthropicCitationWebSearchResultLocation' + propertyName: type + oneOf: + - $ref: '#/components/schemas/AnthropicCitationCharLocation' + - $ref: '#/components/schemas/AnthropicCitationPageLocation' + - $ref: '#/components/schemas/AnthropicCitationContentBlockLocation' + - $ref: '#/components/schemas/AnthropicCitationWebSearchResultLocation' + - $ref: '#/components/schemas/AnthropicCitationSearchResultLocation' + type: + enum: + - citations_delta + type: string + required: + - type + - citation + type: object + - properties: + content: + nullable: true + type: string + type: + enum: + - compaction_delta + type: string + required: + - type + - content + type: object + index: type: integer type: enum: - - response.web_search_call.completed + - content_block_delta type: string required: - type - - item_id - - output_index - - sequence_number - type: object - OpenAIResponsesToolChoice: - anyOf: - - enum: - - auto - type: string - - enum: - - none - type: string - - enum: - - required - type: string - - properties: - name: - type: string - type: - enum: - - function - type: string - required: - - type - - name - type: object - - properties: - type: - anyOf: - - enum: - - web_search_preview_2025_03_11 - type: string - - enum: - - web_search_preview - type: string - required: - - type - type: object - - $ref: '#/components/schemas/ToolChoiceAllowed' - example: auto - OpenAIResponsesTruncation: - enum: - - auto - - disabled - - null - example: auto - nullable: true - type: string - x-speakeasy-unknown-values: allow - OpenAIResponsesUsage: - example: - input_tokens: 100 - input_tokens_details: - cached_tokens: 0 - output_tokens: 50 - output_tokens_details: - reasoning_tokens: 0 - total_tokens: 150 - properties: - input_tokens: - type: integer - input_tokens_details: - properties: - cached_tokens: - type: integer - required: - - cached_tokens - type: object - output_tokens: - type: integer - output_tokens_details: - properties: - reasoning_tokens: - type: integer - required: - - reasoning_tokens - type: object - total_tokens: - type: integer - required: - - input_tokens - - input_tokens_details - - output_tokens - - output_tokens_details - - total_tokens + - index + - delta type: object - OpenAIResponsesWebSearchCallInProgress: + MessagesContentBlockStartEvent: + description: Event sent when a new content block starts example: - item_id: ws_abc123 - output_index: 0 - sequence_number: 1 - type: response.web_search_call.in_progress + content_block: + text: '' + type: text + index: 0 + type: content_block_start properties: - item_id: - type: string - output_index: - type: integer - sequence_number: + content_block: + anyOf: + - $ref: '#/components/schemas/AnthropicTextBlock' + - $ref: '#/components/schemas/AnthropicToolUseBlock' + - $ref: '#/components/schemas/AnthropicThinkingBlock' + - $ref: '#/components/schemas/AnthropicRedactedThinkingBlock' + - $ref: '#/components/schemas/ORAnthropicServerToolUseBlock' + - $ref: '#/components/schemas/AnthropicWebSearchToolResult' + - $ref: '#/components/schemas/AnthropicWebFetchToolResult' + - $ref: '#/components/schemas/AnthropicCodeExecutionToolResult' + - $ref: '#/components/schemas/AnthropicBashCodeExecutionToolResult' + - $ref: '#/components/schemas/AnthropicTextEditorCodeExecutionToolResult' + - $ref: '#/components/schemas/AnthropicToolSearchToolResult' + - $ref: '#/components/schemas/AnthropicContainerUpload' + - $ref: '#/components/schemas/AnthropicCompactionBlock' + - $ref: '#/components/schemas/AnthropicAdvisorToolResult' + - properties: + content: + nullable: true + type: string + type: + enum: + - compaction + type: string + required: + - type + - content + type: object + index: type: integer type: enum: - - response.web_search_call.in_progress + - content_block_start type: string required: - type - - item_id - - output_index - - sequence_number + - index + - content_block type: object - OpenAIResponsesWebSearchCallSearching: + MessagesContentBlockStopEvent: + description: Event sent when a content block is complete example: - item_id: ws_abc123 - output_index: 0 - sequence_number: 2 - type: response.web_search_call.searching + index: 0 + type: content_block_stop properties: - item_id: - type: string - output_index: - type: integer - sequence_number: + index: type: integer type: enum: - - response.web_search_call.searching + - content_block_stop type: string required: - type - - item_id - - output_index - - sequence_number + - index type: object - OpenResponsesCreatedEvent: - allOf: - - $ref: '#/components/schemas/CreatedEvent' - - properties: - response: - $ref: '#/components/schemas/OpenResponsesResult' - type: object - description: Event emitted when a response is created - example: - response: - created_at: 1704067200 - error: null - id: resp-abc123 - incomplete_details: null - instructions: null - max_output_tokens: null - metadata: null - model: gpt-4 - object: response - output: [] - parallel_tool_calls: true - status: in_progress - temperature: null - tool_choice: auto - tools: [] - top_p: null - sequence_number: 0 - type: response.created - OpenResponsesInProgressEvent: - allOf: - - $ref: '#/components/schemas/InProgressEvent' - - properties: - response: - $ref: '#/components/schemas/OpenResponsesResult' - type: object - description: Event emitted when a response is in progress - example: - response: - created_at: 1704067200 - error: null - id: resp-abc123 - incomplete_details: null - instructions: null - max_output_tokens: null - metadata: null - model: gpt-4 - object: response - output: [] - parallel_tool_calls: true - status: in_progress - temperature: null - tool_choice: auto - tools: [] - top_p: null - sequence_number: 1 - type: response.in_progress - OpenResponsesLogProbs: - description: Log probability information for a token + MessagesDeltaEvent: + description: Event sent when the message metadata changes (e.g., stop_reason) example: - logprob: -0.1 - token: world - top_logprobs: - - logprob: -0.5 - token: hello + delta: + stop_details: null + stop_reason: end_turn + stop_sequence: null + type: message_delta + usage: + output_tokens: 15 properties: - bytes: - items: - type: integer - type: array - logprob: - format: double - type: number - token: + delta: + properties: + container: + $ref: '#/components/schemas/AnthropicContainer' + stop_details: + $ref: '#/components/schemas/AnthropicRefusalStopDetails' + stop_reason: + $ref: '#/components/schemas/ORAnthropicStopReason' + stop_sequence: + nullable: true + type: string + required: + - container + - stop_details + - stop_reason + - stop_sequence + type: object + type: + enum: + - message_delta type: string - top_logprobs: - items: - $ref: '#/components/schemas/OpenResponsesTopLogprobs' - type: array - required: - - logprob - - token - type: object - OpenResponsesResult: - allOf: - - $ref: '#/components/schemas/BaseResponsesResult' - - properties: - output: + usage: + properties: + cache_creation_input_tokens: + nullable: true + type: integer + cache_read_input_tokens: + nullable: true + type: integer + input_tokens: + nullable: true + type: integer + iterations: items: - $ref: '#/components/schemas/OutputItems' + $ref: '#/components/schemas/AnthropicUsageIteration' type: array - service_tier: + output_tokens: + type: integer + output_tokens_details: + $ref: '#/components/schemas/AnthropicOutputTokensDetails' + server_tool_use: nullable: true - type: string - text: - $ref: '#/components/schemas/TextExtendedConfig' - usage: - $ref: '#/components/schemas/Usage' + properties: + web_fetch_requests: + type: integer + web_search_requests: + type: integer + required: + - web_search_requests + - web_fetch_requests + type: object + required: + - input_tokens + - output_tokens + - output_tokens_details + - cache_creation_input_tokens + - cache_read_input_tokens + - server_tool_use type: object - description: Complete non-streaming response from the Responses API - example: - created_at: 1704067200 - error: null - id: resp-abc123 - incomplete_details: null - instructions: null - max_output_tokens: null - metadata: null - model: gpt-4 - object: response - output: - - content: - - annotations: [] - text: Hello! How can I help you today? - type: output_text - id: msg-abc123 - role: assistant - status: completed - type: message - parallel_tool_calls: true - status: completed - temperature: null - tool_choice: auto - tools: [] - top_p: null - usage: - input_tokens: 10 - input_tokens_details: - cached_tokens: 0 - output_tokens: 25 - output_tokens_details: - reasoning_tokens: 0 - total_tokens: 35 - OpenResponsesTopLogprobs: - description: Alternative token with its log probability + required: + - type + - delta + - usage + type: object + MessagesErrorDetail: example: - logprob: -0.5 - token: hello + message: Invalid request parameters + type: invalid_request_error properties: - bytes: - items: - type: integer - type: array - logprob: - format: double - type: number - token: + message: + type: string + type: type: string + required: + - type + - message type: object - OpenRouterWebSearchServerTool: - description: 'OpenRouter built-in server tool: searches the web for current information' + MessagesErrorEvent: + description: Error event in the stream example: - parameters: - max_results: 5 - type: openrouter:web_search + error: + message: Overloaded + type: overloaded_error + type: error properties: - parameters: - $ref: '#/components/schemas/WebSearchConfig' + error: + properties: + message: + type: string + type: + type: string + required: + - type + - message + type: object type: enum: - - openrouter:web_search + - error type: string required: - type + - error type: object - ORAnthropicContentBlock: - discriminator: - mapping: - bash_code_execution_tool_result: '#/components/schemas/AnthropicBashCodeExecutionToolResult' - code_execution_tool_result: '#/components/schemas/AnthropicCodeExecutionToolResult' - compaction: '#/components/schemas/AnthropicCompactionBlock' - container_upload: '#/components/schemas/AnthropicContainerUpload' - redacted_thinking: '#/components/schemas/AnthropicRedactedThinkingBlock' - server_tool_use: '#/components/schemas/AnthropicServerToolUseBlock' - text: '#/components/schemas/AnthropicTextBlock' - text_editor_code_execution_tool_result: '#/components/schemas/AnthropicTextEditorCodeExecutionToolResult' - thinking: '#/components/schemas/AnthropicThinkingBlock' - tool_search_tool_result: '#/components/schemas/AnthropicToolSearchToolResult' - tool_use: '#/components/schemas/AnthropicToolUseBlock' - web_fetch_tool_result: '#/components/schemas/AnthropicWebFetchToolResult' - web_search_tool_result: '#/components/schemas/AnthropicWebSearchToolResult' - propertyName: type + MessagesErrorResponse: example: - citations: null - text: Hello, world! - type: text - oneOf: - - $ref: '#/components/schemas/AnthropicTextBlock' - - $ref: '#/components/schemas/AnthropicToolUseBlock' - - $ref: '#/components/schemas/AnthropicThinkingBlock' - - $ref: '#/components/schemas/AnthropicRedactedThinkingBlock' - - $ref: '#/components/schemas/AnthropicServerToolUseBlock' - - $ref: '#/components/schemas/AnthropicWebSearchToolResult' - - $ref: '#/components/schemas/AnthropicWebFetchToolResult' - - $ref: '#/components/schemas/AnthropicCodeExecutionToolResult' - - $ref: '#/components/schemas/AnthropicBashCodeExecutionToolResult' - - $ref: '#/components/schemas/AnthropicTextEditorCodeExecutionToolResult' - - $ref: '#/components/schemas/AnthropicToolSearchToolResult' - - $ref: '#/components/schemas/AnthropicContainerUpload' - - $ref: '#/components/schemas/AnthropicCompactionBlock' - ORAnthropicStopReason: - enum: - - end_turn - - max_tokens - - stop_sequence - - tool_use - - pause_turn - - refusal - - compaction - - null - example: end_turn - nullable: true - type: string - x-speakeasy-unknown-values: allow - OutputApplyPatchServerToolItem: - description: An openrouter:apply_patch server tool output item - example: - filePath: /src/main.ts - id: ap_tmp_abc123 - status: completed - type: openrouter:apply_patch + error: + message: Invalid request parameters + type: invalid_request_error + type: error properties: - filePath: - type: string - id: - type: string - patch: - type: string - status: - $ref: '#/components/schemas/ToolCallStatus' + error: + $ref: '#/components/schemas/MessagesErrorDetail' type: enum: - - openrouter:apply_patch + - error type: string required: - - status - type + - error type: object - OutputBashServerToolItem: - description: An openrouter:bash server tool output item + MessagesFallbackParam: + additionalProperties: + nullable: true + description: >- + Fallback model to try when the primary model fails or refuses. Only the `model` field is supported; per-attempt overrides are rejected. example: - command: ls -la - exitCode: 0 - id: bash_tmp_abc123 - status: completed - stdout: | - total 0 - type: openrouter:bash + model: claude-opus-4-8 properties: - command: - type: string - exitCode: - type: integer - id: - type: string - status: - $ref: '#/components/schemas/ToolCallStatus' - stderr: - type: string - stdout: - type: string - type: - enum: - - openrouter:bash + model: type: string required: - - status - - type + - model type: object - OutputBrowserUseServerToolItem: - description: An openrouter:browser_use server tool output item + MessagesMessageParam: + description: Anthropic message with OpenRouter extensions example: - action: screenshot - id: bu_tmp_abc123 - status: completed - type: openrouter:browser_use + content: Hello, how are you? + role: user properties: - action: - type: string - id: - type: string - screenshotB64: - type: string - status: - $ref: '#/components/schemas/ToolCallStatus' - type: + content: + anyOf: + - type: string + - items: + oneOf: + - $ref: '#/components/schemas/AnthropicTextBlockParam' + - $ref: '#/components/schemas/AnthropicImageBlockParam' + - $ref: '#/components/schemas/AnthropicDocumentBlockParam' + - properties: + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + id: + type: string + input: + nullable: true + name: + type: string + type: + enum: + - tool_use + type: string + required: + - type + - id + - name + type: object + - properties: + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + content: + anyOf: + - type: string + - items: + anyOf: + - $ref: '#/components/schemas/AnthropicTextBlockParam' + - $ref: '#/components/schemas/AnthropicImageBlockParam' + - properties: + tool_name: + type: string + type: + enum: + - tool_reference + type: string + required: + - type + - tool_name + type: object + - $ref: '#/components/schemas/AnthropicSearchResultBlockParam' + - $ref: '#/components/schemas/AnthropicDocumentBlockParam' + type: array + is_error: + type: boolean + tool_use_id: + type: string + type: + enum: + - tool_result + type: string + required: + - type + - tool_use_id + type: object + - properties: + signature: + type: string + thinking: + type: string + type: + enum: + - thinking + type: string + required: + - type + - thinking + - signature + type: object + - properties: + data: + type: string + type: + enum: + - redacted_thinking + type: string + required: + - type + - data + type: object + - properties: + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + id: + type: string + input: + nullable: true + name: + type: string + type: + enum: + - server_tool_use + type: string + required: + - type + - id + - name + type: object + - properties: + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + content: + anyOf: + - items: + $ref: '#/components/schemas/AnthropicWebSearchResultBlockParam' + type: array + - properties: + error_code: + enum: + - invalid_tool_input + - unavailable + - max_uses_exceeded + - too_many_requests + - query_too_long + type: string + x-speakeasy-unknown-values: allow + type: + enum: + - web_search_tool_result_error + type: string + required: + - type + - error_code + type: object + tool_use_id: + type: string + type: + enum: + - web_search_tool_result + type: string + required: + - type + - tool_use_id + - content + type: object + - $ref: '#/components/schemas/AnthropicSearchResultBlockParam' + - properties: + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + content: + nullable: true + type: string + type: + enum: + - compaction + type: string + required: + - type + - content + type: object + - $ref: '#/components/schemas/MessagesAdvisorToolResultBlock' + type: array + role: enum: - - openrouter:browser_use + - user + - assistant + - system type: string + x-speakeasy-unknown-values: allow required: - - status - - type + - role + - content type: object - OutputCodeInterpreterCallItem: - allOf: - - $ref: '#/components/schemas/CodeInterpreterCallItem' - - properties: {} - type: object - description: A code interpreter execution call with outputs - example: - code: print("hello") - container_id: ctr-xyz789 - id: ci-abc123 - outputs: - - logs: | - hello - type: logs - status: completed - type: code_interpreter_call - OutputCodeInterpreterServerToolItem: - description: An openrouter:code_interpreter server tool output item + MessagesOutputConfig: + description: Configuration for controlling output behavior. Supports the effort parameter and structured output format. example: - code: print("hello") - id: ci_tmp_abc123 - language: python - status: completed - stdout: | - hello - type: openrouter:code_interpreter + effort: medium properties: - code: - type: string - exitCode: - type: integer - id: - type: string - language: - type: string - status: - $ref: '#/components/schemas/ToolCallStatus' - stderr: - type: string - stdout: - type: string - type: + effort: + description: >- + How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer. Valid values are `low`, `medium`, `high`, `xhigh`, or `max`. enum: - - openrouter:code_interpreter - type: string - required: - - status - - type - type: object - OutputComputerCallItem: - example: - action: - type: screenshot - call_id: call-abc123 - id: cu-abc123 - pending_safety_checks: [] - status: completed - type: computer_call - properties: - action: + - low + - medium + - high + - xhigh + - max + - null + example: medium nullable: true - call_id: - type: string - id: - type: string - pending_safety_checks: - items: - properties: - code: - type: string - id: - type: string - message: - type: string - required: - - id - - code - - message - type: object - type: array - status: - enum: - - completed - - incomplete - - in_progress type: string x-speakeasy-unknown-values: allow - type: - enum: - - computer_call - type: string - required: - - type - - call_id - - status - - pending_safety_checks - type: object - OutputDatetimeItem: - description: An openrouter:datetime server tool output item - example: - datetime: '2026-03-12T14:30:00.000Z' - id: dt_tmp_abc123 - status: completed - timezone: UTC - type: openrouter:datetime - properties: - datetime: - description: ISO 8601 datetime string - type: string - id: - type: string - status: - $ref: '#/components/schemas/ToolCallStatus' - timezone: - description: IANA timezone name - type: string - type: - enum: - - openrouter:datetime - type: string - required: - - status - - type - - datetime - - timezone - type: object - OutputFileSearchCallItem: - allOf: - - $ref: '#/components/schemas/OutputItemFileSearchCall' - - properties: {} + format: + description: >- + A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs). + nullable: true + properties: + schema: + additionalProperties: + nullable: true + type: object + type: + enum: + - json_schema + type: string + required: + - type + - schema type: object + task_budget: + description: >- + Task budget for an agentic turn. The model sees a countdown of remaining tokens and uses it to prioritize work and wind down gracefully. Advisory — does not enforce a hard cap. + example: + total: 400000 + type: tokens + nullable: true + properties: + remaining: + minimum: 0 + nullable: true + type: integer + total: + minimum: 20000 + type: integer + type: + enum: + - tokens + type: string + required: + - type + - total + type: object + type: object + MessagesPingEvent: + description: Keep-alive ping event example: - id: fs-abc123 - queries: - - search term - results: [] - status: completed - type: file_search_call - OutputFileSearchServerToolItem: - description: An openrouter:file_search server tool output item - example: - id: fs_tmp_abc123 - queries: - - search term - status: completed - type: openrouter:file_search + type: ping properties: - id: - type: string - queries: - items: - type: string - type: array - status: - $ref: '#/components/schemas/ToolCallStatus' type: enum: - - openrouter:file_search + - ping type: string required: - - status - type type: object - OutputFunctionCallItem: - allOf: - - $ref: '#/components/schemas/OutputItemFunctionCall' - - properties: {} - type: object - example: - arguments: '{"location":"San Francisco"}' - call_id: call-abc123 - id: fc-abc123 - name: get_weather - status: completed - type: function_call - OutputImageGenerationCallItem: - allOf: - - $ref: '#/components/schemas/OutputItemImageGenerationCall' - - properties: {} - type: object - example: - id: img-abc123 - result: null - status: completed - type: image_generation_call - OutputImageGenerationServerToolItem: - description: An openrouter:image_generation server tool output item + MessagesRequest: + description: Request schema for Anthropic Messages API endpoint example: - id: ig_tmp_abc123 - imageUrl: https://example.com/image.png - result: https://example.com/image.png - status: completed - type: openrouter:image_generation + max_tokens: 1024 + messages: + - content: Hello, how are you? + role: user + model: anthropic/claude-4.5-sonnet-20250929 + temperature: 0.7 properties: - id: - type: string - imageB64: - type: string - imageUrl: - type: string - result: - description: The generated image as a base64-encoded string or URL, matching OpenAI image_generation_call format + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + context_management: nullable: true - type: string - revisedPrompt: - type: string - status: - $ref: '#/components/schemas/ToolCallStatus' - type: - enum: - - openrouter:image_generation - type: string - required: - - status - - type - type: object - OutputItemAddedEvent: - description: Event emitted when a new output item is added to the response - example: - item: - content: [] - id: item-1 - role: assistant - status: in_progress - type: message - output_index: 0 - sequence_number: 2 - type: response.output_item.added - properties: - item: - discriminator: - mapping: - file_search_call: '#/components/schemas/OutputItemFileSearchCall' - function_call: '#/components/schemas/OutputItemFunctionCall' - image_generation_call: '#/components/schemas/OutputItemImageGenerationCall' - message: '#/components/schemas/OutputMessage' - reasoning: '#/components/schemas/OutputItemReasoning' - web_search_call: '#/components/schemas/OutputItemWebSearchCall' - propertyName: type - oneOf: - - $ref: '#/components/schemas/OutputMessage' - - $ref: '#/components/schemas/OutputItemReasoning' - - $ref: '#/components/schemas/OutputItemFunctionCall' - - $ref: '#/components/schemas/OutputItemWebSearchCall' - - $ref: '#/components/schemas/OutputItemFileSearchCall' - - $ref: '#/components/schemas/OutputItemImageGenerationCall' - output_index: - type: integer - sequence_number: - type: integer - type: - enum: - - response.output_item.added - type: string - required: - - type - - output_index - - item - - sequence_number - type: object - OutputItemDoneEvent: - description: Event emitted when an output item is complete - example: - item: - content: - - annotations: [] - text: Hello! How can I help you? - type: output_text - id: item-1 - role: assistant - status: completed - type: message - output_index: 0 - sequence_number: 8 - type: response.output_item.done - properties: - item: - discriminator: - mapping: - file_search_call: '#/components/schemas/OutputItemFileSearchCall' - function_call: '#/components/schemas/OutputItemFunctionCall' - image_generation_call: '#/components/schemas/OutputItemImageGenerationCall' - message: '#/components/schemas/OutputMessage' - reasoning: '#/components/schemas/OutputItemReasoning' - web_search_call: '#/components/schemas/OutputItemWebSearchCall' - propertyName: type - oneOf: - - $ref: '#/components/schemas/OutputMessage' - - $ref: '#/components/schemas/OutputItemReasoning' - - $ref: '#/components/schemas/OutputItemFunctionCall' - - $ref: '#/components/schemas/OutputItemWebSearchCall' - - $ref: '#/components/schemas/OutputItemFileSearchCall' - - $ref: '#/components/schemas/OutputItemImageGenerationCall' - output_index: - type: integer - sequence_number: + properties: + edits: + items: + oneOf: + - properties: + clear_at_least: + $ref: '#/components/schemas/AnthropicInputTokensClearAtLeast' + clear_tool_inputs: + anyOf: + - type: boolean + - items: + type: string + type: array + - nullable: true + exclude_tools: + items: + type: string + nullable: true + type: array + keep: + $ref: '#/components/schemas/AnthropicToolUsesKeep' + trigger: + discriminator: + mapping: + input_tokens: '#/components/schemas/AnthropicInputTokensTrigger' + tool_uses: '#/components/schemas/AnthropicToolUsesTrigger' + propertyName: type + oneOf: + - $ref: '#/components/schemas/AnthropicInputTokensTrigger' + - $ref: '#/components/schemas/AnthropicToolUsesTrigger' + type: + enum: + - clear_tool_uses_20250919 + type: string + required: + - type + type: object + - properties: + keep: + anyOf: + - $ref: '#/components/schemas/AnthropicThinkingTurns' + - properties: + type: + enum: + - all + type: string + required: + - type + type: object + - enum: + - all + type: string + type: + enum: + - clear_thinking_20251015 + type: string + required: + - type + type: object + - properties: + instructions: + nullable: true + type: string + pause_after_compaction: + type: boolean + trigger: + allOf: + - $ref: '#/components/schemas/AnthropicInputTokensTrigger' + - nullable: true + properties: {} + type: object + example: + type: input_tokens + value: 100000 + type: + enum: + - compact_20260112 + type: string + required: + - type + type: object + type: array + type: object + fallbacks: + description: >- + Fallback models to try if the primary model fails or refuses, in order. Handled by OpenRouter multi-model routing rather than Anthropic server-side fallbacks; cannot be combined with `models`. Each entry accepts only `model`. Maximum of 3 entries. + example: + - model: claude-opus-4-8 + items: + $ref: '#/components/schemas/MessagesFallbackParam' + nullable: true + type: array + max_tokens: type: integer - type: - enum: - - response.output_item.done - type: string - required: - - type - - output_index - - item - - sequence_number - type: object - OutputItemFileSearchCall: - example: - id: filesearch-abc123 - queries: - - machine learning algorithms - - neural networks - status: completed - type: file_search_call - properties: - id: + messages: + items: + $ref: '#/components/schemas/MessagesMessageParam' + nullable: true + type: array + metadata: + properties: + user_id: + nullable: true + type: string + type: object + model: type: string - queries: + models: items: type: string type: array - status: - $ref: '#/components/schemas/WebSearchStatus' - type: - enum: - - file_search_call + output_config: + $ref: '#/components/schemas/MessagesOutputConfig' + plugins: + description: Plugins you want to enable for this request, including their settings. + items: + discriminator: + mapping: + auto-router: '#/components/schemas/AutoRouterPlugin' + context-compression: '#/components/schemas/ContextCompressionPlugin' + file-parser: '#/components/schemas/FileParserPlugin' + fusion: '#/components/schemas/FusionPlugin' + moderation: '#/components/schemas/ModerationPlugin' + pareto-router: '#/components/schemas/ParetoRouterPlugin' + response-healing: '#/components/schemas/ResponseHealingPlugin' + web: '#/components/schemas/WebSearchPlugin' + web-fetch: '#/components/schemas/WebFetchPlugin' + propertyName: id + oneOf: + - $ref: '#/components/schemas/AutoRouterPlugin' + - $ref: '#/components/schemas/ModerationPlugin' + - $ref: '#/components/schemas/WebSearchPlugin' + - $ref: '#/components/schemas/WebFetchPlugin' + - $ref: '#/components/schemas/FileParserPlugin' + - $ref: '#/components/schemas/ResponseHealingPlugin' + - $ref: '#/components/schemas/ContextCompressionPlugin' + - $ref: '#/components/schemas/ParetoRouterPlugin' + - $ref: '#/components/schemas/FusionPlugin' + type: array + provider: + $ref: '#/components/schemas/ProviderPreferences' + route: + $ref: '#/components/schemas/DeprecatedRoute' + service_tier: type: string - required: - - type - - id - - queries - - status - type: object - OutputItemFunctionCall: - example: - arguments: '{"location":"San Francisco","unit":"celsius"}' - call_id: call-abc123 - id: call-abc123 - name: get_weather - type: function_call - properties: - arguments: - type: string - call_id: - type: string - id: - type: string - name: - type: string - status: - anyOf: - - enum: - - completed - type: string - - enum: - - incomplete - type: string - - enum: - - in_progress - type: string - type: - enum: - - function_call - type: string - required: - - type - - name - - arguments - - call_id - type: object - OutputItemImageGenerationCall: - example: - id: imagegen-abc123 - result: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== - status: completed - type: image_generation_call - properties: - id: - type: string - result: - default: null - nullable: true - type: string - status: - $ref: '#/components/schemas/ImageGenerationStatus' - type: - enum: - - image_generation_call + session_id: + description: >- + A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. + maxLength: 256 type: string - required: - - type - - id - - status - type: object - OutputItemReasoning: - example: - id: reasoning-abc123 - summary: - - text: Analyzed the problem using first principles - type: summary_text - type: reasoning - properties: - content: + speed: + allOf: + - $ref: '#/components/schemas/AnthropicSpeed' + - description: >- + Controls output generation speed. When set to `fast`, uses a higher-speed inference configuration at premium pricing. Defaults to `standard` when omitted. + example: fast + stop_sequences: items: - $ref: '#/components/schemas/ReasoningTextContent' + type: string type: array - encrypted_content: - nullable: true - type: string - id: - type: string - status: + stop_server_tools_when: + $ref: '#/components/schemas/StopServerToolsWhen' + stream: + type: boolean + system: anyOf: - - enum: - - completed - type: string - - enum: - - incomplete - type: string - - enum: - - in_progress - type: string - summary: - items: - $ref: '#/components/schemas/ReasoningSummaryText' - type: array - type: - enum: - - reasoning - type: string - required: - - type - - id - - summary - type: object - OutputItems: - description: An output item from the response - discriminator: - mapping: - code_interpreter_call: '#/components/schemas/OutputCodeInterpreterCallItem' - computer_call: '#/components/schemas/OutputComputerCallItem' - file_search_call: '#/components/schemas/OutputFileSearchCallItem' - function_call: '#/components/schemas/OutputFunctionCallItem' - image_generation_call: '#/components/schemas/OutputImageGenerationCallItem' - message: '#/components/schemas/OutputMessageItem' - openrouter:apply_patch: '#/components/schemas/OutputApplyPatchServerToolItem' - openrouter:bash: '#/components/schemas/OutputBashServerToolItem' - openrouter:browser_use: '#/components/schemas/OutputBrowserUseServerToolItem' - openrouter:code_interpreter: '#/components/schemas/OutputCodeInterpreterServerToolItem' - openrouter:datetime: '#/components/schemas/OutputDatetimeItem' - openrouter:experimental__search_models: '#/components/schemas/OutputSearchModelsServerToolItem' - openrouter:file_search: '#/components/schemas/OutputFileSearchServerToolItem' - openrouter:image_generation: '#/components/schemas/OutputImageGenerationServerToolItem' - openrouter:mcp: '#/components/schemas/OutputMcpServerToolItem' - openrouter:memory: '#/components/schemas/OutputMemoryServerToolItem' - openrouter:text_editor: '#/components/schemas/OutputTextEditorServerToolItem' - openrouter:tool_search: '#/components/schemas/OutputToolSearchServerToolItem' - openrouter:web_fetch: '#/components/schemas/OutputWebFetchServerToolItem' - openrouter:web_search: '#/components/schemas/OutputWebSearchServerToolItem' - reasoning: '#/components/schemas/OutputReasoningItem' - web_search_call: '#/components/schemas/OutputWebSearchCallItem' - propertyName: type - example: - content: - - text: Hello! How can I help you today? - type: output_text - id: msg-abc123 - role: assistant - status: completed - type: message - oneOf: - - $ref: '#/components/schemas/OutputMessageItem' - - $ref: '#/components/schemas/OutputReasoningItem' - - $ref: '#/components/schemas/OutputFunctionCallItem' - - $ref: '#/components/schemas/OutputWebSearchCallItem' - - $ref: '#/components/schemas/OutputFileSearchCallItem' - - $ref: '#/components/schemas/OutputImageGenerationCallItem' - - $ref: '#/components/schemas/OutputCodeInterpreterCallItem' - - $ref: '#/components/schemas/OutputComputerCallItem' - - $ref: '#/components/schemas/OutputDatetimeItem' - - $ref: '#/components/schemas/OutputWebSearchServerToolItem' - - $ref: '#/components/schemas/OutputCodeInterpreterServerToolItem' - - $ref: '#/components/schemas/OutputFileSearchServerToolItem' - - $ref: '#/components/schemas/OutputImageGenerationServerToolItem' - - $ref: '#/components/schemas/OutputBrowserUseServerToolItem' - - $ref: '#/components/schemas/OutputBashServerToolItem' - - $ref: '#/components/schemas/OutputTextEditorServerToolItem' - - $ref: '#/components/schemas/OutputApplyPatchServerToolItem' - - $ref: '#/components/schemas/OutputWebFetchServerToolItem' - - $ref: '#/components/schemas/OutputToolSearchServerToolItem' - - $ref: '#/components/schemas/OutputMemoryServerToolItem' - - $ref: '#/components/schemas/OutputMcpServerToolItem' - - $ref: '#/components/schemas/OutputSearchModelsServerToolItem' - OutputItemWebSearchCall: - example: - action: - query: OpenAI API - type: search - id: search-abc123 - status: completed - type: web_search_call - properties: - action: + - type: string + - items: + $ref: '#/components/schemas/AnthropicTextBlockParam' + type: array + temperature: + format: double + type: number + thinking: oneOf: - properties: - queries: - items: - type: string - type: array - query: - type: string - sources: - items: - $ref: '#/components/schemas/WebSearchSource' - type: array + budget_tokens: + type: integer + display: + $ref: '#/components/schemas/AnthropicThinkingDisplay' type: enum: - - search + - enabled type: string required: - type - - query + - budget_tokens type: object - properties: type: enum: - - open_page + - disabled type: string - url: - nullable: true + required: + - type + type: object + - properties: + display: + $ref: '#/components/schemas/AnthropicThinkingDisplay' + type: + enum: + - adaptive type: string required: - type type: object + tool_choice: + oneOf: - properties: - pattern: + disable_parallel_tool_use: + type: boolean + type: + enum: + - auto type: string + required: + - type + type: object + - properties: + disable_parallel_tool_use: + type: boolean type: enum: - - find_in_page + - any type: string - url: + required: + - type + type: object + - properties: + type: + enum: + - none type: string required: - type - - pattern - - url type: object - id: - type: string - status: - $ref: '#/components/schemas/WebSearchStatus' - type: - enum: - - web_search_call + - properties: + disable_parallel_tool_use: + type: boolean + name: + type: string + type: + enum: + - tool + type: string + required: + - type + - name + type: object + tools: + items: + anyOf: + - properties: + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + description: + type: string + input_schema: + additionalProperties: + nullable: true + properties: + properties: + nullable: true + required: + items: + type: string + nullable: true + type: array + type: + default: object + type: string + type: object + name: + type: string + type: + enum: + - custom + type: string + required: + - name + - input_schema + type: object + - properties: + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + name: + enum: + - bash + type: string + type: + enum: + - bash_20250124 + type: string + required: + - type + - name + type: object + - properties: + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + name: + enum: + - str_replace_editor + type: string + type: + enum: + - text_editor_20250124 + type: string + required: + - type + - name + type: object + - properties: + allowed_domains: + items: + type: string + nullable: true + type: array + blocked_domains: + items: + type: string + nullable: true + type: array + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + max_uses: + nullable: true + type: integer + name: + enum: + - web_search + type: string + type: + enum: + - web_search_20250305 + type: string + user_location: + $ref: '#/components/schemas/AnthropicWebSearchToolUserLocation' + required: + - type + - name + type: object + - properties: + allowed_callers: + $ref: '#/components/schemas/AnthropicAllowedCallers' + allowed_domains: + items: + type: string + nullable: true + type: array + blocked_domains: + items: + type: string + nullable: true + type: array + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + max_uses: + nullable: true + type: integer + name: + enum: + - web_search + type: string + type: + enum: + - web_search_20260209 + type: string + user_location: + $ref: '#/components/schemas/AnthropicWebSearchToolUserLocation' + required: + - type + - name + type: object + - properties: + allowed_callers: + $ref: '#/components/schemas/AnthropicAllowedCallers' + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + caching: + allOf: + - $ref: '#/components/schemas/AnthropicCacheControlDirective' + - nullable: true + defer_loading: + type: boolean + max_uses: + type: integer + model: + type: string + name: + enum: + - advisor + type: string + type: + enum: + - advisor_20260301 + type: string + required: + - type + - name + - model + type: object + - $ref: '#/components/schemas/BashServerTool' + - $ref: '#/components/schemas/DatetimeServerTool' + - $ref: '#/components/schemas/ImageGenerationServerTool_OpenRouter' + - $ref: '#/components/schemas/ChatSearchModelsServerTool' + - $ref: '#/components/schemas/WebFetchServerTool' + - $ref: '#/components/schemas/OpenRouterWebSearchServerTool' + - additionalProperties: + nullable: true + properties: + type: + type: string + required: + - type + type: object + type: array + top_k: + type: integer + top_p: + format: double + type: number + trace: + $ref: '#/components/schemas/TraceConfig' + user: + description: >- + A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 256 characters. + maxLength: 256 type: string required: - - type - - id - - action - - status + - model + - messages type: object - OutputMcpServerToolItem: - description: An openrouter:mcp server tool output item + MessagesResult: + allOf: + - $ref: '#/components/schemas/BaseMessagesResult' + - properties: + context_management: + nullable: true + properties: + applied_edits: + items: + additionalProperties: + nullable: true + properties: + type: + type: string + required: + - type + type: object + type: array + required: + - applied_edits + type: object + openrouter_metadata: + $ref: '#/components/schemas/OpenRouterMetadata' + provider: + $ref: '#/components/schemas/ProviderName' + usage: + allOf: + - $ref: '#/components/schemas/AnthropicUsage' + - properties: + cost: + format: double + nullable: true + type: number + cost_details: + $ref: '#/components/schemas/CostDetails' + is_byok: + type: boolean + iterations: + items: + $ref: '#/components/schemas/AnthropicUsageIteration' + type: array + service_tier: + nullable: true + type: string + speed: + $ref: '#/components/schemas/AnthropicSpeed' + type: object + example: + cache_creation: null + cache_creation_input_tokens: null + cache_read_input_tokens: null + inference_geo: null + input_tokens: 100 + output_tokens: 50 + server_tool_use: null + service_tier: standard + type: object + description: Non-streaming response from the Anthropic Messages API with OpenRouter extensions example: - id: mcp_tmp_abc123 - serverLabel: my-server - status: completed - toolName: get_data - type: openrouter:mcp - properties: - id: - type: string - serverLabel: - type: string - status: - $ref: '#/components/schemas/ToolCallStatus' - toolName: - type: string + container: null + content: + - citations: [] + text: Hello! I'm doing well, thank you for asking. + type: text + id: msg_01XFDUDYJgAACzvnptvVoYEL + model: claude-sonnet-4-5-20250929 + role: assistant + stop_details: null + stop_reason: end_turn + stop_sequence: null + type: message + usage: + cache_creation: null + cache_creation_input_tokens: null + cache_read_input_tokens: null + inference_geo: null + input_tokens: 12 + output_tokens: 15 + server_tool_use: null + service_tier: standard + MessagesStartEvent: + description: Event sent at the start of a streaming message + example: + message: + content: [] + id: msg_01XFDUDYJgAACzvnptvVoYEL + model: claude-sonnet-4-5-20250929 + role: assistant + stop_details: null + stop_reason: null + stop_sequence: null + type: message + usage: + input_tokens: 12 + output_tokens: 0 + type: message_start + properties: + message: + properties: + container: + $ref: '#/components/schemas/AnthropicContainer' + content: + items: + $ref: '#/components/schemas/ORAnthropicContentBlock' + type: array + id: + type: string + model: + type: string + provider: + enum: + - AnyScale + - Atoma + - Cent-ML + - CrofAI + - Enfer + - GoPomelo + - HuggingFace + - Hyperbolic + - Hyperbolic 2 + - InoCloud + - Kluster + - Lambda + - Lepton + - Lynn 2 + - Lynn + - Mancer + - Meta + - Modal + - Nineteen + - OctoAI + - Recursal + - Reflection + - Replicate + - SambaNova 2 + - SF Compute + - Targon + - Together 2 + - Ubicloud + - 01.AI + - AkashML + - AI21 + - AionLabs + - Alibaba + - Ambient + - Baidu + - Amazon Bedrock + - Amazon Nova + - Anthropic + - Arcee AI + - AtlasCloud + - Avian + - Azure + - BaseTen + - BytePlus + - Black Forest Labs + - Cerebras + - Chutes + - Cirrascale + - Clarifai + - Cloudflare + - Cohere + - Crucible + - Crusoe + - Darkbloom + - Decart + - DeepInfra + - DeepSeek + - DekaLLM + - DigitalOcean + - Featherless + - Fireworks + - Friendli + - GMICloud + - Google + - Google AI Studio + - Groq + - Inception + - Inceptron + - InferenceNet + - Ionstream + - Infermatic + - Io Net + - Inflection + - Liquid + - Mara + - Mancer 2 + - Minimax + - ModelRun + - Mistral + - Modular + - Moonshot AI + - Morph + - NCompass + - Nebius + - Nex AGI + - NextBit + - Novita + - Nvidia + - OpenAI + - OpenInference + - Parasail + - Poolside + - Perceptron + - Perplexity + - Phala + - Recraft + - Reka + - Relace + - SambaNova + - Seed + - SiliconFlow + - Sourceful + - StepFun + - Stealth + - StreamLake + - Switchpoint + - Together + - Upstage + - Venice + - Wafer + - WandB + - Xiaomi + - xAI + - Z.AI + - FakeProvider + type: string + x-speakeasy-unknown-values: allow + role: + enum: + - assistant + type: string + stop_details: + $ref: '#/components/schemas/AnthropicRefusalStopDetails' + stop_reason: + nullable: true + stop_sequence: + nullable: true + type: + enum: + - message + type: string + usage: + allOf: + - $ref: '#/components/schemas/AnthropicUsage' + - properties: + iterations: + items: + $ref: '#/components/schemas/AnthropicUsageIteration' + type: array + speed: + $ref: '#/components/schemas/AnthropicSpeed' + type: object + example: + cache_creation: null + cache_creation_input_tokens: null + cache_read_input_tokens: null + inference_geo: null + input_tokens: 100 + output_tokens: 50 + server_tool_use: null + service_tier: standard + required: + - id + - type + - role + - container + - content + - model + - stop_reason + - stop_details + - stop_sequence + - usage + type: object type: enum: - - openrouter:mcp + - message_start type: string required: - - status - type + - message type: object - OutputMemoryServerToolItem: - description: An openrouter:memory server tool output item + MessagesStopEvent: + description: Event sent when the message is complete example: - action: read - id: mem_tmp_abc123 - key: user_preference - status: completed - type: openrouter:memory + type: message_stop properties: - action: - enum: - - read - - write - - delete - type: string - x-speakeasy-unknown-values: allow - id: - type: string - key: - type: string - status: - $ref: '#/components/schemas/ToolCallStatus' + openrouter_metadata: + $ref: '#/components/schemas/OpenRouterMetadata' type: enum: - - openrouter:memory + - message_stop type: string - value: - nullable: true required: - - status - type type: object - OutputMessage: + MessagesStreamEvents: + description: Union of all possible streaming events + discriminator: + mapping: + content_block_delta: '#/components/schemas/MessagesContentBlockDeltaEvent' + content_block_start: '#/components/schemas/MessagesContentBlockStartEvent' + content_block_stop: '#/components/schemas/MessagesContentBlockStopEvent' + error: '#/components/schemas/MessagesErrorEvent' + message_delta: '#/components/schemas/MessagesDeltaEvent' + message_start: '#/components/schemas/MessagesStartEvent' + message_stop: '#/components/schemas/MessagesStopEvent' + ping: '#/components/schemas/MessagesPingEvent' + propertyName: type example: - content: - - text: Hello! How can I help you today? - type: output_text - id: msg-abc123 - role: assistant - status: completed - type: message + delta: + text: Hello + type: text_delta + index: 0 + type: content_block_delta + oneOf: + - $ref: '#/components/schemas/MessagesStartEvent' + - $ref: '#/components/schemas/MessagesDeltaEvent' + - $ref: '#/components/schemas/MessagesStopEvent' + - $ref: '#/components/schemas/MessagesContentBlockStartEvent' + - $ref: '#/components/schemas/MessagesContentBlockDeltaEvent' + - $ref: '#/components/schemas/MessagesContentBlockStopEvent' + - $ref: '#/components/schemas/MessagesPingEvent' + - $ref: '#/components/schemas/MessagesErrorEvent' + MessagesStreamingResponse: + example: + data: + delta: + text: Hello + type: text_delta + index: 0 + type: content_block_delta + event: content_block_delta properties: - content: - items: - anyOf: - - $ref: '#/components/schemas/ResponseOutputText' - - $ref: '#/components/schemas/OpenAIResponsesRefusalContent' - type: array - id: - type: string - phase: - anyOf: - - enum: - - commentary - type: string - - enum: - - final_answer - type: string - - nullable: true - description: >- - The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages. - role: - enum: - - assistant - type: string - status: - anyOf: - - enum: - - completed - type: string - - enum: - - incomplete - type: string - - enum: - - in_progress - type: string - type: - enum: - - message + data: + $ref: '#/components/schemas/MessagesStreamEvents' + event: type: string required: - - id - - role - - type - - content + - event + - data type: object - OutputMessageItem: - allOf: - - $ref: '#/components/schemas/OutputMessage' - - properties: {} - type: object - description: An output message item - example: - content: - - annotations: [] - text: Hello! How can I help you? - type: output_text - id: msg-123 - role: assistant - status: completed - type: message - OutputModality: - enum: - - text - - image - - embeddings - - audio - - video - - rerank - - tts - example: text - type: string - x-speakeasy-unknown-values: allow - OutputModalityEnum: + MetadataLevel: + description: Opt-in level for surfacing routing metadata on the response under `openrouter_metadata`. enum: - - text - - image - example: text + - disabled + - enabled + example: enabled type: string x-speakeasy-unknown-values: allow - OutputReasoningItem: - allOf: - - $ref: '#/components/schemas/OutputItemReasoning' - - properties: - content: - items: - $ref: '#/components/schemas/ReasoningTextContent' - nullable: true - type: array - format: - $ref: '#/components/schemas/ReasoningFormat' - signature: - description: A signature for the reasoning content, used for verification - example: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj... - nullable: true - type: string - type: object - description: An output item containing reasoning - example: - content: - - text: First, we analyze the problem... - type: reasoning_text - format: anthropic-claude-v1 - id: reasoning-123 - signature: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj... - status: completed - summary: - - text: Analyzed the problem and found the optimal solution. - type: summary_text - type: reasoning - OutputSearchModelsServerToolItem: - description: An openrouter:experimental__search_models server tool output item + Model: + description: Information about an AI model available on OpenRouter example: - arguments: '{"query":"Claude Opus"}' - id: sm_tmp_abc123 - query: Claude Opus - status: completed - type: openrouter:experimental__search_models + architecture: + input_modalities: + - text + instruct_type: chatml + modality: text->text + output_modalities: + - text + tokenizer: GPT + canonical_slug: openai/gpt-4 + context_length: 8192 + created: 1692901234 + default_parameters: null + description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. + expiration_date: null + id: openai/gpt-4 + knowledge_cutoff: null + links: + details: /api/v1/models/openai/gpt-5.4/endpoints + name: GPT-4 + per_request_limits: null + pricing: + completion: '0.00006' + image: '0' + prompt: '0.00003' + request: '0' + supported_parameters: + - temperature + - top_p + - max_tokens + supported_voices: null + top_provider: + context_length: 8192 + is_moderated: true + max_completion_tokens: 4096 properties: - arguments: - description: The JSON arguments submitted to the search tool (e.g. {"query":"Claude"}) + architecture: + $ref: '#/components/schemas/ModelArchitecture' + benchmarks: + $ref: '#/components/schemas/ModelBenchmarks' + canonical_slug: + description: Canonical slug for the model + example: openai/gpt-4 + type: string + context_length: + description: Maximum context length in tokens + example: 8192 + nullable: true + type: integer + created: + description: Unix timestamp of when the model was created + example: 1692901234 + type: integer + default_parameters: + $ref: '#/components/schemas/DefaultParameters' + description: + description: Description of the model + example: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. + type: string + expiration_date: + description: The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration. + example: '2025-06-01' + nullable: true + type: string + hugging_face_id: + description: Hugging Face model identifier, if applicable + example: microsoft/DialoGPT-medium + nullable: true type: string id: + description: Unique identifier for the model + example: openai/gpt-4 type: string - query: + knowledge_cutoff: + description: The date up to which the model was trained on data. ISO 8601 date string (YYYY-MM-DD) or null if unknown. + example: '2024-10-01' + nullable: true type: string - status: - $ref: '#/components/schemas/ToolCallStatus' - type: - enum: - - openrouter:experimental__search_models + links: + $ref: '#/components/schemas/ModelLinks' + name: + description: Display name of the model + example: GPT-4 type: string + per_request_limits: + $ref: '#/components/schemas/PerRequestLimits' + pricing: + $ref: '#/components/schemas/PublicPricing' + supported_parameters: + description: List of supported parameters for this model + items: + $ref: '#/components/schemas/Parameter' + type: array + supported_voices: + description: List of supported voice identifiers for TTS models. Null for non-TTS models. + example: null + items: + type: string + nullable: true + type: array + top_provider: + $ref: '#/components/schemas/TopProviderInfo' required: - - status - - type + - id + - canonical_slug + - name + - created + - pricing + - context_length + - architecture + - top_provider + - per_request_limits + - supported_parameters + - default_parameters + - supported_voices + - links type: object - OutputTextEditorServerToolItem: - description: An openrouter:text_editor server tool output item + ModelArchitecture: + description: Model architecture information example: - command: view - filePath: /src/main.ts - id: te_tmp_abc123 - status: completed - type: openrouter:text_editor + input_modalities: + - text + instruct_type: chatml + modality: text->text + output_modalities: + - text + tokenizer: GPT properties: - command: + input_modalities: + description: Supported input modalities + items: + $ref: '#/components/schemas/InputModality' + type: array + instruct_type: + description: Instruction format type enum: - - view - - create - - str_replace - - insert + - none + - airoboros + - alpaca + - alpaca-modif + - chatml + - claude + - code-llama + - gemma + - llama2 + - llama3 + - mistral + - nemotron + - neural + - openchat + - phi3 + - rwkv + - vicuna + - zephyr + - deepseek-r1 + - deepseek-v3.1 + - qwq + - qwen3 + - null + example: chatml + nullable: true type: string x-speakeasy-unknown-values: allow - filePath: - type: string - id: - type: string - status: - $ref: '#/components/schemas/ToolCallStatus' - type: - enum: - - openrouter:text_editor + modality: + description: Primary modality of the model + example: text->text + nullable: true type: string + output_modalities: + description: Supported output modalities + items: + $ref: '#/components/schemas/OutputModality' + type: array + tokenizer: + $ref: '#/components/schemas/ModelGroup' required: - - status - - type + - modality + - input_modalities + - output_modalities type: object - OutputToolSearchServerToolItem: - description: An openrouter:tool_search server tool output item + ModelBenchmarks: + description: Third-party benchmark rankings for this model. Omitted when no benchmark data is available. + example: + artificial_analysis: + agentic_index: 55.8 + coding_index: 63.2 + intelligence_index: 71.4 + design_arena: + - arena: models + category: website + elo: 1385.2 + rank: 5 + win_rate: 62.5 + properties: + artificial_analysis: + $ref: '#/components/schemas/AABenchmarkEntry' + design_arena: + description: Design Arena ELO rankings across arena+category pairs. + example: + - arena: models + category: website + elo: 1385.2 + rank: 5 + win_rate: 62.5 + items: + $ref: '#/components/schemas/DABenchmarkEntry' + type: array + required: + - design_arena + type: object + ModelGroup: + description: Tokenizer type used by the model + enum: + - Router + - Media + - Other + - GPT + - Claude + - Gemini + - Gemma + - Grok + - Cohere + - Nova + - Qwen + - Yi + - DeepSeek + - Mistral + - Llama2 + - Llama3 + - Llama4 + - PaLM + - RWKV + - Qwen3 + example: GPT + type: string + x-speakeasy-unknown-values: allow + ModelLinks: + description: Related API endpoints and resources for this model. example: - id: ts_tmp_abc123 - query: weather tools - status: completed - type: openrouter:tool_search + details: /api/v1/models/openai/gpt-5.4/endpoints properties: - id: - type: string - query: - type: string - status: - $ref: '#/components/schemas/ToolCallStatus' - type: - enum: - - openrouter:tool_search + details: + description: URL for the model details/endpoints API + example: /api/v1/models/openai/gpt-5.4/endpoints type: string required: - - status - - type + - details type: object - OutputWebFetchServerToolItem: - description: An openrouter:web_fetch server tool output item + ModelName: + description: Model to use for completion + example: openai/gpt-4 + type: string + ModelResponse: + description: Single model response example: - id: wf_tmp_abc123 - status: completed - title: Example Domain - type: openrouter:web_fetch - url: https://example.com + data: + architecture: + input_modalities: + - text + instruct_type: chatml + modality: text->text + output_modalities: + - text + tokenizer: GPT + context_length: 8192 + created: 1692901234 + description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. + id: openai/gpt-4 + name: GPT-4 + per_request_limits: null + pricing: + completion: '0.00006' + image: '0' + prompt: '0.00003' + request: '0' + supported_parameters: + - temperature + - top_p + - max_tokens + top_provider: + context_length: 8192 + is_moderated: true + max_completion_tokens: 4096 properties: - content: - type: string - id: - type: string - status: - $ref: '#/components/schemas/ToolCallStatus' - title: - type: string - type: - enum: - - openrouter:web_fetch - type: string - url: - type: string + data: + $ref: '#/components/schemas/Model' required: - - status - - type + - data type: object - OutputWebSearchCallItem: - allOf: - - $ref: '#/components/schemas/OutputItemWebSearchCall' - - properties: {} - type: object - example: - id: ws-abc123 - status: completed - type: web_search_call - OutputWebSearchServerToolItem: - description: An openrouter:web_search server tool output item + ModelsCountResponse: + description: Model count data example: - id: ws_tmp_abc123 - status: completed - type: openrouter:web_search + data: + count: 150 properties: - id: - type: string - status: - $ref: '#/components/schemas/ToolCallStatus' - type: - enum: - - openrouter:web_search - type: string + data: + description: Model count data + example: + count: 150 + properties: + count: + description: Total number of available models + example: 150 + type: integer + required: + - count + type: object required: - - status - - type + - data type: object - Parameter: - enum: - - temperature - - top_p - - top_k - - min_p - - top_a - - frequency_penalty - - presence_penalty - - repetition_penalty - - max_tokens - - max_completion_tokens - - logit_bias - - logprobs - - top_logprobs - - seed - - response_format - - structured_outputs - - stop - - tools - - tool_choice - - parallel_tool_calls - - include_reasoning - - reasoning - - reasoning_effort - - web_search_options - - verbosity - example: temperature - type: string - x-speakeasy-unknown-values: allow - ParetoRouterPlugin: + ModelsListResponse: + description: List of available models example: - enabled: true - id: pareto-router - min_coding_score: 0.8 + data: + - architecture: + input_modalities: + - text + instruct_type: chatml + modality: text->text + output_modalities: + - text + tokenizer: GPT + canonical_slug: openai/gpt-4 + context_length: 8192 + created: 1692901234 + default_parameters: null + description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. + expiration_date: null + id: openai/gpt-4 + knowledge_cutoff: null + links: + details: /api/v1/models/openai/gpt-5.4/endpoints + name: GPT-4 + per_request_limits: null + pricing: + completion: '0.00006' + image: '0' + prompt: '0.00003' + request: '0' + supported_parameters: + - temperature + - top_p + - max_tokens + - frequency_penalty + - presence_penalty + supported_voices: null + top_provider: + context_length: 8192 + is_moderated: true + max_completion_tokens: 4096 + properties: + data: + $ref: '#/components/schemas/ModelsListResponseData' + required: + - data + type: object + ModelsListResponseData: + description: List of available models + example: + - architecture: + input_modalities: + - text + instruct_type: chatml + modality: text->text + output_modalities: + - text + tokenizer: GPT + canonical_slug: openai/gpt-4 + context_length: 8192 + created: 1692901234 + default_parameters: null + description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. + expiration_date: null + id: openai/gpt-4 + knowledge_cutoff: null + links: + details: /api/v1/models/openai/gpt-5.4/endpoints + name: GPT-4 + per_request_limits: null + pricing: + completion: '0.00006' + image: '0' + prompt: '0.00003' + request: '0' + supported_parameters: + - temperature + - top_p + - max_tokens + supported_voices: null + top_provider: + context_length: 8192 + is_moderated: true + max_completion_tokens: 4096 + items: + $ref: '#/components/schemas/Model' + type: array + ModerationPlugin: + example: + id: moderation properties: - enabled: - description: Set to false to disable the pareto-router plugin for this request. Defaults to true. - type: boolean id: enum: - - pareto-router + - moderation type: string - min_coding_score: - description: >- - Minimum desired coding score between 0 and 1, where 1 is best. Higher values select from stronger coding models (sourced from Artificial Analysis coding percentiles). Maps internally to one of three tiers (low, medium, high). Omit to use the router default tier. - example: 0.8 - format: double - maximum: 1 - minimum: 0 - type: number required: - id type: object - PayloadTooLargeResponse: - description: Payload Too Large - Request payload exceeds size limits + MultimodalMedia: example: - error: - code: 413 - message: Request payload too large + data: data:audio/wav;base64,UklGRiQAAABXQVZFZm10IBAAAAA... + format: wav properties: - error: - $ref: '#/components/schemas/PayloadTooLargeResponseErrorData' - user_id: - nullable: true + data: + type: string + format: type: string required: - - error + - data type: object - PayloadTooLargeResponseErrorData: - description: Error data for PayloadTooLargeResponse + NotFoundResponse: + description: Not Found - Resource does not exist example: - code: 413 - message: Request payload too large + error: + code: 404 + message: Resource not found properties: - code: - type: integer - message: - type: string - metadata: + error: + $ref: '#/components/schemas/NotFoundResponseErrorData' + openrouter_metadata: additionalProperties: nullable: true nullable: true type: object - required: - - code - - message - type: object - PaymentRequiredResponse: - description: Payment Required - Insufficient credits or quota to complete request - example: - error: - code: 402 - message: Insufficient credits. Add more using https://openrouter.ai/credits - properties: - error: - $ref: '#/components/schemas/PaymentRequiredResponseErrorData' user_id: nullable: true type: string required: - error type: object - PaymentRequiredResponseErrorData: - description: Error data for PaymentRequiredResponse + NotFoundResponseErrorData: + description: Error data for NotFoundResponse example: - code: 402 - message: Insufficient credits. Add more using https://openrouter.ai/credits + code: 404 + message: Resource not found properties: code: type: integer @@ -10700,3420 +12520,8369 @@ components: - code - message type: object - PDFParserEngine: - anyOf: - - enum: - - mistral-ocr - - native - - cloudflare-ai - type: string - x-speakeasy-unknown-values: allow - - enum: - - pdf-text - type: string - description: >- - The engine to use for parsing PDF files. "pdf-text" is deprecated and automatically redirected to "cloudflare-ai". - example: cloudflare-ai - PDFParserOptions: - description: Options for PDF parsing. - example: - engine: cloudflare-ai - properties: - engine: - $ref: '#/components/schemas/PDFParserEngine' - type: object - PercentileLatencyCutoffs: - description: Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred. + ObservabilityArizeDestination: example: - p50: 5 - p90: 10 + api_key_hashes: null + config: + apiKey: arize_...AbCd + baseUrl: https://otlp.arize.com + modelId: openrouter-prod + spaceKey: space_...EfGh + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production Arize + privacy_mode: false + sampling_rate: 1 + type: arize + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 properties: - p50: - description: Maximum p50 latency (seconds) - format: double - nullable: true - type: number - p75: - description: Maximum p75 latency (seconds) - format: double + api_key_hashes: + description: >- + Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + example: null + items: + type: string nullable: true - type: number - p90: - description: Maximum p90 latency (seconds) - format: double + type: array + config: + properties: + apiKey: + minLength: 1 + type: string + baseUrl: + default: https://otlp.arize.com + type: string + headers: + additionalProperties: + type: string + description: Custom HTTP headers to include in requests to this destination. + type: object + modelId: + minLength: 1 + type: string + spaceKey: + minLength: 1 + type: string + required: + - apiKey + - spaceKey + - modelId + type: object + created_at: + description: ISO timestamp of when the destination was created. + example: '2025-08-24T10:30:00Z' + type: string + enabled: + description: Whether this destination is currently enabled. + example: true + type: boolean + filter_rules: + $ref: '#/components/schemas/ObservabilityFilterRulesConfig' + id: + description: Stable public identifier for this destination. + example: 99999999-aaaa-bbbb-cccc-dddddddddddd + format: uuid + type: string + name: + description: Human-readable name for the destination. + example: Production Langfuse nullable: true - type: number - p99: - description: Maximum p99 latency (seconds) + type: string + privacy_mode: + description: When true, request/response bodies are not forwarded to this destination — only metadata. + example: false + type: boolean + sampling_rate: + description: Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + example: 1 format: double - nullable: true type: number + type: + enum: + - arize + type: string + updated_at: + description: ISO timestamp of when the destination was last updated. + example: '2025-08-24T15:45:00Z' + type: string + workspace_id: + description: ID of the workspace this destination belongs to. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + required: + - id + - workspace_id + - name + - enabled + - privacy_mode + - sampling_rate + - api_key_hashes + - filter_rules + - created_at + - updated_at + - type + - config type: object - PercentileStats: - description: >- - Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests. + ObservabilityBraintrustDestination: example: - p50: 25.5 - p75: 35.2 - p90: 48.7 - p99: 85.3 - nullable: true + api_key_hashes: null + config: + apiKey: sk-...AbCd + baseUrl: https://api.braintrust.dev + projectId: proj_... + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production Braintrust + privacy_mode: false + sampling_rate: 1 + type: braintrust + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 properties: - p50: - description: Median (50th percentile) - example: 25.5 - format: double - type: number - p75: - description: 75th percentile - example: 35.2 - format: double - type: number - p90: - description: 90th percentile - example: 48.7 - format: double - type: number - p99: - description: 99th percentile - example: 85.3 - format: double - type: number - required: - - p50 - - p75 - - p90 - - p99 - type: object - PercentileThroughputCutoffs: - description: Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred. - example: - p50: 100 - p90: 50 - properties: - p50: - description: Minimum p50 throughput (tokens/sec) - format: double - nullable: true - type: number - p75: - description: Minimum p75 throughput (tokens/sec) - format: double + api_key_hashes: + description: >- + Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + example: null + items: + type: string nullable: true - type: number - p90: - description: Minimum p90 throughput (tokens/sec) - format: double + type: array + config: + properties: + apiKey: + minLength: 1 + type: string + baseUrl: + default: https://api.braintrust.dev + type: string + headers: + additionalProperties: + type: string + description: Custom HTTP headers to include in requests to this destination. + type: object + projectId: + minLength: 1 + type: string + required: + - apiKey + - projectId + type: object + created_at: + description: ISO timestamp of when the destination was created. + example: '2025-08-24T10:30:00Z' + type: string + enabled: + description: Whether this destination is currently enabled. + example: true + type: boolean + filter_rules: + $ref: '#/components/schemas/ObservabilityFilterRulesConfig' + id: + description: Stable public identifier for this destination. + example: 99999999-aaaa-bbbb-cccc-dddddddddddd + format: uuid + type: string + name: + description: Human-readable name for the destination. + example: Production Langfuse nullable: true - type: number - p99: - description: Minimum p99 throughput (tokens/sec) + type: string + privacy_mode: + description: When true, request/response bodies are not forwarded to this destination — only metadata. + example: false + type: boolean + sampling_rate: + description: Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + example: 1 format: double - nullable: true - type: number - type: object - PerRequestLimits: - description: Per-request token limits - example: - completion_tokens: 1000 - prompt_tokens: 1000 - nullable: true - properties: - completion_tokens: - description: Maximum completion tokens per request - example: 1000 - type: number - prompt_tokens: - description: Maximum prompt tokens per request - example: 1000 - type: number - required: - - prompt_tokens - - completion_tokens - type: object - PreferredMaxLatency: - anyOf: - - format: double - type: number - - $ref: '#/components/schemas/PercentileLatencyCutoffs' - - nullable: true - description: >- - Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. - example: 5 - PreferredMinThroughput: - anyOf: - - format: double type: number - - $ref: '#/components/schemas/PercentileThroughputCutoffs' - - nullable: true - description: >- - Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. - example: 100 - Preview_20250311_WebSearchServerTool: - description: Web search preview tool configuration (2025-03-11 version) - example: - type: web_search_preview_2025_03_11 - properties: - engine: - $ref: '#/components/schemas/WebSearchEngineEnum' - filters: - $ref: '#/components/schemas/WebSearchDomainFilter' - max_results: - description: >- - Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and Parallel engines; ignored with native provider search. - example: 5 - type: integer - search_context_size: - $ref: '#/components/schemas/SearchContextSizeEnum' type: enum: - - web_search_preview_2025_03_11 + - braintrust + type: string + updated_at: + description: ISO timestamp of when the destination was last updated. + example: '2025-08-24T15:45:00Z' + type: string + workspace_id: + description: ID of the workspace this destination belongs to. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid type: string - user_location: - $ref: '#/components/schemas/Preview_WebSearchUserLocation' required: + - id + - workspace_id + - name + - enabled + - privacy_mode + - sampling_rate + - api_key_hashes + - filter_rules + - created_at + - updated_at - type + - config type: object - Preview_WebSearchServerTool: - description: Web search preview tool configuration + ObservabilityClickhouseDestination: example: - type: web_search_preview + api_key_hashes: null + config: + database: analytics + host: https://clickhouse.example.com:8123 + password: '********' + table: OPENROUTER_TRACES + username: default + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production ClickHouse + privacy_mode: false + sampling_rate: 1 + type: clickhouse + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 properties: - engine: - $ref: '#/components/schemas/WebSearchEngineEnum' - filters: - $ref: '#/components/schemas/WebSearchDomainFilter' - max_results: + api_key_hashes: description: >- - Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and Parallel engines; ignored with native provider search. - example: 5 - type: integer - search_context_size: - $ref: '#/components/schemas/SearchContextSizeEnum' + Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + example: null + items: + type: string + nullable: true + type: array + config: + properties: + database: + minLength: 1 + type: string + headers: + additionalProperties: + type: string + description: Custom HTTP headers to include in requests to this destination. + type: object + host: + minLength: 1 + type: string + password: + minLength: 1 + type: string + table: + default: OPENROUTER_TRACES + type: string + username: + description: If you have not set a specific username in ClickHouse, simply type in 'default' below. + minLength: 1 + type: string + required: + - host + - database + - username + - password + type: object + created_at: + description: ISO timestamp of when the destination was created. + example: '2025-08-24T10:30:00Z' + type: string + enabled: + description: Whether this destination is currently enabled. + example: true + type: boolean + filter_rules: + $ref: '#/components/schemas/ObservabilityFilterRulesConfig' + id: + description: Stable public identifier for this destination. + example: 99999999-aaaa-bbbb-cccc-dddddddddddd + format: uuid + type: string + name: + description: Human-readable name for the destination. + example: Production Langfuse + nullable: true + type: string + privacy_mode: + description: When true, request/response bodies are not forwarded to this destination — only metadata. + example: false + type: boolean + sampling_rate: + description: Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + example: 1 + format: double + type: number type: enum: - - web_search_preview + - clickhouse + type: string + updated_at: + description: ISO timestamp of when the destination was last updated. + example: '2025-08-24T15:45:00Z' + type: string + workspace_id: + description: ID of the workspace this destination belongs to. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid type: string - user_location: - $ref: '#/components/schemas/Preview_WebSearchUserLocation' required: + - id + - workspace_id + - name + - enabled + - privacy_mode + - sampling_rate + - api_key_hashes + - filter_rules + - created_at + - updated_at - type + - config type: object - Preview_WebSearchUserLocation: + ObservabilityDatadogDestination: example: - city: San Francisco - country: USA - region: California - timezone: America/Los_Angeles - type: approximate - nullable: true + api_key_hashes: null + config: + apiKey: '************...AbCd' + mlApp: my-llm-app + url: https://api.us5.datadoghq.com + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production Datadog + privacy_mode: false + sampling_rate: 1 + type: datadog + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 properties: - city: - nullable: true - type: string - country: + api_key_hashes: + description: >- + Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + example: null + items: + type: string nullable: true + type: array + config: + properties: + apiKey: + description: 'Datadog API key must have LLM Observability permissions. Create at: ' + minLength: 1 + type: string + headers: + additionalProperties: + type: string + description: Custom HTTP headers to include in requests to this destination. + type: object + mlApp: + description: Name to identify your application in Datadog LLM Observability + minLength: 1 + type: string + url: + default: https://api.us5.datadoghq.com + description: >- + Datadog API URL for your region (e.g., https://api.datadoghq.com, https://api.us3.datadoghq.com, https://api.datadoghq.eu) + type: string + required: + - apiKey + - mlApp + type: object + created_at: + description: ISO timestamp of when the destination was created. + example: '2025-08-24T10:30:00Z' type: string - region: - nullable: true + enabled: + description: Whether this destination is currently enabled. + example: true + type: boolean + filter_rules: + $ref: '#/components/schemas/ObservabilityFilterRulesConfig' + id: + description: Stable public identifier for this destination. + example: 99999999-aaaa-bbbb-cccc-dddddddddddd + format: uuid type: string - timezone: + name: + description: Human-readable name for the destination. + example: Production Langfuse nullable: true type: string - type: - enum: - - approximate - type: string + privacy_mode: + description: When true, request/response bodies are not forwarded to this destination — only metadata. + example: false + type: boolean + sampling_rate: + description: Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + example: 1 + format: double + type: number + type: + enum: + - datadog + type: string + updated_at: + description: ISO timestamp of when the destination was last updated. + example: '2025-08-24T15:45:00Z' + type: string + workspace_id: + description: ID of the workspace this destination belongs to. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string required: + - id + - workspace_id + - name + - enabled + - privacy_mode + - sampling_rate + - api_key_hashes + - filter_rules + - created_at + - updated_at - type + - config type: object - ProviderName: - enum: - - AkashML - - AI21 - - AionLabs - - Alibaba - - Ambient - - Baidu - - Amazon Bedrock - - Amazon Nova - - Anthropic - - Arcee AI - - AtlasCloud - - Avian - - Azure - - BaseTen - - BytePlus - - Black Forest Labs - - Cerebras - - Chutes - - Cirrascale - - Clarifai - - Cloudflare - - Cohere - - Crusoe - - DeepInfra - - DeepSeek - - DekaLLM - - Featherless - - Fireworks - - Friendli - - GMICloud - - Google - - Google AI Studio - - Groq - - Hyperbolic - - Inception - - Inceptron - - InferenceNet - - Ionstream - - Infermatic - - Io Net - - Inflection - - Liquid - - Mara - - Mancer 2 - - Minimax - - ModelRun - - Mistral - - Modular - - Moonshot AI - - Morph - - NCompass - - Nebius - - NextBit - - Novita - - Nvidia - - OpenAI - - OpenInference - - Parasail - - Perplexity - - Phala - - Recraft - - Reka - - Relace - - SambaNova - - Seed - - SiliconFlow - - Sourceful - - StepFun - - Stealth - - StreamLake - - Switchpoint - - Together - - Upstage - - Venice - - WandB - - Xiaomi - - xAI - - Z.AI - - FakeProvider - example: OpenAI - type: string - x-speakeasy-unknown-values: allow - ProviderOverloadedResponse: - description: Provider Overloaded - Provider is temporarily overloaded + ObservabilityDestination: + discriminator: + mapping: + arize: '#/components/schemas/ObservabilityArizeDestination' + braintrust: '#/components/schemas/ObservabilityBraintrustDestination' + clickhouse: '#/components/schemas/ObservabilityClickhouseDestination' + datadog: '#/components/schemas/ObservabilityDatadogDestination' + grafana: '#/components/schemas/ObservabilityGrafanaDestination' + langfuse: '#/components/schemas/ObservabilityLangfuseDestination' + langsmith: '#/components/schemas/ObservabilityLangsmithDestination' + newrelic: '#/components/schemas/ObservabilityNewrelicDestination' + opik: '#/components/schemas/ObservabilityOpikDestination' + otel-collector: '#/components/schemas/ObservabilityOtelCollectorDestination' + posthog: '#/components/schemas/ObservabilityPosthogDestination' + ramp: '#/components/schemas/ObservabilityRampDestination' + s3: '#/components/schemas/ObservabilityS3Destination' + sentry: '#/components/schemas/ObservabilitySentryDestination' + snowflake: '#/components/schemas/ObservabilitySnowflakeDestination' + weave: '#/components/schemas/ObservabilityWeaveDestination' + webhook: '#/components/schemas/ObservabilityWebhookDestination' + propertyName: type example: - error: - code: 529 - message: Provider returned error + api_key_hashes: null + config: + baseUrl: https://us.cloud.langfuse.com + publicKey: pk-l...EfGh + secretKey: sk-l...AbCd + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production Langfuse + privacy_mode: false + sampling_rate: 1 + type: langfuse + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + oneOf: + - $ref: '#/components/schemas/ObservabilityArizeDestination' + - $ref: '#/components/schemas/ObservabilityBraintrustDestination' + - $ref: '#/components/schemas/ObservabilityClickhouseDestination' + - $ref: '#/components/schemas/ObservabilityDatadogDestination' + - $ref: '#/components/schemas/ObservabilityGrafanaDestination' + - $ref: '#/components/schemas/ObservabilityLangfuseDestination' + - $ref: '#/components/schemas/ObservabilityLangsmithDestination' + - $ref: '#/components/schemas/ObservabilityNewrelicDestination' + - $ref: '#/components/schemas/ObservabilityOpikDestination' + - $ref: '#/components/schemas/ObservabilityOtelCollectorDestination' + - $ref: '#/components/schemas/ObservabilityPosthogDestination' + - $ref: '#/components/schemas/ObservabilityRampDestination' + - $ref: '#/components/schemas/ObservabilityS3Destination' + - $ref: '#/components/schemas/ObservabilitySentryDestination' + - $ref: '#/components/schemas/ObservabilitySnowflakeDestination' + - $ref: '#/components/schemas/ObservabilityWeaveDestination' + - $ref: '#/components/schemas/ObservabilityWebhookDestination' + ObservabilityFilterRulesConfig: + description: Optional structured filter rules controlling which events are forwarded. + example: null + nullable: true properties: - error: - $ref: '#/components/schemas/ProviderOverloadedResponseErrorData' - user_id: - nullable: true - type: string + enabled: + default: true + type: boolean + groups: + items: + properties: + logic: + default: and + enum: + - and + - or + type: string + x-speakeasy-unknown-values: allow + rules: + items: + properties: + field: + enum: + - model + - provider + - session_id + - user_id + - api_key_name + - finish_reason + - input + - output + - total_cost + - total_tokens + - prompt_tokens + - completion_tokens + type: string + x-speakeasy-unknown-values: allow + operator: + enum: + - equals + - not_equals + - contains + - not_contains + - regex + - starts_with + - ends_with + - gt + - lt + - gte + - lte + - exists + - not_exists + type: string + x-speakeasy-unknown-values: allow + value: + anyOf: + - type: string + - type: number + required: + - field + - operator + type: object + type: array + required: + - rules + type: object + type: array required: - - error + - groups type: object - ProviderOverloadedResponseErrorData: - description: Error data for ProviderOverloadedResponse + ObservabilityGrafanaDestination: example: - code: 529 - message: Provider returned error + api_key_hashes: null + config: + apiKey: glc_...AbCd + baseUrl: https://otlp-gateway-prod-us-west-0.grafana.net + instanceId: '123456' + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production Grafana + privacy_mode: false + sampling_rate: 1 + type: grafana + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 properties: - code: - type: integer - message: - type: string - metadata: - additionalProperties: - nullable: true + api_key_hashes: + description: >- + Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + example: null + items: + type: string nullable: true + type: array + config: + properties: + apiKey: + minLength: 1 + type: string + baseUrl: + default: https://otlp-gateway-prod-us-west-0.grafana.net + type: string + headers: + additionalProperties: + type: string + description: Custom HTTP headers to include in requests to this destination. + type: object + instanceId: + minLength: 1 + type: string + required: + - apiKey + - instanceId type: object + created_at: + description: ISO timestamp of when the destination was created. + example: '2025-08-24T10:30:00Z' + type: string + enabled: + description: Whether this destination is currently enabled. + example: true + type: boolean + filter_rules: + $ref: '#/components/schemas/ObservabilityFilterRulesConfig' + id: + description: Stable public identifier for this destination. + example: 99999999-aaaa-bbbb-cccc-dddddddddddd + format: uuid + type: string + name: + description: Human-readable name for the destination. + example: Production Langfuse + nullable: true + type: string + privacy_mode: + description: When true, request/response bodies are not forwarded to this destination — only metadata. + example: false + type: boolean + sampling_rate: + description: Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + example: 1 + format: double + type: number + type: + enum: + - grafana + type: string + updated_at: + description: ISO timestamp of when the destination was last updated. + example: '2025-08-24T15:45:00Z' + type: string + workspace_id: + description: ID of the workspace this destination belongs to. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string required: - - code - - message + - id + - workspace_id + - name + - enabled + - privacy_mode + - sampling_rate + - api_key_hashes + - filter_rules + - created_at + - updated_at + - type + - config type: object - ProviderPreferences: - additionalProperties: false - description: When multiple model providers are available, optionally indicate your routing preference. + ObservabilityLangfuseDestination: example: - allow_fallbacks: true - nullable: true + api_key_hashes: null + config: + baseUrl: https://us.cloud.langfuse.com + publicKey: pk-l...EfGh + secretKey: sk-l...AbCd + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production Langfuse + privacy_mode: false + sampling_rate: 1 + type: langfuse + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 properties: - allow_fallbacks: - description: > - Whether to allow backup providers to serve requests - - - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. - - - false: use only the primary/custom provider, and return the upstream error if it's unavailable. - - nullable: true - type: boolean - data_collection: + api_key_hashes: description: >- - Data collection setting. If no available model provider meets the requirement, your request will return an error. - - - allow: (default) allow providers which store user data non-transiently and may train on it - - - - deny: use only providers which do not collect user data. - enum: - - deny - - allow - - null - example: allow + Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + example: null + items: + type: string nullable: true + type: array + config: + properties: + baseUrl: + default: https://us.cloud.langfuse.com + type: string + headers: + additionalProperties: + type: string + description: Custom HTTP headers to include in requests to this destination. + type: object + publicKey: + minLength: 1 + type: string + secretKey: + minLength: 1 + type: string + required: + - secretKey + - publicKey + type: object + created_at: + description: ISO timestamp of when the destination was created. + example: '2025-08-24T10:30:00Z' type: string - x-speakeasy-unknown-values: allow - enforce_distillable_text: - description: >- - Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. + enabled: + description: Whether this destination is currently enabled. example: true + type: boolean + filter_rules: + $ref: '#/components/schemas/ObservabilityFilterRulesConfig' + id: + description: Stable public identifier for this destination. + example: 99999999-aaaa-bbbb-cccc-dddddddddddd + format: uuid + type: string + name: + description: Human-readable name for the destination. + example: Production Langfuse nullable: true + type: string + privacy_mode: + description: When true, request/response bodies are not forwarded to this destination — only metadata. + example: false type: boolean - ignore: + sampling_rate: + description: Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + example: 1 + format: double + type: number + type: + enum: + - langfuse + type: string + updated_at: + description: ISO timestamp of when the destination was last updated. + example: '2025-08-24T15:45:00Z' + type: string + workspace_id: + description: ID of the workspace this destination belongs to. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + required: + - id + - workspace_id + - name + - enabled + - privacy_mode + - sampling_rate + - api_key_hashes + - filter_rules + - created_at + - updated_at + - type + - config + type: object + ObservabilityLangsmithDestination: + example: + api_key_hashes: null + config: + apiKey: lsv2_...AbCd + endpoint: https://api.smith.langchain.com + project: main + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production LangSmith + privacy_mode: false + sampling_rate: 1 + type: langsmith + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + properties: + api_key_hashes: description: >- - List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. - example: - - openai - - anthropic + Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + example: null items: - anyOf: - - $ref: '#/components/schemas/ProviderName' - - type: string + type: string nullable: true type: array - max_price: - description: >- - The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + config: properties: - audio: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: Price per audio unit - completion: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: Price per million completion tokens - image: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: Price per image - prompt: - $ref: '#/components/schemas/BigNumberUnion' - request: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: Price per request + apiKey: + minLength: 1 + type: string + endpoint: + default: https://api.smith.langchain.com + type: string + headers: + additionalProperties: + type: string + description: Custom HTTP headers to include in requests to this destination. + type: object + project: + default: main + description: The name for this project, such as pr-openrouter-demo. Defaults to "main" if not set. + minLength: 1 + type: string + workspaceId: + description: Required for org-scoped API keys. Find this in your LangSmith workspace settings. + type: string + required: + - apiKey type: object - only: - description: >- - List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. - example: - - openai - - anthropic - items: - anyOf: - - $ref: '#/components/schemas/ProviderName' - - type: string + created_at: + description: ISO timestamp of when the destination was created. + example: '2025-08-24T10:30:00Z' + type: string + enabled: + description: Whether this destination is currently enabled. + example: true + type: boolean + filter_rules: + $ref: '#/components/schemas/ObservabilityFilterRulesConfig' + id: + description: Stable public identifier for this destination. + example: 99999999-aaaa-bbbb-cccc-dddddddddddd + format: uuid + type: string + name: + description: Human-readable name for the destination. + example: Production Langfuse nullable: true - type: array - order: + type: string + privacy_mode: + description: When true, request/response bodies are not forwarded to this destination — only metadata. + example: false + type: boolean + sampling_rate: + description: Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + example: 1 + format: double + type: number + type: + enum: + - langsmith + type: string + updated_at: + description: ISO timestamp of when the destination was last updated. + example: '2025-08-24T15:45:00Z' + type: string + workspace_id: + description: ID of the workspace this destination belongs to. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + required: + - id + - workspace_id + - name + - enabled + - privacy_mode + - sampling_rate + - api_key_hashes + - filter_rules + - created_at + - updated_at + - type + - config + type: object + ObservabilityNewrelicDestination: + example: + api_key_hashes: null + config: + licenseKey: '****...AbCd' + region: US + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production New Relic + privacy_mode: false + sampling_rate: 1 + type: newrelic + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + properties: + api_key_hashes: description: >- - An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. - example: - - openai - - anthropic - items: - anyOf: - - $ref: '#/components/schemas/ProviderName' - - type: string - nullable: true - type: array - preferred_max_latency: - $ref: '#/components/schemas/PreferredMaxLatency' - preferred_min_throughput: - $ref: '#/components/schemas/PreferredMinThroughput' - quantizations: - description: A list of quantization levels to filter the provider by. + Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + example: null items: - $ref: '#/components/schemas/Quantization' + type: string nullable: true type: array - require_parameters: - description: >- - Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. - nullable: true - type: boolean - sort: - anyOf: - - $ref: '#/components/schemas/ProviderSort' - - $ref: '#/components/schemas/ProviderSortConfig' - - nullable: true - description: >- - The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. - example: price - zdr: - description: >- - Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. + config: + properties: + headers: + additionalProperties: + type: string + description: Custom HTTP headers to include in requests to this destination. + type: object + licenseKey: + minLength: 1 + type: string + region: + default: us + enum: + - us + - eu + type: string + x-speakeasy-unknown-values: allow + required: + - licenseKey + type: object + created_at: + description: ISO timestamp of when the destination was created. + example: '2025-08-24T10:30:00Z' + type: string + enabled: + description: Whether this destination is currently enabled. example: true + type: boolean + filter_rules: + $ref: '#/components/schemas/ObservabilityFilterRulesConfig' + id: + description: Stable public identifier for this destination. + example: 99999999-aaaa-bbbb-cccc-dddddddddddd + format: uuid + type: string + name: + description: Human-readable name for the destination. + example: Production Langfuse nullable: true + type: string + privacy_mode: + description: When true, request/response bodies are not forwarded to this destination — only metadata. + example: false type: boolean + sampling_rate: + description: Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + example: 1 + format: double + type: number + type: + enum: + - newrelic + type: string + updated_at: + description: ISO timestamp of when the destination was last updated. + example: '2025-08-24T15:45:00Z' + type: string + workspace_id: + description: ID of the workspace this destination belongs to. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + required: + - id + - workspace_id + - name + - enabled + - privacy_mode + - sampling_rate + - api_key_hashes + - filter_rules + - created_at + - updated_at + - type + - config type: object - ProviderResponse: - description: Details of a provider response for a generation attempt + ObservabilityOpikDestination: example: - endpoint_id: ep_abc123 - id: chatcmpl-abc123 - is_byok: false - latency: 1200 - model_permaslug: openai/gpt-4 - provider_name: OpenAI - status: 200 + api_key_hashes: null + config: + apiKey: '****...AbCd' + projectName: openrouter-prod + workspace: my-workspace + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production Opik + privacy_mode: false + sampling_rate: 1 + type: opik + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 properties: - endpoint_id: - description: Internal endpoint identifier - example: ep_abc123 + api_key_hashes: + description: >- + Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + example: null + items: + type: string + nullable: true + type: array + config: + properties: + apiKey: + minLength: 1 + type: string + headers: + additionalProperties: + type: string + description: Custom HTTP headers to include in requests to this destination. + type: object + projectName: + minLength: 1 + type: string + workspace: + minLength: 1 + type: string + required: + - apiKey + - workspace + - projectName + type: object + created_at: + description: ISO timestamp of when the destination was created. + example: '2025-08-24T10:30:00Z' type: string + enabled: + description: Whether this destination is currently enabled. + example: true + type: boolean + filter_rules: + $ref: '#/components/schemas/ObservabilityFilterRulesConfig' id: - description: Upstream provider response identifier - example: chatcmpl-abc123 + description: Stable public identifier for this destination. + example: 99999999-aaaa-bbbb-cccc-dddddddddddd + format: uuid type: string - is_byok: - description: Whether the request used a bring-your-own-key + name: + description: Human-readable name for the destination. + example: Production Langfuse + nullable: true + type: string + privacy_mode: + description: When true, request/response bodies are not forwarded to this destination — only metadata. example: false type: boolean - latency: - description: Response latency in milliseconds - example: 1200 - type: number - model_permaslug: - description: Canonical model slug - example: openai/gpt-4 - type: string - provider_name: - description: Name of the provider - enum: - - AnyScale - - Atoma - - Cent-ML - - CrofAI - - Enfer - - GoPomelo - - HuggingFace - - Hyperbolic 2 - - InoCloud - - Kluster - - Lambda - - Lepton - - Lynn 2 - - Lynn - - Mancer - - Meta - - Modal - - Nineteen - - OctoAI - - Recursal - - Reflection - - Replicate - - SambaNova 2 - - SF Compute - - Targon - - Together 2 - - Ubicloud - - 01.AI - - AkashML - - AI21 - - AionLabs - - Alibaba - - Ambient - - Baidu - - Amazon Bedrock - - Amazon Nova - - Anthropic - - Arcee AI - - AtlasCloud - - Avian - - Azure - - BaseTen - - BytePlus - - Black Forest Labs - - Cerebras - - Chutes - - Cirrascale - - Clarifai - - Cloudflare - - Cohere - - Crusoe - - DeepInfra - - DeepSeek - - DekaLLM - - Featherless - - Fireworks - - Friendli - - GMICloud - - Google - - Google AI Studio - - Groq - - Hyperbolic - - Inception - - Inceptron - - InferenceNet - - Ionstream - - Infermatic - - Io Net - - Inflection - - Liquid - - Mara - - Mancer 2 - - Minimax - - ModelRun - - Mistral - - Modular - - Moonshot AI - - Morph - - NCompass - - Nebius - - NextBit - - Novita - - Nvidia - - OpenAI - - OpenInference - - Parasail - - Perplexity - - Phala - - Recraft - - Reka - - Relace - - SambaNova - - Seed - - SiliconFlow - - Sourceful - - StepFun - - Stealth - - StreamLake - - Switchpoint - - Together - - Upstage - - Venice - - WandB - - Xiaomi - - xAI - - Z.AI - - FakeProvider - example: OpenAI - type: string - x-speakeasy-unknown-values: allow - status: - description: HTTP status code from the provider - example: 200 - nullable: true + sampling_rate: + description: Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + example: 1 + format: double type: number - required: - - status - type: object - ProviderSort: - description: The provider sorting strategy (price, throughput, latency) - enum: - - price - - throughput - - latency - - exacto - example: price - type: string - x-speakeasy-unknown-values: allow - ProviderSortConfig: - description: The provider sorting strategy (price, throughput, latency) - example: - by: price - partition: model - properties: - by: - description: The provider sorting strategy (price, throughput, latency) + type: enum: - - price - - throughput - - latency - - exacto - - null - example: price - nullable: true + - opik type: string - x-speakeasy-unknown-values: allow - partition: - description: >- - Partitioning strategy for sorting: "model" (default) groups endpoints by model before sorting (fallback models remain fallbacks), "none" sorts all endpoints together regardless of model. - enum: - - model - - none - - null - example: model - nullable: true + updated_at: + description: ISO timestamp of when the destination was last updated. + example: '2025-08-24T15:45:00Z' type: string - x-speakeasy-unknown-values: allow + workspace_id: + description: ID of the workspace this destination belongs to. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + required: + - id + - workspace_id + - name + - enabled + - privacy_mode + - sampling_rate + - api_key_hashes + - filter_rules + - created_at + - updated_at + - type + - config type: object - PublicEndpoint: - description: Information about a specific model endpoint + ObservabilityOtelCollectorDestination: example: - context_length: 8192 - latency_last_30m: - p50: 0.25 - p75: 0.35 - p90: 0.48 - p99: 0.85 - max_completion_tokens: 4096 - max_prompt_tokens: 8192 - model_id: openai/gpt-4 - model_name: GPT-4 - name: 'OpenAI: GPT-4' - pricing: - completion: '0.00006' - image: '0' - prompt: '0.00003' - request: '0' - provider_name: OpenAI - quantization: fp16 - status: 0 - supported_parameters: - - temperature - - top_p - - max_tokens - supports_implicit_caching: true - tag: openai - throughput_last_30m: - p50: 45.2 - p75: 38.5 - p90: 28.3 - p99: 15.1 - uptime_last_1d: 99.8 - uptime_last_30m: 99.5 - uptime_last_5m: 100 + api_key_hashes: null + config: + endpoint: https://otel.example.com:4318 + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production OTel Collector + privacy_mode: false + sampling_rate: 1 + type: otel-collector + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 properties: - context_length: - type: integer - latency_last_30m: - $ref: '#/components/schemas/PercentileStats' - max_completion_tokens: - nullable: true - type: integer - max_prompt_tokens: + api_key_hashes: + description: >- + Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + example: null + items: + type: string nullable: true - type: integer - model_id: - description: The unique identifier for the model (permaslug) - example: openai/gpt-4 + type: array + config: + properties: + endpoint: + type: string + headers: + additionalProperties: + type: string + description: >- + Custom HTTP headers as a JSON object. For Axiom, use {"Authorization": "Bearer xaat-xxx", "X-Axiom-Dataset": "your-dataset"} + type: object + required: + - endpoint + type: object + created_at: + description: ISO timestamp of when the destination was created. + example: '2025-08-24T10:30:00Z' type: string - model_name: + enabled: + description: Whether this destination is currently enabled. + example: true + type: boolean + filter_rules: + $ref: '#/components/schemas/ObservabilityFilterRulesConfig' + id: + description: Stable public identifier for this destination. + example: 99999999-aaaa-bbbb-cccc-dddddddddddd + format: uuid type: string name: + description: Human-readable name for the destination. + example: Production Langfuse + nullable: true type: string - pricing: - properties: - audio: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - audio_output: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - completion: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - discount: - type: number - image: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - image_output: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - image_token: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - input_audio_cache: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - input_cache_read: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - input_cache_write: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - internal_reasoning: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - prompt: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - request: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - web_search: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - required: - - prompt - - completion - type: object - provider_name: - $ref: '#/components/schemas/ProviderName' - quantization: - allOf: - - $ref: '#/components/schemas/Quantization' - - nullable: true - status: - $ref: '#/components/schemas/EndpointStatus' - supported_parameters: + privacy_mode: + description: When true, request/response bodies are not forwarded to this destination — only metadata. + example: false + type: boolean + sampling_rate: + description: Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + example: 1 + format: double + type: number + type: + enum: + - otel-collector + type: string + updated_at: + description: ISO timestamp of when the destination was last updated. + example: '2025-08-24T15:45:00Z' + type: string + workspace_id: + description: ID of the workspace this destination belongs to. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + required: + - id + - workspace_id + - name + - enabled + - privacy_mode + - sampling_rate + - api_key_hashes + - filter_rules + - created_at + - updated_at + - type + - config + type: object + ObservabilityPosthogDestination: + example: + api_key_hashes: null + config: + apiKey: phc_...AbCd + endpoint: https://us.i.posthog.com + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production PostHog + privacy_mode: false + sampling_rate: 1 + type: posthog + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + properties: + api_key_hashes: + description: >- + Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + example: null items: - $ref: '#/components/schemas/Parameter' + type: string + nullable: true type: array - supports_implicit_caching: + config: + properties: + apiKey: + minLength: 1 + type: string + endpoint: + default: https://us.i.posthog.com + type: string + headers: + additionalProperties: + type: string + description: Custom HTTP headers to include in requests to this destination. + type: object + required: + - apiKey + type: object + created_at: + description: ISO timestamp of when the destination was created. + example: '2025-08-24T10:30:00Z' + type: string + enabled: + description: Whether this destination is currently enabled. + example: true type: boolean - tag: + filter_rules: + $ref: '#/components/schemas/ObservabilityFilterRulesConfig' + id: + description: Stable public identifier for this destination. + example: 99999999-aaaa-bbbb-cccc-dddddddddddd + format: uuid type: string - throughput_last_30m: - allOf: - - $ref: '#/components/schemas/PercentileStats' - - description: >- - Throughput percentiles in tokens per second over the last 30 minutes. Throughput measures output token generation speed. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests. - uptime_last_1d: - description: >- - Uptime percentage over the last 1 day, calculated as successful requests / (successful + error requests) * 100. Rate-limited requests are excluded. Returns null if insufficient data. - format: double + name: + description: Human-readable name for the destination. + example: Production Langfuse nullable: true - type: number - uptime_last_30m: + type: string + privacy_mode: + description: When true, request/response bodies are not forwarded to this destination — only metadata. + example: false + type: boolean + sampling_rate: + description: Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + example: 1 format: double - nullable: true type: number - uptime_last_5m: + type: + enum: + - posthog + type: string + updated_at: + description: ISO timestamp of when the destination was last updated. + example: '2025-08-24T15:45:00Z' + type: string + workspace_id: + description: ID of the workspace this destination belongs to. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + required: + - id + - workspace_id + - name + - enabled + - privacy_mode + - sampling_rate + - api_key_hashes + - filter_rules + - created_at + - updated_at + - type + - config + type: object + ObservabilityRampDestination: + example: + api_key_hashes: null + config: + apiKey: rmp_...AbCd + baseUrl: https://api.ramp.com/developer/v1/ai-usage/openrouter + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production Ramp + privacy_mode: false + sampling_rate: 1 + type: ramp + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + properties: + api_key_hashes: description: >- - Uptime percentage over the last 5 minutes, calculated as successful requests / (successful + error requests) * 100. Rate-limited requests are excluded. Returns null if insufficient data. - format: double + Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + example: null + items: + type: string + nullable: true + type: array + config: + properties: + apiKey: + description: Generate this in your Ramp integration settings. + minLength: 1 + type: string + baseUrl: + default: https://api.ramp.com/developer/v1/ai-usage/openrouter + type: string + headers: + additionalProperties: + type: string + description: Custom HTTP headers to include in requests to Ramp. + type: object + required: + - apiKey + type: object + created_at: + description: ISO timestamp of when the destination was created. + example: '2025-08-24T10:30:00Z' + type: string + enabled: + description: Whether this destination is currently enabled. + example: true + type: boolean + filter_rules: + $ref: '#/components/schemas/ObservabilityFilterRulesConfig' + id: + description: Stable public identifier for this destination. + example: 99999999-aaaa-bbbb-cccc-dddddddddddd + format: uuid + type: string + name: + description: Human-readable name for the destination. + example: Production Langfuse nullable: true + type: string + privacy_mode: + description: When true, request/response bodies are not forwarded to this destination — only metadata. + example: false + type: boolean + sampling_rate: + description: Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + example: 1 + format: double type: number + type: + enum: + - ramp + type: string + updated_at: + description: ISO timestamp of when the destination was last updated. + example: '2025-08-24T15:45:00Z' + type: string + workspace_id: + description: ID of the workspace this destination belongs to. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string required: + - id + - workspace_id - name - - model_id - - model_name - - context_length - - pricing - - provider_name - - tag - - quantization - - max_completion_tokens - - max_prompt_tokens - - supported_parameters - - uptime_last_30m - - uptime_last_5m - - uptime_last_1d - - supports_implicit_caching - - latency_last_30m - - throughput_last_30m + - enabled + - privacy_mode + - sampling_rate + - api_key_hashes + - filter_rules + - created_at + - updated_at + - type + - config type: object - PublicPricing: - description: Pricing information for the model + ObservabilityS3Destination: example: - completion: '0.00006' - image: '0' - prompt: '0.00003' - request: '0' + api_key_hashes: null + config: + accessKeyId: AKIA...AbCd + bucketName: openrouter-traces + secretAccessKey: '****...EfGh' + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production S3 + privacy_mode: false + sampling_rate: 1 + type: s3 + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 properties: - audio: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - audio_output: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - completion: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - discount: - type: number - image: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - image_output: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - image_token: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - input_audio_cache: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - input_cache_read: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - input_cache_write: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - internal_reasoning: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - prompt: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - request: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - web_search: - allOf: - - $ref: '#/components/schemas/BigNumberUnion' - - description: A number or string value representing a large number - required: - - prompt - - completion - type: object - Quantization: - enum: - - int4 - - int8 - - fp4 - - fp6 - - fp8 - - fp16 - - bf16 - - fp32 - - unknown - example: fp16 - type: string - x-speakeasy-unknown-values: allow - ReasoningConfig: - allOf: - - $ref: '#/components/schemas/BaseReasoningConfig' - - nullable: true + api_key_hashes: + description: >- + Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + example: null + items: + type: string + nullable: true + type: array + config: properties: - enabled: - nullable: true - type: boolean - max_tokens: - nullable: true - type: integer - type: object - description: Configuration for reasoning mode in the response - example: - enabled: true - summary: auto - ReasoningDeltaEvent: - allOf: - - $ref: '#/components/schemas/BaseReasoningDeltaEvent' - - properties: {} + accessKeyId: + minLength: 1 + type: string + bucketName: + minLength: 1 + type: string + endpoint: + description: >- + Only for S3-compatible services like Cloudflare R2 (https://account-id.r2.cloudflarestorage.com) or MinIO. Leave blank for standard AWS S3. + format: uri + type: string + headers: + additionalProperties: + type: string + description: Custom HTTP headers to include in requests to this destination. + type: object + pathTemplate: + default: '{prefix}/{date}' + description: >- + Template for S3 object path. The filename ({traceId}-{timestamp}.json) is automatically appended. Available variables: {prefix}, {date}, {year}, {month}, {day}, {apiKeyName} + type: string + prefix: + default: openrouter-traces + type: string + region: + type: string + secretAccessKey: + minLength: 1 + type: string + sessionToken: + type: string + required: + - bucketName + - accessKeyId + - secretAccessKey type: object - description: Event emitted when reasoning text delta is streamed - example: - content_index: 0 - delta: First, we need - item_id: item-1 - output_index: 0 - sequence_number: 4 - type: response.reasoning_text.delta - ReasoningDetailEncrypted: - description: Reasoning detail encrypted schema - example: - data: encrypted data - type: reasoning.encrypted - properties: - data: + created_at: + description: ISO timestamp of when the destination was created. + example: '2025-08-24T10:30:00Z' type: string - format: - $ref: '#/components/schemas/ReasoningFormat' + enabled: + description: Whether this destination is currently enabled. + example: true + type: boolean + filter_rules: + $ref: '#/components/schemas/ObservabilityFilterRulesConfig' id: + description: Stable public identifier for this destination. + example: 99999999-aaaa-bbbb-cccc-dddddddddddd + format: uuid + type: string + name: + description: Human-readable name for the destination. + example: Production Langfuse nullable: true type: string - index: - type: integer + privacy_mode: + description: When true, request/response bodies are not forwarded to this destination — only metadata. + example: false + type: boolean + sampling_rate: + description: Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + example: 1 + format: double + type: number type: enum: - - reasoning.encrypted + - s3 + type: string + updated_at: + description: ISO timestamp of when the destination was last updated. + example: '2025-08-24T15:45:00Z' + type: string + workspace_id: + description: ID of the workspace this destination belongs to. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid type: string required: + - id + - workspace_id + - name + - enabled + - privacy_mode + - sampling_rate + - api_key_hashes + - filter_rules + - created_at + - updated_at - type - - data + - config type: object - ReasoningDetailSummary: - description: Reasoning detail summary schema + ObservabilitySentryDestination: example: - summary: The model analyzed the problem by first identifying key constraints, then evaluating possible solutions... - type: reasoning.summary + api_key_hashes: null + config: + otlpEndpoint: https://o0.ingest.sentry.io/api/0/otlp + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production Sentry + privacy_mode: false + sampling_rate: 1 + type: sentry + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 properties: - format: - $ref: '#/components/schemas/ReasoningFormat' - id: + api_key_hashes: + description: >- + Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + example: null + items: + type: string nullable: true + type: array + config: + properties: + dsn: + minLength: 1 + pattern: ^https:\/\/([^:@]+)(?::[^@]*)?@([^/]+)(?:\/[^/]+)*\/(\d+)\/?$ + type: string + headers: + additionalProperties: + type: string + description: Custom HTTP headers to include in requests to this destination. + type: object + otlpEndpoint: + type: string + required: + - otlpEndpoint + - dsn + type: object + created_at: + description: ISO timestamp of when the destination was created. + example: '2025-08-24T10:30:00Z' type: string - index: - type: integer - summary: + enabled: + description: Whether this destination is currently enabled. + example: true + type: boolean + filter_rules: + $ref: '#/components/schemas/ObservabilityFilterRulesConfig' + id: + description: Stable public identifier for this destination. + example: 99999999-aaaa-bbbb-cccc-dddddddddddd + format: uuid + type: string + name: + description: Human-readable name for the destination. + example: Production Langfuse + nullable: true type: string + privacy_mode: + description: When true, request/response bodies are not forwarded to this destination — only metadata. + example: false + type: boolean + sampling_rate: + description: Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + example: 1 + format: double + type: number type: enum: - - reasoning.summary + - sentry + type: string + updated_at: + description: ISO timestamp of when the destination was last updated. + example: '2025-08-24T15:45:00Z' + type: string + workspace_id: + description: ID of the workspace this destination belongs to. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid type: string required: + - id + - workspace_id + - name + - enabled + - privacy_mode + - sampling_rate + - api_key_hashes + - filter_rules + - created_at + - updated_at - type - - summary + - config type: object - ReasoningDetailText: - description: Reasoning detail text schema + ObservabilitySnowflakeDestination: example: - signature: signature - text: The model analyzed the problem by first identifying key constraints, then evaluating possible solutions... - type: reasoning.text + api_key_hashes: null + config: + account: xy12345.us-east-1 + token: '****...AbCd' + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production Snowflake + privacy_mode: false + sampling_rate: 1 + type: snowflake + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 properties: - format: - $ref: '#/components/schemas/ReasoningFormat' - id: + api_key_hashes: + description: >- + Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + example: null + items: + type: string nullable: true + type: array + config: + properties: + account: + minLength: 1 + type: string + database: + default: SNOWFLAKE_LEARNING_DB + type: string + headers: + additionalProperties: + type: string + description: Custom HTTP headers to include in requests to this destination. + type: object + schema: + default: PUBLIC + type: string + table: + default: OPENROUTER_TRACES + type: string + token: + minLength: 1 + type: string + warehouse: + default: COMPUTE_WH + type: string + required: + - account + - token + type: object + created_at: + description: ISO timestamp of when the destination was created. + example: '2025-08-24T10:30:00Z' type: string - index: - type: integer - signature: - nullable: true + enabled: + description: Whether this destination is currently enabled. + example: true + type: boolean + filter_rules: + $ref: '#/components/schemas/ObservabilityFilterRulesConfig' + id: + description: Stable public identifier for this destination. + example: 99999999-aaaa-bbbb-cccc-dddddddddddd + format: uuid type: string - text: + name: + description: Human-readable name for the destination. + example: Production Langfuse nullable: true type: string + privacy_mode: + description: When true, request/response bodies are not forwarded to this destination — only metadata. + example: false + type: boolean + sampling_rate: + description: Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + example: 1 + format: double + type: number type: enum: - - reasoning.text + - snowflake + type: string + updated_at: + description: ISO timestamp of when the destination was last updated. + example: '2025-08-24T15:45:00Z' + type: string + workspace_id: + description: ID of the workspace this destination belongs to. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid type: string required: + - id + - workspace_id + - name + - enabled + - privacy_mode + - sampling_rate + - api_key_hashes + - filter_rules + - created_at + - updated_at - type + - config type: object - ReasoningDetailUnion: - description: Reasoning detail union schema - discriminator: - mapping: - reasoning.encrypted: '#/components/schemas/ReasoningDetailEncrypted' - reasoning.summary: '#/components/schemas/ReasoningDetailSummary' - reasoning.text: '#/components/schemas/ReasoningDetailText' - propertyName: type - example: - summary: The model analyzed the problem by first identifying key constraints, then evaluating possible solutions... - type: reasoning.summary - oneOf: - - $ref: '#/components/schemas/ReasoningDetailSummary' - - $ref: '#/components/schemas/ReasoningDetailEncrypted' - - $ref: '#/components/schemas/ReasoningDetailText' - ReasoningDoneEvent: - allOf: - - $ref: '#/components/schemas/BaseReasoningDoneEvent' - - properties: {} - type: object - description: Event emitted when reasoning text streaming is complete + ObservabilityWeaveDestination: example: - content_index: 0 - item_id: item-1 - output_index: 0 - sequence_number: 6 - text: First, we need to identify the key components and then combine them logically. - type: response.reasoning_text.done - ReasoningEffort: - enum: - - xhigh - - high - - medium - - low - - minimal - - none - - null - example: medium - nullable: true - type: string - x-speakeasy-unknown-values: allow - ReasoningFormat: - enum: - - unknown - - openai-responses-v1 - - azure-openai-responses-v1 - - xai-responses-v1 - - anthropic-claude-v1 - - google-gemini-v1 - - null - example: unknown - nullable: true - type: string - x-speakeasy-unknown-values: allow - ReasoningItem: - allOf: - - $ref: '#/components/schemas/OutputItemReasoning' - - properties: - content: - items: - $ref: '#/components/schemas/ReasoningTextContent' - nullable: true - type: array - format: - $ref: '#/components/schemas/ReasoningFormat' - signature: - nullable: true + api_key_hashes: null + config: + apiKey: '****...AbCd' + baseUrl: https://trace.wandb.ai + entity: my-team + project: openrouter-prod + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production Weave + privacy_mode: false + sampling_rate: 1 + type: weave + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + properties: + api_key_hashes: + description: >- + Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + example: null + items: + type: string + nullable: true + type: array + config: + properties: + apiKey: + minLength: 1 type: string + baseUrl: + default: https://trace.wandb.ai + type: string + entity: + minLength: 1 + type: string + headers: + additionalProperties: + type: string + description: Custom HTTP headers to include in requests to this destination. + type: object + project: + minLength: 1 + type: string + required: + - apiKey + - entity + - project type: object - description: Reasoning output item with signature and format extensions - example: - id: reasoning-abc123 - summary: - - text: Step by step analysis - type: summary_text - type: reasoning - ReasoningSummaryPartAddedEvent: - allOf: - - $ref: '#/components/schemas/BaseReasoningSummaryPartAddedEvent' - - properties: {} - type: object - description: Event emitted when a reasoning summary part is added - example: - item_id: item-1 - output_index: 0 - part: - text: '' - type: summary_text - sequence_number: 3 - summary_index: 0 - type: response.reasoning_summary_part.added - ReasoningSummaryPartDoneEvent: - allOf: - - $ref: '#/components/schemas/BaseReasoningSummaryPartDoneEvent' - - properties: {} - type: object - description: Event emitted when a reasoning summary part is complete - example: - item_id: item-1 - output_index: 0 - part: - text: Analyzing the problem step by step to find the optimal solution. - type: summary_text - sequence_number: 7 - summary_index: 0 - type: response.reasoning_summary_part.done - ReasoningSummaryText: - example: - text: Analyzed the problem using first principles - type: summary_text - properties: - text: + created_at: + description: ISO timestamp of when the destination was created. + example: '2025-08-24T10:30:00Z' + type: string + enabled: + description: Whether this destination is currently enabled. + example: true + type: boolean + filter_rules: + $ref: '#/components/schemas/ObservabilityFilterRulesConfig' + id: + description: Stable public identifier for this destination. + example: 99999999-aaaa-bbbb-cccc-dddddddddddd + format: uuid + type: string + name: + description: Human-readable name for the destination. + example: Production Langfuse + nullable: true type: string + privacy_mode: + description: When true, request/response bodies are not forwarded to this destination — only metadata. + example: false + type: boolean + sampling_rate: + description: Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + example: 1 + format: double + type: number type: enum: - - summary_text + - weave + type: string + updated_at: + description: ISO timestamp of when the destination was last updated. + example: '2025-08-24T15:45:00Z' + type: string + workspace_id: + description: ID of the workspace this destination belongs to. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid type: string required: + - id + - workspace_id + - name + - enabled + - privacy_mode + - sampling_rate + - api_key_hashes + - filter_rules + - created_at + - updated_at - type - - text + - config type: object - ReasoningSummaryTextDeltaEvent: - allOf: - - $ref: '#/components/schemas/BaseReasoningSummaryTextDeltaEvent' - - properties: {} - type: object - description: Event emitted when reasoning summary text delta is streamed + ObservabilityWebhookDestination: example: - delta: Analyzing - item_id: item-1 - output_index: 0 - sequence_number: 4 - summary_index: 0 - type: response.reasoning_summary_text.delta - ReasoningSummaryTextDoneEvent: - allOf: - - $ref: '#/components/schemas/BaseReasoningSummaryTextDoneEvent' - - properties: {} - type: object - description: Event emitted when reasoning summary text streaming is complete - example: - item_id: item-1 - output_index: 0 - sequence_number: 6 - summary_index: 0 - text: Analyzing the problem step by step to find the optimal solution. - type: response.reasoning_summary_text.done - ReasoningSummaryVerbosity: - enum: - - auto - - concise - - detailed - - null - example: auto - nullable: true - type: string - x-speakeasy-unknown-values: allow - ReasoningTextContent: - example: - text: Let me think step by step about this problem... - type: reasoning_text + api_key_hashes: null + config: + url: https://example.com/openrouter-events + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production Webhook + privacy_mode: false + sampling_rate: 1 + type: webhook + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 properties: - text: + api_key_hashes: + description: >- + Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + example: null + items: + type: string + nullable: true + type: array + config: + properties: + headers: + additionalProperties: + type: string + type: object + method: + default: POST + enum: + - POST + - PUT + type: string + x-speakeasy-unknown-values: allow + url: + type: string + required: + - url + type: object + created_at: + description: ISO timestamp of when the destination was created. + example: '2025-08-24T10:30:00Z' + type: string + enabled: + description: Whether this destination is currently enabled. + example: true + type: boolean + filter_rules: + $ref: '#/components/schemas/ObservabilityFilterRulesConfig' + id: + description: Stable public identifier for this destination. + example: 99999999-aaaa-bbbb-cccc-dddddddddddd + format: uuid type: string + name: + description: Human-readable name for the destination. + example: Production Langfuse + nullable: true + type: string + privacy_mode: + description: When true, request/response bodies are not forwarded to this destination — only metadata. + example: false + type: boolean + sampling_rate: + description: Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + example: 1 + format: double + type: number type: enum: - - reasoning_text + - webhook + type: string + updated_at: + description: ISO timestamp of when the destination was last updated. + example: '2025-08-24T15:45:00Z' + type: string + workspace_id: + description: ID of the workspace this destination belongs to. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid type: string required: + - id + - workspace_id + - name + - enabled + - privacy_mode + - sampling_rate + - api_key_hashes + - filter_rules + - created_at + - updated_at - type - - text + - config type: object - RefusalDeltaEvent: - allOf: - - $ref: '#/components/schemas/BaseRefusalDeltaEvent' - - properties: {} - type: object - description: Event emitted when a refusal delta is streamed + OpenAIResponseCustomToolCall: example: - content_index: 0 - delta: I'm sorry - item_id: item-1 - output_index: 0 - sequence_number: 4 - type: response.refusal.delta - RefusalDoneEvent: - allOf: - - $ref: '#/components/schemas/BaseRefusalDoneEvent' - - properties: {} - type: object - description: Event emitted when refusal streaming is complete - example: - content_index: 0 - item_id: item-1 - output_index: 0 - refusal: I'm sorry, but I can't assist with that request. - sequence_number: 6 - type: response.refusal.done - RequestMetadata: - additionalProperties: - maxLength: 512 - type: string - description: >- - Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed. - example: - session_id: abc-def-ghi - user_id: '123' - nullable: true - type: object - RequestTimeoutResponse: - description: Request Timeout - Operation exceeded time limit - example: - error: - code: 408 - message: Operation timed out. Please try again later. + call_id: call-abc123 + id: ctc-abc123 + input: |- + *** Begin Patch + *** End Patch + name: apply_patch + type: custom_tool_call properties: - error: - $ref: '#/components/schemas/RequestTimeoutResponseErrorData' - user_id: - nullable: true + call_id: type: string - required: - - error - type: object - RequestTimeoutResponseErrorData: - description: Error data for RequestTimeoutResponse - example: - code: 408 - message: Operation timed out. Please try again later. - properties: - code: - type: integer - message: + id: + type: string + input: + type: string + name: + type: string + namespace: + description: Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) + type: string + type: + enum: + - custom_tool_call type: string - metadata: - additionalProperties: - nullable: true - nullable: true - type: object required: - - code - - message + - type + - call_id + - name + - input type: object - ResponseHealingPlugin: + OpenAIResponseCustomToolCallOutput: example: - enabled: true - id: response-healing + call_id: call-abc123 + output: patch applied successfully + type: custom_tool_call_output properties: - enabled: - description: Set to false to disable the response-healing plugin for this request. Defaults to true. - type: boolean + call_id: + type: string id: + type: string + output: + anyOf: + - type: string + - items: + discriminator: + mapping: + input_file: '#/components/schemas/InputFile' + input_image: '#/components/schemas/InputImage' + input_text: '#/components/schemas/InputText' + propertyName: type + oneOf: + - $ref: '#/components/schemas/InputText' + - $ref: '#/components/schemas/InputImage' + - $ref: '#/components/schemas/InputFile' + type: array + type: enum: - - response-healing + - custom_tool_call_output type: string required: - - id + - type + - call_id + - output type: object - ResponseIncludesEnum: - enum: - - file_search_call.results - - message.input_image.image_url - - computer_call_output.output.image_url - - reasoning.encrypted_content - - code_interpreter_call.outputs - example: file_search_call.results - type: string - x-speakeasy-unknown-values: allow - ResponseOutputText: + OpenAIResponseFunctionToolCall: example: - annotations: - - end_index: 42 - start_index: 0 - title: Paris - Wikipedia - type: url_citation - url: https://en.wikipedia.org/wiki/Paris - text: The capital of France is Paris. - type: output_text + arguments: '{"location":"San Francisco"}' + call_id: call-abc123 + id: fc-abc123 + name: get_weather + status: completed + type: function_call properties: - annotations: - items: - $ref: '#/components/schemas/OpenAIResponsesAnnotation' - type: array - logprobs: - items: - properties: - bytes: - items: - type: integer - type: array - logprob: - format: double - type: number - token: - type: string - top_logprobs: - items: - properties: - bytes: - items: - type: integer - type: array - logprob: - format: double - type: number - token: - type: string - required: - - token - - bytes - - logprob - type: object - type: array - required: - - token - - bytes - - logprob - - top_logprobs - type: object - type: array - text: + arguments: + type: string + call_id: + type: string + id: + type: string + name: + type: string + namespace: + description: Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) type: string + status: + $ref: '#/components/schemas/ToolCallStatus' type: enum: - - output_text + - function_call type: string required: - type - - text + - call_id + - name + - arguments type: object - ResponsesErrorField: - description: Error information returned from the API + OpenAIResponseFunctionToolCallOutput: example: - code: rate_limit_exceeded - message: Rate limit exceeded. Please try again later. - nullable: true + call_id: call-abc123 + output: '{"temperature":72,"conditions":"sunny"}' + type: function_call_output properties: - code: - enum: - - server_error - - rate_limit_exceeded - - invalid_prompt - - vector_store_timeout - - invalid_image - - invalid_image_format - - invalid_base64_image - - invalid_image_url - - image_too_large - - image_too_small - - image_parse_error - - image_content_policy_violation - - invalid_image_mode - - image_file_too_large - - unsupported_image_media_type - - empty_image_file - - failed_to_download_image - - image_file_not_found + call_id: type: string - x-speakeasy-unknown-values: allow - message: + id: + nullable: true + type: string + output: + anyOf: + - type: string + - items: + discriminator: + mapping: + input_file: '#/components/schemas/InputFile' + input_image: '#/components/schemas/InputImage' + input_text: '#/components/schemas/InputText' + propertyName: type + oneOf: + - $ref: '#/components/schemas/InputText' + - $ref: '#/components/schemas/InputImage' + - $ref: '#/components/schemas/InputFile' + type: array + status: + allOf: + - $ref: '#/components/schemas/ToolCallStatus' + - nullable: true + type: + enum: + - function_call_output type: string required: - - code - - message + - type + - call_id + - output type: object - ResponsesRequest: - description: Request schema for Responses endpoint + OpenAIResponseInputMessageItem: example: - input: - - content: Hello, how are you? - role: user - type: message - model: anthropic/claude-4.5-sonnet-20250929 - temperature: 0.7 - tools: - - description: Get the current weather in a given location - name: get_current_weather - parameters: - properties: - location: - type: string - type: object - type: function - top_p: 0.9 + content: + - text: Hello, how are you? + type: input_text + id: msg-abc123 + role: user + type: message properties: - background: - nullable: true - type: boolean - frequency_penalty: - format: double - nullable: true - type: number - image_config: - $ref: '#/components/schemas/ImageConfig' - include: - items: - $ref: '#/components/schemas/ResponseIncludesEnum' - nullable: true - type: array - input: - $ref: '#/components/schemas/Inputs' - instructions: - nullable: true - type: string - max_output_tokens: - nullable: true - type: integer - max_tool_calls: - nullable: true - type: integer - metadata: - $ref: '#/components/schemas/RequestMetadata' - modalities: - description: Output modalities for the response. Supported values are "text" and "image". - example: - - text - - image - items: - $ref: '#/components/schemas/OutputModalityEnum' - type: array - model: - type: string - models: - items: - type: string - type: array - parallel_tool_calls: - nullable: true - type: boolean - plugins: - description: Plugins you want to enable for this request, including their settings. + content: items: discriminator: mapping: - auto-router: '#/components/schemas/AutoRouterPlugin' - context-compression: '#/components/schemas/ContextCompressionPlugin' - file-parser: '#/components/schemas/FileParserPlugin' - moderation: '#/components/schemas/ModerationPlugin' - pareto-router: '#/components/schemas/ParetoRouterPlugin' - response-healing: '#/components/schemas/ResponseHealingPlugin' - web: '#/components/schemas/WebSearchPlugin' - propertyName: id + input_audio: '#/components/schemas/InputAudio' + input_file: '#/components/schemas/InputFile' + input_image: '#/components/schemas/InputImage' + input_text: '#/components/schemas/InputText' + propertyName: type oneOf: - - $ref: '#/components/schemas/AutoRouterPlugin' - - $ref: '#/components/schemas/ModerationPlugin' - - $ref: '#/components/schemas/WebSearchPlugin' - - $ref: '#/components/schemas/FileParserPlugin' - - $ref: '#/components/schemas/ResponseHealingPlugin' - - $ref: '#/components/schemas/ContextCompressionPlugin' - - $ref: '#/components/schemas/ParetoRouterPlugin' + - $ref: '#/components/schemas/InputText' + - $ref: '#/components/schemas/InputImage' + - $ref: '#/components/schemas/InputFile' + - $ref: '#/components/schemas/InputAudio' type: array - presence_penalty: - format: double - nullable: true - type: number - previous_response_id: - nullable: true - type: string - prompt: - $ref: '#/components/schemas/StoredPromptTemplate' - prompt_cache_key: - nullable: true - type: string - provider: - $ref: '#/components/schemas/ProviderPreferences' - reasoning: - $ref: '#/components/schemas/ReasoningConfig' - route: - $ref: '#/components/schemas/DeprecatedRoute' - safety_identifier: - nullable: true + id: type: string - service_tier: - default: auto + role: + anyOf: + - enum: + - user + type: string + - enum: + - system + type: string + - enum: + - developer + type: string + type: enum: - - auto - - default - - flex - - priority - - scale - - null - nullable: true + - message type: string - x-speakeasy-unknown-values: allow - session_id: - description: >- - A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. - maxLength: 256 + required: + - id + - role + - content + type: object + OpenAIResponsesAnnotation: + anyOf: + - $ref: '#/components/schemas/FileCitation' + - $ref: '#/components/schemas/URLCitation' + - $ref: '#/components/schemas/FilePath' + example: + file_id: file-abc123 + filename: research_paper.pdf + index: 0 + type: file_citation + OpenAIResponsesImageGenCallCompleted: + example: + item_id: ig_abc123 + output_index: 0 + sequence_number: 4 + type: response.image_generation_call.completed + properties: + item_id: type: string - store: - const: false - default: false - type: boolean - stream: - default: false - type: boolean - temperature: - format: double - nullable: true - type: number - text: - $ref: '#/components/schemas/TextExtendedConfig' - tool_choice: - $ref: '#/components/schemas/OpenAIResponsesToolChoice' - tools: - items: - anyOf: - - allOf: - - $ref: '#/components/schemas/FunctionTool' - - properties: {} - type: object - description: Function tool definition - example: - description: Get the current weather in a location - name: get_weather - parameters: - properties: - location: - description: The city and state - type: string - unit: - enum: - - celsius - - fahrenheit - type: string - x-speakeasy-unknown-values: allow - required: - - location - type: object - type: function - - $ref: '#/components/schemas/Preview_WebSearchServerTool' - - $ref: '#/components/schemas/Preview_20250311_WebSearchServerTool' - - $ref: '#/components/schemas/Legacy_WebSearchServerTool' - - $ref: '#/components/schemas/WebSearchServerTool' - - $ref: '#/components/schemas/FileSearchServerTool' - - $ref: '#/components/schemas/ComputerUseServerTool' - - $ref: '#/components/schemas/CodeInterpreterServerTool' - - $ref: '#/components/schemas/McpServerTool' - - $ref: '#/components/schemas/ImageGenerationServerTool' - - $ref: '#/components/schemas/CodexLocalShellTool' - - $ref: '#/components/schemas/ShellServerTool' - - $ref: '#/components/schemas/ApplyPatchServerTool' - - $ref: '#/components/schemas/CustomTool' - - $ref: '#/components/schemas/DatetimeServerTool' - - $ref: '#/components/schemas/ImageGenerationServerTool_OpenRouter' - - $ref: '#/components/schemas/ChatSearchModelsServerTool' - - $ref: '#/components/schemas/WebSearchServerTool_OpenRouter' - type: array - top_k: + output_index: type: integer - top_logprobs: - nullable: true + sequence_number: type: integer - top_p: - format: double - nullable: true - type: number - trace: - $ref: '#/components/schemas/TraceConfig' - truncation: - $ref: '#/components/schemas/OpenAIResponsesTruncation' - user: - description: >- - A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 256 characters. - maxLength: 256 + type: + enum: + - response.image_generation_call.completed type: string + required: + - type + - item_id + - output_index + - sequence_number type: object - SearchContextSizeEnum: - description: Size of the search context for web search tools - enum: - - low - - medium - - high - example: medium - type: string - x-speakeasy-unknown-values: allow - SearchModelsServerToolConfig: - description: Configuration for the openrouter:experimental__search_models server tool + OpenAIResponsesImageGenCallGenerating: example: - max_results: 5 - properties: - max_results: - description: Maximum number of models to return. Defaults to 5, max 20. - example: 5 + item_id: ig_abc123 + output_index: 0 + sequence_number: 2 + type: response.image_generation_call.generating + properties: + item_id: + type: string + output_index: + type: integer + sequence_number: type: integer + type: + enum: + - response.image_generation_call.generating + type: string + required: + - type + - item_id + - output_index + - sequence_number type: object - SearchQualityLevel: - description: >- - How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search. - enum: - - low - - medium - - high - example: medium - type: string - x-speakeasy-unknown-values: allow - ServiceTier: - enum: - - auto - - default - - flex - - priority - - scale - - null - example: default - nullable: true - type: string - x-speakeasy-unknown-values: allow - ServiceUnavailableResponse: - description: Service Unavailable - Service temporarily unavailable + OpenAIResponsesImageGenCallInProgress: example: - error: - code: 503 - message: Service temporarily unavailable + item_id: ig_abc123 + output_index: 0 + sequence_number: 1 + type: response.image_generation_call.in_progress properties: - error: - $ref: '#/components/schemas/ServiceUnavailableResponseErrorData' - user_id: - nullable: true + item_id: + type: string + output_index: + type: integer + sequence_number: + type: integer + type: + enum: + - response.image_generation_call.in_progress type: string required: - - error + - type + - item_id + - output_index + - sequence_number type: object - ServiceUnavailableResponseErrorData: - description: Error data for ServiceUnavailableResponse + OpenAIResponsesImageGenCallPartialImage: example: - code: 503 - message: Service temporarily unavailable + item_id: ig_abc123 + output_index: 0 + partial_image_b64: iVBORw0KGgo... + partial_image_index: 0 + sequence_number: 3 + type: response.image_generation_call.partial_image properties: - code: + item_id: + type: string + output_index: type: integer - message: + partial_image_b64: + type: string + partial_image_index: + type: integer + sequence_number: + type: integer + type: + enum: + - response.image_generation_call.partial_image type: string - metadata: - additionalProperties: - nullable: true - nullable: true - type: object required: - - code - - message + - type + - item_id + - output_index + - sequence_number + - partial_image_b64 + - partial_image_index type: object - ShellServerTool: - description: Shell tool configuration + OpenAIResponsesRefusalContent: example: - type: shell + refusal: I'm sorry, I cannot assist with that request + type: refusal properties: + refusal: + type: string type: enum: - - shell + - refusal type: string required: - type + - refusal type: object - SpeechRequest: - description: Text-to-speech request input + OpenAIResponsesResponseStatus: + enum: + - completed + - incomplete + - in_progress + - failed + - cancelled + - queued + example: completed + type: string + x-speakeasy-unknown-values: allow + OpenAIResponsesSearchCompleted: example: - input: Hello world - model: elevenlabs/eleven-turbo-v2 - response_format: pcm - speed: 1 - voice: alloy + item_id: ws_abc123 + output_index: 0 + sequence_number: 5 + type: response.web_search_call.completed properties: - input: - description: Text to synthesize - example: Hello world + item_id: type: string - model: - description: TTS model identifier - example: elevenlabs/eleven-turbo-v2 + output_index: + type: integer + sequence_number: + type: integer + type: + enum: + - response.web_search_call.completed type: string - provider: - description: Provider-specific passthrough configuration + required: + - type + - item_id + - output_index + - sequence_number + type: object + OpenAIResponsesToolChoice: + anyOf: + - enum: + - auto + type: string + - enum: + - none + type: string + - enum: + - required + type: string + - properties: + name: + type: string + type: + enum: + - function + type: string + required: + - type + - name + type: object + - properties: + type: + anyOf: + - enum: + - web_search_preview_2025_03_11 + type: string + - enum: + - web_search_preview + type: string + required: + - type + type: object + - $ref: '#/components/schemas/ToolChoiceAllowed' + - properties: + type: + enum: + - apply_patch + type: string + required: + - type + type: object + - properties: + type: + enum: + - shell + type: string + required: + - type + type: object + example: auto + OpenAIResponsesTruncation: + enum: + - auto + - disabled + - null + example: auto + nullable: true + type: string + x-speakeasy-unknown-values: allow + OpenAIResponsesUsage: + example: + input_tokens: 100 + input_tokens_details: + cached_tokens: 0 + output_tokens: 50 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 150 + properties: + input_tokens: + type: integer + input_tokens_details: properties: - options: - description: >- - Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. - properties: - 01ai: - additionalProperties: - nullable: true - type: object - ai21: - additionalProperties: - nullable: true - type: object - aion-labs: - additionalProperties: - nullable: true - type: object - akashml: - additionalProperties: - nullable: true - type: object - alibaba: - additionalProperties: - nullable: true - type: object - amazon-bedrock: - additionalProperties: - nullable: true - type: object - amazon-nova: - additionalProperties: - nullable: true - type: object - ambient: - additionalProperties: - nullable: true - type: object - anthropic: - additionalProperties: - nullable: true - type: object - anyscale: - additionalProperties: - nullable: true - type: object - arcee-ai: - additionalProperties: - nullable: true - type: object - atlas-cloud: - additionalProperties: - nullable: true - type: object - atoma: - additionalProperties: - nullable: true - type: object - avian: - additionalProperties: - nullable: true - type: object - azure: - additionalProperties: - nullable: true - type: object - baidu: - additionalProperties: - nullable: true - type: object - baseten: - additionalProperties: - nullable: true - type: object - black-forest-labs: - additionalProperties: - nullable: true - type: object - byteplus: - additionalProperties: - nullable: true - type: object - centml: - additionalProperties: - nullable: true - type: object - cerebras: - additionalProperties: - nullable: true - type: object - chutes: - additionalProperties: - nullable: true - type: object - cirrascale: - additionalProperties: - nullable: true - type: object - clarifai: - additionalProperties: - nullable: true - type: object - cloudflare: - additionalProperties: - nullable: true - type: object - cohere: - additionalProperties: - nullable: true - type: object - crofai: - additionalProperties: - nullable: true - type: object - crusoe: - additionalProperties: - nullable: true - type: object - deepinfra: - additionalProperties: - nullable: true - type: object - deepseek: - additionalProperties: - nullable: true - type: object - dekallm: - additionalProperties: - nullable: true - type: object - enfer: - additionalProperties: - nullable: true - type: object - fake-provider: - additionalProperties: - nullable: true - type: object - featherless: - additionalProperties: - nullable: true - type: object - fireworks: - additionalProperties: - nullable: true - type: object - friendli: - additionalProperties: - nullable: true - type: object - gmicloud: - additionalProperties: - nullable: true - type: object - google-ai-studio: - additionalProperties: - nullable: true - type: object - google-vertex: - additionalProperties: - nullable: true - type: object - gopomelo: - additionalProperties: - nullable: true - type: object - groq: - additionalProperties: - nullable: true - type: object - huggingface: - additionalProperties: - nullable: true - type: object - hyperbolic: - additionalProperties: - nullable: true - type: object - hyperbolic-quantized: - additionalProperties: - nullable: true - type: object - inception: - additionalProperties: - nullable: true - type: object - inceptron: - additionalProperties: - nullable: true - type: object - inference-net: - additionalProperties: - nullable: true - type: object - infermatic: - additionalProperties: - nullable: true - type: object - inflection: - additionalProperties: - nullable: true - type: object - inocloud: - additionalProperties: - nullable: true - type: object - io-net: - additionalProperties: - nullable: true - type: object - ionstream: - additionalProperties: - nullable: true - type: object - klusterai: - additionalProperties: - nullable: true - type: object - lambda: - additionalProperties: - nullable: true - type: object - lepton: - additionalProperties: - nullable: true - type: object - liquid: - additionalProperties: - nullable: true - type: object - lynn: - additionalProperties: - nullable: true - type: object - lynn-private: - additionalProperties: - nullable: true - type: object - mancer: - additionalProperties: - nullable: true - type: object - mancer-old: - additionalProperties: - nullable: true - type: object - mara: - additionalProperties: - nullable: true - type: object - meta: - additionalProperties: - nullable: true - type: object - minimax: - additionalProperties: - nullable: true - type: object - mistral: - additionalProperties: - nullable: true - type: object - modal: - additionalProperties: - nullable: true - type: object - modelrun: - additionalProperties: - nullable: true - type: object - modular: - additionalProperties: - nullable: true - type: object - moonshotai: - additionalProperties: - nullable: true - type: object - morph: - additionalProperties: - nullable: true - type: object - ncompass: - additionalProperties: - nullable: true - type: object - nebius: - additionalProperties: - nullable: true - type: object - nextbit: - additionalProperties: - nullable: true - type: object - nineteen: - additionalProperties: - nullable: true - type: object - novita: - additionalProperties: - nullable: true - type: object - nvidia: - additionalProperties: - nullable: true - type: object - octoai: - additionalProperties: - nullable: true - type: object - open-inference: - additionalProperties: - nullable: true - type: object - openai: - additionalProperties: - nullable: true - type: object - parasail: - additionalProperties: - nullable: true - type: object - perplexity: - additionalProperties: - nullable: true - type: object - phala: - additionalProperties: - nullable: true - type: object - recraft: - additionalProperties: - nullable: true - type: object - recursal: - additionalProperties: - nullable: true - type: object - reflection: - additionalProperties: - nullable: true - type: object - reka: - additionalProperties: - nullable: true - type: object - relace: - additionalProperties: - nullable: true - type: object - replicate: - additionalProperties: - nullable: true - type: object - sambanova: - additionalProperties: - nullable: true - type: object - sambanova-cloaked: - additionalProperties: - nullable: true - type: object - seed: - additionalProperties: - nullable: true - type: object - sf-compute: - additionalProperties: - nullable: true - type: object - siliconflow: - additionalProperties: - nullable: true - type: object - sourceful: - additionalProperties: - nullable: true - type: object - stealth: - additionalProperties: - nullable: true - type: object - stepfun: - additionalProperties: - nullable: true - type: object - streamlake: - additionalProperties: - nullable: true - type: object - switchpoint: - additionalProperties: - nullable: true - type: object - targon: - additionalProperties: - nullable: true - type: object - together: - additionalProperties: - nullable: true - type: object - together-lite: - additionalProperties: - nullable: true - type: object - ubicloud: - additionalProperties: - nullable: true - type: object - upstage: - additionalProperties: - nullable: true - type: object - venice: - additionalProperties: - nullable: true - type: object - wandb: - additionalProperties: - nullable: true - type: object - xai: - additionalProperties: - nullable: true - type: object - xiaomi: - additionalProperties: - nullable: true - type: object - z-ai: - additionalProperties: - nullable: true - type: object - type: object - type: object - response_format: - default: pcm - description: Audio output format - enum: - - mp3 - - pcm - example: pcm - type: string - x-speakeasy-unknown-values: allow - speed: - description: >- - Playback speed multiplier. Only used by models that support it (e.g. OpenAI TTS). Ignored by other providers. - example: 1 - format: double - type: number - voice: - description: Voice identifier (provider-specific). - example: alloy - type: string - required: - - model - - input - - voice - type: object - StoredPromptTemplate: - example: - id: prompt-abc123 - variables: - name: John - nullable: true - properties: - id: - type: string - variables: - additionalProperties: - anyOf: - - type: string - - $ref: '#/components/schemas/InputText' - - $ref: '#/components/schemas/InputImage' - - $ref: '#/components/schemas/InputFile' - nullable: true - type: object - required: - - id - type: object - StreamEvents: - description: Union of all possible event types emitted during response streaming - discriminator: - mapping: - error: '#/components/schemas/ErrorEvent' - response.completed: '#/components/schemas/StreamEventsResponseCompleted' - response.content_part.added: '#/components/schemas/ContentPartAddedEvent' - response.content_part.done: '#/components/schemas/ContentPartDoneEvent' - response.created: '#/components/schemas/OpenResponsesCreatedEvent' - response.failed: '#/components/schemas/StreamEventsResponseFailed' - response.function_call_arguments.delta: '#/components/schemas/FunctionCallArgsDeltaEvent' - response.function_call_arguments.done: '#/components/schemas/FunctionCallArgsDoneEvent' - response.image_generation_call.completed: '#/components/schemas/ImageGenCallCompletedEvent' - response.image_generation_call.generating: '#/components/schemas/ImageGenCallGeneratingEvent' - response.image_generation_call.in_progress: '#/components/schemas/ImageGenCallInProgressEvent' - response.image_generation_call.partial_image: '#/components/schemas/ImageGenCallPartialImageEvent' - response.in_progress: '#/components/schemas/OpenResponsesInProgressEvent' - response.incomplete: '#/components/schemas/StreamEventsResponseIncomplete' - response.output_item.added: '#/components/schemas/StreamEventsResponseOutputItemAdded' - response.output_item.done: '#/components/schemas/StreamEventsResponseOutputItemDone' - response.output_text.annotation.added: '#/components/schemas/AnnotationAddedEvent' - response.output_text.delta: '#/components/schemas/TextDeltaEvent' - response.output_text.done: '#/components/schemas/TextDoneEvent' - response.reasoning_summary_part.added: '#/components/schemas/ReasoningSummaryPartAddedEvent' - response.reasoning_summary_part.done: '#/components/schemas/ReasoningSummaryPartDoneEvent' - response.reasoning_summary_text.delta: '#/components/schemas/ReasoningSummaryTextDeltaEvent' - response.reasoning_summary_text.done: '#/components/schemas/ReasoningSummaryTextDoneEvent' - response.reasoning_text.delta: '#/components/schemas/ReasoningDeltaEvent' - response.reasoning_text.done: '#/components/schemas/ReasoningDoneEvent' - response.refusal.delta: '#/components/schemas/RefusalDeltaEvent' - response.refusal.done: '#/components/schemas/RefusalDoneEvent' - response.web_search_call.completed: '#/components/schemas/WebSearchCallCompletedEvent' - response.web_search_call.in_progress: '#/components/schemas/WebSearchCallInProgressEvent' - response.web_search_call.searching: '#/components/schemas/WebSearchCallSearchingEvent' - propertyName: type - example: - response: - created_at: 1704067200 - error: null - id: resp-abc123 - incomplete_details: null - instructions: null - max_output_tokens: null - metadata: null - model: gpt-4 - object: response - output: [] - parallel_tool_calls: true - status: in_progress - temperature: null - tool_choice: auto - tools: [] - top_p: null - sequence_number: 0 - type: response.created - oneOf: - - $ref: '#/components/schemas/OpenResponsesCreatedEvent' - - $ref: '#/components/schemas/OpenResponsesInProgressEvent' - - $ref: '#/components/schemas/StreamEventsResponseCompleted' - - $ref: '#/components/schemas/StreamEventsResponseIncomplete' - - $ref: '#/components/schemas/StreamEventsResponseFailed' - - $ref: '#/components/schemas/ErrorEvent' - - $ref: '#/components/schemas/StreamEventsResponseOutputItemAdded' - - $ref: '#/components/schemas/StreamEventsResponseOutputItemDone' - - $ref: '#/components/schemas/ContentPartAddedEvent' - - $ref: '#/components/schemas/ContentPartDoneEvent' - - $ref: '#/components/schemas/TextDeltaEvent' - - $ref: '#/components/schemas/TextDoneEvent' - - $ref: '#/components/schemas/RefusalDeltaEvent' - - $ref: '#/components/schemas/RefusalDoneEvent' - - $ref: '#/components/schemas/AnnotationAddedEvent' - - $ref: '#/components/schemas/FunctionCallArgsDeltaEvent' - - $ref: '#/components/schemas/FunctionCallArgsDoneEvent' - - $ref: '#/components/schemas/ReasoningDeltaEvent' - - $ref: '#/components/schemas/ReasoningDoneEvent' - - $ref: '#/components/schemas/ReasoningSummaryPartAddedEvent' - - $ref: '#/components/schemas/ReasoningSummaryPartDoneEvent' - - $ref: '#/components/schemas/ReasoningSummaryTextDeltaEvent' - - $ref: '#/components/schemas/ReasoningSummaryTextDoneEvent' - - $ref: '#/components/schemas/ImageGenCallInProgressEvent' - - $ref: '#/components/schemas/ImageGenCallGeneratingEvent' - - $ref: '#/components/schemas/ImageGenCallPartialImageEvent' - - $ref: '#/components/schemas/ImageGenCallCompletedEvent' - - $ref: '#/components/schemas/WebSearchCallInProgressEvent' - - $ref: '#/components/schemas/WebSearchCallSearchingEvent' - - $ref: '#/components/schemas/WebSearchCallCompletedEvent' - StreamEventsResponseCompleted: - allOf: - - $ref: '#/components/schemas/CompletedEvent' - - properties: - response: - $ref: '#/components/schemas/OpenResponsesResult' - type: object - description: Event emitted when a response has completed successfully - example: - response: - created_at: 1704067200 - error: null - id: resp-abc123 - incomplete_details: null - instructions: null - max_output_tokens: null - metadata: null - model: gpt-4 - object: response - output: [] - parallel_tool_calls: true - status: completed - temperature: null - tool_choice: auto - tools: [] - top_p: null - sequence_number: 10 - type: response.completed - StreamEventsResponseFailed: - allOf: - - $ref: '#/components/schemas/FailedEvent' - - properties: - response: - $ref: '#/components/schemas/OpenResponsesResult' - type: object - description: Event emitted when a response has failed - example: - response: - created_at: 1704067200 - error: null - id: resp-abc123 - incomplete_details: null - instructions: null - max_output_tokens: null - metadata: null - model: gpt-4 - object: response - output: [] - parallel_tool_calls: true - status: failed - temperature: null - tool_choice: auto - tools: [] - top_p: null - sequence_number: 3 - type: response.failed - StreamEventsResponseIncomplete: - allOf: - - $ref: '#/components/schemas/IncompleteEvent' - - properties: - response: - $ref: '#/components/schemas/OpenResponsesResult' - type: object - description: Event emitted when a response is incomplete - example: - response: - created_at: 1704067200 - error: null - id: resp-abc123 - incomplete_details: null - instructions: null - max_output_tokens: null - metadata: null - model: gpt-4 - object: response - output: [] - parallel_tool_calls: true - status: incomplete - temperature: null - tool_choice: auto - tools: [] - top_p: null - sequence_number: 5 - type: response.incomplete - StreamEventsResponseOutputItemAdded: - allOf: - - $ref: '#/components/schemas/OutputItemAddedEvent' - - properties: - item: - $ref: '#/components/schemas/OutputItems' - type: object - description: Event emitted when a new output item is added to the response - example: - item: - content: [] - id: item-1 - role: assistant - status: in_progress - type: message - output_index: 0 - sequence_number: 2 - type: response.output_item.added - StreamEventsResponseOutputItemDone: - allOf: - - $ref: '#/components/schemas/OutputItemDoneEvent' - - properties: - item: - $ref: '#/components/schemas/OutputItems' - type: object - description: Event emitted when an output item is complete - example: - item: - content: - - annotations: [] - text: Hello! How can I help you? - type: output_text - id: item-1 - role: assistant - status: completed - type: message - output_index: 0 - sequence_number: 8 - type: response.output_item.done - StreamLogprob: - allOf: - - $ref: '#/components/schemas/OpenResponsesLogProbs' - - properties: - top_logprobs: - items: - $ref: '#/components/schemas/StreamLogprobTopLogprob' - type: array - type: object - description: Log probability information for a token - example: - bytes: - - 72 - - 101 - - 108 - - 108 - - 111 - logprob: -0.5 - token: Hello - top_logprobs: [] - StreamLogprobTopLogprob: - allOf: - - $ref: '#/components/schemas/OpenResponsesTopLogprobs' - - properties: {} - type: object - description: Alternative token with its log probability - example: - bytes: - - 72 - - 101 - - 108 - - 108 - - 111 - logprob: -0.5 - token: Hello - TextConfig: - description: Text output configuration including format and verbosity - example: - format: - type: text - verbosity: medium - properties: - format: - $ref: '#/components/schemas/Formats' - verbosity: - enum: - - high - - low - - medium - - null - nullable: true - type: string - x-speakeasy-unknown-values: allow - type: object - TextDeltaEvent: - allOf: - - $ref: '#/components/schemas/BaseTextDeltaEvent' - - properties: - logprobs: - items: - $ref: '#/components/schemas/StreamLogprob' - type: array - type: object - description: Event emitted when a text delta is streamed - example: - content_index: 0 - delta: Hello - item_id: item-1 - logprobs: [] - output_index: 0 - sequence_number: 4 - type: response.output_text.delta - TextDoneEvent: - allOf: - - $ref: '#/components/schemas/BaseTextDoneEvent' - - properties: - logprobs: - items: - $ref: '#/components/schemas/StreamLogprob' - type: array - type: object - description: Event emitted when text streaming is complete - example: - content_index: 0 - item_id: item-1 - logprobs: [] - output_index: 0 - sequence_number: 6 - text: Hello! How can I help you? - type: response.output_text.done - TextExtendedConfig: - allOf: - - $ref: '#/components/schemas/TextConfig' - - properties: - verbosity: - enum: - - low - - medium - - high - - xhigh - - max - - null - nullable: true - type: string - x-speakeasy-unknown-values: allow - type: object - description: Text output configuration including format and verbosity - example: - format: - type: text - ToolCallStatus: - enum: - - in_progress - - completed - - incomplete - example: completed - type: string - x-speakeasy-unknown-values: allow - ToolChoiceAllowed: - description: Constrains the model to a pre-defined set of allowed tools - example: - mode: auto - tools: - - name: get_weather - type: function - type: allowed_tools - properties: - mode: - anyOf: - - enum: - - auto - type: string - - enum: - - required - type: string - tools: - items: - additionalProperties: - nullable: true - type: object - type: array - type: - enum: - - allowed_tools - type: string - required: - - type - - mode - - tools - type: object - TooManyRequestsResponse: - description: Too Many Requests - Rate limit exceeded - example: - error: - code: 429 - message: Rate limit exceeded - properties: - error: - $ref: '#/components/schemas/TooManyRequestsResponseErrorData' - user_id: - nullable: true - type: string - required: - - error - type: object - TooManyRequestsResponseErrorData: - description: Error data for TooManyRequestsResponse - example: - code: 429 - message: Rate limit exceeded - properties: - code: - type: integer - message: - type: string - metadata: - additionalProperties: - nullable: true - nullable: true - type: object - required: - - code - - message - type: object - TopProviderInfo: - description: Information about the top provider for this model - example: - context_length: 8192 - is_moderated: true - max_completion_tokens: 4096 - properties: - context_length: - description: Context length from the top provider - example: 8192 - nullable: true - type: integer - is_moderated: - description: Whether the top provider moderates content - example: true - type: boolean - max_completion_tokens: - description: Maximum completion tokens from the top provider - example: 4096 - nullable: true - type: integer - required: - - is_moderated - type: object - TraceConfig: - additionalProperties: - nullable: true - description: >- - Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. - example: - trace_id: trace-abc123 - trace_name: my-app-trace - properties: - generation_name: - type: string - parent_span_id: - type: string - span_name: - type: string - trace_id: - type: string - trace_name: - type: string - type: object - Truncation: - enum: - - auto - - disabled - - null - example: auto - nullable: true - type: string - x-speakeasy-unknown-values: allow - UnauthorizedResponse: - description: Unauthorized - Authentication required or invalid credentials - example: - error: - code: 401 - message: Missing Authentication header - properties: - error: - $ref: '#/components/schemas/UnauthorizedResponseErrorData' - user_id: - nullable: true - type: string - required: - - error - type: object - UnauthorizedResponseErrorData: - description: Error data for UnauthorizedResponse - example: - code: 401 - message: Missing Authentication header - properties: - code: - type: integer - message: - type: string - metadata: - additionalProperties: - nullable: true - nullable: true - type: object - required: - - code - - message - type: object - UnprocessableEntityResponse: - description: Unprocessable Entity - Semantic validation failure - example: - error: - code: 422 - message: Invalid argument - properties: - error: - $ref: '#/components/schemas/UnprocessableEntityResponseErrorData' - user_id: - nullable: true - type: string - required: - - error - type: object - UnprocessableEntityResponseErrorData: - description: Error data for UnprocessableEntityResponse - example: - code: 422 - message: Invalid argument - properties: - code: - type: integer - message: - type: string - metadata: - additionalProperties: - nullable: true - nullable: true - type: object - required: - - code - - message - type: object - UpdateGuardrailRequest: - example: - description: Updated description - limit_usd: 75 - name: Updated Guardrail Name - reset_interval: weekly - properties: - allowed_models: - description: Array of model identifiers (slug or canonical_slug accepted) - example: - - openai/gpt-5.2 - items: - type: string - minItems: 1 - nullable: true - type: array - allowed_providers: - description: New list of allowed provider IDs - example: - - openai - - anthropic - - deepseek - items: - type: string - minItems: 1 - nullable: true - type: array - description: - description: New description for the guardrail - example: Updated description - maxLength: 1000 - nullable: true - type: string - enforce_zdr: - description: Whether to enforce zero data retention - example: true - nullable: true - type: boolean - ignored_models: - description: Array of model identifiers to exclude from routing (slug or canonical_slug accepted) - example: - - openai/gpt-4o-mini - items: - type: string - minItems: 1 - nullable: true - type: array - ignored_providers: - description: List of provider IDs to exclude from routing - example: - - azure - items: - type: string - minItems: 1 - nullable: true - type: array - limit_usd: - description: New spending limit in USD - example: 75 - format: double - nullable: true - type: number - name: - description: New name for the guardrail - example: Updated Guardrail Name - maxLength: 200 - minLength: 1 - type: string - reset_interval: - $ref: '#/components/schemas/GuardrailInterval' - type: object - UpdateGuardrailResponse: - example: - data: - allowed_models: null - allowed_providers: - - openai - created_at: '2025-08-24T10:30:00Z' - description: Updated description - enforce_zdr: true - id: 550e8400-e29b-41d4-a716-446655440000 - ignored_models: null - ignored_providers: null - limit_usd: 75 - name: Updated Guardrail Name - reset_interval: weekly - updated_at: '2025-08-24T16:00:00Z' - workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 - properties: - data: - allOf: - - $ref: '#/components/schemas/Guardrail' - - description: The updated guardrail - required: - - data - type: object - UpdateWorkspaceRequest: - example: - name: Updated Workspace - slug: updated-workspace - properties: - default_image_model: - description: Default image model for this workspace - example: openai/dall-e-3 - nullable: true - type: string - default_provider_sort: - description: Default provider sort preference (price, throughput, latency, exacto) - example: price - nullable: true - type: string - default_text_model: - description: Default text model for this workspace - example: openai/gpt-4o - nullable: true - type: string - description: - description: New description for the workspace - example: Updated description - maxLength: 500 - nullable: true - type: string - is_data_discount_logging_enabled: - description: Whether data discount logging is enabled - example: true - type: boolean - is_observability_broadcast_enabled: - description: Whether broadcast is enabled - example: false - type: boolean - is_observability_io_logging_enabled: - description: Whether private logging is enabled - example: false - type: boolean - name: - description: New name for the workspace - example: Updated Workspace - maxLength: 100 - minLength: 1 - type: string - slug: - description: New URL-friendly slug - example: updated-workspace - maxLength: 50 - minLength: 1 - pattern: ^[a-z0-9-]+$ - type: string - type: object - UpdateWorkspaceResponse: - example: - data: - created_at: '2025-08-24T10:30:00Z' - created_by: user_abc123 - default_image_model: openai/dall-e-3 - default_provider_sort: price - default_text_model: openai/gpt-4o - description: Production environment workspace - id: 550e8400-e29b-41d4-a716-446655440000 - is_data_discount_logging_enabled: true - is_observability_broadcast_enabled: false - is_observability_io_logging_enabled: false - name: Updated Workspace - slug: updated-workspace - updated_at: '2025-08-25T10:00:00Z' - properties: - data: - allOf: - - $ref: '#/components/schemas/Workspace' - - description: The updated workspace - required: - - data - type: object - URLCitation: - example: - end_index: 42 - start_index: 0 - title: OpenRouter Documentation - type: url_citation - url: https://openrouter.ai/docs - properties: - end_index: - type: integer - start_index: - type: integer - title: - type: string - type: - enum: - - url_citation - type: string - url: - type: string - required: - - type - - url - - title - - start_index - - end_index - type: object - Usage: - allOf: - - $ref: '#/components/schemas/OpenAIResponsesUsage' - - nullable: true - properties: - cost: - description: Cost of the completion - format: double - nullable: true - type: number - cost_details: - properties: - upstream_inference_cost: - format: double - nullable: true - type: number - upstream_inference_input_cost: - format: double - type: number - upstream_inference_output_cost: - format: double - type: number - required: - - upstream_inference_input_cost - - upstream_inference_output_cost - type: object - is_byok: - description: Whether a request was made using a Bring Your Own Key configuration - type: boolean - type: object - description: Token usage information for the response - example: - cost: 0.0012 - cost_details: - upstream_inference_cost: null - upstream_inference_input_cost: 0.0008 - upstream_inference_output_cost: 0.0004 - input_tokens: 10 - input_tokens_details: - cached_tokens: 0 - output_tokens: 25 - output_tokens_details: - reasoning_tokens: 0 - total_tokens: 35 - VideoGenerationRequest: - example: - aspect_ratio: '16:9' - duration: 8 - model: google/veo-3.1 - prompt: A serene mountain landscape at sunset - resolution: 720p - properties: - aspect_ratio: - description: Aspect ratio of the generated video - enum: - - '16:9' - - '9:16' - - '1:1' - - '4:3' - - '3:4' - - '21:9' - - '9:21' - example: '16:9' - type: string - x-speakeasy-unknown-values: allow - duration: - description: Duration of the generated video in seconds - example: 8 - minimum: 1 - type: integer - frame_images: - description: >- - Images to use as the first and/or last frame of the generated video. Each image must specify a frame_type of first_frame or last_frame. - items: - $ref: '#/components/schemas/FrameImage' - type: array - generate_audio: - description: >- - Whether to generate audio alongside the video. Defaults to the endpoint's generate_audio capability flag, false if not set. - example: true - type: boolean - input_references: - description: Reference images to guide video generation - items: - $ref: '#/components/schemas/ContentPartImage' - type: array - model: - type: string - prompt: - type: string - provider: - description: Provider-specific passthrough configuration - properties: - options: - description: >- - Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. - example: - google-vertex: - output_config: - effort: low - properties: - 01ai: - additionalProperties: - nullable: true - type: object - ai21: - additionalProperties: - nullable: true - type: object - aion-labs: - additionalProperties: - nullable: true - type: object - akashml: - additionalProperties: - nullable: true - type: object - alibaba: - additionalProperties: - nullable: true - type: object - amazon-bedrock: - additionalProperties: - nullable: true - type: object - amazon-nova: - additionalProperties: - nullable: true - type: object - ambient: - additionalProperties: - nullable: true - type: object - anthropic: - additionalProperties: - nullable: true - type: object - anyscale: - additionalProperties: - nullable: true - type: object - arcee-ai: - additionalProperties: - nullable: true - type: object - atlas-cloud: - additionalProperties: - nullable: true - type: object - atoma: - additionalProperties: - nullable: true - type: object - avian: - additionalProperties: - nullable: true - type: object - azure: - additionalProperties: - nullable: true - type: object - baidu: - additionalProperties: - nullable: true - type: object - baseten: - additionalProperties: - nullable: true - type: object - black-forest-labs: - additionalProperties: - nullable: true - type: object - byteplus: - additionalProperties: - nullable: true - type: object - centml: - additionalProperties: - nullable: true - type: object - cerebras: - additionalProperties: - nullable: true - type: object - chutes: - additionalProperties: - nullable: true - type: object - cirrascale: - additionalProperties: - nullable: true - type: object - clarifai: - additionalProperties: - nullable: true - type: object - cloudflare: - additionalProperties: - nullable: true - type: object - cohere: - additionalProperties: - nullable: true - type: object - crofai: - additionalProperties: - nullable: true - type: object - crusoe: - additionalProperties: - nullable: true - type: object - deepinfra: - additionalProperties: - nullable: true - type: object - deepseek: - additionalProperties: - nullable: true - type: object - dekallm: - additionalProperties: - nullable: true - type: object - enfer: - additionalProperties: - nullable: true - type: object - fake-provider: - additionalProperties: - nullable: true - type: object - featherless: - additionalProperties: - nullable: true - type: object - fireworks: - additionalProperties: - nullable: true - type: object - friendli: - additionalProperties: - nullable: true - type: object - gmicloud: - additionalProperties: - nullable: true - type: object - google-ai-studio: - additionalProperties: - nullable: true - type: object - google-vertex: - additionalProperties: - nullable: true - type: object - gopomelo: - additionalProperties: - nullable: true - type: object - groq: - additionalProperties: - nullable: true - type: object - huggingface: - additionalProperties: - nullable: true - type: object - hyperbolic: - additionalProperties: - nullable: true - type: object - hyperbolic-quantized: - additionalProperties: - nullable: true - type: object - inception: - additionalProperties: - nullable: true - type: object - inceptron: - additionalProperties: - nullable: true - type: object - inference-net: - additionalProperties: - nullable: true - type: object - infermatic: - additionalProperties: - nullable: true - type: object - inflection: - additionalProperties: - nullable: true - type: object - inocloud: - additionalProperties: - nullable: true - type: object - io-net: - additionalProperties: - nullable: true - type: object - ionstream: - additionalProperties: - nullable: true - type: object - klusterai: - additionalProperties: - nullable: true - type: object - lambda: - additionalProperties: - nullable: true - type: object - lepton: - additionalProperties: - nullable: true - type: object - liquid: - additionalProperties: - nullable: true - type: object - lynn: - additionalProperties: - nullable: true - type: object - lynn-private: - additionalProperties: - nullable: true - type: object - mancer: - additionalProperties: - nullable: true - type: object - mancer-old: - additionalProperties: - nullable: true - type: object - mara: - additionalProperties: - nullable: true - type: object - meta: - additionalProperties: - nullable: true - type: object - minimax: - additionalProperties: - nullable: true - type: object - mistral: - additionalProperties: - nullable: true - type: object - modal: - additionalProperties: - nullable: true - type: object - modelrun: - additionalProperties: - nullable: true - type: object - modular: - additionalProperties: - nullable: true - type: object - moonshotai: - additionalProperties: - nullable: true - type: object - morph: - additionalProperties: - nullable: true - type: object - ncompass: - additionalProperties: - nullable: true - type: object - nebius: - additionalProperties: - nullable: true - type: object - nextbit: - additionalProperties: - nullable: true - type: object - nineteen: - additionalProperties: - nullable: true - type: object - novita: - additionalProperties: - nullable: true - type: object - nvidia: - additionalProperties: - nullable: true - type: object - octoai: - additionalProperties: - nullable: true - type: object - open-inference: - additionalProperties: - nullable: true - type: object - openai: - additionalProperties: - nullable: true - type: object - parasail: - additionalProperties: - nullable: true - type: object - perplexity: - additionalProperties: - nullable: true - type: object - phala: - additionalProperties: - nullable: true - type: object - recraft: - additionalProperties: - nullable: true - type: object - recursal: - additionalProperties: - nullable: true - type: object - reflection: - additionalProperties: - nullable: true - type: object - reka: - additionalProperties: - nullable: true - type: object - relace: - additionalProperties: - nullable: true - type: object - replicate: - additionalProperties: - nullable: true - type: object - sambanova: - additionalProperties: - nullable: true - type: object - sambanova-cloaked: - additionalProperties: - nullable: true - type: object - seed: - additionalProperties: - nullable: true - type: object - sf-compute: - additionalProperties: - nullable: true - type: object - siliconflow: - additionalProperties: - nullable: true - type: object - sourceful: - additionalProperties: - nullable: true - type: object - stealth: - additionalProperties: - nullable: true - type: object - stepfun: - additionalProperties: - nullable: true - type: object - streamlake: - additionalProperties: - nullable: true - type: object - switchpoint: - additionalProperties: - nullable: true - type: object - targon: - additionalProperties: - nullable: true - type: object - together: - additionalProperties: - nullable: true - type: object - together-lite: - additionalProperties: - nullable: true - type: object - ubicloud: - additionalProperties: - nullable: true - type: object - upstage: - additionalProperties: - nullable: true - type: object - venice: - additionalProperties: - nullable: true - type: object - wandb: - additionalProperties: - nullable: true - type: object - xai: - additionalProperties: - nullable: true - type: object - xiaomi: - additionalProperties: - nullable: true - type: object - z-ai: - additionalProperties: - nullable: true + cached_tokens: + type: integer + required: + - cached_tokens + type: object + output_tokens: + type: integer + output_tokens_details: + properties: + reasoning_tokens: + type: integer + required: + - reasoning_tokens + type: object + total_tokens: + type: integer + required: + - input_tokens + - input_tokens_details + - output_tokens + - output_tokens_details + - total_tokens + type: object + OpenAIResponsesWebSearchCallInProgress: + example: + item_id: ws_abc123 + output_index: 0 + sequence_number: 1 + type: response.web_search_call.in_progress + properties: + item_id: + type: string + output_index: + type: integer + sequence_number: + type: integer + type: + enum: + - response.web_search_call.in_progress + type: string + required: + - type + - item_id + - output_index + - sequence_number + type: object + OpenAIResponsesWebSearchCallSearching: + example: + item_id: ws_abc123 + output_index: 0 + sequence_number: 2 + type: response.web_search_call.searching + properties: + item_id: + type: string + output_index: + type: integer + sequence_number: + type: integer + type: + enum: + - response.web_search_call.searching + type: string + required: + - type + - item_id + - output_index + - sequence_number + type: object + OpenResponsesCreatedEvent: + allOf: + - $ref: '#/components/schemas/CreatedEvent' + - properties: + response: + $ref: '#/components/schemas/OpenResponsesResult' + type: object + description: Event emitted when a response is created + example: + response: + created_at: 1704067200 + error: null + id: resp-abc123 + incomplete_details: null + instructions: null + max_output_tokens: null + metadata: null + model: gpt-4 + object: response + output: [] + parallel_tool_calls: true + status: in_progress + temperature: null + tool_choice: auto + tools: [] + top_p: null + sequence_number: 0 + type: response.created + OpenResponsesInProgressEvent: + allOf: + - $ref: '#/components/schemas/InProgressEvent' + - properties: + response: + $ref: '#/components/schemas/OpenResponsesResult' + type: object + description: Event emitted when a response is in progress + example: + response: + created_at: 1704067200 + error: null + id: resp-abc123 + incomplete_details: null + instructions: null + max_output_tokens: null + metadata: null + model: gpt-4 + object: response + output: [] + parallel_tool_calls: true + status: in_progress + temperature: null + tool_choice: auto + tools: [] + top_p: null + sequence_number: 1 + type: response.in_progress + OpenResponsesLogProbs: + description: Log probability information for a token + example: + logprob: -0.1 + token: world + top_logprobs: + - logprob: -0.5 + token: hello + properties: + bytes: + items: + type: integer + type: array + logprob: + format: double + type: number + token: + type: string + top_logprobs: + items: + $ref: '#/components/schemas/OpenResponsesTopLogprobs' + type: array + required: + - logprob + - token + type: object + OpenResponsesResult: + allOf: + - $ref: '#/components/schemas/BaseResponsesResult' + - properties: + openrouter_metadata: + $ref: '#/components/schemas/OpenRouterMetadata' + output: + items: + $ref: '#/components/schemas/OutputItems' + type: array + service_tier: + nullable: true + type: string + text: + $ref: '#/components/schemas/TextExtendedConfig' + usage: + $ref: '#/components/schemas/Usage' + type: object + description: Complete non-streaming response from the Responses API + example: + created_at: 1704067200 + error: null + id: resp-abc123 + incomplete_details: null + instructions: null + max_output_tokens: null + metadata: null + model: gpt-4 + object: response + output: + - content: + - annotations: [] + text: Hello! How can I help you today? + type: output_text + id: msg-abc123 + role: assistant + status: completed + type: message + parallel_tool_calls: true + status: completed + temperature: null + tool_choice: auto + tools: [] + top_p: null + usage: + input_tokens: 10 + input_tokens_details: + cached_tokens: 0 + output_tokens: 25 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 35 + OpenResponsesTopLogprobs: + description: Alternative token with its log probability + example: + logprob: -0.5 + token: hello + properties: + bytes: + items: + type: integer + type: array + logprob: + format: double + type: number + token: + type: string + type: object + OpenRouterMetadata: + example: + attempt: 1 + endpoints: + available: + - model: openai/gpt-4o + provider: OpenAI + selected: true + total: 1 + is_byok: false + region: iad + requested: openai/gpt-4o + strategy: direct + summary: available=1, selected=OpenAI + properties: + attempt: + type: integer + attempts: + items: + $ref: '#/components/schemas/RouterAttempt' + type: array + endpoints: + $ref: '#/components/schemas/EndpointsMetadata' + is_byok: + type: boolean + params: + $ref: '#/components/schemas/RouterParams' + pipeline: + items: + $ref: '#/components/schemas/PipelineStage' + type: array + region: + nullable: true + type: string + requested: + type: string + strategy: + $ref: '#/components/schemas/RoutingStrategy' + summary: + type: string + required: + - requested + - strategy + - region + - summary + - attempt + - is_byok + - endpoints + type: object + OpenRouterWebSearchServerTool: + description: 'OpenRouter built-in server tool: searches the web for current information' + example: + parameters: + max_results: 5 + type: openrouter:web_search + properties: + parameters: + $ref: '#/components/schemas/WebSearchConfig' + type: + enum: + - openrouter:web_search + type: string + required: + - type + type: object + ORAnthropicContentBlock: + discriminator: + mapping: + advisor_tool_result: '#/components/schemas/AnthropicAdvisorToolResult' + bash_code_execution_tool_result: '#/components/schemas/AnthropicBashCodeExecutionToolResult' + code_execution_tool_result: '#/components/schemas/AnthropicCodeExecutionToolResult' + compaction: '#/components/schemas/AnthropicCompactionBlock' + container_upload: '#/components/schemas/AnthropicContainerUpload' + redacted_thinking: '#/components/schemas/AnthropicRedactedThinkingBlock' + server_tool_use: '#/components/schemas/ORAnthropicServerToolUseBlock' + text: '#/components/schemas/AnthropicTextBlock' + text_editor_code_execution_tool_result: '#/components/schemas/AnthropicTextEditorCodeExecutionToolResult' + thinking: '#/components/schemas/AnthropicThinkingBlock' + tool_search_tool_result: '#/components/schemas/AnthropicToolSearchToolResult' + tool_use: '#/components/schemas/AnthropicToolUseBlock' + web_fetch_tool_result: '#/components/schemas/AnthropicWebFetchToolResult' + web_search_tool_result: '#/components/schemas/AnthropicWebSearchToolResult' + propertyName: type + example: + citations: null + text: Hello, world! + type: text + oneOf: + - $ref: '#/components/schemas/AnthropicTextBlock' + - $ref: '#/components/schemas/AnthropicToolUseBlock' + - $ref: '#/components/schemas/AnthropicThinkingBlock' + - $ref: '#/components/schemas/AnthropicRedactedThinkingBlock' + - $ref: '#/components/schemas/ORAnthropicServerToolUseBlock' + - $ref: '#/components/schemas/AnthropicWebSearchToolResult' + - $ref: '#/components/schemas/AnthropicWebFetchToolResult' + - $ref: '#/components/schemas/AnthropicCodeExecutionToolResult' + - $ref: '#/components/schemas/AnthropicBashCodeExecutionToolResult' + - $ref: '#/components/schemas/AnthropicTextEditorCodeExecutionToolResult' + - $ref: '#/components/schemas/AnthropicToolSearchToolResult' + - $ref: '#/components/schemas/AnthropicContainerUpload' + - $ref: '#/components/schemas/AnthropicCompactionBlock' + - $ref: '#/components/schemas/AnthropicAdvisorToolResult' + ORAnthropicNullableCaller: + discriminator: + mapping: + code_execution_20250825: '#/components/schemas/AnthropicCodeExecution20250825Caller' + code_execution_20260120: '#/components/schemas/AnthropicCodeExecution20260120Caller' + direct: '#/components/schemas/AnthropicDirectCaller' + propertyName: type + example: null + oneOf: + - $ref: '#/components/schemas/AnthropicDirectCaller' + - $ref: '#/components/schemas/AnthropicCodeExecution20250825Caller' + - $ref: '#/components/schemas/AnthropicCodeExecution20260120Caller' + - nullable: true + ORAnthropicServerToolUseBlock: + example: + caller: null + id: srvtoolu_01abc + input: {} + name: advisor + type: server_tool_use + properties: + caller: + $ref: '#/components/schemas/ORAnthropicNullableCaller' + id: + type: string + input: + nullable: true + name: + type: string + type: + enum: + - server_tool_use + type: string + required: + - type + - id + - name + type: object + ORAnthropicStopReason: + enum: + - end_turn + - max_tokens + - stop_sequence + - tool_use + - pause_turn + - refusal + - compaction + - null + example: end_turn + nullable: true + type: string + x-speakeasy-unknown-values: allow + OutputAdvisorServerToolItem: + description: An openrouter:advisor server tool output item + example: + id: st_tmp_abc123 + status: completed + type: openrouter:advisor + properties: + advice: + description: The advisor model's response (the advice text returned to the executor). + type: string + error: + description: Error message when the advisor call did not produce advice. + type: string + id: + type: string + instance_name: + description: >- + Provider-safe function name of the specific advisor instance that produced this item (e.g. `openrouter_advisor__1`). Present only when more than one advisor tool is configured; omitted for the default single advisor. Echo this field back unchanged so the advisor's cross-request memory stays namespaced to the correct instance. This identity is positional: it is derived from the index of the advisor entry in the request `tools` array, so clients must keep the order of advisor tool entries stable across requests in a conversation. Reordering or inserting advisor entries shifts these names and causes each advisor's cross-request memory to be attributed to the wrong instance. + example: openrouter_advisor__1 + type: string + model: + description: Slug of the advisor model that was consulted. + type: string + prompt: + description: The prompt the executor sent to the advisor. + type: string + status: + $ref: '#/components/schemas/ToolCallStatus' + type: + enum: + - openrouter:advisor + type: string + required: + - status + - type + type: object + OutputApplyPatchCallItem: + description: >- + A native `apply_patch_call` output item matching OpenAI's Responses API shape. Emitted when the client requested the `apply_patch` shorthand. + example: + call_id: call_abc123 + id: apc_abc123 + operation: + diff: |- + @@ function main() { + + console.log("hi"); + } + path: /src/main.ts + type: update_file + status: completed + type: apply_patch_call + properties: + call_id: + type: string + id: + type: string + operation: + $ref: '#/components/schemas/ApplyPatchCallOperation' + status: + $ref: '#/components/schemas/ApplyPatchCallStatus' + type: + enum: + - apply_patch_call + type: string + required: + - type + - id + - call_id + - status + - operation + type: object + OutputApplyPatchServerToolItem: + description: >- + An openrouter:apply_patch server tool output item. The turn halts when validation succeeds so the client can apply the patch and echo an `apply_patch_call_output` on the next turn. + example: + call_id: call_abc123 + id: apc_abc123 + operation: + diff: |- + @@ function main() { + + console.log("hi"); + } + path: /src/main.ts + type: update_file + status: completed + type: openrouter:apply_patch + properties: + call_id: + type: string + id: + type: string + operation: + $ref: '#/components/schemas/ApplyPatchCallOperation' + status: + $ref: '#/components/schemas/ToolCallStatus' + type: + enum: + - openrouter:apply_patch + type: string + required: + - status + - type + type: object + OutputBashServerToolItem: + description: An openrouter:bash server tool output item + example: + command: ls -la + exitCode: 0 + id: bash_tmp_abc123 + status: completed + stdout: | + total 0 + type: openrouter:bash + properties: + command: + type: string + exitCode: + type: integer + id: + type: string + status: + $ref: '#/components/schemas/ToolCallStatus' + stderr: + type: string + stdout: + type: string + type: + enum: + - openrouter:bash + type: string + required: + - status + - type + type: object + OutputBrowserUseServerToolItem: + description: An openrouter:browser_use server tool output item + example: + action: screenshot + id: bu_tmp_abc123 + status: completed + type: openrouter:browser_use + properties: + action: + type: string + id: + type: string + screenshotB64: + type: string + status: + $ref: '#/components/schemas/ToolCallStatus' + type: + enum: + - openrouter:browser_use + type: string + required: + - status + - type + type: object + OutputCodeInterpreterCallItem: + allOf: + - $ref: '#/components/schemas/CodeInterpreterCallItem' + - properties: {} + type: object + description: A code interpreter execution call with outputs + example: + code: print("hello") + container_id: ctr-xyz789 + id: ci-abc123 + outputs: + - logs: | + hello + type: logs + status: completed + type: code_interpreter_call + OutputCodeInterpreterServerToolItem: + description: An openrouter:code_interpreter server tool output item + example: + code: print("hello") + id: ci_tmp_abc123 + language: python + status: completed + stdout: | + hello + type: openrouter:code_interpreter + properties: + code: + type: string + exitCode: + type: integer + id: + type: string + language: + type: string + status: + $ref: '#/components/schemas/ToolCallStatus' + stderr: + type: string + stdout: + type: string + type: + enum: + - openrouter:code_interpreter + type: string + required: + - status + - type + type: object + OutputComputerCallItem: + example: + action: + type: screenshot + call_id: call-abc123 + id: cu-abc123 + pending_safety_checks: [] + status: completed + type: computer_call + properties: + action: + nullable: true + call_id: + type: string + id: + type: string + pending_safety_checks: + items: + properties: + code: + type: string + id: + type: string + message: + type: string + required: + - id + - code + - message + type: object + type: array + status: + enum: + - completed + - incomplete + - in_progress + type: string + x-speakeasy-unknown-values: allow + type: + enum: + - computer_call + type: string + required: + - type + - call_id + - status + - pending_safety_checks + type: object + OutputCustomToolCallItem: + description: >- + A call to a custom (freeform-grammar) tool created by the model — distinct from `function_call`. Used for tools like Codex CLI's `apply_patch` whose payload is opaque text rather than JSON arguments. + example: + call_id: call-abc123 + id: ctc-abc123 + input: |- + *** Begin Patch + *** End Patch + name: apply_patch + type: custom_tool_call + properties: + call_id: + type: string + id: + type: string + input: + type: string + name: + type: string + namespace: + description: Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) + type: string + type: + enum: + - custom_tool_call + type: string + required: + - type + - name + - input + - call_id + type: object + OutputDatetimeItem: + description: An openrouter:datetime server tool output item + example: + datetime: '2026-03-12T14:30:00.000Z' + id: dt_tmp_abc123 + status: completed + timezone: UTC + type: openrouter:datetime + properties: + datetime: + description: ISO 8601 datetime string + type: string + id: + type: string + status: + $ref: '#/components/schemas/ToolCallStatus' + timezone: + description: IANA timezone name + type: string + type: + enum: + - openrouter:datetime + type: string + required: + - status + - type + - datetime + - timezone + type: object + OutputFileSearchCallItem: + allOf: + - $ref: '#/components/schemas/OutputItemFileSearchCall' + - properties: {} + type: object + example: + id: fs-abc123 + queries: + - search term + results: [] + status: completed + type: file_search_call + OutputFileSearchServerToolItem: + description: An openrouter:file_search server tool output item + example: + id: fs_tmp_abc123 + queries: + - search term + status: completed + type: openrouter:file_search + properties: + id: + type: string + queries: + items: + type: string + type: array + status: + $ref: '#/components/schemas/ToolCallStatus' + type: + enum: + - openrouter:file_search + type: string + required: + - status + - type + type: object + OutputFunctionCallItem: + allOf: + - $ref: '#/components/schemas/OutputItemFunctionCall' + - properties: {} + type: object + example: + arguments: '{"location":"San Francisco"}' + call_id: call-abc123 + id: fc-abc123 + name: get_weather + status: completed + type: function_call + OutputFusionServerToolItem: + description: An openrouter:fusion server tool output item + example: + id: st_tmp_abc123 + status: completed + type: openrouter:fusion + properties: + analysis: + $ref: '#/components/schemas/FusionAnalysisResult' + error: + description: Error message when the fusion run did not produce an analysis result. + type: string + failed_models: + description: >- + Models that were requested as part of the analysis panel but did not produce a response. Present when at least one requested analysis model failed. The fusion result is still usable but was produced from a degraded panel. + items: + properties: + error: + description: Error message describing why the model failed. + type: string + model: + description: Slug of the analysis model that failed. + type: string + status_code: + description: HTTP status code from the upstream response, when available (e.g. 402, 429). + type: integer + required: + - model + - error + type: object + type: array + failure_reason: + description: >- + Typed failure reason when the fusion run failed. Possible values include: all_panels_failed, insufficient_credits, rate_limited, judge_not_valid_json, judge_schema_mismatch, judge_upstream_error, judge_empty_completion. + type: string + id: + type: string + responses: + description: Analysis models that produced a response in this fusion run, with each model's full panel content. + items: + properties: + content: + type: string + model: + type: string + required: + - model + type: object + type: array + status: + $ref: '#/components/schemas/ToolCallStatus' + type: + enum: + - openrouter:fusion + type: string + required: + - status + - type + type: object + OutputImageGenerationCallItem: + allOf: + - $ref: '#/components/schemas/OutputItemImageGenerationCall' + - properties: {} + type: object + example: + id: img-abc123 + result: null + status: completed + type: image_generation_call + OutputImageGenerationServerToolItem: + description: An openrouter:image_generation server tool output item + example: + id: ig_tmp_abc123 + imageUrl: https://example.com/image.png + result: https://example.com/image.png + status: completed + type: openrouter:image_generation + properties: + id: + type: string + imageB64: + type: string + imageUrl: + type: string + result: + description: The generated image as a base64-encoded string or URL, matching OpenAI image_generation_call format + nullable: true + type: string + revisedPrompt: + type: string + status: + $ref: '#/components/schemas/ToolCallStatus' + type: + enum: + - openrouter:image_generation + type: string + required: + - status + - type + type: object + OutputItemAddedEvent: + description: Event emitted when a new output item is added to the response + example: + item: + content: [] + id: item-1 + role: assistant + status: in_progress + type: message + output_index: 0 + sequence_number: 2 + type: response.output_item.added + properties: + item: + discriminator: + mapping: + apply_patch_call: '#/components/schemas/OutputItemApplyPatchCall' + custom_tool_call: '#/components/schemas/OutputItemCustomToolCall' + file_search_call: '#/components/schemas/OutputItemFileSearchCall' + function_call: '#/components/schemas/OutputItemFunctionCall' + image_generation_call: '#/components/schemas/OutputItemImageGenerationCall' + message: '#/components/schemas/OutputMessage' + reasoning: '#/components/schemas/OutputItemReasoning' + web_search_call: '#/components/schemas/OutputItemWebSearchCall' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OutputMessage' + - $ref: '#/components/schemas/OutputItemReasoning' + - $ref: '#/components/schemas/OutputItemFunctionCall' + - $ref: '#/components/schemas/OutputItemCustomToolCall' + - $ref: '#/components/schemas/OutputItemWebSearchCall' + - $ref: '#/components/schemas/OutputItemFileSearchCall' + - $ref: '#/components/schemas/OutputItemImageGenerationCall' + - $ref: '#/components/schemas/OutputItemApplyPatchCall' + output_index: + type: integer + sequence_number: + type: integer + type: + enum: + - response.output_item.added + type: string + required: + - type + - output_index + - item + - sequence_number + type: object + OutputItemApplyPatchCall: + example: + call_id: call_abc123 + id: apc_abc123 + operation: + diff: |- + @@ function main() { + + console.log("hi"); + } + path: /src/main.ts + type: update_file + status: completed + type: apply_patch_call + properties: + call_id: + type: string + created_by: + type: string + id: + type: string + operation: + discriminator: + mapping: + create_file: '#/components/schemas/ApplyPatchCreateFileOperation' + delete_file: '#/components/schemas/ApplyPatchDeleteFileOperation' + update_file: '#/components/schemas/ApplyPatchUpdateFileOperation' + propertyName: type + oneOf: + - $ref: '#/components/schemas/ApplyPatchCreateFileOperation' + - $ref: '#/components/schemas/ApplyPatchUpdateFileOperation' + - $ref: '#/components/schemas/ApplyPatchDeleteFileOperation' + status: + enum: + - in_progress + - completed + type: string + x-speakeasy-unknown-values: allow + type: + enum: + - apply_patch_call + type: string + required: + - type + - id + - call_id + - operation + - status + type: object + OutputItemCustomToolCall: + example: + call_id: call-abc123 + id: ctc-abc123 + input: |- + *** Begin Patch + *** End Patch + name: apply_patch + type: custom_tool_call + properties: + call_id: + type: string + id: + type: string + input: + type: string + name: + type: string + namespace: + description: Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) + type: string + type: + enum: + - custom_tool_call + type: string + required: + - type + - name + - input + - call_id + type: object + OutputItemDoneEvent: + description: Event emitted when an output item is complete + example: + item: + content: + - annotations: [] + text: Hello! How can I help you? + type: output_text + id: item-1 + role: assistant + status: completed + type: message + output_index: 0 + sequence_number: 8 + type: response.output_item.done + properties: + item: + discriminator: + mapping: + apply_patch_call: '#/components/schemas/OutputItemApplyPatchCall' + custom_tool_call: '#/components/schemas/OutputItemCustomToolCall' + file_search_call: '#/components/schemas/OutputItemFileSearchCall' + function_call: '#/components/schemas/OutputItemFunctionCall' + image_generation_call: '#/components/schemas/OutputItemImageGenerationCall' + message: '#/components/schemas/OutputMessage' + reasoning: '#/components/schemas/OutputItemReasoning' + web_search_call: '#/components/schemas/OutputItemWebSearchCall' + propertyName: type + oneOf: + - $ref: '#/components/schemas/OutputMessage' + - $ref: '#/components/schemas/OutputItemReasoning' + - $ref: '#/components/schemas/OutputItemFunctionCall' + - $ref: '#/components/schemas/OutputItemCustomToolCall' + - $ref: '#/components/schemas/OutputItemWebSearchCall' + - $ref: '#/components/schemas/OutputItemFileSearchCall' + - $ref: '#/components/schemas/OutputItemImageGenerationCall' + - $ref: '#/components/schemas/OutputItemApplyPatchCall' + output_index: + type: integer + sequence_number: + type: integer + type: + enum: + - response.output_item.done + type: string + required: + - type + - output_index + - item + - sequence_number + type: object + OutputItemFileSearchCall: + example: + id: filesearch-abc123 + queries: + - machine learning algorithms + - neural networks + status: completed + type: file_search_call + properties: + id: + type: string + queries: + items: + type: string + type: array + status: + $ref: '#/components/schemas/WebSearchStatus' + type: + enum: + - file_search_call + type: string + required: + - type + - id + - queries + - status + type: object + OutputItemFunctionCall: + example: + arguments: '{"location":"San Francisco","unit":"celsius"}' + call_id: call-abc123 + id: call-abc123 + name: get_weather + type: function_call + properties: + arguments: + type: string + call_id: + type: string + id: + type: string + name: + type: string + namespace: + description: Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) + type: string + status: + anyOf: + - enum: + - completed + type: string + - enum: + - incomplete + type: string + - enum: + - in_progress + type: string + type: + enum: + - function_call + type: string + required: + - type + - name + - arguments + - call_id + type: object + OutputItemImageGenerationCall: + example: + id: imagegen-abc123 + result: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== + status: completed + type: image_generation_call + properties: + id: + type: string + result: + default: null + nullable: true + type: string + status: + $ref: '#/components/schemas/ImageGenerationStatus' + type: + enum: + - image_generation_call + type: string + required: + - type + - id + - status + type: object + OutputItemReasoning: + example: + id: reasoning-abc123 + summary: + - text: Analyzed the problem using first principles + type: summary_text + type: reasoning + properties: + content: + items: + $ref: '#/components/schemas/ReasoningTextContent' + type: array + encrypted_content: + nullable: true + type: string + id: + type: string + status: + anyOf: + - enum: + - completed + type: string + - enum: + - incomplete + type: string + - enum: + - in_progress + type: string + summary: + items: + $ref: '#/components/schemas/ReasoningSummaryText' + type: array + type: + enum: + - reasoning + type: string + required: + - type + - id + - summary + type: object + OutputItems: + description: An output item from the response + discriminator: + mapping: + apply_patch_call: '#/components/schemas/OutputApplyPatchCallItem' + code_interpreter_call: '#/components/schemas/OutputCodeInterpreterCallItem' + computer_call: '#/components/schemas/OutputComputerCallItem' + custom_tool_call: '#/components/schemas/OutputCustomToolCallItem' + file_search_call: '#/components/schemas/OutputFileSearchCallItem' + function_call: '#/components/schemas/OutputFunctionCallItem' + image_generation_call: '#/components/schemas/OutputImageGenerationCallItem' + message: '#/components/schemas/OutputMessageItem' + openrouter:advisor: '#/components/schemas/OutputAdvisorServerToolItem' + openrouter:apply_patch: '#/components/schemas/OutputApplyPatchServerToolItem' + openrouter:bash: '#/components/schemas/OutputBashServerToolItem' + openrouter:browser_use: '#/components/schemas/OutputBrowserUseServerToolItem' + openrouter:code_interpreter: '#/components/schemas/OutputCodeInterpreterServerToolItem' + openrouter:datetime: '#/components/schemas/OutputDatetimeItem' + openrouter:experimental__search_models: '#/components/schemas/OutputSearchModelsServerToolItem' + openrouter:file_search: '#/components/schemas/OutputFileSearchServerToolItem' + openrouter:fusion: '#/components/schemas/OutputFusionServerToolItem' + openrouter:image_generation: '#/components/schemas/OutputImageGenerationServerToolItem' + openrouter:mcp: '#/components/schemas/OutputMcpServerToolItem' + openrouter:memory: '#/components/schemas/OutputMemoryServerToolItem' + openrouter:subagent: '#/components/schemas/OutputSubagentServerToolItem' + openrouter:text_editor: '#/components/schemas/OutputTextEditorServerToolItem' + openrouter:tool_search: '#/components/schemas/OutputToolSearchServerToolItem' + openrouter:web_fetch: '#/components/schemas/OutputWebFetchServerToolItem' + openrouter:web_search: '#/components/schemas/OutputWebSearchServerToolItem' + reasoning: '#/components/schemas/OutputReasoningItem' + shell_call: '#/components/schemas/OutputShellCallItem' + shell_call_output: '#/components/schemas/OutputShellCallOutputItem' + web_search_call: '#/components/schemas/OutputWebSearchCallItem' + propertyName: type + example: + content: + - text: Hello! How can I help you today? + type: output_text + id: msg-abc123 + role: assistant + status: completed + type: message + oneOf: + - $ref: '#/components/schemas/OutputMessageItem' + - $ref: '#/components/schemas/OutputReasoningItem' + - $ref: '#/components/schemas/OutputFunctionCallItem' + - $ref: '#/components/schemas/OutputWebSearchCallItem' + - $ref: '#/components/schemas/OutputFileSearchCallItem' + - $ref: '#/components/schemas/OutputImageGenerationCallItem' + - $ref: '#/components/schemas/OutputCodeInterpreterCallItem' + - $ref: '#/components/schemas/OutputComputerCallItem' + - $ref: '#/components/schemas/OutputDatetimeItem' + - $ref: '#/components/schemas/OutputWebSearchServerToolItem' + - $ref: '#/components/schemas/OutputCodeInterpreterServerToolItem' + - $ref: '#/components/schemas/OutputFileSearchServerToolItem' + - $ref: '#/components/schemas/OutputImageGenerationServerToolItem' + - $ref: '#/components/schemas/OutputBrowserUseServerToolItem' + - $ref: '#/components/schemas/OutputBashServerToolItem' + - $ref: '#/components/schemas/OutputTextEditorServerToolItem' + - $ref: '#/components/schemas/OutputApplyPatchServerToolItem' + - $ref: '#/components/schemas/OutputApplyPatchCallItem' + - $ref: '#/components/schemas/OutputShellCallItem' + - $ref: '#/components/schemas/OutputShellCallOutputItem' + - $ref: '#/components/schemas/OutputWebFetchServerToolItem' + - $ref: '#/components/schemas/OutputToolSearchServerToolItem' + - $ref: '#/components/schemas/OutputMemoryServerToolItem' + - $ref: '#/components/schemas/OutputMcpServerToolItem' + - $ref: '#/components/schemas/OutputSearchModelsServerToolItem' + - $ref: '#/components/schemas/OutputFusionServerToolItem' + - $ref: '#/components/schemas/OutputAdvisorServerToolItem' + - $ref: '#/components/schemas/OutputSubagentServerToolItem' + - $ref: '#/components/schemas/OutputCustomToolCallItem' + OutputItemWebSearchCall: + example: + action: + query: OpenAI API + type: search + id: search-abc123 + status: completed + type: web_search_call + properties: + action: + oneOf: + - properties: + queries: + items: + type: string + type: array + query: + type: string + sources: + items: + $ref: '#/components/schemas/WebSearchSource' + type: array + type: + enum: + - search + type: string + required: + - type + - query + type: object + - properties: + type: + enum: + - open_page + type: string + url: + nullable: true + type: string + required: + - type + type: object + - properties: + pattern: + type: string + type: + enum: + - find_in_page + type: string + url: + type: string + required: + - type + - pattern + - url + type: object + id: + type: string + status: + $ref: '#/components/schemas/WebSearchStatus' + type: + enum: + - web_search_call + type: string + required: + - type + - id + - status + type: object + OutputMcpServerToolItem: + description: An openrouter:mcp server tool output item + example: + id: mcp_tmp_abc123 + serverLabel: my-server + status: completed + toolName: get_data + type: openrouter:mcp + properties: + id: + type: string + serverLabel: + type: string + status: + $ref: '#/components/schemas/ToolCallStatus' + toolName: + type: string + type: + enum: + - openrouter:mcp + type: string + required: + - status + - type + type: object + OutputMemoryServerToolItem: + description: An openrouter:memory server tool output item + example: + action: read + id: mem_tmp_abc123 + key: user_preference + status: completed + type: openrouter:memory + properties: + action: + enum: + - read + - write + - delete + type: string + x-speakeasy-unknown-values: allow + id: + type: string + key: + type: string + status: + $ref: '#/components/schemas/ToolCallStatus' + type: + enum: + - openrouter:memory + type: string + value: + nullable: true + required: + - status + - type + type: object + OutputMessage: + example: + content: + - text: Hello! How can I help you today? + type: output_text + id: msg-abc123 + role: assistant + status: completed + type: message + properties: + content: + items: + anyOf: + - $ref: '#/components/schemas/ResponseOutputText' + - $ref: '#/components/schemas/OpenAIResponsesRefusalContent' + type: array + id: + type: string + phase: + anyOf: + - enum: + - commentary + type: string + - enum: + - final_answer + type: string + - nullable: true + description: >- + The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer` for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages. + role: + enum: + - assistant + type: string + status: + anyOf: + - enum: + - completed + type: string + - enum: + - incomplete + type: string + - enum: + - in_progress + type: string + type: + enum: + - message + type: string + required: + - id + - role + - type + - content + type: object + OutputMessageItem: + allOf: + - $ref: '#/components/schemas/OutputMessage' + - properties: {} + type: object + description: An output message item + example: + content: + - annotations: [] + text: Hello! How can I help you? + type: output_text + id: msg-123 + role: assistant + status: completed + type: message + OutputModality: + enum: + - text + - image + - embeddings + - audio + - video + - rerank + - speech + - transcription + example: text + type: string + x-speakeasy-unknown-values: allow + OutputModalityEnum: + enum: + - text + - image + example: text + type: string + x-speakeasy-unknown-values: allow + OutputReasoningItem: + allOf: + - $ref: '#/components/schemas/OutputItemReasoning' + - properties: + content: + items: + $ref: '#/components/schemas/ReasoningTextContent' + nullable: true + type: array + format: + $ref: '#/components/schemas/ReasoningFormat' + signature: + description: A signature for the reasoning content, used for verification + example: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj... + nullable: true + type: string + type: object + description: An output item containing reasoning + example: + content: + - text: First, we analyze the problem... + type: reasoning_text + format: anthropic-claude-v1 + id: reasoning-123 + signature: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj... + status: completed + summary: + - text: Analyzed the problem and found the optimal solution. + type: summary_text + type: reasoning + OutputSearchModelsServerToolItem: + description: An openrouter:experimental__search_models server tool output item + example: + arguments: '{"query":"Claude Opus"}' + id: sm_tmp_abc123 + query: Claude Opus + status: completed + type: openrouter:experimental__search_models + properties: + arguments: + description: The JSON arguments submitted to the search tool (e.g. {"query":"Claude"}) + type: string + id: + type: string + query: + type: string + status: + $ref: '#/components/schemas/ToolCallStatus' + type: + enum: + - openrouter:experimental__search_models + type: string + required: + - status + - type + type: object + OutputShellCallItem: + description: >- + A native `shell_call` output item matching OpenAI's Responses API shape. Emitted for the sandbox-backed `shell` tool. + example: + action: + commands: + - echo hello + max_output_length: null + timeout_ms: null + call_id: call_abc123 + id: shc_abc123 + status: completed + type: shell_call + properties: + action: + properties: + commands: + items: + type: string + type: array + max_output_length: + nullable: true + type: integer + timeout_ms: + nullable: true + type: integer + required: + - commands + - max_output_length + - timeout_ms + type: object + call_id: + type: string + id: + type: string + status: + $ref: '#/components/schemas/ShellCallStatus' + type: + enum: + - shell_call + type: string + required: + - type + - id + - call_id + - status + type: object + OutputShellCallOutputItem: + description: >- + A native `shell_call_output` item matching OpenAI's Responses API shape. Carries per-command stdout, stderr, and the exit/timeout outcome. + example: + call_id: call_abc123 + id: sho_abc123 + output: + - outcome: + exit_code: 0 + type: exit + stderr: '' + stdout: | + hello + status: completed + type: shell_call_output + properties: + call_id: + type: string + id: + type: string + max_output_length: + nullable: true + type: integer + output: + items: + properties: + outcome: + oneOf: + - properties: + exit_code: + type: integer + type: + enum: + - exit + type: string + required: + - type + - exit_code + type: object + - properties: + type: + enum: + - timeout + type: string + required: + - type + type: object + stderr: + type: string + stdout: + type: string + required: + - stdout + - stderr + - outcome + type: object + type: array + status: + $ref: '#/components/schemas/ShellCallStatus' + type: + enum: + - shell_call_output + type: string + required: + - type + - id + - call_id + - status + - output + type: object + OutputSubagentServerToolItem: + description: An openrouter:subagent server tool output item + example: + id: st_tmp_abc123 + status: completed + type: openrouter:subagent + properties: + error: + description: Error message when the subagent task did not produce an outcome. + type: string + id: + type: string + model: + description: Slug of the worker model that executed the task. + type: string + outcome: + description: The worker model's result (the outcome text returned to the delegating model). + type: string + status: + $ref: '#/components/schemas/ToolCallStatus' + task_description: + description: The task description the delegating model sent to the worker. + type: string + task_name: + description: The short task identifier the delegating model supplied. + type: string + type: + enum: + - openrouter:subagent + type: string + required: + - status + - type + type: object + OutputTextEditorServerToolItem: + description: An openrouter:text_editor server tool output item + example: + command: view + filePath: /src/main.ts + id: te_tmp_abc123 + status: completed + type: openrouter:text_editor + properties: + command: + enum: + - view + - create + - str_replace + - insert + type: string + x-speakeasy-unknown-values: allow + filePath: + type: string + id: + type: string + status: + $ref: '#/components/schemas/ToolCallStatus' + type: + enum: + - openrouter:text_editor + type: string + required: + - status + - type + type: object + OutputToolSearchServerToolItem: + description: An openrouter:tool_search server tool output item + example: + id: ts_tmp_abc123 + query: weather tools + status: completed + type: openrouter:tool_search + properties: + id: + type: string + query: + type: string + status: + $ref: '#/components/schemas/ToolCallStatus' + type: + enum: + - openrouter:tool_search + type: string + required: + - status + - type + type: object + OutputWebFetchServerToolItem: + description: An openrouter:web_fetch server tool output item + example: + httpStatus: 200 + id: wf_tmp_abc123 + status: completed + title: Example Domain + type: openrouter:web_fetch + url: https://example.com + properties: + content: + type: string + error: + description: The error message if the fetch failed. + type: string + httpStatus: + description: The HTTP status code returned by the upstream URL fetch. + type: integer + id: + type: string + status: + $ref: '#/components/schemas/ToolCallStatus' + title: + type: string + type: + enum: + - openrouter:web_fetch + type: string + url: + type: string + required: + - status + - type + type: object + OutputWebSearchCallItem: + allOf: + - $ref: '#/components/schemas/OutputItemWebSearchCall' + - properties: {} + type: object + example: + id: ws-abc123 + status: completed + type: web_search_call + OutputWebSearchServerToolItem: + description: An openrouter:web_search server tool output item + example: + action: + query: latest AI news + type: search + id: ws_tmp_abc123 + status: completed + type: openrouter:web_search + properties: + action: + description: >- + The search action performed, matching OpenAI web_search_call.action shape. Includes the query the model issued and optional source URLs returned by the search provider. + properties: + query: + type: string + sources: + items: + properties: + type: + enum: + - url + type: string + url: + type: string + required: + - type + - url + type: object + type: array + type: + enum: + - search + type: string + required: + - type + - query + type: object + id: + type: string + status: + $ref: '#/components/schemas/ToolCallStatus' + type: + enum: + - openrouter:web_search + type: string + required: + - status + - type + type: object + Parameter: + enum: + - temperature + - top_p + - top_k + - min_p + - top_a + - frequency_penalty + - presence_penalty + - repetition_penalty + - max_tokens + - max_completion_tokens + - logit_bias + - logprobs + - top_logprobs + - seed + - response_format + - structured_outputs + - stop + - tools + - tool_choice + - parallel_tool_calls + - include_reasoning + - reasoning + - reasoning_effort + - web_search_options + - verbosity + example: temperature + type: string + x-speakeasy-unknown-values: allow + ParetoRouterPlugin: + example: + enabled: true + id: pareto-router + min_coding_score: 0.8 + properties: + enabled: + description: Set to false to disable the pareto-router plugin for this request. Defaults to true. + type: boolean + id: + enum: + - pareto-router + type: string + min_coding_score: + description: >- + Minimum desired coding score between 0 and 1, where 1 is best. Higher values select from stronger coding models (sourced from Artificial Analysis coding percentiles). Maps internally to one of three tiers (low, medium, high). Omit to use the router default tier. + example: 0.8 + format: double + maximum: 1 + minimum: 0 + type: number + required: + - id + type: object + PayloadTooLargeResponse: + description: Payload Too Large - Request payload exceeds size limits + example: + error: + code: 413 + message: Request payload too large + properties: + error: + $ref: '#/components/schemas/PayloadTooLargeResponseErrorData' + openrouter_metadata: + additionalProperties: + nullable: true + nullable: true + type: object + user_id: + nullable: true + type: string + required: + - error + type: object + PayloadTooLargeResponseErrorData: + description: Error data for PayloadTooLargeResponse + example: + code: 413 + message: Request payload too large + properties: + code: + type: integer + message: + type: string + metadata: + additionalProperties: + nullable: true + nullable: true + type: object + required: + - code + - message + type: object + PaymentRequiredResponse: + description: Payment Required - Insufficient credits or quota to complete request + example: + error: + code: 402 + message: Insufficient credits. Add more using https://openrouter.ai/credits + properties: + error: + $ref: '#/components/schemas/PaymentRequiredResponseErrorData' + openrouter_metadata: + additionalProperties: + nullable: true + nullable: true + type: object + user_id: + nullable: true + type: string + required: + - error + type: object + PaymentRequiredResponseErrorData: + description: Error data for PaymentRequiredResponse + example: + code: 402 + message: Insufficient credits. Add more using https://openrouter.ai/credits + properties: + code: + type: integer + message: + type: string + metadata: + additionalProperties: + nullable: true + nullable: true + type: object + required: + - code + - message + type: object + PDFParserEngine: + anyOf: + - enum: + - mistral-ocr + - native + - cloudflare-ai + type: string + x-speakeasy-unknown-values: allow + - enum: + - pdf-text + type: string + description: >- + The engine to use for parsing PDF files. "pdf-text" is deprecated and automatically redirected to "cloudflare-ai". + example: cloudflare-ai + PDFParserOptions: + description: Options for PDF parsing. + example: + engine: cloudflare-ai + properties: + engine: + $ref: '#/components/schemas/PDFParserEngine' + type: object + PercentileLatencyCutoffs: + description: Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred. + example: + p50: 5 + p90: 10 + properties: + p50: + description: Maximum p50 latency (seconds) + format: double + nullable: true + type: number + p75: + description: Maximum p75 latency (seconds) + format: double + nullable: true + type: number + p90: + description: Maximum p90 latency (seconds) + format: double + nullable: true + type: number + p99: + description: Maximum p99 latency (seconds) + format: double + nullable: true + type: number + type: object + PercentileStats: + description: >- + Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests. + example: + p50: 25.5 + p75: 35.2 + p90: 48.7 + p99: 85.3 + nullable: true + properties: + p50: + description: Median (50th percentile) + example: 25.5 + format: double + type: number + p75: + description: 75th percentile + example: 35.2 + format: double + type: number + p90: + description: 90th percentile + example: 48.7 + format: double + type: number + p99: + description: 99th percentile + example: 85.3 + format: double + type: number + required: + - p50 + - p75 + - p90 + - p99 + type: object + PercentileThroughputCutoffs: + description: Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred. + example: + p50: 100 + p90: 50 + properties: + p50: + description: Minimum p50 throughput (tokens/sec) + format: double + nullable: true + type: number + p75: + description: Minimum p75 throughput (tokens/sec) + format: double + nullable: true + type: number + p90: + description: Minimum p90 throughput (tokens/sec) + format: double + nullable: true + type: number + p99: + description: Minimum p99 throughput (tokens/sec) + format: double + nullable: true + type: number + type: object + PerRequestLimits: + description: Per-request token limits + example: + completion_tokens: 1000 + prompt_tokens: 1000 + nullable: true + properties: + completion_tokens: + description: Maximum completion tokens per request + example: 1000 + type: number + prompt_tokens: + description: Maximum prompt tokens per request + example: 1000 + type: number + required: + - prompt_tokens + - completion_tokens + type: object + PipelineStage: + example: + data: + action: redacted + engines: + - presidio + flagged: true + matched_entity_types: + - EMAIL + - PHONE + name: content-filter + summary: PII redacted via Presidio (EMAIL, PHONE) + type: guardrail + properties: + cost_usd: + format: double + nullable: true + type: number + data: + additionalProperties: + nullable: true + type: object + guardrail_id: + type: string + guardrail_scope: + type: string + name: + type: string + summary: + type: string + type: + $ref: '#/components/schemas/PipelineStageType' + required: + - type + - name + type: object + PipelineStageType: + description: >- + Categorical kind of a pipeline stage. Multiple plugins can share a type (e.g. all guardrail-level plugins emit `guardrail`); the `name` field disambiguates which plugin emitted it. + enum: + - guardrail + - plugin + - server_tools + - response_healing + - context_compression + example: guardrail + type: string + x-speakeasy-unknown-values: allow + PreferredMaxLatency: + anyOf: + - format: double + type: number + - $ref: '#/components/schemas/PercentileLatencyCutoffs' + - nullable: true + description: >- + Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. + example: 5 + PreferredMinThroughput: + anyOf: + - format: double + type: number + - $ref: '#/components/schemas/PercentileThroughputCutoffs' + - nullable: true + description: >- + Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. + example: 100 + Preset: + description: A preset without version details. + example: + created_at: '2026-04-20T10:00:00Z' + creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 + description: null + designated_version_id: 550e8400-e29b-41d4-a716-446655440000 + id: 650e8400-e29b-41d4-a716-446655440001 + name: my-preset + slug: my-preset + status: active + status_updated_at: null + updated_at: '2026-04-20T10:00:00Z' + workspace_id: 750e8400-e29b-41d4-a716-446655440002 + properties: + created_at: + type: string + creator_user_id: + nullable: true + type: string + description: + nullable: true + type: string + designated_version_id: + nullable: true + type: string + id: + type: string + name: + type: string + slug: + type: string + status: + $ref: '#/components/schemas/PresetStatus' + status_updated_at: + nullable: true + type: string + updated_at: + type: string + workspace_id: + nullable: true + type: string + required: + - id + - creator_user_id + - workspace_id + - name + - slug + - description + - status + - designated_version_id + - created_at + - updated_at + - status_updated_at + type: object + PresetDesignatedVersion: + description: A specific version of a preset, containing config and optional system prompt. + example: + config: + model: openai/gpt-4o + temperature: 0.7 + created_at: '2026-04-20T10:00:00Z' + creator_id: user_2dHFtVWx2n56w6HkM0000000000 + id: 550e8400-e29b-41d4-a716-446655440000 + preset_id: 650e8400-e29b-41d4-a716-446655440001 + system_prompt: You are a helpful assistant. + updated_at: '2026-04-20T10:00:00Z' + version: 1 + nullable: true + properties: + config: + additionalProperties: + nullable: true + type: object + created_at: + type: string + creator_id: + type: string + id: + type: string + preset_id: + type: string + system_prompt: + nullable: true + type: string + updated_at: + type: string + version: + type: integer + required: + - id + - preset_id + - creator_id + - version + - system_prompt + - config + - created_at + - updated_at + type: object + PresetStatus: + description: The status of a preset. + enum: + - active + - disabled + - archived + example: active + type: string + x-speakeasy-unknown-values: allow + PresetWithDesignatedVersion: + allOf: + - $ref: '#/components/schemas/Preset' + - properties: + designated_version: + $ref: '#/components/schemas/PresetDesignatedVersion' + required: + - designated_version + type: object + description: A preset with its currently designated version. + example: + created_at: '2026-04-20T10:00:00Z' + creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 + description: null + designated_version: + config: + model: openai/gpt-4o + temperature: 0.7 + created_at: '2026-04-20T10:00:00Z' + creator_id: user_2dHFtVWx2n56w6HkM0000000000 + id: 550e8400-e29b-41d4-a716-446655440000 + preset_id: 650e8400-e29b-41d4-a716-446655440001 + system_prompt: You are a helpful assistant. + updated_at: '2026-04-20T10:00:00Z' + version: 1 + designated_version_id: 550e8400-e29b-41d4-a716-446655440000 + id: 650e8400-e29b-41d4-a716-446655440001 + name: my-preset + slug: my-preset + status: active + status_updated_at: null + updated_at: '2026-04-20T10:00:00Z' + workspace_id: 750e8400-e29b-41d4-a716-446655440002 + Preview_20250311_WebSearchServerTool: + description: Web search preview tool configuration (2025-03-11 version) + example: + type: web_search_preview_2025_03_11 + properties: + engine: + $ref: '#/components/schemas/WebSearchEngineEnum' + filters: + $ref: '#/components/schemas/WebSearchDomainFilter' + max_results: + description: >- + Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. + example: 5 + type: integer + search_context_size: + $ref: '#/components/schemas/SearchContextSizeEnum' + type: + enum: + - web_search_preview_2025_03_11 + type: string + user_location: + $ref: '#/components/schemas/Preview_WebSearchUserLocation' + required: + - type + type: object + Preview_WebSearchServerTool: + description: Web search preview tool configuration + example: + type: web_search_preview + properties: + engine: + $ref: '#/components/schemas/WebSearchEngineEnum' + filters: + $ref: '#/components/schemas/WebSearchDomainFilter' + max_results: + description: >- + Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. + example: 5 + type: integer + search_context_size: + $ref: '#/components/schemas/SearchContextSizeEnum' + type: + enum: + - web_search_preview + type: string + user_location: + $ref: '#/components/schemas/Preview_WebSearchUserLocation' + required: + - type + type: object + Preview_WebSearchUserLocation: + example: + city: San Francisco + country: USA + region: California + timezone: America/Los_Angeles + type: approximate + nullable: true + properties: + city: + nullable: true + type: string + country: + nullable: true + type: string + region: + nullable: true + type: string + timezone: + nullable: true + type: string + type: + enum: + - approximate + type: string + required: + - type + type: object + PromptInjectionScanScope: + description: >- + Which message roles to scan for prompt injection. Only applies to the regex-prompt-injection builtin. Defaults to all_messages. + enum: + - user_only + - all_messages + example: user_only + type: string + x-speakeasy-unknown-values: allow + ProviderName: + enum: + - AkashML + - AI21 + - AionLabs + - Alibaba + - Ambient + - Baidu + - Amazon Bedrock + - Amazon Nova + - Anthropic + - Arcee AI + - AtlasCloud + - Avian + - Azure + - BaseTen + - BytePlus + - Black Forest Labs + - Cerebras + - Chutes + - Cirrascale + - Clarifai + - Cloudflare + - Cohere + - Crucible + - Crusoe + - Darkbloom + - Decart + - DeepInfra + - DeepSeek + - DekaLLM + - DigitalOcean + - Featherless + - Fireworks + - Friendli + - GMICloud + - Google + - Google AI Studio + - Groq + - Inception + - Inceptron + - InferenceNet + - Ionstream + - Infermatic + - Io Net + - Inflection + - Liquid + - Mara + - Mancer 2 + - Minimax + - ModelRun + - Mistral + - Modular + - Moonshot AI + - Morph + - NCompass + - Nebius + - Nex AGI + - NextBit + - Novita + - Nvidia + - OpenAI + - OpenInference + - Parasail + - Poolside + - Perceptron + - Perplexity + - Phala + - Recraft + - Reka + - Relace + - SambaNova + - Seed + - SiliconFlow + - Sourceful + - StepFun + - Stealth + - StreamLake + - Switchpoint + - Together + - Upstage + - Venice + - Wafer + - WandB + - Xiaomi + - xAI + - Z.AI + - FakeProvider + example: OpenAI + type: string + x-speakeasy-unknown-values: allow + ProviderOptions: + description: >- + Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. + example: + openai: + max_tokens: 1000 + properties: + 01ai: + additionalProperties: + nullable: true + type: object + ai21: + additionalProperties: + nullable: true + type: object + aion-labs: + additionalProperties: + nullable: true + type: object + akashml: + additionalProperties: + nullable: true + type: object + alibaba: + additionalProperties: + nullable: true + type: object + amazon-bedrock: + additionalProperties: + nullable: true + type: object + amazon-nova: + additionalProperties: + nullable: true + type: object + ambient: + additionalProperties: + nullable: true + type: object + anthropic: + additionalProperties: + nullable: true + type: object + anyscale: + additionalProperties: + nullable: true + type: object + arcee-ai: + additionalProperties: + nullable: true + type: object + atlas-cloud: + additionalProperties: + nullable: true + type: object + atoma: + additionalProperties: + nullable: true + type: object + avian: + additionalProperties: + nullable: true + type: object + azure: + additionalProperties: + nullable: true + type: object + baidu: + additionalProperties: + nullable: true + type: object + baseten: + additionalProperties: + nullable: true + type: object + black-forest-labs: + additionalProperties: + nullable: true + type: object + byteplus: + additionalProperties: + nullable: true + type: object + centml: + additionalProperties: + nullable: true + type: object + cerebras: + additionalProperties: + nullable: true + type: object + chutes: + additionalProperties: + nullable: true + type: object + cirrascale: + additionalProperties: + nullable: true + type: object + clarifai: + additionalProperties: + nullable: true + type: object + cloudflare: + additionalProperties: + nullable: true + type: object + cohere: + additionalProperties: + nullable: true + type: object + crofai: + additionalProperties: + nullable: true + type: object + crucible: + additionalProperties: + nullable: true + type: object + crusoe: + additionalProperties: + nullable: true + type: object + darkbloom: + additionalProperties: + nullable: true + type: object + decart: + additionalProperties: + nullable: true + type: object + deepinfra: + additionalProperties: + nullable: true + type: object + deepseek: + additionalProperties: + nullable: true + type: object + dekallm: + additionalProperties: + nullable: true + type: object + digitalocean: + additionalProperties: + nullable: true + type: object + enfer: + additionalProperties: + nullable: true + type: object + fake-provider: + additionalProperties: + nullable: true + type: object + featherless: + additionalProperties: + nullable: true + type: object + fireworks: + additionalProperties: + nullable: true + type: object + friendli: + additionalProperties: + nullable: true + type: object + gmicloud: + additionalProperties: + nullable: true + type: object + google-ai-studio: + additionalProperties: + nullable: true + type: object + google-vertex: + additionalProperties: + nullable: true + type: object + gopomelo: + additionalProperties: + nullable: true + type: object + groq: + additionalProperties: + nullable: true + type: object + huggingface: + additionalProperties: + nullable: true + type: object + hyperbolic: + additionalProperties: + nullable: true + type: object + hyperbolic-quantized: + additionalProperties: + nullable: true + type: object + inception: + additionalProperties: + nullable: true + type: object + inceptron: + additionalProperties: + nullable: true + type: object + inference-net: + additionalProperties: + nullable: true + type: object + infermatic: + additionalProperties: + nullable: true + type: object + inflection: + additionalProperties: + nullable: true + type: object + inocloud: + additionalProperties: + nullable: true + type: object + io-net: + additionalProperties: + nullable: true + type: object + ionstream: + additionalProperties: + nullable: true + type: object + klusterai: + additionalProperties: + nullable: true + type: object + lambda: + additionalProperties: + nullable: true + type: object + lepton: + additionalProperties: + nullable: true + type: object + liquid: + additionalProperties: + nullable: true + type: object + lynn: + additionalProperties: + nullable: true + type: object + lynn-private: + additionalProperties: + nullable: true + type: object + mancer: + additionalProperties: + nullable: true + type: object + mancer-old: + additionalProperties: + nullable: true + type: object + mara: + additionalProperties: + nullable: true + type: object + meta: + additionalProperties: + nullable: true + type: object + minimax: + additionalProperties: + nullable: true + type: object + mistral: + additionalProperties: + nullable: true + type: object + modal: + additionalProperties: + nullable: true + type: object + modelrun: + additionalProperties: + nullable: true + type: object + modular: + additionalProperties: + nullable: true + type: object + moonshotai: + additionalProperties: + nullable: true + type: object + morph: + additionalProperties: + nullable: true + type: object + ncompass: + additionalProperties: + nullable: true + type: object + nebius: + additionalProperties: + nullable: true + type: object + nex-agi: + additionalProperties: + nullable: true + type: object + nextbit: + additionalProperties: + nullable: true + type: object + nineteen: + additionalProperties: + nullable: true + type: object + novita: + additionalProperties: + nullable: true + type: object + nvidia: + additionalProperties: + nullable: true + type: object + octoai: + additionalProperties: + nullable: true + type: object + open-inference: + additionalProperties: + nullable: true + type: object + openai: + additionalProperties: + nullable: true + type: object + parasail: + additionalProperties: + nullable: true + type: object + perceptron: + additionalProperties: + nullable: true + type: object + perplexity: + additionalProperties: + nullable: true + type: object + phala: + additionalProperties: + nullable: true + type: object + poolside: + additionalProperties: + nullable: true + type: object + recraft: + additionalProperties: + nullable: true + type: object + recursal: + additionalProperties: + nullable: true + type: object + reflection: + additionalProperties: + nullable: true + type: object + reka: + additionalProperties: + nullable: true + type: object + relace: + additionalProperties: + nullable: true + type: object + replicate: + additionalProperties: + nullable: true + type: object + sambanova: + additionalProperties: + nullable: true + type: object + sambanova-cloaked: + additionalProperties: + nullable: true + type: object + seed: + additionalProperties: + nullable: true + type: object + sf-compute: + additionalProperties: + nullable: true + type: object + siliconflow: + additionalProperties: + nullable: true + type: object + sourceful: + additionalProperties: + nullable: true + type: object + stealth: + additionalProperties: + nullable: true + type: object + stepfun: + additionalProperties: + nullable: true + type: object + streamlake: + additionalProperties: + nullable: true + type: object + switchpoint: + additionalProperties: + nullable: true + type: object + targon: + additionalProperties: + nullable: true + type: object + together: + additionalProperties: + nullable: true + type: object + together-lite: + additionalProperties: + nullable: true + type: object + ubicloud: + additionalProperties: + nullable: true + type: object + upstage: + additionalProperties: + nullable: true + type: object + venice: + additionalProperties: + nullable: true + type: object + wafer: + additionalProperties: + nullable: true + type: object + wandb: + additionalProperties: + nullable: true + type: object + xai: + additionalProperties: + nullable: true + type: object + xiaomi: + additionalProperties: + nullable: true + type: object + z-ai: + additionalProperties: + nullable: true + type: object + type: object + ProviderOverloadedResponse: + description: Provider Overloaded - Provider is temporarily overloaded + example: + error: + code: 529 + message: Provider returned error + properties: + error: + $ref: '#/components/schemas/ProviderOverloadedResponseErrorData' + openrouter_metadata: + additionalProperties: + nullable: true + nullable: true + type: object + user_id: + nullable: true + type: string + required: + - error + type: object + ProviderOverloadedResponseErrorData: + description: Error data for ProviderOverloadedResponse + example: + code: 529 + message: Provider returned error + properties: + code: + type: integer + message: + type: string + metadata: + additionalProperties: + nullable: true + nullable: true + type: object + required: + - code + - message + type: object + ProviderPreferences: + additionalProperties: false + description: When multiple model providers are available, optionally indicate your routing preference. + example: + allow_fallbacks: true + nullable: true + properties: + allow_fallbacks: + description: > + Whether to allow backup providers to serve requests + + - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. + + - false: use only the primary/custom provider, and return the upstream error if it's unavailable. + + nullable: true + type: boolean + data_collection: + description: >- + Data collection setting. If no available model provider meets the requirement, your request will return an error. + + - allow: (default) allow providers which store user data non-transiently and may train on it + + + - deny: use only providers which do not collect user data. + enum: + - deny + - allow + - null + example: allow + nullable: true + type: string + x-speakeasy-unknown-values: allow + enforce_distillable_text: + description: >- + Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. + example: true + nullable: true + type: boolean + ignore: + description: >- + List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. + example: + - openai + - anthropic + items: + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string + nullable: true + type: array + max_price: + description: >- + The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + properties: + audio: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: Price per audio unit + completion: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: Price per million completion tokens + image: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: Price per image + prompt: + $ref: '#/components/schemas/BigNumberUnion' + request: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: Price per request + type: object + only: + description: >- + List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. + example: + - openai + - anthropic + items: + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string + nullable: true + type: array + order: + description: >- + An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. + example: + - openai + - anthropic + items: + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string + nullable: true + type: array + preferred_max_latency: + $ref: '#/components/schemas/PreferredMaxLatency' + preferred_min_throughput: + $ref: '#/components/schemas/PreferredMinThroughput' + quantizations: + description: A list of quantization levels to filter the provider by. + items: + $ref: '#/components/schemas/Quantization' + nullable: true + type: array + require_parameters: + description: >- + Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. + nullable: true + type: boolean + sort: + anyOf: + - $ref: '#/components/schemas/ProviderSort' + - $ref: '#/components/schemas/ProviderSortConfig' + - nullable: true + description: >- + The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. + example: price + zdr: + description: >- + Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. + example: true + nullable: true + type: boolean + type: object + ProviderResponse: + description: Details of a provider response for a generation attempt + example: + endpoint_id: ep_abc123 + id: chatcmpl-abc123 + is_byok: false + latency: 1200 + model_permaslug: openai/gpt-4 + provider_name: OpenAI + status: 200 + properties: + endpoint_id: + description: Internal endpoint identifier + example: ep_abc123 + type: string + id: + description: Upstream provider response identifier + example: chatcmpl-abc123 + type: string + is_byok: + description: Whether the request used a bring-your-own-key + example: false + type: boolean + latency: + description: Response latency in milliseconds + example: 1200 + format: double + type: number + model_permaslug: + description: Canonical model slug + example: openai/gpt-4 + type: string + provider_name: + description: Name of the provider + enum: + - AnyScale + - Atoma + - Cent-ML + - CrofAI + - Enfer + - GoPomelo + - HuggingFace + - Hyperbolic + - Hyperbolic 2 + - InoCloud + - Kluster + - Lambda + - Lepton + - Lynn 2 + - Lynn + - Mancer + - Meta + - Modal + - Nineteen + - OctoAI + - Recursal + - Reflection + - Replicate + - SambaNova 2 + - SF Compute + - Targon + - Together 2 + - Ubicloud + - 01.AI + - AkashML + - AI21 + - AionLabs + - Alibaba + - Ambient + - Baidu + - Amazon Bedrock + - Amazon Nova + - Anthropic + - Arcee AI + - AtlasCloud + - Avian + - Azure + - BaseTen + - BytePlus + - Black Forest Labs + - Cerebras + - Chutes + - Cirrascale + - Clarifai + - Cloudflare + - Cohere + - Crucible + - Crusoe + - Darkbloom + - Decart + - DeepInfra + - DeepSeek + - DekaLLM + - DigitalOcean + - Featherless + - Fireworks + - Friendli + - GMICloud + - Google + - Google AI Studio + - Groq + - Inception + - Inceptron + - InferenceNet + - Ionstream + - Infermatic + - Io Net + - Inflection + - Liquid + - Mara + - Mancer 2 + - Minimax + - ModelRun + - Mistral + - Modular + - Moonshot AI + - Morph + - NCompass + - Nebius + - Nex AGI + - NextBit + - Novita + - Nvidia + - OpenAI + - OpenInference + - Parasail + - Poolside + - Perceptron + - Perplexity + - Phala + - Recraft + - Reka + - Relace + - SambaNova + - Seed + - SiliconFlow + - Sourceful + - StepFun + - Stealth + - StreamLake + - Switchpoint + - Together + - Upstage + - Venice + - Wafer + - WandB + - Xiaomi + - xAI + - Z.AI + - FakeProvider + example: OpenAI + type: string + x-speakeasy-unknown-values: allow + status: + description: HTTP status code from the provider + example: 200 + nullable: true + type: integer + required: + - status + type: object + ProviderSort: + description: The provider sorting strategy (price, throughput, latency) + enum: + - price + - throughput + - latency + - exacto + example: price + type: string + x-speakeasy-unknown-values: allow + ProviderSortConfig: + description: The provider sorting strategy (price, throughput, latency) + example: + by: price + partition: model + properties: + by: + description: The provider sorting strategy (price, throughput, latency) + enum: + - price + - throughput + - latency + - exacto + - null + example: price + nullable: true + type: string + x-speakeasy-unknown-values: allow + partition: + description: >- + Partitioning strategy for sorting: "model" (default) groups endpoints by model before sorting (fallback models remain fallbacks), "none" sorts all endpoints together regardless of model. + enum: + - model + - none + - null + example: model + nullable: true + type: string + x-speakeasy-unknown-values: allow + type: object + PublicEndpoint: + description: Information about a specific model endpoint + example: + context_length: 8192 + latency_last_30m: + p50: 0.25 + p75: 0.35 + p90: 0.48 + p99: 0.85 + max_completion_tokens: 4096 + max_prompt_tokens: 8192 + model_id: openai/gpt-4 + model_name: GPT-4 + name: 'OpenAI: GPT-4' + pricing: + completion: '0.00006' + image: '0' + prompt: '0.00003' + request: '0' + provider_name: OpenAI + quantization: fp16 + status: 0 + supported_parameters: + - temperature + - top_p + - max_tokens + supports_implicit_caching: true + tag: openai + throughput_last_30m: + p50: 45.2 + p75: 38.5 + p90: 28.3 + p99: 15.1 + uptime_last_1d: 99.8 + uptime_last_30m: 99.5 + uptime_last_5m: 100 + properties: + context_length: + type: integer + latency_last_30m: + $ref: '#/components/schemas/PercentileStats' + max_completion_tokens: + nullable: true + type: integer + max_prompt_tokens: + nullable: true + type: integer + model_id: + description: The unique identifier for the model (permaslug) + example: openai/gpt-4 + type: string + model_name: + type: string + name: + type: string + pricing: + properties: + audio: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + audio_output: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + completion: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + discount: + format: double + type: number + image: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + image_output: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + image_token: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + input_audio_cache: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + input_cache_read: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + input_cache_write: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + internal_reasoning: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + prompt: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + request: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + web_search: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + required: + - prompt + - completion + type: object + provider_name: + $ref: '#/components/schemas/ProviderName' + quantization: + allOf: + - $ref: '#/components/schemas/Quantization' + - nullable: true + status: + $ref: '#/components/schemas/EndpointStatus' + supported_parameters: + items: + $ref: '#/components/schemas/Parameter' + type: array + supports_implicit_caching: + type: boolean + tag: + type: string + throughput_last_30m: + allOf: + - $ref: '#/components/schemas/PercentileStats' + - description: >- + Throughput percentiles in tokens per second over the last 30 minutes. Throughput measures output token generation speed. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests. + uptime_last_1d: + description: >- + Uptime percentage over the last 1 day, calculated as successful requests / (successful + error requests) * 100. Rate-limited requests are excluded. Returns null if insufficient data. + format: double + nullable: true + type: number + uptime_last_30m: + format: double + nullable: true + type: number + uptime_last_5m: + description: >- + Uptime percentage over the last 5 minutes, calculated as successful requests / (successful + error requests) * 100. Rate-limited requests are excluded. Returns null if insufficient data. + format: double + nullable: true + type: number + required: + - name + - model_id + - model_name + - context_length + - pricing + - provider_name + - tag + - quantization + - max_completion_tokens + - max_prompt_tokens + - supported_parameters + - uptime_last_30m + - uptime_last_5m + - uptime_last_1d + - supports_implicit_caching + - latency_last_30m + - throughput_last_30m + type: object + PublicPricing: + description: Pricing information for the model + example: + completion: '0.00006' + image: '0' + prompt: '0.00003' + request: '0' + properties: + audio: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + audio_output: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + completion: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + discount: + format: double + type: number + image: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + image_output: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + image_token: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + input_audio_cache: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + input_cache_read: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + input_cache_write: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + internal_reasoning: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + prompt: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + request: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + web_search: + allOf: + - $ref: '#/components/schemas/BigNumberUnion' + - description: A number or string value representing a large number + required: + - prompt + - completion + type: object + Quantization: + enum: + - int4 + - int8 + - fp4 + - fp6 + - fp8 + - fp16 + - bf16 + - fp32 + - unknown + example: fp16 + type: string + x-speakeasy-unknown-values: allow + RankingsDailyItem: + example: + date: '2026-05-11' + model_permaslug: openai/gpt-4o-2024-05-13 + total_tokens: '12345678' + properties: + date: + description: UTC calendar date the row is aggregated over (YYYY-MM-DD). + example: '2026-05-11' + type: string + model_permaslug: + description: >- + Model variant permaslug (e.g. `openai/gpt-4o-2024-05-13`, `openai/gpt-4o-2024-05-13:free`). Non-default variants include a `:variant` suffix and are ranked as their own entry. The reserved value `other` denotes the aggregated row covering every model outside the daily top 50 for that date — always sorted last within its date. + example: openai/gpt-4o-2024-05-13 + type: string + total_tokens: + description: >- + Sum of `prompt_tokens + completion_tokens` for the day, returned as a decimal string so 64-bit values are not truncated. + example: '12345678' + type: string + required: + - date + - model_permaslug + - total_tokens + type: object + RankingsDailyMeta: + example: + as_of: '2026-05-12T02:00:00Z' + end_date: '2026-05-11' + start_date: '2026-04-12' + version: v1 + properties: + as_of: + description: >- + ISO-8601 timestamp of when the response was generated. Reflects data-freshness because the underlying materialized view continuously ingests upstream events. + example: '2026-05-12T02:00:00Z' + type: string + end_date: + description: Resolved end of the date window (UTC, inclusive). + example: '2026-05-11' + type: string + start_date: + description: Resolved start of the date window (UTC, inclusive). + example: '2026-04-12' + type: string + version: + description: Dataset version. Field names and grain are stable for the life of `v1`. + enum: + - v1 + type: string + required: + - as_of + - version + - start_date + - end_date + type: object + RankingsDailyResponse: + example: + data: + - date: '2026-05-11' + model_permaslug: openai/gpt-4o-2024-05-13 + total_tokens: '12345678' + - date: '2026-05-11' + model_permaslug: anthropic/claude-3.5-sonnet-20241022 + total_tokens: '9876543' + meta: + as_of: '2026-05-12T02:00:00Z' + end_date: '2026-05-11' + start_date: '2026-04-12' + version: v1 + properties: + data: + description: >- + Up to 51 rows per day — the top 50 public models by `total_tokens` for each UTC calendar date in the window, plus one aggregated `other` row summing every model outside that top 50 (omitted when the long tail is empty). Rows are sorted by `date` ascending, then by `total_tokens` descending, with `other` pinned last within its date. Ties between real models break alphabetically on `model_permaslug` so the order is stable across requests. + items: + $ref: '#/components/schemas/RankingsDailyItem' + type: array + meta: + $ref: '#/components/schemas/RankingsDailyMeta' + required: + - data + - meta + type: object + ReasoningConfig: + allOf: + - $ref: '#/components/schemas/BaseReasoningConfig' + - nullable: true + properties: + enabled: + nullable: true + type: boolean + max_tokens: + nullable: true + type: integer + type: object + description: Configuration for reasoning mode in the response + example: + enabled: true + summary: auto + ReasoningDeltaEvent: + allOf: + - $ref: '#/components/schemas/BaseReasoningDeltaEvent' + - properties: {} + type: object + description: Event emitted when reasoning text delta is streamed + example: + content_index: 0 + delta: First, we need + item_id: item-1 + output_index: 0 + sequence_number: 4 + type: response.reasoning_text.delta + ReasoningDetailEncrypted: + description: Reasoning detail encrypted schema + example: + data: encrypted data + type: reasoning.encrypted + properties: + data: + type: string + format: + $ref: '#/components/schemas/ReasoningFormat' + id: + nullable: true + type: string + index: + type: integer + type: + enum: + - reasoning.encrypted + type: string + required: + - type + - data + type: object + ReasoningDetailSummary: + description: Reasoning detail summary schema + example: + summary: The model analyzed the problem by first identifying key constraints, then evaluating possible solutions... + type: reasoning.summary + properties: + format: + $ref: '#/components/schemas/ReasoningFormat' + id: + nullable: true + type: string + index: + type: integer + summary: + type: string + type: + enum: + - reasoning.summary + type: string + required: + - type + - summary + type: object + ReasoningDetailText: + description: Reasoning detail text schema + example: + signature: signature + text: The model analyzed the problem by first identifying key constraints, then evaluating possible solutions... + type: reasoning.text + properties: + format: + $ref: '#/components/schemas/ReasoningFormat' + id: + nullable: true + type: string + index: + type: integer + signature: + nullable: true + type: string + text: + nullable: true + type: string + type: + enum: + - reasoning.text + type: string + required: + - type + type: object + ReasoningDetailUnion: + description: Reasoning detail union schema + discriminator: + mapping: + reasoning.encrypted: '#/components/schemas/ReasoningDetailEncrypted' + reasoning.summary: '#/components/schemas/ReasoningDetailSummary' + reasoning.text: '#/components/schemas/ReasoningDetailText' + propertyName: type + example: + summary: The model analyzed the problem by first identifying key constraints, then evaluating possible solutions... + type: reasoning.summary + oneOf: + - $ref: '#/components/schemas/ReasoningDetailSummary' + - $ref: '#/components/schemas/ReasoningDetailEncrypted' + - $ref: '#/components/schemas/ReasoningDetailText' + ReasoningDoneEvent: + allOf: + - $ref: '#/components/schemas/BaseReasoningDoneEvent' + - properties: {} + type: object + description: Event emitted when reasoning text streaming is complete + example: + content_index: 0 + item_id: item-1 + output_index: 0 + sequence_number: 6 + text: First, we need to identify the key components and then combine them logically. + type: response.reasoning_text.done + ReasoningEffort: + enum: + - xhigh + - high + - medium + - low + - minimal + - none + - null + example: medium + nullable: true + type: string + x-speakeasy-unknown-values: allow + ReasoningFormat: + enum: + - unknown + - openai-responses-v1 + - azure-openai-responses-v1 + - xai-responses-v1 + - anthropic-claude-v1 + - google-gemini-v1 + - null + example: unknown + nullable: true + type: string + x-speakeasy-unknown-values: allow + ReasoningItem: + allOf: + - $ref: '#/components/schemas/OutputItemReasoning' + - properties: + content: + items: + $ref: '#/components/schemas/ReasoningTextContent' + nullable: true + type: array + format: + $ref: '#/components/schemas/ReasoningFormat' + signature: + nullable: true + type: string + type: object + description: Reasoning output item with signature and format extensions + example: + id: reasoning-abc123 + summary: + - text: Step by step analysis + type: summary_text + type: reasoning + ReasoningSummaryPartAddedEvent: + allOf: + - $ref: '#/components/schemas/BaseReasoningSummaryPartAddedEvent' + - properties: {} + type: object + description: Event emitted when a reasoning summary part is added + example: + item_id: item-1 + output_index: 0 + part: + text: '' + type: summary_text + sequence_number: 3 + summary_index: 0 + type: response.reasoning_summary_part.added + ReasoningSummaryPartDoneEvent: + allOf: + - $ref: '#/components/schemas/BaseReasoningSummaryPartDoneEvent' + - properties: {} + type: object + description: Event emitted when a reasoning summary part is complete + example: + item_id: item-1 + output_index: 0 + part: + text: Analyzing the problem step by step to find the optimal solution. + type: summary_text + sequence_number: 7 + summary_index: 0 + type: response.reasoning_summary_part.done + ReasoningSummaryText: + example: + text: Analyzed the problem using first principles + type: summary_text + properties: + text: + type: string + type: + enum: + - summary_text + type: string + required: + - type + - text + type: object + ReasoningSummaryTextDeltaEvent: + allOf: + - $ref: '#/components/schemas/BaseReasoningSummaryTextDeltaEvent' + - properties: {} + type: object + description: Event emitted when reasoning summary text delta is streamed + example: + delta: Analyzing + item_id: item-1 + output_index: 0 + sequence_number: 4 + summary_index: 0 + type: response.reasoning_summary_text.delta + ReasoningSummaryTextDoneEvent: + allOf: + - $ref: '#/components/schemas/BaseReasoningSummaryTextDoneEvent' + - properties: {} + type: object + description: Event emitted when reasoning summary text streaming is complete + example: + item_id: item-1 + output_index: 0 + sequence_number: 6 + summary_index: 0 + text: Analyzing the problem step by step to find the optimal solution. + type: response.reasoning_summary_text.done + ReasoningSummaryVerbosity: + enum: + - auto + - concise + - detailed + - null + example: auto + nullable: true + type: string + x-speakeasy-unknown-values: allow + ReasoningTextContent: + example: + text: Let me think step by step about this problem... + type: reasoning_text + properties: + text: + type: string + type: + enum: + - reasoning_text + type: string + required: + - type + - text + type: object + RefusalDeltaEvent: + allOf: + - $ref: '#/components/schemas/BaseRefusalDeltaEvent' + - properties: {} + type: object + description: Event emitted when a refusal delta is streamed + example: + content_index: 0 + delta: I'm sorry + item_id: item-1 + output_index: 0 + sequence_number: 4 + type: response.refusal.delta + RefusalDoneEvent: + allOf: + - $ref: '#/components/schemas/BaseRefusalDoneEvent' + - properties: {} + type: object + description: Event emitted when refusal streaming is complete + example: + content_index: 0 + item_id: item-1 + output_index: 0 + refusal: I'm sorry, but I can't assist with that request. + sequence_number: 6 + type: response.refusal.done + RequestMetadata: + additionalProperties: + maxLength: 512 + type: string + description: >- + Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed. + example: + session_id: abc-def-ghi + user_id: '123' + nullable: true + type: object + RequestTimeoutResponse: + description: Request Timeout - Operation exceeded time limit + example: + error: + code: 408 + message: Operation timed out. Please try again later. + properties: + error: + $ref: '#/components/schemas/RequestTimeoutResponseErrorData' + openrouter_metadata: + additionalProperties: + nullable: true + nullable: true + type: object + user_id: + nullable: true + type: string + required: + - error + type: object + RequestTimeoutResponseErrorData: + description: Error data for RequestTimeoutResponse + example: + code: 408 + message: Operation timed out. Please try again later. + properties: + code: + type: integer + message: + type: string + metadata: + additionalProperties: + nullable: true + nullable: true + type: object + required: + - code + - message + type: object + ResponseHealingPlugin: + example: + enabled: true + id: response-healing + properties: + enabled: + description: Set to false to disable the response-healing plugin for this request. Defaults to true. + type: boolean + id: + enum: + - response-healing + type: string + required: + - id + type: object + ResponseIncludesEnum: + enum: + - file_search_call.results + - message.input_image.image_url + - computer_call_output.output.image_url + - reasoning.encrypted_content + - code_interpreter_call.outputs + example: file_search_call.results + type: string + x-speakeasy-unknown-values: allow + ResponseOutputText: + example: + annotations: + - end_index: 42 + start_index: 0 + title: Paris - Wikipedia + type: url_citation + url: https://en.wikipedia.org/wiki/Paris + text: The capital of France is Paris. + type: output_text + properties: + annotations: + items: + $ref: '#/components/schemas/OpenAIResponsesAnnotation' + type: array + logprobs: + items: + properties: + bytes: + items: + type: integer + type: array + logprob: + format: double + type: number + token: + type: string + top_logprobs: + items: + properties: + bytes: + items: + type: integer + type: array + logprob: + format: double + type: number + token: + type: string + required: + - token + - bytes + - logprob type: object + type: array + required: + - token + - bytes + - logprob + - top_logprobs + type: object + type: array + text: + type: string + type: + enum: + - output_text + type: string + required: + - type + - text + type: object + ResponsesErrorField: + description: Error information returned from the API + example: + code: rate_limit_exceeded + message: Rate limit exceeded. Please try again later. + nullable: true + properties: + code: + enum: + - server_error + - rate_limit_exceeded + - invalid_prompt + - vector_store_timeout + - invalid_image + - invalid_image_format + - invalid_base64_image + - invalid_image_url + - image_too_large + - image_too_small + - image_parse_error + - image_content_policy_violation + - invalid_image_mode + - image_file_too_large + - unsupported_image_media_type + - empty_image_file + - failed_to_download_image + - image_file_not_found + type: string + x-speakeasy-unknown-values: allow + message: + type: string + required: + - code + - message + type: object + ResponsesRequest: + description: Request schema for Responses endpoint + example: + input: + - content: Hello, how are you? + role: user + type: message + model: anthropic/claude-4.5-sonnet-20250929 + temperature: 0.7 + tools: + - description: Get the current weather in a given location + name: get_current_weather + parameters: + properties: + location: + type: string + type: object + type: function + top_p: 0.9 + properties: + background: + nullable: true + type: boolean + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + frequency_penalty: + format: double + nullable: true + type: number + image_config: + $ref: '#/components/schemas/ImageConfig' + include: + items: + $ref: '#/components/schemas/ResponseIncludesEnum' + nullable: true + type: array + input: + $ref: '#/components/schemas/Inputs' + instructions: + nullable: true + type: string + max_output_tokens: + nullable: true + type: integer + max_tool_calls: + nullable: true + type: integer + metadata: + $ref: '#/components/schemas/RequestMetadata' + modalities: + description: Output modalities for the response. Supported values are "text" and "image". + example: + - text + - image + items: + $ref: '#/components/schemas/OutputModalityEnum' + type: array + model: + type: string + models: + items: + type: string + type: array + parallel_tool_calls: + nullable: true + type: boolean + plugins: + description: Plugins you want to enable for this request, including their settings. + items: + discriminator: + mapping: + auto-router: '#/components/schemas/AutoRouterPlugin' + context-compression: '#/components/schemas/ContextCompressionPlugin' + file-parser: '#/components/schemas/FileParserPlugin' + fusion: '#/components/schemas/FusionPlugin' + moderation: '#/components/schemas/ModerationPlugin' + pareto-router: '#/components/schemas/ParetoRouterPlugin' + response-healing: '#/components/schemas/ResponseHealingPlugin' + web: '#/components/schemas/WebSearchPlugin' + web-fetch: '#/components/schemas/WebFetchPlugin' + propertyName: id + oneOf: + - $ref: '#/components/schemas/AutoRouterPlugin' + - $ref: '#/components/schemas/ModerationPlugin' + - $ref: '#/components/schemas/WebSearchPlugin' + - $ref: '#/components/schemas/WebFetchPlugin' + - $ref: '#/components/schemas/FileParserPlugin' + - $ref: '#/components/schemas/ResponseHealingPlugin' + - $ref: '#/components/schemas/ContextCompressionPlugin' + - $ref: '#/components/schemas/ParetoRouterPlugin' + - $ref: '#/components/schemas/FusionPlugin' + type: array + presence_penalty: + format: double + nullable: true + type: number + previous_response_id: + nullable: true + type: string + prompt: + $ref: '#/components/schemas/StoredPromptTemplate' + prompt_cache_key: + nullable: true + type: string + provider: + $ref: '#/components/schemas/ProviderPreferences' + reasoning: + $ref: '#/components/schemas/ReasoningConfig' + route: + $ref: '#/components/schemas/DeprecatedRoute' + safety_identifier: + nullable: true + type: string + service_tier: + default: auto + enum: + - auto + - default + - flex + - priority + - scale + - null + nullable: true + type: string + x-speakeasy-unknown-values: allow + session_id: + description: >- + A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. + maxLength: 256 + type: string + stop_server_tools_when: + $ref: '#/components/schemas/StopServerToolsWhen' + store: + const: false + default: false + type: boolean + stream: + default: false + type: boolean + temperature: + format: double + nullable: true + type: number + text: + $ref: '#/components/schemas/TextExtendedConfig' + tool_choice: + $ref: '#/components/schemas/OpenAIResponsesToolChoice' + tools: + items: + anyOf: + - allOf: + - $ref: '#/components/schemas/FunctionTool' + - properties: {} + type: object + description: Function tool definition + example: + description: Get the current weather in a location + name: get_weather + parameters: + properties: + location: + description: The city and state + type: string + unit: + enum: + - celsius + - fahrenheit + type: string + x-speakeasy-unknown-values: allow + required: + - location + type: object + type: function + - $ref: '#/components/schemas/Preview_WebSearchServerTool' + - $ref: '#/components/schemas/Preview_20250311_WebSearchServerTool' + - $ref: '#/components/schemas/Legacy_WebSearchServerTool' + - $ref: '#/components/schemas/WebSearchServerTool' + - $ref: '#/components/schemas/FileSearchServerTool' + - $ref: '#/components/schemas/ComputerUseServerTool' + - $ref: '#/components/schemas/CodeInterpreterServerTool' + - $ref: '#/components/schemas/McpServerTool' + - $ref: '#/components/schemas/ImageGenerationServerTool' + - $ref: '#/components/schemas/CodexLocalShellTool' + - $ref: '#/components/schemas/ShellServerTool' + - $ref: '#/components/schemas/ApplyPatchServerTool' + - $ref: '#/components/schemas/CustomTool' + - $ref: '#/components/schemas/AdvisorServerTool_OpenRouter' + - $ref: '#/components/schemas/SubagentServerTool_OpenRouter' + - $ref: '#/components/schemas/DatetimeServerTool' + - $ref: '#/components/schemas/FusionServerTool_OpenRouter' + - $ref: '#/components/schemas/ImageGenerationServerTool_OpenRouter' + - $ref: '#/components/schemas/ChatSearchModelsServerTool' + - $ref: '#/components/schemas/WebFetchServerTool' + - $ref: '#/components/schemas/WebSearchServerTool_OpenRouter' + - $ref: '#/components/schemas/ApplyPatchServerTool_OpenRouter' + - $ref: '#/components/schemas/BashServerTool' + - $ref: '#/components/schemas/ShellServerTool_OpenRouter' + type: array + top_k: + type: integer + top_logprobs: + nullable: true + type: integer + top_p: + format: double + nullable: true + type: number + trace: + $ref: '#/components/schemas/TraceConfig' + truncation: + $ref: '#/components/schemas/OpenAIResponsesTruncation' + user: + description: >- + A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 256 characters. + maxLength: 256 + type: string + type: object + ResponsesStreamingResponse: + example: + data: + delta: Hello + type: response.output_text.delta + properties: + data: + $ref: '#/components/schemas/StreamEvents' + required: + - data + type: object + RouterAttempt: + example: + model: openai/gpt-4o + provider: OpenAI + status: 200 + properties: + model: + type: string + provider: + type: string + status: + type: integer + required: + - provider + - model + - status + type: object + RouterParams: + additionalProperties: + nullable: true + example: + version_group: anthropic/claude-sonnet-4 + properties: + quality_floor: + format: double + type: number + throughput_floor: + format: double + type: number + version_group: + type: string + type: object + RoutingStrategy: + enum: + - direct + - auto + - free + - latest + - alias + - fallback + - pareto + - bodybuilder + - fusion + example: direct + type: string + x-speakeasy-unknown-values: allow + SandboxSleepAfterSeconds: + description: >- + How long (in seconds) the container stays warm after its last command before sleeping, freeing its capacity slot. Idle-based: each command renews the timer. Defaults to 900 (15 minutes); capped at 2592000 (30 days). + example: 900 + type: integer + SearchContextSizeEnum: + description: Size of the search context for web search tools + enum: + - low + - medium + - high + example: medium + type: string + x-speakeasy-unknown-values: allow + SearchModelsServerToolConfig: + description: Configuration for the openrouter:experimental__search_models server tool + example: + max_results: 5 + properties: + max_results: + description: Maximum number of models to return. Defaults to 5, max 20. + example: 5 + type: integer + type: object + SearchQualityLevel: + description: >- + How much context to retrieve per result. Applies to Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, pins a fixed per-result character cap (low=5,000, medium=15,000, high=30,000); when omitted, Exa picks an adaptive size per query and document (typically ~2,000–4,000 characters per result). For Parallel, controls the total characters across all results; when omitted, Parallel uses its own default size. For Perplexity, maps directly to the Search API's native search_context_size parameter. Overridden by `max_characters` when both are set. + enum: + - low + - medium + - high + example: medium + type: string + x-speakeasy-unknown-values: allow + ServiceTier: + enum: + - auto + - default + - flex + - priority + - scale + - null + example: default + nullable: true + type: string + x-speakeasy-unknown-values: allow + ServiceUnavailableResponse: + description: Service Unavailable - Service temporarily unavailable + example: + error: + code: 503 + message: Service temporarily unavailable + properties: + error: + $ref: '#/components/schemas/ServiceUnavailableResponseErrorData' + openrouter_metadata: + additionalProperties: + nullable: true + nullable: true + type: object + user_id: + nullable: true + type: string + required: + - error + type: object + ServiceUnavailableResponseErrorData: + description: Error data for ServiceUnavailableResponse + example: + code: 503 + message: Service temporarily unavailable + properties: + code: + type: integer + message: + type: string + metadata: + additionalProperties: + nullable: true + nullable: true + type: object + required: + - code + - message + type: object + ShellCallItem: + description: A shell command execution call (newer variant) + example: + action: + commands: + - ls + - '-la' + max_output_length: 10000 + call_id: call-abc123 + status: completed + type: shell_call + properties: + action: + properties: + commands: + items: + type: string + type: array + max_output_length: + nullable: true + type: integer + timeout_ms: + nullable: true + type: integer + required: + - commands + type: object + call_id: + type: string + environment: + nullable: true + id: + nullable: true + type: string + status: + allOf: + - $ref: '#/components/schemas/ToolCallStatus' + - nullable: true + type: + enum: + - shell_call + type: string + required: + - type + - call_id + - action + type: object + ShellCallOutputItem: + description: Output from a shell command execution (newer variant) + example: + call_id: call-abc123 + output: + - content: | + total 0 + type: stdout + status: completed + type: shell_call_output + properties: + call_id: + type: string + id: + nullable: true + type: string + max_output_length: + nullable: true + type: integer + output: + items: + additionalProperties: + nullable: true + properties: + content: + nullable: true + type: string + exit_code: + nullable: true + type: integer + type: + type: string + required: + - type + type: object + type: array + status: + allOf: + - $ref: '#/components/schemas/ToolCallStatus' + - nullable: true + type: + enum: + - shell_call_output + type: string + required: + - type + - call_id + - output + type: object + ShellCallStatus: + description: Status of a shell call or its output. + enum: + - in_progress + - completed + - incomplete + example: completed + type: string + x-speakeasy-unknown-values: allow + ShellServerTool: + description: Shell tool configuration + example: + type: shell + properties: + type: + enum: + - shell + type: string + required: + - type + type: object + ShellServerTool_OpenRouter: + description: >- + OpenRouter built-in server tool: runs shell commands server-side in a sandboxed container (a sandbox-backed clone of OpenAI's hosted shell tool) + example: + parameters: + engine: openrouter + environment: + type: container_auto + type: openrouter:shell + properties: + parameters: + $ref: '#/components/schemas/ShellServerToolConfig' + type: + enum: + - openrouter:shell + type: string + required: + - type + type: object + ShellServerToolConfig: + description: Configuration for the openrouter:shell server tool + example: + engine: openrouter + environment: + type: container_auto + properties: + engine: + $ref: '#/components/schemas/ShellServerToolEngine' + environment: + $ref: '#/components/schemas/ShellServerToolEnvironment' + sleep_after_seconds: + $ref: '#/components/schemas/SandboxSleepAfterSeconds' + type: object + ShellServerToolEngine: + description: >- + Which shell engine to use. "openrouter" runs commands server-side in the OpenRouter sandbox. "auto" (default) keeps the provider's native hosted shell when available (OpenAI); on other providers the call is routed to the OpenRouter sandbox. + enum: + - auto + - openrouter + example: openrouter + type: string + x-speakeasy-unknown-values: allow + ShellServerToolEnvironment: + description: >- + Server-side execution environment for the shell tool. Only container-backed environments are supported; "local" shells are not. + discriminator: + mapping: + container_auto: '#/components/schemas/ContainerAutoEnvironment' + container_reference: '#/components/schemas/ContainerReferenceEnvironment' + propertyName: type + example: + type: container_auto + oneOf: + - $ref: '#/components/schemas/ContainerAutoEnvironment' + - $ref: '#/components/schemas/ContainerReferenceEnvironment' + SpeechRequest: + description: Text-to-speech request input + example: + input: Hello world + model: elevenlabs/eleven-turbo-v2 + response_format: pcm + speed: 1 + voice: alloy + properties: + input: + description: Text to synthesize + example: Hello world + type: string + model: + description: TTS model identifier + example: elevenlabs/eleven-turbo-v2 + type: string + provider: + description: Provider-specific passthrough configuration + properties: + options: + $ref: '#/components/schemas/ProviderOptions' + type: object + response_format: + default: pcm + description: Audio output format + enum: + - mp3 + - pcm + example: pcm + type: string + x-speakeasy-unknown-values: allow + speed: + description: >- + Playback speed multiplier. Only used by models that support it (e.g. OpenAI TTS). Ignored by other providers. + example: 1 + format: double + type: number + voice: + description: Voice identifier (provider-specific). + example: alloy + type: string + required: + - model + - input + - voice + type: object + StopServerToolsWhen: + description: >- + Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`. + example: + - step_count: 5 + type: step_count_is + - max_cost_in_dollars: 0.5 + type: max_cost + items: + $ref: '#/components/schemas/StopServerToolsWhenCondition' + minItems: 1 + type: array + StopServerToolsWhenCondition: + description: A single condition that, when met, halts the server-tool agent loop. + discriminator: + mapping: + finish_reason_is: '#/components/schemas/StopServerToolsWhenFinishReasonIs' + has_tool_call: '#/components/schemas/StopServerToolsWhenHasToolCall' + max_cost: '#/components/schemas/StopServerToolsWhenMaxCost' + max_tokens_used: '#/components/schemas/StopServerToolsWhenMaxTokensUsed' + step_count_is: '#/components/schemas/StopServerToolsWhenStepCountIs' + propertyName: type + example: + step_count: 5 + type: step_count_is + oneOf: + - $ref: '#/components/schemas/StopServerToolsWhenStepCountIs' + - $ref: '#/components/schemas/StopServerToolsWhenHasToolCall' + - $ref: '#/components/schemas/StopServerToolsWhenMaxTokensUsed' + - $ref: '#/components/schemas/StopServerToolsWhenMaxCost' + - $ref: '#/components/schemas/StopServerToolsWhenFinishReasonIs' + StopServerToolsWhenFinishReasonIs: + description: Stop when the upstream model emits this finish reason (e.g. `length`). + example: + reason: length + type: finish_reason_is + properties: + reason: + minLength: 1 + type: string + type: + enum: + - finish_reason_is + type: string + required: + - type + - reason + type: object + StopServerToolsWhenHasToolCall: + description: Stop after a tool with this name has been called. + example: + tool_name: finalize + type: has_tool_call + properties: + tool_name: + minLength: 1 + type: string + type: + enum: + - has_tool_call + type: string + required: + - type + - tool_name + type: object + StopServerToolsWhenMaxCost: + description: Stop once cumulative cost across the loop exceeds this dollar threshold. + example: + max_cost_in_dollars: 0.5 + type: max_cost + properties: + max_cost_in_dollars: + format: double + type: number + type: + enum: + - max_cost + type: string + required: + - type + - max_cost_in_dollars + type: object + StopServerToolsWhenMaxTokensUsed: + description: Stop once cumulative token usage across the loop exceeds this threshold. + example: + max_tokens: 10000 + type: max_tokens_used + properties: + max_tokens: + type: integer + type: + enum: + - max_tokens_used + type: string + required: + - type + - max_tokens + type: object + StopServerToolsWhenStepCountIs: + description: Stop after the agent loop has executed this many steps. + example: + step_count: 5 + type: step_count_is + properties: + step_count: + type: integer + type: + enum: + - step_count_is + type: string + required: + - type + - step_count + type: object + StoredPromptTemplate: + example: + id: prompt-abc123 + variables: + name: John + nullable: true + properties: + id: + type: string + variables: + additionalProperties: + anyOf: + - type: string + - $ref: '#/components/schemas/InputText' + - $ref: '#/components/schemas/InputImage' + - $ref: '#/components/schemas/InputFile' + nullable: true + type: object + required: + - id + type: object + StreamEvents: + description: Union of all possible event types emitted during response streaming + discriminator: + mapping: + error: '#/components/schemas/ErrorEvent' + response.apply_patch_call_operation_diff.delta: '#/components/schemas/ApplyPatchCallOperationDiffDeltaEvent' + response.apply_patch_call_operation_diff.done: '#/components/schemas/ApplyPatchCallOperationDiffDoneEvent' + response.completed: '#/components/schemas/StreamEventsResponseCompleted' + response.content_part.added: '#/components/schemas/ContentPartAddedEvent' + response.content_part.done: '#/components/schemas/ContentPartDoneEvent' + response.created: '#/components/schemas/OpenResponsesCreatedEvent' + response.custom_tool_call_input.delta: '#/components/schemas/CustomToolCallInputDeltaEvent' + response.custom_tool_call_input.done: '#/components/schemas/CustomToolCallInputDoneEvent' + response.failed: '#/components/schemas/StreamEventsResponseFailed' + response.function_call_arguments.delta: '#/components/schemas/FunctionCallArgsDeltaEvent' + response.function_call_arguments.done: '#/components/schemas/FunctionCallArgsDoneEvent' + response.fusion_call.analysis.completed: '#/components/schemas/FusionCallAnalysisCompletedEvent' + response.fusion_call.analysis.in_progress: '#/components/schemas/FusionCallAnalysisInProgressEvent' + response.fusion_call.completed: '#/components/schemas/FusionCallCompletedEvent' + response.fusion_call.in_progress: '#/components/schemas/FusionCallInProgressEvent' + response.fusion_call.panel.added: '#/components/schemas/FusionCallPanelAddedEvent' + response.fusion_call.panel.completed: '#/components/schemas/FusionCallPanelCompletedEvent' + response.fusion_call.panel.delta: '#/components/schemas/FusionCallPanelDeltaEvent' + response.fusion_call.panel.failed: '#/components/schemas/FusionCallPanelFailedEvent' + response.fusion_call.panel.reasoning.delta: '#/components/schemas/FusionCallPanelReasoningDeltaEvent' + response.image_generation_call.completed: '#/components/schemas/ImageGenCallCompletedEvent' + response.image_generation_call.generating: '#/components/schemas/ImageGenCallGeneratingEvent' + response.image_generation_call.in_progress: '#/components/schemas/ImageGenCallInProgressEvent' + response.image_generation_call.partial_image: '#/components/schemas/ImageGenCallPartialImageEvent' + response.in_progress: '#/components/schemas/OpenResponsesInProgressEvent' + response.incomplete: '#/components/schemas/StreamEventsResponseIncomplete' + response.output_item.added: '#/components/schemas/StreamEventsResponseOutputItemAdded' + response.output_item.done: '#/components/schemas/StreamEventsResponseOutputItemDone' + response.output_text.annotation.added: '#/components/schemas/AnnotationAddedEvent' + response.output_text.delta: '#/components/schemas/TextDeltaEvent' + response.output_text.done: '#/components/schemas/TextDoneEvent' + response.reasoning_summary_part.added: '#/components/schemas/ReasoningSummaryPartAddedEvent' + response.reasoning_summary_part.done: '#/components/schemas/ReasoningSummaryPartDoneEvent' + response.reasoning_summary_text.delta: '#/components/schemas/ReasoningSummaryTextDeltaEvent' + response.reasoning_summary_text.done: '#/components/schemas/ReasoningSummaryTextDoneEvent' + response.reasoning_text.delta: '#/components/schemas/ReasoningDeltaEvent' + response.reasoning_text.done: '#/components/schemas/ReasoningDoneEvent' + response.refusal.delta: '#/components/schemas/RefusalDeltaEvent' + response.refusal.done: '#/components/schemas/RefusalDoneEvent' + response.web_search_call.completed: '#/components/schemas/WebSearchCallCompletedEvent' + response.web_search_call.in_progress: '#/components/schemas/WebSearchCallInProgressEvent' + response.web_search_call.searching: '#/components/schemas/WebSearchCallSearchingEvent' + propertyName: type + example: + response: + created_at: 1704067200 + error: null + id: resp-abc123 + incomplete_details: null + instructions: null + max_output_tokens: null + metadata: null + model: gpt-4 + object: response + output: [] + parallel_tool_calls: true + status: in_progress + temperature: null + tool_choice: auto + tools: [] + top_p: null + sequence_number: 0 + type: response.created + oneOf: + - $ref: '#/components/schemas/OpenResponsesCreatedEvent' + - $ref: '#/components/schemas/OpenResponsesInProgressEvent' + - $ref: '#/components/schemas/StreamEventsResponseCompleted' + - $ref: '#/components/schemas/StreamEventsResponseIncomplete' + - $ref: '#/components/schemas/StreamEventsResponseFailed' + - $ref: '#/components/schemas/ErrorEvent' + - $ref: '#/components/schemas/StreamEventsResponseOutputItemAdded' + - $ref: '#/components/schemas/StreamEventsResponseOutputItemDone' + - $ref: '#/components/schemas/ContentPartAddedEvent' + - $ref: '#/components/schemas/ContentPartDoneEvent' + - $ref: '#/components/schemas/TextDeltaEvent' + - $ref: '#/components/schemas/TextDoneEvent' + - $ref: '#/components/schemas/RefusalDeltaEvent' + - $ref: '#/components/schemas/RefusalDoneEvent' + - $ref: '#/components/schemas/AnnotationAddedEvent' + - $ref: '#/components/schemas/FunctionCallArgsDeltaEvent' + - $ref: '#/components/schemas/FunctionCallArgsDoneEvent' + - $ref: '#/components/schemas/ReasoningDeltaEvent' + - $ref: '#/components/schemas/ReasoningDoneEvent' + - $ref: '#/components/schemas/ReasoningSummaryPartAddedEvent' + - $ref: '#/components/schemas/ReasoningSummaryPartDoneEvent' + - $ref: '#/components/schemas/ReasoningSummaryTextDeltaEvent' + - $ref: '#/components/schemas/ReasoningSummaryTextDoneEvent' + - $ref: '#/components/schemas/ImageGenCallInProgressEvent' + - $ref: '#/components/schemas/ImageGenCallGeneratingEvent' + - $ref: '#/components/schemas/ImageGenCallPartialImageEvent' + - $ref: '#/components/schemas/ImageGenCallCompletedEvent' + - $ref: '#/components/schemas/WebSearchCallInProgressEvent' + - $ref: '#/components/schemas/WebSearchCallSearchingEvent' + - $ref: '#/components/schemas/WebSearchCallCompletedEvent' + - $ref: '#/components/schemas/CustomToolCallInputDeltaEvent' + - $ref: '#/components/schemas/CustomToolCallInputDoneEvent' + - $ref: '#/components/schemas/ApplyPatchCallOperationDiffDeltaEvent' + - $ref: '#/components/schemas/ApplyPatchCallOperationDiffDoneEvent' + - $ref: '#/components/schemas/FusionCallInProgressEvent' + - $ref: '#/components/schemas/FusionCallPanelAddedEvent' + - $ref: '#/components/schemas/FusionCallPanelDeltaEvent' + - $ref: '#/components/schemas/FusionCallPanelReasoningDeltaEvent' + - $ref: '#/components/schemas/FusionCallPanelCompletedEvent' + - $ref: '#/components/schemas/FusionCallPanelFailedEvent' + - $ref: '#/components/schemas/FusionCallAnalysisInProgressEvent' + - $ref: '#/components/schemas/FusionCallAnalysisCompletedEvent' + - $ref: '#/components/schemas/FusionCallCompletedEvent' + StreamEventsResponseCompleted: + allOf: + - $ref: '#/components/schemas/CompletedEvent' + - properties: + response: + $ref: '#/components/schemas/OpenResponsesResult' + type: object + description: Event emitted when a response has completed successfully + example: + response: + created_at: 1704067200 + error: null + id: resp-abc123 + incomplete_details: null + instructions: null + max_output_tokens: null + metadata: null + model: gpt-4 + object: response + output: [] + parallel_tool_calls: true + status: completed + temperature: null + tool_choice: auto + tools: [] + top_p: null + sequence_number: 10 + type: response.completed + StreamEventsResponseFailed: + allOf: + - $ref: '#/components/schemas/FailedEvent' + - properties: + response: + $ref: '#/components/schemas/OpenResponsesResult' + type: object + description: Event emitted when a response has failed + example: + response: + created_at: 1704067200 + error: null + id: resp-abc123 + incomplete_details: null + instructions: null + max_output_tokens: null + metadata: null + model: gpt-4 + object: response + output: [] + parallel_tool_calls: true + status: failed + temperature: null + tool_choice: auto + tools: [] + top_p: null + sequence_number: 3 + type: response.failed + StreamEventsResponseIncomplete: + allOf: + - $ref: '#/components/schemas/IncompleteEvent' + - properties: + response: + $ref: '#/components/schemas/OpenResponsesResult' + type: object + description: Event emitted when a response is incomplete + example: + response: + created_at: 1704067200 + error: null + id: resp-abc123 + incomplete_details: null + instructions: null + max_output_tokens: null + metadata: null + model: gpt-4 + object: response + output: [] + parallel_tool_calls: true + status: incomplete + temperature: null + tool_choice: auto + tools: [] + top_p: null + sequence_number: 5 + type: response.incomplete + StreamEventsResponseOutputItemAdded: + allOf: + - $ref: '#/components/schemas/OutputItemAddedEvent' + - properties: + item: + $ref: '#/components/schemas/OutputItems' + type: object + description: Event emitted when a new output item is added to the response + example: + item: + content: [] + id: item-1 + role: assistant + status: in_progress + type: message + output_index: 0 + sequence_number: 2 + type: response.output_item.added + StreamEventsResponseOutputItemDone: + allOf: + - $ref: '#/components/schemas/OutputItemDoneEvent' + - properties: + item: + $ref: '#/components/schemas/OutputItems' + type: object + description: Event emitted when an output item is complete + example: + item: + content: + - annotations: [] + text: Hello! How can I help you? + type: output_text + id: item-1 + role: assistant + status: completed + type: message + output_index: 0 + sequence_number: 8 + type: response.output_item.done + StreamLogprob: + allOf: + - $ref: '#/components/schemas/OpenResponsesLogProbs' + - properties: + top_logprobs: + items: + $ref: '#/components/schemas/StreamLogprobTopLogprob' + type: array + type: object + description: Log probability information for a token + example: + bytes: + - 72 + - 101 + - 108 + - 108 + - 111 + logprob: -0.5 + token: Hello + top_logprobs: [] + StreamLogprobTopLogprob: + allOf: + - $ref: '#/components/schemas/OpenResponsesTopLogprobs' + - properties: {} + type: object + description: Alternative token with its log probability + example: + bytes: + - 72 + - 101 + - 108 + - 108 + - 111 + logprob: -0.5 + token: Hello + STTInputAudio: + description: Base64-encoded audio to transcribe + example: + data: UklGRiQA... + format: wav + properties: + data: + description: Base64-encoded audio data (raw bytes, not a data URI) + type: string + format: + description: Audio format (e.g., wav, mp3, flac, m4a, ogg, webm, aac). Supported formats vary by provider. + type: string + required: + - data + - format + type: object + STTRequest: + description: Speech-to-text request input. Accepts a JSON body with input_audio containing base64-encoded audio. + example: + input_audio: + data: UklGRiQA... + format: wav + language: en + model: openai/whisper-large-v3 + properties: + input_audio: + $ref: '#/components/schemas/STTInputAudio' + language: + description: ISO-639-1 language code (e.g., "en", "ja"). Auto-detected if omitted. + example: en + type: string + model: + description: STT model identifier + example: openai/whisper-large-v3 + type: string + provider: + description: Provider-specific passthrough configuration + properties: + options: + $ref: '#/components/schemas/ProviderOptions' + type: object + temperature: + description: Sampling temperature for transcription + example: 0 + format: double + type: number + required: + - model + - input_audio + type: object + STTResponse: + description: STT response containing transcribed text and optional usage statistics + example: + text: Hello, this is a test of OpenAI speech-to-text transcription. + usage: + cost: 0.000508 + input_tokens: 83 + output_tokens: 30 + seconds: 9.2 + total_tokens: 113 + properties: + text: + description: The transcribed text + example: >- + Hello, this is a test of OpenAI speech-to-text transcription. The weather is sunny today and the temperature is around 72 degrees. + type: string + usage: + $ref: '#/components/schemas/STTUsage' + required: + - text + type: object + STTUsage: + description: Aggregated usage statistics for the request + example: + cost: 0.000508 + input_tokens: 83 + output_tokens: 30 + seconds: 9.2 + total_tokens: 113 + properties: + cost: + description: Total cost of the request in USD + example: 0.000508 + format: double + type: number + input_tokens: + description: Number of input tokens billed for this request + example: 83 + type: integer + output_tokens: + description: Number of output tokens generated + example: 30 + type: integer + seconds: + description: Duration of the input audio in seconds + example: 9.2 + format: double + type: number + total_tokens: + description: Total number of tokens used (input + output) + example: 113 + type: integer + type: object + SubagentNestedTool: + additionalProperties: + nullable: true + description: >- + A tool made available to the subagent. Only OpenRouter server tools (e.g. openrouter:web_search) are supported; function tools are rejected because the worker has no way to execute them. The subagent tool may not list itself. + example: + type: openrouter:web_search + properties: + parameters: + additionalProperties: + nullable: true + type: object + type: + type: string + required: + - type + type: object + SubagentReasoning: + description: >- + Reasoning configuration forwarded to the subagent call. Use this to control reasoning effort and token budget for models that support extended thinking. + example: + effort: low + properties: + effort: + description: Reasoning effort level for the subagent call. + enum: + - xhigh + - high + - medium + - low + - minimal + - none + type: string + x-speakeasy-unknown-values: allow + max_tokens: + description: >- + Maximum number of reasoning tokens the subagent may use. Accepted and validated but not yet forwarded to the subagent call. + type: integer + type: object + SubagentServerTool_OpenRouter: + description: >- + OpenRouter built-in server tool: delegates self-contained tasks to a smaller, cheaper, faster worker model (any OpenRouter model) mid-generation and returns its outcome. The worker may run as a sub-agent with its own tools. + example: + parameters: + model: ~anthropic/claude-haiku-latest + type: openrouter:subagent + properties: + parameters: + $ref: '#/components/schemas/SubagentServerToolConfig' + type: + enum: + - openrouter:subagent + type: string + required: + - type + type: object + SubagentServerToolConfig: + description: Configuration for the openrouter:subagent server tool. + example: + model: ~anthropic/claude-haiku-latest + properties: + instructions: + description: System instructions for the subagent. When omitted, the subagent responds with no system prompt of its own. + example: You are a fast, focused worker. Complete the task exactly as described. + type: string + max_completion_tokens: + description: >- + Maximum number of output tokens (including reasoning) the subagent may produce. When omitted, the provider's default applies. + example: 2048 + type: integer + max_tool_calls: + description: >- + Maximum number of tool-calling steps the subagent may take during its agentic loop. Capped at 25. Only relevant when the subagent is given tools. Accepted and validated but not yet enforced on the subagent call. + example: 5 + maximum: 25 + minimum: 1 + type: integer + model: + description: >- + Slug of the model that executes delegated tasks (any OpenRouter model). Typically a smaller, cheaper, faster model than the one delegating. When omitted, the model from the outer API request is used. The subagent tool itself cannot be the subagent model. + example: ~anthropic/claude-haiku-latest + type: string + reasoning: + $ref: '#/components/schemas/SubagentReasoning' + temperature: + description: Sampling temperature forwarded to the subagent call. When omitted, the provider's default applies. + example: 0.7 + format: double + type: number + tools: + description: >- + Tools the subagent may use while executing a delegated task. The subagent runs as an agentic sub-agent over these tools, then returns its outcome. Only OpenRouter server tools are supported — function tools are rejected — and the list must not include the subagent tool itself. + items: + $ref: '#/components/schemas/SubagentNestedTool' + type: array + type: object + TextConfig: + description: Text output configuration including format and verbosity + example: + format: + type: text + verbosity: medium + properties: + format: + $ref: '#/components/schemas/Formats' + verbosity: + enum: + - high + - low + - medium + - null + nullable: true + type: string + x-speakeasy-unknown-values: allow + type: object + TextDeltaEvent: + allOf: + - $ref: '#/components/schemas/BaseTextDeltaEvent' + - properties: + logprobs: + items: + $ref: '#/components/schemas/StreamLogprob' + type: array + type: object + description: Event emitted when a text delta is streamed + example: + content_index: 0 + delta: Hello + item_id: item-1 + logprobs: [] + output_index: 0 + sequence_number: 4 + type: response.output_text.delta + TextDoneEvent: + allOf: + - $ref: '#/components/schemas/BaseTextDoneEvent' + - properties: + logprobs: + items: + $ref: '#/components/schemas/StreamLogprob' + type: array + type: object + description: Event emitted when text streaming is complete + example: + content_index: 0 + item_id: item-1 + logprobs: [] + output_index: 0 + sequence_number: 6 + text: Hello! How can I help you? + type: response.output_text.done + TextExtendedConfig: + allOf: + - $ref: '#/components/schemas/TextConfig' + - properties: + verbosity: + enum: + - low + - medium + - high + - xhigh + - max + - null + nullable: true + type: string + x-speakeasy-unknown-values: allow + type: object + description: Text output configuration including format and verbosity + example: + format: + type: text + ToolCallStatus: + enum: + - in_progress + - completed + - incomplete + example: completed + type: string + x-speakeasy-unknown-values: allow + ToolChoiceAllowed: + description: Constrains the model to a pre-defined set of allowed tools + example: + mode: auto + tools: + - name: get_weather + type: function + type: allowed_tools + properties: + mode: + anyOf: + - enum: + - auto + type: string + - enum: + - required + type: string + tools: + items: + additionalProperties: + nullable: true + type: object + type: array + type: + enum: + - allowed_tools + type: string + required: + - type + - mode + - tools + type: object + TooManyRequestsResponse: + description: Too Many Requests - Rate limit exceeded + example: + error: + code: 429 + message: Rate limit exceeded + properties: + error: + $ref: '#/components/schemas/TooManyRequestsResponseErrorData' + openrouter_metadata: + additionalProperties: + nullable: true + nullable: true + type: object + user_id: + nullable: true + type: string + required: + - error + type: object + TooManyRequestsResponseErrorData: + description: Error data for TooManyRequestsResponse + example: + code: 429 + message: Rate limit exceeded + properties: + code: + type: integer + message: + type: string + metadata: + additionalProperties: + nullable: true + nullable: true + type: object + required: + - code + - message + type: object + TopProviderInfo: + description: Information about the top provider for this model + example: + context_length: 8192 + is_moderated: true + max_completion_tokens: 4096 + properties: + context_length: + description: Context length from the top provider + example: 8192 + nullable: true + type: integer + is_moderated: + description: Whether the top provider moderates content + example: true + type: boolean + max_completion_tokens: + description: Maximum completion tokens from the top provider + example: 4096 + nullable: true + type: integer + required: + - is_moderated + type: object + TraceConfig: + additionalProperties: + nullable: true + description: >- + Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. + example: + trace_id: trace-abc123 + trace_name: my-app-trace + properties: + generation_name: + type: string + parent_span_id: + type: string + span_name: + type: string + trace_id: + type: string + trace_name: + type: string + type: object + Truncation: + enum: + - auto + - disabled + - null + example: auto + nullable: true + type: string + x-speakeasy-unknown-values: allow + UnauthorizedResponse: + description: Unauthorized - Authentication required or invalid credentials + example: + error: + code: 401 + message: Missing Authentication header + properties: + error: + $ref: '#/components/schemas/UnauthorizedResponseErrorData' + openrouter_metadata: + additionalProperties: + nullable: true + nullable: true + type: object + user_id: + nullable: true + type: string + required: + - error + type: object + UnauthorizedResponseErrorData: + description: Error data for UnauthorizedResponse + example: + code: 401 + message: Missing Authentication header + properties: + code: + type: integer + message: + type: string + metadata: + additionalProperties: + nullable: true + nullable: true + type: object + required: + - code + - message + type: object + UnprocessableEntityResponse: + description: Unprocessable Entity - Semantic validation failure + example: + error: + code: 422 + message: Invalid argument + properties: + error: + $ref: '#/components/schemas/UnprocessableEntityResponseErrorData' + openrouter_metadata: + additionalProperties: + nullable: true + nullable: true + type: object + user_id: + nullable: true + type: string + required: + - error + type: object + UnprocessableEntityResponseErrorData: + description: Error data for UnprocessableEntityResponse + example: + code: 422 + message: Invalid argument + properties: + code: + type: integer + message: + type: string + metadata: + additionalProperties: + nullable: true + nullable: true + type: object + required: + - code + - message + type: object + UpdateBYOKKeyRequest: + example: + disabled: false + name: Updated OpenAI Key + properties: + allowed_models: + description: Optional allowlist of model slugs this credential may be used for. `null` means no restriction. + example: null + items: + type: string + maxItems: 100 + nullable: true + type: array + allowed_user_ids: + description: Optional allowlist of user IDs that may use this credential. `null` means no restriction. + example: null + items: + type: string + maxItems: 100 + nullable: true + type: array + disabled: + description: Whether this credential is disabled. + example: false + type: boolean + is_fallback: + description: >- + Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried. + example: false + type: boolean + key: + description: >- + A new raw provider API key to rotate the credential in-place. The previous key material is overwritten and the masked label is regenerated. Encrypted at rest and never returned in API responses. + example: sk-proj-newkey456... + minLength: 1 + type: string + name: + description: Optional human-readable name for the credential. + example: Updated OpenAI Key + maxLength: 255 + nullable: true + type: string + type: object + UpdateBYOKKeyResponse: + example: + data: + allowed_api_key_hashes: null + allowed_models: null + allowed_user_ids: null + created_at: '2025-08-24T10:30:00Z' + disabled: false + id: 11111111-2222-3333-4444-555555555555 + is_fallback: false + label: sk-...AbCd + name: Updated OpenAI Key + provider: openai + sort_order: 0 + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + properties: + data: + allOf: + - $ref: '#/components/schemas/BYOKKey' + - description: The updated BYOK credential. + required: + - data + type: object + UpdateGuardrailRequest: + example: + description: Updated description + limit_usd: 75 + name: Updated Guardrail Name + reset_interval: weekly + properties: + allowed_models: + description: Array of model identifiers (slug or canonical_slug accepted) + example: + - openai/gpt-5.2 + items: + type: string + minItems: 1 + nullable: true + type: array + allowed_providers: + description: New list of allowed provider IDs + example: + - openai + - anthropic + - deepseek + items: + type: string + minItems: 1 + nullable: true + type: array + content_filter_builtins: + description: >- + Builtin content filters to apply. Set to null to remove. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only. + example: + - action: block + slug: regex-prompt-injection + items: + $ref: '#/components/schemas/ContentFilterBuiltinEntryInput' + nullable: true + type: array + content_filters: + description: Custom regex content filters to apply. Set to null to remove. + example: null + items: + $ref: '#/components/schemas/ContentFilterEntry' + nullable: true + type: array + description: + description: New description for the guardrail + example: Updated description + maxLength: 1000 + nullable: true + type: string + enforce_zdr: + deprecated: true + description: >- + Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. + example: true + nullable: true + type: boolean + enforce_zdr_anthropic: + description: Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. + example: true + nullable: true + type: boolean + enforce_zdr_google: + description: Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. + example: true + nullable: true + type: boolean + enforce_zdr_openai: + description: Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. + example: true + nullable: true + type: boolean + enforce_zdr_other: + description: >- + Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided. + example: true + nullable: true + type: boolean + ignored_models: + description: Array of model identifiers to exclude from routing (slug or canonical_slug accepted) + example: + - openai/gpt-4o-mini + items: + type: string + minItems: 1 + nullable: true + type: array + ignored_providers: + description: List of provider IDs to exclude from routing + example: + - azure + items: + type: string + minItems: 1 + nullable: true + type: array + limit_usd: + description: New spending limit in USD + example: 75 + format: double + nullable: true + type: number + name: + description: New name for the guardrail + example: Updated Guardrail Name + maxLength: 200 + minLength: 1 + type: string + reset_interval: + $ref: '#/components/schemas/GuardrailInterval' + type: object + UpdateGuardrailResponse: + example: + data: + allowed_models: null + allowed_providers: + - openai + content_filter_builtins: + - action: redact + label: '[EMAIL]' + slug: email + content_filters: null + created_at: '2025-08-24T10:30:00Z' + description: Updated description + enforce_zdr: null + enforce_zdr_anthropic: true + enforce_zdr_google: true + enforce_zdr_openai: true + enforce_zdr_other: true + id: 550e8400-e29b-41d4-a716-446655440000 + ignored_models: null + ignored_providers: null + limit_usd: 75 + name: Updated Guardrail Name + reset_interval: weekly + updated_at: '2025-08-24T16:00:00Z' + workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 + properties: + data: + allOf: + - $ref: '#/components/schemas/Guardrail' + - description: The updated guardrail + required: + - data + type: object + UpdateObservabilityDestinationRequest: + example: + enabled: false + name: Updated Langfuse + properties: + api_key_hashes: + description: >- + Optional allowlist of OpenRouter API key hashes. `null` clears the filter (all keys). Omitting leaves the current value. Must contain at least one hash if provided. + example: null + items: + type: string + minItems: 1 + nullable: true + type: array + config: + additionalProperties: + nullable: true + description: >- + Provider-specific configuration fields to update. Masked values are ignored; unset fields keep their current value. + example: + baseUrl: https://us.cloud.langfuse.com + publicKey: pk-l...EfGh + secretKey: sk-l...AbCd + type: object + enabled: + description: Whether the destination is enabled. + example: true + type: boolean + filter_rules: + allOf: + - $ref: '#/components/schemas/ObservabilityFilterRulesConfig' + - description: Optional structured filter rules. `null` clears the rules. Omitting keeps the current value. + name: + description: Human-readable name for the destination. + example: Production Langfuse + type: string + privacy_mode: + description: When true, request/response bodies are not forwarded — only metadata. + example: false + type: boolean + sampling_rate: + description: Sampling rate between 0.0001 and 1 (1 = 100%). + example: 1 + format: double + type: number + type: object + UpdateObservabilityDestinationResponse: + example: + data: + api_key_hashes: null + config: + baseUrl: https://us.cloud.langfuse.com + publicKey: pk-l...EfGh + secretKey: sk-l...AbCd + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production Langfuse + privacy_mode: false + sampling_rate: 1 + type: langfuse + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + properties: + data: + allOf: + - $ref: '#/components/schemas/ObservabilityDestination' + - description: The updated observability destination. + required: + - data + type: object + UpdateWorkspaceRequest: + example: + name: Updated Workspace + slug: updated-workspace + properties: + default_image_model: + description: Default image model for this workspace + example: openai/dall-e-3 + nullable: true + type: string + default_provider_sort: + description: Default provider sort preference (price, throughput, latency, exacto) + example: price + nullable: true + type: string + default_text_model: + description: Default text model for this workspace + example: openai/gpt-4o + nullable: true + type: string + description: + description: New description for the workspace + example: Updated description + maxLength: 500 + nullable: true + type: string + io_logging_api_key_ids: + description: Optional array of API key IDs to filter I/O logging + example: null + items: + type: integer + nullable: true + type: array + io_logging_sampling_rate: + description: Sampling rate for I/O logging (0.0001-1) + example: 1 + format: double + type: number + is_data_discount_logging_enabled: + description: Whether data discount logging is enabled + example: true + type: boolean + is_observability_broadcast_enabled: + description: Whether broadcast is enabled + example: false + type: boolean + is_observability_io_logging_enabled: + description: Whether private logging is enabled + example: false + type: boolean + name: + description: New name for the workspace + example: Updated Workspace + maxLength: 100 + minLength: 1 + type: string + slug: + description: >- + New URL-friendly slug (lowercase alphanumeric segments separated by single hyphens, no leading/trailing hyphens) + example: updated-workspace + maxLength: 50 + minLength: 1 + pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$ + type: string + type: object + UpdateWorkspaceResponse: + example: + data: + created_at: '2025-08-24T10:30:00Z' + created_by: user_abc123 + default_image_model: openai/dall-e-3 + default_provider_sort: price + default_text_model: openai/gpt-4o + description: Production environment workspace + id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 + is_data_discount_logging_enabled: true + is_observability_broadcast_enabled: false + is_observability_io_logging_enabled: false + name: Updated Workspace + slug: updated-workspace + updated_at: '2025-08-25T10:00:00Z' + properties: + data: + allOf: + - $ref: '#/components/schemas/Workspace' + - description: The updated workspace + required: + - data + type: object + URLCitation: + example: + content: OpenRouter provides a unified API for accessing LLMs from multiple providers. + end_index: 42 + start_index: 0 + title: OpenRouter Documentation + type: url_citation + url: https://openrouter.ai/docs + properties: + content: + type: string + end_index: + type: integer + start_index: + type: integer + title: + type: string + type: + enum: + - url_citation + type: string + url: + type: string + required: + - type + - url + - title + - start_index + - end_index + type: object + Usage: + allOf: + - $ref: '#/components/schemas/OpenAIResponsesUsage' + - nullable: true + properties: + cost: + description: Cost of the completion + format: double + nullable: true + type: number + cost_details: + properties: + upstream_inference_cost: + format: double + nullable: true + type: number + upstream_inference_input_cost: + format: double + type: number + upstream_inference_output_cost: + format: double + type: number + required: + - upstream_inference_input_cost + - upstream_inference_output_cost type: object + is_byok: + description: Whether a request was made using a Bring Your Own Key configuration + type: boolean + type: object + description: Token usage information for the response + example: + cost: 0.0012 + cost_details: + upstream_inference_cost: null + upstream_inference_input_cost: 0.0008 + upstream_inference_output_cost: 0.0004 + input_tokens: 10 + input_tokens_details: + cached_tokens: 0 + output_tokens: 25 + output_tokens_details: + reasoning_tokens: 0 + total_tokens: 35 + VideoGenerationRequest: + example: + aspect_ratio: '16:9' + duration: 8 + model: google/veo-3.1 + prompt: A serene mountain landscape at sunset + resolution: 720p + properties: + aspect_ratio: + description: Aspect ratio of the generated video + enum: + - '16:9' + - '9:16' + - '1:1' + - '4:3' + - '3:4' + - '3:2' + - '2:3' + - '21:9' + - '9:21' + example: '16:9' + type: string + x-speakeasy-unknown-values: allow + callback_url: + description: >- + URL to receive a webhook notification when the video generation job completes. Overrides the workspace-level default callback URL if set. Must be HTTPS. + example: https://example.com/webhook + format: uri + type: string + duration: + description: Duration of the generated video in seconds + example: 8 + minimum: 1 + type: integer + frame_images: + description: >- + Images to use as the first and/or last frame of the generated video. Each image must specify a frame_type of first_frame or last_frame. + items: + $ref: '#/components/schemas/FrameImage' + type: array + generate_audio: + description: >- + Whether to generate audio alongside the video. Defaults to the endpoint's generate_audio capability flag, false if not set. + example: true + type: boolean + input_references: + description: >- + Reference assets to guide video generation. Accepts image, audio, and video references. Audio and video references are only honored by providers that support them (currently BytePlus Seedance 2.0); other providers use image references and ignore the rest. + items: + $ref: '#/components/schemas/InputReference' + type: array + model: + type: string + prompt: + type: string + provider: + description: Provider-specific passthrough configuration + properties: + options: + allOf: + - $ref: '#/components/schemas/ProviderOptions' + - example: + google-vertex: + output_config: + effort: low type: object resolution: description: Resolution of the generated video @@ -14269,6 +21038,8 @@ components: - '1:1' - '4:3' - '3:4' + - '3:2' + - '2:3' - '21:9' - '9:21' type: string @@ -14311,30 +21082,38 @@ components: enum: - 480x480 - 480x640 + - 480x720 - 480x854 - 480x1120 - 640x480 + - 720x480 - 720x720 - 720x960 + - 720x1080 - 720x1280 - 720x1680 - 854x480 - 960x720 + - 1080x720 - 1080x1080 - 1080x1440 + - 1080x1620 - 1080x1920 - 1080x2520 - 1120x480 - 1280x720 - 1440x1080 + - 1620x1080 - 1680x720 - 1920x1080 - 2160x2160 - 2160x2880 + - 2160x3240 - 2160x3840 - 2160x5040 - 2520x1080 - 2880x2160 + - 3240x2160 - 3840x2160 - 5040x2160 type: string @@ -14387,6 +21166,90 @@ components: required: - data type: object + WebFetchEngineEnum: + description: >- + Which fetch engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in fetch. "exa" uses Exa Contents API. "openrouter" uses direct HTTP fetch. "firecrawl" uses Firecrawl scrape (requires BYOK). "parallel" uses the Parallel extract API. + enum: + - auto + - native + - openrouter + - exa + - parallel + - firecrawl + example: auto + type: string + x-speakeasy-unknown-values: allow + WebFetchPlugin: + example: + id: web-fetch + max_uses: 10 + properties: + allowed_domains: + description: Only fetch from these domains. + items: + type: string + type: array + blocked_domains: + description: Never fetch from these domains. + items: + type: string + type: array + id: + enum: + - web-fetch + type: string + max_content_tokens: + description: Maximum content length in approximate tokens. Content exceeding this limit is truncated. + type: integer + max_uses: + description: Maximum number of web fetches per request. Once exceeded, the tool returns an error. + type: integer + required: + - id + type: object + WebFetchServerTool: + description: 'OpenRouter built-in server tool: fetches full content from a URL (web page or PDF)' + example: + parameters: + max_uses: 10 + type: openrouter:web_fetch + properties: + parameters: + $ref: '#/components/schemas/WebFetchServerToolConfig' + type: + enum: + - openrouter:web_fetch + type: string + required: + - type + type: object + WebFetchServerToolConfig: + description: Configuration for the openrouter:web_fetch server tool + example: + max_content_tokens: 100000 + max_uses: 10 + properties: + allowed_domains: + description: Only fetch from these domains. + items: + type: string + type: array + blocked_domains: + description: Never fetch from these domains. + items: + type: string + type: array + engine: + $ref: '#/components/schemas/WebFetchEngineEnum' + max_content_tokens: + description: Maximum content length in approximate tokens. Content exceeding this limit is truncated. + example: 100000 + type: integer + max_uses: + description: Maximum number of web fetches per request. Once exceeded, the tool returns an error. + example: 10 + type: integer + type: object WebSearchCallCompletedEvent: allOf: - $ref: '#/components/schemas/OpenAIResponsesSearchCompleted' @@ -14427,7 +21290,7 @@ components: properties: allowed_domains: description: >- - Limit search results to these domains. Supported by Exa, Parallel, and most native providers (Anthropic, OpenAI, xAI). Not supported with Firecrawl or Perplexity. + Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI, xAI). Cannot be used with excluded_domains. items: type: string type: array @@ -14435,19 +21298,24 @@ components: $ref: '#/components/schemas/WebSearchEngineEnum' excluded_domains: description: >- - Exclude search results from these domains. Supported by Exa, Parallel, Anthropic, and xAI. Not supported with Firecrawl, OpenAI (silently ignored), or Perplexity. + Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, and xAI. Not supported with OpenAI (silently ignored). Cannot be used with allowed_domains. items: type: string type: array + max_characters: + description: >- + Exact maximum number of characters of content per search result. Applies to the Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, caps highlight content per result. For Parallel, caps excerpt content per result (default 1,500 when omitted). For Perplexity, maps to the native `max_tokens_per_page` parameter (converted from characters to tokens) and trims the response to the exact character cap. When both `max_characters` and `search_context_size` are set, `max_characters` takes precedence. When omitted, falls back to `search_context_size` mapping (Exa) or engine defaults (Parallel, Perplexity). + example: 2000 + type: integer max_results: description: >- - Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and Parallel engines; ignored with native provider search. + Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. example: 5 type: integer max_total_results: description: >- - Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. - example: 20 + Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. Defaults to 50 when not specified. + example: 50 type: integer search_context_size: $ref: '#/components/schemas/SearchQualityLevel' @@ -14480,18 +21348,20 @@ components: - exa - firecrawl - parallel + - perplexity example: exa type: string x-speakeasy-unknown-values: allow WebSearchEngineEnum: description: >- - Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. + Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). enum: - - auto - native - exa - - firecrawl - parallel + - firecrawl + - perplexity + - auto example: auto type: string x-speakeasy-unknown-values: allow @@ -14532,8 +21402,25 @@ components: type: array max_results: type: integer + max_uses: + description: >- + Maximum number of times the model can invoke web search in a single turn. Passed through to native providers that support it (e.g. Anthropic). + type: integer search_prompt: type: string + user_location: + allOf: + - $ref: '#/components/schemas/WebSearchUserLocation' + - description: >- + Approximate user location for location-biased search results. Passed through to native providers that support it (e.g. Anthropic). + example: + city: San Francisco + country: US + region: California + timezone: America/Los_Angeles + type: approximate + required: + - type required: - id type: object @@ -14552,7 +21439,7 @@ components: $ref: '#/components/schemas/WebSearchDomainFilter' max_results: description: >- - Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and Parallel engines; ignored with native provider search. + Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. example: 5 type: integer search_context_size: @@ -14574,17 +21461,7 @@ components: type: openrouter:web_search properties: parameters: - properties: - max_results: - description: Maximum number of search results to return per search call. Defaults to 5. - example: 5 - type: integer - max_total_results: - description: >- - Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. - example: 20 - type: integer - type: object + $ref: '#/components/schemas/WebSearchServerToolConfig' type: enum: - openrouter:web_search @@ -14592,6 +21469,46 @@ components: required: - type type: object + WebSearchServerToolConfig: + description: Configuration for the openrouter:web_search server tool + example: + max_results: 5 + search_context_size: medium + properties: + allowed_domains: + description: >- + Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI, xAI). Cannot be used with excluded_domains. + items: + type: string + type: array + engine: + $ref: '#/components/schemas/WebSearchEngineEnum' + excluded_domains: + description: >- + Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, and xAI. Not supported with OpenAI (silently ignored). Cannot be used with allowed_domains. + items: + type: string + type: array + max_characters: + description: >- + Exact maximum number of characters of content per search result. Applies to the Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, caps highlight content per result. For Parallel, caps excerpt content per result (default 1,500 when omitted). For Perplexity, maps to the native `max_tokens_per_page` parameter (converted from characters to tokens) and trims the response to the exact character cap. When both `max_characters` and `search_context_size` are set, `max_characters` takes precedence. When omitted, falls back to `search_context_size` mapping (Exa) or engine defaults (Parallel, Perplexity). + example: 2000 + type: integer + max_results: + description: >- + Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. + example: 5 + type: integer + max_total_results: + description: >- + Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. Defaults to 50 when not specified. + example: 50 + type: integer + search_context_size: + $ref: '#/components/schemas/SearchQualityLevel' + user_location: + $ref: '#/components/schemas/WebSearchUserLocationServerTool' + type: object WebSearchSource: example: type: url @@ -14653,12 +21570,16 @@ components: type: approximate properties: city: + nullable: true type: string country: + nullable: true type: string region: + nullable: true type: string timezone: + nullable: true type: string type: enum: @@ -14674,6 +21595,8 @@ components: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false @@ -14715,6 +21638,18 @@ components: example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string + io_logging_api_key_ids: + description: Optional array of API key IDs to filter I/O logging. Null means all keys are logged. + example: null + items: + type: integer + nullable: true + type: array + io_logging_sampling_rate: + description: Sampling rate for I/O logging (0.0001-1). 1 means 100% of requests are logged. + example: 1 + format: double + type: number is_data_discount_logging_enabled: description: Whether data discount logging is enabled for this workspace example: true @@ -14751,6 +21686,8 @@ components: - is_observability_io_logging_enabled - is_observability_broadcast_enabled - is_data_discount_logging_enabled + - io_logging_sampling_rate + - io_logging_api_key_ids - created_at - updated_at - created_by @@ -14824,53 +21761,2244 @@ paths: /activity: get: description: >- - Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: getUserActivity + Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: getUserActivity + parameters: + - description: Filter by a single UTC date in the last 30 days (YYYY-MM-DD format). + in: query + name: date + required: false + schema: + description: Filter by a single UTC date in the last 30 days (YYYY-MM-DD format). + example: '2025-08-24' + type: string + - description: Filter by API key hash (SHA-256 hex string, as returned by the keys API). + in: query + name: api_key_hash + required: false + schema: + description: Filter by API key hash (SHA-256 hex string, as returned by the keys API). + example: abc123def456... + type: string + - description: Filter by org member user ID. Only applicable for organization accounts. + in: query + name: user_id + required: false + schema: + description: Filter by org member user ID. Only applicable for organization accounts. + example: user_abc123 + type: string + responses: + '200': + content: + application/json: + example: + data: + - byok_usage_inference: 0.012 + completion_tokens: 125 + date: '2025-08-24' + endpoint_id: 550e8400-e29b-41d4-a716-446655440000 + model: openai/gpt-4.1 + model_permaslug: openai/gpt-4.1-2025-04-14 + prompt_tokens: 50 + provider_name: OpenAI + reasoning_tokens: 25 + requests: 5 + usage: 0.015 + schema: + $ref: '#/components/schemas/ActivityResponse' + description: Returns user activity data grouped by endpoint + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '403': + content: + application/json: + example: + error: + code: 403 + message: Only management keys can perform this operation + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: Forbidden - Authentication successful but insufficient permissions + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Get user activity grouped by endpoint + tags: + - Analytics + /analytics/meta: + get: + description: >- + Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: getAnalyticsMeta + responses: + '200': + content: + application/json: + example: + data: + dimensions: + - display_label: Model + name: model + granularities: + - display_label: Day + name: day + metrics: + - display_format: number + display_label: Request Count + is_rate: false + name: request_count + operators: + - name: eq + value_type: scalar + schema: + properties: + data: + properties: + dimensions: + items: + properties: + display_label: + description: Human-readable label + example: Model + type: string + name: + description: Dimension identifier used in query requests + example: model + type: string + required: + - name + - display_label + type: object + type: array + granularities: + items: + properties: + display_label: + description: Human-readable label + example: Day + type: string + name: + description: Granularity identifier + enum: + - minute + - hour + - day + - week + - month + example: day + type: string + x-speakeasy-unknown-values: allow + required: + - name + - display_label + type: object + type: array + metrics: + items: + properties: + display_format: + description: >- + How this metric value should be formatted for display (e.g. percent → multiply by 100 and append %, currency → prefix with $) + enum: + - number + - currency + - percent + - latency + - throughput + example: number + type: string + x-speakeasy-unknown-values: allow + display_label: + description: Human-readable label + example: Request Count + type: string + is_rate: + description: Whether this metric is a rate/ratio (averaged, not summed) + type: boolean + name: + description: Metric identifier used in query requests + example: request_count + type: string + required: + - name + - display_label + - is_rate + - display_format + type: object + type: array + operators: + items: + properties: + name: + description: Operator identifier used in filter definitions + enum: + - eq + - neq + - in + - not_in + - gt + - gte + - lt + - lte + example: eq + type: string + x-speakeasy-unknown-values: allow + value_type: + description: Whether the operator expects a single value or an array + enum: + - scalar + - array + type: string + x-speakeasy-unknown-values: allow + required: + - name + - value_type + type: object + type: array + required: + - metrics + - dimensions + - operators + - granularities + type: object + required: + - data + type: object + description: Returns analytics query metadata + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '403': + content: + application/json: + example: + error: + code: 403 + message: Only management keys can perform this operation + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: Forbidden - Authentication successful but insufficient permissions + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Get available analytics metrics and dimensions + tags: + - beta.Analytics + /analytics/query: + post: + description: >- + Execute an analytics query with specified metrics, dimensions, filters, and time range. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: queryAnalytics + requestBody: + content: + application/json: + example: + dimensions: + - model + granularity: day + limit: 100 + metrics: + - request_count + time_range: + end: '2025-01-08T00:00:00Z' + start: '2025-01-01T00:00:00Z' + schema: + properties: + dimensions: + items: + description: Dimension name + example: model + type: string + maxItems: 2 + type: array + filters: + items: + properties: + field: + description: Dimension to filter on + example: model + type: string + operator: + description: Filter operator + example: eq + type: string + value: + anyOf: + - type: string + - format: double + type: number + - items: + anyOf: + - type: string + - format: double + type: number + type: array + description: Filter value (scalar or array depending on operator) + required: + - field + - operator + - value + type: object + maxItems: 20 + type: array + granularity: + description: Time granularity + example: day + type: string + group_limit: + description: >- + Maximum rows per distinct combination of dimensions. When omitted on time-series queries (granularity + dimensions), auto-computed to avoid truncating time windows. Explicit values override the default and may truncate time buckets if set lower than the number of buckets in the range. Ignored when no dimensions are specified. + example: 100 + type: integer + limit: + description: >- + Maximum total rows returned. Defaults to 1000. On time-series queries with dimensions and no explicit group_limit, the server may raise this to accommodate the expected number of unique time-bucket/dimension combinations. + type: integer + metrics: + items: + description: Metric name + example: request_count + type: string + minItems: 1 + type: array + order_by: + properties: + direction: + enum: + - asc + - desc + type: string + x-speakeasy-unknown-values: allow + field: + description: Field to order by + example: request_count + type: string + required: + - field + - direction + type: object + time_range: + properties: + end: + format: date-time + type: string + start: + format: date-time + type: string + required: + - start + - end + type: object + required: + - metrics + type: object + required: true + responses: + '200': + content: + application/json: + example: + data: + data: + - date__day: '2025-01-01T00:00:00.000Z' + request_count: 1500 + metadata: + query_time_ms: 42 + row_count: 1 + truncated: false + schema: + properties: + data: + properties: + cachedAt: + format: double + type: number + data: + items: + description: A row of analytics data with metric/dimension values + type: object + type: array + metadata: + properties: + query_time_ms: + format: double + type: number + row_count: + type: integer + truncated: + type: boolean + required: + - query_time_ms + - row_count + - truncated + type: object + required: + - data + - metadata + type: object + required: + - data + type: object + description: Analytics query results + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '403': + content: + application/json: + example: + error: + code: 403 + message: Only management keys can perform this operation + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: Forbidden - Authentication successful but insufficient permissions + '408': + content: + application/json: + example: + error: + code: 408 + message: Operation timed out. Please try again later. + schema: + $ref: '#/components/schemas/RequestTimeoutResponse' + description: Request Timeout - Operation exceeded time limit + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Query analytics data + tags: + - beta.Analytics + /audio/speech: + post: + description: >- + Synthesizes audio from the input text. Returns a raw audio bytestream in the requested format (e.g. mp3, pcm, wav). + operationId: createAudioSpeech + requestBody: + content: + application/json: + example: + input: Hello world + model: elevenlabs/eleven-turbo-v2 + response_format: pcm + speed: 1 + voice: alloy + schema: + $ref: '#/components/schemas/SpeechRequest' + required: true + responses: + '200': + content: + audio/*: + schema: + description: >- + Raw audio bytestream. Content-Type varies by requested format (audio/mpeg for mp3, audio/pcm for pcm — 16-bit little-endian). + example: + format: binary + type: string + description: Audio bytes stream + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '402': + content: + application/json: + example: + error: + code: 402 + message: Insufficient credits. Add more using https://openrouter.ai/credits + schema: + $ref: '#/components/schemas/PaymentRequiredResponse' + description: Payment Required - Insufficient credits or quota to complete request + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '429': + content: + application/json: + example: + error: + code: 429 + message: Rate limit exceeded + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + '502': + content: + application/json: + example: + error: + code: 502 + message: Provider returned error + schema: + $ref: '#/components/schemas/BadGatewayResponse' + description: Bad Gateway - Provider/upstream API failure + '503': + content: + application/json: + example: + error: + code: 503 + message: Service temporarily unavailable + schema: + $ref: '#/components/schemas/ServiceUnavailableResponse' + description: Service Unavailable - Service temporarily unavailable + '524': + content: + application/json: + example: + error: + code: 524 + message: Request timed out. Please try again later. + schema: + $ref: '#/components/schemas/EdgeNetworkTimeoutResponse' + description: Infrastructure Timeout - Provider request timed out at edge network + '529': + content: + application/json: + example: + error: + code: 529 + message: Provider returned error + schema: + $ref: '#/components/schemas/ProviderOverloadedResponse' + description: Provider Overloaded - Provider is temporarily overloaded + summary: Create speech + tags: + - TTS + x-speakeasy-max-method-params: 1 + x-speakeasy-name-override: createSpeech + /audio/transcriptions: + post: + description: Transcribes audio into text. Accepts base64-encoded audio input and returns the transcribed text. + operationId: createAudioTranscriptions + requestBody: + content: + application/json: + example: + input_audio: + data: UklGRiQA... + format: wav + language: en + model: openai/whisper-large-v3 + schema: + $ref: '#/components/schemas/STTRequest' + required: true + responses: + '200': + content: + application/json: + example: + text: Hello, this is a test of OpenAI speech-to-text transcription. + usage: + cost: 0.000508 + input_tokens: 83 + output_tokens: 30 + seconds: 9.2 + total_tokens: 113 + schema: + $ref: '#/components/schemas/STTResponse' + description: Transcription result + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '402': + content: + application/json: + example: + error: + code: 402 + message: Insufficient credits. Add more using https://openrouter.ai/credits + schema: + $ref: '#/components/schemas/PaymentRequiredResponse' + description: Payment Required - Insufficient credits or quota to complete request + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '429': + content: + application/json: + example: + error: + code: 429 + message: Rate limit exceeded + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + '502': + content: + application/json: + example: + error: + code: 502 + message: Provider returned error + schema: + $ref: '#/components/schemas/BadGatewayResponse' + description: Bad Gateway - Provider/upstream API failure + '503': + content: + application/json: + example: + error: + code: 503 + message: Service temporarily unavailable + schema: + $ref: '#/components/schemas/ServiceUnavailableResponse' + description: Service Unavailable - Service temporarily unavailable + '524': + content: + application/json: + example: + error: + code: 524 + message: Request timed out. Please try again later. + schema: + $ref: '#/components/schemas/EdgeNetworkTimeoutResponse' + description: Infrastructure Timeout - Provider request timed out at edge network + '529': + content: + application/json: + example: + error: + code: 529 + message: Provider returned error + schema: + $ref: '#/components/schemas/ProviderOverloadedResponse' + description: Provider Overloaded - Provider is temporarily overloaded + summary: Create transcription + tags: + - STT + x-speakeasy-max-method-params: 1 + x-speakeasy-name-override: createTranscription + /auth/keys: + post: + description: Exchange an authorization code from the PKCE flow for a user-controlled API key + operationId: exchangeAuthCodeForAPIKey + requestBody: + content: + application/json: + example: + code: auth_code_abc123def456 + code_challenge_method: S256 + code_verifier: dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk + schema: + example: + code: auth_code_abc123def456 + code_challenge_method: S256 + code_verifier: dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk + properties: + code: + description: The authorization code received from the OAuth redirect + example: auth_code_abc123def456 + type: string + code_challenge_method: + description: The method used to generate the code challenge + enum: + - S256 + - plain + - null + example: S256 + nullable: true + type: string + x-speakeasy-unknown-values: allow + code_verifier: + description: The code verifier if code_challenge was used in the authorization request + example: dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk + type: string + required: + - code + type: object + required: true + responses: + '200': + content: + application/json: + example: + key: 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 + user_id: user_2yOPcMpKoQhcd4bVgSMlELRaIah + schema: + example: + key: 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 + user_id: user_2yOPcMpKoQhcd4bVgSMlELRaIah + properties: + key: + description: The API key to use for OpenRouter requests + example: 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 + type: string + user_id: + description: User ID associated with the API key + example: user_2yOPcMpKoQhcd4bVgSMlELRaIah + nullable: true + type: string + required: + - key + - user_id + type: object + description: Successfully exchanged code for an API key + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '403': + content: + application/json: + example: + error: + code: 403 + message: Only management keys can perform this operation + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: Forbidden - Authentication successful but insufficient permissions + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Exchange authorization code for API key + tags: + - OAuth + /auth/keys/code: + post: + description: Create an authorization code for the PKCE flow to generate a user-controlled API key + operationId: createAuthKeysCode + requestBody: + content: + application/json: + example: + callback_url: https://myapp.com/auth/callback + code_challenge: E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM + code_challenge_method: S256 + limit: 100 + schema: + example: + callback_url: https://myapp.com/auth/callback + code_challenge: E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM + code_challenge_method: S256 + limit: 100 + properties: + callback_url: + description: >- + The callback URL to redirect to after authorization. Supports https URLs and localhost/127.0.0.1 URLs on any port for local CLI tools. + example: https://myapp.com/auth/callback + format: uri + type: string + code_challenge: + description: PKCE code challenge for enhanced security + example: E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM + type: string + code_challenge_method: + description: The method used to generate the code challenge + enum: + - S256 + - plain + example: S256 + type: string + x-speakeasy-unknown-values: allow + expires_at: + description: Optional expiration time for the API key to be created + example: '2027-12-31T23:59:59Z' + format: date-time + nullable: true + type: string + key_label: + description: Optional custom label for the API key. Defaults to the app name if not provided. + example: My Custom Key + maxLength: 100 + type: string + limit: + description: Credit limit for the API key to be created + example: 100 + format: double + type: number + spawn_agent: + description: Agent identifier for spawn telemetry + example: my-agent + type: string + x-fern-ignore: true + x-speakeasy-ignore: true + spawn_cloud: + description: Cloud identifier for spawn telemetry + example: aws-us-east-1 + type: string + x-fern-ignore: true + x-speakeasy-ignore: true + usage_limit_type: + description: Optional credit limit reset interval. When set, the credit limit resets on this interval. + enum: + - daily + - weekly + - monthly + example: monthly + type: string + x-speakeasy-unknown-values: allow + workspace_id: + description: Optional workspace ID to associate the API key with + format: uuid + type: string + required: + - callback_url + type: object + required: true + responses: + '200': + content: + application/json: + example: + data: + app_id: 12345 + created_at: '2025-08-24T10:30:00Z' + id: auth_code_xyz789 + schema: + example: + data: + app_id: 12345 + created_at: '2025-08-24T10:30:00Z' + id: auth_code_xyz789 + properties: + data: + description: Auth code data + example: + app_id: 12345 + created_at: '2025-08-24T10:30:00Z' + id: auth_code_xyz789 + properties: + app_id: + description: The application ID associated with this auth code + example: 12345 + type: integer + created_at: + description: ISO 8601 timestamp of when the auth code was created + example: '2025-08-24T10:30:00Z' + type: string + id: + description: The authorization code ID to use in the exchange request + example: auth_code_xyz789 + type: string + required: + - id + - app_id + - created_at + type: object + required: + - data + type: object + description: Successfully created authorization code + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '403': + content: + application/json: + example: + error: + code: 403 + message: Only management keys can perform this operation + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: Forbidden - Authentication successful but insufficient permissions + '409': + content: + application/json: + example: + error: + code: 409 + message: Resource conflict. Please try again later. + schema: + $ref: '#/components/schemas/ConflictResponse' + description: Conflict - Resource conflict or concurrent modification + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Create authorization code + tags: + - OAuth + x-speakeasy-name-override: createAuthCode + /byok: + get: + description: >- + List the bring-your-own-key (BYOK) provider credentials for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace, or the `provider` query parameter to filter by upstream provider. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: listBYOKKeys + parameters: + - description: Number of records to skip for pagination + in: query + name: offset + required: false + schema: + description: Number of records to skip for pagination + example: 0 + minimum: 0 + nullable: true + type: integer + - description: Maximum number of records to return (max 100) + in: query + name: limit + required: false + schema: + description: Maximum number of records to return (max 100) + example: 50 + maximum: 100 + minimum: 1 + type: integer + - description: Optional workspace ID to filter by. Defaults to the authenticated entity's default workspace. + in: query + name: workspace_id + required: false + schema: + description: Optional workspace ID to filter by. Defaults to the authenticated entity's default workspace. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + - description: Optional provider slug to filter by (e.g. `openai`, `anthropic`, `amazon-bedrock`). + in: query + name: provider + required: false + schema: + description: Optional provider slug to filter by (e.g. `openai`, `anthropic`, `amazon-bedrock`). + enum: + - ai21 + - aion-labs + - akashml + - alibaba + - amazon-bedrock + - amazon-nova + - ambient + - anthropic + - arcee-ai + - atlas-cloud + - avian + - azure + - baidu + - baseten + - black-forest-labs + - byteplus + - cerebras + - chutes + - cirrascale + - clarifai + - cloudflare + - cohere + - crusoe + - darkbloom + - decart + - deepinfra + - deepseek + - dekallm + - digitalocean + - featherless + - fireworks + - friendli + - gmicloud + - google-ai-studio + - google-vertex + - groq + - inception + - inceptron + - inference-net + - infermatic + - inflection + - io-net + - ionstream + - liquid + - mancer + - mara + - minimax + - mistral + - modelrun + - modular + - moonshotai + - morph + - ncompass + - nebius + - nex-agi + - nextbit + - novita + - nvidia + - open-inference + - openai + - parasail + - perceptron + - perplexity + - phala + - poolside + - recraft + - reka + - relace + - sambanova + - seed + - siliconflow + - sourceful + - stepfun + - streamlake + - switchpoint + - together + - upstage + - venice + - wafer + - wandb + - xai + - xiaomi + - z-ai + example: openai + type: string + x-speakeasy-unknown-values: allow + responses: + '200': + content: + application/json: + example: + data: + - allowed_api_key_hashes: null + allowed_models: null + allowed_user_ids: null + created_at: '2025-08-24T10:30:00Z' + disabled: false + id: 11111111-2222-3333-4444-555555555555 + is_fallback: false + label: sk-...AbCd + name: Production OpenAI Key + provider: openai + sort_order: 0 + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + total_count: 1 + schema: + $ref: '#/components/schemas/ListBYOKKeysResponse' + description: List of BYOK credentials + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: List BYOK provider credentials + tags: + - BYOK + x-speakeasy-name-override: list + x-speakeasy-pagination: + inputs: + - in: parameters + name: offset + type: offset + - in: parameters + name: limit + type: limit + outputs: + results: $.data + type: offsetLimit + post: + description: >- + Create a new bring-your-own-key (BYOK) provider credential. The raw key is encrypted at rest and never returned in API responses. Defaults to the authenticated entity's default workspace; use the `workspace_id` body field to scope to a different workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: createBYOKKey + requestBody: + content: + application/json: + example: + key: sk-proj-abc123... + name: Production OpenAI Key + provider: openai + schema: + $ref: '#/components/schemas/CreateBYOKKeyRequest' + required: true + responses: + '201': + content: + application/json: + example: + data: + allowed_api_key_hashes: null + allowed_models: null + allowed_user_ids: null + created_at: '2025-08-24T10:30:00Z' + disabled: false + id: 11111111-2222-3333-4444-555555555555 + is_fallback: false + label: sk-...AbCd + name: Production OpenAI Key + provider: openai + sort_order: 0 + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + schema: + $ref: '#/components/schemas/CreateBYOKKeyResponse' + description: BYOK credential created successfully + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '403': + content: + application/json: + example: + error: + code: 403 + message: Only management keys can perform this operation + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: Forbidden - Authentication successful but insufficient permissions + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Create a BYOK provider credential + tags: + - BYOK + x-speakeasy-name-override: create + /byok/{id}: + delete: + description: >- + Delete (soft-delete) a bring-your-own-key (BYOK) provider credential by its `id`. The encrypted key material is wiped and the record is marked as deleted. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: deleteBYOKKey + parameters: + - description: The BYOK credential ID (UUID). + in: path + name: id + required: true + schema: + description: The BYOK credential ID (UUID). + example: 11111111-2222-3333-4444-555555555555 + format: uuid + type: string + responses: + '200': + content: + application/json: + example: + deleted: true + schema: + $ref: '#/components/schemas/DeleteBYOKKeyResponse' + description: BYOK credential deleted successfully + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Delete a BYOK provider credential + tags: + - BYOK + x-speakeasy-name-override: delete + get: + description: >- + Get a single bring-your-own-key (BYOK) provider credential by its `id`. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: getBYOKKey + parameters: + - description: The BYOK credential ID (UUID). + in: path + name: id + required: true + schema: + description: The BYOK credential ID (UUID). + example: 11111111-2222-3333-4444-555555555555 + format: uuid + type: string + responses: + '200': + content: + application/json: + example: + data: + allowed_api_key_hashes: null + allowed_models: null + allowed_user_ids: null + created_at: '2025-08-24T10:30:00Z' + disabled: false + id: 11111111-2222-3333-4444-555555555555 + is_fallback: false + label: sk-...AbCd + name: Production OpenAI Key + provider: openai + sort_order: 0 + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + schema: + $ref: '#/components/schemas/GetBYOKKeyResponse' + description: BYOK credential details + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Get a BYOK provider credential + tags: + - BYOK + x-speakeasy-name-override: get + patch: + description: >- + Update an existing bring-your-own-key (BYOK) provider credential by its `id`. Include the `key` field to rotate the raw provider API key in-place (the previous key material is overwritten). [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: updateBYOKKey + parameters: + - description: The BYOK credential ID (UUID). + in: path + name: id + required: true + schema: + description: The BYOK credential ID (UUID). + example: 11111111-2222-3333-4444-555555555555 + format: uuid + type: string + requestBody: + content: + application/json: + example: + disabled: false + name: Updated OpenAI Key + schema: + $ref: '#/components/schemas/UpdateBYOKKeyRequest' + required: true + responses: + '200': + content: + application/json: + example: + data: + allowed_api_key_hashes: null + allowed_models: null + allowed_user_ids: null + created_at: '2025-08-24T10:30:00Z' + disabled: false + id: 11111111-2222-3333-4444-555555555555 + is_fallback: false + label: sk-...AbCd + name: Updated OpenAI Key + provider: openai + sort_order: 0 + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + schema: + $ref: '#/components/schemas/UpdateBYOKKeyResponse' + description: BYOK credential updated successfully + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Update a BYOK provider credential + tags: + - BYOK + x-speakeasy-name-override: update + /chat/completions: + post: + description: >- + Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes. + operationId: sendChatCompletionRequest + parameters: + - description: >- + Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. + example: enabled + in: header + name: X-OpenRouter-Metadata + required: false + schema: + $ref: '#/components/schemas/MetadataLevel' + requestBody: + content: + application/json: + example: + max_tokens: 150 + messages: + - content: You are a helpful assistant. + role: system + - content: What is the capital of France? + role: user + model: openai/gpt-4 + temperature: 0.7 + schema: + $ref: '#/components/schemas/ChatRequest' + required: true + responses: + '200': + content: + application/json: + example: + choices: + - finish_reason: stop + index: 0 + message: + content: The capital of France is Paris. + role: assistant + created: 1677652288 + id: chatcmpl-123 + model: openai/gpt-4 + object: chat.completion + usage: + completion_tokens: 10 + prompt_tokens: 25 + total_tokens: 35 + schema: + $ref: '#/components/schemas/ChatResult' + text/event-stream: + example: + data: + choices: + - delta: + content: Hello + role: assistant + finish_reason: null + index: 0 + created: 1677652288 + id: chatcmpl-123 + model: openai/gpt-4 + object: chat.completion.chunk + schema: + $ref: '#/components/schemas/ChatStreamingResponse' + x-speakeasy-sse-sentinel: '[DONE]' + description: Successful chat completion response + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '402': + content: + application/json: + example: + error: + code: 402 + message: Insufficient credits. Add more using https://openrouter.ai/credits + schema: + $ref: '#/components/schemas/PaymentRequiredResponse' + description: Payment Required - Insufficient credits or quota to complete request + '403': + content: + application/json: + examples: + guardrail-blocked: + summary: Guardrail blocked the request + value: + error: + code: 403 + message: 'Request blocked: prompt injection patterns detected' + metadata: + patterns: + - ignore all previous instructions + openrouter_metadata: + attempt: 1 + endpoints: + available: + - model: openai/gpt-4o + provider: OpenAI + selected: false + total: 1 + is_byok: false + pipeline: + - data: + action: blocked + detected: true + engines: + - regex + patterns: + - ignore all previous instructions + guardrail_id: grd_abc123 + guardrail_scope: api-key + name: regex_pi_detection + summary: 'Blocked: prompt injection detected (1 pattern matched)' + type: guardrail + region: iad + requested: openai/gpt-4o + strategy: direct + summary: available=1 + insufficient-permissions: + summary: Insufficient permissions + value: + error: + code: 403 + message: Only management keys can perform this operation + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: >- + Forbidden - Authentication successful but insufficient permissions, or a guardrail blocked the request. When guardrails block and the `X-OpenRouter-Metadata: enabled` header is present, the response includes `openrouter_metadata` with full routing context and a `pipeline` array containing guardrail stage details. + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '408': + content: + application/json: + example: + error: + code: 408 + message: Operation timed out. Please try again later. + schema: + $ref: '#/components/schemas/RequestTimeoutResponse' + description: Request Timeout - Operation exceeded time limit + '413': + content: + application/json: + example: + error: + code: 413 + message: Request payload too large + schema: + $ref: '#/components/schemas/PayloadTooLargeResponse' + description: Payload Too Large - Request payload exceeds size limits + '422': + content: + application/json: + example: + error: + code: 422 + message: Invalid argument + schema: + $ref: '#/components/schemas/UnprocessableEntityResponse' + description: Unprocessable Entity - Semantic validation failure + '429': + content: + application/json: + example: + error: + code: 429 + message: Rate limit exceeded + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + '502': + content: + application/json: + example: + error: + code: 502 + message: Provider returned error + schema: + $ref: '#/components/schemas/BadGatewayResponse' + description: Bad Gateway - Provider/upstream API failure + '503': + content: + application/json: + example: + error: + code: 503 + message: Service temporarily unavailable + schema: + $ref: '#/components/schemas/ServiceUnavailableResponse' + description: Service Unavailable - Service temporarily unavailable + '524': + content: + application/json: + example: + error: + code: 524 + message: Request timed out. Please try again later. + schema: + $ref: '#/components/schemas/EdgeNetworkTimeoutResponse' + description: Infrastructure Timeout - Provider request timed out at edge network + '529': + content: + application/json: + example: + error: + code: 529 + message: Provider returned error + schema: + $ref: '#/components/schemas/ProviderOverloadedResponse' + description: Provider Overloaded - Provider is temporarily overloaded + summary: Create a chat completion + tags: + - Chat + x-speakeasy-group: chat + x-speakeasy-name-override: send + x-speakeasy-stream-request-field: stream + /credits: + get: + description: >- + Get total credits purchased and used for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: getCredits + responses: + '200': + content: + application/json: + example: + data: + total_credits: 100.5 + total_usage: 25.75 + schema: + description: Total credits purchased and used + example: + data: + total_credits: 100.5 + total_usage: 25.75 + properties: + data: + example: + total_credits: 100.5 + total_usage: 25.75 + properties: + total_credits: + description: Total credits purchased + example: 100.5 + format: double + type: number + total_usage: + description: Total credits used + example: 25.75 + format: double + type: number + required: + - total_credits + - total_usage + type: object + required: + - data + type: object + description: Returns the total credits purchased and used + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '403': + content: + application/json: + example: + error: + code: 403 + message: Only management keys can perform this operation + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: Forbidden - Authentication successful but insufficient permissions + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Get remaining credits + tags: + - Credits + x-speakeasy-name-override: getCredits + /credits/coinbase: + post: + deprecated: true + description: >- + Deprecated. The Coinbase APIs used by this endpoint have been deprecated, so Coinbase Commerce charges have been removed. Use the web credits purchase flow instead. + operationId: createCoinbaseCharge + responses: + '200': + description: This endpoint is deprecated and will never return a 200 response. + '410': + content: + application/json: + example: + error: + code: 410 + message: >- + The Coinbase APIs used by this endpoint have been deprecated, so the Coinbase Commerce credits API has been removed. Use the web credits purchase flow instead. + schema: + $ref: '#/components/schemas/GoneResponse' + description: Gone - Endpoint has been permanently removed or deprecated + security: [] + summary: Deprecated Coinbase Commerce charge endpoint + tags: + - Credits + x-fern-ignore: true + x-speakeasy-ignore: true + x-speakeasy-name-override: createCoinbaseCharge + /datasets/app-rankings: + get: + description: |- + Returns the top public apps on OpenRouter ranked by token usage inside the requested + date window, matching the public apps marketplace on openrouter.ai/apps. Token totals + are `prompt_tokens + completion_tokens`; hidden and private apps are excluded and + traffic from related app aliases is merged into the canonical visible app. + + `sort=popular` (default) ranks by total token volume inside the window. + `sort=trending` ranks by absolute excess token growth: window volume minus the average + volume of the three equal-length periods immediately preceding the window. Apps with + no excess growth are omitted, so `trending` may return fewer than `limit` rows. + + Filter with `category` (marketplace category group, e.g. `coding`) or `subcategory` + (e.g. `cli-agent`). Ranks are re-numbered 1..N after filtering. Page with `offset` — + `rank` stays absolute, so the first row of `offset=50` is `rank: 51`. + + Authenticate with any valid OpenRouter API key (same key used for inference). + Rate-limited to 30 requests/minute per key and 500 requests/day per account. + + When republishing or quoting this dataset, OpenRouter must be cited as: + "Source: OpenRouter (openrouter.ai/apps), as of {as_of}." + + Token counts come from each upstream provider's own tokenizer, so a token attributed + to one app is not directly comparable to a token attributed to another app whose + traffic flows through a different provider. + operationId: getAppRankings + parameters: + - description: >- + Marketplace category group to filter by (e.g. `coding`). Only apps tagged with a subcategory inside this group are returned. Mutually combinable with `subcategory` — when both are supplied the `subcategory` must belong to the `category` group. + in: query + name: category + required: false + schema: + description: >- + Marketplace category group to filter by (e.g. `coding`). Only apps tagged with a subcategory inside this group are returned. Mutually combinable with `subcategory` — when both are supplied the `subcategory` must belong to the `category` group. + enum: + - coding + - creative + - productivity + - entertainment + example: coding + type: string + x-speakeasy-unknown-values: allow + - description: >- + Marketplace subcategory to filter by (e.g. `cli-agent`). Takes precedence over `category` for the actual filter; when `category` is also supplied the pair must be consistent. + in: query + name: subcategory + required: false + schema: + description: >- + Marketplace subcategory to filter by (e.g. `cli-agent`). Takes precedence over `category` for the actual filter; when `category` is also supplied the pair must be consistent. + enum: + - cli-agent + - ide-extension + - cloud-agent + - programming-app + - native-app-builder + - creative-writing + - video-gen + - image-gen + - audio-gen + - roleplay + - game + - writing-assistant + - general-chat + - personal-agent + - legal + example: cli-agent + type: string + x-speakeasy-unknown-values: allow + - description: >- + `popular` ranks apps by total token volume inside the date window. `trending` ranks apps by absolute excess token growth: window volume minus the average volume of the three equal-length periods immediately preceding the window. Apps with no excess growth are omitted from `trending` results. + in: query + name: sort + required: false + schema: + default: popular + description: >- + `popular` ranks apps by total token volume inside the date window. `trending` ranks apps by absolute excess token growth: window volume minus the average volume of the three equal-length periods immediately preceding the window. Apps with no excess growth are omitted from `trending` results. + enum: + - popular + - trending + example: popular + type: string + x-speakeasy-unknown-values: allow + - description: >- + Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`. + in: query + name: start_date + required: false + schema: + description: >- + Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`. + example: '2026-04-12' + pattern: ^\d{4}-\d{2}-\d{2}$ + type: string + - description: >- + End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400. + in: query + name: end_date + required: false + schema: + description: >- + End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400. + example: '2026-05-11' + pattern: ^\d{4}-\d{2}-\d{2}$ + type: string + - description: Maximum number of apps to return (1-100). Defaults to 50. + in: query + name: limit + required: false + schema: + default: 50 + description: Maximum number of apps to return (1-100). Defaults to 50. + example: 50 + maximum: 100 + minimum: 1 + type: integer + - description: >- + Number of ranked apps to skip before the first returned row (0-100). Defaults to 0. `rank` stays absolute, so the first row of `offset=50` is `rank: 51`. + in: query + name: offset + required: false + schema: + default: 0 + description: >- + Number of ranked apps to skip before the first returned row (0-100). Defaults to 0. `rank` stays absolute, so the first row of `offset=50` is `rank: 51`. + example: 0 + maximum: 100 + minimum: 0 + nullable: true + type: integer + responses: + '200': + content: + application/json: + example: + data: + - app_id: 12345 + app_name: Cline + rank: 1 + total_requests: 4321 + total_tokens: '12345678' + - app_id: 67890 + app_name: Roo Code + rank: 2 + total_requests: 2109 + total_tokens: '9876543' + meta: + as_of: '2026-05-12T02:00:00Z' + end_date: '2026-05-11' + start_date: '2026-04-12' + version: v1 + schema: + $ref: '#/components/schemas/AppRankingsResponse' + description: >- + Apps ranked per the requested `sort`, re-numbered 1..N. `popular` sorts by `total_tokens` descending; `trending` sorts by absolute excess token growth descending and may return fewer than `limit` rows. + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '429': + content: + application/json: + example: + error: + code: 429 + message: Rate limit exceeded + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Top apps by token usage + tags: + - Datasets + x-speakeasy-pagination: + inputs: + - in: parameters + name: offset + type: offset + - in: parameters + name: limit + type: limit + outputs: + results: $.data + type: offsetLimit + /datasets/benchmarks/artificial-analysis: + get: + description: >- + Returns composite index scores (Intelligence, Coding, Agentic) from Artificial Analysis for LLM models. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. + operationId: getBenchmarksArtificialAnalysis parameters: - - description: Filter by a single UTC date in the last 30 days (YYYY-MM-DD format). + - description: Max results to return (1–100, default 50). in: query - name: date + name: max_results required: false schema: - description: Filter by a single UTC date in the last 30 days (YYYY-MM-DD format). - example: '2025-08-24' - type: string - - description: Filter by API key hash (SHA-256 hex string, as returned by the keys API). + default: 50 + description: Max results to return (1–100, default 50). + example: 20 + maximum: 100 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + example: + data: + - aa_name: GPT-4o + agentic_index: 58.3 + coding_index: 65.8 + intelligence_index: 71.2 + model_permaslug: openai/gpt-4o + pricing: + completion: '0.00001' + prompt: '0.0000025' + meta: + as_of: '2026-06-03T12:00:00Z' + citation: 'Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).' + model_count: 1 + source: artificial-analysis + source_url: https://artificialanalysis.ai + version: v1 + schema: + $ref: '#/components/schemas/BenchmarksAAResponse' + description: Artificial Analysis composite index scores with pricing and attribution metadata. + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '429': + content: + application/json: + example: + error: + code: 429 + message: Rate limit exceeded + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Artificial Analysis Benchmark Indices + tags: + - Datasets + /datasets/benchmarks/design-arena: + get: + description: >- + Returns ELO ratings from head-to-head arena battles on Design Arena. Filterable by arena (models/builders/agents) and category. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. + operationId: getBenchmarksDesignArena + parameters: + - description: Arena to query. Defaults to `models`. in: query - name: api_key_hash + name: arena required: false schema: - description: Filter by API key hash (SHA-256 hex string, as returned by the keys API). - example: abc123def456... + default: models + description: Arena to query. Defaults to `models`. + enum: + - models + - builders + - agents + example: models type: string - - description: Filter by org member user ID. Only applicable for organization accounts. + x-speakeasy-unknown-values: allow + - description: >- + Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. in: query - name: user_id + name: category required: false schema: - description: Filter by org member user ID. Only applicable for organization accounts. - example: user_abc123 + description: >- + Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. + example: codecategories type: string + - description: 'Max results to return: per category when no category filter is applied (1–100, default 50).' + in: query + name: max_results + required: false + schema: + default: 50 + description: 'Max results to return: per category when no category filter is applied (1–100, default 50).' + example: 20 + maximum: 100 + minimum: 1 + type: integer responses: '200': content: application/json: example: data: - - byok_usage_inference: 0.012 - completion_tokens: 125 - date: '2025-08-24' - endpoint_id: 550e8400-e29b-41d4-a716-446655440000 - model: openai/gpt-4.1 - model_permaslug: openai/gpt-4.1-2025-04-14 - prompt_tokens: 50 - provider_name: OpenAI - reasoning_tokens: 25 - requests: 5 - usage: 0.015 - schema: - $ref: '#/components/schemas/ActivityResponse' - description: Returns user activity data grouped by endpoint + - arena: models + avg_generation_time_ms: 3200 + category: codecategories + display_name: Claude Sonnet 4 + elo: 1423 + model_permaslug: anthropic/claude-sonnet-4 + pricing: + completion: '0.000015' + prompt: '0.000003' + tournament_stats: + first_place: 12 + fourth_place: 2 + second_place: 8 + third_place: 5 + total: 27 + win_rate: 72 + meta: + arena: models + as_of: '2026-06-03T12:00:00Z' + category: null + citation: 'Source: Design Arena (www.designarena.ai) via OpenRouter (openrouter.ai/rankings).' + elo_bounds: + max: 1600 + min: 900 + model_count: 1 + source: design-arena + source_url: https://www.designarena.ai + version: v1 + schema: + $ref: '#/components/schemas/BenchmarksDAResponse' + description: Design Arena ELO rankings with pricing and attribution metadata. '400': content: application/json: @@ -14891,26 +24019,129 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: Unauthorized - Authentication required or invalid credentials - '403': + '429': content: application/json: example: error: - code: 403 - message: Only management keys can perform this operation + code: 429 + message: Rate limit exceeded schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: Forbidden - Authentication successful but insufficient permissions - '404': + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded + '500': content: application/json: example: error: - code: 404 - message: Resource not found + code: 500 + message: Internal Server Error schema: - $ref: '#/components/schemas/NotFoundResponse' - description: Not Found - Resource does not exist + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Design Arena Benchmark Rankings + tags: + - Datasets + /datasets/rankings-daily: + get: + description: |- + Returns the top 50 public models per day by total token usage on OpenRouter, plus a + single aggregated `other` row per day that sums every model outside that top 50. + Token totals are `prompt_tokens + completion_tokens`, matching the public rankings + chart on openrouter.ai/rankings. + + Each row is a distinct `(date, model_permaslug)` pair. The `other` row uses the + reserved permaslug `other` and is always returned last within its date, so callers + can compute `top-50 traffic / total daily traffic` without a second request. + + Authenticate with any valid OpenRouter API key (same key used for inference). + Rate-limited to 30 requests/minute per key and 500 requests/day per account. + + When republishing or quoting this dataset, OpenRouter must be cited as: + "Source: OpenRouter (openrouter.ai/rankings), as of {as_of}." + + Token counts come from each upstream provider's own tokenizer (Anthropic counts + are as reported by Anthropic, OpenAI counts are as reported by OpenAI, etc.), so + a token in one row is not directly comparable to a token in another row from a + different provider. + operationId: getRankingsDaily + parameters: + - description: >- + Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`. + in: query + name: start_date + required: false + schema: + description: >- + Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`. + example: '2026-04-12' + pattern: ^\d{4}-\d{2}-\d{2}$ + type: string + - description: >- + End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400. + in: query + name: end_date + required: false + schema: + description: >- + End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400. + example: '2026-05-11' + pattern: ^\d{4}-\d{2}-\d{2}$ + type: string + responses: + '200': + content: + application/json: + example: + data: + - date: '2026-05-11' + model_permaslug: openai/gpt-4o-2024-05-13 + total_tokens: '12345678' + - date: '2026-05-11' + model_permaslug: anthropic/claude-3.5-sonnet-20241022 + total_tokens: '9876543' + - date: '2026-05-11' + model_permaslug: other + total_tokens: '4321098' + meta: + as_of: '2026-05-12T02:00:00Z' + end_date: '2026-05-11' + start_date: '2026-04-12' + version: v1 + schema: + $ref: '#/components/schemas/RankingsDailyResponse' + description: >- + Up to 51 rows per day — the top 50 public models by `total_tokens` plus a single aggregated `other` row covering every model outside that top 50. Sorted by `date` ascending, then by `total_tokens` descending, with `other` pinned last within its date. + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '429': + content: + application/json: + example: + error: + code: 429 + message: Rate limit exceeded + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded '500': content: application/json: @@ -14921,35 +24152,245 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: Get user activity grouped by endpoint + summary: Daily token totals for top 50 models tags: - - Analytics - /audio/speech: + - Datasets + /embeddings: post: - description: Synthesizes audio from the input text - operationId: createAudioSpeech + description: Submits an embedding request to the embeddings router + operationId: createEmbeddings requestBody: content: application/json: - example: - input: Hello world - model: elevenlabs/eleven-turbo-v2 - response_format: pcm - speed: 1 - voice: alloy schema: - $ref: '#/components/schemas/SpeechRequest' + description: Embeddings request input + example: + dimensions: 1536 + input: The quick brown fox jumps over the lazy dog + model: openai/text-embedding-3-small + properties: + dimensions: + description: The number of dimensions for the output embeddings + example: 1536 + minimum: 1 + type: integer + encoding_format: + description: The format of the output embeddings + enum: + - float + - base64 + example: float + type: string + x-speakeasy-unknown-values: allow + input: + anyOf: + - type: string + - items: + type: string + type: array + - items: + type: number + type: array + - items: + items: + type: number + type: array + type: array + - items: + properties: + content: + items: + oneOf: + - properties: + text: + type: string + type: + enum: + - text + type: string + required: + - type + - text + type: object + - properties: + image_url: + properties: + url: + type: string + required: + - url + type: object + type: + enum: + - image_url + type: string + required: + - type + - image_url + type: object + - $ref: '#/components/schemas/ContentPartInputAudio' + - $ref: '#/components/schemas/ContentPartInputVideo' + - $ref: '#/components/schemas/ContentPartInputFile' + type: array + required: + - content + type: object + type: array + description: Text, token, or multimodal input(s) to embed + example: The quick brown fox jumps over the lazy dog + input_type: + description: The type of input (e.g. search_query, search_document) + example: search_query + type: string + model: + description: The model to use for embeddings + example: openai/text-embedding-3-small + type: string + provider: + allOf: + - $ref: '#/components/schemas/ProviderPreferences' + - description: Provider routing preferences for the request. + user: + description: A unique identifier for the end-user + example: user-1234 + type: string + required: + - input + - model + type: object required: true responses: '200': content: - audio/*: + application/json: schema: - description: Raw audio bytestream. Content-Type varies by requested format (audio/mpeg for mp3, audio/L16 for pcm). - example: - format: binary + description: Embeddings response containing embedding vectors + example: + data: + - embedding: + - 0.0023064255 + - -0.009327292 + - 0.015797347 + index: 0 + object: embedding + model: openai/text-embedding-3-small + object: list + usage: + prompt_tokens: 8 + total_tokens: 8 + properties: + data: + description: List of embedding objects + example: + - embedding: + - 0.0023064255 + - -0.009327292 + - 0.015797347 + index: 0 + object: embedding + items: + description: A single embedding object + example: + embedding: + - 0.0023064255 + - -0.009327292 + - 0.015797347 + index: 0 + object: embedding + properties: + embedding: + anyOf: + - items: + type: number + type: array + - type: string + description: Embedding vector as an array of floats or a base64 string + example: + - 0.0023064255 + - -0.009327292 + - 0.015797347 + index: + description: Index of the embedding in the input list + example: 0 + type: integer + object: + enum: + - embedding + type: string + required: + - object + - embedding + type: object + type: array + id: + description: Unique identifier for the embeddings response + example: embd-1234567890 + type: string + model: + description: The model used for embeddings + example: openai/text-embedding-3-small + type: string + object: + enum: + - list + type: string + usage: + description: Token usage statistics + example: + prompt_tokens: 8 + total_tokens: 8 + properties: + cost: + description: Cost of the request in credits + example: 0.0001 + format: double + type: number + prompt_tokens: + description: Number of tokens in the input + example: 8 + type: integer + prompt_tokens_details: + description: >- + Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included. + properties: + audio_tokens: + description: Number of audio tokens in the input + type: integer + file_tokens: + description: Number of file/document tokens in the input + type: integer + image_tokens: + description: Number of image tokens in the input + example: 258 + type: integer + text_tokens: + description: Number of text tokens in the input + example: 8 + type: integer + video_tokens: + description: Number of video tokens in the input + type: integer + type: object + total_tokens: + description: Total number of tokens used + example: 8 + type: integer + required: + - prompt_tokens + - total_tokens + type: object + required: + - object + - data + - model + type: object + text/event-stream: + example: 'data: [DONE]' + schema: + description: Not used for embeddings - embeddings do not support streaming type: string - description: Audio bytes stream + x-speakeasy-sse-sentinel: '[DONE]' + description: Embedding response '400': content: application/json: @@ -15050,75 +24491,54 @@ paths: schema: $ref: '#/components/schemas/ProviderOverloadedResponse' description: Provider Overloaded - Provider is temporarily overloaded - summary: Create speech + summary: Submit an embedding request tags: - - TTS - x-speakeasy-name-override: createSpeech - /auth/keys: - post: - description: Exchange an authorization code from the PKCE flow for a user-controlled API key - operationId: exchangeAuthCodeForAPIKey - requestBody: - content: - application/json: - example: - code: auth_code_abc123def456 - code_challenge_method: S256 - code_verifier: dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk - schema: - example: - code: auth_code_abc123def456 - code_challenge_method: S256 - code_verifier: dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk - properties: - code: - description: The authorization code received from the OAuth redirect - example: auth_code_abc123def456 - type: string - code_challenge_method: - description: The method used to generate the code challenge - enum: - - S256 - - plain - - null - example: S256 - nullable: true - type: string - x-speakeasy-unknown-values: allow - code_verifier: - description: The code verifier if code_challenge was used in the authorization request - example: dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk - type: string - required: - - code - type: object - required: true + - Embeddings + x-speakeasy-name-override: generate + /embeddings/models: + get: + description: Returns a list of all available embeddings models and their properties + operationId: listEmbeddingsModels responses: '200': content: application/json: example: - key: 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 - user_id: user_2yOPcMpKoQhcd4bVgSMlELRaIah + data: + - architecture: + input_modalities: + - text + instruct_type: null + modality: text->text + output_modalities: + - embeddings + tokenizer: GPT + canonical_slug: openai/text-embedding-3-small + context_length: 8192 + created: 1692901234 + default_parameters: null + description: OpenAI text embedding model optimized for performance. + expiration_date: null + id: openai/text-embedding-3-small + knowledge_cutoff: null + links: + details: /api/v1/models/openai/text-embedding-3-small/endpoints + name: Text Embedding 3 Small + per_request_limits: null + pricing: + completion: '0' + image: '0' + prompt: '0.00000002' + request: '0' + supported_parameters: [] + supported_voices: null + top_provider: + context_length: 8192 + is_moderated: false + max_completion_tokens: null schema: - example: - key: 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 - user_id: user_2yOPcMpKoQhcd4bVgSMlELRaIah - properties: - key: - description: The API key to use for OpenRouter requests - example: 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 - type: string - user_id: - description: User ID associated with the API key - example: user_2yOPcMpKoQhcd4bVgSMlELRaIah - nullable: true - type: string - required: - - key - - user_id - type: object - description: Successfully exchanged code for an API key + $ref: '#/components/schemas/ModelsListResponse' + description: Returns a list of embeddings models '400': content: application/json: @@ -15129,16 +24549,6 @@ paths: schema: $ref: '#/components/schemas/BadRequestResponse' description: Bad Request - Invalid request parameters or malformed input - '403': - content: - application/json: - example: - error: - code: 403 - message: Only management keys can perform this operation - schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: Forbidden - Authentication successful but insufficient permissions '500': content: application/json: @@ -15149,131 +24559,163 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: Exchange authorization code for API key + summary: List all embeddings models tags: - - OAuth - /auth/keys/code: - post: - description: Create an authorization code for the PKCE flow to generate a user-controlled API key - operationId: createAuthKeysCode - requestBody: - content: - application/json: - example: - callback_url: https://myapp.com/auth/callback - code_challenge: E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM - code_challenge_method: S256 - limit: 100 - schema: - example: - callback_url: https://myapp.com/auth/callback - code_challenge: E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM - code_challenge_method: S256 - limit: 100 - properties: - callback_url: - description: >- - The callback URL to redirect to after authorization. Note, only https URLs on ports 443 and 3000 are allowed. - example: https://myapp.com/auth/callback - format: uri - type: string - code_challenge: - description: PKCE code challenge for enhanced security - example: E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM - type: string - code_challenge_method: - description: The method used to generate the code challenge - enum: - - S256 - - plain - example: S256 - type: string - x-speakeasy-unknown-values: allow - expires_at: - description: Optional expiration time for the API key to be created - example: '2027-12-31T23:59:59Z' - format: date-time - nullable: true - type: string - key_label: - description: Optional custom label for the API key. Defaults to the app name if not provided. - example: My Custom Key - maxLength: 100 - type: string - limit: - description: Credit limit for the API key to be created - example: 100 - format: double - type: number - spawn_agent: - description: Agent identifier for spawn telemetry - example: my-agent - type: string - x-fern-ignore: true - x-speakeasy-ignore: true - spawn_cloud: - description: Cloud identifier for spawn telemetry - example: aws-us-east-1 - type: string - x-fern-ignore: true - x-speakeasy-ignore: true - usage_limit_type: - description: Optional credit limit reset interval. When set, the credit limit resets on this interval. - enum: - - daily - - weekly - - monthly - example: monthly - type: string - x-speakeasy-unknown-values: allow - required: - - callback_url - type: object - required: true + - Embeddings + x-speakeasy-name-override: listModels + /endpoints/zdr: + get: + operationId: listEndpointsZdr responses: '200': content: application/json: example: data: - app_id: 12345 - created_at: '2025-08-24T10:30:00Z' - id: auth_code_xyz789 + - context_length: 8192 + latency_last_30m: + p50: 0.25 + p75: 0.35 + p90: 0.48 + p99: 0.85 + max_completion_tokens: 4096 + max_prompt_tokens: 8192 + model_id: openai/gpt-4 + model_name: GPT-4 + name: 'OpenAI: GPT-4' + pricing: + completion: '0.00006' + image: '0' + prompt: '0.00003' + request: '0' + provider_name: OpenAI + quantization: fp16 + status: default + supported_parameters: + - temperature + - top_p + - max_tokens + supports_implicit_caching: true + tag: openai + throughput_last_30m: + p50: 45.2 + p75: 38.5 + p90: 28.3 + p99: 15.1 + uptime_last_1d: 99.8 + uptime_last_30m: 99.5 + uptime_last_5m: 100 schema: example: data: - app_id: 12345 - created_at: '2025-08-24T10:30:00Z' - id: auth_code_xyz789 + - context_length: 8192 + latency_last_30m: + p50: 0.25 + p75: 0.35 + p90: 0.48 + p99: 0.85 + max_completion_tokens: 4096 + max_prompt_tokens: 8192 + model_id: openai/gpt-4 + model_name: GPT-4 + name: 'OpenAI: GPT-4' + pricing: + completion: '0.00006' + image: '0' + prompt: '0.00003' + request: '0' + provider_name: OpenAI + quantization: fp16 + status: default + supported_parameters: + - temperature + - top_p + - max_tokens + supports_implicit_caching: true + tag: openai + throughput_last_30m: + p50: 45.2 + p75: 38.5 + p90: 28.3 + p99: 15.1 + uptime_last_1d: 99.8 + uptime_last_30m: 99.5 + uptime_last_5m: 100 properties: data: - description: Auth code data - example: - app_id: 12345 - created_at: '2025-08-24T10:30:00Z' - id: auth_code_xyz789 - properties: - app_id: - description: The application ID associated with this auth code - example: 12345 - type: integer - created_at: - description: ISO 8601 timestamp of when the auth code was created - example: '2025-08-24T10:30:00Z' - type: string - id: - description: The authorization code ID to use in the exchange request - example: auth_code_xyz789 - type: string - required: - - id - - app_id - - created_at - type: object + items: + $ref: '#/components/schemas/PublicEndpoint' + type: array required: - data type: object - description: Successfully created authorization code + description: Returns a list of endpoints + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Preview the impact of ZDR on the available endpoints + tags: + - Endpoints + x-speakeasy-name-override: listZdrEndpoints + /files: + get: + description: Lists files belonging to the workspace of the authenticating API key. + operationId: listFiles + parameters: + - description: Maximum number of files to return (1–1000). + in: query + name: limit + required: false + schema: + description: Maximum number of files to return (1–1000). + example: 100 + maximum: 1000 + minimum: 1 + type: integer + - description: Opaque pagination cursor from a previous response. + in: query + name: cursor + required: false + schema: + description: Opaque pagination cursor from a previous response. + example: eyJjdXJzb3IiOiJmaWxlXzAxMUNOaGE4aUNKY1Uxd1hOUjZxNFY4dyJ9 + type: string + - description: Workspace to scope the request to. Defaults to the caller’s default workspace. + in: query + name: workspace_id + required: false + schema: + description: Workspace to scope the request to. Defaults to the caller’s default workspace. + example: a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 + format: uuid + type: string + responses: + '200': + content: + application/json: + example: + cursor: null + data: + - created_at: '2025-01-01T00:00:00Z' + downloadable: false + filename: document.pdf + id: file_011CNha8iCJcU1wXNR6q4V8w + mime_type: application/pdf + size_bytes: 1024000 + type: file + first_id: file_011CNha8iCJcU1wXNR6q4V8w + has_more: false + last_id: file_011CNha8iCJcU1wXNR6q4V8w + schema: + $ref: '#/components/schemas/FileListResponse' + description: A page of files. '400': content: application/json: @@ -15294,16 +24736,16 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: Unauthorized - Authentication required or invalid credentials - '409': + '429': content: application/json: example: error: - code: 409 - message: Resource conflict. Please try again later. + code: 429 + message: Rate limit exceeded schema: - $ref: '#/components/schemas/ConflictResponse' - description: Conflict - Resource conflict or concurrent modification + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded '500': content: application/json: @@ -15314,73 +24756,62 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: Create authorization code + summary: List files tags: - - OAuth - x-speakeasy-name-override: createAuthCode - /chat/completions: + - Files + x-speakeasy-name-override: list + x-speakeasy-pagination: + inputs: + - in: parameters + name: cursor + type: cursor + outputs: + nextCursor: $.cursor + results: $.data + type: cursor post: description: >- - Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes. - operationId: sendChatCompletionRequest + Uploads a file to be referenced in future API calls. The file is stored under the workspace of the authenticating API key. Maximum file size: 100 MB. + operationId: uploadFile + parameters: + - description: Workspace to scope the request to. Defaults to the caller’s default workspace. + in: query + name: workspace_id + required: false + schema: + description: Workspace to scope the request to. Defaults to the caller’s default workspace. + example: a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 + format: uuid + type: string requestBody: content: - application/json: + multipart/form-data: example: - max_tokens: 150 - messages: - - content: You are a helpful assistant. - role: system - - content: What is the capital of France? - role: user - model: openai/gpt-4 - temperature: 0.7 + file: document.pdf schema: - $ref: '#/components/schemas/ChatRequest' + properties: + file: + format: binary + type: string + required: + - file + type: object required: true responses: '200': content: application/json: example: - choices: - - finish_reason: stop - index: 0 - message: - content: The capital of France is Paris. - role: assistant - created: 1677652288 - id: chatcmpl-123 - model: openai/gpt-4 - object: chat.completion - usage: - completion_tokens: 10 - prompt_tokens: 25 - total_tokens: 35 - schema: - $ref: '#/components/schemas/ChatResult' - text/event-stream: - example: - data: - choices: - - delta: - content: Hello - role: assistant - finish_reason: null - index: 0 - created: 1677652288 - id: chatcmpl-123 - model: openai/gpt-4 - object: chat.completion.chunk + created_at: '2025-01-01T00:00:00Z' + downloadable: false + filename: document.pdf + id: file_011CNha8iCJcU1wXNR6q4V8w + mime_type: application/pdf + size_bytes: 1024000 + type: file schema: - properties: - data: - $ref: '#/components/schemas/ChatStreamChunk' - required: - - data - type: object - x-speakeasy-sse-sentinel: '[DONE]' - description: Successful chat completion response + $ref: '#/components/schemas/FileMetadata' + description: The uploaded file metadata. '400': content: application/json: @@ -15401,36 +24832,16 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: Unauthorized - Authentication required or invalid credentials - '402': - content: - application/json: - example: - error: - code: 402 - message: Insufficient credits. Add more using https://openrouter.ai/credits - schema: - $ref: '#/components/schemas/PaymentRequiredResponse' - description: Payment Required - Insufficient credits or quota to complete request - '404': - content: - application/json: - example: - error: - code: 404 - message: Resource not found - schema: - $ref: '#/components/schemas/NotFoundResponse' - description: Not Found - Resource does not exist - '408': + '403': content: application/json: example: error: - code: 408 - message: Operation timed out. Please try again later. + code: 403 + message: Only management keys can perform this operation schema: - $ref: '#/components/schemas/RequestTimeoutResponse' - description: Request Timeout - Operation exceeded time limit + $ref: '#/components/schemas/ForbiddenResponse' + description: Forbidden - Authentication successful but insufficient permissions '413': content: application/json: @@ -15441,16 +24852,6 @@ paths: schema: $ref: '#/components/schemas/PayloadTooLargeResponse' description: Payload Too Large - Request payload exceeds size limits - '422': - content: - application/json: - example: - error: - code: 422 - message: Invalid argument - schema: - $ref: '#/components/schemas/UnprocessableEntityResponse' - description: Unprocessable Entity - Semantic validation failure '429': content: application/json: @@ -15471,95 +24872,40 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - '502': - content: - application/json: - example: - error: - code: 502 - message: Provider returned error - schema: - $ref: '#/components/schemas/BadGatewayResponse' - description: Bad Gateway - Provider/upstream API failure - '503': - content: - application/json: - example: - error: - code: 503 - message: Service temporarily unavailable - schema: - $ref: '#/components/schemas/ServiceUnavailableResponse' - description: Service Unavailable - Service temporarily unavailable - '524': - content: - application/json: - example: - error: - code: 524 - message: Request timed out. Please try again later. - schema: - $ref: '#/components/schemas/EdgeNetworkTimeoutResponse' - description: Infrastructure Timeout - Provider request timed out at edge network - '529': - content: - application/json: - example: - error: - code: 529 - message: Provider returned error - schema: - $ref: '#/components/schemas/ProviderOverloadedResponse' - description: Provider Overloaded - Provider is temporarily overloaded - summary: Create a chat completion + summary: Upload a file tags: - - Chat - x-speakeasy-group: chat - x-speakeasy-name-override: send - x-speakeasy-stream-request-field: stream - /credits: - get: - description: >- - Get total credits purchased and used for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: getCredits + - Files + x-speakeasy-name-override: upload + /files/{file_id}: + delete: + description: Deletes a file owned by the requesting workspace. Deletion is irreversible. + operationId: deleteFile + parameters: + - in: path + name: file_id + required: true + schema: + example: file_011CNha8iCJcU1wXNR6q4V8w + type: string + - description: Workspace to scope the request to. Defaults to the caller’s default workspace. + in: query + name: workspace_id + required: false + schema: + description: Workspace to scope the request to. Defaults to the caller’s default workspace. + example: a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 + format: uuid + type: string responses: '200': content: application/json: example: - data: - total_credits: 100.5 - total_usage: 25.75 + id: file_011CNha8iCJcU1wXNR6q4V8w + type: file_deleted schema: - description: Total credits purchased and used - example: - data: - total_credits: 100.5 - total_usage: 25.75 - properties: - data: - example: - total_credits: 100.5 - total_usage: 25.75 - properties: - total_credits: - description: Total credits purchased - example: 100.5 - format: double - type: number - total_usage: - description: Total credits used - example: 25.75 - format: double - type: number - required: - - total_credits - - total_usage - type: object - required: - - data - type: object - description: Returns the total credits purchased and used + $ref: '#/components/schemas/FileDeleteResponse' + description: The file was deleted. '401': content: application/json: @@ -15570,16 +24916,26 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: Unauthorized - Authentication required or invalid credentials - '403': + '404': content: application/json: example: error: - code: 403 - message: Only management keys can perform this operation + code: 404 + message: Resource not found schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: Forbidden - Authentication successful but insufficient permissions + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '429': + content: + application/json: + example: + error: + code: 429 + message: Rate limit exceeded + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded '500': content: application/json: @@ -15590,267 +24946,117 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: Get remaining credits + summary: Delete a file tags: - - Credits - x-speakeasy-name-override: getCredits - /credits/coinbase: - post: - deprecated: true - description: >- - Deprecated. The Coinbase APIs used by this endpoint have been deprecated, so Coinbase Commerce charges have been removed. Use the web credits purchase flow instead. - operationId: createCoinbaseCharge + - Files + x-speakeasy-name-override: delete + get: + description: Retrieves metadata for a single file owned by the requesting workspace. + operationId: getFileMetadata + parameters: + - in: path + name: file_id + required: true + schema: + example: file_011CNha8iCJcU1wXNR6q4V8w + type: string + - description: Workspace to scope the request to. Defaults to the caller’s default workspace. + in: query + name: workspace_id + required: false + schema: + description: Workspace to scope the request to. Defaults to the caller’s default workspace. + example: a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 + format: uuid + type: string responses: '200': - description: This endpoint is deprecated and will never return a 200 response. - '410': content: application/json: example: - error: - code: 410 - message: >- - The Coinbase APIs used by this endpoint have been deprecated, so the Coinbase Commerce credits API has been removed. Use the web credits purchase flow instead. + created_at: '2025-01-01T00:00:00Z' + downloadable: false + filename: document.pdf + id: file_011CNha8iCJcU1wXNR6q4V8w + mime_type: application/pdf + size_bytes: 1024000 + type: file schema: - $ref: '#/components/schemas/GoneResponse' - description: Gone - Endpoint has been permanently removed or deprecated - security: [] - summary: Deprecated Coinbase Commerce charge endpoint - tags: - - Credits - x-fern-ignore: true - x-speakeasy-ignore: true - x-speakeasy-name-override: createCoinbaseCharge - /embeddings: - post: - description: Submits an embedding request to the embeddings router - operationId: createEmbeddings - requestBody: - content: - application/json: - schema: - description: Embeddings request input - example: - dimensions: 1536 - input: The quick brown fox jumps over the lazy dog - model: openai/text-embedding-3-small - properties: - dimensions: - description: The number of dimensions for the output embeddings - example: 1536 - minimum: 1 - type: integer - encoding_format: - description: The format of the output embeddings - enum: - - float - - base64 - example: float - type: string - x-speakeasy-unknown-values: allow - input: - anyOf: - - type: string - - items: - type: string - type: array - - items: - type: number - type: array - - items: - items: - type: number - type: array - type: array - - items: - properties: - content: - items: - oneOf: - - properties: - text: - type: string - type: - enum: - - text - type: string - required: - - type - - text - type: object - - properties: - image_url: - properties: - url: - type: string - required: - - url - type: object - type: - enum: - - image_url - type: string - required: - - type - - image_url - type: object - type: array - required: - - content - type: object - type: array - description: Text, token, or multimodal input(s) to embed - example: The quick brown fox jumps over the lazy dog - input_type: - description: The type of input (e.g. search_query, search_document) - example: search_query - type: string - model: - description: The model to use for embeddings - example: openai/text-embedding-3-small - type: string - provider: - allOf: - - $ref: '#/components/schemas/ProviderPreferences' - - description: Provider routing preferences for the request. - user: - description: A unique identifier for the end-user - example: user-1234 - type: string - required: - - input - - model - type: object - required: true - responses: - '200': + $ref: '#/components/schemas/FileMetadata' + description: The file metadata. + '401': content: application/json: + example: + error: + code: 401 + message: Missing Authentication header schema: - description: Embeddings response containing embedding vectors - example: - data: - - embedding: - - 0.0023064255 - - -0.009327292 - - 0.015797347 - index: 0 - object: embedding - model: openai/text-embedding-3-small - object: list - usage: - prompt_tokens: 8 - total_tokens: 8 - properties: - data: - description: List of embedding objects - example: - - embedding: - - 0.0023064255 - - -0.009327292 - - 0.015797347 - index: 0 - object: embedding - items: - description: A single embedding object - example: - embedding: - - 0.0023064255 - - -0.009327292 - - 0.015797347 - index: 0 - object: embedding - properties: - embedding: - anyOf: - - items: - type: number - type: array - - type: string - description: Embedding vector as an array of floats or a base64 string - example: - - 0.0023064255 - - -0.009327292 - - 0.015797347 - index: - description: Index of the embedding in the input list - example: 0 - type: integer - object: - enum: - - embedding - type: string - required: - - object - - embedding - type: object - type: array - id: - description: Unique identifier for the embeddings response - example: embd-1234567890 - type: string - model: - description: The model used for embeddings - example: openai/text-embedding-3-small - type: string - object: - enum: - - list - type: string - usage: - description: Token usage statistics - example: - prompt_tokens: 8 - total_tokens: 8 - properties: - cost: - description: Cost of the request in credits - example: 0.0001 - format: double - type: number - prompt_tokens: - description: Number of tokens in the input - example: 8 - type: integer - prompt_tokens_details: - description: >- - Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included. - properties: - audio_tokens: - description: Number of audio tokens in the input - type: integer - image_tokens: - description: Number of image tokens in the input - example: 258 - type: integer - text_tokens: - description: Number of text tokens in the input - example: 8 - type: integer - video_tokens: - description: Number of video tokens in the input - type: integer - type: object - total_tokens: - description: Total number of tokens used - example: 8 - type: integer - required: - - prompt_tokens - - total_tokens - type: object - required: - - object - - data - - model - type: object - text/event-stream: - example: 'data: [DONE]' + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found schema: - description: Not used for embeddings - embeddings do not support streaming + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '429': + content: + application/json: + example: + error: + code: 429 + message: Rate limit exceeded + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Get file metadata + tags: + - Files + x-speakeasy-name-override: retrieve + /files/{file_id}/content: + get: + description: Downloads the raw bytes of a file. Only files created server-side are downloadable; uploaded files return 400. + operationId: downloadFileContent + parameters: + - in: path + name: file_id + required: true + schema: + example: file_011CNha8iCJcU1wXNR6q4V8w + type: string + - description: Workspace to scope the request to. Defaults to the caller’s default workspace. + in: query + name: workspace_id + required: false + schema: + description: Workspace to scope the request to. Defaults to the caller’s default workspace. + example: a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 + format: uuid + type: string + responses: + '200': + content: + application/octet-stream: + example: binary file contents + schema: + format: binary type: string - x-speakeasy-sse-sentinel: '[DONE]' - description: Embedding response + description: The raw file content. '400': content: application/json: @@ -15859,8 +25065,224 @@ paths: code: 400 message: Invalid request parameters schema: - $ref: '#/components/schemas/BadRequestResponse' - description: Bad Request - Invalid request parameters or malformed input + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '429': + content: + application/json: + example: + error: + code: 429 + message: Rate limit exceeded + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Download file content + tags: + - Files + x-speakeasy-name-override: download + /generation: + get: + operationId: getGeneration + parameters: + - description: The generation ID + in: query + name: id + required: true + schema: + description: The generation ID + example: gen-1234567890 + minLength: 1 + type: string + responses: + '200': + content: + application/json: + example: + data: + api_type: completions + app_id: 12345 + cache_discount: null + cancelled: false + created_at: '2024-07-15T23:33:19.433273+00:00' + external_user: user-123 + finish_reason: stop + generation_time: 1200 + http_referer: https://openrouter.ai/ + id: gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG + is_byok: false + latency: 1250 + model: sao10k/l3-stheno-8b + moderation_latency: 50 + native_finish_reason: stop + native_tokens_cached: 3 + native_tokens_completion: 25 + native_tokens_completion_images: 0 + native_tokens_prompt: 10 + native_tokens_reasoning: 5 + num_input_audio_prompt: 0 + num_media_completion: 0 + num_media_prompt: 1 + num_search_results: 5 + origin: https://openrouter.ai/ + provider_name: Infermatic + provider_responses: null + request_id: req-1727282430-aBcDeFgHiJkLmNoPqRsT + router: openrouter/auto + session_id: null + streamed: true + tokens_completion: 25 + tokens_prompt: 10 + total_cost: 0.0015 + upstream_id: chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946 + upstream_inference_cost: 0.0012 + usage: 0.0015 + user_agent: Mozilla/5.0 + schema: + $ref: '#/components/schemas/GenerationResponse' + description: Returns the request metadata for this generation + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '402': + content: + application/json: + example: + error: + code: 402 + message: Insufficient credits. Add more using https://openrouter.ai/credits + schema: + $ref: '#/components/schemas/PaymentRequiredResponse' + description: Payment Required - Insufficient credits or quota to complete request + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '429': + content: + application/json: + example: + error: + code: 429 + message: Rate limit exceeded + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + '502': + content: + application/json: + example: + error: + code: 502 + message: Provider returned error + schema: + $ref: '#/components/schemas/BadGatewayResponse' + description: Bad Gateway - Provider/upstream API failure + '524': + content: + application/json: + example: + error: + code: 524 + message: Request timed out. Please try again later. + schema: + $ref: '#/components/schemas/EdgeNetworkTimeoutResponse' + description: Infrastructure Timeout - Provider request timed out at edge network + '529': + content: + application/json: + example: + error: + code: 529 + message: Provider returned error + schema: + $ref: '#/components/schemas/ProviderOverloadedResponse' + description: Provider Overloaded - Provider is temporarily overloaded + summary: Get request & usage metadata for a generation + tags: + - Generations + /generation/content: + get: + operationId: listGenerationContent + parameters: + - description: The generation ID + in: query + name: id + required: true + schema: + description: The generation ID + example: gen-1234567890 + minLength: 1 + type: string + responses: + '200': + content: + application/json: + example: + data: + input: + messages: + - content: What is the meaning of life? + role: user + output: + completion: The meaning of life is a philosophical question... + reasoning: null + schema: + $ref: '#/components/schemas/GenerationContentResponse' + description: Returns the stored prompt and completion content '401': content: application/json: @@ -15871,16 +25293,16 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: Unauthorized - Authentication required or invalid credentials - '402': + '403': content: application/json: example: error: - code: 402 - message: Insufficient credits. Add more using https://openrouter.ai/credits + code: 403 + message: Only management keys can perform this operation schema: - $ref: '#/components/schemas/PaymentRequiredResponse' - description: Payment Required - Insufficient credits or quota to complete request + $ref: '#/components/schemas/ForbiddenResponse' + description: Forbidden - Authentication successful but insufficient permissions '404': content: application/json: @@ -15921,16 +25343,6 @@ paths: schema: $ref: '#/components/schemas/BadGatewayResponse' description: Bad Gateway - Provider/upstream API failure - '503': - content: - application/json: - example: - error: - code: 503 - message: Service temporarily unavailable - schema: - $ref: '#/components/schemas/ServiceUnavailableResponse' - description: Service Unavailable - Service temporarily unavailable '524': content: application/json: @@ -15951,63 +25363,247 @@ paths: schema: $ref: '#/components/schemas/ProviderOverloadedResponse' description: Provider Overloaded - Provider is temporarily overloaded - summary: Submit an embedding request + summary: Get stored prompt and completion content for a generation tags: - - Embeddings - x-speakeasy-name-override: generate - /embeddings/models: + - Generations + /guardrails: get: - description: Returns a list of all available embeddings models and their properties - operationId: listEmbeddingsModels + description: >- + List all guardrails for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: listGuardrails + parameters: + - description: Number of records to skip for pagination + in: query + name: offset + required: false + schema: + description: Number of records to skip for pagination + example: 0 + minimum: 0 + nullable: true + type: integer + - description: Maximum number of records to return (max 100) + in: query + name: limit + required: false + schema: + description: Maximum number of records to return (max 100) + example: 50 + maximum: 100 + minimum: 1 + type: integer + - description: Filter guardrails by workspace ID. By default, guardrails in the default workspace are returned. + in: query + name: workspace_id + required: false + schema: + description: Filter guardrails by workspace ID. By default, guardrails in the default workspace are returned. + example: 0df9e665-d932-5740-b2c7-b52af166bc11 + format: uuid + type: string responses: '200': content: application/json: example: data: - - architecture: - input_modalities: - - text - instruct_type: null - modality: text->text - output_modalities: - - embeddings - tokenizer: GPT - canonical_slug: openai/text-embedding-3-small - context_length: 8192 - created: 1692901234 - default_parameters: null - description: OpenAI text embedding model optimized for performance. - expiration_date: null - id: openai/text-embedding-3-small - knowledge_cutoff: null - links: - details: /api/v1/models/openai/text-embedding-3-small/endpoints - name: Text Embedding 3 Small - per_request_limits: null - pricing: - completion: '0' - image: '0' - prompt: '0.00000002' - request: '0' - supported_parameters: [] - top_provider: - context_length: 8192 - is_moderated: false - max_completion_tokens: null + - allowed_models: null + allowed_providers: + - openai + - anthropic + - google + created_at: '2025-08-24T10:30:00Z' + description: Guardrail for production environment + enforce_zdr: false + id: 550e8400-e29b-41d4-a716-446655440000 + ignored_models: null + ignored_providers: null + limit_usd: 100 + name: Production Guardrail + reset_interval: monthly + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 + total_count: 1 + schema: + $ref: '#/components/schemas/ListGuardrailsResponse' + description: List of guardrails + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: List guardrails + tags: + - Guardrails + x-speakeasy-name-override: list + x-speakeasy-pagination: + inputs: + - in: parameters + name: offset + type: offset + - in: parameters + name: limit + type: limit + outputs: + results: $.data + type: offsetLimit + post: + description: >- + Create a new guardrail for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: createGuardrail + requestBody: + content: + application/json: + example: + allowed_models: null + allowed_providers: + - openai + - anthropic + - deepseek + description: A guardrail for limiting API usage + enforce_zdr_anthropic: true + enforce_zdr_google: false + enforce_zdr_openai: true + enforce_zdr_other: false + ignored_models: null + ignored_providers: null + limit_usd: 50 + name: My New Guardrail + reset_interval: monthly + schema: + $ref: '#/components/schemas/CreateGuardrailRequest' + required: true + responses: + '201': + content: + application/json: + example: + data: + allowed_models: null + allowed_providers: + - openai + - anthropic + - google + created_at: '2025-08-24T10:30:00Z' + description: A guardrail for limiting API usage + enforce_zdr: null + enforce_zdr_anthropic: true + enforce_zdr_google: false + enforce_zdr_openai: true + enforce_zdr_other: false + id: 550e8400-e29b-41d4-a716-446655440000 + ignored_models: null + ignored_providers: null + limit_usd: 50 + name: My New Guardrail + reset_interval: monthly + updated_at: null + workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 + schema: + $ref: '#/components/schemas/CreateGuardrailResponse' + description: Guardrail created successfully + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '403': + content: + application/json: + example: + error: + code: 403 + message: Only management keys can perform this operation + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: Forbidden - Authentication successful but insufficient permissions + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Create a guardrail + tags: + - Guardrails + x-speakeasy-name-override: create + /guardrails/{id}: + delete: + description: Delete an existing guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: deleteGuardrail + parameters: + - description: The unique identifier of the guardrail to delete + in: path + name: id + required: true + schema: + description: The unique identifier of the guardrail to delete + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + responses: + '200': + content: + application/json: + example: + deleted: true schema: - $ref: '#/components/schemas/ModelsListResponse' - description: Returns a list of embeddings models - '400': + $ref: '#/components/schemas/DeleteGuardrailResponse' + description: Guardrail deleted successfully + '401': content: application/json: example: error: - code: 400 - message: Invalid request parameters + code: 401 + message: Missing Authentication header schema: - $ref: '#/components/schemas/BadRequestResponse' - description: Bad Request - Invalid request parameters or malformed input + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist '500': content: application/json: @@ -16018,97 +25614,68 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: List all embeddings models + summary: Delete a guardrail tags: - - Embeddings - x-speakeasy-name-override: listModels - /endpoints/zdr: + - Guardrails + x-speakeasy-name-override: delete get: - operationId: listEndpointsZdr + description: Get a single guardrail by ID. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: getGuardrail + parameters: + - description: The unique identifier of the guardrail to retrieve + in: path + name: id + required: true + schema: + description: The unique identifier of the guardrail to retrieve + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string responses: '200': content: application/json: example: data: - - context_length: 8192 - latency_last_30m: - p50: 0.25 - p75: 0.35 - p90: 0.48 - p99: 0.85 - max_completion_tokens: 4096 - max_prompt_tokens: 8192 - model_id: openai/gpt-4 - model_name: GPT-4 - name: 'OpenAI: GPT-4' - pricing: - completion: '0.00006' - image: '0' - prompt: '0.00003' - request: '0' - provider_name: OpenAI - quantization: fp16 - status: default - supported_parameters: - - temperature - - top_p - - max_tokens - supports_implicit_caching: true - tag: openai - throughput_last_30m: - p50: 45.2 - p75: 38.5 - p90: 28.3 - p99: 15.1 - uptime_last_1d: 99.8 - uptime_last_30m: 99.5 - uptime_last_5m: 100 + allowed_models: null + allowed_providers: + - openai + - anthropic + - google + created_at: '2025-08-24T10:30:00Z' + description: Guardrail for production environment + enforce_zdr: false + id: 550e8400-e29b-41d4-a716-446655440000 + ignored_models: null + ignored_providers: null + limit_usd: 100 + name: Production Guardrail + reset_interval: monthly + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 schema: - example: - data: - - context_length: 8192 - latency_last_30m: - p50: 0.25 - p75: 0.35 - p90: 0.48 - p99: 0.85 - max_completion_tokens: 4096 - max_prompt_tokens: 8192 - model_id: openai/gpt-4 - model_name: GPT-4 - name: 'OpenAI: GPT-4' - pricing: - completion: '0.00006' - image: '0' - prompt: '0.00003' - request: '0' - provider_name: OpenAI - quantization: fp16 - status: default - supported_parameters: - - temperature - - top_p - - max_tokens - supports_implicit_caching: true - tag: openai - throughput_last_30m: - p50: 45.2 - p75: 38.5 - p90: 28.3 - p99: 15.1 - uptime_last_1d: 99.8 - uptime_last_30m: 99.5 - uptime_last_5m: 100 - properties: - data: - items: - $ref: '#/components/schemas/PublicEndpoint' - type: array - required: - - data - type: object - description: Returns a list of endpoints + $ref: '#/components/schemas/GetGuardrailResponse' + description: Guardrail details + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist '500': content: application/json: @@ -16119,70 +25686,71 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: Preview the impact of ZDR on the available endpoints + summary: Get a guardrail tags: - - Endpoints - x-speakeasy-name-override: listZdrEndpoints - /generation: - get: - operationId: getGeneration + - Guardrails + x-speakeasy-name-override: get + patch: + description: Update an existing guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: updateGuardrail parameters: - - description: The generation ID - in: query + - description: The unique identifier of the guardrail to update + in: path name: id required: true schema: - description: The generation ID - example: gen-1234567890 - minLength: 1 + description: The unique identifier of the guardrail to update + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid type: string + requestBody: + content: + application/json: + example: + description: Updated description + limit_usd: 75 + name: Updated Guardrail Name + reset_interval: weekly + schema: + $ref: '#/components/schemas/UpdateGuardrailRequest' + required: true responses: '200': content: application/json: example: data: - api_type: completions - app_id: 12345 - cache_discount: null - cancelled: false - created_at: '2024-07-15T23:33:19.433273+00:00' - external_user: user-123 - finish_reason: stop - generation_time: 1200 - http_referer: https://openrouter.ai/ - id: gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG - is_byok: false - latency: 1250 - model: sao10k/l3-stheno-8b - moderation_latency: 50 - native_finish_reason: stop - native_tokens_cached: 3 - native_tokens_completion: 25 - native_tokens_completion_images: 0 - native_tokens_prompt: 10 - native_tokens_reasoning: 5 - num_input_audio_prompt: 0 - num_media_completion: 0 - num_media_prompt: 1 - num_search_results: 5 - origin: https://openrouter.ai/ - provider_name: Infermatic - provider_responses: null - request_id: req-1727282430-aBcDeFgHiJkLmNoPqRsT - router: openrouter/auto - session_id: null - streamed: true - tokens_completion: 25 - tokens_prompt: 10 - total_cost: 0.0015 - upstream_id: chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946 - upstream_inference_cost: 0.0012 - usage: 0.0015 - user_agent: Mozilla/5.0 + allowed_models: null + allowed_providers: + - openai + created_at: '2025-08-24T10:30:00Z' + description: Updated description + enforce_zdr: null + enforce_zdr_anthropic: true + enforce_zdr_google: true + enforce_zdr_openai: true + enforce_zdr_other: true + id: 550e8400-e29b-41d4-a716-446655440000 + ignored_models: null + ignored_providers: null + limit_usd: 75 + name: Updated Guardrail Name + reset_interval: weekly + updated_at: '2025-08-24T16:00:00Z' + workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 + schema: + $ref: '#/components/schemas/UpdateGuardrailResponse' + description: Guardrail updated successfully + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters schema: - $ref: '#/components/schemas/GenerationResponse' - description: Returns the request metadata for this generation + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input '401': content: application/json: @@ -16193,16 +25761,6 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: Unauthorized - Authentication required or invalid credentials - '402': - content: - application/json: - example: - error: - code: 402 - message: Insufficient credits. Add more using https://openrouter.ai/credits - schema: - $ref: '#/components/schemas/PaymentRequiredResponse' - description: Payment Required - Insufficient credits or quota to complete request '404': content: application/json: @@ -16213,16 +25771,6 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: Not Found - Resource does not exist - '429': - content: - application/json: - example: - error: - code: 429 - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: Too Many Requests - Rate limit exceeded '500': content: application/json: @@ -16233,88 +25781,159 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - '502': + summary: Update a guardrail + tags: + - Guardrails + x-speakeasy-name-override: update + /guardrails/{id}/assignments/keys: + get: + description: >- + List all API key assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: listGuardrailKeyAssignments + parameters: + - description: The unique identifier of the guardrail + in: path + name: id + required: true + schema: + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + - description: Number of records to skip for pagination + in: query + name: offset + required: false + schema: + description: Number of records to skip for pagination + example: 0 + minimum: 0 + nullable: true + type: integer + - description: Maximum number of records to return (max 100) + in: query + name: limit + required: false + schema: + description: Maximum number of records to return (max 100) + example: 50 + maximum: 100 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + example: + data: + - assigned_by: user_abc123 + created_at: '2025-08-24T10:30:00Z' + guardrail_id: 550e8400-e29b-41d4-a716-446655440001 + id: 550e8400-e29b-41d4-a716-446655440000 + key_hash: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + key_label: prod-key + key_name: Production Key + total_count: 1 + schema: + $ref: '#/components/schemas/ListKeyAssignmentsResponse' + description: List of key assignments + '401': content: application/json: example: error: - code: 502 - message: Provider returned error + code: 401 + message: Missing Authentication header schema: - $ref: '#/components/schemas/BadGatewayResponse' - description: Bad Gateway - Provider/upstream API failure - '524': + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '404': content: application/json: example: error: - code: 524 - message: Request timed out. Please try again later. + code: 404 + message: Resource not found schema: - $ref: '#/components/schemas/EdgeNetworkTimeoutResponse' - description: Infrastructure Timeout - Provider request timed out at edge network - '529': + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '500': content: application/json: example: error: - code: 529 - message: Provider returned error + code: 500 + message: Internal Server Error schema: - $ref: '#/components/schemas/ProviderOverloadedResponse' - description: Provider Overloaded - Provider is temporarily overloaded - summary: Get request & usage metadata for a generation + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: List key assignments for a guardrail tags: - - Generations - /generation/content: - get: - operationId: listGenerationContent + - Guardrails + x-speakeasy-name-override: listGuardrailKeyAssignments + x-speakeasy-pagination: + inputs: + - in: parameters + name: offset + type: offset + - in: parameters + name: limit + type: limit + outputs: + results: $.data + type: offsetLimit + post: + description: >- + Assign multiple API keys to a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: bulkAssignKeysToGuardrail parameters: - - description: The generation ID - in: query + - description: The unique identifier of the guardrail + in: path name: id required: true schema: - description: The generation ID - example: gen-1234567890 - minLength: 1 + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid type: string + requestBody: + content: + application/json: + example: + key_hashes: + - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + schema: + $ref: '#/components/schemas/BulkAssignKeysRequest' + required: true responses: '200': content: application/json: example: - data: - input: - messages: - - content: What is the meaning of life? - role: user - output: - completion: The meaning of life is a philosophical question... - reasoning: null + assigned_count: 3 schema: - $ref: '#/components/schemas/GenerationContentResponse' - description: Returns the stored prompt and completion content - '401': + $ref: '#/components/schemas/BulkAssignKeysResponse' + description: Assignment result + '400': content: application/json: example: error: - code: 401 - message: Missing Authentication header + code: 400 + message: Invalid request parameters schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: Unauthorized - Authentication required or invalid credentials - '403': + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': content: application/json: example: error: - code: 403 - message: Only management keys can perform this operation + code: 401 + message: Missing Authentication header schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: Forbidden - Authentication successful but insufficient permissions + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials '404': content: application/json: @@ -16325,16 +25944,6 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: Not Found - Resource does not exist - '429': - content: - application/json: - example: - error: - code: 429 - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: Too Many Requests - Rate limit exceeded '500': content: application/json: @@ -16345,45 +25954,102 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - '502': + summary: Bulk assign keys to a guardrail + tags: + - Guardrails + x-speakeasy-name-override: bulkAssignKeys + /guardrails/{id}/assignments/keys/remove: + post: + description: >- + Unassign multiple API keys from a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: bulkUnassignKeysFromGuardrail + parameters: + - description: The unique identifier of the guardrail + in: path + name: id + required: true + schema: + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + requestBody: + content: + application/json: + example: + key_hashes: + - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + schema: + $ref: '#/components/schemas/BulkUnassignKeysRequest' + required: true + responses: + '200': + content: + application/json: + example: + unassigned_count: 3 + schema: + $ref: '#/components/schemas/BulkUnassignKeysResponse' + description: Unassignment result + '400': content: application/json: example: error: - code: 502 - message: Provider returned error + code: 400 + message: Invalid request parameters schema: - $ref: '#/components/schemas/BadGatewayResponse' - description: Bad Gateway - Provider/upstream API failure - '524': + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '404': content: application/json: example: error: - code: 524 - message: Request timed out. Please try again later. + code: 404 + message: Resource not found schema: - $ref: '#/components/schemas/EdgeNetworkTimeoutResponse' - description: Infrastructure Timeout - Provider request timed out at edge network - '529': + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '500': content: application/json: example: error: - code: 529 - message: Provider returned error + code: 500 + message: Internal Server Error schema: - $ref: '#/components/schemas/ProviderOverloadedResponse' - description: Provider Overloaded - Provider is temporarily overloaded - summary: Get stored prompt and completion content for a generation + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Bulk unassign keys from a guardrail tags: - - Generations - /guardrails: + - Guardrails + x-speakeasy-name-override: bulkUnassignKeys + /guardrails/{id}/assignments/members: get: description: >- - List all guardrails for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: listGuardrails + List all organization member assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: listGuardrailMemberAssignments parameters: + - description: The unique identifier of the guardrail + in: path + name: id + required: true + schema: + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string - description: Number of records to skip for pagination in: query name: offset @@ -16404,41 +26070,22 @@ paths: maximum: 100 minimum: 1 type: integer - - description: Filter guardrails by workspace ID. By default, guardrails in the default workspace are returned. - in: query - name: workspace_id - required: false - schema: - description: Filter guardrails by workspace ID. By default, guardrails in the default workspace are returned. - example: 0df9e665-d932-5740-b2c7-b52af166bc11 - format: uuid - type: string responses: '200': content: application/json: example: data: - - allowed_models: null - allowed_providers: - - openai - - anthropic - - google + - assigned_by: user_abc123 created_at: '2025-08-24T10:30:00Z' - description: Guardrail for production environment - enforce_zdr: false + guardrail_id: 550e8400-e29b-41d4-a716-446655440001 id: 550e8400-e29b-41d4-a716-446655440000 - ignored_models: null - ignored_providers: null - limit_usd: 100 - name: Production Guardrail - reset_interval: monthly - updated_at: '2025-08-24T15:45:00Z' - workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 + organization_id: org_xyz789 + user_id: user_abc123 total_count: 1 schema: - $ref: '#/components/schemas/ListGuardrailsResponse' - description: List of guardrails + $ref: '#/components/schemas/ListMemberAssignmentsResponse' + description: List of member assignments '401': content: application/json: @@ -16449,6 +26096,16 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: Unauthorized - Authentication required or invalid credentials + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist '500': content: application/json: @@ -16459,10 +26116,10 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: List guardrails + summary: List member assignments for a guardrail tags: - Guardrails - x-speakeasy-name-override: list + x-speakeasy-name-override: listGuardrailMemberAssignments x-speakeasy-pagination: inputs: - in: parameters @@ -16476,52 +26133,37 @@ paths: type: offsetLimit post: description: >- - Create a new guardrail for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: createGuardrail + Assign multiple organization members to a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: bulkAssignMembersToGuardrail + parameters: + - description: The unique identifier of the guardrail + in: path + name: id + required: true + schema: + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string requestBody: content: application/json: example: - allowed_models: null - allowed_providers: - - openai - - anthropic - - deepseek - description: A guardrail for limiting API usage - enforce_zdr: false - ignored_models: null - ignored_providers: null - limit_usd: 50 - name: My New Guardrail - reset_interval: monthly + member_user_ids: + - user_abc123 + - user_def456 schema: - $ref: '#/components/schemas/CreateGuardrailRequest' + $ref: '#/components/schemas/BulkAssignMembersRequest' required: true responses: - '201': + '200': content: application/json: example: - data: - allowed_models: null - allowed_providers: - - openai - - anthropic - - google - created_at: '2025-08-24T10:30:00Z' - description: A guardrail for limiting API usage - enforce_zdr: false - id: 550e8400-e29b-41d4-a716-446655440000 - ignored_models: null - ignored_providers: null - limit_usd: 50 - name: My New Guardrail - reset_interval: monthly - updated_at: null - workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 + assigned_count: 2 schema: - $ref: '#/components/schemas/CreateGuardrailResponse' - description: Guardrail created successfully + $ref: '#/components/schemas/BulkAssignMembersResponse' + description: Assignment result '400': content: application/json: @@ -16542,16 +26184,16 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: Unauthorized - Authentication required or invalid credentials - '403': + '404': content: application/json: example: error: - code: 403 - message: Only management keys can perform this operation + code: 404 + message: Resource not found schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: Forbidden - Authentication successful but insufficient permissions + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist '500': content: application/json: @@ -16562,33 +26204,131 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: Create a guardrail + summary: Bulk assign members to a guardrail tags: - Guardrails - x-speakeasy-name-override: create - /guardrails/{id}: - delete: - description: Delete an existing guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: deleteGuardrail + x-speakeasy-name-override: bulkAssignMembers + /guardrails/{id}/assignments/members/remove: + post: + description: >- + Unassign multiple organization members from a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: bulkUnassignMembersFromGuardrail parameters: - - description: The unique identifier of the guardrail to delete + - description: The unique identifier of the guardrail in: path name: id required: true schema: - description: The unique identifier of the guardrail to delete + description: The unique identifier of the guardrail example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string + requestBody: + content: + application/json: + example: + member_user_ids: + - user_abc123 + - user_def456 + schema: + $ref: '#/components/schemas/BulkUnassignMembersRequest' + required: true + responses: + '200': + content: + application/json: + example: + unassigned_count: 2 + schema: + $ref: '#/components/schemas/BulkUnassignMembersResponse' + description: Unassignment result + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Bulk unassign members from a guardrail + tags: + - Guardrails + x-speakeasy-name-override: bulkUnassignMembers + /guardrails/assignments/keys: + get: + description: >- + List all API key guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: listKeyAssignments + parameters: + - description: Number of records to skip for pagination + in: query + name: offset + required: false + schema: + description: Number of records to skip for pagination + example: 0 + minimum: 0 + nullable: true + type: integer + - description: Maximum number of records to return (max 100) + in: query + name: limit + required: false + schema: + description: Maximum number of records to return (max 100) + example: 50 + maximum: 100 + minimum: 1 + type: integer responses: '200': content: application/json: example: - deleted: true + data: + - assigned_by: user_abc123 + created_at: '2025-08-24T10:30:00Z' + guardrail_id: 550e8400-e29b-41d4-a716-446655440001 + id: 550e8400-e29b-41d4-a716-446655440000 + key_hash: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + key_label: prod-key + key_name: Production Key + total_count: 1 schema: - $ref: '#/components/schemas/DeleteGuardrailResponse' - description: Guardrail deleted successfully + $ref: '#/components/schemas/ListKeyAssignmentsResponse' + description: List of key assignments '401': content: application/json: @@ -16599,16 +26339,6 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: Unauthorized - Authentication required or invalid credentials - '404': - content: - application/json: - example: - error: - code: 404 - message: Resource not found - schema: - $ref: '#/components/schemas/NotFoundResponse' - description: Not Found - Resource does not exist '500': content: application/json: @@ -16619,48 +26349,63 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: Delete a guardrail + summary: List all key assignments tags: - Guardrails - x-speakeasy-name-override: delete + x-speakeasy-name-override: listKeyAssignments + x-speakeasy-pagination: + inputs: + - in: parameters + name: offset + type: offset + - in: parameters + name: limit + type: limit + outputs: + results: $.data + type: offsetLimit + /guardrails/assignments/members: get: - description: Get a single guardrail by ID. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: getGuardrail + description: >- + List all organization member guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: listMemberAssignments parameters: - - description: The unique identifier of the guardrail to retrieve - in: path - name: id - required: true + - description: Number of records to skip for pagination + in: query + name: offset + required: false schema: - description: The unique identifier of the guardrail to retrieve - example: 550e8400-e29b-41d4-a716-446655440000 - format: uuid - type: string + description: Number of records to skip for pagination + example: 0 + minimum: 0 + nullable: true + type: integer + - description: Maximum number of records to return (max 100) + in: query + name: limit + required: false + schema: + description: Maximum number of records to return (max 100) + example: 50 + maximum: 100 + minimum: 1 + type: integer responses: '200': content: application/json: example: data: - allowed_models: null - allowed_providers: - - openai - - anthropic - - google - created_at: '2025-08-24T10:30:00Z' - description: Guardrail for production environment - enforce_zdr: false - id: 550e8400-e29b-41d4-a716-446655440000 - ignored_models: null - ignored_providers: null - limit_usd: 100 - name: Production Guardrail - reset_interval: monthly - updated_at: '2025-08-24T15:45:00Z' - workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 + - assigned_by: user_abc123 + created_at: '2025-08-24T10:30:00Z' + guardrail_id: 550e8400-e29b-41d4-a716-446655440001 + id: 550e8400-e29b-41d4-a716-446655440000 + organization_id: org_xyz789 + user_id: user_abc123 + total_count: 1 schema: - $ref: '#/components/schemas/GetGuardrailResponse' - description: Guardrail details + $ref: '#/components/schemas/ListMemberAssignmentsResponse' + description: List of member assignments '401': content: application/json: @@ -16671,16 +26416,6 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: Unauthorized - Authentication required or invalid credentials - '404': - content: - application/json: - example: - error: - code: 404 - message: Resource not found - schema: - $ref: '#/components/schemas/NotFoundResponse' - description: Not Found - Resource does not exist '500': content: application/json: @@ -16691,67 +26426,244 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: Get a guardrail + summary: List all member assignments tags: - Guardrails - x-speakeasy-name-override: get - patch: - description: Update an existing guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: updateGuardrail - parameters: - - description: The unique identifier of the guardrail to update - in: path - name: id - required: true - schema: - description: The unique identifier of the guardrail to update - example: 550e8400-e29b-41d4-a716-446655440000 - format: uuid - type: string - requestBody: - content: - application/json: - example: - description: Updated description - limit_usd: 75 - name: Updated Guardrail Name - reset_interval: weekly - schema: - $ref: '#/components/schemas/UpdateGuardrailRequest' - required: true + x-speakeasy-name-override: listMemberAssignments + x-speakeasy-pagination: + inputs: + - in: parameters + name: offset + type: offset + - in: parameters + name: limit + type: limit + outputs: + results: $.data + type: offsetLimit + /key: + get: + description: Get information on the API key associated with the current authentication session + operationId: getCurrentKey responses: '200': content: application/json: example: data: - allowed_models: null - allowed_providers: - - openai - created_at: '2025-08-24T10:30:00Z' - description: Updated description - enforce_zdr: true - id: 550e8400-e29b-41d4-a716-446655440000 - ignored_models: null - ignored_providers: null - limit_usd: 75 - name: Updated Guardrail Name - reset_interval: weekly - updated_at: '2025-08-24T16:00:00Z' - workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 - schema: - $ref: '#/components/schemas/UpdateGuardrailResponse' - description: Guardrail updated successfully - '400': - content: - application/json: - example: - error: - code: 400 - message: Invalid request parameters + byok_usage: 17.38 + byok_usage_daily: 17.38 + byok_usage_monthly: 17.38 + byok_usage_weekly: 17.38 + creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 + expires_at: '2027-12-31T23:59:59Z' + include_byok_in_limit: false + is_free_tier: false + is_management_key: false + is_provisioning_key: false + label: sk-or-v1-au7...890 + limit: 100 + limit_remaining: 74.5 + limit_reset: monthly + rate_limit: + interval: 1h + note: This field is deprecated and safe to ignore. + requests: 1000 + usage: 25.5 + usage_daily: 25.5 + usage_monthly: 25.5 + usage_weekly: 25.5 schema: - $ref: '#/components/schemas/BadRequestResponse' - description: Bad Request - Invalid request parameters or malformed input + example: + data: + byok_usage: 17.38 + byok_usage_daily: 17.38 + byok_usage_monthly: 17.38 + byok_usage_weekly: 17.38 + creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 + expires_at: '2027-12-31T23:59:59Z' + include_byok_in_limit: false + is_free_tier: false + is_management_key: false + is_provisioning_key: false + label: sk-or-v1-au7...890 + limit: 100 + limit_remaining: 74.5 + limit_reset: monthly + rate_limit: + interval: 1h + note: This field is deprecated and safe to ignore. + requests: 1000 + usage: 25.5 + usage_daily: 25.5 + usage_monthly: 25.5 + usage_weekly: 25.5 + properties: + data: + description: Current API key information + example: + byok_usage: 17.38 + byok_usage_daily: 17.38 + byok_usage_monthly: 17.38 + byok_usage_weekly: 17.38 + creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 + expires_at: '2027-12-31T23:59:59Z' + include_byok_in_limit: false + is_free_tier: false + is_management_key: false + is_provisioning_key: false + label: sk-or-v1-au7...890 + limit: 100 + limit_remaining: 74.5 + limit_reset: monthly + rate_limit: + interval: 1h + note: This field is deprecated and safe to ignore. + requests: 1000 + usage: 25.5 + usage_daily: 25.5 + usage_monthly: 25.5 + usage_weekly: 25.5 + properties: + byok_usage: + description: Total external BYOK usage (in USD) for the API key + example: 17.38 + format: double + type: number + byok_usage_daily: + description: External BYOK usage (in USD) for the current UTC day + example: 17.38 + format: double + type: number + byok_usage_monthly: + description: External BYOK usage (in USD) for current UTC month + example: 17.38 + format: double + type: number + byok_usage_weekly: + description: External BYOK usage (in USD) for the current UTC week (Monday-Sunday) + example: 17.38 + format: double + type: number + creator_user_id: + description: >- + The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID. + example: user_2dHFtVWx2n56w6HkM0000000000 + nullable: true + type: string + expires_at: + description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration + example: '2027-12-31T23:59:59Z' + format: date-time + nullable: true + type: string + include_byok_in_limit: + description: Whether to include external BYOK usage in the credit limit + example: false + type: boolean + is_free_tier: + description: Whether this is a free tier API key + example: false + type: boolean + is_management_key: + description: Whether this is a management key + example: false + type: boolean + is_provisioning_key: + deprecated: true + description: Whether this is a management key + example: false + type: boolean + label: + description: Human-readable label for the API key + example: sk-or-v1-0e6...1c96 + type: string + limit: + description: Spending limit for the API key in USD + example: 100 + format: double + nullable: true + type: number + limit_remaining: + description: Remaining spending limit in USD + example: 74.5 + format: double + nullable: true + type: number + limit_reset: + description: Type of limit reset for the API key + example: monthly + nullable: true + type: string + rate_limit: + deprecated: true + description: Legacy rate limit information about a key. Will always return -1. + example: + interval: 1h + note: This field is deprecated and safe to ignore. + requests: 1000 + properties: + interval: + description: Rate limit interval + example: 1h + type: string + note: + description: Note about the rate limit + example: This field is deprecated and safe to ignore. + type: string + requests: + description: Number of requests allowed per interval + example: 1000 + type: integer + required: + - requests + - interval + - note + type: object + usage: + description: Total OpenRouter credit usage (in USD) for the API key + example: 25.5 + format: double + type: number + usage_daily: + description: OpenRouter credit usage (in USD) for the current UTC day + example: 25.5 + format: double + type: number + usage_monthly: + description: OpenRouter credit usage (in USD) for the current UTC month + example: 25.5 + format: double + type: number + usage_weekly: + description: OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday) + example: 25.5 + format: double + type: number + required: + - label + - limit + - usage + - usage_daily + - usage_weekly + - usage_monthly + - byok_usage + - byok_usage_daily + - byok_usage_weekly + - byok_usage_monthly + - is_free_tier + - is_management_key + - is_provisioning_key + - limit_remaining + - limit_reset + - include_byok_in_limit + - creator_user_id + - rate_limit + type: object + required: + - data + type: object + description: API key details '401': content: application/json: @@ -16762,16 +26674,6 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: Unauthorized - Authentication required or invalid credentials - '404': - content: - application/json: - example: - error: - code: 404 - message: Resource not found - schema: - $ref: '#/components/schemas/NotFoundResponse' - description: Not Found - Resource does not exist '500': content: application/json: @@ -16782,149 +26684,251 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: Update a guardrail + summary: Get current API key tags: - - Guardrails - x-speakeasy-name-override: update - /guardrails/{id}/assignments/keys: + - API Keys + x-speakeasy-name-override: getCurrentKeyMetadata + /keys: get: description: >- - List all API key assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: listGuardrailKeyAssignments + List all API keys for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: list parameters: - - description: The unique identifier of the guardrail - in: path - name: id - required: true - schema: - description: The unique identifier of the guardrail - example: 550e8400-e29b-41d4-a716-446655440000 - format: uuid - type: string - - description: Number of records to skip for pagination - in: query - name: offset - required: false - schema: - description: Number of records to skip for pagination - example: 0 - minimum: 0 - nullable: true - type: integer - - description: Maximum number of records to return (max 100) + - description: Whether to include disabled API keys in the response in: query - name: limit + name: include_disabled required: false schema: - description: Maximum number of records to return (max 100) - example: 50 - maximum: 100 - minimum: 1 - type: integer - responses: - '200': - content: - application/json: - example: - data: - - assigned_by: user_abc123 - created_at: '2025-08-24T10:30:00Z' - guardrail_id: 550e8400-e29b-41d4-a716-446655440001 - id: 550e8400-e29b-41d4-a716-446655440000 - key_hash: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 - key_label: prod-key - key_name: Production Key - total_count: 1 - schema: - $ref: '#/components/schemas/ListKeyAssignmentsResponse' - description: List of key assignments - '401': - content: - application/json: - example: - error: - code: 401 - message: Missing Authentication header - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: Unauthorized - Authentication required or invalid credentials - '404': - content: - application/json: - example: - error: - code: 404 - message: Resource not found - schema: - $ref: '#/components/schemas/NotFoundResponse' - description: Not Found - Resource does not exist - '500': - content: - application/json: - example: - error: - code: 500 - message: Internal Server Error - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: Internal Server Error - Unexpected server error - summary: List key assignments for a guardrail - tags: - - Guardrails - x-speakeasy-name-override: listGuardrailKeyAssignments - x-speakeasy-pagination: - inputs: - - in: parameters - name: offset - type: offset - - in: parameters - name: limit - type: limit - outputs: - results: $.data - type: offsetLimit - post: - description: >- - Assign multiple API keys to a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: bulkAssignKeysToGuardrail - parameters: - - description: The unique identifier of the guardrail - in: path - name: id - required: true + description: Whether to include disabled API keys in the response + example: 'false' + type: boolean + x-openrouter-type: boolean + - description: Number of API keys to skip for pagination + in: query + name: offset + required: false schema: - description: The unique identifier of the guardrail - example: 550e8400-e29b-41d4-a716-446655440000 + description: Number of API keys to skip for pagination + example: 0 + minimum: 0 + nullable: true + type: integer + - description: Filter API keys by workspace ID. By default, keys in the default workspace are returned. + in: query + name: workspace_id + required: false + schema: + description: Filter API keys by workspace ID. By default, keys in the default workspace are returned. + example: 0df9e665-d932-5740-b2c7-b52af166bc11 format: uuid type: string - requestBody: - content: - application/json: - example: - key_hashes: - - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 - schema: - $ref: '#/components/schemas/BulkAssignKeysRequest' - required: true responses: '200': content: application/json: example: - assigned_count: 3 - schema: - $ref: '#/components/schemas/BulkAssignKeysResponse' - description: Assignment result - '400': - content: - application/json: - example: - error: - code: 400 - message: Invalid request parameters + data: + - byok_usage: 17.38 + byok_usage_daily: 17.38 + byok_usage_monthly: 17.38 + byok_usage_weekly: 17.38 + created_at: '2025-08-24T10:30:00Z' + creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 + disabled: false + expires_at: '2027-12-31T23:59:59Z' + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 + include_byok_in_limit: false + label: Production API Key + limit: 100 + limit_remaining: 74.5 + limit_reset: monthly + name: My Production Key + updated_at: '2025-08-24T15:45:00Z' + usage: 25.5 + usage_daily: 25.5 + usage_monthly: 25.5 + usage_weekly: 25.5 + workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 schema: - $ref: '#/components/schemas/BadRequestResponse' - description: Bad Request - Invalid request parameters or malformed input + example: + data: + - byok_usage: 17.38 + byok_usage_daily: 17.38 + byok_usage_monthly: 17.38 + byok_usage_weekly: 17.38 + created_at: '2025-08-24T10:30:00Z' + creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 + disabled: false + expires_at: '2027-12-31T23:59:59Z' + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 + include_byok_in_limit: false + label: Production API Key + limit: 100 + limit_remaining: 74.5 + limit_reset: monthly + name: My Production Key + updated_at: '2025-08-24T15:45:00Z' + usage: 25.5 + usage_daily: 25.5 + usage_monthly: 25.5 + usage_weekly: 25.5 + workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 + properties: + data: + description: List of API keys + items: + example: + byok_usage: 17.38 + byok_usage_daily: 17.38 + byok_usage_monthly: 17.38 + byok_usage_weekly: 17.38 + created_at: '2025-08-24T10:30:00Z' + creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 + disabled: false + expires_at: '2027-12-31T23:59:59Z' + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 + include_byok_in_limit: false + label: sk-or-v1-0e6...1c96 + limit: 100 + limit_remaining: 74.5 + limit_reset: monthly + name: My Production Key + updated_at: '2025-08-24T15:45:00Z' + usage: 25.5 + usage_daily: 25.5 + usage_monthly: 25.5 + usage_weekly: 25.5 + workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 + properties: + byok_usage: + description: Total external BYOK usage (in USD) for the API key + example: 17.38 + format: double + type: number + byok_usage_daily: + description: External BYOK usage (in USD) for the current UTC day + example: 17.38 + format: double + type: number + byok_usage_monthly: + description: External BYOK usage (in USD) for current UTC month + example: 17.38 + format: double + type: number + byok_usage_weekly: + description: External BYOK usage (in USD) for the current UTC week (Monday-Sunday) + example: 17.38 + format: double + type: number + created_at: + description: ISO 8601 timestamp of when the API key was created + example: '2025-08-24T10:30:00Z' + type: string + creator_user_id: + description: >- + The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID. + example: user_2dHFtVWx2n56w6HkM0000000000 + nullable: true + type: string + disabled: + description: Whether the API key is disabled + example: false + type: boolean + expires_at: + description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration + example: '2027-12-31T23:59:59Z' + format: date-time + nullable: true + type: string + hash: + description: Unique hash identifier for the API key + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 + type: string + include_byok_in_limit: + description: Whether to include external BYOK usage in the credit limit + example: false + type: boolean + label: + description: Human-readable label for the API key + example: sk-or-v1-0e6...1c96 + type: string + limit: + description: Spending limit for the API key in USD + example: 100 + format: double + nullable: true + type: number + limit_remaining: + description: Remaining spending limit in USD + example: 74.5 + format: double + nullable: true + type: number + limit_reset: + description: Type of limit reset for the API key + example: monthly + nullable: true + type: string + name: + description: Name of the API key + example: My Production Key + type: string + updated_at: + description: ISO 8601 timestamp of when the API key was last updated + example: '2025-08-24T15:45:00Z' + nullable: true + type: string + usage: + description: Total OpenRouter credit usage (in USD) for the API key + example: 25.5 + format: double + type: number + usage_daily: + description: OpenRouter credit usage (in USD) for the current UTC day + example: 25.5 + format: double + type: number + usage_monthly: + description: OpenRouter credit usage (in USD) for the current UTC month + example: 25.5 + format: double + type: number + usage_weekly: + description: OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday) + example: 25.5 + format: double + type: number + workspace_id: + description: The workspace ID this API key belongs to. + example: 0df9e665-d932-5740-b2c7-b52af166bc11 + type: string + required: + - hash + - name + - label + - disabled + - limit + - limit_remaining + - limit_reset + - include_byok_in_limit + - usage + - usage_daily + - usage_weekly + - usage_monthly + - byok_usage + - byok_usage_daily + - byok_usage_weekly + - byok_usage_monthly + - created_at + - updated_at + - creator_user_id + - workspace_id + type: object + type: array + required: + - data + type: object + description: List of API keys '401': content: application/json: @@ -16935,16 +26939,16 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: Unauthorized - Authentication required or invalid credentials - '404': + '429': content: application/json: example: error: - code: 404 - message: Resource not found + code: 429 + message: Rate limit exceeded schema: - $ref: '#/components/schemas/NotFoundResponse' - description: Not Found - Resource does not exist + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded '500': content: application/json: @@ -16955,43 +26959,293 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: Bulk assign keys to a guardrail + summary: List API keys tags: - - Guardrails - x-speakeasy-name-override: bulkAssignKeys - /guardrails/{id}/assignments/keys/remove: + - API Keys + x-speakeasy-name-override: list post: description: >- - Unassign multiple API keys from a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: bulkUnassignKeysFromGuardrail - parameters: - - description: The unique identifier of the guardrail - in: path - name: id - required: true - schema: - description: The unique identifier of the guardrail - example: 550e8400-e29b-41d4-a716-446655440000 - format: uuid - type: string + Create a new API key for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: createKeys requestBody: content: application/json: example: - key_hashes: - - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + expires_at: '2027-12-31T23:59:59Z' + include_byok_in_limit: true + limit: 50 + limit_reset: monthly + name: My New API Key schema: - $ref: '#/components/schemas/BulkUnassignKeysRequest' + example: + expires_at: '2027-12-31T23:59:59Z' + include_byok_in_limit: true + limit: 50 + limit_reset: monthly + name: My New API Key + properties: + creator_user_id: + description: >- + Optional user ID of the key creator. Only meaningful for organization-owned keys where a specific member is creating the key. + example: user_2dHFtVWx2n56w6HkM0000000000 + minLength: 1 + nullable: true + type: string + expires_at: + description: >- + Optional ISO 8601 UTC timestamp when the API key should expire. Must be UTC, other timezones will be rejected + example: '2027-12-31T23:59:59Z' + format: date-time + nullable: true + type: string + include_byok_in_limit: + description: Whether to include BYOK usage in the limit + example: true + type: boolean + limit: + description: Optional spending limit for the API key in USD + example: 50 + format: double + nullable: true + type: number + limit_reset: + description: >- + Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. + enum: + - daily + - weekly + - monthly + - null + example: monthly + nullable: true + type: string + x-speakeasy-unknown-values: allow + name: + description: Name for the new API key + example: My New API Key + minLength: 1 + type: string + workspace_id: + description: The workspace to create the API key in. Defaults to the default workspace if not provided. + example: 0df9e665-d932-5740-b2c7-b52af166bc11 + format: uuid + type: string + required: + - name + type: object required: true responses: - '200': + '201': content: application/json: example: - unassigned_count: 3 + data: + byok_usage: 0 + byok_usage_daily: 0 + byok_usage_monthly: 0 + byok_usage_weekly: 0 + created_at: '2025-08-24T10:30:00Z' + creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 + disabled: false + expires_at: '2027-12-31T23:59:59Z' + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 + include_byok_in_limit: true + label: My New API Key + limit: 50 + limit_remaining: 50 + limit_reset: monthly + name: My New API Key + updated_at: null + usage: 0 + usage_daily: 0 + usage_monthly: 0 + usage_weekly: 0 + workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 + key: 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 schema: - $ref: '#/components/schemas/BulkUnassignKeysResponse' - description: Unassignment result + example: + data: + byok_usage: 0 + byok_usage_daily: 0 + byok_usage_monthly: 0 + byok_usage_weekly: 0 + created_at: '2025-08-24T10:30:00Z' + creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 + disabled: false + expires_at: '2027-12-31T23:59:59Z' + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 + include_byok_in_limit: true + label: My New API Key + limit: 50 + limit_remaining: 50 + limit_reset: monthly + name: My New API Key + updated_at: null + usage: 0 + usage_daily: 0 + usage_monthly: 0 + usage_weekly: 0 + workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 + key: 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 + properties: + data: + description: The created API key information + example: + byok_usage: 17.38 + byok_usage_daily: 17.38 + byok_usage_monthly: 17.38 + byok_usage_weekly: 17.38 + created_at: '2025-08-24T10:30:00Z' + creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 + disabled: false + expires_at: '2027-12-31T23:59:59Z' + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 + include_byok_in_limit: false + label: sk-or-v1-0e6...1c96 + limit: 100 + limit_remaining: 74.5 + limit_reset: monthly + name: My Production Key + updated_at: '2025-08-24T15:45:00Z' + usage: 25.5 + usage_daily: 25.5 + usage_monthly: 25.5 + usage_weekly: 25.5 + workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 + properties: + byok_usage: + description: Total external BYOK usage (in USD) for the API key + example: 17.38 + format: double + type: number + byok_usage_daily: + description: External BYOK usage (in USD) for the current UTC day + example: 17.38 + format: double + type: number + byok_usage_monthly: + description: External BYOK usage (in USD) for current UTC month + example: 17.38 + format: double + type: number + byok_usage_weekly: + description: External BYOK usage (in USD) for the current UTC week (Monday-Sunday) + example: 17.38 + format: double + type: number + created_at: + description: ISO 8601 timestamp of when the API key was created + example: '2025-08-24T10:30:00Z' + type: string + creator_user_id: + description: >- + The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID. + example: user_2dHFtVWx2n56w6HkM0000000000 + nullable: true + type: string + disabled: + description: Whether the API key is disabled + example: false + type: boolean + expires_at: + description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration + example: '2027-12-31T23:59:59Z' + format: date-time + nullable: true + type: string + hash: + description: Unique hash identifier for the API key + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 + type: string + include_byok_in_limit: + description: Whether to include external BYOK usage in the credit limit + example: false + type: boolean + label: + description: Human-readable label for the API key + example: sk-or-v1-0e6...1c96 + type: string + limit: + description: Spending limit for the API key in USD + example: 100 + format: double + nullable: true + type: number + limit_remaining: + description: Remaining spending limit in USD + example: 74.5 + format: double + nullable: true + type: number + limit_reset: + description: Type of limit reset for the API key + example: monthly + nullable: true + type: string + name: + description: Name of the API key + example: My Production Key + type: string + updated_at: + description: ISO 8601 timestamp of when the API key was last updated + example: '2025-08-24T15:45:00Z' + nullable: true + type: string + usage: + description: Total OpenRouter credit usage (in USD) for the API key + example: 25.5 + format: double + type: number + usage_daily: + description: OpenRouter credit usage (in USD) for the current UTC day + example: 25.5 + format: double + type: number + usage_monthly: + description: OpenRouter credit usage (in USD) for the current UTC month + example: 25.5 + format: double + type: number + usage_weekly: + description: OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday) + example: 25.5 + format: double + type: number + workspace_id: + description: The workspace ID this API key belongs to. + example: 0df9e665-d932-5740-b2c7-b52af166bc11 + type: string + required: + - hash + - name + - label + - disabled + - limit + - limit_remaining + - limit_reset + - include_byok_in_limit + - usage + - usage_daily + - usage_weekly + - usage_monthly + - byok_usage + - byok_usage_daily + - byok_usage_weekly + - byok_usage_monthly + - created_at + - updated_at + - creator_user_id + - workspace_id + type: object + key: + description: The actual API key string (only shown once) + example: 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 + type: string + required: + - data + - key + type: object + description: API key created successfully '400': content: application/json: @@ -17012,189 +27266,26 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: Unauthorized - Authentication required or invalid credentials - '404': - content: - application/json: - example: - error: - code: 404 - message: Resource not found - schema: - $ref: '#/components/schemas/NotFoundResponse' - description: Not Found - Resource does not exist - '500': - content: - application/json: - example: - error: - code: 500 - message: Internal Server Error - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: Internal Server Error - Unexpected server error - summary: Bulk unassign keys from a guardrail - tags: - - Guardrails - x-speakeasy-name-override: bulkUnassignKeys - /guardrails/{id}/assignments/members: - get: - description: >- - List all organization member assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: listGuardrailMemberAssignments - parameters: - - description: The unique identifier of the guardrail - in: path - name: id - required: true - schema: - description: The unique identifier of the guardrail - example: 550e8400-e29b-41d4-a716-446655440000 - format: uuid - type: string - - description: Number of records to skip for pagination - in: query - name: offset - required: false - schema: - description: Number of records to skip for pagination - example: 0 - minimum: 0 - nullable: true - type: integer - - description: Maximum number of records to return (max 100) - in: query - name: limit - required: false - schema: - description: Maximum number of records to return (max 100) - example: 50 - maximum: 100 - minimum: 1 - type: integer - responses: - '200': - content: - application/json: - example: - data: - - assigned_by: user_abc123 - created_at: '2025-08-24T10:30:00Z' - guardrail_id: 550e8400-e29b-41d4-a716-446655440001 - id: 550e8400-e29b-41d4-a716-446655440000 - organization_id: org_xyz789 - user_id: user_abc123 - total_count: 1 - schema: - $ref: '#/components/schemas/ListMemberAssignmentsResponse' - description: List of member assignments - '401': - content: - application/json: - example: - error: - code: 401 - message: Missing Authentication header - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: Unauthorized - Authentication required or invalid credentials - '404': - content: - application/json: - example: - error: - code: 404 - message: Resource not found - schema: - $ref: '#/components/schemas/NotFoundResponse' - description: Not Found - Resource does not exist - '500': - content: - application/json: - example: - error: - code: 500 - message: Internal Server Error - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: Internal Server Error - Unexpected server error - summary: List member assignments for a guardrail - tags: - - Guardrails - x-speakeasy-name-override: listGuardrailMemberAssignments - x-speakeasy-pagination: - inputs: - - in: parameters - name: offset - type: offset - - in: parameters - name: limit - type: limit - outputs: - results: $.data - type: offsetLimit - post: - description: >- - Assign multiple organization members to a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: bulkAssignMembersToGuardrail - parameters: - - description: The unique identifier of the guardrail - in: path - name: id - required: true - schema: - description: The unique identifier of the guardrail - example: 550e8400-e29b-41d4-a716-446655440000 - format: uuid - type: string - requestBody: - content: - application/json: - example: - member_user_ids: - - user_abc123 - - user_def456 - schema: - $ref: '#/components/schemas/BulkAssignMembersRequest' - required: true - responses: - '200': - content: - application/json: - example: - assigned_count: 2 - schema: - $ref: '#/components/schemas/BulkAssignMembersResponse' - description: Assignment result - '400': - content: - application/json: - example: - error: - code: 400 - message: Invalid request parameters - schema: - $ref: '#/components/schemas/BadRequestResponse' - description: Bad Request - Invalid request parameters or malformed input - '401': + '403': content: application/json: example: error: - code: 401 - message: Missing Authentication header + code: 403 + message: Only management keys can perform this operation schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: Unauthorized - Authentication required or invalid credentials - '404': + $ref: '#/components/schemas/ForbiddenResponse' + description: Forbidden - Authentication successful but insufficient permissions + '429': content: application/json: example: error: - code: 404 - message: Resource not found + code: 429 + message: Rate limit exceeded schema: - $ref: '#/components/schemas/NotFoundResponse' - description: Not Found - Resource does not exist + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded '500': content: application/json: @@ -17205,54 +27296,42 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: Bulk assign members to a guardrail + summary: Create a new API key tags: - - Guardrails - x-speakeasy-name-override: bulkAssignMembers - /guardrails/{id}/assignments/members/remove: - post: - description: >- - Unassign multiple organization members from a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: bulkUnassignMembersFromGuardrail + - API Keys + x-speakeasy-name-override: create + /keys/{hash}: + delete: + description: Delete an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: deleteKeys parameters: - - description: The unique identifier of the guardrail + - description: The hash identifier of the API key to delete in: path - name: id + name: hash required: true schema: - description: The unique identifier of the guardrail - example: 550e8400-e29b-41d4-a716-446655440000 - format: uuid - type: string - requestBody: - content: - application/json: - example: - member_user_ids: - - user_abc123 - - user_def456 - schema: - $ref: '#/components/schemas/BulkUnassignMembersRequest' - required: true + description: The hash identifier of the API key to delete + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 + type: string responses: '200': content: application/json: example: - unassigned_count: 2 - schema: - $ref: '#/components/schemas/BulkUnassignMembersResponse' - description: Unassignment result - '400': - content: - application/json: - example: - error: - code: 400 - message: Invalid request parameters + deleted: true schema: - $ref: '#/components/schemas/BadRequestResponse' - description: Bad Request - Invalid request parameters or malformed input + example: + deleted: true + properties: + deleted: + const: true + description: Confirmation that the API key was deleted + example: true + type: boolean + required: + - deleted + type: object + description: API key deleted successfully '401': content: application/json: @@ -17273,6 +27352,16 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: Not Found - Resource does not exist + '429': + content: + application/json: + example: + error: + code: 429 + message: Rate limit exceeded + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded '500': content: application/json: @@ -17283,53 +27372,227 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: Bulk unassign members from a guardrail + summary: Delete an API key tags: - - Guardrails - x-speakeasy-name-override: bulkUnassignMembers - /guardrails/assignments/keys: + - API Keys + x-speakeasy-name-override: delete get: - description: >- - List all API key guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: listKeyAssignments + description: Get a single API key by hash. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: getKey parameters: - - description: Number of records to skip for pagination - in: query - name: offset - required: false - schema: - description: Number of records to skip for pagination - example: 0 - minimum: 0 - nullable: true - type: integer - - description: Maximum number of records to return (max 100) - in: query - name: limit - required: false + - description: The hash identifier of the API key to retrieve + in: path + name: hash + required: true schema: - description: Maximum number of records to return (max 100) - example: 50 - maximum: 100 - minimum: 1 - type: integer + description: The hash identifier of the API key to retrieve + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 + type: string responses: '200': content: application/json: example: data: - - assigned_by: user_abc123 - created_at: '2025-08-24T10:30:00Z' - guardrail_id: 550e8400-e29b-41d4-a716-446655440001 - id: 550e8400-e29b-41d4-a716-446655440000 - key_hash: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 - key_label: prod-key - key_name: Production Key - total_count: 1 + byok_usage: 17.38 + byok_usage_daily: 17.38 + byok_usage_monthly: 17.38 + byok_usage_weekly: 17.38 + created_at: '2025-08-24T10:30:00Z' + creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 + disabled: false + expires_at: '2027-12-31T23:59:59Z' + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 + include_byok_in_limit: false + label: Production API Key + limit: 100 + limit_remaining: 74.5 + limit_reset: monthly + name: My Production Key + updated_at: '2025-08-24T15:45:00Z' + usage: 25.5 + usage_daily: 25.5 + usage_monthly: 25.5 + usage_weekly: 25.5 + workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 schema: - $ref: '#/components/schemas/ListKeyAssignmentsResponse' - description: List of key assignments + example: + data: + byok_usage: 17.38 + byok_usage_daily: 17.38 + byok_usage_monthly: 17.38 + byok_usage_weekly: 17.38 + created_at: '2025-08-24T10:30:00Z' + creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 + disabled: false + expires_at: '2027-12-31T23:59:59Z' + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 + include_byok_in_limit: false + label: Production API Key + limit: 100 + limit_remaining: 74.5 + limit_reset: monthly + name: My Production Key + updated_at: '2025-08-24T15:45:00Z' + usage: 25.5 + usage_daily: 25.5 + usage_monthly: 25.5 + usage_weekly: 25.5 + workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 + properties: + data: + description: The API key information + example: + byok_usage: 17.38 + byok_usage_daily: 17.38 + byok_usage_monthly: 17.38 + byok_usage_weekly: 17.38 + created_at: '2025-08-24T10:30:00Z' + creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 + disabled: false + expires_at: '2027-12-31T23:59:59Z' + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 + include_byok_in_limit: false + label: sk-or-v1-0e6...1c96 + limit: 100 + limit_remaining: 74.5 + limit_reset: monthly + name: My Production Key + updated_at: '2025-08-24T15:45:00Z' + usage: 25.5 + usage_daily: 25.5 + usage_monthly: 25.5 + usage_weekly: 25.5 + workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 + properties: + byok_usage: + description: Total external BYOK usage (in USD) for the API key + example: 17.38 + format: double + type: number + byok_usage_daily: + description: External BYOK usage (in USD) for the current UTC day + example: 17.38 + format: double + type: number + byok_usage_monthly: + description: External BYOK usage (in USD) for current UTC month + example: 17.38 + format: double + type: number + byok_usage_weekly: + description: External BYOK usage (in USD) for the current UTC week (Monday-Sunday) + example: 17.38 + format: double + type: number + created_at: + description: ISO 8601 timestamp of when the API key was created + example: '2025-08-24T10:30:00Z' + type: string + creator_user_id: + description: >- + The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID. + example: user_2dHFtVWx2n56w6HkM0000000000 + nullable: true + type: string + disabled: + description: Whether the API key is disabled + example: false + type: boolean + expires_at: + description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration + example: '2027-12-31T23:59:59Z' + format: date-time + nullable: true + type: string + hash: + description: Unique hash identifier for the API key + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 + type: string + include_byok_in_limit: + description: Whether to include external BYOK usage in the credit limit + example: false + type: boolean + label: + description: Human-readable label for the API key + example: sk-or-v1-0e6...1c96 + type: string + limit: + description: Spending limit for the API key in USD + example: 100 + format: double + nullable: true + type: number + limit_remaining: + description: Remaining spending limit in USD + example: 74.5 + format: double + nullable: true + type: number + limit_reset: + description: Type of limit reset for the API key + example: monthly + nullable: true + type: string + name: + description: Name of the API key + example: My Production Key + type: string + updated_at: + description: ISO 8601 timestamp of when the API key was last updated + example: '2025-08-24T15:45:00Z' + nullable: true + type: string + usage: + description: Total OpenRouter credit usage (in USD) for the API key + example: 25.5 + format: double + type: number + usage_daily: + description: OpenRouter credit usage (in USD) for the current UTC day + example: 25.5 + format: double + type: number + usage_monthly: + description: OpenRouter credit usage (in USD) for the current UTC month + example: 25.5 + format: double + type: number + usage_weekly: + description: OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday) + example: 25.5 + format: double + type: number + workspace_id: + description: The workspace ID this API key belongs to. + example: 0df9e665-d932-5740-b2c7-b52af166bc11 + type: string + required: + - hash + - name + - label + - disabled + - limit + - limit_remaining + - limit_reset + - include_byok_in_limit + - usage + - usage_daily + - usage_weekly + - usage_monthly + - byok_usage + - byok_usage_daily + - byok_usage_weekly + - byok_usage_monthly + - created_at + - updated_at + - creator_user_id + - workspace_id + type: object + required: + - data + type: object + description: API key details '401': content: application/json: @@ -17340,83 +27603,26 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: Unauthorized - Authentication required or invalid credentials - '500': + '404': content: application/json: example: error: - code: 500 - message: Internal Server Error - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: Internal Server Error - Unexpected server error - summary: List all key assignments - tags: - - Guardrails - x-speakeasy-name-override: listKeyAssignments - x-speakeasy-pagination: - inputs: - - in: parameters - name: offset - type: offset - - in: parameters - name: limit - type: limit - outputs: - results: $.data - type: offsetLimit - /guardrails/assignments/members: - get: - description: >- - List all organization member guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: listMemberAssignments - parameters: - - description: Number of records to skip for pagination - in: query - name: offset - required: false - schema: - description: Number of records to skip for pagination - example: 0 - minimum: 0 - nullable: true - type: integer - - description: Maximum number of records to return (max 100) - in: query - name: limit - required: false - schema: - description: Maximum number of records to return (max 100) - example: 50 - maximum: 100 - minimum: 1 - type: integer - responses: - '200': - content: - application/json: - example: - data: - - assigned_by: user_abc123 - created_at: '2025-08-24T10:30:00Z' - guardrail_id: 550e8400-e29b-41d4-a716-446655440001 - id: 550e8400-e29b-41d4-a716-446655440000 - organization_id: org_xyz789 - user_id: user_abc123 - total_count: 1 + code: 404 + message: Resource not found schema: - $ref: '#/components/schemas/ListMemberAssignmentsResponse' - description: List of member assignments - '401': + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '429': content: application/json: example: error: - code: 401 - message: Missing Authentication header + code: 429 + message: Rate limit exceeded schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: Unauthorized - Authentication required or invalid credentials + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded '500': content: application/json: @@ -17427,25 +27633,71 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: List all member assignments + summary: Get a single API key tags: - - Guardrails - x-speakeasy-name-override: listMemberAssignments - x-speakeasy-pagination: - inputs: - - in: parameters - name: offset - type: offset - - in: parameters - name: limit - type: limit - outputs: - results: $.data - type: offsetLimit - /key: - get: - description: Get information on the API key associated with the current authentication session - operationId: getCurrentKey + - API Keys + x-speakeasy-name-override: get + patch: + description: Update an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: updateKeys + parameters: + - description: The hash identifier of the API key to update + in: path + name: hash + required: true + schema: + description: The hash identifier of the API key to update + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 + type: string + requestBody: + content: + application/json: + example: + disabled: false + include_byok_in_limit: true + limit: 75 + limit_reset: daily + name: Updated API Key Name + schema: + example: + disabled: false + include_byok_in_limit: true + limit: 75 + limit_reset: daily + name: Updated API Key Name + properties: + disabled: + description: Whether to disable the API key + example: false + type: boolean + include_byok_in_limit: + description: Whether to include BYOK usage in the limit + example: true + type: boolean + limit: + description: New spending limit for the API key in USD + example: 75 + format: double + nullable: true + type: number + limit_reset: + description: >- + New limit reset type for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. + enum: + - daily + - weekly + - monthly + - null + example: daily + nullable: true + type: string + x-speakeasy-unknown-values: allow + name: + description: New name for the API key + example: Updated API Key Name + type: string + type: object + required: true responses: '200': content: @@ -17456,24 +27708,23 @@ paths: byok_usage_daily: 17.38 byok_usage_monthly: 17.38 byok_usage_weekly: 17.38 + created_at: '2025-08-24T10:30:00Z' creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 - expires_at: '2027-12-31T23:59:59Z' - include_byok_in_limit: false - is_free_tier: false - is_management_key: false - is_provisioning_key: false - label: sk-or-v1-au7...890 - limit: 100 - limit_remaining: 74.5 - limit_reset: monthly - rate_limit: - interval: 1h - note: This field is deprecated and safe to ignore. - requests: 1000 + disabled: false + expires_at: null + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 + include_byok_in_limit: true + label: Updated API Key Name + limit: 75 + limit_remaining: 49.5 + limit_reset: daily + name: Updated API Key Name + updated_at: '2025-08-24T16:00:00Z' usage: 25.5 usage_daily: 25.5 usage_monthly: 25.5 usage_weekly: 25.5 + workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 schema: example: data: @@ -17481,50 +27732,48 @@ paths: byok_usage_daily: 17.38 byok_usage_monthly: 17.38 byok_usage_weekly: 17.38 + created_at: '2025-08-24T10:30:00Z' creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 - expires_at: '2027-12-31T23:59:59Z' - include_byok_in_limit: false - is_free_tier: false - is_management_key: false - is_provisioning_key: false - label: sk-or-v1-au7...890 - limit: 100 - limit_remaining: 74.5 - limit_reset: monthly - rate_limit: - interval: 1h - note: This field is deprecated and safe to ignore. - requests: 1000 + disabled: false + expires_at: null + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 + include_byok_in_limit: true + label: Updated API Key Name + limit: 75 + limit_remaining: 49.5 + limit_reset: daily + name: Updated API Key Name + updated_at: '2025-08-24T16:00:00Z' usage: 25.5 usage_daily: 25.5 usage_monthly: 25.5 usage_weekly: 25.5 + workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 properties: data: - description: Current API key information + description: The updated API key information example: byok_usage: 17.38 byok_usage_daily: 17.38 byok_usage_monthly: 17.38 byok_usage_weekly: 17.38 + created_at: '2025-08-24T10:30:00Z' creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 + disabled: false expires_at: '2027-12-31T23:59:59Z' + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 include_byok_in_limit: false - is_free_tier: false - is_management_key: false - is_provisioning_key: false - label: sk-or-v1-au7...890 + label: sk-or-v1-0e6...1c96 limit: 100 limit_remaining: 74.5 limit_reset: monthly - rate_limit: - interval: 1h - note: This field is deprecated and safe to ignore. - requests: 1000 + name: My Production Key + updated_at: '2025-08-24T15:45:00Z' usage: 25.5 usage_daily: 25.5 usage_monthly: 25.5 usage_weekly: 25.5 + workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 properties: byok_usage: description: Total external BYOK usage (in USD) for the API key @@ -17546,35 +27795,34 @@ paths: example: 17.38 format: double type: number + created_at: + description: ISO 8601 timestamp of when the API key was created + example: '2025-08-24T10:30:00Z' + type: string creator_user_id: description: >- The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID. example: user_2dHFtVWx2n56w6HkM0000000000 nullable: true type: string + disabled: + description: Whether the API key is disabled + example: false + type: boolean expires_at: description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration example: '2027-12-31T23:59:59Z' format: date-time nullable: true type: string + hash: + description: Unique hash identifier for the API key + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 + type: string include_byok_in_limit: description: Whether to include external BYOK usage in the credit limit example: false type: boolean - is_free_tier: - description: Whether this is a free tier API key - example: false - type: boolean - is_management_key: - description: Whether this is a management key - example: false - type: boolean - is_provisioning_key: - deprecated: true - description: Whether this is a management key - example: false - type: boolean label: description: Human-readable label for the API key example: sk-or-v1-0e6...1c96 @@ -17596,31 +27844,15 @@ paths: example: monthly nullable: true type: string - rate_limit: - deprecated: true - description: Legacy rate limit information about a key. Will always return -1. - example: - interval: 1h - note: This field is deprecated and safe to ignore. - requests: 1000 - properties: - interval: - description: Rate limit interval - example: 1h - type: string - note: - description: Note about the rate limit - example: This field is deprecated and safe to ignore. - type: string - requests: - description: Number of requests allowed per interval - example: 1000 - type: integer - required: - - requests - - interval - - note - type: object + name: + description: Name of the API key + example: My Production Key + type: string + updated_at: + description: ISO 8601 timestamp of when the API key was last updated + example: '2025-08-24T15:45:00Z' + nullable: true + type: string usage: description: Total OpenRouter credit usage (in USD) for the API key example: 25.5 @@ -17641,9 +27873,19 @@ paths: example: 25.5 format: double type: number + workspace_id: + description: The workspace ID this API key belongs to. + example: 0df9e665-d932-5740-b2c7-b52af166bc11 + type: string required: + - hash + - name - label + - disabled - limit + - limit_remaining + - limit_reset + - include_byok_in_limit - usage - usage_daily - usage_weekly @@ -17652,19 +27894,25 @@ paths: - byok_usage_daily - byok_usage_weekly - byok_usage_monthly - - is_free_tier - - is_management_key - - is_provisioning_key - - limit_remaining - - limit_reset - - include_byok_in_limit + - created_at + - updated_at - creator_user_id - - rate_limit + - workspace_id type: object required: - data type: object - description: API key details + description: API key updated successfully + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input '401': content: application/json: @@ -17675,6 +27923,26 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: Unauthorized - Authentication required or invalid credentials + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '429': + content: + application/json: + example: + error: + code: 429 + message: Rate limit exceeded + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: Too Many Requests - Rate limit exceeded '500': content: application/json: @@ -17685,43 +27953,220 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: Get current API key + summary: Update an API key tags: - API Keys - x-speakeasy-name-override: getCurrentKeyMetadata - /keys: - get: + x-speakeasy-name-override: update + /messages: + post: description: >- - List all API keys for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: list + Creates a message using the Anthropic Messages API format. Supports text, images, PDFs, tools, and extended thinking. + operationId: createMessages + parameters: + - description: >- + Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. + example: enabled + in: header + name: X-OpenRouter-Metadata + required: false + schema: + $ref: '#/components/schemas/MetadataLevel' + requestBody: + content: + application/json: + example: + max_tokens: 1024 + messages: + - content: Hello, how are you? + role: user + model: anthropic/claude-sonnet-4 + schema: + $ref: '#/components/schemas/MessagesRequest' + required: true + responses: + '200': + content: + application/json: + example: + content: + - text: I'm doing well, thank you for asking! How can I help you today? + type: text + id: msg_abc123 + model: anthropic/claude-sonnet-4 + role: assistant + stop_reason: end_turn + type: message + usage: + input_tokens: 12 + output_tokens: 18 + schema: + $ref: '#/components/schemas/MessagesResult' + text/event-stream: + example: + data: + delta: + text: Hello + type: text_delta + index: 0 + type: content_block_delta + event: content_block_delta + schema: + $ref: '#/components/schemas/MessagesStreamingResponse' + x-speakeasy-sse-sentinel: '[DONE]' + description: Successful response + '400': + content: + application/json: + example: + error: + message: 'Invalid request: messages is required' + type: invalid_request_error + type: error + schema: + $ref: '#/components/schemas/MessagesErrorResponse' + description: Invalid request error + '401': + content: + application/json: + example: + error: + message: Invalid API key + type: authentication_error + type: error + schema: + $ref: '#/components/schemas/MessagesErrorResponse' + description: Authentication error + '403': + content: + application/json: + examples: + guardrail-blocked: + summary: Guardrail blocked the request + value: + error: + code: 403 + message: 'Request blocked: prompt injection patterns detected' + metadata: + patterns: + - ignore all previous instructions + openrouter_metadata: + attempt: 1 + endpoints: + available: + - model: openai/gpt-4o + provider: OpenAI + selected: false + total: 1 + is_byok: false + pipeline: + - data: + action: blocked + detected: true + engines: + - regex + patterns: + - ignore all previous instructions + guardrail_id: grd_abc123 + guardrail_scope: api-key + name: regex_pi_detection + summary: 'Blocked: prompt injection detected (1 pattern matched)' + type: guardrail + region: iad + requested: openai/gpt-4o + strategy: direct + summary: available=1 + insufficient-permissions: + summary: Insufficient permissions + value: + error: + code: 403 + message: Only management keys can perform this operation + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: >- + Forbidden - Authentication successful but insufficient permissions, or a guardrail blocked the request. When guardrails block and the `X-OpenRouter-Metadata: enabled` header is present, the response includes `openrouter_metadata` with full routing context and a `pipeline` array containing guardrail stage details. + '404': + content: + application/json: + example: + error: + message: Model not found + type: not_found_error + type: error + schema: + $ref: '#/components/schemas/MessagesErrorResponse' + description: Not found error + '429': + content: + application/json: + example: + error: + message: Rate limit exceeded + type: rate_limit_error + type: error + schema: + $ref: '#/components/schemas/MessagesErrorResponse' + description: Rate limit error + '500': + content: + application/json: + example: + error: + message: Internal server error + type: api_error + type: error + schema: + $ref: '#/components/schemas/MessagesErrorResponse' + description: API error + '503': + content: + application/json: + example: + error: + message: Service temporarily overloaded + type: overloaded_error + type: error + schema: + $ref: '#/components/schemas/MessagesErrorResponse' + description: Overloaded error + '529': + content: + application/json: + example: + error: + message: Provider is temporarily overloaded + type: overloaded_error + type: error + schema: + $ref: '#/components/schemas/MessagesErrorResponse' + description: Overloaded error + summary: Create a message + tags: + - Anthropic Messages + x-speakeasy-ignore: true + x-speakeasy-name-override: create + x-speakeasy-stream-request-field: stream + /model/{author}/{slug}: + get: + description: >- + Returns full details for a single model identified by its author and slug (e.g. openai/gpt-4). Supports variant suffixes (e.g. openai/gpt-4:free) and resolves known slug aliases. + operationId: getModel parameters: - - description: Whether to include disabled API keys in the response - in: query - name: include_disabled - required: false - schema: - description: Whether to include disabled API keys in the response - example: 'false' - type: boolean - x-openrouter-type: boolean - - description: Number of API keys to skip for pagination - in: query - name: offset - required: false + - description: The author/organization of the model + in: path + name: author + required: true schema: - description: Number of API keys to skip for pagination - example: 0 - minimum: 0 - nullable: true - type: integer - - description: Filter API keys by workspace ID. By default, keys in the default workspace are returned. - in: query - name: workspace_id - required: false + description: The author/organization of the model + example: openai + type: string + - description: The model slug, optionally including a variant suffix (e.g. gpt-4 or gpt-4:free) + in: path + name: slug + required: true schema: - description: Filter API keys by workspace ID. By default, keys in the default workspace are returned. - example: 0df9e665-d932-5740-b2c7-b52af166bc11 - format: uuid + description: The model slug, optionally including a variant suffix (e.g. gpt-4 or gpt-4:free) + example: gpt-4 type: string responses: '200': @@ -17729,227 +28174,279 @@ paths: application/json: example: data: - - byok_usage: 17.38 - byok_usage_daily: 17.38 - byok_usage_monthly: 17.38 - byok_usage_weekly: 17.38 - created_at: '2025-08-24T10:30:00Z' - creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 - disabled: false - expires_at: '2027-12-31T23:59:59Z' - hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 - include_byok_in_limit: false - label: Production API Key - limit: 100 - limit_remaining: 74.5 - limit_reset: monthly - name: My Production Key - updated_at: '2025-08-24T15:45:00Z' - usage: 25.5 - usage_daily: 25.5 - usage_monthly: 25.5 - usage_weekly: 25.5 - workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 + architecture: + input_modalities: + - text + instruct_type: chatml + modality: text->text + output_modalities: + - text + tokenizer: GPT + context_length: 8192 + created: 1692901234 + description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. + id: openai/gpt-4 + name: GPT-4 + per_request_limits: null + pricing: + completion: '0.00006' + image: '0' + prompt: '0.00003' + request: '0' + supported_parameters: + - temperature + - top_p + - max_tokens + top_provider: + context_length: 8192 + is_moderated: true + max_completion_tokens: 4096 schema: - example: - data: - - byok_usage: 17.38 - byok_usage_daily: 17.38 - byok_usage_monthly: 17.38 - byok_usage_weekly: 17.38 - created_at: '2025-08-24T10:30:00Z' - creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 - disabled: false - expires_at: '2027-12-31T23:59:59Z' - hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 - include_byok_in_limit: false - label: Production API Key - limit: 100 - limit_remaining: 74.5 - limit_reset: monthly - name: My Production Key - updated_at: '2025-08-24T15:45:00Z' - usage: 25.5 - usage_daily: 25.5 - usage_monthly: 25.5 - usage_weekly: 25.5 - workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 - properties: - data: - description: List of API keys - items: - example: - byok_usage: 17.38 - byok_usage_daily: 17.38 - byok_usage_monthly: 17.38 - byok_usage_weekly: 17.38 - created_at: '2025-08-24T10:30:00Z' - creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 - disabled: false - expires_at: '2027-12-31T23:59:59Z' - hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 - include_byok_in_limit: false - label: sk-or-v1-0e6...1c96 - limit: 100 - limit_remaining: 74.5 - limit_reset: monthly - name: My Production Key - updated_at: '2025-08-24T15:45:00Z' - usage: 25.5 - usage_daily: 25.5 - usage_monthly: 25.5 - usage_weekly: 25.5 - workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 - properties: - byok_usage: - description: Total external BYOK usage (in USD) for the API key - example: 17.38 - format: double - type: number - byok_usage_daily: - description: External BYOK usage (in USD) for the current UTC day - example: 17.38 - format: double - type: number - byok_usage_monthly: - description: External BYOK usage (in USD) for current UTC month - example: 17.38 - format: double - type: number - byok_usage_weekly: - description: External BYOK usage (in USD) for the current UTC week (Monday-Sunday) - example: 17.38 - format: double - type: number - created_at: - description: ISO 8601 timestamp of when the API key was created - example: '2025-08-24T10:30:00Z' - type: string - creator_user_id: - description: >- - The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID. - example: user_2dHFtVWx2n56w6HkM0000000000 - nullable: true - type: string - disabled: - description: Whether the API key is disabled - example: false - type: boolean - expires_at: - description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration - example: '2027-12-31T23:59:59Z' - format: date-time - nullable: true - type: string - hash: - description: Unique hash identifier for the API key - example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 - type: string - include_byok_in_limit: - description: Whether to include external BYOK usage in the credit limit - example: false - type: boolean - label: - description: Human-readable label for the API key - example: sk-or-v1-0e6...1c96 - type: string - limit: - description: Spending limit for the API key in USD - example: 100 - format: double - nullable: true - type: number - limit_remaining: - description: Remaining spending limit in USD - example: 74.5 - format: double - nullable: true - type: number - limit_reset: - description: Type of limit reset for the API key - example: monthly - nullable: true - type: string - name: - description: Name of the API key - example: My Production Key - type: string - updated_at: - description: ISO 8601 timestamp of when the API key was last updated - example: '2025-08-24T15:45:00Z' - nullable: true - type: string - usage: - description: Total OpenRouter credit usage (in USD) for the API key - example: 25.5 - format: double - type: number - usage_daily: - description: OpenRouter credit usage (in USD) for the current UTC day - example: 25.5 - format: double - type: number - usage_monthly: - description: OpenRouter credit usage (in USD) for the current UTC month - example: 25.5 - format: double - type: number - usage_weekly: - description: OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday) - example: 25.5 - format: double - type: number - workspace_id: - description: The workspace ID this API key belongs to. - example: 0df9e665-d932-5740-b2c7-b52af166bc11 - type: string - required: - - hash - - name - - label - - disabled - - limit - - limit_remaining - - limit_reset - - include_byok_in_limit - - usage - - usage_daily - - usage_weekly - - usage_monthly - - byok_usage - - byok_usage_daily - - byok_usage_weekly - - byok_usage_monthly - - created_at - - updated_at - - creator_user_id - - workspace_id - type: object - type: array - required: - - data - type: object - description: List of API keys - '401': + $ref: '#/components/schemas/ModelResponse' + description: Returns the model details + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '500': content: application/json: example: error: - code: 401 - message: Missing Authentication header + code: 500 + message: Internal Server Error schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: Unauthorized - Authentication required or invalid credentials - '429': + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Get a model by its slug + tags: + - Models + x-speakeasy-name-override: get + /models: + get: + operationId: getModels + parameters: + - description: Filter models by use case category + in: query + name: category + required: false + schema: + description: Filter models by use case category + enum: + - programming + - roleplay + - marketing + - marketing/seo + - technology + - science + - translation + - legal + - finance + - health + - trivia + - academia + example: programming + type: string + x-speakeasy-unknown-values: allow + - description: Filter models by supported parameter (comma-separated) + in: query + name: supported_parameters + required: false + schema: + description: Filter models by supported parameter (comma-separated) + example: temperature + type: string + - description: >- + Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". + in: query + name: output_modalities + required: false + schema: + description: >- + Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". + example: text + type: string + - description: >- + Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date). When omitted, the existing default ordering is preserved. + in: query + name: sort + required: false + schema: + description: >- + Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date). When omitted, the existing default ordering is preserved. + enum: + - most-popular + - newest + - top-weekly + - pricing-low-to-high + - pricing-high-to-low + - context-high-to-low + - throughput-high-to-low + - latency-low-to-high + example: newest + type: string + x-speakeasy-unknown-values: allow + - description: Free-text search by model name or slug. + in: query + name: q + required: false + schema: + description: Free-text search by model name or slug. + example: gpt-4 + type: string + - description: 'Filter models by input modality. Comma-separated list of: text, image, audio, file.' + in: query + name: input_modalities + required: false + schema: + description: 'Filter models by input modality. Comma-separated list of: text, image, audio, file.' + example: text,image + type: string + - description: Minimum context length (tokens). Models with smaller context are excluded. + in: query + name: context + required: false + schema: + description: Minimum context length (tokens). Models with smaller context are excluded. + example: 128000 + exclusiveMinimum: true + minimum: 0 + type: integer + - description: Minimum prompt price in $/M tokens. + in: query + name: min_price + required: false + schema: + description: Minimum prompt price in $/M tokens. + example: 0 + minimum: 0 + nullable: true + type: number + - description: Maximum prompt price in $/M tokens. + in: query + name: max_price + required: false + schema: + description: Maximum prompt price in $/M tokens. + example: 10 + minimum: 0 + nullable: true + type: number + - description: Filter models by architecture/model family (e.g. GPT, Claude, Gemini, Llama). + in: query + name: arch + required: false + schema: + description: Filter models by architecture/model family (e.g. GPT, Claude, Gemini, Llama). + example: GPT + type: string + - description: Filter models by the organization that created the model. Comma-separated list of author slugs. + in: query + name: model_authors + required: false + schema: + description: Filter models by the organization that created the model. Comma-separated list of author slugs. + example: openai,anthropic + type: string + - description: Filter models by hosting provider. Comma-separated list of provider names. + in: query + name: providers + required: false + schema: + description: Filter models by hosting provider. Comma-separated list of provider names. + example: OpenAI,Anthropic + type: string + - description: Filter by distillation capability. "true" returns only distillable models, "false" excludes them. + in: query + name: distillable + required: false + schema: + description: Filter by distillation capability. "true" returns only distillable models, "false" excludes them. + enum: + - 'true' + - 'false' + example: 'true' + type: string + x-speakeasy-unknown-values: allow + - description: When set to "true", return only models with zero data retention endpoints. + in: query + name: zdr + required: false + schema: + description: When set to "true", return only models with zero data retention endpoints. + enum: + - 'true' + example: 'true' + type: string + - description: Filter to models with endpoints in the given data region. Currently only "eu" is supported. + in: query + name: region + required: false + schema: + description: Filter to models with endpoints in the given data region. Currently only "eu" is supported. + enum: + - eu + example: eu + type: string + responses: + '200': + content: + application/json: + example: + data: + - architecture: + input_modalities: + - text + instruct_type: chatml + modality: text->text + output_modalities: + - text + tokenizer: GPT + canonical_slug: openai/gpt-4 + context_length: 8192 + created: 1692901234 + default_parameters: null + description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. + expiration_date: null + id: openai/gpt-4 + knowledge_cutoff: null + links: + details: /api/v1/models/openai/gpt-5.4/endpoints + name: GPT-4 + per_request_limits: null + pricing: + completion: '0.00006' + image: '0' + prompt: '0.00003' + request: '0' + supported_parameters: + - temperature + - top_p + - max_tokens + supported_voices: null + top_provider: + context_length: 8192 + is_moderated: true + max_completion_tokens: 4096 + schema: + $ref: '#/components/schemas/ModelsListResponse' + description: Returns a list of models or RSS feed + '400': content: application/json: example: error: - code: 429 - message: Rate limit exceeded + code: 400 + message: Invalid request parameters schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: Too Many Requests - Rate limit exceeded + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input '500': content: application/json: @@ -17960,293 +28457,153 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: List API keys + summary: List all models and their properties tags: - - API Keys + - Models x-speakeasy-name-override: list - post: - description: >- - Create a new API key for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: createKeys - requestBody: - content: - application/json: - example: - expires_at: '2027-12-31T23:59:59Z' - include_byok_in_limit: true - limit: 50 - limit_reset: monthly - name: My New API Key - schema: - example: - expires_at: '2027-12-31T23:59:59Z' - include_byok_in_limit: true - limit: 50 - limit_reset: monthly - name: My New API Key - properties: - creator_user_id: - description: >- - Optional user ID of the key creator. Only meaningful for organization-owned keys where a specific member is creating the key. - example: user_2dHFtVWx2n56w6HkM0000000000 - minLength: 1 - nullable: true - type: string - expires_at: - description: >- - Optional ISO 8601 UTC timestamp when the API key should expire. Must be UTC, other timezones will be rejected - example: '2027-12-31T23:59:59Z' - format: date-time - nullable: true - type: string - include_byok_in_limit: - description: Whether to include BYOK usage in the limit - example: true - type: boolean - limit: - description: Optional spending limit for the API key in USD - example: 50 - format: double - nullable: true - type: number - limit_reset: - description: >- - Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. - enum: - - daily - - weekly - - monthly - - null - example: monthly - nullable: true - type: string - x-speakeasy-unknown-values: allow - name: - description: Name for the new API key - example: My New API Key - minLength: 1 - type: string - workspace_id: - description: The workspace to create the API key in. Defaults to the default workspace if not provided. - example: 0df9e665-d932-5740-b2c7-b52af166bc11 - format: uuid - type: string - required: - - name - type: object - required: true + /models/{author}/{slug}/endpoints: + get: + operationId: listEndpoints + parameters: + - description: The author/organization of the model + in: path + name: author + required: true + schema: + description: The author/organization of the model + example: openai + type: string + - description: The model slug + in: path + name: slug + required: true + schema: + description: The model slug + example: gpt-4 + type: string responses: - '201': + '200': content: application/json: example: data: - byok_usage: 0 - byok_usage_daily: 0 - byok_usage_monthly: 0 - byok_usage_weekly: 0 - created_at: '2025-08-24T10:30:00Z' - creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 - disabled: false - expires_at: '2027-12-31T23:59:59Z' - hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 - include_byok_in_limit: true - label: My New API Key - limit: 50 - limit_remaining: 50 - limit_reset: monthly - name: My New API Key - updated_at: null - usage: 0 - usage_daily: 0 - usage_monthly: 0 - usage_weekly: 0 - workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 - key: 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 + architecture: + input_modalities: + - text + instruct_type: chatml + modality: text->text + output_modalities: + - text + tokenizer: GPT + created: 1692901234 + description: GPT-4 is a large multimodal model. + endpoints: [] + id: openai/gpt-4 + name: GPT-4 schema: example: data: - byok_usage: 0 - byok_usage_daily: 0 - byok_usage_monthly: 0 - byok_usage_weekly: 0 - created_at: '2025-08-24T10:30:00Z' - creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 - disabled: false - expires_at: '2027-12-31T23:59:59Z' - hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 - include_byok_in_limit: true - label: My New API Key - limit: 50 - limit_remaining: 50 - limit_reset: monthly - name: My New API Key - updated_at: null - usage: 0 - usage_daily: 0 - usage_monthly: 0 - usage_weekly: 0 - workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 - key: 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 - properties: - data: - description: The created API key information - example: - byok_usage: 17.38 - byok_usage_daily: 17.38 - byok_usage_monthly: 17.38 - byok_usage_weekly: 17.38 - created_at: '2025-08-24T10:30:00Z' - creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 - disabled: false - expires_at: '2027-12-31T23:59:59Z' - hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 - include_byok_in_limit: false - label: sk-or-v1-0e6...1c96 - limit: 100 - limit_remaining: 74.5 - limit_reset: monthly - name: My Production Key - updated_at: '2025-08-24T15:45:00Z' - usage: 25.5 - usage_daily: 25.5 - usage_monthly: 25.5 - usage_weekly: 25.5 - workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 - properties: - byok_usage: - description: Total external BYOK usage (in USD) for the API key - example: 17.38 - format: double - type: number - byok_usage_daily: - description: External BYOK usage (in USD) for the current UTC day - example: 17.38 - format: double - type: number - byok_usage_monthly: - description: External BYOK usage (in USD) for current UTC month - example: 17.38 - format: double - type: number - byok_usage_weekly: - description: External BYOK usage (in USD) for the current UTC week (Monday-Sunday) - example: 17.38 - format: double - type: number - created_at: - description: ISO 8601 timestamp of when the API key was created - example: '2025-08-24T10:30:00Z' - type: string - creator_user_id: - description: >- - The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID. - example: user_2dHFtVWx2n56w6HkM0000000000 - nullable: true - type: string - disabled: - description: Whether the API key is disabled - example: false - type: boolean - expires_at: - description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration - example: '2027-12-31T23:59:59Z' - format: date-time - nullable: true - type: string - hash: - description: Unique hash identifier for the API key - example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 - type: string - include_byok_in_limit: - description: Whether to include external BYOK usage in the credit limit - example: false - type: boolean - label: - description: Human-readable label for the API key - example: sk-or-v1-0e6...1c96 - type: string - limit: - description: Spending limit for the API key in USD - example: 100 - format: double - nullable: true - type: number - limit_remaining: - description: Remaining spending limit in USD - example: 74.5 - format: double - nullable: true - type: number - limit_reset: - description: Type of limit reset for the API key - example: monthly - nullable: true - type: string - name: - description: Name of the API key - example: My Production Key - type: string - updated_at: - description: ISO 8601 timestamp of when the API key was last updated - example: '2025-08-24T15:45:00Z' - nullable: true - type: string - usage: - description: Total OpenRouter credit usage (in USD) for the API key - example: 25.5 - format: double - type: number - usage_daily: - description: OpenRouter credit usage (in USD) for the current UTC day - example: 25.5 - format: double - type: number - usage_monthly: - description: OpenRouter credit usage (in USD) for the current UTC month - example: 25.5 - format: double - type: number - usage_weekly: - description: OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday) - example: 25.5 - format: double - type: number - workspace_id: - description: The workspace ID this API key belongs to. - example: 0df9e665-d932-5740-b2c7-b52af166bc11 - type: string - required: - - hash - - name - - label - - disabled - - limit - - limit_remaining - - limit_reset - - include_byok_in_limit - - usage - - usage_daily - - usage_weekly - - usage_monthly - - byok_usage - - byok_usage_daily - - byok_usage_weekly - - byok_usage_monthly - - created_at - - updated_at - - creator_user_id - - workspace_id - type: object - key: - description: The actual API key string (only shown once) - example: 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 - type: string + architecture: + input_modalities: + - text + instruct_type: chatml + modality: text->text + output_modalities: + - text + tokenizer: GPT + created: 1692901234 + description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. + endpoints: + - context_length: 8192 + latency_last_30m: + p50: 0.25 + p75: 0.35 + p90: 0.48 + p99: 0.85 + max_completion_tokens: 4096 + max_prompt_tokens: 8192 + model_id: openai/gpt-4 + model_name: GPT-4 + name: 'OpenAI: GPT-4' + pricing: + completion: '0.00006' + image: '0' + prompt: '0.00003' + request: '0' + provider_name: OpenAI + quantization: fp16 + status: default + supported_parameters: + - temperature + - top_p + - max_tokens + supports_implicit_caching: true + tag: openai + throughput_last_30m: + p50: 45.2 + p75: 38.5 + p90: 28.3 + p99: 15.1 + uptime_last_1d: 99.8 + uptime_last_30m: 99.5 + uptime_last_5m: 100 + id: openai/gpt-4 + name: GPT-4 + properties: + data: + $ref: '#/components/schemas/ListEndpointsResponse' required: - data - - key type: object - description: API key created successfully + description: Returns a list of endpoints + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: List all endpoints for a model + tags: + - Endpoints + x-speakeasy-name-override: list + /models/count: + get: + operationId: listModelsCount + parameters: + - description: >- + Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". + in: query + name: output_modalities + required: false + schema: + description: >- + Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". + example: text + type: string + responses: + '200': + content: + application/json: + example: + data: + count: 150 + schema: + $ref: '#/components/schemas/ModelsCountResponse' + description: Returns the total count of available models '400': content: application/json: @@ -18257,36 +28614,88 @@ paths: schema: $ref: '#/components/schemas/BadRequestResponse' description: Bad Request - Invalid request parameters or malformed input - '401': + '500': content: application/json: example: error: - code: 401 - message: Missing Authentication header + code: 500 + message: Internal Server Error schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: Unauthorized - Authentication required or invalid credentials - '403': + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Get total count of available models + tags: + - Models + x-speakeasy-name-override: count + /models/user: + get: + description: >- + List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through `eu.openrouter.ai/api/v1/...` the results will be filtered to models that satisfy [EU in-region routing](https://openrouter.ai/docs/guides/privacy/provider-logging#enterprise-eu-in-region-routing). + operationId: listModelsUser + responses: + '200': + content: + application/json: + example: + data: + - architecture: + input_modalities: + - text + instruct_type: chatml + modality: text->text + output_modalities: + - text + tokenizer: GPT + canonical_slug: openai/gpt-4 + context_length: 8192 + created: 1692901234 + default_parameters: null + description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. + expiration_date: null + id: openai/gpt-4 + knowledge_cutoff: null + links: + details: /api/v1/models/openai/gpt-5.4/endpoints + name: GPT-4 + per_request_limits: null + pricing: + completion: '0.00006' + image: '0' + prompt: '0.00003' + request: '0' + supported_parameters: + - temperature + - top_p + - max_tokens + supported_voices: null + top_provider: + context_length: 8192 + is_moderated: true + max_completion_tokens: 4096 + schema: + $ref: '#/components/schemas/ModelsListResponse' + description: Returns a list of models filtered by user provider preferences + '401': content: application/json: example: error: - code: 403 - message: Only management keys can perform this operation + code: 401 + message: Missing Authentication header schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: Forbidden - Authentication successful but insufficient permissions - '429': + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '404': content: application/json: example: error: - code: 429 - message: Rate limit exceeded + code: 404 + message: Resource not found schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: Too Many Requests - Rate limit exceeded + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist '500': content: application/json: @@ -18297,42 +28706,72 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: Create a new API key + security: + - bearer: [] + summary: List models filtered by user provider preferences, privacy settings, and guardrails tags: - - API Keys - x-speakeasy-name-override: create - /keys/{hash}: - delete: - description: Delete an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: deleteKeys + - Models + x-speakeasy-name-override: listForUser + /observability/destinations: + get: + description: >- + List the observability destinations configured for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace. Only destinations with stable release status are surfaced — destinations of other types are excluded. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: listObservabilityDestinations parameters: - - description: The hash identifier of the API key to delete - in: path - name: hash - required: true + - description: Number of records to skip for pagination + in: query + name: offset + required: false schema: - description: The hash identifier of the API key to delete - example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 + description: Number of records to skip for pagination + example: 0 + minimum: 0 + nullable: true + type: integer + - description: Maximum number of records to return (max 100) + in: query + name: limit + required: false + schema: + description: Maximum number of records to return (max 100) + example: 50 + maximum: 100 + minimum: 1 + type: integer + - description: Optional workspace ID to filter by. Defaults to the authenticated entity's default workspace. + in: query + name: workspace_id + required: false + schema: + description: Optional workspace ID to filter by. Defaults to the authenticated entity's default workspace. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid type: string responses: '200': content: application/json: example: - deleted: true + data: + - api_key_hashes: null + config: + baseUrl: https://us.cloud.langfuse.com + publicKey: pk-l...EfGh + secretKey: sk-l...AbCd + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production Langfuse + privacy_mode: false + sampling_rate: 1 + type: langfuse + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + total_count: 1 schema: - example: - deleted: true - properties: - deleted: - const: true - description: Confirmation that the API key was deleted - example: true - type: boolean - required: - - deleted - type: object - description: API key deleted successfully + $ref: '#/components/schemas/ListObservabilityDestinationsResponse' + description: List of observability destinations '401': content: application/json: @@ -18341,259 +28780,152 @@ paths: code: 401 message: Missing Authentication header schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: Unauthorized - Authentication required or invalid credentials - '404': + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: List observability destinations + tags: + - Observability + x-speakeasy-name-override: list + x-speakeasy-pagination: + inputs: + - in: parameters + name: offset + type: offset + - in: parameters + name: limit + type: limit + outputs: + results: $.data + type: offsetLimit + post: + description: >- + Create a new observability destination. A maximum of 5 destinations per type is allowed. Defaults to the authenticated entity's default workspace; use the `workspace_id` body field to scope to a different workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: createObservabilityDestination + requestBody: + content: + application/json: + example: + config: + baseUrl: https://us.cloud.langfuse.com + publicKey: pk-l...EfGh + secretKey: sk-l...AbCd + name: Production Langfuse + type: langfuse + schema: + $ref: '#/components/schemas/CreateObservabilityDestinationRequest' + required: true + responses: + '201': + content: + application/json: + example: + data: + api_key_hashes: null + config: + baseUrl: https://us.cloud.langfuse.com + publicKey: pk-l...EfGh + secretKey: sk-l...AbCd + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production Langfuse + privacy_mode: false + sampling_rate: 1 + type: langfuse + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + schema: + $ref: '#/components/schemas/CreateObservabilityDestinationResponse' + description: Destination created successfully + '400': content: application/json: example: error: - code: 404 - message: Resource not found + code: 400 + message: Invalid request parameters schema: - $ref: '#/components/schemas/NotFoundResponse' - description: Not Found - Resource does not exist - '429': + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': content: application/json: example: error: - code: 429 - message: Rate limit exceeded + code: 401 + message: Missing Authentication header schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: Too Many Requests - Rate limit exceeded - '500': + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '403': content: application/json: example: error: - code: 500 - message: Internal Server Error + code: 403 + message: Only management keys can perform this operation schema: - $ref: '#/components/schemas/InternalServerResponse' - description: Internal Server Error - Unexpected server error - summary: Delete an API key - tags: - - API Keys - x-speakeasy-name-override: delete - get: - description: Get a single API key by hash. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: getKey - parameters: - - description: The hash identifier of the API key to retrieve - in: path - name: hash - required: true - schema: - description: The hash identifier of the API key to retrieve - example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 - type: string - responses: - '200': + $ref: '#/components/schemas/ForbiddenResponse' + description: Forbidden - Authentication successful but insufficient permissions + '409': content: application/json: example: - data: - byok_usage: 17.38 - byok_usage_daily: 17.38 - byok_usage_monthly: 17.38 - byok_usage_weekly: 17.38 - created_at: '2025-08-24T10:30:00Z' - creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 - disabled: false - expires_at: '2027-12-31T23:59:59Z' - hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 - include_byok_in_limit: false - label: Production API Key - limit: 100 - limit_remaining: 74.5 - limit_reset: monthly - name: My Production Key - updated_at: '2025-08-24T15:45:00Z' - usage: 25.5 - usage_daily: 25.5 - usage_monthly: 25.5 - usage_weekly: 25.5 - workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 - schema: - example: - data: - byok_usage: 17.38 - byok_usage_daily: 17.38 - byok_usage_monthly: 17.38 - byok_usage_weekly: 17.38 - created_at: '2025-08-24T10:30:00Z' - creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 - disabled: false - expires_at: '2027-12-31T23:59:59Z' - hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 - include_byok_in_limit: false - label: Production API Key - limit: 100 - limit_remaining: 74.5 - limit_reset: monthly - name: My Production Key - updated_at: '2025-08-24T15:45:00Z' - usage: 25.5 - usage_daily: 25.5 - usage_monthly: 25.5 - usage_weekly: 25.5 - workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 - properties: - data: - description: The API key information - example: - byok_usage: 17.38 - byok_usage_daily: 17.38 - byok_usage_monthly: 17.38 - byok_usage_weekly: 17.38 - created_at: '2025-08-24T10:30:00Z' - creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 - disabled: false - expires_at: '2027-12-31T23:59:59Z' - hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 - include_byok_in_limit: false - label: sk-or-v1-0e6...1c96 - limit: 100 - limit_remaining: 74.5 - limit_reset: monthly - name: My Production Key - updated_at: '2025-08-24T15:45:00Z' - usage: 25.5 - usage_daily: 25.5 - usage_monthly: 25.5 - usage_weekly: 25.5 - workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 - properties: - byok_usage: - description: Total external BYOK usage (in USD) for the API key - example: 17.38 - format: double - type: number - byok_usage_daily: - description: External BYOK usage (in USD) for the current UTC day - example: 17.38 - format: double - type: number - byok_usage_monthly: - description: External BYOK usage (in USD) for current UTC month - example: 17.38 - format: double - type: number - byok_usage_weekly: - description: External BYOK usage (in USD) for the current UTC week (Monday-Sunday) - example: 17.38 - format: double - type: number - created_at: - description: ISO 8601 timestamp of when the API key was created - example: '2025-08-24T10:30:00Z' - type: string - creator_user_id: - description: >- - The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID. - example: user_2dHFtVWx2n56w6HkM0000000000 - nullable: true - type: string - disabled: - description: Whether the API key is disabled - example: false - type: boolean - expires_at: - description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration - example: '2027-12-31T23:59:59Z' - format: date-time - nullable: true - type: string - hash: - description: Unique hash identifier for the API key - example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 - type: string - include_byok_in_limit: - description: Whether to include external BYOK usage in the credit limit - example: false - type: boolean - label: - description: Human-readable label for the API key - example: sk-or-v1-0e6...1c96 - type: string - limit: - description: Spending limit for the API key in USD - example: 100 - format: double - nullable: true - type: number - limit_remaining: - description: Remaining spending limit in USD - example: 74.5 - format: double - nullable: true - type: number - limit_reset: - description: Type of limit reset for the API key - example: monthly - nullable: true - type: string - name: - description: Name of the API key - example: My Production Key - type: string - updated_at: - description: ISO 8601 timestamp of when the API key was last updated - example: '2025-08-24T15:45:00Z' - nullable: true - type: string - usage: - description: Total OpenRouter credit usage (in USD) for the API key - example: 25.5 - format: double - type: number - usage_daily: - description: OpenRouter credit usage (in USD) for the current UTC day - example: 25.5 - format: double - type: number - usage_monthly: - description: OpenRouter credit usage (in USD) for the current UTC month - example: 25.5 - format: double - type: number - usage_weekly: - description: OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday) - example: 25.5 - format: double - type: number - workspace_id: - description: The workspace ID this API key belongs to. - example: 0df9e665-d932-5740-b2c7-b52af166bc11 - type: string - required: - - hash - - name - - label - - disabled - - limit - - limit_remaining - - limit_reset - - include_byok_in_limit - - usage - - usage_daily - - usage_weekly - - usage_monthly - - byok_usage - - byok_usage_daily - - byok_usage_weekly - - byok_usage_monthly - - created_at - - updated_at - - creator_user_id - - workspace_id - type: object - required: - - data - type: object - description: API key details + error: + code: 409 + message: Resource conflict. Please try again later. + schema: + $ref: '#/components/schemas/ConflictResponse' + description: Conflict - Resource conflict or concurrent modification + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Create an observability destination + tags: + - Observability + x-speakeasy-name-override: create + /observability/destinations/{id}: + delete: + description: >- + Delete an existing observability destination. This performs a soft delete. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: deleteObservabilityDestination + parameters: + - description: The destination ID (UUID). + in: path + name: id + required: true + schema: + description: The destination ID (UUID). + example: 99999999-aaaa-bbbb-cccc-dddddddddddd + format: uuid + type: string + responses: + '200': + content: + application/json: + example: + deleted: true + schema: + $ref: '#/components/schemas/DeleteObservabilityDestinationResponse' + description: Destination deleted successfully '401': content: application/json: @@ -18614,16 +28946,78 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: Not Found - Resource does not exist - '429': + '500': content: application/json: example: error: - code: 429 - message: Rate limit exceeded + code: 500 + message: Internal Server Error schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: Too Many Requests - Rate limit exceeded + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Delete an observability destination + tags: + - Observability + x-speakeasy-name-override: delete + get: + description: >- + Fetch a single observability destination by its UUID. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: getObservabilityDestination + parameters: + - description: The destination ID (UUID). + in: path + name: id + required: true + schema: + description: The destination ID (UUID). + example: 99999999-aaaa-bbbb-cccc-dddddddddddd + format: uuid + type: string + responses: + '200': + content: + application/json: + example: + data: + api_key_hashes: null + config: + baseUrl: https://us.cloud.langfuse.com + publicKey: pk-l...EfGh + secretKey: sk-l...AbCd + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production Langfuse + privacy_mode: false + sampling_rate: 1 + type: langfuse + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + schema: + $ref: '#/components/schemas/GetObservabilityDestinationResponse' + description: The observability destination + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist '500': content: application/json: @@ -18634,70 +29028,32 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: Get a single API key + summary: Get an observability destination tags: - - API Keys + - Observability x-speakeasy-name-override: get patch: - description: Update an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: updateKeys + description: >- + Update an existing observability destination. Only the fields provided in the request body are updated. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: updateObservabilityDestination parameters: - - description: The hash identifier of the API key to update + - description: The destination ID (UUID). in: path - name: hash + name: id required: true schema: - description: The hash identifier of the API key to update - example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 + description: The destination ID (UUID). + example: 99999999-aaaa-bbbb-cccc-dddddddddddd + format: uuid type: string requestBody: content: application/json: example: - disabled: false - include_byok_in_limit: true - limit: 75 - limit_reset: daily - name: Updated API Key Name + enabled: false + name: Updated Langfuse schema: - example: - disabled: false - include_byok_in_limit: true - limit: 75 - limit_reset: daily - name: Updated API Key Name - properties: - disabled: - description: Whether to disable the API key - example: false - type: boolean - include_byok_in_limit: - description: Whether to include BYOK usage in the limit - example: true - type: boolean - limit: - description: New spending limit for the API key in USD - example: 75 - format: double - nullable: true - type: number - limit_reset: - description: >- - New limit reset type for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. - enum: - - daily - - weekly - - monthly - - null - example: daily - nullable: true - type: string - x-speakeasy-unknown-values: allow - name: - description: New name for the API key - example: Updated API Key Name - type: string - type: object + $ref: '#/components/schemas/UpdateObservabilityDestinationRequest' required: true responses: '200': @@ -18705,205 +29061,256 @@ paths: application/json: example: data: - byok_usage: 17.38 - byok_usage_daily: 17.38 - byok_usage_monthly: 17.38 - byok_usage_weekly: 17.38 + api_key_hashes: null + config: + baseUrl: https://us.cloud.langfuse.com + publicKey: pk-l...EfGh + secretKey: sk-l...AbCd created_at: '2025-08-24T10:30:00Z' - creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 - disabled: false - expires_at: null - hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 - include_byok_in_limit: true - label: Updated API Key Name - limit: 75 - limit_remaining: 49.5 - limit_reset: daily - name: Updated API Key Name - updated_at: '2025-08-24T16:00:00Z' - usage: 25.5 - usage_daily: 25.5 - usage_monthly: 25.5 - usage_weekly: 25.5 - workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 + enabled: true + filter_rules: null + id: 99999999-aaaa-bbbb-cccc-dddddddddddd + name: Production Langfuse + privacy_mode: false + sampling_rate: 1 + type: langfuse + updated_at: '2025-08-24T15:45:00Z' + workspace_id: 550e8400-e29b-41d4-a716-446655440000 + schema: + $ref: '#/components/schemas/UpdateObservabilityDestinationResponse' + description: Destination updated successfully + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '409': + content: + application/json: + example: + error: + code: 409 + message: Resource conflict. Please try again later. + schema: + $ref: '#/components/schemas/ConflictResponse' + description: Conflict - Resource conflict or concurrent modification + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: Update an observability destination + tags: + - Observability + x-speakeasy-name-override: update + /organization/members: + get: + description: >- + List all members of the organization associated with the authenticated management key. [Management key](/docs/guides/overview/auth/management-api-keys) required. + operationId: listOrganizationMembers + parameters: + - description: Number of records to skip for pagination + in: query + name: offset + required: false + schema: + description: Number of records to skip for pagination + example: 0 + minimum: 0 + nullable: true + type: integer + - description: Maximum number of records to return (max 100) + in: query + name: limit + required: false + schema: + description: Maximum number of records to return (max 100) + example: 50 + maximum: 100 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + example: + data: + - email: jane.doe@example.com + first_name: Jane + id: user_2dHFtVWx2n56w6HkM0000000000 + last_name: Doe + role: member + total_count: 25 schema: - example: - data: - byok_usage: 17.38 - byok_usage_daily: 17.38 - byok_usage_monthly: 17.38 - byok_usage_weekly: 17.38 - created_at: '2025-08-24T10:30:00Z' - creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 - disabled: false - expires_at: null - hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 - include_byok_in_limit: true - label: Updated API Key Name - limit: 75 - limit_remaining: 49.5 - limit_reset: daily - name: Updated API Key Name - updated_at: '2025-08-24T16:00:00Z' - usage: 25.5 - usage_daily: 25.5 - usage_monthly: 25.5 - usage_weekly: 25.5 - workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 properties: data: - description: The updated API key information - example: - byok_usage: 17.38 - byok_usage_daily: 17.38 - byok_usage_monthly: 17.38 - byok_usage_weekly: 17.38 - created_at: '2025-08-24T10:30:00Z' - creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 - disabled: false - expires_at: '2027-12-31T23:59:59Z' - hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 - include_byok_in_limit: false - label: sk-or-v1-0e6...1c96 - limit: 100 - limit_remaining: 74.5 - limit_reset: monthly - name: My Production Key - updated_at: '2025-08-24T15:45:00Z' - usage: 25.5 - usage_daily: 25.5 - usage_monthly: 25.5 - usage_weekly: 25.5 - workspace_id: 0df9e665-d932-5740-b2c7-b52af166bc11 - properties: - byok_usage: - description: Total external BYOK usage (in USD) for the API key - example: 17.38 - format: double - type: number - byok_usage_daily: - description: External BYOK usage (in USD) for the current UTC day - example: 17.38 - format: double - type: number - byok_usage_monthly: - description: External BYOK usage (in USD) for current UTC month - example: 17.38 - format: double - type: number - byok_usage_weekly: - description: External BYOK usage (in USD) for the current UTC week (Monday-Sunday) - example: 17.38 - format: double - type: number - created_at: - description: ISO 8601 timestamp of when the API key was created - example: '2025-08-24T10:30:00Z' - type: string - creator_user_id: - description: >- - The user ID of the key creator. For organization-owned keys, this is the member who created the key. For individual users, this is the user's own ID. - example: user_2dHFtVWx2n56w6HkM0000000000 - nullable: true - type: string - disabled: - description: Whether the API key is disabled - example: false - type: boolean - expires_at: - description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration - example: '2027-12-31T23:59:59Z' - format: date-time - nullable: true - type: string - hash: - description: Unique hash identifier for the API key - example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 - type: string - include_byok_in_limit: - description: Whether to include external BYOK usage in the credit limit - example: false - type: boolean - label: - description: Human-readable label for the API key - example: sk-or-v1-0e6...1c96 - type: string - limit: - description: Spending limit for the API key in USD - example: 100 - format: double - nullable: true - type: number - limit_remaining: - description: Remaining spending limit in USD - example: 74.5 - format: double - nullable: true - type: number - limit_reset: - description: Type of limit reset for the API key - example: monthly - nullable: true - type: string - name: - description: Name of the API key - example: My Production Key - type: string - updated_at: - description: ISO 8601 timestamp of when the API key was last updated - example: '2025-08-24T15:45:00Z' - nullable: true - type: string - usage: - description: Total OpenRouter credit usage (in USD) for the API key - example: 25.5 - format: double - type: number - usage_daily: - description: OpenRouter credit usage (in USD) for the current UTC day - example: 25.5 - format: double - type: number - usage_monthly: - description: OpenRouter credit usage (in USD) for the current UTC month - example: 25.5 - format: double - type: number - usage_weekly: - description: OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday) - example: 25.5 - format: double - type: number - workspace_id: - description: The workspace ID this API key belongs to. - example: 0df9e665-d932-5740-b2c7-b52af166bc11 - type: string - required: - - hash - - name - - label - - disabled - - limit - - limit_remaining - - limit_reset - - include_byok_in_limit - - usage - - usage_daily - - usage_weekly - - usage_monthly - - byok_usage - - byok_usage_daily - - byok_usage_weekly - - byok_usage_monthly - - created_at - - updated_at - - creator_user_id - - workspace_id - type: object + description: List of organization members + items: + properties: + email: + description: Email address of the member + example: jane.doe@example.com + type: string + first_name: + description: First name of the member + example: Jane + nullable: true + type: string + id: + description: User ID of the organization member + example: user_2dHFtVWx2n56w6HkM0000000000 + type: string + last_name: + description: Last name of the member + example: Doe + nullable: true + type: string + role: + description: Role of the member in the organization + enum: + - org:admin + - org:member + example: org:member + type: string + x-speakeasy-unknown-values: allow + required: + - id + - first_name + - last_name + - email + - role + type: object + type: array + total_count: + description: Total number of members in the organization + example: 25 + type: integer required: - data + - total_count type: object - description: API key updated successfully + description: List of organization members + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + summary: List organization members + tags: + - Organization + x-speakeasy-name-override: listMembers + x-speakeasy-pagination: + inputs: + - in: parameters + name: offset + type: offset + - in: parameters + name: limit + type: limit + outputs: + results: $.data + type: offsetLimit + /presets: + get: + description: Lists all presets for the authenticated user, ordered by most recently updated first. + operationId: listPresets + parameters: + - description: Number of records to skip for pagination + in: query + name: offset + required: false + schema: + description: Number of records to skip for pagination + example: 0 + minimum: 0 + nullable: true + type: integer + - description: Maximum number of records to return (max 100) + in: query + name: limit + required: false + schema: + description: Maximum number of records to return (max 100) + example: 50 + maximum: 100 + minimum: 1 + type: integer + responses: + '200': + content: + application/json: + example: + data: + - created_at: '2026-04-20T10:00:00Z' + creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 + description: null + designated_version_id: 550e8400-e29b-41d4-a716-446655440000 + id: 650e8400-e29b-41d4-a716-446655440001 + name: my-preset + slug: my-preset + status: active + status_updated_at: null + updated_at: '2026-04-20T10:00:00Z' + workspace_id: 750e8400-e29b-41d4-a716-446655440002 + total_count: 1 + schema: + $ref: '#/components/schemas/ListPresetsResponse' + description: Paginated list of presets. '400': content: application/json: @@ -18924,26 +29331,6 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: Unauthorized - Authentication required or invalid credentials - '404': - content: - application/json: - example: - error: - code: 404 - message: Resource not found - schema: - $ref: '#/components/schemas/NotFoundResponse' - description: Not Found - Resource does not exist - '429': - content: - application/json: - example: - error: - code: 429 - message: Rate limit exceeded - schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: Too Many Requests - Rate limit exceeded '500': content: application/json: @@ -18954,246 +29341,174 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: Update an API key + security: + - apiKey: [] + summary: List presets tags: - - API Keys - x-speakeasy-name-override: update - /messages: - post: - description: >- - Creates a message using the Anthropic Messages API format. Supports text, images, PDFs, tools, and extended thinking. - operationId: createMessages - requestBody: - content: - application/json: - example: - max_tokens: 1024 - messages: - - content: Hello, how are you? - role: user - model: anthropic/claude-sonnet-4 - schema: - $ref: '#/components/schemas/MessagesRequest' - required: true + - Presets + x-speakeasy-name-override: list + x-speakeasy-pagination: + inputs: + - in: parameters + name: offset + type: offset + - in: parameters + name: limit + type: limit + outputs: + results: $.data + type: offsetLimit + /presets/{slug}: + get: + description: Retrieves a preset by its slug with its currently designated version inline. + operationId: getPreset + parameters: + - description: URL-safe slug identifying the preset. + in: path + name: slug + required: true + schema: + description: URL-safe slug identifying the preset. + example: my-preset + minLength: 1 + type: string responses: '200': content: application/json: - example: - content: - - text: I'm doing well, thank you for asking! How can I help you today? - type: text - id: msg_abc123 - model: anthropic/claude-sonnet-4 - role: assistant - stop_reason: end_turn - type: message - usage: - input_tokens: 12 - output_tokens: 18 - schema: - $ref: '#/components/schemas/MessagesResult' - text/event-stream: example: data: - delta: - text: Hello - type: text_delta - index: 0 - type: content_block_delta - event: content_block_delta - schema: - properties: - data: - $ref: '#/components/schemas/MessagesStreamEvents' - event: - type: string - required: - - event - - data - type: object - x-speakeasy-sse-sentinel: '[DONE]' - description: Successful response + created_at: '2026-04-20T10:00:00Z' + creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 + description: null + designated_version: + config: + model: openai/gpt-4o + temperature: 0.7 + created_at: '2026-04-20T10:00:00Z' + creator_id: user_2dHFtVWx2n56w6HkM0000000000 + id: 550e8400-e29b-41d4-a716-446655440000 + preset_id: 650e8400-e29b-41d4-a716-446655440001 + system_prompt: You are a helpful assistant. + updated_at: '2026-04-20T10:00:00Z' + version: 1 + designated_version_id: 550e8400-e29b-41d4-a716-446655440000 + id: 650e8400-e29b-41d4-a716-446655440001 + name: my-preset + slug: my-preset + status: active + status_updated_at: null + updated_at: '2026-04-20T10:00:00Z' + workspace_id: 750e8400-e29b-41d4-a716-446655440002 + schema: + $ref: '#/components/schemas/GetPresetResponse' + description: Preset with its designated version. '400': content: application/json: example: error: - message: 'Invalid request: messages is required' - type: invalid_request_error - type: error + code: 400 + message: Invalid request parameters schema: - $ref: '#/components/schemas/MessagesErrorResponse' - description: Invalid request error + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input '401': content: application/json: example: error: - message: Invalid API key - type: authentication_error - type: error - schema: - $ref: '#/components/schemas/MessagesErrorResponse' - description: Authentication error - '403': - content: - application/json: - example: - error: - message: Permission denied - type: permission_error - type: error + code: 401 + message: Missing Authentication header schema: - $ref: '#/components/schemas/MessagesErrorResponse' - description: Permission denied error + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials '404': content: application/json: example: error: - message: Model not found - type: not_found_error - type: error - schema: - $ref: '#/components/schemas/MessagesErrorResponse' - description: Not found error - '429': - content: - application/json: - example: - error: - message: Rate limit exceeded - type: rate_limit_error - type: error + code: 404 + message: Resource not found schema: - $ref: '#/components/schemas/MessagesErrorResponse' - description: Rate limit error + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist '500': content: application/json: example: error: - message: Internal server error - type: api_error - type: error - schema: - $ref: '#/components/schemas/MessagesErrorResponse' - description: API error - '503': - content: - application/json: - example: - error: - message: Service temporarily overloaded - type: overloaded_error - type: error - schema: - $ref: '#/components/schemas/MessagesErrorResponse' - description: Overloaded error - '529': - content: - application/json: - example: - error: - message: Provider is temporarily overloaded - type: overloaded_error - type: error + code: 500 + message: Internal Server Error schema: - $ref: '#/components/schemas/MessagesErrorResponse' - description: Overloaded error - summary: Create a message + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + security: + - apiKey: [] + summary: Get a preset tags: - - Anthropic Messages - x-speakeasy-ignore: true - x-speakeasy-name-override: create - x-speakeasy-stream-request-field: stream - /models: - get: - operationId: getModels + - Presets + x-speakeasy-name-override: get + /presets/{slug}/chat/completions: + post: + description: >- + Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. `messages`, `stream`, `prompt`) are silently ignored. + operationId: createPresetsChatCompletions parameters: - - description: Filter models by use case category - in: query - name: category - required: false - schema: - description: Filter models by use case category - enum: - - programming - - roleplay - - marketing - - marketing/seo - - technology - - science - - translation - - legal - - finance - - health - - trivia - - academia - example: programming - type: string - x-speakeasy-unknown-values: allow - - description: Filter models by supported parameter (comma-separated) - in: query - name: supported_parameters - required: false - schema: - description: Filter models by supported parameter (comma-separated) - example: temperature - type: string - - description: >- - Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". - in: query - name: output_modalities - required: false + - description: URL-safe slug identifying the preset. Created if it does not exist. + in: path + name: slug + required: true schema: - description: >- - Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". - example: text + description: URL-safe slug identifying the preset. Created if it does not exist. + example: my-preset + minLength: 1 type: string + requestBody: + content: + application/json: + example: + messages: + - content: You are a helpful assistant. + role: system + - content: Hello! + role: user + model: openai/gpt-5.4 + temperature: 0.7 + schema: + $ref: '#/components/schemas/ChatRequest' + required: true responses: '200': content: application/json: example: data: - - architecture: - input_modalities: - - text - instruct_type: chatml - modality: text->text - output_modalities: - - text - tokenizer: GPT - canonical_slug: openai/gpt-4 - context_length: 8192 - created: 1692901234 - default_parameters: null - description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. - expiration_date: null - id: openai/gpt-4 - knowledge_cutoff: null - links: - details: /api/v1/models/openai/gpt-5.4/endpoints - name: GPT-4 - per_request_limits: null - pricing: - completion: '0.00006' - image: '0' - prompt: '0.00003' - request: '0' - supported_parameters: - - temperature - - top_p - - max_tokens - top_provider: - context_length: 8192 - is_moderated: true - max_completion_tokens: 4096 - schema: - $ref: '#/components/schemas/ModelsListResponse' - description: Returns a list of models or RSS feed + created_at: '2026-04-20T10:00:00Z' + creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 + description: null + designated_version: + config: + model: openai/gpt-5.4 + temperature: 0.7 + created_at: '2026-04-20T10:00:00Z' + creator_id: user_2dHFtVWx2n56w6HkM0000000000 + id: 550e8400-e29b-41d4-a716-446655440000 + preset_id: 650e8400-e29b-41d4-a716-446655440001 + system_prompt: You are a helpful assistant. + updated_at: '2026-04-20T10:00:00Z' + version: 1 + designated_version_id: 550e8400-e29b-41d4-a716-446655440000 + id: 650e8400-e29b-41d4-a716-446655440001 + name: my-preset + slug: my-preset + status: active + status_updated_at: null + updated_at: '2026-04-20T10:00:00Z' + workspace_id: 750e8400-e29b-41d4-a716-446655440002 + schema: + $ref: '#/components/schemas/CreatePresetFromInferenceResponse' + description: Preset created or updated successfully. '400': content: application/json: @@ -19204,6 +29519,46 @@ paths: schema: $ref: '#/components/schemas/BadRequestResponse' description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '403': + content: + application/json: + example: + error: + code: 403 + message: Only management keys can perform this operation + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: Forbidden - Authentication successful but insufficient permissions + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '409': + content: + application/json: + example: + error: + code: 409 + message: Resource conflict. Please try again later. + schema: + $ref: '#/components/schemas/ConflictResponse' + description: Conflict - Resource conflict or concurrent modification '500': content: application/json: @@ -19214,105 +29569,100 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: List all models and their properties + security: + - apiKey: [] + summary: Create a preset from a chat-completions request body tags: - - Models - x-speakeasy-name-override: list - /models/{author}/{slug}/endpoints: - get: - operationId: listEndpoints + - Presets + /presets/{slug}/messages: + post: + description: >- + Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. `messages`, `stream`, `prompt`) are silently ignored. + operationId: createPresetsMessages parameters: - - description: The author/organization of the model - in: path - name: author - required: true - schema: - description: The author/organization of the model - example: openai - type: string - - description: The model slug + - description: URL-safe slug identifying the preset. Created if it does not exist. in: path name: slug required: true schema: - description: The model slug - example: gpt-4 + description: URL-safe slug identifying the preset. Created if it does not exist. + example: my-preset + minLength: 1 type: string + requestBody: + content: + application/json: + example: + max_tokens: 1024 + messages: + - content: Hello! + role: user + model: anthropic/claude-4.6-sonnet + system: You are a helpful assistant. + schema: + $ref: '#/components/schemas/MessagesRequest' + required: true responses: '200': content: application/json: example: data: - architecture: - input_modalities: - - text - instruct_type: chatml - modality: text->text - output_modalities: - - text - tokenizer: GPT - created: 1692901234 - description: GPT-4 is a large multimodal model. - endpoints: [] - id: openai/gpt-4 - name: GPT-4 + created_at: '2026-04-20T10:00:00Z' + creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 + description: null + designated_version: + config: + max_tokens: 1024 + model: anthropic/claude-4.6-sonnet + created_at: '2026-04-20T10:00:00Z' + creator_id: user_2dHFtVWx2n56w6HkM0000000000 + id: 550e8400-e29b-41d4-a716-446655440000 + preset_id: 650e8400-e29b-41d4-a716-446655440001 + system_prompt: You are a helpful assistant. + updated_at: '2026-04-20T10:00:00Z' + version: 1 + designated_version_id: 550e8400-e29b-41d4-a716-446655440000 + id: 650e8400-e29b-41d4-a716-446655440001 + name: my-preset + slug: my-preset + status: active + status_updated_at: null + updated_at: '2026-04-20T10:00:00Z' + workspace_id: 750e8400-e29b-41d4-a716-446655440002 + schema: + $ref: '#/components/schemas/CreatePresetFromInferenceResponse' + description: Preset created or updated successfully. + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters schema: - example: - data: - architecture: - input_modalities: - - text - instruct_type: chatml - modality: text->text - output_modalities: - - text - tokenizer: GPT - created: 1692901234 - description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. - endpoints: - - context_length: 8192 - latency_last_30m: - p50: 0.25 - p75: 0.35 - p90: 0.48 - p99: 0.85 - max_completion_tokens: 4096 - max_prompt_tokens: 8192 - model_id: openai/gpt-4 - model_name: GPT-4 - name: 'OpenAI: GPT-4' - pricing: - completion: '0.00006' - image: '0' - prompt: '0.00003' - request: '0' - provider_name: OpenAI - quantization: fp16 - status: default - supported_parameters: - - temperature - - top_p - - max_tokens - supports_implicit_caching: true - tag: openai - throughput_last_30m: - p50: 45.2 - p75: 38.5 - p90: 28.3 - p99: 15.1 - uptime_last_1d: 99.8 - uptime_last_30m: 99.5 - uptime_last_5m: 100 - id: openai/gpt-4 - name: GPT-4 - properties: - data: - $ref: '#/components/schemas/ListEndpointsResponse' - required: - - data - type: object - description: Returns a list of endpoints + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '403': + content: + application/json: + example: + error: + code: 403 + message: Only management keys can perform this operation + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: Forbidden - Authentication successful but insufficient permissions '404': content: application/json: @@ -19323,6 +29673,16 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: Not Found - Resource does not exist + '409': + content: + application/json: + example: + error: + code: 409 + message: Resource conflict. Please try again later. + schema: + $ref: '#/components/schemas/ConflictResponse' + description: Conflict - Resource conflict or concurrent modification '500': content: application/json: @@ -19333,34 +29693,66 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: List all endpoints for a model + security: + - apiKey: [] + summary: Create a preset from a messages request body tags: - - Endpoints - x-speakeasy-name-override: list - /models/count: - get: - operationId: listModelsCount + - Presets + /presets/{slug}/responses: + post: + description: >- + Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. `messages`, `stream`, `prompt`) are silently ignored. + operationId: createPresetsResponses parameters: - - description: >- - Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". - in: query - name: output_modalities - required: false + - description: URL-safe slug identifying the preset. Created if it does not exist. + in: path + name: slug + required: true schema: - description: >- - Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". - example: text + description: URL-safe slug identifying the preset. Created if it does not exist. + example: my-preset + minLength: 1 type: string + requestBody: + content: + application/json: + example: + input: Hello! + instructions: You are a helpful assistant. + model: openai/gpt-5.4 + schema: + $ref: '#/components/schemas/ResponsesRequest' + required: true responses: '200': content: application/json: example: data: - count: 150 - schema: - $ref: '#/components/schemas/ModelsCountResponse' - description: Returns the total count of available models + created_at: '2026-04-20T10:00:00Z' + creator_user_id: user_2dHFtVWx2n56w6HkM0000000000 + description: null + designated_version: + config: + model: openai/gpt-5.4 + created_at: '2026-04-20T10:00:00Z' + creator_id: user_2dHFtVWx2n56w6HkM0000000000 + id: 550e8400-e29b-41d4-a716-446655440000 + preset_id: 650e8400-e29b-41d4-a716-446655440001 + system_prompt: You are a helpful assistant. + updated_at: '2026-04-20T10:00:00Z' + version: 1 + designated_version_id: 550e8400-e29b-41d4-a716-446655440000 + id: 650e8400-e29b-41d4-a716-446655440001 + name: my-preset + slug: my-preset + status: active + status_updated_at: null + updated_at: '2026-04-20T10:00:00Z' + workspace_id: 750e8400-e29b-41d4-a716-446655440002 + schema: + $ref: '#/components/schemas/CreatePresetFromInferenceResponse' + description: Preset created or updated successfully. '400': content: application/json: @@ -19371,67 +29763,6 @@ paths: schema: $ref: '#/components/schemas/BadRequestResponse' description: Bad Request - Invalid request parameters or malformed input - '500': - content: - application/json: - example: - error: - code: 500 - message: Internal Server Error - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: Internal Server Error - Unexpected server error - summary: Get total count of available models - tags: - - Models - x-speakeasy-name-override: count - /models/user: - get: - description: >- - List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through `eu.openrouter.ai/api/v1/...` the results will be filtered to models that satisfy [EU in-region routing](https://openrouter.ai/docs/guides/privacy/provider-logging#enterprise-eu-in-region-routing). - operationId: listModelsUser - responses: - '200': - content: - application/json: - example: - data: - - architecture: - input_modalities: - - text - instruct_type: chatml - modality: text->text - output_modalities: - - text - tokenizer: GPT - canonical_slug: openai/gpt-4 - context_length: 8192 - created: 1692901234 - default_parameters: null - description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. - expiration_date: null - id: openai/gpt-4 - knowledge_cutoff: null - links: - details: /api/v1/models/openai/gpt-5.4/endpoints - name: GPT-4 - per_request_limits: null - pricing: - completion: '0.00006' - image: '0' - prompt: '0.00003' - request: '0' - supported_parameters: - - temperature - - top_p - - max_tokens - top_provider: - context_length: 8192 - is_moderated: true - max_completion_tokens: 4096 - schema: - $ref: '#/components/schemas/ModelsListResponse' - description: Returns a list of models filtered by user provider preferences '401': content: application/json: @@ -19442,6 +29773,16 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: Unauthorized - Authentication required or invalid credentials + '403': + content: + application/json: + example: + error: + code: 403 + message: Only management keys can perform this operation + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: Forbidden - Authentication successful but insufficient permissions '404': content: application/json: @@ -19452,6 +29793,16 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: Not Found - Resource does not exist + '409': + content: + application/json: + example: + error: + code: 409 + message: Resource conflict. Please try again later. + schema: + $ref: '#/components/schemas/ConflictResponse' + description: Conflict - Resource conflict or concurrent modification '500': content: application/json: @@ -19463,17 +29814,24 @@ paths: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error security: - - bearer: [] - summary: List models filtered by user provider preferences, privacy settings, and guardrails + - apiKey: [] + summary: Create a preset from a responses request body tags: - - Models - x-speakeasy-name-override: listForUser - /organization/members: + - Presets + /presets/{slug}/versions: get: - description: >- - List all members of the organization associated with the authenticated management key. [Management key](/docs/guides/overview/auth/management-api-keys) required. - operationId: listOrganizationMembers + description: Lists all versions of a preset, ordered by version number ascending (oldest first). + operationId: listPresetVersions parameters: + - description: URL-safe slug identifying the preset. + in: path + name: slug + required: true + schema: + description: URL-safe slug identifying the preset. + example: my-preset + minLength: 1 + type: string - description: Number of records to skip for pagination in: query name: offset @@ -19500,61 +29858,30 @@ paths: application/json: example: data: - - email: jane.doe@example.com - first_name: Jane - id: user_2dHFtVWx2n56w6HkM0000000000 - last_name: Doe - role: member - total_count: 25 + - config: + model: openai/gpt-4o + temperature: 0.7 + created_at: '2026-04-20T10:00:00Z' + creator_id: user_2dHFtVWx2n56w6HkM0000000000 + id: 550e8400-e29b-41d4-a716-446655440000 + preset_id: 650e8400-e29b-41d4-a716-446655440001 + system_prompt: You are a helpful assistant. + updated_at: '2026-04-20T10:00:00Z' + version: 1 + total_count: 1 schema: - properties: - data: - description: List of organization members - items: - properties: - email: - description: Email address of the member - example: jane.doe@example.com - type: string - first_name: - description: First name of the member - example: Jane - nullable: true - type: string - id: - description: User ID of the organization member - example: user_2dHFtVWx2n56w6HkM0000000000 - type: string - last_name: - description: Last name of the member - example: Doe - nullable: true - type: string - role: - description: Role of the member in the organization - enum: - - org:admin - - org:member - example: org:member - type: string - x-speakeasy-unknown-values: allow - required: - - id - - first_name - - last_name - - email - - role - type: object - type: array - total_count: - description: Total number of members in the organization - example: 25 - type: integer - required: - - data - - total_count - type: object - description: List of organization members + $ref: '#/components/schemas/ListPresetVersionsResponse' + description: Paginated list of preset versions. + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input '401': content: application/json: @@ -19585,10 +29912,12 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: Internal Server Error - Unexpected server error - summary: List organization members + security: + - apiKey: [] + summary: List versions of a preset tags: - - Organization - x-speakeasy-name-override: listMembers + - Presets + x-speakeasy-name-override: listVersions x-speakeasy-pagination: inputs: - in: parameters @@ -19600,6 +29929,94 @@ paths: outputs: results: $.data type: offsetLimit + /presets/{slug}/versions/{version}: + get: + description: Retrieves a specific version of a preset by its slug and version number. + operationId: getPresetVersion + parameters: + - description: URL-safe slug identifying the preset. + in: path + name: slug + required: true + schema: + description: URL-safe slug identifying the preset. + example: my-preset + minLength: 1 + type: string + - description: Version number of the preset. + in: path + name: version + required: true + schema: + description: Version number of the preset. + example: '1' + minLength: 1 + type: string + responses: + '200': + content: + application/json: + example: + data: + config: + model: openai/gpt-4o + temperature: 0.7 + created_at: '2026-04-20T10:00:00Z' + creator_id: user_2dHFtVWx2n56w6HkM0000000000 + id: 550e8400-e29b-41d4-a716-446655440000 + preset_id: 650e8400-e29b-41d4-a716-446655440001 + system_prompt: You are a helpful assistant. + updated_at: '2026-04-20T10:00:00Z' + version: 1 + schema: + $ref: '#/components/schemas/GetPresetVersionResponse' + description: The requested preset version. + '400': + content: + application/json: + example: + error: + code: 400 + message: Invalid request parameters + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: Bad Request - Invalid request parameters or malformed input + '401': + content: + application/json: + example: + error: + code: 401 + message: Missing Authentication header + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: Unauthorized - Authentication required or invalid credentials + '404': + content: + application/json: + example: + error: + code: 404 + message: Resource not found + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: Not Found - Resource does not exist + '500': + content: + application/json: + example: + error: + code: 500 + message: Internal Server Error + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: Internal Server Error - Unexpected server error + security: + - apiKey: [] + summary: Get a specific version of a preset + tags: + - Presets + x-speakeasy-name-override: getVersion /providers: get: operationId: listProviders @@ -20226,12 +30643,30 @@ paths: top_n: 3 properties: documents: - description: The list of documents to rerank + description: >- + The list of documents to rerank. Documents may be plain strings, or structured objects with `text` and/or `image` for multimodal models. example: - Paris is the capital of France. - Berlin is the capital of Germany. items: - type: string + anyOf: + - type: string + - description: >- + A structured document with optional text and/or image content. At least one of `text` or `image` must be provided. + properties: + image: + description: >- + An image associated with the document, as a remote URL (http/https) or a base64-encoded data URI (data:image/...). + example: https://upload.wikimedia.org/wikipedia/commons/thumb/8/8b/Phytogenic.png + type: string + text: + description: The document text + example: AI enables robots to perceive, plan, and act autonomously. + type: string + type: object + description: >- + A document to rerank. Either a plain string, or a structured object with optional `text` and/or `image`. + minItems: 1 type: array model: description: The rerank model to use @@ -20302,14 +30737,16 @@ paths: relevance_score: 0.98 properties: document: - description: The document object containing the original text + description: The document object echoing the original input (text and/or image) properties: + image: + description: The image (URL or data URI) from the original document + example: https://example.com/image.png + type: string text: description: The document text example: Paris is the capital of France. type: string - required: - - text type: object index: description: Index of the document in the original input list @@ -20465,6 +30902,15 @@ paths: post: description: Creates a streaming or non-streaming response using OpenResponses API format operationId: createResponses + parameters: + - description: >- + Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. + example: enabled + in: header + name: X-OpenRouter-Metadata + required: false + schema: + $ref: '#/components/schemas/MetadataLevel' requestBody: content: application/json: @@ -20502,12 +30948,7 @@ paths: delta: Hello type: response.output_text.delta schema: - properties: - data: - $ref: '#/components/schemas/StreamEvents' - required: - - data - type: object + $ref: '#/components/schemas/ResponsesStreamingResponse' x-speakeasy-sse-sentinel: '[DONE]' description: Successful response '400': @@ -20540,6 +30981,55 @@ paths: schema: $ref: '#/components/schemas/PaymentRequiredResponse' description: Payment Required - Insufficient credits or quota to complete request + '403': + content: + application/json: + examples: + guardrail-blocked: + summary: Guardrail blocked the request + value: + error: + code: 403 + message: 'Request blocked: prompt injection patterns detected' + metadata: + patterns: + - ignore all previous instructions + openrouter_metadata: + attempt: 1 + endpoints: + available: + - model: openai/gpt-4o + provider: OpenAI + selected: false + total: 1 + is_byok: false + pipeline: + - data: + action: blocked + detected: true + engines: + - regex + patterns: + - ignore all previous instructions + guardrail_id: grd_abc123 + guardrail_scope: api-key + name: regex_pi_detection + summary: 'Blocked: prompt injection detected (1 pattern matched)' + type: guardrail + region: iad + requested: openai/gpt-4o + strategy: direct + summary: available=1 + insufficient-permissions: + summary: Insufficient permissions + value: + error: + code: 403 + message: Only management keys can perform this operation + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: >- + Forbidden - Authentication successful but insufficient permissions, or a guardrail blocked the request. When guardrails block and the `X-OpenRouter-Metadata: enabled` header is present, the response includes `openrouter_metadata` with full routing context and a `pipeline` array containing guardrail stage details. '404': content: application/json: @@ -20757,7 +31247,7 @@ paths: generation_id: gen-xyz789 id: job-abc123 polling_url: /api/v1/videos/job-abc123 - status: complete + status: completed unsigned_urls: - https://storage.example.com/video.mp4 usage: @@ -20979,6 +31469,8 @@ paths: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false @@ -21054,6 +31546,8 @@ paths: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false @@ -21211,6 +31705,8 @@ paths: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false @@ -21290,6 +31786,8 @@ paths: default_text_model: openai/gpt-4o description: Production environment workspace id: 550e8400-e29b-41d4-a716-446655440000 + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 is_data_discount_logging_enabled: true is_observability_broadcast_enabled: false is_observability_io_logging_enabled: false @@ -21548,14 +32046,20 @@ tags: name: Analytics - description: Anthropic Messages endpoints name: Anthropic Messages + - description: BYOK endpoints + name: BYOK - description: Chat completion endpoints name: Chat - description: Credit management endpoints name: Credits + - description: Datasets endpoints + name: Datasets - description: Text embedding endpoints name: Embeddings - description: Endpoint information name: Endpoints + - description: Files endpoints + name: Files - description: Generation history endpoints name: Generations - description: Guardrails endpoints @@ -21564,21 +32068,30 @@ tags: name: Models - description: OAuth authentication endpoints name: OAuth + - description: Observability endpoints + name: Observability - description: Organization endpoints name: Organization + - description: Presets endpoints + name: Presets - description: Provider information endpoints name: Providers - description: Rerank endpoints name: Rerank + - description: Speech-to-text endpoints + name: STT + x-displayName: Transcriptions - description: Text-to-speech endpoints name: TTS + x-displayName: Speech - description: Video Generation endpoints name: Video Generation - description: Workspaces endpoints name: Workspaces + - description: beta.Analytics endpoints + name: beta.Analytics - description: beta.responses endpoints name: beta.responses -x-fern-base-path: / x-retry-strategy: initialDelay: 500 maxAttempts: 3 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index c862378b..4a071506 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.761.1 +speakeasyVersion: 1.778.0 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:fbc0818f9ff51ea0161e1bdd89c483841b410d57e346e549330b671a492b90ce - sourceBlobDigest: sha256:902ea3853462ba9229fdf45bc57a2c1cecff82d9480e25975c6ad92604ff09cb + sourceRevisionDigest: sha256:f86ec5826e5979caeb7d63b95605c7f3d04a89ba87865fd1e842b97cc1b050f7 + sourceBlobDigest: sha256:9d3070733f3d96784a38b93bbd2efd93f091738828ef3f9c306caf987a39b9ba tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:fbc0818f9ff51ea0161e1bdd89c483841b410d57e346e549330b671a492b90ce - sourceBlobDigest: sha256:902ea3853462ba9229fdf45bc57a2c1cecff82d9480e25975c6ad92604ff09cb + sourceRevisionDigest: sha256:f86ec5826e5979caeb7d63b95605c7f3d04a89ba87865fd1e842b97cc1b050f7 + sourceBlobDigest: sha256:9d3070733f3d96784a38b93bbd2efd93f091738828ef3f9c306caf987a39b9ba codeSamplesNamespace: open-router-chat-completions-api-go-code-samples - codeSamplesRevisionDigest: sha256:170dac435c3295a1c8b0fedef9f0af6389be4df068ae24157a154bfb2c447774 + codeSamplesRevisionDigest: sha256:ee3cbebfde57eae967da0aed27919ff5dea440d30c0638f1c608f1491550dc19 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.761.1 diff --git a/README.md b/README.md index b3eb9f42..61673ac3 100644 --- a/README.md +++ b/README.md @@ -173,10 +173,23 @@ func main() { * [Get](docs/sdks/apikeys/README.md#get) - Get a single API key * [Update](docs/sdks/apikeys/README.md#update) - Update an API key +### [Beta.Analytics](docs/sdks/betaanalytics/README.md) + +* [GetAnalyticsMeta](docs/sdks/betaanalytics/README.md#getanalyticsmeta) - Get available analytics metrics and dimensions +* [QueryAnalytics](docs/sdks/betaanalytics/README.md#queryanalytics) - Query analytics data + ### [Beta.Responses](docs/sdks/responses/README.md) * [Send](docs/sdks/responses/README.md#send) - Create a response +### [Byok](docs/sdks/byok/README.md) + +* [List](docs/sdks/byok/README.md#list) - List BYOK provider credentials +* [Create](docs/sdks/byok/README.md#create) - Create a BYOK provider credential +* [Delete](docs/sdks/byok/README.md#delete) - Delete a BYOK provider credential +* [Get](docs/sdks/byok/README.md#get) - Get a BYOK provider credential +* [Update](docs/sdks/byok/README.md#update) - Update a BYOK provider credential + ### [Chat](docs/sdks/chat/README.md) * [Send](docs/sdks/chat/README.md#send) - Create a chat completion @@ -185,6 +198,13 @@ func main() { * [GetCredits](docs/sdks/credits/README.md#getcredits) - Get remaining credits +### [Datasets](docs/sdks/datasets/README.md) + +* [GetAppRankings](docs/sdks/datasets/README.md#getapprankings) - Top apps by token usage +* [GetBenchmarksArtificialAnalysis](docs/sdks/datasets/README.md#getbenchmarksartificialanalysis) - Artificial Analysis Benchmark Indices +* [GetBenchmarksDesignArena](docs/sdks/datasets/README.md#getbenchmarksdesignarena) - Design Arena Benchmark Rankings +* [GetRankingsDaily](docs/sdks/datasets/README.md#getrankingsdaily) - Daily token totals for top 50 models + ### [Embeddings](docs/sdks/embeddings/README.md) * [Generate](docs/sdks/embeddings/README.md#generate) - Submit an embedding request @@ -195,6 +215,14 @@ func main() { * [ListZdrEndpoints](docs/sdks/endpoints/README.md#listzdrendpoints) - Preview the impact of ZDR on the available endpoints * [List](docs/sdks/endpoints/README.md#list) - List all endpoints for a model +### [Files](docs/sdks/files/README.md) + +* [List](docs/sdks/files/README.md#list) - List files +* [Upload](docs/sdks/files/README.md#upload) - Upload a file +* [Delete](docs/sdks/files/README.md#delete) - Delete a file +* [Retrieve](docs/sdks/files/README.md#retrieve) - Get file metadata +* [Download](docs/sdks/files/README.md#download) - Download file content + ### [Generations](docs/sdks/generations/README.md) * [GetGeneration](docs/sdks/generations/README.md#getgeneration) - Get request & usage metadata for a generation @@ -218,6 +246,7 @@ func main() { ### [Models](docs/sdks/models/README.md) +* [Get](docs/sdks/models/README.md#get) - Get a model by its slug * [List](docs/sdks/models/README.md#list) - List all models and their properties * [Count](docs/sdks/models/README.md#count) - Get total count of available models * [ListForUser](docs/sdks/models/README.md#listforuser) - List models filtered by user provider preferences, privacy settings, and guardrails @@ -227,10 +256,28 @@ func main() { * [ExchangeAuthCodeForAPIKey](docs/sdks/oauth/README.md#exchangeauthcodeforapikey) - Exchange authorization code for API key * [CreateAuthCode](docs/sdks/oauth/README.md#createauthcode) - Create authorization code +### [Observability](docs/sdks/observability/README.md) + +* [List](docs/sdks/observability/README.md#list) - List observability destinations +* [Create](docs/sdks/observability/README.md#create) - Create an observability destination +* [Delete](docs/sdks/observability/README.md#delete) - Delete an observability destination +* [Get](docs/sdks/observability/README.md#get) - Get an observability destination +* [Update](docs/sdks/observability/README.md#update) - Update an observability destination + ### [Organization](docs/sdks/organization/README.md) * [ListMembers](docs/sdks/organization/README.md#listmembers) - List organization members +### [Presets](docs/sdks/presets/README.md) + +* [List](docs/sdks/presets/README.md#list) - List presets +* [Get](docs/sdks/presets/README.md#get) - Get a preset +* [CreatePresetsChatCompletions](docs/sdks/presets/README.md#createpresetschatcompletions) - Create a preset from a chat-completions request body +* [CreatePresetsMessages](docs/sdks/presets/README.md#createpresetsmessages) - Create a preset from a messages request body +* [CreatePresetsResponses](docs/sdks/presets/README.md#createpresetsresponses) - Create a preset from a responses request body +* [ListVersions](docs/sdks/presets/README.md#listversions) - List versions of a preset +* [GetVersion](docs/sdks/presets/README.md#getversion) - Get a specific version of a preset + ### [Providers](docs/sdks/providers/README.md) * [List](docs/sdks/providers/README.md#list) - List all providers @@ -239,6 +286,10 @@ func main() { * [Rerank](docs/sdks/rerank/README.md#rerank) - Submit a rerank request +### [Stt](docs/sdks/stt/README.md) + +* [CreateTranscription](docs/sdks/stt/README.md#createtranscription) - Create transcription + ### [Tts](docs/sdks/tts/README.md) * [CreateSpeech](docs/sdks/tts/README.md#createspeech) - Create speech @@ -279,7 +330,6 @@ import ( "context" openrouter "github.com/OpenRouterTeam/go-sdk" "github.com/OpenRouterTeam/go-sdk/models/components" - "github.com/OpenRouterTeam/go-sdk/optionalnullable" "log" "os" ) @@ -291,37 +341,20 @@ func main() { openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), ) - res, err := s.Chat.Send(ctx, components.ChatRequest{ - MaxTokens: optionalnullable.From(openrouter.Pointer[int64](150)), - Messages: []components.ChatMessages{ - components.CreateChatMessagesSystem( - components.ChatSystemMessage{ - Content: components.CreateChatSystemMessageContentStr( - "You are a helpful assistant.", - ), - Role: components.ChatSystemMessageRoleSystem, - }, - ), - components.CreateChatMessagesUser( - components.ChatUserMessage{ - Content: components.CreateChatUserMessageContentStr( - "What is the capital of France?", - ), - Role: components.ChatUserMessageRoleUser, - }, - ), - }, - Model: openrouter.Pointer("openai/gpt-4"), - Temperature: optionalnullable.From(openrouter.Pointer[float64](0.7)), - }) + res, err := s.Beta.Responses.Send(ctx, components.ResponsesRequest{ + Input: openrouter.Pointer(components.CreateInputsUnionStr( + "Tell me a joke", + )), + Model: openrouter.Pointer("openai/gpt-4o"), + }, components.MetadataLevelEnabled.ToPointer()) if err != nil { log.Fatal(err) } if res != nil { - defer res.Object.Close() + defer res.ResponsesStreamingResponse.Close() - for res.Object.Next() { - event := res.Object.Value() + for res.ResponsesStreamingResponse.Next() { + event := res.ResponsesStreamingResponse.Value() log.Print(event) // Handle the event } @@ -359,7 +392,7 @@ func main() { openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), ) - res, err := s.Guardrails.List(ctx, optionalnullable.From[int64](nil), nil, nil) + res, err := s.Byok.List(ctx, optionalnullable.From[int64](nil), nil, nil, nil) if err != nil { log.Fatal(err) } diff --git a/RELEASES.md b/RELEASES.md index 84ec546e..d6ee140e 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -38,4 +38,14 @@ Based on: ### Generated - [go v0.4.1] . ### Releases -- [Go v0.4.1] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.4.1 - . \ No newline at end of file +- [Go v0.4.1] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.4.1 - . + +## 2026-06-15 16:30:09 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.778.0 (2.904.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.5.0] . +### Releases +- [Go v0.5.0] https://github.com/OpenRouterTeam/go-sdk/releases/tag/v0.5.0 - . \ No newline at end of file diff --git a/analytics.go b/analytics.go index 7f93a20a..57da7c77 100644 --- a/analytics.go +++ b/analytics.go @@ -186,7 +186,7 @@ func (s *Analytics) GetUserActivity(ctx context.Context, date *string, apiKeyHas _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/apikeys.go b/apikeys.go index b8731fd1..8195bc8c 100644 --- a/apikeys.go +++ b/apikeys.go @@ -176,7 +176,7 @@ func (s *APIKeys) GetCurrentKeyMetadata(ctx context.Context, opts ...operations. _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"401", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -433,7 +433,7 @@ func (s *APIKeys) List(ctx context.Context, includeDisabled *bool, offset option _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"401", "429", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -708,7 +708,7 @@ func (s *APIKeys) Create(ctx context.Context, request operations.CreateKeysReque _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "429", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1022,7 +1022,7 @@ func (s *APIKeys) Delete(ctx context.Context, hash string, opts ...operations.Op _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"401", "404", "429", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1315,7 +1315,7 @@ func (s *APIKeys) Get(ctx context.Context, hash string, opts ...operations.Optio _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"401", "404", "429", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1616,7 +1616,7 @@ func (s *APIKeys) Update(ctx context.Context, hash string, requestBody operation _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "404", "429", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/beta.go b/beta.go index cf3cf427..cb62d236 100644 --- a/beta.go +++ b/beta.go @@ -8,6 +8,8 @@ import ( ) type Beta struct { + // beta.Analytics endpoints + Analytics *BetaAnalytics // beta.responses endpoints Responses *Responses @@ -21,6 +23,7 @@ func newBeta(rootSDK *OpenRouter, sdkConfig config.SDKConfiguration, hooks *hook rootSDK: rootSDK, sdkConfiguration: sdkConfig, hooks: hooks, + Analytics: newBetaAnalytics(rootSDK, sdkConfig, hooks), Responses: newResponses(rootSDK, sdkConfig, hooks), } } diff --git a/betaanalytics.go b/betaanalytics.go new file mode 100644 index 00000000..c48c63a6 --- /dev/null +++ b/betaanalytics.go @@ -0,0 +1,617 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package openrouter + +import ( + "bytes" + "context" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/config" + "github.com/OpenRouterTeam/go-sdk/internal/hooks" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/models/operations" + "github.com/OpenRouterTeam/go-sdk/models/sdkerrors" + "github.com/OpenRouterTeam/go-sdk/retry" + "net/http" + "net/url" +) + +// BetaAnalytics - beta.Analytics endpoints +type BetaAnalytics struct { + rootSDK *OpenRouter + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newBetaAnalytics(rootSDK *OpenRouter, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *BetaAnalytics { + return &BetaAnalytics{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// GetAnalyticsMeta - Get available analytics metrics and dimensions +// Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required. +func (s *BetaAnalytics) GetAnalyticsMeta(ctx context.Context, opts ...operations.Option) (*operations.GetAnalyticsMetaResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/analytics/meta") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getAnalyticsMeta", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.GetAnalyticsMetaResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 403: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.ForbiddenResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} + +// QueryAnalytics - Query analytics data +// Execute an analytics query with specified metrics, dimensions, filters, and time range. [Management key](/docs/guides/overview/auth/management-api-keys) required. +func (s *BetaAnalytics) QueryAnalytics(ctx context.Context, request operations.QueryAnalyticsRequest, opts ...operations.Option) (*operations.QueryAnalyticsResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/analytics/query") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "queryAnalytics", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out operations.QueryAnalyticsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.BadRequestResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 403: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.ForbiddenResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 408: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.RequestTimeoutResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} diff --git a/byok.go b/byok.go new file mode 100644 index 00000000..9870c83f --- /dev/null +++ b/byok.go @@ -0,0 +1,1484 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package openrouter + +import ( + "bytes" + "context" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/config" + "github.com/OpenRouterTeam/go-sdk/internal/hooks" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/models/components" + "github.com/OpenRouterTeam/go-sdk/models/operations" + "github.com/OpenRouterTeam/go-sdk/models/sdkerrors" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" + "github.com/OpenRouterTeam/go-sdk/retry" + "github.com/spyzhov/ajson" + "net/http" + "net/url" +) + +// Byok - BYOK endpoints +type Byok struct { + rootSDK *OpenRouter + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newByok(rootSDK *OpenRouter, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Byok { + return &Byok{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// List BYOK provider credentials +// List the bring-your-own-key (BYOK) provider credentials for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace, or the `provider` query parameter to filter by upstream provider. [Management key](/docs/guides/overview/auth/management-api-keys) required. +func (s *Byok) List(ctx context.Context, offset optionalnullable.OptionalNullable[int64], limit *int64, workspaceID *string, provider *operations.Provider, opts ...operations.Option) (*operations.ListBYOKKeysResponse, error) { + request := operations.ListBYOKKeysRequest{ + Offset: offset, + Limit: limit, + WorkspaceID: workspaceID, + Provider: provider, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/byok") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "listBYOKKeys", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListBYOKKeysResponse{} + res.Next = func() (*operations.ListBYOKKeysResponse, error) { + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + b, err := ajson.Unmarshal(rawBody) + if err != nil { + return nil, err + } + + oS := 0 + if offsetVal, ok := offset.Get(); ok && offsetVal != nil { + oS = int(*offsetVal) + } + r, err := ajson.Eval(b, "$.data") + if err != nil { + return nil, err + } + if !r.IsArray() { + return nil, nil + } + arr, err := r.GetArray() + if err != nil { + return nil, err + } + if len(arr) == 0 { + return nil, nil + } + + l := 0 + if limit != nil { + l = int(*limit) + } + if len(arr) < l { + return nil, nil + } + nOS := int64(oS + len(arr)) + + return s.List( + ctx, + optionalnullable.From(&nOS), + limit, + workspaceID, + provider, + opts..., + ) + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.ListBYOKKeysResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Result = out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Create a BYOK provider credential +// Create a new bring-your-own-key (BYOK) provider credential. The raw key is encrypted at rest and never returned in API responses. Defaults to the authenticated entity's default workspace; use the `workspace_id` body field to scope to a different workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required. +func (s *Byok) Create(ctx context.Context, request components.CreateBYOKKeyRequest, opts ...operations.Option) (*components.CreateBYOKKeyResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/byok") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "createBYOKKey", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 201: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.CreateBYOKKeyResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.BadRequestResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 403: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.ForbiddenResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} + +// Delete a BYOK provider credential +// Delete (soft-delete) a bring-your-own-key (BYOK) provider credential by its `id`. The encrypted key material is wiped and the record is marked as deleted. [Management key](/docs/guides/overview/auth/management-api-keys) required. +func (s *Byok) Delete(ctx context.Context, id string, opts ...operations.Option) (*components.DeleteBYOKKeyResponse, error) { + request := operations.DeleteBYOKKeyRequest{ + ID: id, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/byok/{id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteBYOKKey", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.DeleteBYOKKeyResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.NotFoundResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} + +// Get a BYOK provider credential +// Get a single bring-your-own-key (BYOK) provider credential by its `id`. [Management key](/docs/guides/overview/auth/management-api-keys) required. +func (s *Byok) Get(ctx context.Context, id string, opts ...operations.Option) (*components.GetBYOKKeyResponse, error) { + request := operations.GetBYOKKeyRequest{ + ID: id, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/byok/{id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getBYOKKey", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.GetBYOKKeyResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.NotFoundResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} + +// Update a BYOK provider credential +// Update an existing bring-your-own-key (BYOK) provider credential by its `id`. Include the `key` field to rotate the raw provider API key in-place (the previous key material is overwritten). [Management key](/docs/guides/overview/auth/management-api-keys) required. +func (s *Byok) Update(ctx context.Context, id string, updateBYOKKeyRequest components.UpdateBYOKKeyRequest, opts ...operations.Option) (*components.UpdateBYOKKeyResponse, error) { + request := operations.UpdateBYOKKeyRequest{ + ID: id, + UpdateBYOKKeyRequest: updateBYOKKeyRequest, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/byok/{id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "updateBYOKKey", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "UpdateBYOKKeyRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PATCH", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.UpdateBYOKKeyResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.BadRequestResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.NotFoundResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} diff --git a/chat.go b/chat.go index 8a427a76..fedc9b46 100644 --- a/chat.go +++ b/chat.go @@ -34,7 +34,12 @@ func newChat(rootSDK *OpenRouter, sdkConfig config.SDKConfiguration, hooks *hook // Send - Create a chat completion // Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes. -func (s *Chat) Send(ctx context.Context, request components.ChatRequest, opts ...operations.Option) (*operations.SendChatCompletionRequestResponse, error) { +func (s *Chat) Send(ctx context.Context, chatRequest components.ChatRequest, xOpenRouterMetadata *components.MetadataLevel, opts ...operations.Option) (*operations.SendChatCompletionRequestResponse, error) { + request := operations.SendChatCompletionRequestRequest{ + ChatRequest: chatRequest, + XOpenRouterMetadata: xOpenRouterMetadata, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -68,7 +73,7 @@ func (s *Chat) Send(ctx context.Context, request components.ChatRequest, opts .. OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "ChatRequest", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err } @@ -99,6 +104,8 @@ func (s *Chat) Send(ctx context.Context, request components.ChatRequest, opts .. req.Header.Set("Content-Type", reqContentType) } + utils.PopulateHeaders(ctx, req, request, nil) + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err } @@ -189,7 +196,7 @@ func (s *Chat) Send(ctx context.Context, request components.ChatRequest, opts .. _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "402", "404", "408", "413", "422", "429", "4XX", "500", "502", "503", "524", "529", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -221,10 +228,10 @@ func (s *Chat) Send(ctx context.Context, request components.ChatRequest, opts .. result := operations.CreateSendChatCompletionRequestResponseChatResult(out) return &result, nil case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `text/event-stream`): - out := stream.NewEventStream(ctx, httpRes.Body, func(se []byte) (operations.SendChatCompletionRequestResponseBody, error) { - var e operations.SendChatCompletionRequestResponseBody + out := stream.NewEventStream(ctx, httpRes.Body, func(se []byte) (components.ChatStreamingResponse, error) { + var e components.ChatStreamingResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(se), &e, ""); err != nil { - return operations.SendChatCompletionRequestResponseBody{}, err + return components.ChatStreamingResponse{}, err } return e, nil }, "[DONE]") @@ -292,6 +299,27 @@ func (s *Chat) Send(ctx context.Context, request components.ChatRequest, opts .. return nil, err } + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 403: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.ForbiddenResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + return nil, &out default: rawBody, err := utils.ConsumeRawBody(httpRes) diff --git a/credits.go b/credits.go index 7d475479..cf99d6c5 100644 --- a/credits.go +++ b/credits.go @@ -175,7 +175,7 @@ func (s *Credits) GetCredits(ctx context.Context, opts ...operations.Option) (*o _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"401", "403", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/datasets.go b/datasets.go new file mode 100644 index 00000000..bc499300 --- /dev/null +++ b/datasets.go @@ -0,0 +1,1310 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package openrouter + +import ( + "bytes" + "context" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/config" + "github.com/OpenRouterTeam/go-sdk/internal/hooks" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/models/components" + "github.com/OpenRouterTeam/go-sdk/models/operations" + "github.com/OpenRouterTeam/go-sdk/models/sdkerrors" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" + "github.com/OpenRouterTeam/go-sdk/retry" + "github.com/spyzhov/ajson" + "net/http" + "net/url" +) + +// Datasets endpoints +type Datasets struct { + rootSDK *OpenRouter + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newDatasets(rootSDK *OpenRouter, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Datasets { + return &Datasets{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// GetAppRankings - Top apps by token usage +// Returns the top public apps on OpenRouter ranked by token usage inside the requested +// date window, matching the public apps marketplace on openrouter.ai/apps. Token totals +// are `prompt_tokens + completion_tokens`; hidden and private apps are excluded and +// traffic from related app aliases is merged into the canonical visible app. +// +// `sort=popular` (default) ranks by total token volume inside the window. +// `sort=trending` ranks by absolute excess token growth: window volume minus the average +// volume of the three equal-length periods immediately preceding the window. Apps with +// no excess growth are omitted, so `trending` may return fewer than `limit` rows. +// +// Filter with `category` (marketplace category group, e.g. `coding`) or `subcategory` +// (e.g. `cli-agent`). Ranks are re-numbered 1..N after filtering. Page with `offset` — +// `rank` stays absolute, so the first row of `offset=50` is `rank: 51`. +// +// Authenticate with any valid OpenRouter API key (same key used for inference). +// Rate-limited to 30 requests/minute per key and 500 requests/day per account. +// +// When republishing or quoting this dataset, OpenRouter must be cited as: +// "Source: OpenRouter (openrouter.ai/apps), as of {as_of}." +// +// Token counts come from each upstream provider's own tokenizer, so a token attributed +// to one app is not directly comparable to a token attributed to another app whose +// traffic flows through a different provider. +func (s *Datasets) GetAppRankings(ctx context.Context, request *operations.GetAppRankingsRequest, opts ...operations.Option) (*operations.GetAppRankingsResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/datasets/app-rankings") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getAppRankings", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetAppRankingsResponse{} + res.Next = func() (*operations.GetAppRankingsResponse, error) { + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + b, err := ajson.Unmarshal(rawBody) + if err != nil { + return nil, err + } + + oS := 0 + if offsetVal, ok := request.Offset.Get(); ok && offsetVal != nil { + oS = int(*offsetVal) + } + r, err := ajson.Eval(b, "$.data") + if err != nil { + return nil, err + } + if !r.IsArray() { + return nil, nil + } + arr, err := r.GetArray() + if err != nil { + return nil, err + } + if len(arr) == 0 { + return nil, nil + } + + l := 0 + if request.Limit != nil { + l = int(*request.Limit) + } + if len(arr) < l { + return nil, nil + } + nOS := int64(oS + len(arr)) + request.Offset = optionalnullable.From(&nOS) + + return s.GetAppRankings( + ctx, + request, + opts..., + ) + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.AppRankingsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Result = out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.BadRequestResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.TooManyRequestsResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetBenchmarksArtificialAnalysis - Artificial Analysis Benchmark Indices +// Returns composite index scores (Intelligence, Coding, Agentic) from Artificial Analysis for LLM models. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. +func (s *Datasets) GetBenchmarksArtificialAnalysis(ctx context.Context, maxResults *int64, opts ...operations.Option) (*components.BenchmarksAAResponse, error) { + request := operations.GetBenchmarksArtificialAnalysisRequest{ + MaxResults: maxResults, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/datasets/benchmarks/artificial-analysis") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getBenchmarksArtificialAnalysis", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.BenchmarksAAResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.BadRequestResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.TooManyRequestsResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} + +// GetBenchmarksDesignArena - Design Arena Benchmark Rankings +// Returns ELO ratings from head-to-head arena battles on Design Arena. Filterable by arena (models/builders/agents) and category. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. +func (s *Datasets) GetBenchmarksDesignArena(ctx context.Context, arena *operations.Arena, category *string, maxResults *int64, opts ...operations.Option) (*components.BenchmarksDAResponse, error) { + request := operations.GetBenchmarksDesignArenaRequest{ + Arena: arena, + Category: category, + MaxResults: maxResults, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/datasets/benchmarks/design-arena") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getBenchmarksDesignArena", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.BenchmarksDAResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.BadRequestResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.TooManyRequestsResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} + +// GetRankingsDaily - Daily token totals for top 50 models +// Returns the top 50 public models per day by total token usage on OpenRouter, plus a +// single aggregated `other` row per day that sums every model outside that top 50. +// Token totals are `prompt_tokens + completion_tokens`, matching the public rankings +// chart on openrouter.ai/rankings. +// +// Each row is a distinct `(date, model_permaslug)` pair. The `other` row uses the +// reserved permaslug `other` and is always returned last within its date, so callers +// can compute `top-50 traffic / total daily traffic` without a second request. +// +// Authenticate with any valid OpenRouter API key (same key used for inference). +// Rate-limited to 30 requests/minute per key and 500 requests/day per account. +// +// When republishing or quoting this dataset, OpenRouter must be cited as: +// "Source: OpenRouter (openrouter.ai/rankings), as of {as_of}." +// +// Token counts come from each upstream provider's own tokenizer (Anthropic counts +// are as reported by Anthropic, OpenAI counts are as reported by OpenAI, etc.), so +// a token in one row is not directly comparable to a token in another row from a +// different provider. +func (s *Datasets) GetRankingsDaily(ctx context.Context, startDate *string, endDate *string, opts ...operations.Option) (*components.RankingsDailyResponse, error) { + request := operations.GetRankingsDailyRequest{ + StartDate: startDate, + EndDate: endDate, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/datasets/rankings-daily") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getRankingsDaily", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.RankingsDailyResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.BadRequestResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.TooManyRequestsResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} diff --git a/docs/models/components/aabenchmarkentry.md b/docs/models/components/aabenchmarkentry.md new file mode 100644 index 00000000..9b9f206f --- /dev/null +++ b/docs/models/components/aabenchmarkentry.md @@ -0,0 +1,12 @@ +# AABenchmarkEntry + +Artificial Analysis benchmark index scores. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `AgenticIndex` | `*float64` | :heavy_check_mark: | Artificial Analysis Agentic Index score | 55.8 | +| `CodingIndex` | `*float64` | :heavy_check_mark: | Artificial Analysis Coding Index score | 63.2 | +| `IntelligenceIndex` | `*float64` | :heavy_check_mark: | Artificial Analysis Intelligence Index score | 71.4 | \ No newline at end of file diff --git a/docs/models/components/action.md b/docs/models/components/action.md index 6107db16..58551c6b 100644 --- a/docs/models/components/action.md +++ b/docs/models/components/action.md @@ -3,10 +3,10 @@ ## Supported Types -### ActionSearch +### OutputWebSearchCallItemActionSearch ```go -action := components.CreateActionSearch(components.ActionSearch{/* values here */}) +action := components.CreateActionSearch(components.OutputWebSearchCallItemActionSearch{/* values here */}) ``` ### ActionOpenPage @@ -27,8 +27,8 @@ Use the `Type` field to determine which variant is active, then access the corre ```go switch action.Type { - case components.ActionTypeSearch: - // action.ActionSearch is populated + case components.ActionTypeSearchValue: + // action.OutputWebSearchCallItemActionSearch is populated case components.ActionTypeOpenPage: // action.ActionOpenPage is populated case components.ActionTypeFindInPage: diff --git a/docs/models/components/actiontypesearch.md b/docs/models/components/actiontypesearch.md new file mode 100644 index 00000000..6ecc5ec2 --- /dev/null +++ b/docs/models/components/actiontypesearch.md @@ -0,0 +1,18 @@ +# ActionTypeSearch + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ActionTypeSearchSearch +``` + + +## Values + +| Name | Value | +| ------------------------ | ------------------------ | +| `ActionTypeSearchSearch` | search | \ No newline at end of file diff --git a/docs/models/components/advisornestedtool.md b/docs/models/components/advisornestedtool.md new file mode 100644 index 00000000..e56c00f4 --- /dev/null +++ b/docs/models/components/advisornestedtool.md @@ -0,0 +1,12 @@ +# AdvisorNestedTool + +A tool made available to the advisor sub-agent. Only OpenRouter server tools (e.g. openrouter:web_search) are supported; function tools are rejected because the advisor has no way to execute them. The advisor tool may not list itself. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | +| `Parameters` | map[string]`any` | :heavy_minus_sign: | N/A | | +| `Type` | `string` | :heavy_check_mark: | N/A | | +| `AdditionalProperties` | map[string]`any` | :heavy_minus_sign: | N/A | {
"type": "openrouter:web_search"
} | \ No newline at end of file diff --git a/docs/models/components/advisorreasoning.md b/docs/models/components/advisorreasoning.md new file mode 100644 index 00000000..e8de8b91 --- /dev/null +++ b/docs/models/components/advisorreasoning.md @@ -0,0 +1,11 @@ +# AdvisorReasoning + +Reasoning configuration forwarded to the advisor call. Use this to control reasoning effort and token budget for models that support extended thinking. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `Effort` | [*components.AdvisorReasoningEffort](../../models/components/advisorreasoningeffort.md) | :heavy_minus_sign: | Reasoning effort level for the advisor call. | +| `MaxTokens` | `*int64` | :heavy_minus_sign: | Maximum number of reasoning tokens the advisor may use. | \ No newline at end of file diff --git a/docs/models/components/advisorreasoningeffort.md b/docs/models/components/advisorreasoningeffort.md new file mode 100644 index 00000000..0cae415c --- /dev/null +++ b/docs/models/components/advisorreasoningeffort.md @@ -0,0 +1,28 @@ +# AdvisorReasoningEffort + +Reasoning effort level for the advisor call. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AdvisorReasoningEffortXhigh + +// Open enum: custom values can be created with a direct type cast +custom := components.AdvisorReasoningEffort("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------------- | ------------------------------- | +| `AdvisorReasoningEffortXhigh` | xhigh | +| `AdvisorReasoningEffortHigh` | high | +| `AdvisorReasoningEffortMedium` | medium | +| `AdvisorReasoningEffortLow` | low | +| `AdvisorReasoningEffortMinimal` | minimal | +| `AdvisorReasoningEffortNone` | none | \ No newline at end of file diff --git a/docs/models/components/advisorservertoolconfig.md b/docs/models/components/advisorservertoolconfig.md new file mode 100644 index 00000000..466ab5d8 --- /dev/null +++ b/docs/models/components/advisorservertoolconfig.md @@ -0,0 +1,19 @@ +# AdvisorServerToolConfig + +Configuration for one openrouter:advisor server tool entry. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ForwardTranscript` | `*bool` | :heavy_minus_sign: | When true, the full parent conversation is forwarded to the advisor so it sees the same context the executor does (and the tool-call `prompt`, if given, is appended as a final user turn). When false or omitted, the advisor receives only the `prompt` the executor passes in the tool call. | false | +| `Instructions` | `*string` | :heavy_minus_sign: | System instructions for the advisor sub-agent. When omitted, the advisor responds with no system prompt of its own. | You are a senior staff engineer. Give a focused, decisive plan. | +| `MaxCompletionTokens` | `*int64` | :heavy_minus_sign: | Maximum number of output tokens (including reasoning) the advisor may produce. When omitted, the provider's default applies. | 2048 | +| `MaxToolCalls` | `*int64` | :heavy_minus_sign: | Maximum number of tool-calling steps the advisor sub-agent may take during its agentic loop. Capped at 25. Only relevant when the advisor is given tools. | 5 | +| `Model` | `*string` | :heavy_minus_sign: | Slug of the advisor model to consult (any OpenRouter model). When omitted, the executor can choose it via the tool call's `model` argument; if neither is set, the model from the outer API request is used. The advisor tool itself cannot be the advisor model. | ~anthropic/claude-opus-latest | +| `Name` | `*string` | :heavy_minus_sign: | Optional name for this advisor. The model sees one tool per named advisor (and one default for an unnamed entry). Names must be unique across advisor entries. Letters, digits, spaces, underscores, and dashes; trimmed; 1–64 chars. | reviewer | +| `Reasoning` | [*components.AdvisorReasoning](../../models/components/advisorreasoning.md) | :heavy_minus_sign: | Reasoning configuration forwarded to the advisor call. Use this to control reasoning effort and token budget for models that support extended thinking. | {
"effort": "high"
} | +| `Stream` | `*bool` | :heavy_minus_sign: | When true, the advisor's advice streams incrementally as it is produced. In the Responses API this emits `response.output_text.delta` events targeting the advisor output item; the final `advice` field is still set on the completed item. Has no effect on the Chat Completions API (where the advice arrives only as the final tool result). When false or omitted, the advice arrives only as the final result. | false | +| `Temperature` | `*float64` | :heavy_minus_sign: | Sampling temperature forwarded to the advisor call. When omitted, the provider's default applies. | 0.7 | +| `Tools` | [][components.AdvisorNestedTool](../../models/components/advisornestedtool.md) | :heavy_minus_sign: | Tools the advisor sub-agent may use while forming its advice. The advisor runs as an agentic sub-agent over these tools, then returns its text. Only OpenRouter server tools are supported — function tools are rejected — and the list must not include the advisor tool itself. | | \ No newline at end of file diff --git a/docs/models/components/advisorservertoolopenrouter.md b/docs/models/components/advisorservertoolopenrouter.md new file mode 100644 index 00000000..b60e70f2 --- /dev/null +++ b/docs/models/components/advisorservertoolopenrouter.md @@ -0,0 +1,11 @@ +# AdvisorServerToolOpenRouter + +OpenRouter built-in server tool: consults a higher-intelligence advisor model (any OpenRouter model) for guidance mid-generation and returns its response. The advisor may run as a sub-agent with its own tools. Include multiple entries to offer several named advisors; at most one entry may omit `name` to act as the default advisor. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `Parameters` | [*components.AdvisorServerToolConfig](../../models/components/advisorservertoolconfig.md) | :heavy_minus_sign: | Configuration for one openrouter:advisor server tool entry. | {
"model": "~anthropic/claude-opus-latest",
"name": "reviewer"
} | +| `Type` | [components.AdvisorServerToolOpenRouterType](../../models/components/advisorservertoolopenroutertype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/advisorservertoolopenroutertype.md b/docs/models/components/advisorservertoolopenroutertype.md new file mode 100644 index 00000000..e2d02194 --- /dev/null +++ b/docs/models/components/advisorservertoolopenroutertype.md @@ -0,0 +1,18 @@ +# AdvisorServerToolOpenRouterType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AdvisorServerToolOpenRouterTypeOpenrouterAdvisor +``` + + +## Values + +| Name | Value | +| -------------------------------------------------- | -------------------------------------------------- | +| `AdvisorServerToolOpenRouterTypeOpenrouterAdvisor` | openrouter:advisor | \ No newline at end of file diff --git a/docs/models/components/anthropicallowedcallers.md b/docs/models/components/anthropicallowedcallers.md new file mode 100644 index 00000000..54d5cfe6 --- /dev/null +++ b/docs/models/components/anthropicallowedcallers.md @@ -0,0 +1,23 @@ +# AnthropicAllowedCallers + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicAllowedCallersDirect + +// Open enum: custom values can be created with a direct type cast +custom := components.AnthropicAllowedCallers("custom_value") +``` + + +## Values + +| Name | Value | +| ---------------------------------------------- | ---------------------------------------------- | +| `AnthropicAllowedCallersDirect` | direct | +| `AnthropicAllowedCallersCodeExecution20250825` | code_execution_20250825 | +| `AnthropicAllowedCallersCodeExecution20260120` | code_execution_20260120 | \ No newline at end of file diff --git a/docs/models/components/anthropicbase64imagesource.md b/docs/models/components/anthropicbase64imagesource.md new file mode 100644 index 00000000..6bdc1bf2 --- /dev/null +++ b/docs/models/components/anthropicbase64imagesource.md @@ -0,0 +1,10 @@ +# AnthropicBase64ImageSource + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `Data` | `string` | :heavy_check_mark: | N/A | | +| `MediaType` | [components.AnthropicImageMimeType](../../models/components/anthropicimagemimetype.md) | :heavy_check_mark: | N/A | image/jpeg | +| `Type` | [components.AnthropicBase64ImageSourceType](../../models/components/anthropicbase64imagesourcetype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/anthropicbase64imagesourcetype.md b/docs/models/components/anthropicbase64imagesourcetype.md new file mode 100644 index 00000000..35cd4a4f --- /dev/null +++ b/docs/models/components/anthropicbase64imagesourcetype.md @@ -0,0 +1,18 @@ +# AnthropicBase64ImageSourceType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicBase64ImageSourceTypeBase64 +``` + + +## Values + +| Name | Value | +| -------------------------------------- | -------------------------------------- | +| `AnthropicBase64ImageSourceTypeBase64` | base64 | \ No newline at end of file diff --git a/docs/models/components/anthropicbase64pdfsource.md b/docs/models/components/anthropicbase64pdfsource.md new file mode 100644 index 00000000..38266914 --- /dev/null +++ b/docs/models/components/anthropicbase64pdfsource.md @@ -0,0 +1,10 @@ +# AnthropicBase64PdfSource + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `Data` | `string` | :heavy_check_mark: | N/A | +| `MediaType` | [components.AnthropicBase64PdfSourceMediaType](../../models/components/anthropicbase64pdfsourcemediatype.md) | :heavy_check_mark: | N/A | +| `Type` | [components.AnthropicBase64PdfSourceType](../../models/components/anthropicbase64pdfsourcetype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/anthropicbase64pdfsourcemediatype.md b/docs/models/components/anthropicbase64pdfsourcemediatype.md new file mode 100644 index 00000000..db85d09d --- /dev/null +++ b/docs/models/components/anthropicbase64pdfsourcemediatype.md @@ -0,0 +1,18 @@ +# AnthropicBase64PdfSourceMediaType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicBase64PdfSourceMediaTypeApplicationPdf +``` + + +## Values + +| Name | Value | +| ------------------------------------------------- | ------------------------------------------------- | +| `AnthropicBase64PdfSourceMediaTypeApplicationPdf` | application/pdf | \ No newline at end of file diff --git a/docs/models/components/anthropicbase64pdfsourcetype.md b/docs/models/components/anthropicbase64pdfsourcetype.md new file mode 100644 index 00000000..c510ce5b --- /dev/null +++ b/docs/models/components/anthropicbase64pdfsourcetype.md @@ -0,0 +1,18 @@ +# AnthropicBase64PdfSourceType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicBase64PdfSourceTypeBase64 +``` + + +## Values + +| Name | Value | +| ------------------------------------ | ------------------------------------ | +| `AnthropicBase64PdfSourceTypeBase64` | base64 | \ No newline at end of file diff --git a/docs/models/components/anthropiccachecontroldirective.md b/docs/models/components/anthropiccachecontroldirective.md index 21899272..408b8d2f 100644 --- a/docs/models/components/anthropiccachecontroldirective.md +++ b/docs/models/components/anthropiccachecontroldirective.md @@ -1,6 +1,6 @@ # AnthropicCacheControlDirective -Enable automatic prompt caching. When set, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. +Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. ## Fields diff --git a/docs/models/components/anthropiccitationcharlocationparam.md b/docs/models/components/anthropiccitationcharlocationparam.md new file mode 100644 index 00000000..9faf4a40 --- /dev/null +++ b/docs/models/components/anthropiccitationcharlocationparam.md @@ -0,0 +1,13 @@ +# AnthropicCitationCharLocationParam + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `CitedText` | `string` | :heavy_check_mark: | N/A | +| `DocumentIndex` | `int64` | :heavy_check_mark: | N/A | +| `DocumentTitle` | `*string` | :heavy_check_mark: | N/A | +| `EndCharIndex` | `int64` | :heavy_check_mark: | N/A | +| `StartCharIndex` | `int64` | :heavy_check_mark: | N/A | +| `Type` | [components.AnthropicCitationCharLocationParamType](../../models/components/anthropiccitationcharlocationparamtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/anthropiccitationcharlocationparamtype.md b/docs/models/components/anthropiccitationcharlocationparamtype.md new file mode 100644 index 00000000..c9bb0048 --- /dev/null +++ b/docs/models/components/anthropiccitationcharlocationparamtype.md @@ -0,0 +1,18 @@ +# AnthropicCitationCharLocationParamType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicCitationCharLocationParamTypeCharLocation +``` + + +## Values + +| Name | Value | +| ---------------------------------------------------- | ---------------------------------------------------- | +| `AnthropicCitationCharLocationParamTypeCharLocation` | char_location | \ No newline at end of file diff --git a/docs/models/components/anthropiccitationcontentblocklocationparam.md b/docs/models/components/anthropiccitationcontentblocklocationparam.md new file mode 100644 index 00000000..def35a80 --- /dev/null +++ b/docs/models/components/anthropiccitationcontentblocklocationparam.md @@ -0,0 +1,13 @@ +# AnthropicCitationContentBlockLocationParam + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `CitedText` | `string` | :heavy_check_mark: | N/A | +| `DocumentIndex` | `int64` | :heavy_check_mark: | N/A | +| `DocumentTitle` | `*string` | :heavy_check_mark: | N/A | +| `EndBlockIndex` | `int64` | :heavy_check_mark: | N/A | +| `StartBlockIndex` | `int64` | :heavy_check_mark: | N/A | +| `Type` | [components.AnthropicCitationContentBlockLocationParamType](../../models/components/anthropiccitationcontentblocklocationparamtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/anthropiccitationcontentblocklocationparamtype.md b/docs/models/components/anthropiccitationcontentblocklocationparamtype.md new file mode 100644 index 00000000..9b47c039 --- /dev/null +++ b/docs/models/components/anthropiccitationcontentblocklocationparamtype.md @@ -0,0 +1,18 @@ +# AnthropicCitationContentBlockLocationParamType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicCitationContentBlockLocationParamTypeContentBlockLocation +``` + + +## Values + +| Name | Value | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `AnthropicCitationContentBlockLocationParamTypeContentBlockLocation` | content_block_location | \ No newline at end of file diff --git a/docs/models/components/anthropiccitationpagelocationparam.md b/docs/models/components/anthropiccitationpagelocationparam.md new file mode 100644 index 00000000..812d63a6 --- /dev/null +++ b/docs/models/components/anthropiccitationpagelocationparam.md @@ -0,0 +1,13 @@ +# AnthropicCitationPageLocationParam + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `CitedText` | `string` | :heavy_check_mark: | N/A | +| `DocumentIndex` | `int64` | :heavy_check_mark: | N/A | +| `DocumentTitle` | `*string` | :heavy_check_mark: | N/A | +| `EndPageNumber` | `int64` | :heavy_check_mark: | N/A | +| `StartPageNumber` | `int64` | :heavy_check_mark: | N/A | +| `Type` | [components.AnthropicCitationPageLocationParamType](../../models/components/anthropiccitationpagelocationparamtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/anthropiccitationpagelocationparamtype.md b/docs/models/components/anthropiccitationpagelocationparamtype.md new file mode 100644 index 00000000..4d652afa --- /dev/null +++ b/docs/models/components/anthropiccitationpagelocationparamtype.md @@ -0,0 +1,18 @@ +# AnthropicCitationPageLocationParamType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicCitationPageLocationParamTypePageLocation +``` + + +## Values + +| Name | Value | +| ---------------------------------------------------- | ---------------------------------------------------- | +| `AnthropicCitationPageLocationParamTypePageLocation` | page_location | \ No newline at end of file diff --git a/docs/models/components/anthropiccitationsearchresultlocation.md b/docs/models/components/anthropiccitationsearchresultlocation.md new file mode 100644 index 00000000..f943a65d --- /dev/null +++ b/docs/models/components/anthropiccitationsearchresultlocation.md @@ -0,0 +1,14 @@ +# AnthropicCitationSearchResultLocation + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `CitedText` | `string` | :heavy_check_mark: | N/A | +| `EndBlockIndex` | `int64` | :heavy_check_mark: | N/A | +| `SearchResultIndex` | `int64` | :heavy_check_mark: | N/A | +| `Source` | `string` | :heavy_check_mark: | N/A | +| `StartBlockIndex` | `int64` | :heavy_check_mark: | N/A | +| `Title` | `*string` | :heavy_check_mark: | N/A | +| `Type` | [components.AnthropicCitationSearchResultLocationType](../../models/components/anthropiccitationsearchresultlocationtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/anthropiccitationsearchresultlocationtype.md b/docs/models/components/anthropiccitationsearchresultlocationtype.md new file mode 100644 index 00000000..c25a3739 --- /dev/null +++ b/docs/models/components/anthropiccitationsearchresultlocationtype.md @@ -0,0 +1,18 @@ +# AnthropicCitationSearchResultLocationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicCitationSearchResultLocationTypeSearchResultLocation +``` + + +## Values + +| Name | Value | +| --------------------------------------------------------------- | --------------------------------------------------------------- | +| `AnthropicCitationSearchResultLocationTypeSearchResultLocation` | search_result_location | \ No newline at end of file diff --git a/docs/models/components/anthropiccitationwebsearchresultlocation.md b/docs/models/components/anthropiccitationwebsearchresultlocation.md new file mode 100644 index 00000000..0ff4eae9 --- /dev/null +++ b/docs/models/components/anthropiccitationwebsearchresultlocation.md @@ -0,0 +1,12 @@ +# AnthropicCitationWebSearchResultLocation + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `CitedText` | `string` | :heavy_check_mark: | N/A | +| `EncryptedIndex` | `string` | :heavy_check_mark: | N/A | +| `Title` | `*string` | :heavy_check_mark: | N/A | +| `Type` | [components.AnthropicCitationWebSearchResultLocationType](../../models/components/anthropiccitationwebsearchresultlocationtype.md) | :heavy_check_mark: | N/A | +| `URL` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/anthropiccitationwebsearchresultlocationtype.md b/docs/models/components/anthropiccitationwebsearchresultlocationtype.md new file mode 100644 index 00000000..d40fcdd7 --- /dev/null +++ b/docs/models/components/anthropiccitationwebsearchresultlocationtype.md @@ -0,0 +1,18 @@ +# AnthropicCitationWebSearchResultLocationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicCitationWebSearchResultLocationTypeWebSearchResultLocation +``` + + +## Values + +| Name | Value | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `AnthropicCitationWebSearchResultLocationTypeWebSearchResultLocation` | web_search_result_location | \ No newline at end of file diff --git a/docs/models/components/anthropicdocumentblockparam.md b/docs/models/components/anthropicdocumentblockparam.md new file mode 100644 index 00000000..427d8cf1 --- /dev/null +++ b/docs/models/components/anthropicdocumentblockparam.md @@ -0,0 +1,13 @@ +# AnthropicDocumentBlockParam + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CacheControl` | [*components.AnthropicCacheControlDirective](../../models/components/anthropiccachecontroldirective.md) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | {
"type": "ephemeral"
} | +| `Citations` | optionalnullable.OptionalNullable[[components.AnthropicDocumentBlockParamCitations](../../models/components/anthropicdocumentblockparamcitations.md)] | :heavy_minus_sign: | N/A | | +| `Context` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | | +| `Source` | [components.AnthropicDocumentBlockParamSourceUnion](../../models/components/anthropicdocumentblockparamsourceunion.md) | :heavy_check_mark: | N/A | | +| `Title` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | | +| `Type` | [components.TypeDocument](../../models/components/typedocument.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/anthropicdocumentblockparamcitations.md b/docs/models/components/anthropicdocumentblockparamcitations.md new file mode 100644 index 00000000..3512506a --- /dev/null +++ b/docs/models/components/anthropicdocumentblockparamcitations.md @@ -0,0 +1,8 @@ +# AnthropicDocumentBlockParamCitations + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Enabled` | `*bool` | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/anthropicdocumentblockparamcontent1.md b/docs/models/components/anthropicdocumentblockparamcontent1.md new file mode 100644 index 00000000..8ddbe259 --- /dev/null +++ b/docs/models/components/anthropicdocumentblockparamcontent1.md @@ -0,0 +1,29 @@ +# AnthropicDocumentBlockParamContent1 + + +## Supported Types + +### AnthropicImageBlockParam + +```go +anthropicDocumentBlockParamContent1 := components.CreateAnthropicDocumentBlockParamContent1Image(components.AnthropicImageBlockParam{/* values here */}) +``` + +### AnthropicTextBlockParam + +```go +anthropicDocumentBlockParamContent1 := components.CreateAnthropicDocumentBlockParamContent1Text(components.AnthropicTextBlockParam{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch anthropicDocumentBlockParamContent1.Type { + case components.AnthropicDocumentBlockParamContent1TypeImage: + // anthropicDocumentBlockParamContent1.AnthropicImageBlockParam is populated + case components.AnthropicDocumentBlockParamContent1TypeText: + // anthropicDocumentBlockParamContent1.AnthropicTextBlockParam is populated +} +``` diff --git a/docs/models/components/anthropicdocumentblockparamcontent2.md b/docs/models/components/anthropicdocumentblockparamcontent2.md new file mode 100644 index 00000000..2e8fe28b --- /dev/null +++ b/docs/models/components/anthropicdocumentblockparamcontent2.md @@ -0,0 +1,29 @@ +# AnthropicDocumentBlockParamContent2 + + +## Supported Types + +### + +```go +anthropicDocumentBlockParamContent2 := components.CreateAnthropicDocumentBlockParamContent2Str(string{/* values here */}) +``` + +### + +```go +anthropicDocumentBlockParamContent2 := components.CreateAnthropicDocumentBlockParamContent2ArrayOfAnthropicDocumentBlockParamContent1([]components.AnthropicDocumentBlockParamContent1{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch anthropicDocumentBlockParamContent2.Type { + case components.AnthropicDocumentBlockParamContent2TypeStr: + // anthropicDocumentBlockParamContent2.Str is populated + case components.AnthropicDocumentBlockParamContent2TypeArrayOfAnthropicDocumentBlockParamContent1: + // anthropicDocumentBlockParamContent2.ArrayOfAnthropicDocumentBlockParamContent1 is populated +} +``` diff --git a/docs/models/components/anthropicdocumentblockparamsourceunion.md b/docs/models/components/anthropicdocumentblockparamsourceunion.md new file mode 100644 index 00000000..2dd305a9 --- /dev/null +++ b/docs/models/components/anthropicdocumentblockparamsourceunion.md @@ -0,0 +1,45 @@ +# AnthropicDocumentBlockParamSourceUnion + + +## Supported Types + +### AnthropicBase64PdfSource + +```go +anthropicDocumentBlockParamSourceUnion := components.CreateAnthropicDocumentBlockParamSourceUnionBase64(components.AnthropicBase64PdfSource{/* values here */}) +``` + +### AnthropicPlainTextSource + +```go +anthropicDocumentBlockParamSourceUnion := components.CreateAnthropicDocumentBlockParamSourceUnionText(components.AnthropicPlainTextSource{/* values here */}) +``` + +### SourceContent + +```go +anthropicDocumentBlockParamSourceUnion := components.CreateAnthropicDocumentBlockParamSourceUnionContent(components.SourceContent{/* values here */}) +``` + +### AnthropicURLPdfSource + +```go +anthropicDocumentBlockParamSourceUnion := components.CreateAnthropicDocumentBlockParamSourceUnionURLObj(components.AnthropicURLPdfSource{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch anthropicDocumentBlockParamSourceUnion.Type { + case components.AnthropicDocumentBlockParamSourceUnionTypeBase64: + // anthropicDocumentBlockParamSourceUnion.AnthropicBase64PdfSource is populated + case components.AnthropicDocumentBlockParamSourceUnionTypeText: + // anthropicDocumentBlockParamSourceUnion.AnthropicPlainTextSource is populated + case components.AnthropicDocumentBlockParamSourceUnionTypeContent: + // anthropicDocumentBlockParamSourceUnion.SourceContent is populated + case components.AnthropicDocumentBlockParamSourceUnionTypeURLObj: + // anthropicDocumentBlockParamSourceUnion.AnthropicURLPdfSource is populated +} +``` diff --git a/docs/models/components/anthropicimageblockparam.md b/docs/models/components/anthropicimageblockparam.md new file mode 100644 index 00000000..15246ac5 --- /dev/null +++ b/docs/models/components/anthropicimageblockparam.md @@ -0,0 +1,10 @@ +# AnthropicImageBlockParam + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CacheControl` | [*components.AnthropicCacheControlDirective](../../models/components/anthropiccachecontroldirective.md) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | {
"type": "ephemeral"
} | +| `Source` | [components.AnthropicImageBlockParamSource](../../models/components/anthropicimageblockparamsource.md) | :heavy_check_mark: | N/A | | +| `Type` | [components.AnthropicImageBlockParamType](../../models/components/anthropicimageblockparamtype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/anthropicimageblockparamsource.md b/docs/models/components/anthropicimageblockparamsource.md new file mode 100644 index 00000000..1f963538 --- /dev/null +++ b/docs/models/components/anthropicimageblockparamsource.md @@ -0,0 +1,29 @@ +# AnthropicImageBlockParamSource + + +## Supported Types + +### AnthropicBase64ImageSource + +```go +anthropicImageBlockParamSource := components.CreateAnthropicImageBlockParamSourceBase64(components.AnthropicBase64ImageSource{/* values here */}) +``` + +### AnthropicURLImageSource + +```go +anthropicImageBlockParamSource := components.CreateAnthropicImageBlockParamSourceURLObj(components.AnthropicURLImageSource{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch anthropicImageBlockParamSource.Type { + case components.AnthropicImageBlockParamSourceTypeBase64: + // anthropicImageBlockParamSource.AnthropicBase64ImageSource is populated + case components.AnthropicImageBlockParamSourceTypeURLObj: + // anthropicImageBlockParamSource.AnthropicURLImageSource is populated +} +``` diff --git a/docs/models/components/anthropicimageblockparamtype.md b/docs/models/components/anthropicimageblockparamtype.md new file mode 100644 index 00000000..845ba509 --- /dev/null +++ b/docs/models/components/anthropicimageblockparamtype.md @@ -0,0 +1,18 @@ +# AnthropicImageBlockParamType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicImageBlockParamTypeImage +``` + + +## Values + +| Name | Value | +| ----------------------------------- | ----------------------------------- | +| `AnthropicImageBlockParamTypeImage` | image | \ No newline at end of file diff --git a/docs/models/components/anthropicimagemimetype.md b/docs/models/components/anthropicimagemimetype.md new file mode 100644 index 00000000..b5498493 --- /dev/null +++ b/docs/models/components/anthropicimagemimetype.md @@ -0,0 +1,24 @@ +# AnthropicImageMimeType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicImageMimeTypeImageJpeg + +// Open enum: custom values can be created with a direct type cast +custom := components.AnthropicImageMimeType("custom_value") +``` + + +## Values + +| Name | Value | +| --------------------------------- | --------------------------------- | +| `AnthropicImageMimeTypeImageJpeg` | image/jpeg | +| `AnthropicImageMimeTypeImagePng` | image/png | +| `AnthropicImageMimeTypeImageGif` | image/gif | +| `AnthropicImageMimeTypeImageWebp` | image/webp | \ No newline at end of file diff --git a/docs/models/components/anthropicinputtokensclearatleast.md b/docs/models/components/anthropicinputtokensclearatleast.md new file mode 100644 index 00000000..ea06879d --- /dev/null +++ b/docs/models/components/anthropicinputtokensclearatleast.md @@ -0,0 +1,9 @@ +# AnthropicInputTokensClearAtLeast + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `Type` | [components.AnthropicInputTokensClearAtLeastType](../../models/components/anthropicinputtokensclearatleasttype.md) | :heavy_check_mark: | N/A | +| `Value` | `int64` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/anthropicinputtokensclearatleasttype.md b/docs/models/components/anthropicinputtokensclearatleasttype.md new file mode 100644 index 00000000..07984400 --- /dev/null +++ b/docs/models/components/anthropicinputtokensclearatleasttype.md @@ -0,0 +1,18 @@ +# AnthropicInputTokensClearAtLeastType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicInputTokensClearAtLeastTypeInputTokens +``` + + +## Values + +| Name | Value | +| ------------------------------------------------- | ------------------------------------------------- | +| `AnthropicInputTokensClearAtLeastTypeInputTokens` | input_tokens | \ No newline at end of file diff --git a/docs/models/components/anthropicinputtokenstrigger.md b/docs/models/components/anthropicinputtokenstrigger.md new file mode 100644 index 00000000..2339ad7b --- /dev/null +++ b/docs/models/components/anthropicinputtokenstrigger.md @@ -0,0 +1,9 @@ +# AnthropicInputTokensTrigger + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `Type` | [components.AnthropicInputTokensTriggerType](../../models/components/anthropicinputtokenstriggertype.md) | :heavy_check_mark: | N/A | +| `Value` | `int64` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/functioncalloutputitemoutputtype.md b/docs/models/components/anthropicinputtokenstriggertype.md similarity index 67% rename from docs/models/components/functioncalloutputitemoutputtype.md rename to docs/models/components/anthropicinputtokenstriggertype.md index 3bed8504..865594ce 100644 --- a/docs/models/components/functioncalloutputitemoutputtype.md +++ b/docs/models/components/anthropicinputtokenstriggertype.md @@ -1,4 +1,4 @@ -# FunctionCallOutputItemOutputType +# AnthropicInputTokensTriggerType ## Example Usage @@ -7,7 +7,7 @@ import ( "github.com/OpenRouterTeam/go-sdk/models/components" ) -value := components.FunctionCallOutputItemOutputTypeInputImage +value := components.AnthropicInputTokensTriggerTypeInputTokens ``` @@ -15,4 +15,4 @@ value := components.FunctionCallOutputItemOutputTypeInputImage | Name | Value | | -------------------------------------------- | -------------------------------------------- | -| `FunctionCallOutputItemOutputTypeInputImage` | input_image | \ No newline at end of file +| `AnthropicInputTokensTriggerTypeInputTokens` | input_tokens | \ No newline at end of file diff --git a/docs/models/components/anthropicplaintextsource.md b/docs/models/components/anthropicplaintextsource.md new file mode 100644 index 00000000..ef328d21 --- /dev/null +++ b/docs/models/components/anthropicplaintextsource.md @@ -0,0 +1,10 @@ +# AnthropicPlainTextSource + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `Data` | `string` | :heavy_check_mark: | N/A | +| `MediaType` | [components.AnthropicPlainTextSourceMediaType](../../models/components/anthropicplaintextsourcemediatype.md) | :heavy_check_mark: | N/A | +| `Type` | [components.AnthropicPlainTextSourceType](../../models/components/anthropicplaintextsourcetype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/anthropicplaintextsourcemediatype.md b/docs/models/components/anthropicplaintextsourcemediatype.md new file mode 100644 index 00000000..0beeecee --- /dev/null +++ b/docs/models/components/anthropicplaintextsourcemediatype.md @@ -0,0 +1,18 @@ +# AnthropicPlainTextSourceMediaType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicPlainTextSourceMediaTypeTextPlain +``` + + +## Values + +| Name | Value | +| -------------------------------------------- | -------------------------------------------- | +| `AnthropicPlainTextSourceMediaTypeTextPlain` | text/plain | \ No newline at end of file diff --git a/docs/models/components/anthropicplaintextsourcetype.md b/docs/models/components/anthropicplaintextsourcetype.md new file mode 100644 index 00000000..de85a9b4 --- /dev/null +++ b/docs/models/components/anthropicplaintextsourcetype.md @@ -0,0 +1,18 @@ +# AnthropicPlainTextSourceType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicPlainTextSourceTypeText +``` + + +## Values + +| Name | Value | +| ---------------------------------- | ---------------------------------- | +| `AnthropicPlainTextSourceTypeText` | text | \ No newline at end of file diff --git a/docs/models/components/anthropicsearchresultblockparam.md b/docs/models/components/anthropicsearchresultblockparam.md new file mode 100644 index 00000000..a7f3c31d --- /dev/null +++ b/docs/models/components/anthropicsearchresultblockparam.md @@ -0,0 +1,13 @@ +# AnthropicSearchResultBlockParam + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CacheControl` | [*components.AnthropicCacheControlDirective](../../models/components/anthropiccachecontroldirective.md) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | {
"type": "ephemeral"
} | +| `Citations` | [*components.AnthropicSearchResultBlockParamCitations](../../models/components/anthropicsearchresultblockparamcitations.md) | :heavy_minus_sign: | N/A | | +| `Content` | [][components.AnthropicTextBlockParam](../../models/components/anthropictextblockparam.md) | :heavy_check_mark: | N/A | | +| `Source` | `string` | :heavy_check_mark: | N/A | | +| `Title` | `string` | :heavy_check_mark: | N/A | | +| `Type` | [components.AnthropicSearchResultBlockParamType](../../models/components/anthropicsearchresultblockparamtype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/anthropicsearchresultblockparamcitations.md b/docs/models/components/anthropicsearchresultblockparamcitations.md new file mode 100644 index 00000000..72eb4a3d --- /dev/null +++ b/docs/models/components/anthropicsearchresultblockparamcitations.md @@ -0,0 +1,8 @@ +# AnthropicSearchResultBlockParamCitations + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Enabled` | `*bool` | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/anthropicsearchresultblockparamtype.md b/docs/models/components/anthropicsearchresultblockparamtype.md new file mode 100644 index 00000000..d781d5e4 --- /dev/null +++ b/docs/models/components/anthropicsearchresultblockparamtype.md @@ -0,0 +1,18 @@ +# AnthropicSearchResultBlockParamType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicSearchResultBlockParamTypeSearchResult +``` + + +## Values + +| Name | Value | +| ------------------------------------------------- | ------------------------------------------------- | +| `AnthropicSearchResultBlockParamTypeSearchResult` | search_result | \ No newline at end of file diff --git a/docs/models/components/anthropictextblockparam.md b/docs/models/components/anthropictextblockparam.md new file mode 100644 index 00000000..3474804f --- /dev/null +++ b/docs/models/components/anthropictextblockparam.md @@ -0,0 +1,11 @@ +# AnthropicTextBlockParam + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CacheControl` | [*components.AnthropicCacheControlDirective](../../models/components/anthropiccachecontroldirective.md) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | {
"type": "ephemeral"
} | +| `Citations` | optionalnullable.OptionalNullable[[][components.Citation](../../models/components/citation.md)] | :heavy_minus_sign: | N/A | | +| `Text` | `string` | :heavy_check_mark: | N/A | | +| `Type` | [components.AnthropicTextBlockParamType](../../models/components/anthropictextblockparamtype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/anthropictextblockparamtype.md b/docs/models/components/anthropictextblockparamtype.md new file mode 100644 index 00000000..389e1fa4 --- /dev/null +++ b/docs/models/components/anthropictextblockparamtype.md @@ -0,0 +1,18 @@ +# AnthropicTextBlockParamType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicTextBlockParamTypeText +``` + + +## Values + +| Name | Value | +| --------------------------------- | --------------------------------- | +| `AnthropicTextBlockParamTypeText` | text | \ No newline at end of file diff --git a/docs/models/components/anthropicthinkingdisplay.md b/docs/models/components/anthropicthinkingdisplay.md new file mode 100644 index 00000000..d784d965 --- /dev/null +++ b/docs/models/components/anthropicthinkingdisplay.md @@ -0,0 +1,22 @@ +# AnthropicThinkingDisplay + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicThinkingDisplaySummarized + +// Open enum: custom values can be created with a direct type cast +custom := components.AnthropicThinkingDisplay("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------------------ | ------------------------------------ | +| `AnthropicThinkingDisplaySummarized` | summarized | +| `AnthropicThinkingDisplayOmitted` | omitted | \ No newline at end of file diff --git a/docs/models/components/anthropicthinkingturns.md b/docs/models/components/anthropicthinkingturns.md new file mode 100644 index 00000000..d06e19f2 --- /dev/null +++ b/docs/models/components/anthropicthinkingturns.md @@ -0,0 +1,9 @@ +# AnthropicThinkingTurns + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `Type` | [components.AnthropicThinkingTurnsType](../../models/components/anthropicthinkingturnstype.md) | :heavy_check_mark: | N/A | +| `Value` | `int64` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/anthropicthinkingturnstype.md b/docs/models/components/anthropicthinkingturnstype.md new file mode 100644 index 00000000..2f91ac3e --- /dev/null +++ b/docs/models/components/anthropicthinkingturnstype.md @@ -0,0 +1,18 @@ +# AnthropicThinkingTurnsType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicThinkingTurnsTypeThinkingTurns +``` + + +## Values + +| Name | Value | +| ----------------------------------------- | ----------------------------------------- | +| `AnthropicThinkingTurnsTypeThinkingTurns` | thinking_turns | \ No newline at end of file diff --git a/docs/models/components/anthropictooluseskeep.md b/docs/models/components/anthropictooluseskeep.md new file mode 100644 index 00000000..0b270dd2 --- /dev/null +++ b/docs/models/components/anthropictooluseskeep.md @@ -0,0 +1,9 @@ +# AnthropicToolUsesKeep + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `Type` | [components.AnthropicToolUsesKeepType](../../models/components/anthropictooluseskeeptype.md) | :heavy_check_mark: | N/A | +| `Value` | `int64` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/anthropictooluseskeeptype.md b/docs/models/components/anthropictooluseskeeptype.md new file mode 100644 index 00000000..f82b0d13 --- /dev/null +++ b/docs/models/components/anthropictooluseskeeptype.md @@ -0,0 +1,18 @@ +# AnthropicToolUsesKeepType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicToolUsesKeepTypeToolUses +``` + + +## Values + +| Name | Value | +| ----------------------------------- | ----------------------------------- | +| `AnthropicToolUsesKeepTypeToolUses` | tool_uses | \ No newline at end of file diff --git a/docs/models/components/anthropictoolusestrigger.md b/docs/models/components/anthropictoolusestrigger.md new file mode 100644 index 00000000..581bc8d3 --- /dev/null +++ b/docs/models/components/anthropictoolusestrigger.md @@ -0,0 +1,9 @@ +# AnthropicToolUsesTrigger + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `Type` | [components.AnthropicToolUsesTriggerType](../../models/components/anthropictoolusestriggertype.md) | :heavy_check_mark: | N/A | +| `Value` | `int64` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/anthropictoolusestriggertype.md b/docs/models/components/anthropictoolusestriggertype.md new file mode 100644 index 00000000..6c8f0880 --- /dev/null +++ b/docs/models/components/anthropictoolusestriggertype.md @@ -0,0 +1,18 @@ +# AnthropicToolUsesTriggerType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicToolUsesTriggerTypeToolUses +``` + + +## Values + +| Name | Value | +| -------------------------------------- | -------------------------------------- | +| `AnthropicToolUsesTriggerTypeToolUses` | tool_uses | \ No newline at end of file diff --git a/docs/models/components/anthropicurlimagesource.md b/docs/models/components/anthropicurlimagesource.md new file mode 100644 index 00000000..8226b994 --- /dev/null +++ b/docs/models/components/anthropicurlimagesource.md @@ -0,0 +1,9 @@ +# AnthropicURLImageSource + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `Type` | [components.AnthropicURLImageSourceType](../../models/components/anthropicurlimagesourcetype.md) | :heavy_check_mark: | N/A | +| `URL` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/anthropicurlimagesourcetype.md b/docs/models/components/anthropicurlimagesourcetype.md new file mode 100644 index 00000000..cc54359b --- /dev/null +++ b/docs/models/components/anthropicurlimagesourcetype.md @@ -0,0 +1,18 @@ +# AnthropicURLImageSourceType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicURLImageSourceTypeURL +``` + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `AnthropicURLImageSourceTypeURL` | url | \ No newline at end of file diff --git a/docs/models/components/anthropicurlpdfsource.md b/docs/models/components/anthropicurlpdfsource.md new file mode 100644 index 00000000..0aaaeaf4 --- /dev/null +++ b/docs/models/components/anthropicurlpdfsource.md @@ -0,0 +1,9 @@ +# AnthropicURLPdfSource + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `Type` | [components.AnthropicURLPdfSourceType](../../models/components/anthropicurlpdfsourcetype.md) | :heavy_check_mark: | N/A | +| `URL` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/anthropicurlpdfsourcetype.md b/docs/models/components/anthropicurlpdfsourcetype.md new file mode 100644 index 00000000..118c27f4 --- /dev/null +++ b/docs/models/components/anthropicurlpdfsourcetype.md @@ -0,0 +1,18 @@ +# AnthropicURLPdfSourceType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicURLPdfSourceTypeURL +``` + + +## Values + +| Name | Value | +| ------------------------------ | ------------------------------ | +| `AnthropicURLPdfSourceTypeURL` | url | \ No newline at end of file diff --git a/docs/models/components/anthropicwebsearchresultblockparam.md b/docs/models/components/anthropicwebsearchresultblockparam.md new file mode 100644 index 00000000..3eba2e3e --- /dev/null +++ b/docs/models/components/anthropicwebsearchresultblockparam.md @@ -0,0 +1,12 @@ +# AnthropicWebSearchResultBlockParam + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `EncryptedContent` | `string` | :heavy_check_mark: | N/A | +| `PageAge` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `Title` | `string` | :heavy_check_mark: | N/A | +| `Type` | [components.AnthropicWebSearchResultBlockParamType](../../models/components/anthropicwebsearchresultblockparamtype.md) | :heavy_check_mark: | N/A | +| `URL` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/anthropicwebsearchresultblockparamtype.md b/docs/models/components/anthropicwebsearchresultblockparamtype.md new file mode 100644 index 00000000..6b0ca0fb --- /dev/null +++ b/docs/models/components/anthropicwebsearchresultblockparamtype.md @@ -0,0 +1,18 @@ +# AnthropicWebSearchResultBlockParamType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicWebSearchResultBlockParamTypeWebSearchResult +``` + + +## Values + +| Name | Value | +| ------------------------------------------------------- | ------------------------------------------------------- | +| `AnthropicWebSearchResultBlockParamTypeWebSearchResult` | web_search_result | \ No newline at end of file diff --git a/docs/models/components/anthropicwebsearchtooluserlocation.md b/docs/models/components/anthropicwebsearchtooluserlocation.md new file mode 100644 index 00000000..47617501 --- /dev/null +++ b/docs/models/components/anthropicwebsearchtooluserlocation.md @@ -0,0 +1,12 @@ +# AnthropicWebSearchToolUserLocation + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `City` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `Country` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `Region` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `Timezone` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `Type` | [components.AnthropicWebSearchToolUserLocationType](../../models/components/anthropicwebsearchtooluserlocationtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/anthropicwebsearchtooluserlocationtype.md b/docs/models/components/anthropicwebsearchtooluserlocationtype.md new file mode 100644 index 00000000..52d72b60 --- /dev/null +++ b/docs/models/components/anthropicwebsearchtooluserlocationtype.md @@ -0,0 +1,18 @@ +# AnthropicWebSearchToolUserLocationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.AnthropicWebSearchToolUserLocationTypeApproximate +``` + + +## Values + +| Name | Value | +| --------------------------------------------------- | --------------------------------------------------- | +| `AnthropicWebSearchToolUserLocationTypeApproximate` | approximate | \ No newline at end of file diff --git a/docs/models/components/apitype.md b/docs/models/components/apitype.md index c5a630b2..74bccaab 100644 --- a/docs/models/components/apitype.md +++ b/docs/models/components/apitype.md @@ -24,4 +24,6 @@ custom := components.APIType("custom_value") | `APITypeEmbeddings` | embeddings | | `APITypeRerank` | rerank | | `APITypeTts` | tts | -| `APITypeVideo` | video | \ No newline at end of file +| `APITypeStt` | stt | +| `APITypeVideo` | video | +| `APITypeImage` | image | \ No newline at end of file diff --git a/docs/models/components/applypatchcallitem.md b/docs/models/components/applypatchcallitem.md new file mode 100644 index 00000000..418fdc2d --- /dev/null +++ b/docs/models/components/applypatchcallitem.md @@ -0,0 +1,14 @@ +# ApplyPatchCallItem + +A tool call emitted by the model requesting a V4A patch operation. The client applies the patch and echoes an `apply_patch_call_output` on the next turn. + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `CallID` | `string` | :heavy_check_mark: | N/A | | +| `ID` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | | +| `Operation` | [components.ApplyPatchCallOperation](../../models/components/applypatchcalloperation.md) | :heavy_check_mark: | The patch operation requested by an `apply_patch_call`. `create_file` and `update_file` carry a V4A diff; `delete_file` omits it. | {
"diff": "@@ function main() {\n+ console.log(\"hi\");\n }",
"path": "/src/main.ts",
"type": "update_file"
} | +| `Status` | [components.ApplyPatchCallStatus](../../models/components/applypatchcallstatus.md) | :heavy_check_mark: | Lifecycle state of an `apply_patch_call` output item. | completed | +| `Type` | [components.ApplyPatchCallItemType](../../models/components/applypatchcallitemtype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/applypatchcallitemtype.md b/docs/models/components/applypatchcallitemtype.md new file mode 100644 index 00000000..d71a16ca --- /dev/null +++ b/docs/models/components/applypatchcallitemtype.md @@ -0,0 +1,18 @@ +# ApplyPatchCallItemType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ApplyPatchCallItemTypeApplyPatchCall +``` + + +## Values + +| Name | Value | +| -------------------------------------- | -------------------------------------- | +| `ApplyPatchCallItemTypeApplyPatchCall` | apply_patch_call | \ No newline at end of file diff --git a/docs/models/components/applypatchcalloperation.md b/docs/models/components/applypatchcalloperation.md new file mode 100644 index 00000000..82e0f9c8 --- /dev/null +++ b/docs/models/components/applypatchcalloperation.md @@ -0,0 +1,41 @@ +# ApplyPatchCallOperation + +The patch operation requested by an `apply_patch_call`. `create_file` and `update_file` carry a V4A diff; `delete_file` omits it. + + +## Supported Types + +### ApplyPatchCreateFileOperation + +```go +applyPatchCallOperation := components.CreateApplyPatchCallOperationCreateFile(components.ApplyPatchCreateFileOperation{/* values here */}) +``` + +### ApplyPatchDeleteFileOperation + +```go +applyPatchCallOperation := components.CreateApplyPatchCallOperationDeleteFile(components.ApplyPatchDeleteFileOperation{/* values here */}) +``` + +### ApplyPatchUpdateFileOperation + +```go +applyPatchCallOperation := components.CreateApplyPatchCallOperationUpdateFile(components.ApplyPatchUpdateFileOperation{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch applyPatchCallOperation.Type { + case components.ApplyPatchCallOperationTypeCreateFile: + // applyPatchCallOperation.ApplyPatchCreateFileOperation is populated + case components.ApplyPatchCallOperationTypeDeleteFile: + // applyPatchCallOperation.ApplyPatchDeleteFileOperation is populated + case components.ApplyPatchCallOperationTypeUpdateFile: + // applyPatchCallOperation.ApplyPatchUpdateFileOperation is populated + default: + // Unknown type - use applyPatchCallOperation.GetUnknownRaw() for raw JSON +} +``` diff --git a/docs/models/components/applypatchcalloperationdiffdeltaevent.md b/docs/models/components/applypatchcalloperationdiffdeltaevent.md new file mode 100644 index 00000000..2284e032 --- /dev/null +++ b/docs/models/components/applypatchcalloperationdiffdeltaevent.md @@ -0,0 +1,14 @@ +# ApplyPatchCallOperationDiffDeltaEvent + +Incremental chunk of `operation.diff` for an `apply_patch_call`. Matches OpenAI's streaming shape. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `Delta` | `string` | :heavy_check_mark: | N/A | +| `ItemID` | `string` | :heavy_check_mark: | N/A | +| `OutputIndex` | `int64` | :heavy_check_mark: | N/A | +| `SequenceNumber` | `int64` | :heavy_check_mark: | N/A | +| `Type` | [components.ApplyPatchCallOperationDiffDeltaEventType](../../models/components/applypatchcalloperationdiffdeltaeventtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/applypatchcalloperationdiffdeltaeventtype.md b/docs/models/components/applypatchcalloperationdiffdeltaeventtype.md new file mode 100644 index 00000000..1d520847 --- /dev/null +++ b/docs/models/components/applypatchcalloperationdiffdeltaeventtype.md @@ -0,0 +1,18 @@ +# ApplyPatchCallOperationDiffDeltaEventType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ApplyPatchCallOperationDiffDeltaEventTypeResponseApplyPatchCallOperationDiffDelta +``` + + +## Values + +| Name | Value | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `ApplyPatchCallOperationDiffDeltaEventTypeResponseApplyPatchCallOperationDiffDelta` | response.apply_patch_call_operation_diff.delta | \ No newline at end of file diff --git a/docs/models/components/applypatchcalloperationdiffdoneevent.md b/docs/models/components/applypatchcalloperationdiffdoneevent.md new file mode 100644 index 00000000..39055948 --- /dev/null +++ b/docs/models/components/applypatchcalloperationdiffdoneevent.md @@ -0,0 +1,14 @@ +# ApplyPatchCallOperationDiffDoneEvent + +Emitted when `operation.diff` streaming completes for an `apply_patch_call`. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `Diff` | `string` | :heavy_check_mark: | N/A | +| `ItemID` | `string` | :heavy_check_mark: | N/A | +| `OutputIndex` | `int64` | :heavy_check_mark: | N/A | +| `SequenceNumber` | `int64` | :heavy_check_mark: | N/A | +| `Type` | [components.ApplyPatchCallOperationDiffDoneEventType](../../models/components/applypatchcalloperationdiffdoneeventtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/applypatchcalloperationdiffdoneeventtype.md b/docs/models/components/applypatchcalloperationdiffdoneeventtype.md new file mode 100644 index 00000000..fb5c9c1d --- /dev/null +++ b/docs/models/components/applypatchcalloperationdiffdoneeventtype.md @@ -0,0 +1,18 @@ +# ApplyPatchCallOperationDiffDoneEventType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ApplyPatchCallOperationDiffDoneEventTypeResponseApplyPatchCallOperationDiffDone +``` + + +## Values + +| Name | Value | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `ApplyPatchCallOperationDiffDoneEventTypeResponseApplyPatchCallOperationDiffDone` | response.apply_patch_call_operation_diff.done | \ No newline at end of file diff --git a/docs/models/components/applypatchcalloutputitem.md b/docs/models/components/applypatchcalloutputitem.md new file mode 100644 index 00000000..0f744c05 --- /dev/null +++ b/docs/models/components/applypatchcalloutputitem.md @@ -0,0 +1,14 @@ +# ApplyPatchCallOutputItem + +The client's echo of an `apply_patch_call` after applying the patch. `output` is an optional human-readable log; `status` is `completed` when the patch was applied successfully, `failed` otherwise. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `CallID` | `string` | :heavy_check_mark: | N/A | +| `ID` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `Output` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `Status` | [components.ApplyPatchCallOutputItemStatus](../../models/components/applypatchcalloutputitemstatus.md) | :heavy_check_mark: | N/A | +| `Type` | [components.ApplyPatchCallOutputItemType](../../models/components/applypatchcalloutputitemtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/applypatchcalloutputitemstatus.md b/docs/models/components/applypatchcalloutputitemstatus.md new file mode 100644 index 00000000..8dd87d9c --- /dev/null +++ b/docs/models/components/applypatchcalloutputitemstatus.md @@ -0,0 +1,22 @@ +# ApplyPatchCallOutputItemStatus + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ApplyPatchCallOutputItemStatusCompleted + +// Open enum: custom values can be created with a direct type cast +custom := components.ApplyPatchCallOutputItemStatus("custom_value") +``` + + +## Values + +| Name | Value | +| ----------------------------------------- | ----------------------------------------- | +| `ApplyPatchCallOutputItemStatusCompleted` | completed | +| `ApplyPatchCallOutputItemStatusFailed` | failed | \ No newline at end of file diff --git a/docs/models/components/applypatchcalloutputitemtype.md b/docs/models/components/applypatchcalloutputitemtype.md new file mode 100644 index 00000000..992d69ec --- /dev/null +++ b/docs/models/components/applypatchcalloutputitemtype.md @@ -0,0 +1,18 @@ +# ApplyPatchCallOutputItemType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ApplyPatchCallOutputItemTypeApplyPatchCallOutput +``` + + +## Values + +| Name | Value | +| -------------------------------------------------- | -------------------------------------------------- | +| `ApplyPatchCallOutputItemTypeApplyPatchCallOutput` | apply_patch_call_output | \ No newline at end of file diff --git a/docs/models/components/applypatchcallstatus.md b/docs/models/components/applypatchcallstatus.md new file mode 100644 index 00000000..3ad3fa0e --- /dev/null +++ b/docs/models/components/applypatchcallstatus.md @@ -0,0 +1,24 @@ +# ApplyPatchCallStatus + +Lifecycle state of an `apply_patch_call` output item. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ApplyPatchCallStatusInProgress + +// Open enum: custom values can be created with a direct type cast +custom := components.ApplyPatchCallStatus("custom_value") +``` + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `ApplyPatchCallStatusInProgress` | in_progress | +| `ApplyPatchCallStatusCompleted` | completed | \ No newline at end of file diff --git a/docs/models/components/applypatchcreatefileoperation.md b/docs/models/components/applypatchcreatefileoperation.md new file mode 100644 index 00000000..3c578cbb --- /dev/null +++ b/docs/models/components/applypatchcreatefileoperation.md @@ -0,0 +1,12 @@ +# ApplyPatchCreateFileOperation + +The `create_file` variant of an `apply_patch_call.operation`. Carries a V4A diff describing the new file contents. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `Diff` | `string` | :heavy_check_mark: | N/A | +| `Path` | `string` | :heavy_check_mark: | N/A | +| `Type` | [components.ApplyPatchCreateFileOperationType](../../models/components/applypatchcreatefileoperationtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/applypatchcreatefileoperationtype.md b/docs/models/components/applypatchcreatefileoperationtype.md new file mode 100644 index 00000000..0d19e2c7 --- /dev/null +++ b/docs/models/components/applypatchcreatefileoperationtype.md @@ -0,0 +1,18 @@ +# ApplyPatchCreateFileOperationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ApplyPatchCreateFileOperationTypeCreateFile +``` + + +## Values + +| Name | Value | +| --------------------------------------------- | --------------------------------------------- | +| `ApplyPatchCreateFileOperationTypeCreateFile` | create_file | \ No newline at end of file diff --git a/docs/models/components/applypatchdeletefileoperation.md b/docs/models/components/applypatchdeletefileoperation.md new file mode 100644 index 00000000..7e688f93 --- /dev/null +++ b/docs/models/components/applypatchdeletefileoperation.md @@ -0,0 +1,11 @@ +# ApplyPatchDeleteFileOperation + +The `delete_file` variant of an `apply_patch_call.operation`. Identifies the file to remove; no diff is required. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `Path` | `string` | :heavy_check_mark: | N/A | +| `Type` | [components.ApplyPatchDeleteFileOperationType](../../models/components/applypatchdeletefileoperationtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/applypatchdeletefileoperationtype.md b/docs/models/components/applypatchdeletefileoperationtype.md new file mode 100644 index 00000000..2f7ecd2d --- /dev/null +++ b/docs/models/components/applypatchdeletefileoperationtype.md @@ -0,0 +1,18 @@ +# ApplyPatchDeleteFileOperationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ApplyPatchDeleteFileOperationTypeDeleteFile +``` + + +## Values + +| Name | Value | +| --------------------------------------------- | --------------------------------------------- | +| `ApplyPatchDeleteFileOperationTypeDeleteFile` | delete_file | \ No newline at end of file diff --git a/docs/models/components/applypatchengineenum.md b/docs/models/components/applypatchengineenum.md new file mode 100644 index 00000000..4f607c6f --- /dev/null +++ b/docs/models/components/applypatchengineenum.md @@ -0,0 +1,25 @@ +# ApplyPatchEngineEnum + +Which apply_patch engine to use. "auto" (default) uses native passthrough when the endpoint advertises native apply_patch support, otherwise falls back to OpenRouter's HITL validator. "native" forces native passthrough — when the endpoint does not support native, the request falls back to HITL. "openrouter" always runs the HITL validator. Native passthrough streams the diff incrementally via `apply_patch_call_operation_diff.delta` events; HITL buffers the diff for atomic delivery as a single delta. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ApplyPatchEngineEnumAuto + +// Open enum: custom values can be created with a direct type cast +custom := components.ApplyPatchEngineEnum("custom_value") +``` + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `ApplyPatchEngineEnumAuto` | auto | +| `ApplyPatchEngineEnumNative` | native | +| `ApplyPatchEngineEnumOpenrouter` | openrouter | \ No newline at end of file diff --git a/docs/models/components/applypatchservertoolconfig.md b/docs/models/components/applypatchservertoolconfig.md new file mode 100644 index 00000000..a5cc33d2 --- /dev/null +++ b/docs/models/components/applypatchservertoolconfig.md @@ -0,0 +1,10 @@ +# ApplyPatchServerToolConfig + +Configuration for the openrouter:apply_patch server tool + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Engine` | [*components.ApplyPatchEngineEnum](../../models/components/applypatchengineenum.md) | :heavy_minus_sign: | Which apply_patch engine to use. "auto" (default) uses native passthrough when the endpoint advertises native apply_patch support, otherwise falls back to OpenRouter's HITL validator. "native" forces native passthrough — when the endpoint does not support native, the request falls back to HITL. "openrouter" always runs the HITL validator. Native passthrough streams the diff incrementally via `apply_patch_call_operation_diff.delta` events; HITL buffers the diff for atomic delivery as a single delta. | auto | \ No newline at end of file diff --git a/docs/models/components/applypatchservertoolopenrouter.md b/docs/models/components/applypatchservertoolopenrouter.md new file mode 100644 index 00000000..293360b2 --- /dev/null +++ b/docs/models/components/applypatchservertoolopenrouter.md @@ -0,0 +1,11 @@ +# ApplyPatchServerToolOpenRouter + +OpenRouter built-in server tool: validates V4A diff patches for file operations (create, update, delete). Restricted to the Responses API. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `Parameters` | [*components.ApplyPatchServerToolConfig](../../models/components/applypatchservertoolconfig.md) | :heavy_minus_sign: | Configuration for the openrouter:apply_patch server tool | {
"engine": "auto"
} | +| `Type` | [components.ApplyPatchServerToolOpenRouterType](../../models/components/applypatchservertoolopenroutertype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/applypatchservertoolopenroutertype.md b/docs/models/components/applypatchservertoolopenroutertype.md new file mode 100644 index 00000000..5906fe7c --- /dev/null +++ b/docs/models/components/applypatchservertoolopenroutertype.md @@ -0,0 +1,18 @@ +# ApplyPatchServerToolOpenRouterType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ApplyPatchServerToolOpenRouterTypeOpenrouterApplyPatch +``` + + +## Values + +| Name | Value | +| -------------------------------------------------------- | -------------------------------------------------------- | +| `ApplyPatchServerToolOpenRouterTypeOpenrouterApplyPatch` | openrouter:apply_patch | \ No newline at end of file diff --git a/docs/models/components/applypatchupdatefileoperation.md b/docs/models/components/applypatchupdatefileoperation.md new file mode 100644 index 00000000..31a40083 --- /dev/null +++ b/docs/models/components/applypatchupdatefileoperation.md @@ -0,0 +1,12 @@ +# ApplyPatchUpdateFileOperation + +The `update_file` variant of an `apply_patch_call.operation`. Carries a V4A diff describing edits to an existing file. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `Diff` | `string` | :heavy_check_mark: | N/A | +| `Path` | `string` | :heavy_check_mark: | N/A | +| `Type` | [components.ApplyPatchUpdateFileOperationType](../../models/components/applypatchupdatefileoperationtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/applypatchupdatefileoperationtype.md b/docs/models/components/applypatchupdatefileoperationtype.md new file mode 100644 index 00000000..9fff74dc --- /dev/null +++ b/docs/models/components/applypatchupdatefileoperationtype.md @@ -0,0 +1,18 @@ +# ApplyPatchUpdateFileOperationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ApplyPatchUpdateFileOperationTypeUpdateFile +``` + + +## Values + +| Name | Value | +| --------------------------------------------- | --------------------------------------------- | +| `ApplyPatchUpdateFileOperationTypeUpdateFile` | update_file | \ No newline at end of file diff --git a/docs/models/components/apprankingsitem.md b/docs/models/components/apprankingsitem.md new file mode 100644 index 00000000..48cedd0d --- /dev/null +++ b/docs/models/components/apprankingsitem.md @@ -0,0 +1,12 @@ +# AppRankingsItem + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AppID` | `int64` | :heavy_check_mark: | Stable numeric identifier of the app on OpenRouter. | 12345 | +| `AppName` | `string` | :heavy_check_mark: | Public display name of the app. | Cline | +| `Rank` | `int64` | :heavy_check_mark: | 1-based position of the app within this response, per the requested `sort`. | 1 | +| `TotalRequests` | `int64` | :heavy_check_mark: | Number of requests attributed to the app inside the date window. | 4321 | +| `TotalTokens` | `string` | :heavy_check_mark: | Sum of `prompt_tokens + completion_tokens` attributed to the app inside the date window, returned as a decimal string so 64-bit values are not truncated. | 12345678 | \ No newline at end of file diff --git a/docs/models/components/apprankingsresponse.md b/docs/models/components/apprankingsresponse.md new file mode 100644 index 00000000..e0fc5af3 --- /dev/null +++ b/docs/models/components/apprankingsresponse.md @@ -0,0 +1,9 @@ +# AppRankingsResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Data` | [][components.AppRankingsItem](../../models/components/apprankingsitem.md) | :heavy_check_mark: | Apps ranked per the requested `sort`, re-numbered 1..N after category filtering. `popular` sorts by `total_tokens` descending; `trending` sorts by absolute excess token growth descending and may return fewer than `limit` rows when few apps are growing. | | +| `Meta` | [components.RankingsDailyMeta](../../models/components/rankingsdailymeta.md) | :heavy_check_mark: | N/A | {
"as_of": "2026-05-12T02:00:00Z",
"end_date": "2026-05-11",
"start_date": "2026-04-12",
"version": "v1"
} | \ No newline at end of file diff --git a/docs/models/components/aspectratio.md b/docs/models/components/aspectratio.md index ebace458..30c0b981 100644 --- a/docs/models/components/aspectratio.md +++ b/docs/models/components/aspectratio.md @@ -25,5 +25,7 @@ custom := components.AspectRatio("custom_value") | `AspectRatioEleven` | 1:1 | | `AspectRatioFortyThree` | 4:3 | | `AspectRatioThirtyFour` | 3:4 | +| `AspectRatioThirtyTwo` | 3:2 | +| `AspectRatioTwentyThree` | 2:3 | | `AspectRatioTwoHundredAndNineteen` | 21:9 | | `AspectRatioNineHundredAndTwentyOne` | 9:21 | \ No newline at end of file diff --git a/docs/models/components/audiourl.md b/docs/models/components/audiourl.md new file mode 100644 index 00000000..9dfdd39b --- /dev/null +++ b/docs/models/components/audiourl.md @@ -0,0 +1,8 @@ +# AudioURL + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `URL` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/autorouterplugin.md b/docs/models/components/autorouterplugin.md index 38479728..e414907e 100644 --- a/docs/models/components/autorouterplugin.md +++ b/docs/models/components/autorouterplugin.md @@ -3,8 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AllowedModels` | []`string` | :heavy_minus_sign: | List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, uses the default supported models list. | [
"anthropic/*",
"openai/gpt-4o",
"google/*"
] | -| `Enabled` | `*bool` | :heavy_minus_sign: | Set to false to disable the auto-router plugin for this request. Defaults to true. | | -| `ID` | [components.AutoRouterPluginID](../../models/components/autorouterpluginid.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AllowedModels` | []`string` | :heavy_minus_sign: | List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, uses the default supported models list. | [
"anthropic/*",
"openai/gpt-4o",
"google/*"
] | +| `CostQualityTradeoff` | `*int64` | :heavy_minus_sign: | Controls cost vs. quality routing tradeoff (0–10). 0 = pure quality (best model regardless of cost), 10 = maximize for cost (cheapest model wins). Intermediate values blend quality and cost signals continuously. Defaults to 7. | 7 | +| `Enabled` | `*bool` | :heavy_minus_sign: | Set to false to disable the auto-router plugin for this request. Defaults to true. | | +| `ID` | [components.AutoRouterPluginID](../../models/components/autorouterpluginid.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/baseinputsunion1.md b/docs/models/components/baseinputsunion1.md index 9ebf8bd7..36c02a58 100644 --- a/docs/models/components/baseinputsunion1.md +++ b/docs/models/components/baseinputsunion1.md @@ -39,6 +39,30 @@ baseInputsUnion1 := components.CreateBaseInputsUnion1OutputItemImageGenerationCa baseInputsUnion1 := components.CreateBaseInputsUnion1OutputMessage(components.OutputMessage{/* values here */}) ``` +### OpenAIResponseCustomToolCall + +```go +baseInputsUnion1 := components.CreateBaseInputsUnion1OpenAIResponseCustomToolCall(components.OpenAIResponseCustomToolCall{/* values here */}) +``` + +### OpenAIResponseCustomToolCallOutput + +```go +baseInputsUnion1 := components.CreateBaseInputsUnion1OpenAIResponseCustomToolCallOutput(components.OpenAIResponseCustomToolCallOutput{/* values here */}) +``` + +### ApplyPatchCallItem + +```go +baseInputsUnion1 := components.CreateBaseInputsUnion1ApplyPatchCallItem(components.ApplyPatchCallItem{/* values here */}) +``` + +### ApplyPatchCallOutputItem + +```go +baseInputsUnion1 := components.CreateBaseInputsUnion1ApplyPatchCallOutputItem(components.ApplyPatchCallOutputItem{/* values here */}) +``` + ## Union Discrimination Use the `Type` field to determine which variant is active, then access the corresponding field: @@ -57,5 +81,13 @@ switch baseInputsUnion1.Type { // baseInputsUnion1.OutputItemImageGenerationCall is populated case components.BaseInputsUnion1TypeOutputMessage: // baseInputsUnion1.OutputMessage is populated + case components.BaseInputsUnion1TypeOpenAIResponseCustomToolCall: + // baseInputsUnion1.OpenAIResponseCustomToolCall is populated + case components.BaseInputsUnion1TypeOpenAIResponseCustomToolCallOutput: + // baseInputsUnion1.OpenAIResponseCustomToolCallOutput is populated + case components.BaseInputsUnion1TypeApplyPatchCallItem: + // baseInputsUnion1.ApplyPatchCallItem is populated + case components.BaseInputsUnion1TypeApplyPatchCallOutputItem: + // baseInputsUnion1.ApplyPatchCallOutputItem is populated } ``` diff --git a/docs/models/components/bashservertool.md b/docs/models/components/bashservertool.md new file mode 100644 index 00000000..7dbfce3c --- /dev/null +++ b/docs/models/components/bashservertool.md @@ -0,0 +1,11 @@ +# BashServerTool + +OpenRouter built-in server tool: runs shell commands server-side in a sandboxed container + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `Parameters` | [*components.BashServerToolConfig](../../models/components/bashservertoolconfig.md) | :heavy_minus_sign: | Configuration for the openrouter:bash server tool | {
"environment": {
"type": "container_auto"
}
} | +| `Type` | [components.BashServerToolType](../../models/components/bashservertooltype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/bashservertoolconfig.md b/docs/models/components/bashservertoolconfig.md new file mode 100644 index 00000000..23e89ab9 --- /dev/null +++ b/docs/models/components/bashservertoolconfig.md @@ -0,0 +1,12 @@ +# BashServerToolConfig + +Configuration for the openrouter:bash server tool + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Engine` | [*components.BashServerToolEngine](../../models/components/bashservertoolengine.md) | :heavy_minus_sign: | Which bash engine to use. "openrouter" runs commands server-side in the OpenRouter sandbox. "auto" (default) and "native" use native passthrough, returning the tool call to your application to run client-side; OpenRouter does not execute the commands. | auto | +| `Environment` | [*components.BashServerToolEnvironment](../../models/components/bashservertoolenvironment.md) | :heavy_minus_sign: | Execution environment for the bash server tool. | {
"type": "container_auto"
} | +| `SleepAfterSeconds` | `*int64` | :heavy_minus_sign: | How long (in seconds) the container stays warm after its last command before sleeping, freeing its capacity slot. Idle-based: each command renews the timer. Defaults to 900 (15 minutes); capped at 2592000 (30 days). | 900 | \ No newline at end of file diff --git a/docs/models/components/bashservertoolengine.md b/docs/models/components/bashservertoolengine.md new file mode 100644 index 00000000..5e61f6b2 --- /dev/null +++ b/docs/models/components/bashservertoolengine.md @@ -0,0 +1,25 @@ +# BashServerToolEngine + +Which bash engine to use. "openrouter" runs commands server-side in the OpenRouter sandbox. "auto" (default) and "native" use native passthrough, returning the tool call to your application to run client-side; OpenRouter does not execute the commands. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.BashServerToolEngineAuto + +// Open enum: custom values can be created with a direct type cast +custom := components.BashServerToolEngine("custom_value") +``` + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `BashServerToolEngineAuto` | auto | +| `BashServerToolEngineNative` | native | +| `BashServerToolEngineOpenrouter` | openrouter | \ No newline at end of file diff --git a/docs/models/components/bashservertoolenvironment.md b/docs/models/components/bashservertoolenvironment.md new file mode 100644 index 00000000..f0dedcec --- /dev/null +++ b/docs/models/components/bashservertoolenvironment.md @@ -0,0 +1,31 @@ +# BashServerToolEnvironment + +Execution environment for the bash server tool. + + +## Supported Types + +### ContainerAutoEnvironment + +```go +bashServerToolEnvironment := components.CreateBashServerToolEnvironmentContainerAuto(components.ContainerAutoEnvironment{/* values here */}) +``` + +### ContainerReferenceEnvironment + +```go +bashServerToolEnvironment := components.CreateBashServerToolEnvironmentContainerReference(components.ContainerReferenceEnvironment{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch bashServerToolEnvironment.Type { + case components.BashServerToolEnvironmentTypeContainerAuto: + // bashServerToolEnvironment.ContainerAutoEnvironment is populated + case components.BashServerToolEnvironmentTypeContainerReference: + // bashServerToolEnvironment.ContainerReferenceEnvironment is populated +} +``` diff --git a/docs/models/components/bashservertooltype.md b/docs/models/components/bashservertooltype.md new file mode 100644 index 00000000..7d76c9d0 --- /dev/null +++ b/docs/models/components/bashservertooltype.md @@ -0,0 +1,18 @@ +# BashServerToolType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.BashServerToolTypeOpenrouterBash +``` + + +## Values + +| Name | Value | +| ---------------------------------- | ---------------------------------- | +| `BashServerToolTypeOpenrouterBash` | openrouter:bash | \ No newline at end of file diff --git a/docs/models/components/benchmarkpricing.md b/docs/models/components/benchmarkpricing.md new file mode 100644 index 00000000..3c0d7726 --- /dev/null +++ b/docs/models/components/benchmarkpricing.md @@ -0,0 +1,11 @@ +# BenchmarkPricing + +OpenRouter pricing per token for this model. Null if pricing is unavailable. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `Completion` | `string` | :heavy_check_mark: | Cost per output token (USD, decimal string). | 0.000015 | +| `Prompt` | `string` | :heavy_check_mark: | Cost per input token (USD, decimal string). | 0.000003 | \ No newline at end of file diff --git a/docs/models/components/benchmarksaaitem.md b/docs/models/components/benchmarksaaitem.md new file mode 100644 index 00000000..cfb5382e --- /dev/null +++ b/docs/models/components/benchmarksaaitem.md @@ -0,0 +1,13 @@ +# BenchmarksAAItem + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `AaName` | `string` | :heavy_check_mark: | Model name as listed on Artificial Analysis. | GPT-4o | +| `AgenticIndex` | `*float64` | :heavy_check_mark: | Artificial Analysis Agentic Index composite score. Higher is better. | 58.3 | +| `CodingIndex` | `*float64` | :heavy_check_mark: | Artificial Analysis Coding Index composite score. Higher is better. | 65.8 | +| `IntelligenceIndex` | `*float64` | :heavy_check_mark: | Artificial Analysis Intelligence Index composite score. Higher is better. | 71.2 | +| `ModelPermaslug` | `string` | :heavy_check_mark: | Stable OpenRouter model identifier. | openai/gpt-4o | +| `Pricing` | [*components.BenchmarkPricing](../../models/components/benchmarkpricing.md) | :heavy_check_mark: | OpenRouter pricing per token for this model. Null if pricing is unavailable. | {
"completion": "0.000015",
"prompt": "0.000003"
} | \ No newline at end of file diff --git a/docs/models/components/benchmarksaameta.md b/docs/models/components/benchmarksaameta.md new file mode 100644 index 00000000..ae084a5e --- /dev/null +++ b/docs/models/components/benchmarksaameta.md @@ -0,0 +1,13 @@ +# BenchmarksAAMeta + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `AsOf` | `string` | :heavy_check_mark: | ISO-8601 timestamp of when this data was last updated. | 2026-06-03T12:00:00Z | +| `Citation` | `string` | :heavy_check_mark: | Required attribution when republishing this data. | Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings). | +| `ModelCount` | `int64` | :heavy_check_mark: | Number of unique models in the response. | | +| `Source` | [components.BenchmarksAAMetaSource](../../models/components/benchmarksaametasource.md) | :heavy_check_mark: | Data source identifier. | | +| `SourceURL` | [components.BenchmarksAAMetaSourceURL](../../models/components/benchmarksaametasourceurl.md) | :heavy_check_mark: | URL of the upstream data source. | | +| `Version` | [components.BenchmarksAAMetaVersion](../../models/components/benchmarksaametaversion.md) | :heavy_check_mark: | Dataset version. | | \ No newline at end of file diff --git a/docs/models/components/benchmarksaametasource.md b/docs/models/components/benchmarksaametasource.md new file mode 100644 index 00000000..1fff3fd8 --- /dev/null +++ b/docs/models/components/benchmarksaametasource.md @@ -0,0 +1,20 @@ +# BenchmarksAAMetaSource + +Data source identifier. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.BenchmarksAAMetaSourceArtificialAnalysis +``` + + +## Values + +| Name | Value | +| ------------------------------------------ | ------------------------------------------ | +| `BenchmarksAAMetaSourceArtificialAnalysis` | artificial-analysis | \ No newline at end of file diff --git a/docs/models/components/benchmarksaametasourceurl.md b/docs/models/components/benchmarksaametasourceurl.md new file mode 100644 index 00000000..71b7fa02 --- /dev/null +++ b/docs/models/components/benchmarksaametasourceurl.md @@ -0,0 +1,20 @@ +# BenchmarksAAMetaSourceURL + +URL of the upstream data source. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.BenchmarksAAMetaSourceURLHTTPSArtificialanalysisAi +``` + + +## Values + +| Name | Value | +| ---------------------------------------------------- | ---------------------------------------------------- | +| `BenchmarksAAMetaSourceURLHTTPSArtificialanalysisAi` | https://artificialanalysis.ai | \ No newline at end of file diff --git a/docs/models/components/benchmarksaametaversion.md b/docs/models/components/benchmarksaametaversion.md new file mode 100644 index 00000000..d4aaaa11 --- /dev/null +++ b/docs/models/components/benchmarksaametaversion.md @@ -0,0 +1,20 @@ +# BenchmarksAAMetaVersion + +Dataset version. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.BenchmarksAAMetaVersionV1 +``` + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `BenchmarksAAMetaVersionV1` | v1 | \ No newline at end of file diff --git a/docs/models/components/benchmarksaaresponse.md b/docs/models/components/benchmarksaaresponse.md new file mode 100644 index 00000000..3961f84a --- /dev/null +++ b/docs/models/components/benchmarksaaresponse.md @@ -0,0 +1,9 @@ +# BenchmarksAAResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Data` | [][components.BenchmarksAAItem](../../models/components/benchmarksaaitem.md) | :heavy_check_mark: | N/A | | +| `Meta` | [components.BenchmarksAAMeta](../../models/components/benchmarksaameta.md) | :heavy_check_mark: | N/A | {
"as_of": "2026-06-03T12:00:00Z",
"citation": "Source: Artificial Analysis (artificialanalysis.ai) via OpenRouter (openrouter.ai/rankings).",
"model_count": 50,
"source": "artificial-analysis",
"source_url": "https://artificialanalysis.ai",
"version": "v1"
} | \ No newline at end of file diff --git a/docs/models/components/benchmarksdaitem.md b/docs/models/components/benchmarksdaitem.md new file mode 100644 index 00000000..66322fb0 --- /dev/null +++ b/docs/models/components/benchmarksdaitem.md @@ -0,0 +1,16 @@ +# BenchmarksDAItem + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Arena` | `string` | :heavy_check_mark: | Arena this ranking belongs to. | models | +| `AvgGenerationTimeMs` | `*float64` | :heavy_check_mark: | Average generation time in milliseconds. | 3200 | +| `Category` | `string` | :heavy_check_mark: | Category within the arena. | codecategories | +| `DisplayName` | `string` | :heavy_check_mark: | Human-readable model name from Design Arena. | Claude Sonnet 4 | +| `Elo` | `float64` | :heavy_check_mark: | ELO rating from head-to-head arena battles. | 1423 | +| `ModelPermaslug` | `string` | :heavy_check_mark: | Stable OpenRouter model identifier when the model is on OpenRouter; otherwise the upstream Design Arena model id. Use pricing != null to detect OpenRouter-mapped models. | anthropic/claude-sonnet-4 | +| `Pricing` | [*components.BenchmarkPricing](../../models/components/benchmarkpricing.md) | :heavy_check_mark: | OpenRouter pricing per token for this model. Null if pricing is unavailable. | {
"completion": "0.000015",
"prompt": "0.000003"
} | +| `TournamentStats` | [components.TournamentStats](../../models/components/tournamentstats.md) | :heavy_check_mark: | Placement distribution from tournament matches. | | +| `WinRate` | `float64` | :heavy_check_mark: | Win rate as a percentage (0–100). | 72 | \ No newline at end of file diff --git a/docs/models/components/benchmarksdameta.md b/docs/models/components/benchmarksdameta.md new file mode 100644 index 00000000..b8ba4209 --- /dev/null +++ b/docs/models/components/benchmarksdameta.md @@ -0,0 +1,16 @@ +# BenchmarksDAMeta + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `Arena` | `string` | :heavy_check_mark: | The arena filter applied. | | +| `AsOf` | `string` | :heavy_check_mark: | ISO-8601 timestamp of when this data was generated. | 2026-06-03T12:00:00Z | +| `Category` | `*string` | :heavy_check_mark: | The category filter applied, or null if showing all. | | +| `Citation` | `string` | :heavy_check_mark: | Required attribution when republishing this data. | Source: Design Arena (www.designarena.ai) via OpenRouter (openrouter.ai/rankings). | +| `EloBounds` | [components.EloBounds](../../models/components/elobounds.md) | :heavy_check_mark: | ELO range across all returned models for normalization. | | +| `ModelCount` | `int64` | :heavy_check_mark: | Number of unique models in the response. | | +| `Source` | [components.BenchmarksDAMetaSource](../../models/components/benchmarksdametasource.md) | :heavy_check_mark: | Data source identifier. | | +| `SourceURL` | [components.BenchmarksDAMetaSourceURL](../../models/components/benchmarksdametasourceurl.md) | :heavy_check_mark: | URL of the upstream data source. | | +| `Version` | [components.BenchmarksDAMetaVersion](../../models/components/benchmarksdametaversion.md) | :heavy_check_mark: | Dataset version. | | \ No newline at end of file diff --git a/docs/models/components/benchmarksdametasource.md b/docs/models/components/benchmarksdametasource.md new file mode 100644 index 00000000..d6109f39 --- /dev/null +++ b/docs/models/components/benchmarksdametasource.md @@ -0,0 +1,20 @@ +# BenchmarksDAMetaSource + +Data source identifier. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.BenchmarksDAMetaSourceDesignArena +``` + + +## Values + +| Name | Value | +| ----------------------------------- | ----------------------------------- | +| `BenchmarksDAMetaSourceDesignArena` | design-arena | \ No newline at end of file diff --git a/docs/models/components/benchmarksdametasourceurl.md b/docs/models/components/benchmarksdametasourceurl.md new file mode 100644 index 00000000..3eae2e01 --- /dev/null +++ b/docs/models/components/benchmarksdametasourceurl.md @@ -0,0 +1,20 @@ +# BenchmarksDAMetaSourceURL + +URL of the upstream data source. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.BenchmarksDAMetaSourceURLHTTPSWwwDesignarenaAi +``` + + +## Values + +| Name | Value | +| ------------------------------------------------ | ------------------------------------------------ | +| `BenchmarksDAMetaSourceURLHTTPSWwwDesignarenaAi` | https://www.designarena.ai | \ No newline at end of file diff --git a/docs/models/components/benchmarksdametaversion.md b/docs/models/components/benchmarksdametaversion.md new file mode 100644 index 00000000..db84f1dd --- /dev/null +++ b/docs/models/components/benchmarksdametaversion.md @@ -0,0 +1,20 @@ +# BenchmarksDAMetaVersion + +Dataset version. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.BenchmarksDAMetaVersionV1 +``` + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `BenchmarksDAMetaVersionV1` | v1 | \ No newline at end of file diff --git a/docs/models/components/benchmarksdaresponse.md b/docs/models/components/benchmarksdaresponse.md new file mode 100644 index 00000000..e67e6a75 --- /dev/null +++ b/docs/models/components/benchmarksdaresponse.md @@ -0,0 +1,9 @@ +# BenchmarksDAResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Data` | [][components.BenchmarksDAItem](../../models/components/benchmarksdaitem.md) | :heavy_check_mark: | N/A | | +| `Meta` | [components.BenchmarksDAMeta](../../models/components/benchmarksdameta.md) | :heavy_check_mark: | N/A | {
"arena": "models",
"as_of": "2026-06-03T12:00:00Z",
"category": null,
"citation": "Source: Design Arena (www.designarena.ai) via OpenRouter (openrouter.ai/rankings).",
"elo_bounds": {
"max": 1600,
"min": 900
},
"model_count": 50,
"source": "design-arena",
"source_url": "https://www.designarena.ai",
"version": "v1"
} | \ No newline at end of file diff --git a/docs/models/components/byokkey.md b/docs/models/components/byokkey.md new file mode 100644 index 00000000..aac5e094 --- /dev/null +++ b/docs/models/components/byokkey.md @@ -0,0 +1,19 @@ +# BYOKKey + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `AllowedAPIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) that may use this credential. `null` means no restriction. | [
"f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943"
] | +| `AllowedModels` | []`string` | :heavy_check_mark: | Optional allowlist of model slugs this credential may be used for. `null` means no restriction. | null | +| `AllowedUserIds` | []`string` | :heavy_check_mark: | Optional allowlist of user IDs that may use this credential. `null` means no restriction. | null | +| `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the credential was created. | 2025-08-24T10:30:00Z | +| `Disabled` | `bool` | :heavy_check_mark: | Whether this credential is currently disabled. | false | +| `ID` | `string` | :heavy_check_mark: | Stable public identifier for this BYOK credential. | 11111111-2222-3333-4444-555555555555 | +| `IsFallback` | `bool` | :heavy_check_mark: | Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried. | false | +| `Label` | `string` | :heavy_check_mark: | Short masked snippet of the key (e.g. the first/last few characters) used to identify it in the UI. | sk-...AbCd | +| `Name` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Optional human-readable name for the credential. | Production OpenAI Key | +| `Provider` | [components.BYOKProviderSlug](../../models/components/byokproviderslug.md) | :heavy_check_mark: | The upstream provider this credential authenticates against, as a lowercase slug (e.g. `openai`, `anthropic`, `amazon-bedrock`). | openai | +| `SortOrder` | `int64` | :heavy_check_mark: | Position within the provider — credentials are tried in ascending sort order. | 0 | +| `WorkspaceID` | `string` | :heavy_check_mark: | ID of the workspace this credential belongs to. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/components/byokproviderslug.md b/docs/models/components/byokproviderslug.md new file mode 100644 index 00000000..bf7e9bd6 --- /dev/null +++ b/docs/models/components/byokproviderslug.md @@ -0,0 +1,105 @@ +# BYOKProviderSlug + +The upstream provider this credential authenticates against, as a lowercase slug (e.g. `openai`, `anthropic`, `amazon-bedrock`). + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.BYOKProviderSlugAi21 + +// Open enum: custom values can be created with a direct type cast +custom := components.BYOKProviderSlug("custom_value") +``` + + +## Values + +| Name | Value | +| --------------------------------- | --------------------------------- | +| `BYOKProviderSlugAi21` | ai21 | +| `BYOKProviderSlugAionLabs` | aion-labs | +| `BYOKProviderSlugAkashml` | akashml | +| `BYOKProviderSlugAlibaba` | alibaba | +| `BYOKProviderSlugAmazonBedrock` | amazon-bedrock | +| `BYOKProviderSlugAmazonNova` | amazon-nova | +| `BYOKProviderSlugAmbient` | ambient | +| `BYOKProviderSlugAnthropic` | anthropic | +| `BYOKProviderSlugArceeAi` | arcee-ai | +| `BYOKProviderSlugAtlasCloud` | atlas-cloud | +| `BYOKProviderSlugAvian` | avian | +| `BYOKProviderSlugAzure` | azure | +| `BYOKProviderSlugBaidu` | baidu | +| `BYOKProviderSlugBaseten` | baseten | +| `BYOKProviderSlugBlackForestLabs` | black-forest-labs | +| `BYOKProviderSlugByteplus` | byteplus | +| `BYOKProviderSlugCerebras` | cerebras | +| `BYOKProviderSlugChutes` | chutes | +| `BYOKProviderSlugCirrascale` | cirrascale | +| `BYOKProviderSlugClarifai` | clarifai | +| `BYOKProviderSlugCloudflare` | cloudflare | +| `BYOKProviderSlugCohere` | cohere | +| `BYOKProviderSlugCrusoe` | crusoe | +| `BYOKProviderSlugDarkbloom` | darkbloom | +| `BYOKProviderSlugDecart` | decart | +| `BYOKProviderSlugDeepinfra` | deepinfra | +| `BYOKProviderSlugDeepseek` | deepseek | +| `BYOKProviderSlugDekallm` | dekallm | +| `BYOKProviderSlugDigitalocean` | digitalocean | +| `BYOKProviderSlugFeatherless` | featherless | +| `BYOKProviderSlugFireworks` | fireworks | +| `BYOKProviderSlugFriendli` | friendli | +| `BYOKProviderSlugGmicloud` | gmicloud | +| `BYOKProviderSlugGoogleAiStudio` | google-ai-studio | +| `BYOKProviderSlugGoogleVertex` | google-vertex | +| `BYOKProviderSlugGroq` | groq | +| `BYOKProviderSlugInception` | inception | +| `BYOKProviderSlugInceptron` | inceptron | +| `BYOKProviderSlugInferenceNet` | inference-net | +| `BYOKProviderSlugInfermatic` | infermatic | +| `BYOKProviderSlugInflection` | inflection | +| `BYOKProviderSlugIoNet` | io-net | +| `BYOKProviderSlugIonstream` | ionstream | +| `BYOKProviderSlugLiquid` | liquid | +| `BYOKProviderSlugMancer` | mancer | +| `BYOKProviderSlugMara` | mara | +| `BYOKProviderSlugMinimax` | minimax | +| `BYOKProviderSlugMistral` | mistral | +| `BYOKProviderSlugModelrun` | modelrun | +| `BYOKProviderSlugModular` | modular | +| `BYOKProviderSlugMoonshotai` | moonshotai | +| `BYOKProviderSlugMorph` | morph | +| `BYOKProviderSlugNcompass` | ncompass | +| `BYOKProviderSlugNebius` | nebius | +| `BYOKProviderSlugNexAgi` | nex-agi | +| `BYOKProviderSlugNextbit` | nextbit | +| `BYOKProviderSlugNovita` | novita | +| `BYOKProviderSlugNvidia` | nvidia | +| `BYOKProviderSlugOpenInference` | open-inference | +| `BYOKProviderSlugOpenai` | openai | +| `BYOKProviderSlugParasail` | parasail | +| `BYOKProviderSlugPerceptron` | perceptron | +| `BYOKProviderSlugPerplexity` | perplexity | +| `BYOKProviderSlugPhala` | phala | +| `BYOKProviderSlugPoolside` | poolside | +| `BYOKProviderSlugRecraft` | recraft | +| `BYOKProviderSlugReka` | reka | +| `BYOKProviderSlugRelace` | relace | +| `BYOKProviderSlugSambanova` | sambanova | +| `BYOKProviderSlugSeed` | seed | +| `BYOKProviderSlugSiliconflow` | siliconflow | +| `BYOKProviderSlugSourceful` | sourceful | +| `BYOKProviderSlugStepfun` | stepfun | +| `BYOKProviderSlugStreamlake` | streamlake | +| `BYOKProviderSlugSwitchpoint` | switchpoint | +| `BYOKProviderSlugTogether` | together | +| `BYOKProviderSlugUpstage` | upstage | +| `BYOKProviderSlugVenice` | venice | +| `BYOKProviderSlugWafer` | wafer | +| `BYOKProviderSlugWandb` | wandb | +| `BYOKProviderSlugXai` | xai | +| `BYOKProviderSlugXiaomi` | xiaomi | +| `BYOKProviderSlugZAi` | z-ai | \ No newline at end of file diff --git a/docs/models/components/caching.md b/docs/models/components/caching.md new file mode 100644 index 00000000..006345ae --- /dev/null +++ b/docs/models/components/caching.md @@ -0,0 +1,11 @@ +# Caching + +Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `TTL` | [*components.AnthropicCacheControlTTL](../../models/components/anthropiccachecontrolttl.md) | :heavy_minus_sign: | N/A | 5m | +| `Type` | [components.ToolTypeEphemeral](../../models/components/tooltypeephemeral.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/chatfunctiontool.md b/docs/models/components/chatfunctiontool.md index af6950b1..9c80a7a8 100644 --- a/docs/models/components/chatfunctiontool.md +++ b/docs/models/components/chatfunctiontool.md @@ -11,6 +11,18 @@ Tool definition for function calling (regular function or OpenRouter built-in se chatFunctionTool := components.CreateChatFunctionToolChatFunctionToolFunction(components.ChatFunctionToolFunction{/* values here */}) ``` +### AdvisorServerToolOpenRouter + +```go +chatFunctionTool := components.CreateChatFunctionToolAdvisorServerToolOpenRouter(components.AdvisorServerToolOpenRouter{/* values here */}) +``` + +### BashServerTool + +```go +chatFunctionTool := components.CreateChatFunctionToolBashServerTool(components.BashServerTool{/* values here */}) +``` + ### DatetimeServerTool ```go @@ -29,6 +41,18 @@ chatFunctionTool := components.CreateChatFunctionToolImageGenerationServerToolOp chatFunctionTool := components.CreateChatFunctionToolChatSearchModelsServerTool(components.ChatSearchModelsServerTool{/* values here */}) ``` +### SubagentServerToolOpenRouter + +```go +chatFunctionTool := components.CreateChatFunctionToolSubagentServerToolOpenRouter(components.SubagentServerToolOpenRouter{/* values here */}) +``` + +### WebFetchServerTool + +```go +chatFunctionTool := components.CreateChatFunctionToolWebFetchServerTool(components.WebFetchServerTool{/* values here */}) +``` + ### OpenRouterWebSearchServerTool ```go @@ -49,12 +73,20 @@ Use the `Type` field to determine which variant is active, then access the corre switch chatFunctionTool.Type { case components.ChatFunctionToolUnionTypeChatFunctionToolFunction: // chatFunctionTool.ChatFunctionToolFunction is populated + case components.ChatFunctionToolUnionTypeAdvisorServerToolOpenRouter: + // chatFunctionTool.AdvisorServerToolOpenRouter is populated + case components.ChatFunctionToolUnionTypeBashServerTool: + // chatFunctionTool.BashServerTool is populated case components.ChatFunctionToolUnionTypeDatetimeServerTool: // chatFunctionTool.DatetimeServerTool is populated case components.ChatFunctionToolUnionTypeImageGenerationServerToolOpenRouter: // chatFunctionTool.ImageGenerationServerToolOpenRouter is populated case components.ChatFunctionToolUnionTypeChatSearchModelsServerTool: // chatFunctionTool.ChatSearchModelsServerTool is populated + case components.ChatFunctionToolUnionTypeSubagentServerToolOpenRouter: + // chatFunctionTool.SubagentServerToolOpenRouter is populated + case components.ChatFunctionToolUnionTypeWebFetchServerTool: + // chatFunctionTool.WebFetchServerTool is populated case components.ChatFunctionToolUnionTypeOpenRouterWebSearchServerTool: // chatFunctionTool.OpenRouterWebSearchServerTool is populated case components.ChatFunctionToolUnionTypeChatWebSearchShorthand: diff --git a/docs/models/components/chatrequest.md b/docs/models/components/chatrequest.md index 58cf3f3b..1c030576 100644 --- a/docs/models/components/chatrequest.md +++ b/docs/models/components/chatrequest.md @@ -5,37 +5,43 @@ Chat completion request parameters ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `CacheControl` | [*components.AnthropicCacheControlDirective](../../models/components/anthropiccachecontroldirective.md) | :heavy_minus_sign: | N/A | {
"type": "ephemeral"
} | -| `Debug` | [*components.ChatDebugOptions](../../models/components/chatdebugoptions.md) | :heavy_minus_sign: | Debug options for inspecting request transformations (streaming only) | {
"echo_upstream_body": true
} | -| `FrequencyPenalty` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | Frequency penalty (-2.0 to 2.0) | 0 | -| `ImageConfig` | map[string][components.ImageConfig](../../models/components/imageconfig.md) | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. | {
"aspect_ratio": "16:9",
"quality": "high"
} | -| `LogitBias` | optionalnullable.OptionalNullable[map[string]`float64`] | :heavy_minus_sign: | Token logit bias adjustments | {
"50256": -100
} | -| `Logprobs` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | Return log probabilities | false | -| `MaxCompletionTokens` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Maximum tokens in completion | 100 | -| `MaxTokens` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16. | 100 | -| `Messages` | [][components.ChatMessages](../../models/components/chatmessages.md) | :heavy_check_mark: | List of messages for the conversation | [
{
"content": "Hello!",
"role": "user"
}
] | -| `Metadata` | map[string]`string` | :heavy_minus_sign: | Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) | {
"session_id": "session-456",
"user_id": "user-123"
} | -| `Modalities` | [][components.Modality](../../models/components/modality.md) | :heavy_minus_sign: | Output modalities for the response. Supported values are "text", "image", and "audio". | [
"text",
"image"
] | -| `Model` | `*string` | :heavy_minus_sign: | Model to use for completion | openai/gpt-4 | -| `Models` | []`string` | :heavy_minus_sign: | Models to use for completion | [
"openai/gpt-4",
"openai/gpt-4o"
] | -| `ParallelToolCalls` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response. | true | -| `Plugins` | [][components.ChatRequestPlugin](../../models/components/chatrequestplugin.md) | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | | -| `PresencePenalty` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | Presence penalty (-2.0 to 2.0) | 0 | -| `Provider` | optionalnullable.OptionalNullable[[components.ProviderPreferences](../../models/components/providerpreferences.md)] | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | {
"allow_fallbacks": true
} | -| `Reasoning` | [*components.Reasoning](../../models/components/reasoning.md) | :heavy_minus_sign: | Configuration options for reasoning models | {
"effort": "medium",
"summary": "concise"
} | -| `ResponseFormat` | [*components.ResponseFormat](../../models/components/responseformat.md) | :heavy_minus_sign: | Response format configuration | {
"type": "json_object"
} | -| `Seed` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Random seed for deterministic outputs | 42 | -| `ServiceTier` | optionalnullable.OptionalNullable[[components.ChatRequestServiceTier](../../models/components/chatrequestservicetier.md)] | :heavy_minus_sign: | The service tier to use for processing this request. | auto | -| `SessionID` | `*string` | :heavy_minus_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. | | -| `Stop` | optionalnullable.OptionalNullable[[components.Stop](../../models/components/stop.md)] | :heavy_minus_sign: | Stop sequences (up to 4) | [
""
] | -| `Stream` | `*bool` | :heavy_minus_sign: | Enable streaming response | false | -| `StreamOptions` | optionalnullable.OptionalNullable[[components.ChatStreamOptions](../../models/components/chatstreamoptions.md)] | :heavy_minus_sign: | Streaming configuration options | {
"include_usage": true
} | -| `Temperature` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | Sampling temperature (0-2) | 0.7 | -| `ToolChoice` | [*components.ChatToolChoice](../../models/components/chattoolchoice.md) | :heavy_minus_sign: | Tool choice configuration | auto | -| `Tools` | [][components.ChatFunctionTool](../../models/components/chatfunctiontool.md) | :heavy_minus_sign: | Available tools for function calling | [
{
"function": {
"description": "Get weather",
"name": "get_weather"
},
"type": "function"
}
] | -| `TopLogprobs` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Number of top log probabilities to return (0-20) | 5 | -| `TopP` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | Nucleus sampling parameter (0-1) | 1 | -| `Trace` | [*components.TraceConfig](../../models/components/traceconfig.md) | :heavy_minus_sign: | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | {
"trace_id": "trace-abc123",
"trace_name": "my-app-trace"
} | -| `User` | `*string` | :heavy_minus_sign: | Unique user identifier | user-123 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CacheControl` | [*components.AnthropicCacheControlDirective](../../models/components/anthropiccachecontroldirective.md) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | {
"type": "ephemeral"
} | +| `Debug` | [*components.ChatDebugOptions](../../models/components/chatdebugoptions.md) | :heavy_minus_sign: | Debug options for inspecting request transformations (streaming only) | {
"echo_upstream_body": true
} | +| `FrequencyPenalty` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | Frequency penalty (-2.0 to 2.0) | 0 | +| `ImageConfig` | map[string][components.ImageConfig](../../models/components/imageconfig.md) | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. | {
"aspect_ratio": "16:9",
"quality": "high"
} | +| `LogitBias` | optionalnullable.OptionalNullable[map[string]`float64`] | :heavy_minus_sign: | Token logit bias adjustments | {
"50256": -100
} | +| `Logprobs` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | Return log probabilities | false | +| `MaxCompletionTokens` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Maximum tokens in completion | 100 | +| `MaxTokens` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16. | 100 | +| `Messages` | [][components.ChatMessages](../../models/components/chatmessages.md) | :heavy_check_mark: | List of messages for the conversation | [
{
"content": "Hello!",
"role": "user"
}
] | +| `Metadata` | map[string]`string` | :heavy_minus_sign: | Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) | {
"session_id": "session-456",
"user_id": "user-123"
} | +| `MinP` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | Minimum probability threshold relative to the most likely token. Tokens with probability below min_p * (probability of top token) are filtered out. Not all providers support this parameter. | 0.1 | +| `Modalities` | [][components.Modality](../../models/components/modality.md) | :heavy_minus_sign: | Output modalities for the response. Supported values are "text", "image", and "audio". | [
"text",
"image"
] | +| `Model` | `*string` | :heavy_minus_sign: | Model to use for completion | openai/gpt-4 | +| `Models` | []`string` | :heavy_minus_sign: | Models to use for completion | [
"openai/gpt-4",
"openai/gpt-4o"
] | +| `ParallelToolCalls` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool calls in a single response. | true | +| `Plugins` | [][components.ChatRequestPlugin](../../models/components/chatrequestplugin.md) | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | | +| `PresencePenalty` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | Presence penalty (-2.0 to 2.0) | 0 | +| `Provider` | optionalnullable.OptionalNullable[[components.ProviderPreferences](../../models/components/providerpreferences.md)] | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | {
"allow_fallbacks": true
} | +| `Reasoning` | [*components.ChatRequestReasoning](../../models/components/chatrequestreasoning.md) | :heavy_minus_sign: | Configuration options for reasoning models | {
"effort": "medium",
"summary": "concise"
} | +| `ReasoningEffort` | optionalnullable.OptionalNullable[[components.ChatRequestReasoningEffort](../../models/components/chatrequestreasoningeffort.md)] | :heavy_minus_sign: | Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. | medium | +| `RepetitionPenalty` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | Penalizes tokens based on how much they have already appeared in the text. A value of 1.0 means no penalty. Values above 1.0 penalize repeated tokens more strongly. Not all providers support this parameter. | 1 | +| `ResponseFormat` | [*components.ResponseFormat](../../models/components/responseformat.md) | :heavy_minus_sign: | Response format configuration | {
"type": "json_object"
} | +| `Seed` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Random seed for deterministic outputs | 42 | +| `ServiceTier` | optionalnullable.OptionalNullable[[components.ChatRequestServiceTier](../../models/components/chatrequestservicetier.md)] | :heavy_minus_sign: | The service tier to use for processing this request. | auto | +| `SessionID` | `*string` | :heavy_minus_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. | | +| `Stop` | optionalnullable.OptionalNullable[[components.Stop](../../models/components/stop.md)] | :heavy_minus_sign: | Stop sequences (up to 4) | [
""
] | +| `StopServerToolsWhen` | [][components.StopServerToolsWhenCondition](../../models/components/stopservertoolswhencondition.md) | :heavy_minus_sign: | Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`. | [
{
"step_count": 5,
"type": "step_count_is"
},
{
"max_cost_in_dollars": 0.5,
"type": "max_cost"
}
] | +| `Stream` | `*bool` | :heavy_minus_sign: | Enable streaming response | false | +| `StreamOptions` | optionalnullable.OptionalNullable[[components.ChatStreamOptions](../../models/components/chatstreamoptions.md)] | :heavy_minus_sign: | Streaming configuration options | {
"include_usage": true
} | +| `Temperature` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | Sampling temperature (0-2) | 0.7 | +| `ToolChoice` | [*components.ChatToolChoice](../../models/components/chattoolchoice.md) | :heavy_minus_sign: | Tool choice configuration | auto | +| `Tools` | [][components.ChatFunctionTool](../../models/components/chatfunctiontool.md) | :heavy_minus_sign: | Available tools for function calling | [
{
"function": {
"description": "Get weather",
"name": "get_weather"
},
"type": "function"
}
] | +| `TopA` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | Consider only tokens with "sufficiently high" probabilities based on the probability of the most likely token. Not all providers support this parameter. | 0 | +| `TopK` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Limits the model to choose from the top K most likely tokens at each step. A value of 1 means the model will always pick the most likely next token. Not all providers support this parameter. | 40 | +| `TopLogprobs` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Number of top log probabilities to return (0-20) | 5 | +| `TopP` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | Nucleus sampling parameter (0-1) | 1 | +| `Trace` | [*components.TraceConfig](../../models/components/traceconfig.md) | :heavy_minus_sign: | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | {
"trace_id": "trace-abc123",
"trace_name": "my-app-trace"
} | +| `User` | `*string` | :heavy_minus_sign: | Unique user identifier | user-123 | \ No newline at end of file diff --git a/docs/models/components/chatrequesteffort.md b/docs/models/components/chatrequesteffort.md new file mode 100644 index 00000000..499c1234 --- /dev/null +++ b/docs/models/components/chatrequesteffort.md @@ -0,0 +1,28 @@ +# ChatRequestEffort + +Constrains effort on reasoning for reasoning models + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ChatRequestEffortXhigh + +// Open enum: custom values can be created with a direct type cast +custom := components.ChatRequestEffort("custom_value") +``` + + +## Values + +| Name | Value | +| -------------------------- | -------------------------- | +| `ChatRequestEffortXhigh` | xhigh | +| `ChatRequestEffortHigh` | high | +| `ChatRequestEffortMedium` | medium | +| `ChatRequestEffortLow` | low | +| `ChatRequestEffortMinimal` | minimal | +| `ChatRequestEffortNone` | none | \ No newline at end of file diff --git a/docs/models/components/chatrequestplugin.md b/docs/models/components/chatrequestplugin.md index e2aeef1f..fb028ef4 100644 --- a/docs/models/components/chatrequestplugin.md +++ b/docs/models/components/chatrequestplugin.md @@ -21,6 +21,12 @@ chatRequestPlugin := components.CreateChatRequestPluginContextCompression(compon chatRequestPlugin := components.CreateChatRequestPluginFileParser(components.FileParserPlugin{/* values here */}) ``` +### FusionPlugin + +```go +chatRequestPlugin := components.CreateChatRequestPluginFusion(components.FusionPlugin{/* values here */}) +``` + ### ModerationPlugin ```go @@ -45,6 +51,12 @@ chatRequestPlugin := components.CreateChatRequestPluginResponseHealing(component chatRequestPlugin := components.CreateChatRequestPluginWeb(components.WebSearchPlugin{/* values here */}) ``` +### WebFetchPlugin + +```go +chatRequestPlugin := components.CreateChatRequestPluginWebFetch(components.WebFetchPlugin{/* values here */}) +``` + ## Union Discrimination Use the `Type` field to determine which variant is active, then access the corresponding field: @@ -57,6 +69,8 @@ switch chatRequestPlugin.Type { // chatRequestPlugin.ContextCompressionPlugin is populated case components.ChatRequestPluginTypeFileParser: // chatRequestPlugin.FileParserPlugin is populated + case components.ChatRequestPluginTypeFusion: + // chatRequestPlugin.FusionPlugin is populated case components.ChatRequestPluginTypeModeration: // chatRequestPlugin.ModerationPlugin is populated case components.ChatRequestPluginTypeParetoRouter: @@ -65,5 +79,7 @@ switch chatRequestPlugin.Type { // chatRequestPlugin.ResponseHealingPlugin is populated case components.ChatRequestPluginTypeWeb: // chatRequestPlugin.WebSearchPlugin is populated + case components.ChatRequestPluginTypeWebFetch: + // chatRequestPlugin.WebFetchPlugin is populated } ``` diff --git a/docs/models/components/reasoning.md b/docs/models/components/chatrequestreasoning.md similarity index 94% rename from docs/models/components/reasoning.md rename to docs/models/components/chatrequestreasoning.md index ef272e79..e8a685e8 100644 --- a/docs/models/components/reasoning.md +++ b/docs/models/components/chatrequestreasoning.md @@ -1,4 +1,4 @@ -# Reasoning +# ChatRequestReasoning Configuration options for reasoning models @@ -7,5 +7,5 @@ Configuration options for reasoning models | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | -| `Effort` | optionalnullable.OptionalNullable[[components.Effort](../../models/components/effort.md)] | :heavy_minus_sign: | Constrains effort on reasoning for reasoning models | medium | +| `Effort` | optionalnullable.OptionalNullable[[components.ChatRequestEffort](../../models/components/chatrequesteffort.md)] | :heavy_minus_sign: | Constrains effort on reasoning for reasoning models | medium | | `Summary` | optionalnullable.OptionalNullable[[components.ChatReasoningSummaryVerbosityEnum](../../models/components/chatreasoningsummaryverbosityenum.md)] | :heavy_minus_sign: | N/A | concise | \ No newline at end of file diff --git a/docs/models/components/chatrequestreasoningeffort.md b/docs/models/components/chatrequestreasoningeffort.md new file mode 100644 index 00000000..86722c52 --- /dev/null +++ b/docs/models/components/chatrequestreasoningeffort.md @@ -0,0 +1,28 @@ +# ChatRequestReasoningEffort + +Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ChatRequestReasoningEffortXhigh + +// Open enum: custom values can be created with a direct type cast +custom := components.ChatRequestReasoningEffort("custom_value") +``` + + +## Values + +| Name | Value | +| ----------------------------------- | ----------------------------------- | +| `ChatRequestReasoningEffortXhigh` | xhigh | +| `ChatRequestReasoningEffortHigh` | high | +| `ChatRequestReasoningEffortMedium` | medium | +| `ChatRequestReasoningEffortLow` | low | +| `ChatRequestReasoningEffortMinimal` | minimal | +| `ChatRequestReasoningEffortNone` | none | \ No newline at end of file diff --git a/docs/models/components/chatresult.md b/docs/models/components/chatresult.md index 11876116..9a6728c7 100644 --- a/docs/models/components/chatresult.md +++ b/docs/models/components/chatresult.md @@ -5,13 +5,14 @@ Chat completion response ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Choices` | [][components.ChatChoice](../../models/components/chatchoice.md) | :heavy_check_mark: | List of completion choices | | -| `Created` | `int64` | :heavy_check_mark: | Unix timestamp of creation | 1677652288 | -| `ID` | `string` | :heavy_check_mark: | Unique completion identifier | chatcmpl-123 | -| `Model` | `string` | :heavy_check_mark: | Model used for completion | openai/gpt-4 | -| `Object` | [components.ChatResultObject](../../models/components/chatresultobject.md) | :heavy_check_mark: | N/A | | -| `ServiceTier` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | The service tier used by the upstream provider for this request | default | -| `SystemFingerprint` | `*string` | :heavy_check_mark: | System fingerprint | fp_44709d6fcb | -| `Usage` | [*components.ChatUsage](../../models/components/chatusage.md) | :heavy_minus_sign: | Token usage statistics | {
"completion_tokens": 15,
"completion_tokens_details": {
"reasoning_tokens": 5
},
"prompt_tokens": 10,
"prompt_tokens_details": {
"cached_tokens": 2
},
"total_tokens": 25
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Choices` | [][components.ChatChoice](../../models/components/chatchoice.md) | :heavy_check_mark: | List of completion choices | | +| `Created` | `int64` | :heavy_check_mark: | Unix timestamp of creation | 1677652288 | +| `ID` | `string` | :heavy_check_mark: | Unique completion identifier | chatcmpl-123 | +| `Model` | `string` | :heavy_check_mark: | Model used for completion | openai/gpt-4 | +| `Object` | [components.ChatResultObject](../../models/components/chatresultobject.md) | :heavy_check_mark: | N/A | | +| `OpenrouterMetadata` | [*components.OpenRouterMetadata](../../models/components/openroutermetadata.md) | :heavy_minus_sign: | N/A | {
"attempt": 1,
"endpoints": {
"available": [
{
"model": "openai/gpt-4o",
"provider": "OpenAI",
"selected": true
}
],
"total": 1
},
"is_byok": false,
"region": "iad",
"requested": "openai/gpt-4o",
"strategy": "direct",
"summary": "available=1, selected=OpenAI"
} | +| `ServiceTier` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | The service tier used by the upstream provider for this request | default | +| `SystemFingerprint` | `*string` | :heavy_check_mark: | System fingerprint | fp_44709d6fcb | +| `Usage` | [*components.ChatUsage](../../models/components/chatusage.md) | :heavy_minus_sign: | Token usage statistics | {
"completion_tokens": 15,
"completion_tokens_details": {
"reasoning_tokens": 5
},
"cost": 0.0012,
"cost_details": {
"upstream_inference_completions_cost": 0.0004,
"upstream_inference_cost": null,
"upstream_inference_prompt_cost": 0.0008
},
"is_byok": false,
"prompt_tokens": 10,
"prompt_tokens_details": {
"cached_tokens": 2
},
"total_tokens": 25
} | \ No newline at end of file diff --git a/docs/models/components/chatservertoolchoice.md b/docs/models/components/chatservertoolchoice.md new file mode 100644 index 00000000..ec6bed1e --- /dev/null +++ b/docs/models/components/chatservertoolchoice.md @@ -0,0 +1,10 @@ +# ChatServerToolChoice + +OpenRouter extension: force a specific server tool by naming it directly in `tool_choice.type` instead of wrapping it in `{ type: "function", function: { name } }`. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `Type` | `string` | :heavy_check_mark: | OpenRouter server-tool type to force (e.g. `openrouter:web_search`, `web_search`, `web_search_preview`). | openrouter:web_search | \ No newline at end of file diff --git a/docs/models/components/chatstreamchunk.md b/docs/models/components/chatstreamchunk.md index 54ec70b6..4194e190 100644 --- a/docs/models/components/chatstreamchunk.md +++ b/docs/models/components/chatstreamchunk.md @@ -5,14 +5,15 @@ Streaming chat completion chunk ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Choices` | [][components.ChatStreamChoice](../../models/components/chatstreamchoice.md) | :heavy_check_mark: | List of streaming chunk choices | | -| `Created` | `int64` | :heavy_check_mark: | Unix timestamp of creation | 1677652288 | -| `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error information | {
"code": 429,
"message": "Rate limit exceeded"
} | -| `ID` | `string` | :heavy_check_mark: | Unique chunk identifier | chatcmpl-123 | -| `Model` | `string` | :heavy_check_mark: | Model used for completion | openai/gpt-4 | -| `Object` | [components.ChatStreamChunkObject](../../models/components/chatstreamchunkobject.md) | :heavy_check_mark: | N/A | | -| `ServiceTier` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | The service tier used by the upstream provider for this request | default | -| `SystemFingerprint` | `*string` | :heavy_minus_sign: | System fingerprint | fp_44709d6fcb | -| `Usage` | [*components.ChatUsage](../../models/components/chatusage.md) | :heavy_minus_sign: | Token usage statistics | {
"completion_tokens": 15,
"completion_tokens_details": {
"reasoning_tokens": 5
},
"prompt_tokens": 10,
"prompt_tokens_details": {
"cached_tokens": 2
},
"total_tokens": 25
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Choices` | [][components.ChatStreamChoice](../../models/components/chatstreamchoice.md) | :heavy_check_mark: | List of streaming chunk choices | | +| `Created` | `int64` | :heavy_check_mark: | Unix timestamp of creation | 1677652288 | +| `Error` | [*components.Error](../../models/components/error.md) | :heavy_minus_sign: | Error information | {
"code": 429,
"message": "Rate limit exceeded"
} | +| `ID` | `string` | :heavy_check_mark: | Unique chunk identifier | chatcmpl-123 | +| `Model` | `string` | :heavy_check_mark: | Model used for completion | openai/gpt-4 | +| `Object` | [components.ChatStreamChunkObject](../../models/components/chatstreamchunkobject.md) | :heavy_check_mark: | N/A | | +| `OpenrouterMetadata` | [*components.OpenRouterMetadata](../../models/components/openroutermetadata.md) | :heavy_minus_sign: | N/A | {
"attempt": 1,
"endpoints": {
"available": [
{
"model": "openai/gpt-4o",
"provider": "OpenAI",
"selected": true
}
],
"total": 1
},
"is_byok": false,
"region": "iad",
"requested": "openai/gpt-4o",
"strategy": "direct",
"summary": "available=1, selected=OpenAI"
} | +| `ServiceTier` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | The service tier used by the upstream provider for this request | default | +| `SystemFingerprint` | `*string` | :heavy_minus_sign: | System fingerprint | fp_44709d6fcb | +| `Usage` | [*components.ChatUsage](../../models/components/chatusage.md) | :heavy_minus_sign: | Token usage statistics | {
"completion_tokens": 15,
"completion_tokens_details": {
"reasoning_tokens": 5
},
"cost": 0.0012,
"cost_details": {
"upstream_inference_completions_cost": 0.0004,
"upstream_inference_cost": null,
"upstream_inference_prompt_cost": 0.0008
},
"is_byok": false,
"prompt_tokens": 10,
"prompt_tokens_details": {
"cached_tokens": 2
},
"total_tokens": 25
} | \ No newline at end of file diff --git a/docs/models/components/chatstreamdelta.md b/docs/models/components/chatstreamdelta.md index 5d934c4b..c33cee92 100644 --- a/docs/models/components/chatstreamdelta.md +++ b/docs/models/components/chatstreamdelta.md @@ -11,6 +11,6 @@ Delta changes in streaming response | `Content` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Message content delta | Hello | | `Reasoning` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Reasoning content delta | I need to | | `ReasoningDetails` | [][components.ReasoningDetailUnion](../../models/components/reasoningdetailunion.md) | :heavy_minus_sign: | Reasoning details for extended thinking models | [
{
"text": "Let me think about this...",
"type": "text"
}
] | -| `Refusal` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Refusal message delta | | +| `Refusal` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Refusal message delta | null | | `Role` | [*components.ChatStreamDeltaRole](../../models/components/chatstreamdeltarole.md) | :heavy_minus_sign: | The role of the message author | assistant | | `ToolCalls` | [][components.ChatStreamToolCall](../../models/components/chatstreamtoolcall.md) | :heavy_minus_sign: | Tool calls delta | | \ No newline at end of file diff --git a/docs/models/operations/sendchatcompletionrequestresponsebody.md b/docs/models/components/chatstreamingresponse.md similarity index 97% rename from docs/models/operations/sendchatcompletionrequestresponsebody.md rename to docs/models/components/chatstreamingresponse.md index c3333268..ca27dbc4 100644 --- a/docs/models/operations/sendchatcompletionrequestresponsebody.md +++ b/docs/models/components/chatstreamingresponse.md @@ -1,6 +1,4 @@ -# SendChatCompletionRequestResponseBody - -Successful chat completion response +# ChatStreamingResponse ## Fields diff --git a/docs/models/components/chattoolchoice.md b/docs/models/components/chattoolchoice.md index e62b62c4..ee05100f 100644 --- a/docs/models/components/chattoolchoice.md +++ b/docs/models/components/chattoolchoice.md @@ -29,6 +29,12 @@ chatToolChoice := components.CreateChatToolChoiceChatToolChoiceRequired(componen chatToolChoice := components.CreateChatToolChoiceChatNamedToolChoice(components.ChatNamedToolChoice{/* values here */}) ``` +### ChatServerToolChoice + +```go +chatToolChoice := components.CreateChatToolChoiceChatServerToolChoice(components.ChatServerToolChoice{/* values here */}) +``` + ## Union Discrimination Use the `Type` field to determine which variant is active, then access the corresponding field: @@ -43,5 +49,7 @@ switch chatToolChoice.Type { // chatToolChoice.ChatToolChoiceRequired is populated case components.ChatToolChoiceTypeChatNamedToolChoice: // chatToolChoice.ChatNamedToolChoice is populated + case components.ChatToolChoiceTypeChatServerToolChoice: + // chatToolChoice.ChatServerToolChoice is populated } ``` diff --git a/docs/models/components/chatusage.md b/docs/models/components/chatusage.md index f3d29a1a..e540306a 100644 --- a/docs/models/components/chatusage.md +++ b/docs/models/components/chatusage.md @@ -5,10 +5,13 @@ Token usage statistics ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `CompletionTokens` | `int64` | :heavy_check_mark: | Number of tokens in the completion | -| `CompletionTokensDetails` | optionalnullable.OptionalNullable[[components.CompletionTokensDetails](../../models/components/completiontokensdetails.md)] | :heavy_minus_sign: | Detailed completion token usage | -| `PromptTokens` | `int64` | :heavy_check_mark: | Number of tokens in the prompt | -| `PromptTokensDetails` | optionalnullable.OptionalNullable[[components.PromptTokensDetails](../../models/components/prompttokensdetails.md)] | :heavy_minus_sign: | Detailed prompt token usage | -| `TotalTokens` | `int64` | :heavy_check_mark: | Total number of tokens | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `CompletionTokens` | `int64` | :heavy_check_mark: | Number of tokens in the completion | | +| `CompletionTokensDetails` | optionalnullable.OptionalNullable[[components.CompletionTokensDetails](../../models/components/completiontokensdetails.md)] | :heavy_minus_sign: | Detailed completion token usage | | +| `Cost` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | Cost of the completion | | +| `CostDetails` | optionalnullable.OptionalNullable[[components.CostDetails](../../models/components/costdetails.md)] | :heavy_minus_sign: | Breakdown of upstream inference costs | {
"upstream_inference_completions_cost": 0.0004,
"upstream_inference_cost": null,
"upstream_inference_prompt_cost": 0.0008
} | +| `IsByok` | `*bool` | :heavy_minus_sign: | Whether a request was made using a Bring Your Own Key configuration | | +| `PromptTokens` | `int64` | :heavy_check_mark: | Number of tokens in the prompt | | +| `PromptTokensDetails` | optionalnullable.OptionalNullable[[components.PromptTokensDetails](../../models/components/prompttokensdetails.md)] | :heavy_minus_sign: | Detailed prompt token usage | | +| `TotalTokens` | `int64` | :heavy_check_mark: | Total number of tokens | | \ No newline at end of file diff --git a/docs/models/components/chatwebsearchshorthand.md b/docs/models/components/chatwebsearchshorthand.md index 9ba2ef17..b8b2bea7 100644 --- a/docs/models/components/chatwebsearchshorthand.md +++ b/docs/models/components/chatwebsearchshorthand.md @@ -5,14 +5,15 @@ Web search tool using OpenAI Responses API syntax. Automatically converted to op ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AllowedDomains` | []`string` | :heavy_minus_sign: | Limit search results to these domains. Supported by Exa, Parallel, and most native providers (Anthropic, OpenAI, xAI). Not supported with Firecrawl or Perplexity. | | -| `Engine` | [*components.WebSearchEngineEnum](../../models/components/websearchengineenum.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. | auto | -| `ExcludedDomains` | []`string` | :heavy_minus_sign: | Exclude search results from these domains. Supported by Exa, Parallel, Anthropic, and xAI. Not supported with Firecrawl, OpenAI (silently ignored), or Perplexity. | | -| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and Parallel engines; ignored with native provider search. | 5 | -| `MaxTotalResults` | `*int64` | :heavy_minus_sign: | Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. | 20 | -| `Parameters` | [*components.WebSearchConfig](../../models/components/websearchconfig.md) | :heavy_minus_sign: | N/A | {
"max_results": 5,
"search_context_size": "medium"
} | -| `SearchContextSize` | [*components.SearchQualityLevel](../../models/components/searchqualitylevel.md) | :heavy_minus_sign: | How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search. | medium | -| `Type` | [components.ChatWebSearchShorthandType](../../models/components/chatwebsearchshorthandtype.md) | :heavy_check_mark: | N/A | | -| `UserLocation` | [*components.WebSearchUserLocationServerTool](../../models/components/websearchuserlocationservertool.md) | :heavy_minus_sign: | Approximate user location for location-biased results. | {
"city": "San Francisco",
"country": "US",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AllowedDomains` | []`string` | :heavy_minus_sign: | Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI, xAI). Cannot be used with excluded_domains. | | +| `Engine` | [*components.WebSearchEngineEnum](../../models/components/websearchengineenum.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). | auto | +| `ExcludedDomains` | []`string` | :heavy_minus_sign: | Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, and xAI. Not supported with OpenAI (silently ignored). Cannot be used with allowed_domains. | | +| `MaxCharacters` | `*int64` | :heavy_minus_sign: | Exact maximum number of characters of content per search result. Applies to the Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, caps highlight content per result. For Parallel, caps excerpt content per result (default 1,500 when omitted). For Perplexity, maps to the native `max_tokens_per_page` parameter (converted from characters to tokens) and trims the response to the exact character cap. When both `max_characters` and `search_context_size` are set, `max_characters` takes precedence. When omitted, falls back to `search_context_size` mapping (Exa) or engine defaults (Parallel, Perplexity). | 2000 | +| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. | 5 | +| `MaxTotalResults` | `*int64` | :heavy_minus_sign: | Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. Defaults to 50 when not specified. | 50 | +| `Parameters` | [*components.WebSearchConfig](../../models/components/websearchconfig.md) | :heavy_minus_sign: | N/A | {
"max_results": 5,
"search_context_size": "medium"
} | +| `SearchContextSize` | [*components.SearchQualityLevel](../../models/components/searchqualitylevel.md) | :heavy_minus_sign: | How much context to retrieve per result. Applies to Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, pins a fixed per-result character cap (low=5,000, medium=15,000, high=30,000); when omitted, Exa picks an adaptive size per query and document (typically ~2,000–4,000 characters per result). For Parallel, controls the total characters across all results; when omitted, Parallel uses its own default size. For Perplexity, maps directly to the Search API's native search_context_size parameter. Overridden by `max_characters` when both are set. | medium | +| `Type` | [components.ChatWebSearchShorthandType](../../models/components/chatwebsearchshorthandtype.md) | :heavy_check_mark: | N/A | | +| `UserLocation` | [*components.WebSearchUserLocationServerTool](../../models/components/websearchuserlocationservertool.md) | :heavy_minus_sign: | Approximate user location for location-biased results. | {
"city": "San Francisco",
"country": "US",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file diff --git a/docs/models/components/citation.md b/docs/models/components/citation.md new file mode 100644 index 00000000..a81aeb24 --- /dev/null +++ b/docs/models/components/citation.md @@ -0,0 +1,53 @@ +# Citation + + +## Supported Types + +### AnthropicCitationCharLocationParam + +```go +citation := components.CreateCitationCharLocation(components.AnthropicCitationCharLocationParam{/* values here */}) +``` + +### AnthropicCitationContentBlockLocationParam + +```go +citation := components.CreateCitationContentBlockLocation(components.AnthropicCitationContentBlockLocationParam{/* values here */}) +``` + +### AnthropicCitationPageLocationParam + +```go +citation := components.CreateCitationPageLocation(components.AnthropicCitationPageLocationParam{/* values here */}) +``` + +### AnthropicCitationSearchResultLocation + +```go +citation := components.CreateCitationSearchResultLocation(components.AnthropicCitationSearchResultLocation{/* values here */}) +``` + +### AnthropicCitationWebSearchResultLocation + +```go +citation := components.CreateCitationWebSearchResultLocation(components.AnthropicCitationWebSearchResultLocation{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch citation.Type { + case components.CitationTypeCharLocation: + // citation.AnthropicCitationCharLocationParam is populated + case components.CitationTypeContentBlockLocation: + // citation.AnthropicCitationContentBlockLocationParam is populated + case components.CitationTypePageLocation: + // citation.AnthropicCitationPageLocationParam is populated + case components.CitationTypeSearchResultLocation: + // citation.AnthropicCitationSearchResultLocation is populated + case components.CitationTypeWebSearchResultLocation: + // citation.AnthropicCitationWebSearchResultLocation is populated +} +``` diff --git a/docs/models/components/cleartoolinputs.md b/docs/models/components/cleartoolinputs.md new file mode 100644 index 00000000..1a877aff --- /dev/null +++ b/docs/models/components/cleartoolinputs.md @@ -0,0 +1,37 @@ +# ClearToolInputs + + +## Supported Types + +### + +```go +clearToolInputs := components.CreateClearToolInputsBoolean(bool{/* values here */}) +``` + +### + +```go +clearToolInputs := components.CreateClearToolInputsArrayOfStr([]string{/* values here */}) +``` + +### + +```go +clearToolInputs := components.CreateClearToolInputsAny(any{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch clearToolInputs.Type { + case components.ClearToolInputsTypeBoolean: + // clearToolInputs.Boolean is populated + case components.ClearToolInputsTypeArrayOfStr: + // clearToolInputs.ArrayOfStr is populated + case components.ClearToolInputsTypeAny: + // clearToolInputs.Any is populated +} +``` diff --git a/docs/models/components/compactionitem.md b/docs/models/components/compactionitem.md new file mode 100644 index 00000000..598ee73b --- /dev/null +++ b/docs/models/components/compactionitem.md @@ -0,0 +1,12 @@ +# CompactionItem + +A context compaction marker with encrypted summary + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `EncryptedContent` | `string` | :heavy_check_mark: | N/A | +| `ID` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `Type` | [components.CompactionItemType](../../models/components/compactionitemtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/compactionitemtype.md b/docs/models/components/compactionitemtype.md new file mode 100644 index 00000000..6420ec31 --- /dev/null +++ b/docs/models/components/compactionitemtype.md @@ -0,0 +1,18 @@ +# CompactionItemType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.CompactionItemTypeCompaction +``` + + +## Values + +| Name | Value | +| ------------------------------ | ------------------------------ | +| `CompactionItemTypeCompaction` | compaction | \ No newline at end of file diff --git a/docs/models/components/containerautoenvironment.md b/docs/models/components/containerautoenvironment.md new file mode 100644 index 00000000..cdaf4c21 --- /dev/null +++ b/docs/models/components/containerautoenvironment.md @@ -0,0 +1,10 @@ +# ContainerAutoEnvironment + +An OpenRouter-managed, auto-provisioned ephemeral container. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `Type` | [components.ContainerAutoEnvironmentType](../../models/components/containerautoenvironmenttype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/containerautoenvironmenttype.md b/docs/models/components/containerautoenvironmenttype.md new file mode 100644 index 00000000..91038e1f --- /dev/null +++ b/docs/models/components/containerautoenvironmenttype.md @@ -0,0 +1,18 @@ +# ContainerAutoEnvironmentType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ContainerAutoEnvironmentTypeContainerAuto +``` + + +## Values + +| Name | Value | +| ------------------------------------------- | ------------------------------------------- | +| `ContainerAutoEnvironmentTypeContainerAuto` | container_auto | \ No newline at end of file diff --git a/docs/models/components/containerreferenceenvironment.md b/docs/models/components/containerreferenceenvironment.md new file mode 100644 index 00000000..0c1e5f0b --- /dev/null +++ b/docs/models/components/containerreferenceenvironment.md @@ -0,0 +1,11 @@ +# ContainerReferenceEnvironment + +Reference to a previously created container to reuse. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `ContainerID` | `string` | :heavy_check_mark: | Identifier of an existing container to reuse (max 20 characters). | cntr_abc123 | +| `Type` | [components.ContainerReferenceEnvironmentType](../../models/components/containerreferenceenvironmenttype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/containerreferenceenvironmenttype.md b/docs/models/components/containerreferenceenvironmenttype.md new file mode 100644 index 00000000..f43e9094 --- /dev/null +++ b/docs/models/components/containerreferenceenvironmenttype.md @@ -0,0 +1,18 @@ +# ContainerReferenceEnvironmentType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ContainerReferenceEnvironmentTypeContainerReference +``` + + +## Values + +| Name | Value | +| ----------------------------------------------------- | ----------------------------------------------------- | +| `ContainerReferenceEnvironmentTypeContainerReference` | container_reference | \ No newline at end of file diff --git a/docs/models/components/contentcompaction.md b/docs/models/components/contentcompaction.md new file mode 100644 index 00000000..df38ba90 --- /dev/null +++ b/docs/models/components/contentcompaction.md @@ -0,0 +1,10 @@ +# ContentCompaction + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CacheControl` | [*components.AnthropicCacheControlDirective](../../models/components/anthropiccachecontroldirective.md) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | {
"type": "ephemeral"
} | +| `Content` | `*string` | :heavy_check_mark: | N/A | | +| `Type` | [components.MessagesMessageParamTypeCompaction](../../models/components/messagesmessageparamtypecompaction.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/contentfilteraction.md b/docs/models/components/contentfilteraction.md new file mode 100644 index 00000000..fee5a8e5 --- /dev/null +++ b/docs/models/components/contentfilteraction.md @@ -0,0 +1,24 @@ +# ContentFilterAction + +Action taken when the pattern matches + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ContentFilterActionRedact + +// Open enum: custom values can be created with a direct type cast +custom := components.ContentFilterAction("custom_value") +``` + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `ContentFilterActionRedact` | redact | +| `ContentFilterActionBlock` | block | \ No newline at end of file diff --git a/docs/models/components/contentfilterbuiltinaction.md b/docs/models/components/contentfilterbuiltinaction.md new file mode 100644 index 00000000..832d63ae --- /dev/null +++ b/docs/models/components/contentfilterbuiltinaction.md @@ -0,0 +1,25 @@ +# ContentFilterBuiltinAction + +Action taken when the builtin filter triggers + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ContentFilterBuiltinActionRedact + +// Open enum: custom values can be created with a direct type cast +custom := components.ContentFilterBuiltinAction("custom_value") +``` + + +## Values + +| Name | Value | +| ---------------------------------- | ---------------------------------- | +| `ContentFilterBuiltinActionRedact` | redact | +| `ContentFilterBuiltinActionBlock` | block | +| `ContentFilterBuiltinActionFlag` | flag | \ No newline at end of file diff --git a/docs/models/components/contentfilterbuiltinentry.md b/docs/models/components/contentfilterbuiltinentry.md new file mode 100644 index 00000000..575f66d3 --- /dev/null +++ b/docs/models/components/contentfilterbuiltinentry.md @@ -0,0 +1,13 @@ +# ContentFilterBuiltinEntry + +A builtin content filter entry. Builtin filters include PII detectors and the regex-based prompt injection detector. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `Action` | [components.ContentFilterBuiltinAction](../../models/components/contentfilterbuiltinaction.md) | :heavy_check_mark: | Action taken when the builtin filter triggers | block | +| `Label` | `*string` | :heavy_minus_sign: | Read-only, system-assigned redaction placeholder derived from the slug (e.g. "[EMAIL]", "[PHONE]"). Not settable by the caller. | [EMAIL] | +| `ScanScope` | [*components.PromptInjectionScanScope](../../models/components/promptinjectionscanscope.md) | :heavy_minus_sign: | Which message roles to scan for prompt injection. Only applies to the regex-prompt-injection builtin. Defaults to all_messages. | user_only | +| `Slug` | [components.ContentFilterBuiltinSlug](../../models/components/contentfilterbuiltinslug.md) | :heavy_check_mark: | The builtin filter identifier | regex-prompt-injection | \ No newline at end of file diff --git a/docs/models/components/contentfilterbuiltinentryinput.md b/docs/models/components/contentfilterbuiltinentryinput.md new file mode 100644 index 00000000..2732c003 --- /dev/null +++ b/docs/models/components/contentfilterbuiltinentryinput.md @@ -0,0 +1,13 @@ +# ContentFilterBuiltinEntryInput + +A builtin content filter entry for create/update requests. Labels are system-assigned and cannot be set by the caller. + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Action` | [components.ContentFilterBuiltinAction](../../models/components/contentfilterbuiltinaction.md) | :heavy_check_mark: | Action taken when the builtin filter triggers | block | +| ~~`Label`~~ | `*string` | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated: labels are system-assigned and cannot be set by the caller. Accepted for backward compatibility but silently ignored. | | +| `ScanScope` | [*components.PromptInjectionScanScope](../../models/components/promptinjectionscanscope.md) | :heavy_minus_sign: | Which message roles to scan for prompt injection. Only applies to the regex-prompt-injection builtin. Defaults to all_messages. | user_only | +| `Slug` | [components.ContentFilterBuiltinSlug](../../models/components/contentfilterbuiltinslug.md) | :heavy_check_mark: | The builtin filter identifier | regex-prompt-injection | \ No newline at end of file diff --git a/docs/models/components/contentfilterbuiltinslug.md b/docs/models/components/contentfilterbuiltinslug.md new file mode 100644 index 00000000..a65c6c7b --- /dev/null +++ b/docs/models/components/contentfilterbuiltinslug.md @@ -0,0 +1,30 @@ +# ContentFilterBuiltinSlug + +The builtin filter identifier + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ContentFilterBuiltinSlugEmail + +// Open enum: custom values can be created with a direct type cast +custom := components.ContentFilterBuiltinSlug("custom_value") +``` + + +## Values + +| Name | Value | +| ---------------------------------------------- | ---------------------------------------------- | +| `ContentFilterBuiltinSlugEmail` | email | +| `ContentFilterBuiltinSlugPhone` | phone | +| `ContentFilterBuiltinSlugSsn` | ssn | +| `ContentFilterBuiltinSlugCreditCard` | credit-card | +| `ContentFilterBuiltinSlugIPAddress` | ip-address | +| `ContentFilterBuiltinSlugPersonName` | person-name | +| `ContentFilterBuiltinSlugAddress` | address | +| `ContentFilterBuiltinSlugRegexPromptInjection` | regex-prompt-injection | \ No newline at end of file diff --git a/docs/models/components/contentfilterentry.md b/docs/models/components/contentfilterentry.md new file mode 100644 index 00000000..14bb3e48 --- /dev/null +++ b/docs/models/components/contentfilterentry.md @@ -0,0 +1,12 @@ +# ContentFilterEntry + +A custom regex content filter that scans request messages for matching patterns. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `Action` | [components.ContentFilterAction](../../models/components/contentfilteraction.md) | :heavy_check_mark: | Action taken when the pattern matches | block | +| `Label` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Optional label used in redaction placeholders or error messages | [API_KEY] | +| `Pattern` | `string` | :heavy_check_mark: | A regex pattern to match against request content | \b(sk-[a-zA-Z0-9]{48})\b | \ No newline at end of file diff --git a/docs/models/components/contentpartaudio.md b/docs/models/components/contentpartaudio.md new file mode 100644 index 00000000..2c258e87 --- /dev/null +++ b/docs/models/components/contentpartaudio.md @@ -0,0 +1,9 @@ +# ContentPartAudio + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `AudioURL` | [components.AudioURL](../../models/components/audiourl.md) | :heavy_check_mark: | N/A | +| `Type` | [components.ContentPartAudioType](../../models/components/contentpartaudiotype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/contentpartaudiotype.md b/docs/models/components/contentpartaudiotype.md new file mode 100644 index 00000000..b83987eb --- /dev/null +++ b/docs/models/components/contentpartaudiotype.md @@ -0,0 +1,18 @@ +# ContentPartAudioType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ContentPartAudioTypeAudioURL +``` + + +## Values + +| Name | Value | +| ------------------------------ | ------------------------------ | +| `ContentPartAudioTypeAudioURL` | audio_url | \ No newline at end of file diff --git a/docs/models/components/contentpartinputaudio.md b/docs/models/components/contentpartinputaudio.md new file mode 100644 index 00000000..24a9dbbd --- /dev/null +++ b/docs/models/components/contentpartinputaudio.md @@ -0,0 +1,9 @@ +# ContentPartInputAudio + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `InputAudio` | [components.MultimodalMedia](../../models/components/multimodalmedia.md) | :heavy_check_mark: | N/A | {
"data": "data:audio/wav;base64,UklGRiQAAABXQVZFZm10IBAAAAA...",
"format": "wav"
} | +| `Type` | [components.ContentPartInputAudioType](../../models/components/contentpartinputaudiotype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/contentpartinputaudiotype.md b/docs/models/components/contentpartinputaudiotype.md new file mode 100644 index 00000000..241f1ab9 --- /dev/null +++ b/docs/models/components/contentpartinputaudiotype.md @@ -0,0 +1,18 @@ +# ContentPartInputAudioType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ContentPartInputAudioTypeInputAudio +``` + + +## Values + +| Name | Value | +| ------------------------------------- | ------------------------------------- | +| `ContentPartInputAudioTypeInputAudio` | input_audio | \ No newline at end of file diff --git a/docs/models/components/contentpartinputfile.md b/docs/models/components/contentpartinputfile.md new file mode 100644 index 00000000..414e0ef4 --- /dev/null +++ b/docs/models/components/contentpartinputfile.md @@ -0,0 +1,9 @@ +# ContentPartInputFile + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `InputFile` | [components.MultimodalMedia](../../models/components/multimodalmedia.md) | :heavy_check_mark: | N/A | {
"data": "data:audio/wav;base64,UklGRiQAAABXQVZFZm10IBAAAAA...",
"format": "wav"
} | +| `Type` | [components.ContentPartInputFileType](../../models/components/contentpartinputfiletype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/contentpartinputfiletype.md b/docs/models/components/contentpartinputfiletype.md new file mode 100644 index 00000000..ad9b792a --- /dev/null +++ b/docs/models/components/contentpartinputfiletype.md @@ -0,0 +1,18 @@ +# ContentPartInputFileType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ContentPartInputFileTypeInputFile +``` + + +## Values + +| Name | Value | +| ----------------------------------- | ----------------------------------- | +| `ContentPartInputFileTypeInputFile` | input_file | \ No newline at end of file diff --git a/docs/models/components/contentpartinputvideo.md b/docs/models/components/contentpartinputvideo.md new file mode 100644 index 00000000..435cd193 --- /dev/null +++ b/docs/models/components/contentpartinputvideo.md @@ -0,0 +1,9 @@ +# ContentPartInputVideo + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `InputVideo` | [components.MultimodalMedia](../../models/components/multimodalmedia.md) | :heavy_check_mark: | N/A | {
"data": "data:audio/wav;base64,UklGRiQAAABXQVZFZm10IBAAAAA...",
"format": "wav"
} | +| `Type` | [components.ContentPartInputVideoType](../../models/components/contentpartinputvideotype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/contentpartinputvideotype.md b/docs/models/components/contentpartinputvideotype.md new file mode 100644 index 00000000..bd26b09e --- /dev/null +++ b/docs/models/components/contentpartinputvideotype.md @@ -0,0 +1,18 @@ +# ContentPartInputVideoType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ContentPartInputVideoTypeInputVideo +``` + + +## Values + +| Name | Value | +| ------------------------------------- | ------------------------------------- | +| `ContentPartInputVideoTypeInputVideo` | input_video | \ No newline at end of file diff --git a/docs/models/components/contentpartvideo.md b/docs/models/components/contentpartvideo.md new file mode 100644 index 00000000..625bf939 --- /dev/null +++ b/docs/models/components/contentpartvideo.md @@ -0,0 +1,9 @@ +# ContentPartVideo + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `Type` | [components.ContentPartVideoType](../../models/components/contentpartvideotype.md) | :heavy_check_mark: | N/A | +| `VideoURL` | [components.VideoURL](../../models/components/videourl.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/contentpartvideotype.md b/docs/models/components/contentpartvideotype.md new file mode 100644 index 00000000..4f777062 --- /dev/null +++ b/docs/models/components/contentpartvideotype.md @@ -0,0 +1,18 @@ +# ContentPartVideoType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ContentPartVideoTypeVideoURL +``` + + +## Values + +| Name | Value | +| ------------------------------ | ------------------------------ | +| `ContentPartVideoTypeVideoURL` | video_url | \ No newline at end of file diff --git a/docs/models/components/contentredactedthinking.md b/docs/models/components/contentredactedthinking.md new file mode 100644 index 00000000..bf113b1c --- /dev/null +++ b/docs/models/components/contentredactedthinking.md @@ -0,0 +1,9 @@ +# ContentRedactedThinking + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `Data` | `string` | :heavy_check_mark: | N/A | +| `Type` | [components.TypeRedactedThinking](../../models/components/typeredactedthinking.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/contentservertooluse.md b/docs/models/components/contentservertooluse.md new file mode 100644 index 00000000..953787b3 --- /dev/null +++ b/docs/models/components/contentservertooluse.md @@ -0,0 +1,12 @@ +# ContentServerToolUse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CacheControl` | [*components.AnthropicCacheControlDirective](../../models/components/anthropiccachecontroldirective.md) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | {
"type": "ephemeral"
} | +| `ID` | `string` | :heavy_check_mark: | N/A | | +| `Input` | optionalnullable.OptionalNullable[`any`] | :heavy_minus_sign: | N/A | | +| `Name` | `string` | :heavy_check_mark: | N/A | | +| `Type` | [components.TypeServerToolUse](../../models/components/typeservertooluse.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/contentthinking.md b/docs/models/components/contentthinking.md new file mode 100644 index 00000000..2ccf3b1d --- /dev/null +++ b/docs/models/components/contentthinking.md @@ -0,0 +1,10 @@ +# ContentThinking + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `Signature` | `string` | :heavy_check_mark: | N/A | +| `Thinking` | `string` | :heavy_check_mark: | N/A | +| `Type` | [components.TypeThinking](../../models/components/typethinking.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/contenttoolreference.md b/docs/models/components/contenttoolreference.md new file mode 100644 index 00000000..83eb1fbd --- /dev/null +++ b/docs/models/components/contenttoolreference.md @@ -0,0 +1,9 @@ +# ContentToolReference + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `ToolName` | `string` | :heavy_check_mark: | N/A | +| `Type` | [components.TypeToolReference](../../models/components/typetoolreference.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/contenttoolresult.md b/docs/models/components/contenttoolresult.md new file mode 100644 index 00000000..43149074 --- /dev/null +++ b/docs/models/components/contenttoolresult.md @@ -0,0 +1,12 @@ +# ContentToolResult + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CacheControl` | [*components.AnthropicCacheControlDirective](../../models/components/anthropiccachecontroldirective.md) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | {
"type": "ephemeral"
} | +| `Content` | [*components.MessagesMessageParamContentUnion2](../../models/components/messagesmessageparamcontentunion2.md) | :heavy_minus_sign: | N/A | | +| `IsError` | `*bool` | :heavy_minus_sign: | N/A | | +| `ToolUseID` | `string` | :heavy_check_mark: | N/A | | +| `Type` | [components.TypeToolResult](../../models/components/typetoolresult.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/contenttooluse.md b/docs/models/components/contenttooluse.md new file mode 100644 index 00000000..eebb50d3 --- /dev/null +++ b/docs/models/components/contenttooluse.md @@ -0,0 +1,12 @@ +# ContentToolUse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CacheControl` | [*components.AnthropicCacheControlDirective](../../models/components/anthropiccachecontroldirective.md) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | {
"type": "ephemeral"
} | +| `ID` | `string` | :heavy_check_mark: | N/A | | +| `Input` | optionalnullable.OptionalNullable[`any`] | :heavy_minus_sign: | N/A | | +| `Name` | `string` | :heavy_check_mark: | N/A | | +| `Type` | [components.TypeToolUse](../../models/components/typetooluse.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/contentwebsearchtoolresult.md b/docs/models/components/contentwebsearchtoolresult.md new file mode 100644 index 00000000..0208fd56 --- /dev/null +++ b/docs/models/components/contentwebsearchtoolresult.md @@ -0,0 +1,11 @@ +# ContentWebSearchToolResult + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CacheControl` | [*components.AnthropicCacheControlDirective](../../models/components/anthropiccachecontroldirective.md) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | {
"type": "ephemeral"
} | +| `Content` | [components.MessagesMessageParamContentUnion3](../../models/components/messagesmessageparamcontentunion3.md) | :heavy_check_mark: | N/A | | +| `ToolUseID` | `string` | :heavy_check_mark: | N/A | | +| `Type` | [components.TypeWebSearchToolResult](../../models/components/typewebsearchtoolresult.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/contentwebsearchtoolresulterror.md b/docs/models/components/contentwebsearchtoolresulterror.md new file mode 100644 index 00000000..44fff780 --- /dev/null +++ b/docs/models/components/contentwebsearchtoolresulterror.md @@ -0,0 +1,9 @@ +# ContentWebSearchToolResultError + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `ErrorCode` | [components.ErrorCode](../../models/components/errorcode.md) | :heavy_check_mark: | N/A | +| `Type` | [components.TypeWebSearchToolResultError](../../models/components/typewebsearchtoolresulterror.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/contextmanagement.md b/docs/models/components/contextmanagement.md new file mode 100644 index 00000000..b821cd64 --- /dev/null +++ b/docs/models/components/contextmanagement.md @@ -0,0 +1,8 @@ +# ContextManagement + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `Edits` | [][components.Edit](../../models/components/edit.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/contradiction.md b/docs/models/components/contradiction.md new file mode 100644 index 00000000..540472dc --- /dev/null +++ b/docs/models/components/contradiction.md @@ -0,0 +1,9 @@ +# Contradiction + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `Stances` | [][components.Stance](../../models/components/stance.md) | :heavy_check_mark: | N/A | +| `Topic` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/costdetails.md b/docs/models/components/costdetails.md index 172780c4..0021d8f8 100644 --- a/docs/models/components/costdetails.md +++ b/docs/models/components/costdetails.md @@ -1,10 +1,12 @@ # CostDetails +Breakdown of upstream inference costs + ## Fields | Field | Type | Required | Description | | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `UpstreamInferenceCompletionsCost` | `float64` | :heavy_check_mark: | N/A | | `UpstreamInferenceCost` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | N/A | -| `UpstreamInferenceInputCost` | `float64` | :heavy_check_mark: | N/A | -| `UpstreamInferenceOutputCost` | `float64` | :heavy_check_mark: | N/A | \ No newline at end of file +| `UpstreamInferencePromptCost` | `float64` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/createbyokkeyrequest.md b/docs/models/components/createbyokkeyrequest.md new file mode 100644 index 00000000..317fbd4f --- /dev/null +++ b/docs/models/components/createbyokkeyrequest.md @@ -0,0 +1,15 @@ +# CreateBYOKKeyRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `AllowedModels` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Optional allowlist of model slugs this credential may be used for. `null` means no restriction. | null | +| `AllowedUserIds` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Optional allowlist of user IDs that may use this credential. `null` means no restriction. | null | +| `Disabled` | `*bool` | :heavy_minus_sign: | Whether this credential should be created in a disabled state. | false | +| `IsFallback` | `*bool` | :heavy_minus_sign: | Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried. | false | +| `Key` | `string` | :heavy_check_mark: | The raw provider API key or credential. This value is encrypted at rest and never returned in API responses. | sk-proj-abc123... | +| `Name` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Optional human-readable name for the credential. | Production OpenAI Key | +| `Provider` | [components.BYOKProviderSlug](../../models/components/byokproviderslug.md) | :heavy_check_mark: | The upstream provider this credential authenticates against, as a lowercase slug (e.g. `openai`, `anthropic`, `amazon-bedrock`). | openai | +| `WorkspaceID` | `*string` | :heavy_minus_sign: | Optional workspace ID. Defaults to the authenticated entity's default workspace. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/components/createbyokkeyresponse.md b/docs/models/components/createbyokkeyresponse.md new file mode 100644 index 00000000..49cbe807 --- /dev/null +++ b/docs/models/components/createbyokkeyresponse.md @@ -0,0 +1,8 @@ +# CreateBYOKKeyResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Data` | [components.BYOKKey](../../models/components/byokkey.md) | :heavy_check_mark: | N/A | {
"allowed_api_key_hashes": null,
"allowed_models": null,
"allowed_user_ids": null,
"created_at": "2025-08-24T10:30:00Z",
"disabled": false,
"id": "11111111-2222-3333-4444-555555555555",
"is_fallback": false,
"label": "sk-...AbCd",
"name": "Production OpenAI Key",
"provider": "openai",
"sort_order": 0,
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
} | \ No newline at end of file diff --git a/docs/models/components/createguardrailrequest.md b/docs/models/components/createguardrailrequest.md index beea0c5f..93fbe7a7 100644 --- a/docs/models/components/createguardrailrequest.md +++ b/docs/models/components/createguardrailrequest.md @@ -3,15 +3,21 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `AllowedModels` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] | -| `AllowedProviders` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | -| `Description` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Description of the guardrail | A guardrail for limiting API usage | -| `EnforceZdr` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | Whether to enforce zero data retention | false | -| `IgnoredModels` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Array of model identifiers to exclude from routing (slug or canonical_slug accepted) | [
"openai/gpt-4o-mini"
] | -| `IgnoredProviders` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | -| `LimitUsd` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | Spending limit in USD | 50 | -| `Name` | `string` | :heavy_check_mark: | Name for the new guardrail | My New Guardrail | -| `ResetInterval` | optionalnullable.OptionalNullable[[components.GuardrailInterval](../../models/components/guardrailinterval.md)] | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | -| `WorkspaceID` | `*string` | :heavy_minus_sign: | The workspace to create the guardrail in. Defaults to the default workspace if not provided. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AllowedModels` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] | +| `AllowedProviders` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | +| `ContentFilterBuiltins` | optionalnullable.OptionalNullable[[][components.ContentFilterBuiltinEntryInput](../../models/components/contentfilterbuiltinentryinput.md)] | :heavy_minus_sign: | Builtin content filters to apply. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only. | [
{
"action": "block",
"slug": "regex-prompt-injection"
}
] | +| `ContentFilters` | optionalnullable.OptionalNullable[[][components.ContentFilterEntry](../../models/components/contentfilterentry.md)] | :heavy_minus_sign: | Custom regex content filters to apply to request messages | [
{
"action": "redact",
"label": "[API_KEY]",
"pattern": "\\b(sk-[a-zA-Z0-9]{48})\\b"
}
] | +| `Description` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Description of the guardrail | A guardrail for limiting API usage | +| ~~`EnforceZdr`~~ | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. | false | +| `EnforceZdrAnthropic` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. | false | +| `EnforceZdrGoogle` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. | false | +| `EnforceZdrOpenai` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. | false | +| `EnforceZdrOther` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided. | false | +| `IgnoredModels` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Array of model identifiers to exclude from routing (slug or canonical_slug accepted) | [
"openai/gpt-4o-mini"
] | +| `IgnoredProviders` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | +| `LimitUsd` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | Spending limit in USD | 50 | +| `Name` | `string` | :heavy_check_mark: | Name for the new guardrail | My New Guardrail | +| `ResetInterval` | optionalnullable.OptionalNullable[[components.GuardrailInterval](../../models/components/guardrailinterval.md)] | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | +| `WorkspaceID` | `*string` | :heavy_minus_sign: | The workspace to create the guardrail in. Defaults to the default workspace if not provided. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/models/components/createguardrailresponse.md b/docs/models/components/createguardrailresponse.md index 4605f0c7..eebd9642 100644 --- a/docs/models/components/createguardrailresponse.md +++ b/docs/models/components/createguardrailresponse.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Data` | [components.Guardrail](../../models/components/guardrail.md) | :heavy_check_mark: | N/A | {
"allowed_models": null,
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"created_at": "2025-08-24T10:30:00Z",
"description": "Guardrail for production environment",
"enforce_zdr": false,
"id": "550e8400-e29b-41d4-a716-446655440000",
"ignored_models": null,
"ignored_providers": null,
"limit_usd": 100,
"name": "Production Guardrail",
"reset_interval": "monthly",
"updated_at": "2025-08-24T15:45:00Z",
"workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Data` | [components.Guardrail](../../models/components/guardrail.md) | :heavy_check_mark: | N/A | {
"allowed_models": null,
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"content_filter_builtins": [
{
"action": "redact",
"label": "[EMAIL]",
"slug": "email"
}
],
"content_filters": null,
"created_at": "2025-08-24T10:30:00Z",
"description": "Guardrail for production environment",
"enforce_zdr": null,
"enforce_zdr_anthropic": true,
"enforce_zdr_google": false,
"enforce_zdr_openai": true,
"enforce_zdr_other": false,
"id": "550e8400-e29b-41d4-a716-446655440000",
"ignored_models": null,
"ignored_providers": null,
"limit_usd": 100,
"name": "Production Guardrail",
"reset_interval": "monthly",
"updated_at": "2025-08-24T15:45:00Z",
"workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"
} | \ No newline at end of file diff --git a/docs/models/components/createobservabilitydestinationrequest.md b/docs/models/components/createobservabilitydestinationrequest.md new file mode 100644 index 00000000..ff5f5f4e --- /dev/null +++ b/docs/models/components/createobservabilitydestinationrequest.md @@ -0,0 +1,16 @@ +# CreateObservabilityDestinationRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `APIKeyHashes` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Optional allowlist of OpenRouter API key hashes whose traffic is forwarded. `null` or omitted means all keys. Must contain at least one hash if provided. | null | +| `Config` | map[string]`any` | :heavy_check_mark: | Provider-specific configuration. The shape depends on `type` and is validated server-side. | {
"baseUrl": "https://us.cloud.langfuse.com",
"publicKey": "pk-l...EfGh",
"secretKey": "sk-l...AbCd"
} | +| `Enabled` | `*bool` | :heavy_minus_sign: | Whether this destination should be enabled immediately. | true | +| `FilterRules` | optionalnullable.OptionalNullable[[components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md)] | :heavy_minus_sign: | Optional structured filter rules controlling which events are forwarded. | null | +| `Name` | `string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | +| `PrivacyMode` | `*bool` | :heavy_minus_sign: | When true, request/response bodies are not forwarded — only metadata. | false | +| `SamplingRate` | `*float64` | :heavy_minus_sign: | Sampling rate between 0.0001 and 1 (1 = 100%). | 1 | +| `Type` | [components.CreateObservabilityDestinationRequestType](../../models/components/createobservabilitydestinationrequesttype.md) | :heavy_check_mark: | The destination type. Only stable destination types are accepted. | langfuse | +| `WorkspaceID` | `*string` | :heavy_minus_sign: | Optional workspace ID. Defaults to the authenticated entity's default workspace. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/components/createobservabilitydestinationrequesttype.md b/docs/models/components/createobservabilitydestinationrequesttype.md new file mode 100644 index 00000000..06fdda18 --- /dev/null +++ b/docs/models/components/createobservabilitydestinationrequesttype.md @@ -0,0 +1,39 @@ +# CreateObservabilityDestinationRequestType + +The destination type. Only stable destination types are accepted. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.CreateObservabilityDestinationRequestTypeArize + +// Open enum: custom values can be created with a direct type cast +custom := components.CreateObservabilityDestinationRequestType("custom_value") +``` + + +## Values + +| Name | Value | +| -------------------------------------------------------- | -------------------------------------------------------- | +| `CreateObservabilityDestinationRequestTypeArize` | arize | +| `CreateObservabilityDestinationRequestTypeBraintrust` | braintrust | +| `CreateObservabilityDestinationRequestTypeClickhouse` | clickhouse | +| `CreateObservabilityDestinationRequestTypeDatadog` | datadog | +| `CreateObservabilityDestinationRequestTypeGrafana` | grafana | +| `CreateObservabilityDestinationRequestTypeLangfuse` | langfuse | +| `CreateObservabilityDestinationRequestTypeLangsmith` | langsmith | +| `CreateObservabilityDestinationRequestTypeNewrelic` | newrelic | +| `CreateObservabilityDestinationRequestTypeOpik` | opik | +| `CreateObservabilityDestinationRequestTypeOtelCollector` | otel-collector | +| `CreateObservabilityDestinationRequestTypePosthog` | posthog | +| `CreateObservabilityDestinationRequestTypeRamp` | ramp | +| `CreateObservabilityDestinationRequestTypeS3` | s3 | +| `CreateObservabilityDestinationRequestTypeSentry` | sentry | +| `CreateObservabilityDestinationRequestTypeSnowflake` | snowflake | +| `CreateObservabilityDestinationRequestTypeWeave` | weave | +| `CreateObservabilityDestinationRequestTypeWebhook` | webhook | \ No newline at end of file diff --git a/docs/models/components/createobservabilitydestinationresponse.md b/docs/models/components/createobservabilitydestinationresponse.md new file mode 100644 index 00000000..bcb88c8d --- /dev/null +++ b/docs/models/components/createobservabilitydestinationresponse.md @@ -0,0 +1,8 @@ +# CreateObservabilityDestinationResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Data` | [components.ObservabilityDestination](../../models/components/observabilitydestination.md) | :heavy_check_mark: | N/A | {
"api_key_hashes": null,
"config": {
"baseUrl": "https://us.cloud.langfuse.com",
"publicKey": "pk-l...EfGh",
"secretKey": "sk-l...AbCd"
},
"created_at": "2025-08-24T10:30:00Z",
"enabled": true,
"filter_rules": null,
"id": "99999999-aaaa-bbbb-cccc-dddddddddddd",
"name": "Production Langfuse",
"privacy_mode": false,
"sampling_rate": 1,
"type": "langfuse",
"updated_at": "2025-08-24T15:45:00Z",
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
} | \ No newline at end of file diff --git a/docs/models/components/createpresetfrominferenceresponse.md b/docs/models/components/createpresetfrominferenceresponse.md new file mode 100644 index 00000000..1f14c0a3 --- /dev/null +++ b/docs/models/components/createpresetfrominferenceresponse.md @@ -0,0 +1,10 @@ +# CreatePresetFromInferenceResponse + +Response containing the created preset with its designated version. + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Data` | [components.PresetWithDesignatedVersion](../../models/components/presetwithdesignatedversion.md) | :heavy_check_mark: | A preset with its currently designated version. | {
"created_at": "2026-04-20T10:00:00Z",
"creator_user_id": "user_2dHFtVWx2n56w6HkM0000000000",
"description": null,
"designated_version": {
"config": {
"model": "openai/gpt-4o",
"temperature": 0.7
},
"created_at": "2026-04-20T10:00:00Z",
"creator_id": "user_2dHFtVWx2n56w6HkM0000000000",
"id": "550e8400-e29b-41d4-a716-446655440000",
"preset_id": "650e8400-e29b-41d4-a716-446655440001",
"system_prompt": "You are a helpful assistant.",
"updated_at": "2026-04-20T10:00:00Z",
"version": 1
},
"designated_version_id": "550e8400-e29b-41d4-a716-446655440000",
"id": "650e8400-e29b-41d4-a716-446655440001",
"name": "my-preset",
"slug": "my-preset",
"status": "active",
"status_updated_at": null,
"updated_at": "2026-04-20T10:00:00Z",
"workspace_id": "750e8400-e29b-41d4-a716-446655440002"
} | \ No newline at end of file diff --git a/docs/models/components/createworkspacerequest.md b/docs/models/components/createworkspacerequest.md index 7257bad3..ec9560bf 100644 --- a/docs/models/components/createworkspacerequest.md +++ b/docs/models/components/createworkspacerequest.md @@ -3,14 +3,16 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `DefaultImageModel` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Default image model for this workspace | openai/dall-e-3 | -| `DefaultProviderSort` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Default provider sort preference (price, throughput, latency, exacto) | price | -| `DefaultTextModel` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Default text model for this workspace | openai/gpt-4o | -| `Description` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Description of the workspace | Production environment workspace | -| `IsDataDiscountLoggingEnabled` | `*bool` | :heavy_minus_sign: | Whether data discount logging is enabled | true | -| `IsObservabilityBroadcastEnabled` | `*bool` | :heavy_minus_sign: | Whether broadcast is enabled | false | -| `IsObservabilityIoLoggingEnabled` | `*bool` | :heavy_minus_sign: | Whether private logging is enabled | false | -| `Name` | `string` | :heavy_check_mark: | Name for the new workspace | Production | -| `Slug` | `string` | :heavy_check_mark: | URL-friendly slug (lowercase alphanumeric and hyphens only) | production | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `DefaultImageModel` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Default image model for this workspace | openai/dall-e-3 | +| `DefaultProviderSort` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Default provider sort preference (price, throughput, latency, exacto) | price | +| `DefaultTextModel` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Default text model for this workspace | openai/gpt-4o | +| `Description` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Description of the workspace | Production environment workspace | +| `IoLoggingAPIKeyIds` | optionalnullable.OptionalNullable[[]`int64`] | :heavy_minus_sign: | Optional array of API key IDs to filter I/O logging | null | +| `IoLoggingSamplingRate` | `*float64` | :heavy_minus_sign: | Sampling rate for I/O logging (0.0001-1) | 1 | +| `IsDataDiscountLoggingEnabled` | `*bool` | :heavy_minus_sign: | Whether data discount logging is enabled | true | +| `IsObservabilityBroadcastEnabled` | `*bool` | :heavy_minus_sign: | Whether broadcast is enabled | false | +| `IsObservabilityIoLoggingEnabled` | `*bool` | :heavy_minus_sign: | Whether private logging is enabled | false | +| `Name` | `string` | :heavy_check_mark: | Name for the new workspace | Production | +| `Slug` | `string` | :heavy_check_mark: | URL-friendly slug (lowercase alphanumeric segments separated by single hyphens, no leading/trailing hyphens) | production | \ No newline at end of file diff --git a/docs/models/components/createworkspaceresponse.md b/docs/models/components/createworkspaceresponse.md index 9cd182d3..6f359dec 100644 --- a/docs/models/components/createworkspaceresponse.md +++ b/docs/models/components/createworkspaceresponse.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Data` | [components.Workspace](../../models/components/workspace.md) | :heavy_check_mark: | N/A | {
"created_at": "2025-08-24T10:30:00Z",
"created_by": "user_abc123",
"default_image_model": "openai/dall-e-3",
"default_provider_sort": "price",
"default_text_model": "openai/gpt-4o",
"description": "Production environment workspace",
"id": "550e8400-e29b-41d4-a716-446655440000",
"is_data_discount_logging_enabled": true,
"is_observability_broadcast_enabled": false,
"is_observability_io_logging_enabled": false,
"name": "Production",
"slug": "production",
"updated_at": "2025-08-24T15:45:00Z"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Data` | [components.Workspace](../../models/components/workspace.md) | :heavy_check_mark: | N/A | {
"created_at": "2025-08-24T10:30:00Z",
"created_by": "user_abc123",
"default_image_model": "openai/dall-e-3",
"default_provider_sort": "price",
"default_text_model": "openai/gpt-4o",
"description": "Production environment workspace",
"id": "550e8400-e29b-41d4-a716-446655440000",
"io_logging_api_key_ids": null,
"io_logging_sampling_rate": 1,
"is_data_discount_logging_enabled": true,
"is_observability_broadcast_enabled": false,
"is_observability_io_logging_enabled": false,
"name": "Production",
"slug": "production",
"updated_at": "2025-08-24T15:45:00Z"
} | \ No newline at end of file diff --git a/docs/models/components/customtool.md b/docs/models/components/customtool.md index 19500f50..e11193fc 100644 --- a/docs/models/components/customtool.md +++ b/docs/models/components/customtool.md @@ -5,9 +5,9 @@ Custom tool configuration ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -| `Description` | `*string` | :heavy_minus_sign: | N/A | -| `Format` | [*components.Format](../../models/components/format.md) | :heavy_minus_sign: | N/A | -| `Name` | `string` | :heavy_check_mark: | N/A | -| `Type` | [components.TypeCustom](../../models/components/typecustom.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `Description` | `*string` | :heavy_minus_sign: | N/A | +| `Format` | [*components.Format](../../models/components/format.md) | :heavy_minus_sign: | N/A | +| `Name` | `string` | :heavy_check_mark: | N/A | +| `Type` | [components.CustomToolTypeCustom](../../models/components/customtooltypecustom.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/customtoolcallinputdeltaevent.md b/docs/models/components/customtoolcallinputdeltaevent.md new file mode 100644 index 00000000..e1401818 --- /dev/null +++ b/docs/models/components/customtoolcallinputdeltaevent.md @@ -0,0 +1,14 @@ +# CustomToolCallInputDeltaEvent + +Event emitted when a custom tool call's freeform input is being streamed. Mirrors `response.function_call_arguments.delta` but for `custom` tools whose input is opaque text rather than JSON arguments. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `Delta` | `string` | :heavy_check_mark: | N/A | +| `ItemID` | `string` | :heavy_check_mark: | N/A | +| `OutputIndex` | `int64` | :heavy_check_mark: | N/A | +| `SequenceNumber` | `int64` | :heavy_check_mark: | N/A | +| `Type` | [components.CustomToolCallInputDeltaEventType](../../models/components/customtoolcallinputdeltaeventtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/customtoolcallinputdeltaeventtype.md b/docs/models/components/customtoolcallinputdeltaeventtype.md new file mode 100644 index 00000000..f278d910 --- /dev/null +++ b/docs/models/components/customtoolcallinputdeltaeventtype.md @@ -0,0 +1,18 @@ +# CustomToolCallInputDeltaEventType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.CustomToolCallInputDeltaEventTypeResponseCustomToolCallInputDelta +``` + + +## Values + +| Name | Value | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `CustomToolCallInputDeltaEventTypeResponseCustomToolCallInputDelta` | response.custom_tool_call_input.delta | \ No newline at end of file diff --git a/docs/models/components/customtoolcallinputdoneevent.md b/docs/models/components/customtoolcallinputdoneevent.md new file mode 100644 index 00000000..4f765e0e --- /dev/null +++ b/docs/models/components/customtoolcallinputdoneevent.md @@ -0,0 +1,14 @@ +# CustomToolCallInputDoneEvent + +Event emitted when a custom tool call's freeform input streaming is complete. Mirrors `response.function_call_arguments.done` but for `custom` tools. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `Input` | `string` | :heavy_check_mark: | N/A | +| `ItemID` | `string` | :heavy_check_mark: | N/A | +| `OutputIndex` | `int64` | :heavy_check_mark: | N/A | +| `SequenceNumber` | `int64` | :heavy_check_mark: | N/A | +| `Type` | [components.CustomToolCallInputDoneEventType](../../models/components/customtoolcallinputdoneeventtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/customtoolcallinputdoneeventtype.md b/docs/models/components/customtoolcallinputdoneeventtype.md new file mode 100644 index 00000000..25ee1adf --- /dev/null +++ b/docs/models/components/customtoolcallinputdoneeventtype.md @@ -0,0 +1,18 @@ +# CustomToolCallInputDoneEventType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.CustomToolCallInputDoneEventTypeResponseCustomToolCallInputDone +``` + + +## Values + +| Name | Value | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `CustomToolCallInputDoneEventTypeResponseCustomToolCallInputDone` | response.custom_tool_call_input.done | \ No newline at end of file diff --git a/docs/models/components/customtoolcallitem.md b/docs/models/components/customtoolcallitem.md new file mode 100644 index 00000000..0cc8a58a --- /dev/null +++ b/docs/models/components/customtoolcallitem.md @@ -0,0 +1,15 @@ +# CustomToolCallItem + +A call to a custom (freeform-grammar) tool created by the model — distinct from `function_call`. Used for tools like Codex CLI's `apply_patch` whose payload is opaque text rather than JSON arguments. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `CallID` | `string` | :heavy_check_mark: | N/A | +| `ID` | `*string` | :heavy_minus_sign: | N/A | +| `Input` | `string` | :heavy_check_mark: | N/A | +| `Name` | `string` | :heavy_check_mark: | N/A | +| `Namespace` | `*string` | :heavy_minus_sign: | Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) | +| `Type` | [components.CustomToolCallItemType](../../models/components/customtoolcallitemtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/customtoolcallitemtype.md b/docs/models/components/customtoolcallitemtype.md new file mode 100644 index 00000000..1031fe48 --- /dev/null +++ b/docs/models/components/customtoolcallitemtype.md @@ -0,0 +1,18 @@ +# CustomToolCallItemType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.CustomToolCallItemTypeCustomToolCall +``` + + +## Values + +| Name | Value | +| -------------------------------------- | -------------------------------------- | +| `CustomToolCallItemTypeCustomToolCall` | custom_tool_call | \ No newline at end of file diff --git a/docs/models/components/customtoolcalloutputitem.md b/docs/models/components/customtoolcalloutputitem.md new file mode 100644 index 00000000..3b69b3d6 --- /dev/null +++ b/docs/models/components/customtoolcalloutputitem.md @@ -0,0 +1,13 @@ +# CustomToolCallOutputItem + +The output from a custom (freeform-grammar) tool call execution. Mirrors `function_call_output` but is matched to a `custom_tool_call` rather than a `function_call`. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `CallID` | `string` | :heavy_check_mark: | N/A | +| `ID` | `*string` | :heavy_minus_sign: | N/A | +| `Output` | [components.CustomToolCallOutputItemOutputUnion2](../../models/components/customtoolcalloutputitemoutputunion2.md) | :heavy_check_mark: | N/A | +| `Type` | [components.CustomToolCallOutputItemTypeCustomToolCallOutput](../../models/components/customtoolcalloutputitemtypecustomtoolcalloutput.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/customtoolcalloutputitemdetail.md b/docs/models/components/customtoolcalloutputitemdetail.md new file mode 100644 index 00000000..de771461 --- /dev/null +++ b/docs/models/components/customtoolcalloutputitemdetail.md @@ -0,0 +1,24 @@ +# CustomToolCallOutputItemDetail + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.CustomToolCallOutputItemDetailAuto + +// Open enum: custom values can be created with a direct type cast +custom := components.CustomToolCallOutputItemDetail("custom_value") +``` + + +## Values + +| Name | Value | +| ---------------------------------------- | ---------------------------------------- | +| `CustomToolCallOutputItemDetailAuto` | auto | +| `CustomToolCallOutputItemDetailHigh` | high | +| `CustomToolCallOutputItemDetailLow` | low | +| `CustomToolCallOutputItemDetailOriginal` | original | \ No newline at end of file diff --git a/docs/models/components/customtoolcalloutputitemoutputinputimage.md b/docs/models/components/customtoolcalloutputitemoutputinputimage.md new file mode 100644 index 00000000..073a2512 --- /dev/null +++ b/docs/models/components/customtoolcalloutputitemoutputinputimage.md @@ -0,0 +1,12 @@ +# CustomToolCallOutputItemOutputInputImage + +Image input content item + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `Detail` | [components.CustomToolCallOutputItemDetail](../../models/components/customtoolcalloutputitemdetail.md) | :heavy_check_mark: | N/A | +| `ImageURL` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `Type` | [components.CustomToolCallOutputItemTypeInputImage](../../models/components/customtoolcalloutputitemtypeinputimage.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/customtoolcalloutputitemoutputunion1.md b/docs/models/components/customtoolcalloutputitemoutputunion1.md new file mode 100644 index 00000000..1cef654c --- /dev/null +++ b/docs/models/components/customtoolcalloutputitemoutputunion1.md @@ -0,0 +1,37 @@ +# CustomToolCallOutputItemOutputUnion1 + + +## Supported Types + +### InputText + +```go +customToolCallOutputItemOutputUnion1 := components.CreateCustomToolCallOutputItemOutputUnion1InputText(components.InputText{/* values here */}) +``` + +### CustomToolCallOutputItemOutputInputImage + +```go +customToolCallOutputItemOutputUnion1 := components.CreateCustomToolCallOutputItemOutputUnion1InputImage(components.CustomToolCallOutputItemOutputInputImage{/* values here */}) +``` + +### InputFile + +```go +customToolCallOutputItemOutputUnion1 := components.CreateCustomToolCallOutputItemOutputUnion1InputFile(components.InputFile{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch customToolCallOutputItemOutputUnion1.Type { + case components.CustomToolCallOutputItemOutputUnion1TypeInputText: + // customToolCallOutputItemOutputUnion1.InputText is populated + case components.CustomToolCallOutputItemOutputUnion1TypeInputImage: + // customToolCallOutputItemOutputUnion1.CustomToolCallOutputItemOutputInputImage is populated + case components.CustomToolCallOutputItemOutputUnion1TypeInputFile: + // customToolCallOutputItemOutputUnion1.InputFile is populated +} +``` diff --git a/docs/models/components/customtoolcalloutputitemoutputunion2.md b/docs/models/components/customtoolcalloutputitemoutputunion2.md new file mode 100644 index 00000000..dd238d2c --- /dev/null +++ b/docs/models/components/customtoolcalloutputitemoutputunion2.md @@ -0,0 +1,29 @@ +# CustomToolCallOutputItemOutputUnion2 + + +## Supported Types + +### + +```go +customToolCallOutputItemOutputUnion2 := components.CreateCustomToolCallOutputItemOutputUnion2Str(string{/* values here */}) +``` + +### + +```go +customToolCallOutputItemOutputUnion2 := components.CreateCustomToolCallOutputItemOutputUnion2ArrayOfCustomToolCallOutputItemOutputUnion1([]components.CustomToolCallOutputItemOutputUnion1{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch customToolCallOutputItemOutputUnion2.Type { + case components.CustomToolCallOutputItemOutputUnion2TypeStr: + // customToolCallOutputItemOutputUnion2.Str is populated + case components.CustomToolCallOutputItemOutputUnion2TypeArrayOfCustomToolCallOutputItemOutputUnion1: + // customToolCallOutputItemOutputUnion2.ArrayOfCustomToolCallOutputItemOutputUnion1 is populated +} +``` diff --git a/docs/models/components/customtoolcalloutputitemtypecustomtoolcalloutput.md b/docs/models/components/customtoolcalloutputitemtypecustomtoolcalloutput.md new file mode 100644 index 00000000..ec8ad6ea --- /dev/null +++ b/docs/models/components/customtoolcalloutputitemtypecustomtoolcalloutput.md @@ -0,0 +1,18 @@ +# CustomToolCallOutputItemTypeCustomToolCallOutput + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.CustomToolCallOutputItemTypeCustomToolCallOutputCustomToolCallOutput +``` + + +## Values + +| Name | Value | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `CustomToolCallOutputItemTypeCustomToolCallOutputCustomToolCallOutput` | custom_tool_call_output | \ No newline at end of file diff --git a/docs/models/components/customtoolcalloutputitemtypeinputimage.md b/docs/models/components/customtoolcalloutputitemtypeinputimage.md new file mode 100644 index 00000000..4db37ce7 --- /dev/null +++ b/docs/models/components/customtoolcalloutputitemtypeinputimage.md @@ -0,0 +1,18 @@ +# CustomToolCallOutputItemTypeInputImage + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.CustomToolCallOutputItemTypeInputImageInputImage +``` + + +## Values + +| Name | Value | +| -------------------------------------------------- | -------------------------------------------------- | +| `CustomToolCallOutputItemTypeInputImageInputImage` | input_image | \ No newline at end of file diff --git a/docs/models/components/customtooltypecustom.md b/docs/models/components/customtooltypecustom.md new file mode 100644 index 00000000..7fefa582 --- /dev/null +++ b/docs/models/components/customtooltypecustom.md @@ -0,0 +1,18 @@ +# CustomToolTypeCustom + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.CustomToolTypeCustomCustom +``` + + +## Values + +| Name | Value | +| ---------------------------- | ---------------------------- | +| `CustomToolTypeCustomCustom` | custom | \ No newline at end of file diff --git a/docs/models/components/dabenchmarkentry.md b/docs/models/components/dabenchmarkentry.md new file mode 100644 index 00000000..35febe6b --- /dev/null +++ b/docs/models/components/dabenchmarkentry.md @@ -0,0 +1,14 @@ +# DABenchmarkEntry + +A single Design Arena benchmark entry for a specific arena+category + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `Arena` | `string` | :heavy_check_mark: | Arena type (e.g. models, builders, agents) | models | +| `Category` | `string` | :heavy_check_mark: | Category within the arena (e.g. website, gamedev, uicomponent) | website | +| `Elo` | `float64` | :heavy_check_mark: | ELO rating from head-to-head arena battles | 1385.2 | +| `Rank` | `int64` | :heavy_check_mark: | Rank position within this arena+category among models available on OpenRouter (1 = highest ELO) | 5 | +| `WinRate` | `float64` | :heavy_check_mark: | Win rate percentage in arena battles | 62.5 | \ No newline at end of file diff --git a/docs/models/components/dataregion.md b/docs/models/components/dataregion.md new file mode 100644 index 00000000..377b7649 --- /dev/null +++ b/docs/models/components/dataregion.md @@ -0,0 +1,24 @@ +# DataRegion + +The data region this generation was routed through. 'europe' for EU-routed requests, 'global' otherwise. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.DataRegionGlobal + +// Open enum: custom values can be created with a direct type cast +custom := components.DataRegion("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------ | ------------------ | +| `DataRegionGlobal` | global | +| `DataRegionEurope` | europe | \ No newline at end of file diff --git a/docs/models/components/deletebyokkeyresponse.md b/docs/models/components/deletebyokkeyresponse.md new file mode 100644 index 00000000..8fd4ae40 --- /dev/null +++ b/docs/models/components/deletebyokkeyresponse.md @@ -0,0 +1,8 @@ +# DeleteBYOKKeyResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `Deleted` | `bool` | :heavy_check_mark: | Confirmation that the BYOK credential was deleted. | true | \ No newline at end of file diff --git a/docs/models/components/deleteobservabilitydestinationresponse.md b/docs/models/components/deleteobservabilitydestinationresponse.md new file mode 100644 index 00000000..5baf708a --- /dev/null +++ b/docs/models/components/deleteobservabilitydestinationresponse.md @@ -0,0 +1,8 @@ +# DeleteObservabilityDestinationResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `Deleted` | `bool` | :heavy_check_mark: | Always `true` on success. | \ No newline at end of file diff --git a/docs/models/components/easyinputmessagecontentinputimage.md b/docs/models/components/easyinputmessagecontentinputimage.md index dc375810..3cd64947 100644 --- a/docs/models/components/easyinputmessagecontentinputimage.md +++ b/docs/models/components/easyinputmessagecontentinputimage.md @@ -5,8 +5,8 @@ Image input content item ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `Detail` | [components.EasyInputMessageDetail](../../models/components/easyinputmessagedetail.md) | :heavy_check_mark: | N/A | -| `ImageURL` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | -| `Type` | [components.EasyInputMessageContentType](../../models/components/easyinputmessagecontenttype.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `Detail` | [components.EasyInputMessageDetail](../../models/components/easyinputmessagedetail.md) | :heavy_check_mark: | N/A | +| `ImageURL` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `Type` | [components.EasyInputMessageTypeInputImage](../../models/components/easyinputmessagetypeinputimage.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/easyinputmessagecontenttype.md b/docs/models/components/easyinputmessagecontenttype.md deleted file mode 100644 index f246739b..00000000 --- a/docs/models/components/easyinputmessagecontenttype.md +++ /dev/null @@ -1,18 +0,0 @@ -# EasyInputMessageContentType - -## Example Usage - -```go -import ( - "github.com/OpenRouterTeam/go-sdk/models/components" -) - -value := components.EasyInputMessageContentTypeInputImage -``` - - -## Values - -| Name | Value | -| --------------------------------------- | --------------------------------------- | -| `EasyInputMessageContentTypeInputImage` | input_image | \ No newline at end of file diff --git a/docs/models/components/easyinputmessagedetail.md b/docs/models/components/easyinputmessagedetail.md index 802b8a94..629806b5 100644 --- a/docs/models/components/easyinputmessagedetail.md +++ b/docs/models/components/easyinputmessagedetail.md @@ -16,8 +16,9 @@ custom := components.EasyInputMessageDetail("custom_value") ## Values -| Name | Value | -| ---------------------------- | ---------------------------- | -| `EasyInputMessageDetailAuto` | auto | -| `EasyInputMessageDetailHigh` | high | -| `EasyInputMessageDetailLow` | low | \ No newline at end of file +| Name | Value | +| -------------------------------- | -------------------------------- | +| `EasyInputMessageDetailAuto` | auto | +| `EasyInputMessageDetailHigh` | high | +| `EasyInputMessageDetailLow` | low | +| `EasyInputMessageDetailOriginal` | original | \ No newline at end of file diff --git a/docs/models/components/easyinputmessagetypeinputimage.md b/docs/models/components/easyinputmessagetypeinputimage.md new file mode 100644 index 00000000..978f29ea --- /dev/null +++ b/docs/models/components/easyinputmessagetypeinputimage.md @@ -0,0 +1,18 @@ +# EasyInputMessageTypeInputImage + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.EasyInputMessageTypeInputImageInputImage +``` + + +## Values + +| Name | Value | +| ------------------------------------------ | ------------------------------------------ | +| `EasyInputMessageTypeInputImageInputImage` | input_image | \ No newline at end of file diff --git a/docs/models/components/edit.md b/docs/models/components/edit.md new file mode 100644 index 00000000..7bcb77d0 --- /dev/null +++ b/docs/models/components/edit.md @@ -0,0 +1,37 @@ +# Edit + + +## Supported Types + +### EditClearToolUses20250919 + +```go +edit := components.CreateEditClearToolUses20250919(components.EditClearToolUses20250919{/* values here */}) +``` + +### EditClearThinking20251015 + +```go +edit := components.CreateEditClearThinking20251015(components.EditClearThinking20251015{/* values here */}) +``` + +### EditCompact20260112 + +```go +edit := components.CreateEditCompact20260112(components.EditCompact20260112{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch edit.Type { + case components.EditTypeClearToolUses20250919: + // edit.EditClearToolUses20250919 is populated + case components.EditTypeClearThinking20251015: + // edit.EditClearThinking20251015 is populated + case components.EditTypeCompact20260112: + // edit.EditCompact20260112 is populated +} +``` diff --git a/docs/models/components/editclearthinking20251015.md b/docs/models/components/editclearthinking20251015.md new file mode 100644 index 00000000..76d58e8a --- /dev/null +++ b/docs/models/components/editclearthinking20251015.md @@ -0,0 +1,9 @@ +# EditClearThinking20251015 + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `Keep` | [*components.Keep](../../models/components/keep.md) | :heavy_minus_sign: | N/A | +| `Type` | [components.TypeClearThinking20251015](../../models/components/typeclearthinking20251015.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/editcleartooluses20250919.md b/docs/models/components/editcleartooluses20250919.md new file mode 100644 index 00000000..f9e025f0 --- /dev/null +++ b/docs/models/components/editcleartooluses20250919.md @@ -0,0 +1,13 @@ +# EditClearToolUses20250919 + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `ClearAtLeast` | optionalnullable.OptionalNullable[[components.AnthropicInputTokensClearAtLeast](../../models/components/anthropicinputtokensclearatleast.md)] | :heavy_minus_sign: | N/A | {
"type": "input_tokens",
"value": 50000
} | +| `ClearToolInputs` | optionalnullable.OptionalNullable[[components.ClearToolInputs](../../models/components/cleartoolinputs.md)] | :heavy_minus_sign: | N/A | | +| `ExcludeTools` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | N/A | | +| `Keep` | [*components.AnthropicToolUsesKeep](../../models/components/anthropictooluseskeep.md) | :heavy_minus_sign: | N/A | {
"type": "tool_uses",
"value": 5
} | +| `Trigger` | [*components.Trigger](../../models/components/trigger.md) | :heavy_minus_sign: | N/A | | +| `Type` | [components.TypeClearToolUses20250919](../../models/components/typecleartooluses20250919.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/editcompact20260112.md b/docs/models/components/editcompact20260112.md new file mode 100644 index 00000000..a03637f1 --- /dev/null +++ b/docs/models/components/editcompact20260112.md @@ -0,0 +1,11 @@ +# EditCompact20260112 + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `Instructions` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | | +| `PauseAfterCompaction` | `*bool` | :heavy_minus_sign: | N/A | | +| `Trigger` | optionalnullable.OptionalNullable[[components.TriggerInputTokens](../../models/components/triggerinputtokens.md)] | :heavy_minus_sign: | N/A | {
"type": "input_tokens",
"value": 100000
} | +| `Type` | [components.TypeCompact20260112](../../models/components/typecompact20260112.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/edittypeinputtokens.md b/docs/models/components/edittypeinputtokens.md new file mode 100644 index 00000000..04c46d2c --- /dev/null +++ b/docs/models/components/edittypeinputtokens.md @@ -0,0 +1,18 @@ +# EditTypeInputTokens + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.EditTypeInputTokensInputTokens +``` + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `EditTypeInputTokensInputTokens` | input_tokens | \ No newline at end of file diff --git a/docs/models/components/effort.md b/docs/models/components/effort.md deleted file mode 100644 index 6c201f66..00000000 --- a/docs/models/components/effort.md +++ /dev/null @@ -1,28 +0,0 @@ -# Effort - -Constrains effort on reasoning for reasoning models - -## Example Usage - -```go -import ( - "github.com/OpenRouterTeam/go-sdk/models/components" -) - -value := components.EffortXhigh - -// Open enum: custom values can be created with a direct type cast -custom := components.Effort("custom_value") -``` - - -## Values - -| Name | Value | -| --------------- | --------------- | -| `EffortXhigh` | xhigh | -| `EffortHigh` | high | -| `EffortMedium` | medium | -| `EffortLow` | low | -| `EffortMinimal` | minimal | -| `EffortNone` | none | \ No newline at end of file diff --git a/docs/models/components/elobounds.md b/docs/models/components/elobounds.md new file mode 100644 index 00000000..2764b566 --- /dev/null +++ b/docs/models/components/elobounds.md @@ -0,0 +1,11 @@ +# EloBounds + +ELO range across all returned models for normalization. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `Max` | `float64` | :heavy_check_mark: | Maximum ELO in the result set. | +| `Min` | `float64` | :heavy_check_mark: | Minimum ELO in the result set. | \ No newline at end of file diff --git a/docs/models/components/endpointinfo.md b/docs/models/components/endpointinfo.md new file mode 100644 index 00000000..16c89546 --- /dev/null +++ b/docs/models/components/endpointinfo.md @@ -0,0 +1,10 @@ +# EndpointInfo + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Model` | `string` | :heavy_check_mark: | N/A | +| `Provider` | `string` | :heavy_check_mark: | N/A | +| `Selected` | `bool` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/endpointsmetadata.md b/docs/models/components/endpointsmetadata.md new file mode 100644 index 00000000..8ea541dd --- /dev/null +++ b/docs/models/components/endpointsmetadata.md @@ -0,0 +1,9 @@ +# EndpointsMetadata + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `Available` | [][components.EndpointInfo](../../models/components/endpointinfo.md) | :heavy_check_mark: | N/A | +| `Total` | `int64` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/errorcode.md b/docs/models/components/errorcode.md new file mode 100644 index 00000000..d886e446 --- /dev/null +++ b/docs/models/components/errorcode.md @@ -0,0 +1,25 @@ +# ErrorCode + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ErrorCodeInvalidToolInput + +// Open enum: custom values can be created with a direct type cast +custom := components.ErrorCode("custom_value") +``` + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `ErrorCodeInvalidToolInput` | invalid_tool_input | +| `ErrorCodeUnavailable` | unavailable | +| `ErrorCodeMaxUsesExceeded` | max_uses_exceeded | +| `ErrorCodeTooManyRequests` | too_many_requests | +| `ErrorCodeQueryTooLong` | query_too_long | \ No newline at end of file diff --git a/docs/models/components/failedmodel.md b/docs/models/components/failedmodel.md new file mode 100644 index 00000000..144474f9 --- /dev/null +++ b/docs/models/components/failedmodel.md @@ -0,0 +1,10 @@ +# FailedModel + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `Error` | `string` | :heavy_check_mark: | Error message describing why the model failed. | +| `Model` | `string` | :heavy_check_mark: | Slug of the analysis model that failed. | +| `StatusCode` | `*int64` | :heavy_minus_sign: | HTTP status code from the upstream response, when available (e.g. 402, 429). | \ No newline at end of file diff --git a/docs/models/components/field.md b/docs/models/components/field.md new file mode 100644 index 00000000..3a07d0e3 --- /dev/null +++ b/docs/models/components/field.md @@ -0,0 +1,32 @@ +# Field + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.FieldModel + +// Open enum: custom values can be created with a direct type cast +custom := components.Field("custom_value") +``` + + +## Values + +| Name | Value | +| ----------------------- | ----------------------- | +| `FieldModel` | model | +| `FieldProvider` | provider | +| `FieldSessionID` | session_id | +| `FieldUserID` | user_id | +| `FieldAPIKeyName` | api_key_name | +| `FieldFinishReason` | finish_reason | +| `FieldInput` | input | +| `FieldOutput` | output | +| `FieldTotalCost` | total_cost | +| `FieldTotalTokens` | total_tokens | +| `FieldPromptTokens` | prompt_tokens | +| `FieldCompletionTokens` | completion_tokens | \ No newline at end of file diff --git a/docs/models/components/filedeleteresponse.md b/docs/models/components/filedeleteresponse.md new file mode 100644 index 00000000..e33b53ec --- /dev/null +++ b/docs/models/components/filedeleteresponse.md @@ -0,0 +1,11 @@ +# FileDeleteResponse + +Confirmation that a file was deleted. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `ID` | `string` | :heavy_check_mark: | N/A | +| `Type` | [components.FileDeleteResponseType](../../models/components/filedeleteresponsetype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/filedeleteresponsetype.md b/docs/models/components/filedeleteresponsetype.md new file mode 100644 index 00000000..c3277cdf --- /dev/null +++ b/docs/models/components/filedeleteresponsetype.md @@ -0,0 +1,18 @@ +# FileDeleteResponseType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.FileDeleteResponseTypeFileDeleted +``` + + +## Values + +| Name | Value | +| ----------------------------------- | ----------------------------------- | +| `FileDeleteResponseTypeFileDeleted` | file_deleted | \ No newline at end of file diff --git a/docs/models/components/filelistresponse.md b/docs/models/components/filelistresponse.md new file mode 100644 index 00000000..5089d131 --- /dev/null +++ b/docs/models/components/filelistresponse.md @@ -0,0 +1,14 @@ +# FileListResponse + +A page of files belonging to the requesting workspace. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `Cursor` | `*string` | :heavy_check_mark: | Opaque cursor for the next page; null when there are no more results. | +| `Data` | [][components.FileMetadata](../../models/components/filemetadata.md) | :heavy_check_mark: | N/A | +| `FirstID` | `*string` | :heavy_check_mark: | N/A | +| `HasMore` | `bool` | :heavy_check_mark: | N/A | +| `LastID` | `*string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/filemetadata.md b/docs/models/components/filemetadata.md new file mode 100644 index 00000000..48f44c22 --- /dev/null +++ b/docs/models/components/filemetadata.md @@ -0,0 +1,16 @@ +# FileMetadata + +Metadata describing a stored file. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `CreatedAt` | `string` | :heavy_check_mark: | N/A | +| `Downloadable` | `bool` | :heavy_check_mark: | N/A | +| `Filename` | `string` | :heavy_check_mark: | N/A | +| `ID` | `string` | :heavy_check_mark: | N/A | +| `MimeType` | `string` | :heavy_check_mark: | N/A | +| `SizeBytes` | `int64` | :heavy_check_mark: | N/A | +| `Type` | [components.FileMetadataType](../../models/components/filemetadatatype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/filemetadatatype.md b/docs/models/components/filemetadatatype.md new file mode 100644 index 00000000..35111dfe --- /dev/null +++ b/docs/models/components/filemetadatatype.md @@ -0,0 +1,18 @@ +# FileMetadataType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.FileMetadataTypeFile +``` + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `FileMetadataTypeFile` | file | \ No newline at end of file diff --git a/docs/models/components/filesearchservertoolvalue1.md b/docs/models/components/filesearchservertoolvalue1.md new file mode 100644 index 00000000..290dcd38 --- /dev/null +++ b/docs/models/components/filesearchservertoolvalue1.md @@ -0,0 +1,29 @@ +# FileSearchServerToolValue1 + + +## Supported Types + +### + +```go +fileSearchServerToolValue1 := components.CreateFileSearchServerToolValue1Str(string{/* values here */}) +``` + +### + +```go +fileSearchServerToolValue1 := components.CreateFileSearchServerToolValue1Number(float64{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch fileSearchServerToolValue1.Type { + case components.FileSearchServerToolValue1TypeStr: + // fileSearchServerToolValue1.Str is populated + case components.FileSearchServerToolValue1TypeNumber: + // fileSearchServerToolValue1.Number is populated +} +``` diff --git a/docs/models/components/filesearchservertoolvalue2.md b/docs/models/components/filesearchservertoolvalue2.md new file mode 100644 index 00000000..99ea39b8 --- /dev/null +++ b/docs/models/components/filesearchservertoolvalue2.md @@ -0,0 +1,45 @@ +# FileSearchServerToolValue2 + + +## Supported Types + +### + +```go +fileSearchServerToolValue2 := components.CreateFileSearchServerToolValue2Str(string{/* values here */}) +``` + +### + +```go +fileSearchServerToolValue2 := components.CreateFileSearchServerToolValue2Number(float64{/* values here */}) +``` + +### + +```go +fileSearchServerToolValue2 := components.CreateFileSearchServerToolValue2Boolean(bool{/* values here */}) +``` + +### + +```go +fileSearchServerToolValue2 := components.CreateFileSearchServerToolValue2ArrayOfFileSearchServerToolValue1([]components.FileSearchServerToolValue1{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch fileSearchServerToolValue2.Type { + case components.FileSearchServerToolValue2TypeStr: + // fileSearchServerToolValue2.Str is populated + case components.FileSearchServerToolValue2TypeNumber: + // fileSearchServerToolValue2.Number is populated + case components.FileSearchServerToolValue2TypeBoolean: + // fileSearchServerToolValue2.Boolean is populated + case components.FileSearchServerToolValue2TypeArrayOfFileSearchServerToolValue1: + // fileSearchServerToolValue2.ArrayOfFileSearchServerToolValue1 is populated +} +``` diff --git a/docs/models/components/filters.md b/docs/models/components/filters.md index 2a6b168e..9e4eeeef 100644 --- a/docs/models/components/filters.md +++ b/docs/models/components/filters.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `Key` | `string` | :heavy_check_mark: | N/A | -| `Type` | [components.FiltersType](../../models/components/filterstype.md) | :heavy_check_mark: | N/A | -| `Value` | [components.Value2](../../models/components/value2.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `Key` | `string` | :heavy_check_mark: | N/A | +| `Type` | [components.FiltersType](../../models/components/filterstype.md) | :heavy_check_mark: | N/A | +| `Value` | [components.FileSearchServerToolValue2](../../models/components/filesearchservertoolvalue2.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/functioncallitem.md b/docs/models/components/functioncallitem.md index 8c5a2a85..11f98d1d 100644 --- a/docs/models/components/functioncallitem.md +++ b/docs/models/components/functioncallitem.md @@ -5,11 +5,12 @@ A function call initiated by the model ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `Arguments` | `string` | :heavy_check_mark: | N/A | | -| `CallID` | `string` | :heavy_check_mark: | N/A | | -| `ID` | `string` | :heavy_check_mark: | N/A | | -| `Name` | `string` | :heavy_check_mark: | N/A | | -| `Status` | [*components.ToolCallStatus](../../models/components/toolcallstatus.md) | :heavy_minus_sign: | N/A | completed | -| `Type` | [components.FunctionCallItemType](../../models/components/functioncallitemtype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `Arguments` | `string` | :heavy_check_mark: | N/A | | +| `CallID` | `string` | :heavy_check_mark: | N/A | | +| `ID` | `string` | :heavy_check_mark: | N/A | | +| `Name` | `string` | :heavy_check_mark: | N/A | | +| `Namespace` | `*string` | :heavy_minus_sign: | Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) | | +| `Status` | [*components.ToolCallStatus](../../models/components/toolcallstatus.md) | :heavy_minus_sign: | N/A | completed | +| `Type` | [components.FunctionCallItemType](../../models/components/functioncallitemtype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/functioncalloutputitemdetail.md b/docs/models/components/functioncalloutputitemdetail.md index 64961392..075d5270 100644 --- a/docs/models/components/functioncalloutputitemdetail.md +++ b/docs/models/components/functioncalloutputitemdetail.md @@ -16,8 +16,9 @@ custom := components.FunctionCallOutputItemDetail("custom_value") ## Values -| Name | Value | -| ---------------------------------- | ---------------------------------- | -| `FunctionCallOutputItemDetailAuto` | auto | -| `FunctionCallOutputItemDetailHigh` | high | -| `FunctionCallOutputItemDetailLow` | low | \ No newline at end of file +| Name | Value | +| -------------------------------------- | -------------------------------------- | +| `FunctionCallOutputItemDetailAuto` | auto | +| `FunctionCallOutputItemDetailHigh` | high | +| `FunctionCallOutputItemDetailLow` | low | +| `FunctionCallOutputItemDetailOriginal` | original | \ No newline at end of file diff --git a/docs/models/components/functioncalloutputitemoutputinputimage.md b/docs/models/components/functioncalloutputitemoutputinputimage.md new file mode 100644 index 00000000..972e487f --- /dev/null +++ b/docs/models/components/functioncalloutputitemoutputinputimage.md @@ -0,0 +1,12 @@ +# FunctionCallOutputItemOutputInputImage + +Image input content item + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `Detail` | [components.FunctionCallOutputItemDetail](../../models/components/functioncalloutputitemdetail.md) | :heavy_check_mark: | N/A | +| `ImageURL` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `Type` | [components.FunctionCallOutputItemTypeInputImage](../../models/components/functioncalloutputitemtypeinputimage.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/functioncalloutputitemoutputunion1.md b/docs/models/components/functioncalloutputitemoutputunion1.md index c81e70e7..8c921e4b 100644 --- a/docs/models/components/functioncalloutputitemoutputunion1.md +++ b/docs/models/components/functioncalloutputitemoutputunion1.md @@ -9,10 +9,10 @@ functionCallOutputItemOutputUnion1 := components.CreateFunctionCallOutputItemOutputUnion1InputText(components.InputText{/* values here */}) ``` -### OutputInputImage +### FunctionCallOutputItemOutputInputImage ```go -functionCallOutputItemOutputUnion1 := components.CreateFunctionCallOutputItemOutputUnion1InputImage(components.OutputInputImage{/* values here */}) +functionCallOutputItemOutputUnion1 := components.CreateFunctionCallOutputItemOutputUnion1InputImage(components.FunctionCallOutputItemOutputInputImage{/* values here */}) ``` ### InputFile @@ -30,7 +30,7 @@ switch functionCallOutputItemOutputUnion1.Type { case components.FunctionCallOutputItemOutputUnion1TypeInputText: // functionCallOutputItemOutputUnion1.InputText is populated case components.FunctionCallOutputItemOutputUnion1TypeInputImage: - // functionCallOutputItemOutputUnion1.OutputInputImage is populated + // functionCallOutputItemOutputUnion1.FunctionCallOutputItemOutputInputImage is populated case components.FunctionCallOutputItemOutputUnion1TypeInputFile: // functionCallOutputItemOutputUnion1.InputFile is populated } diff --git a/docs/models/components/functioncalloutputitemtypeinputimage.md b/docs/models/components/functioncalloutputitemtypeinputimage.md new file mode 100644 index 00000000..27198f3f --- /dev/null +++ b/docs/models/components/functioncalloutputitemtypeinputimage.md @@ -0,0 +1,18 @@ +# FunctionCallOutputItemTypeInputImage + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.FunctionCallOutputItemTypeInputImageInputImage +``` + + +## Values + +| Name | Value | +| ------------------------------------------------ | ------------------------------------------------ | +| `FunctionCallOutputItemTypeInputImageInputImage` | input_image | \ No newline at end of file diff --git a/docs/models/components/fusionanalysisresult.md b/docs/models/components/fusionanalysisresult.md new file mode 100644 index 00000000..eaaba7ed --- /dev/null +++ b/docs/models/components/fusionanalysisresult.md @@ -0,0 +1,14 @@ +# FusionAnalysisResult + +Structured analysis produced by the fusion judge model. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `BlindSpots` | []`string` | :heavy_check_mark: | N/A | +| `Consensus` | []`string` | :heavy_check_mark: | N/A | +| `Contradictions` | [][components.Contradiction](../../models/components/contradiction.md) | :heavy_check_mark: | N/A | +| `PartialCoverage` | [][components.PartialCoverage](../../models/components/partialcoverage.md) | :heavy_check_mark: | N/A | +| `UniqueInsights` | [][components.UniqueInsight](../../models/components/uniqueinsight.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/fusioncallanalysiscompletedevent.md b/docs/models/components/fusioncallanalysiscompletedevent.md new file mode 100644 index 00000000..66dbdacc --- /dev/null +++ b/docs/models/components/fusioncallanalysiscompletedevent.md @@ -0,0 +1,14 @@ +# FusionCallAnalysisCompletedEvent + +Emitted when the fusion judge completes with the structured analysis. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Analysis` | [components.FusionAnalysisResult](../../models/components/fusionanalysisresult.md) | :heavy_check_mark: | Structured analysis produced by the fusion judge model. | {
"blind_spots": [
"No model considered the impact on existing API consumers."
],
"consensus": [
"All panel models agree the request is asking for a concise summary."
],
"contradictions": [
{
"stances": [
{
"model": "openai/gpt-5",
"stance": "Favors an incremental rollout."
},
{
"model": "anthropic/claude-sonnet-4.5",
"stance": "Favors a single coordinated migration."
}
],
"topic": "Recommended approach"
}
],
"partial_coverage": [
{
"models": [
"openai/gpt-5"
],
"point": "Only one model addressed the rollback strategy."
}
],
"unique_insights": [
{
"insight": "Highlighted a backwards-compatibility risk the other models missed.",
"model": "anthropic/claude-sonnet-4.5"
}
]
} | +| `ItemID` | `string` | :heavy_check_mark: | N/A | | +| `OutputIndex` | `int64` | :heavy_check_mark: | N/A | | +| `SequenceNumber` | `int64` | :heavy_check_mark: | N/A | | +| `Type` | [components.FusionCallAnalysisCompletedEventType](../../models/components/fusioncallanalysiscompletedeventtype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/fusioncallanalysiscompletedeventtype.md b/docs/models/components/fusioncallanalysiscompletedeventtype.md new file mode 100644 index 00000000..dd4ef98b --- /dev/null +++ b/docs/models/components/fusioncallanalysiscompletedeventtype.md @@ -0,0 +1,18 @@ +# FusionCallAnalysisCompletedEventType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.FusionCallAnalysisCompletedEventTypeResponseFusionCallAnalysisCompleted +``` + + +## Values + +| Name | Value | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `FusionCallAnalysisCompletedEventTypeResponseFusionCallAnalysisCompleted` | response.fusion_call.analysis.completed | \ No newline at end of file diff --git a/docs/models/components/fusioncallanalysisinprogressevent.md b/docs/models/components/fusioncallanalysisinprogressevent.md new file mode 100644 index 00000000..1ac4aea2 --- /dev/null +++ b/docs/models/components/fusioncallanalysisinprogressevent.md @@ -0,0 +1,14 @@ +# FusionCallAnalysisInProgressEvent + +Emitted when the fusion judge starts producing the structured analysis. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `ItemID` | `string` | :heavy_check_mark: | N/A | +| `JudgeModel` | `string` | :heavy_check_mark: | N/A | +| `OutputIndex` | `int64` | :heavy_check_mark: | N/A | +| `SequenceNumber` | `int64` | :heavy_check_mark: | N/A | +| `Type` | [components.FusionCallAnalysisInProgressEventType](../../models/components/fusioncallanalysisinprogresseventtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/fusioncallanalysisinprogresseventtype.md b/docs/models/components/fusioncallanalysisinprogresseventtype.md new file mode 100644 index 00000000..ded43014 --- /dev/null +++ b/docs/models/components/fusioncallanalysisinprogresseventtype.md @@ -0,0 +1,18 @@ +# FusionCallAnalysisInProgressEventType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.FusionCallAnalysisInProgressEventTypeResponseFusionCallAnalysisInProgress +``` + + +## Values + +| Name | Value | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `FusionCallAnalysisInProgressEventTypeResponseFusionCallAnalysisInProgress` | response.fusion_call.analysis.in_progress | \ No newline at end of file diff --git a/docs/models/components/fusioncallcompletedevent.md b/docs/models/components/fusioncallcompletedevent.md new file mode 100644 index 00000000..90b1114f --- /dev/null +++ b/docs/models/components/fusioncallcompletedevent.md @@ -0,0 +1,13 @@ +# FusionCallCompletedEvent + +Emitted when the openrouter:fusion tool call finishes. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `ItemID` | `string` | :heavy_check_mark: | N/A | +| `OutputIndex` | `int64` | :heavy_check_mark: | N/A | +| `SequenceNumber` | `int64` | :heavy_check_mark: | N/A | +| `Type` | [components.FusionCallCompletedEventType](../../models/components/fusioncallcompletedeventtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/fusioncallcompletedeventtype.md b/docs/models/components/fusioncallcompletedeventtype.md new file mode 100644 index 00000000..e581d4d4 --- /dev/null +++ b/docs/models/components/fusioncallcompletedeventtype.md @@ -0,0 +1,18 @@ +# FusionCallCompletedEventType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.FusionCallCompletedEventTypeResponseFusionCallCompleted +``` + + +## Values + +| Name | Value | +| --------------------------------------------------------- | --------------------------------------------------------- | +| `FusionCallCompletedEventTypeResponseFusionCallCompleted` | response.fusion_call.completed | \ No newline at end of file diff --git a/docs/models/components/fusioncallinprogressevent.md b/docs/models/components/fusioncallinprogressevent.md new file mode 100644 index 00000000..879ad6aa --- /dev/null +++ b/docs/models/components/fusioncallinprogressevent.md @@ -0,0 +1,13 @@ +# FusionCallInProgressEvent + +Emitted when an openrouter:fusion tool call begins executing. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `ItemID` | `string` | :heavy_check_mark: | N/A | +| `OutputIndex` | `int64` | :heavy_check_mark: | N/A | +| `SequenceNumber` | `int64` | :heavy_check_mark: | N/A | +| `Type` | [components.FusionCallInProgressEventType](../../models/components/fusioncallinprogresseventtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/fusioncallinprogresseventtype.md b/docs/models/components/fusioncallinprogresseventtype.md new file mode 100644 index 00000000..0215b06e --- /dev/null +++ b/docs/models/components/fusioncallinprogresseventtype.md @@ -0,0 +1,18 @@ +# FusionCallInProgressEventType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.FusionCallInProgressEventTypeResponseFusionCallInProgress +``` + + +## Values + +| Name | Value | +| ----------------------------------------------------------- | ----------------------------------------------------------- | +| `FusionCallInProgressEventTypeResponseFusionCallInProgress` | response.fusion_call.in_progress | \ No newline at end of file diff --git a/docs/models/components/fusioncallpaneladdedevent.md b/docs/models/components/fusioncallpaneladdedevent.md new file mode 100644 index 00000000..da42ef4d --- /dev/null +++ b/docs/models/components/fusioncallpaneladdedevent.md @@ -0,0 +1,14 @@ +# FusionCallPanelAddedEvent + +Emitted when a fusion analysis-panel model starts. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `ItemID` | `string` | :heavy_check_mark: | N/A | +| `Model` | `string` | :heavy_check_mark: | N/A | +| `OutputIndex` | `int64` | :heavy_check_mark: | N/A | +| `SequenceNumber` | `int64` | :heavy_check_mark: | N/A | +| `Type` | [components.FusionCallPanelAddedEventType](../../models/components/fusioncallpaneladdedeventtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/fusioncallpaneladdedeventtype.md b/docs/models/components/fusioncallpaneladdedeventtype.md new file mode 100644 index 00000000..943b08f5 --- /dev/null +++ b/docs/models/components/fusioncallpaneladdedeventtype.md @@ -0,0 +1,18 @@ +# FusionCallPanelAddedEventType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.FusionCallPanelAddedEventTypeResponseFusionCallPanelAdded +``` + + +## Values + +| Name | Value | +| ----------------------------------------------------------- | ----------------------------------------------------------- | +| `FusionCallPanelAddedEventTypeResponseFusionCallPanelAdded` | response.fusion_call.panel.added | \ No newline at end of file diff --git a/docs/models/components/fusioncallpanelcompletedevent.md b/docs/models/components/fusioncallpanelcompletedevent.md new file mode 100644 index 00000000..20aa62f5 --- /dev/null +++ b/docs/models/components/fusioncallpanelcompletedevent.md @@ -0,0 +1,15 @@ +# FusionCallPanelCompletedEvent + +Emitted when a fusion panel model finishes with its full content. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `Content` | `string` | :heavy_check_mark: | N/A | +| `ItemID` | `string` | :heavy_check_mark: | N/A | +| `Model` | `string` | :heavy_check_mark: | N/A | +| `OutputIndex` | `int64` | :heavy_check_mark: | N/A | +| `SequenceNumber` | `int64` | :heavy_check_mark: | N/A | +| `Type` | [components.FusionCallPanelCompletedEventType](../../models/components/fusioncallpanelcompletedeventtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/fusioncallpanelcompletedeventtype.md b/docs/models/components/fusioncallpanelcompletedeventtype.md new file mode 100644 index 00000000..b4e6b654 --- /dev/null +++ b/docs/models/components/fusioncallpanelcompletedeventtype.md @@ -0,0 +1,18 @@ +# FusionCallPanelCompletedEventType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.FusionCallPanelCompletedEventTypeResponseFusionCallPanelCompleted +``` + + +## Values + +| Name | Value | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `FusionCallPanelCompletedEventTypeResponseFusionCallPanelCompleted` | response.fusion_call.panel.completed | \ No newline at end of file diff --git a/docs/models/components/fusioncallpaneldeltaevent.md b/docs/models/components/fusioncallpaneldeltaevent.md new file mode 100644 index 00000000..03e2f043 --- /dev/null +++ b/docs/models/components/fusioncallpaneldeltaevent.md @@ -0,0 +1,15 @@ +# FusionCallPanelDeltaEvent + +Incremental content token from a fusion panel model. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `Delta` | `string` | :heavy_check_mark: | N/A | +| `ItemID` | `string` | :heavy_check_mark: | N/A | +| `Model` | `string` | :heavy_check_mark: | N/A | +| `OutputIndex` | `int64` | :heavy_check_mark: | N/A | +| `SequenceNumber` | `int64` | :heavy_check_mark: | N/A | +| `Type` | [components.FusionCallPanelDeltaEventType](../../models/components/fusioncallpaneldeltaeventtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/fusioncallpaneldeltaeventtype.md b/docs/models/components/fusioncallpaneldeltaeventtype.md new file mode 100644 index 00000000..4e6e83df --- /dev/null +++ b/docs/models/components/fusioncallpaneldeltaeventtype.md @@ -0,0 +1,18 @@ +# FusionCallPanelDeltaEventType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.FusionCallPanelDeltaEventTypeResponseFusionCallPanelDelta +``` + + +## Values + +| Name | Value | +| ----------------------------------------------------------- | ----------------------------------------------------------- | +| `FusionCallPanelDeltaEventTypeResponseFusionCallPanelDelta` | response.fusion_call.panel.delta | \ No newline at end of file diff --git a/docs/models/components/fusioncallpanelfailedevent.md b/docs/models/components/fusioncallpanelfailedevent.md new file mode 100644 index 00000000..8b9f5baf --- /dev/null +++ b/docs/models/components/fusioncallpanelfailedevent.md @@ -0,0 +1,16 @@ +# FusionCallPanelFailedEvent + +Emitted when a fusion panel model fails. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `Error` | `string` | :heavy_check_mark: | N/A | +| `ItemID` | `string` | :heavy_check_mark: | N/A | +| `Model` | `string` | :heavy_check_mark: | N/A | +| `OutputIndex` | `int64` | :heavy_check_mark: | N/A | +| `SequenceNumber` | `int64` | :heavy_check_mark: | N/A | +| `StatusCode` | `*int64` | :heavy_minus_sign: | N/A | +| `Type` | [components.FusionCallPanelFailedEventType](../../models/components/fusioncallpanelfailedeventtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/fusioncallpanelfailedeventtype.md b/docs/models/components/fusioncallpanelfailedeventtype.md new file mode 100644 index 00000000..707dfa42 --- /dev/null +++ b/docs/models/components/fusioncallpanelfailedeventtype.md @@ -0,0 +1,18 @@ +# FusionCallPanelFailedEventType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.FusionCallPanelFailedEventTypeResponseFusionCallPanelFailed +``` + + +## Values + +| Name | Value | +| ------------------------------------------------------------- | ------------------------------------------------------------- | +| `FusionCallPanelFailedEventTypeResponseFusionCallPanelFailed` | response.fusion_call.panel.failed | \ No newline at end of file diff --git a/docs/models/components/fusioncallpanelreasoningdeltaevent.md b/docs/models/components/fusioncallpanelreasoningdeltaevent.md new file mode 100644 index 00000000..2bc0e175 --- /dev/null +++ b/docs/models/components/fusioncallpanelreasoningdeltaevent.md @@ -0,0 +1,15 @@ +# FusionCallPanelReasoningDeltaEvent + +Incremental reasoning token from a fusion panel model. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `Delta` | `string` | :heavy_check_mark: | N/A | +| `ItemID` | `string` | :heavy_check_mark: | N/A | +| `Model` | `string` | :heavy_check_mark: | N/A | +| `OutputIndex` | `int64` | :heavy_check_mark: | N/A | +| `SequenceNumber` | `int64` | :heavy_check_mark: | N/A | +| `Type` | [components.FusionCallPanelReasoningDeltaEventType](../../models/components/fusioncallpanelreasoningdeltaeventtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/fusioncallpanelreasoningdeltaeventtype.md b/docs/models/components/fusioncallpanelreasoningdeltaeventtype.md new file mode 100644 index 00000000..116c36a6 --- /dev/null +++ b/docs/models/components/fusioncallpanelreasoningdeltaeventtype.md @@ -0,0 +1,18 @@ +# FusionCallPanelReasoningDeltaEventType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.FusionCallPanelReasoningDeltaEventTypeResponseFusionCallPanelReasoningDelta +``` + + +## Values + +| Name | Value | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `FusionCallPanelReasoningDeltaEventTypeResponseFusionCallPanelReasoningDelta` | response.fusion_call.panel.reasoning.delta | \ No newline at end of file diff --git a/docs/models/components/fusionplugin.md b/docs/models/components/fusionplugin.md new file mode 100644 index 00000000..ae7186f5 --- /dev/null +++ b/docs/models/components/fusionplugin.md @@ -0,0 +1,13 @@ +# FusionPlugin + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AnalysisModels` | []`string` | :heavy_minus_sign: | Slugs of models to run in parallel as the "expert panel" the judge analyzes. Each model receives the same user prompt with web_search + web_fetch enabled. Capped at 8 models to bound cost amplification. When omitted, defaults to the Quality preset from the /labs/fusion UI (~anthropic/claude-opus-latest, ~openai/gpt-latest, ~google/gemini-pro-latest). | [
"~anthropic/claude-opus-latest",
"~openai/gpt-latest",
"~google/gemini-pro-latest"
] | +| `Enabled` | `*bool` | :heavy_minus_sign: | Set to false to disable the fusion plugin for this request. Defaults to true. | | +| `ID` | [components.FusionPluginID](../../models/components/fusionpluginid.md) | :heavy_check_mark: | N/A | | +| `MaxToolCalls` | `*int64` | :heavy_minus_sign: | Maximum number of tool-calling steps each panelist (analysis model) and the judge model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to 8. Capped at 16. | 12 | +| `Model` | `*string` | :heavy_minus_sign: | Slug of the model that performs both the judge step (with web_search + web_fetch) and the final synthesis. When omitted, defaults to the first model in the Quality preset. | ~anthropic/claude-opus-latest | +| `Tools` | [][components.FusionPluginTool](../../models/components/fusionplugintool.md) | :heavy_minus_sign: | Server tools available to panelist and judge inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: "openrouter:web_search" }, { type: "openrouter:web_fetch" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only). | [
{
"parameters": {
"excluded_domains": [
"example.com"
]
},
"type": "openrouter:web_search"
},
{
"type": "openrouter:web_fetch"
}
] | \ No newline at end of file diff --git a/docs/models/components/fusionpluginid.md b/docs/models/components/fusionpluginid.md new file mode 100644 index 00000000..368bb7d4 --- /dev/null +++ b/docs/models/components/fusionpluginid.md @@ -0,0 +1,18 @@ +# FusionPluginID + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.FusionPluginIDFusion +``` + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `FusionPluginIDFusion` | fusion | \ No newline at end of file diff --git a/docs/models/components/fusionplugintool.md b/docs/models/components/fusionplugintool.md new file mode 100644 index 00000000..bba489b1 --- /dev/null +++ b/docs/models/components/fusionplugintool.md @@ -0,0 +1,9 @@ +# FusionPluginTool + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `Parameters` | map[string]`any` | :heavy_minus_sign: | Optional configuration forwarded as the tool's `parameters` object. | +| `Type` | `string` | :heavy_check_mark: | Server tool type identifier (e.g. "openrouter:web_search", "openrouter:web_fetch"). | \ No newline at end of file diff --git a/docs/models/components/fusionservertoolconfig.md b/docs/models/components/fusionservertoolconfig.md new file mode 100644 index 00000000..c8513720 --- /dev/null +++ b/docs/models/components/fusionservertoolconfig.md @@ -0,0 +1,16 @@ +# FusionServerToolConfig + +Configuration for the openrouter:fusion server tool. + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AnalysisModels` | []`string` | :heavy_minus_sign: | Slugs of models to run in parallel as the analysis panel. Each model receives the user prompt with openrouter:web_search and openrouter:web_fetch enabled, then a judge model summarizes the collective output into structured analysis JSON. Capped at 8 models to bound cost amplification. Defaults to the Quality preset from /labs/fusion. | [
"~anthropic/claude-opus-latest",
"~openai/gpt-latest",
"~google/gemini-pro-latest"
] | +| `MaxCompletionTokens` | `*int64` | :heavy_minus_sign: | Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, the provider's default applies. | 16384 | +| `MaxToolCalls` | `*int64` | :heavy_minus_sign: | Maximum number of tool-calling steps each panelist (analysis model) and the judge model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to 8. Capped at 16. | 12 | +| `Model` | `*string` | :heavy_minus_sign: | Slug of the judge model that produces the structured analysis JSON. Defaults to the model used in the outer API request. | ~anthropic/claude-opus-latest | +| `Reasoning` | [*components.FusionServerToolConfigReasoning](../../models/components/fusionservertoolconfigreasoning.md) | :heavy_minus_sign: | Reasoning configuration forwarded to panelist and judge inner calls. Use this to control reasoning effort and token budget for models that support extended thinking. | | +| `Temperature` | `*float64` | :heavy_minus_sign: | Sampling temperature forwarded to panelist and judge inner calls. When omitted, the provider's default applies. | 0.7 | +| `Tools` | [][components.FusionServerToolConfigTool](../../models/components/fusionservertoolconfigtool.md) | :heavy_minus_sign: | Server tools available to panelist and judge inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: "openrouter:web_search" }, { type: "openrouter:web_fetch" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only). | [
{
"parameters": {
"excluded_domains": [
"example.com"
]
},
"type": "openrouter:web_search"
},
{
"type": "openrouter:web_fetch"
}
] | \ No newline at end of file diff --git a/docs/models/components/fusionservertoolconfigeffort.md b/docs/models/components/fusionservertoolconfigeffort.md new file mode 100644 index 00000000..bd6d257b --- /dev/null +++ b/docs/models/components/fusionservertoolconfigeffort.md @@ -0,0 +1,28 @@ +# FusionServerToolConfigEffort + +Reasoning effort level for panelist and judge inner calls. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.FusionServerToolConfigEffortXhigh + +// Open enum: custom values can be created with a direct type cast +custom := components.FusionServerToolConfigEffort("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------------------- | ------------------------------------- | +| `FusionServerToolConfigEffortXhigh` | xhigh | +| `FusionServerToolConfigEffortHigh` | high | +| `FusionServerToolConfigEffortMedium` | medium | +| `FusionServerToolConfigEffortLow` | low | +| `FusionServerToolConfigEffortMinimal` | minimal | +| `FusionServerToolConfigEffortNone` | none | \ No newline at end of file diff --git a/docs/models/components/fusionservertoolconfigreasoning.md b/docs/models/components/fusionservertoolconfigreasoning.md new file mode 100644 index 00000000..4972d47e --- /dev/null +++ b/docs/models/components/fusionservertoolconfigreasoning.md @@ -0,0 +1,11 @@ +# FusionServerToolConfigReasoning + +Reasoning configuration forwarded to panelist and judge inner calls. Use this to control reasoning effort and token budget for models that support extended thinking. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Effort` | [*components.FusionServerToolConfigEffort](../../models/components/fusionservertoolconfigeffort.md) | :heavy_minus_sign: | Reasoning effort level for panelist and judge inner calls. | +| `MaxTokens` | `*int64` | :heavy_minus_sign: | Maximum number of reasoning tokens each panelist and judge model may use. Helps bound cost when models allocate too much budget to chain-of-thought. | \ No newline at end of file diff --git a/docs/models/components/fusionservertoolconfigtool.md b/docs/models/components/fusionservertoolconfigtool.md new file mode 100644 index 00000000..757f9d1a --- /dev/null +++ b/docs/models/components/fusionservertoolconfigtool.md @@ -0,0 +1,9 @@ +# FusionServerToolConfigTool + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `Parameters` | map[string]`any` | :heavy_minus_sign: | Optional configuration forwarded as the tool's `parameters` object. | +| `Type` | `string` | :heavy_check_mark: | Server tool type identifier (e.g. "openrouter:web_search", "openrouter:web_fetch"). | \ No newline at end of file diff --git a/docs/models/components/fusionservertoolopenrouter.md b/docs/models/components/fusionservertoolopenrouter.md new file mode 100644 index 00000000..62946cc9 --- /dev/null +++ b/docs/models/components/fusionservertoolopenrouter.md @@ -0,0 +1,11 @@ +# FusionServerToolOpenRouter + +OpenRouter built-in server tool: fans out the user prompt to a panel of analysis models, then asks a judge model to summarize their collective output as structured JSON the outer model can synthesize from. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `Parameters` | [*components.FusionServerToolConfig](../../models/components/fusionservertoolconfig.md) | :heavy_minus_sign: | Configuration for the openrouter:fusion server tool. | {
"analysis_models": [
"~anthropic/claude-opus-latest",
"~openai/gpt-latest",
"~google/gemini-pro-latest"
]
} | +| `Type` | [components.FusionServerToolOpenRouterType](../../models/components/fusionservertoolopenroutertype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/fusionservertoolopenroutertype.md b/docs/models/components/fusionservertoolopenroutertype.md new file mode 100644 index 00000000..8a15d3d1 --- /dev/null +++ b/docs/models/components/fusionservertoolopenroutertype.md @@ -0,0 +1,18 @@ +# FusionServerToolOpenRouterType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.FusionServerToolOpenRouterTypeOpenrouterFusion +``` + + +## Values + +| Name | Value | +| ------------------------------------------------ | ------------------------------------------------ | +| `FusionServerToolOpenRouterTypeOpenrouterFusion` | openrouter:fusion | \ No newline at end of file diff --git a/docs/models/components/generationcontentdataoutput.md b/docs/models/components/generationcontentdataoutput.md index d267ae5c..03ccb3a3 100644 --- a/docs/models/components/generationcontentdataoutput.md +++ b/docs/models/components/generationcontentdataoutput.md @@ -8,4 +8,4 @@ The output from the generation | Field | Type | Required | Description | Example | | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | | `Completion` | `*string` | :heavy_check_mark: | The completion output | The meaning of life is a philosophical question... | -| `Reasoning` | `*string` | :heavy_check_mark: | Reasoning/thinking output, if any | | \ No newline at end of file +| `Reasoning` | `*string` | :heavy_check_mark: | Reasoning/thinking output, if any | null | \ No newline at end of file diff --git a/docs/models/components/generationresponsedata.md b/docs/models/components/generationresponsedata.md index a80be725..36dac265 100644 --- a/docs/models/components/generationresponsedata.md +++ b/docs/models/components/generationresponsedata.md @@ -5,44 +5,49 @@ Generation data ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -| `APIType` | [*components.APIType](../../models/components/apitype.md) | :heavy_check_mark: | Type of API used for the generation | | -| `AppID` | `*int64` | :heavy_check_mark: | ID of the app that made the request | 12345 | -| `CacheDiscount` | `*float64` | :heavy_check_mark: | Discount applied due to caching | 0.0002 | -| `Cancelled` | `*bool` | :heavy_check_mark: | Whether the generation was cancelled | false | -| `CreatedAt` | `string` | :heavy_check_mark: | ISO 8601 timestamp of when the generation was created | 2024-07-15T23:33:19.433273+00:00 | -| `ExternalUser` | `*string` | :heavy_check_mark: | External user identifier | user-123 | -| `FinishReason` | `*string` | :heavy_check_mark: | Reason the generation finished | stop | -| `GenerationTime` | `*float64` | :heavy_check_mark: | Time taken for generation in milliseconds | 1200 | -| `HTTPReferer` | `*string` | :heavy_check_mark: | Referer header from the request | | -| `ID` | `string` | :heavy_check_mark: | Unique identifier for the generation | gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG | -| `IsByok` | `bool` | :heavy_check_mark: | Whether this used bring-your-own-key | false | -| `Latency` | `*float64` | :heavy_check_mark: | Total latency in milliseconds | 1250 | -| `Model` | `string` | :heavy_check_mark: | Model used for the generation | sao10k/l3-stheno-8b | -| `ModerationLatency` | `*float64` | :heavy_check_mark: | Moderation latency in milliseconds | 50 | -| `NativeFinishReason` | `*string` | :heavy_check_mark: | Native finish reason as reported by provider | stop | -| `NativeTokensCached` | `*int64` | :heavy_check_mark: | Native cached tokens as reported by provider | 3 | -| `NativeTokensCompletion` | `*int64` | :heavy_check_mark: | Native completion tokens as reported by provider | 25 | -| `NativeTokensCompletionImages` | `*int64` | :heavy_check_mark: | Native completion image tokens as reported by provider | 0 | -| `NativeTokensPrompt` | `*int64` | :heavy_check_mark: | Native prompt tokens as reported by provider | 10 | -| `NativeTokensReasoning` | `*int64` | :heavy_check_mark: | Native reasoning tokens as reported by provider | 5 | -| `NumInputAudioPrompt` | `*int64` | :heavy_check_mark: | Number of audio inputs in the prompt | 0 | -| `NumMediaCompletion` | `*int64` | :heavy_check_mark: | Number of media items in the completion | 0 | -| `NumMediaPrompt` | `*int64` | :heavy_check_mark: | Number of media items in the prompt | 1 | -| `NumSearchResults` | `*int64` | :heavy_check_mark: | Number of search results included | 5 | -| `Origin` | `string` | :heavy_check_mark: | Origin URL of the request | https://openrouter.ai/ | -| `ProviderName` | `*string` | :heavy_check_mark: | Name of the provider that served the request | Infermatic | -| `ProviderResponses` | [][components.ProviderResponse](../../models/components/providerresponse.md) | :heavy_check_mark: | List of provider responses for this generation, including fallback attempts | | -| `RequestID` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Unique identifier grouping all generations from a single API request | req-1727282430-aBcDeFgHiJkLmNoPqRsT | -| `Router` | `*string` | :heavy_check_mark: | Router used for the request (e.g., openrouter/auto) | openrouter/auto | -| `SessionID` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Session identifier grouping multiple generations in the same session | | -| `Streamed` | `*bool` | :heavy_check_mark: | Whether the response was streamed | true | -| `TokensCompletion` | `*int64` | :heavy_check_mark: | Number of tokens in the completion | 25 | -| `TokensPrompt` | `*int64` | :heavy_check_mark: | Number of tokens in the prompt | 10 | -| `TotalCost` | `float64` | :heavy_check_mark: | Total cost of the generation in USD | 0.0015 | -| `UpstreamID` | `*string` | :heavy_check_mark: | Upstream provider's identifier for this generation | chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946 | -| `UpstreamInferenceCost` | `*float64` | :heavy_check_mark: | Cost charged by the upstream provider | 0.0012 | -| `Usage` | `float64` | :heavy_check_mark: | Usage amount in USD | 0.0015 | -| `UserAgent` | `*string` | :heavy_check_mark: | User-Agent header from the request | | -| `WebSearchEngine` | `*string` | :heavy_check_mark: | The resolved web search engine used for this generation (e.g. exa, firecrawl, parallel) | exa | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `APIType` | [*components.APIType](../../models/components/apitype.md) | :heavy_check_mark: | Type of API used for the generation | | +| `AppID` | `*int64` | :heavy_check_mark: | ID of the app that made the request | 12345 | +| `CacheDiscount` | `*float64` | :heavy_check_mark: | Discount applied due to caching | 0.0002 | +| `Cancelled` | `*bool` | :heavy_check_mark: | Whether the generation was cancelled | false | +| `CreatedAt` | `string` | :heavy_check_mark: | ISO 8601 timestamp of when the generation was created | 2024-07-15T23:33:19.433273+00:00 | +| `DataRegion` | [components.DataRegion](../../models/components/dataregion.md) | :heavy_check_mark: | The data region this generation was routed through. 'europe' for EU-routed requests, 'global' otherwise. | global | +| `ExternalUser` | `*string` | :heavy_check_mark: | External user identifier | user-123 | +| `FinishReason` | `*string` | :heavy_check_mark: | Reason the generation finished | stop | +| `GenerationTime` | `*float64` | :heavy_check_mark: | Time taken for generation in milliseconds | 1200 | +| `HTTPReferer` | `*string` | :heavy_check_mark: | Referer header from the request | | +| `ID` | `string` | :heavy_check_mark: | Unique identifier for the generation | gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG | +| `IsByok` | `bool` | :heavy_check_mark: | Whether this used bring-your-own-key | false | +| `Latency` | `*float64` | :heavy_check_mark: | Total latency in milliseconds | 1250 | +| `Model` | `string` | :heavy_check_mark: | Model used for the generation | sao10k/l3-stheno-8b | +| `ModerationLatency` | `*float64` | :heavy_check_mark: | Moderation latency in milliseconds | 50 | +| `NativeFinishReason` | `*string` | :heavy_check_mark: | Native finish reason as reported by provider | stop | +| `NativeTokensCached` | `*int64` | :heavy_check_mark: | Native cached tokens as reported by provider | 3 | +| `NativeTokensCompletion` | `*int64` | :heavy_check_mark: | Native completion tokens as reported by provider | 25 | +| `NativeTokensCompletionImages` | `*int64` | :heavy_check_mark: | Native completion image tokens as reported by provider | 0 | +| `NativeTokensPrompt` | `*int64` | :heavy_check_mark: | Native prompt tokens as reported by provider | 10 | +| `NativeTokensReasoning` | `*int64` | :heavy_check_mark: | Native reasoning tokens as reported by provider | 5 | +| `NumFetches` | `*int64` | :heavy_check_mark: | Number of web fetches performed | 0 | +| `NumInputAudioPrompt` | `*int64` | :heavy_check_mark: | Number of audio inputs in the prompt | 0 | +| `NumMediaCompletion` | `*int64` | :heavy_check_mark: | Number of media items in the completion | 0 | +| `NumMediaPrompt` | `*int64` | :heavy_check_mark: | Number of media items in the prompt | 1 | +| `NumSearchResults` | `*int64` | :heavy_check_mark: | Number of search results included | 5 | +| `Origin` | `string` | :heavy_check_mark: | Origin URL of the request | https://openrouter.ai/ | +| `PresetID` | `*string` | :heavy_check_mark: | ID of the preset used for this generation, null if no preset was used | a9e8d400-592a-494f-908c-375efa66cafd | +| `ProviderName` | `*string` | :heavy_check_mark: | Name of the provider that served the request | Infermatic | +| `ProviderResponses` | [][components.ProviderResponse](../../models/components/providerresponse.md) | :heavy_check_mark: | List of provider responses for this generation, including fallback attempts | | +| `RequestID` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Unique identifier grouping all generations from a single API request | req-1727282430-aBcDeFgHiJkLmNoPqRsT | +| `ResponseCacheSourceID` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | If this generation was served from response cache, contains the original generation ID. Null otherwise. | | +| `Router` | `*string` | :heavy_check_mark: | Router used for the request (e.g., openrouter/auto) | openrouter/auto | +| `ServiceTier` | `*string` | :heavy_check_mark: | Service tier the upstream provider reported running this request on, or null if it did not report one. | priority | +| `SessionID` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Session identifier grouping multiple generations in the same session | | +| `Streamed` | `*bool` | :heavy_check_mark: | Whether the response was streamed | true | +| `TokensCompletion` | `*int64` | :heavy_check_mark: | Number of tokens in the completion | 25 | +| `TokensPrompt` | `*int64` | :heavy_check_mark: | Number of tokens in the prompt | 10 | +| `TotalCost` | `float64` | :heavy_check_mark: | Total cost of the generation in USD | 0.0015 | +| `UpstreamID` | `*string` | :heavy_check_mark: | Upstream provider's identifier for this generation | chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946 | +| `UpstreamInferenceCost` | `*float64` | :heavy_check_mark: | Cost charged by the upstream provider | 0.0012 | +| `Usage` | `float64` | :heavy_check_mark: | Usage amount in USD | 0.0015 | +| `UserAgent` | `*string` | :heavy_check_mark: | User-Agent header from the request | | +| `WebSearchEngine` | `*string` | :heavy_check_mark: | The resolved web search engine used for this generation (e.g. exa, firecrawl, parallel) | exa | \ No newline at end of file diff --git a/docs/models/components/getbyokkeyresponse.md b/docs/models/components/getbyokkeyresponse.md new file mode 100644 index 00000000..dfe12781 --- /dev/null +++ b/docs/models/components/getbyokkeyresponse.md @@ -0,0 +1,8 @@ +# GetBYOKKeyResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Data` | [components.BYOKKey](../../models/components/byokkey.md) | :heavy_check_mark: | N/A | {
"allowed_api_key_hashes": null,
"allowed_models": null,
"allowed_user_ids": null,
"created_at": "2025-08-24T10:30:00Z",
"disabled": false,
"id": "11111111-2222-3333-4444-555555555555",
"is_fallback": false,
"label": "sk-...AbCd",
"name": "Production OpenAI Key",
"provider": "openai",
"sort_order": 0,
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
} | \ No newline at end of file diff --git a/docs/models/components/getguardrailresponse.md b/docs/models/components/getguardrailresponse.md index c18e67ea..2ac17702 100644 --- a/docs/models/components/getguardrailresponse.md +++ b/docs/models/components/getguardrailresponse.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Data` | [components.Guardrail](../../models/components/guardrail.md) | :heavy_check_mark: | N/A | {
"allowed_models": null,
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"created_at": "2025-08-24T10:30:00Z",
"description": "Guardrail for production environment",
"enforce_zdr": false,
"id": "550e8400-e29b-41d4-a716-446655440000",
"ignored_models": null,
"ignored_providers": null,
"limit_usd": 100,
"name": "Production Guardrail",
"reset_interval": "monthly",
"updated_at": "2025-08-24T15:45:00Z",
"workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Data` | [components.Guardrail](../../models/components/guardrail.md) | :heavy_check_mark: | N/A | {
"allowed_models": null,
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"content_filter_builtins": [
{
"action": "redact",
"label": "[EMAIL]",
"slug": "email"
}
],
"content_filters": null,
"created_at": "2025-08-24T10:30:00Z",
"description": "Guardrail for production environment",
"enforce_zdr": null,
"enforce_zdr_anthropic": true,
"enforce_zdr_google": false,
"enforce_zdr_openai": true,
"enforce_zdr_other": false,
"id": "550e8400-e29b-41d4-a716-446655440000",
"ignored_models": null,
"ignored_providers": null,
"limit_usd": 100,
"name": "Production Guardrail",
"reset_interval": "monthly",
"updated_at": "2025-08-24T15:45:00Z",
"workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"
} | \ No newline at end of file diff --git a/docs/models/components/getobservabilitydestinationresponse.md b/docs/models/components/getobservabilitydestinationresponse.md new file mode 100644 index 00000000..8b0bcafe --- /dev/null +++ b/docs/models/components/getobservabilitydestinationresponse.md @@ -0,0 +1,8 @@ +# GetObservabilityDestinationResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Data` | [components.ObservabilityDestination](../../models/components/observabilitydestination.md) | :heavy_check_mark: | N/A | {
"api_key_hashes": null,
"config": {
"baseUrl": "https://us.cloud.langfuse.com",
"publicKey": "pk-l...EfGh",
"secretKey": "sk-l...AbCd"
},
"created_at": "2025-08-24T10:30:00Z",
"enabled": true,
"filter_rules": null,
"id": "99999999-aaaa-bbbb-cccc-dddddddddddd",
"name": "Production Langfuse",
"privacy_mode": false,
"sampling_rate": 1,
"type": "langfuse",
"updated_at": "2025-08-24T15:45:00Z",
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
} | \ No newline at end of file diff --git a/docs/models/components/getpresetresponse.md b/docs/models/components/getpresetresponse.md new file mode 100644 index 00000000..39fcec1d --- /dev/null +++ b/docs/models/components/getpresetresponse.md @@ -0,0 +1,10 @@ +# GetPresetResponse + +A preset with its currently designated version. + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Data` | [components.PresetWithDesignatedVersion](../../models/components/presetwithdesignatedversion.md) | :heavy_check_mark: | A preset with its currently designated version. | {
"created_at": "2026-04-20T10:00:00Z",
"creator_user_id": "user_2dHFtVWx2n56w6HkM0000000000",
"description": null,
"designated_version": {
"config": {
"model": "openai/gpt-4o",
"temperature": 0.7
},
"created_at": "2026-04-20T10:00:00Z",
"creator_id": "user_2dHFtVWx2n56w6HkM0000000000",
"id": "550e8400-e29b-41d4-a716-446655440000",
"preset_id": "650e8400-e29b-41d4-a716-446655440001",
"system_prompt": "You are a helpful assistant.",
"updated_at": "2026-04-20T10:00:00Z",
"version": 1
},
"designated_version_id": "550e8400-e29b-41d4-a716-446655440000",
"id": "650e8400-e29b-41d4-a716-446655440001",
"name": "my-preset",
"slug": "my-preset",
"status": "active",
"status_updated_at": null,
"updated_at": "2026-04-20T10:00:00Z",
"workspace_id": "750e8400-e29b-41d4-a716-446655440002"
} | \ No newline at end of file diff --git a/docs/models/components/getpresetversionresponse.md b/docs/models/components/getpresetversionresponse.md new file mode 100644 index 00000000..9559491c --- /dev/null +++ b/docs/models/components/getpresetversionresponse.md @@ -0,0 +1,10 @@ +# GetPresetVersionResponse + +A single version of a preset. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Data` | [*components.PresetDesignatedVersion](../../models/components/presetdesignatedversion.md) | :heavy_check_mark: | A specific version of a preset, containing config and optional system prompt. | {
"config": {
"model": "openai/gpt-4o",
"temperature": 0.7
},
"created_at": "2026-04-20T10:00:00Z",
"creator_id": "user_2dHFtVWx2n56w6HkM0000000000",
"id": "550e8400-e29b-41d4-a716-446655440000",
"preset_id": "650e8400-e29b-41d4-a716-446655440001",
"system_prompt": "You are a helpful assistant.",
"updated_at": "2026-04-20T10:00:00Z",
"version": 1
} | \ No newline at end of file diff --git a/docs/models/components/getworkspaceresponse.md b/docs/models/components/getworkspaceresponse.md index b1832df8..527992cc 100644 --- a/docs/models/components/getworkspaceresponse.md +++ b/docs/models/components/getworkspaceresponse.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Data` | [components.Workspace](../../models/components/workspace.md) | :heavy_check_mark: | N/A | {
"created_at": "2025-08-24T10:30:00Z",
"created_by": "user_abc123",
"default_image_model": "openai/dall-e-3",
"default_provider_sort": "price",
"default_text_model": "openai/gpt-4o",
"description": "Production environment workspace",
"id": "550e8400-e29b-41d4-a716-446655440000",
"is_data_discount_logging_enabled": true,
"is_observability_broadcast_enabled": false,
"is_observability_io_logging_enabled": false,
"name": "Production",
"slug": "production",
"updated_at": "2025-08-24T15:45:00Z"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Data` | [components.Workspace](../../models/components/workspace.md) | :heavy_check_mark: | N/A | {
"created_at": "2025-08-24T10:30:00Z",
"created_by": "user_abc123",
"default_image_model": "openai/dall-e-3",
"default_provider_sort": "price",
"default_text_model": "openai/gpt-4o",
"description": "Production environment workspace",
"id": "550e8400-e29b-41d4-a716-446655440000",
"io_logging_api_key_ids": null,
"io_logging_sampling_rate": 1,
"is_data_discount_logging_enabled": true,
"is_observability_broadcast_enabled": false,
"is_observability_io_logging_enabled": false,
"name": "Production",
"slug": "production",
"updated_at": "2025-08-24T15:45:00Z"
} | \ No newline at end of file diff --git a/docs/models/components/group.md b/docs/models/components/group.md new file mode 100644 index 00000000..d3b7a005 --- /dev/null +++ b/docs/models/components/group.md @@ -0,0 +1,9 @@ +# Group + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `Logic` | [*components.Logic](../../models/components/logic.md) | :heavy_minus_sign: | N/A | +| `Rules` | [][components.Rule](../../models/components/rule.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/guardrail.md b/docs/models/components/guardrail.md index f76fcbab..94e1d4de 100644 --- a/docs/models/components/guardrail.md +++ b/docs/models/components/guardrail.md @@ -3,18 +3,24 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `AllowedModels` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Array of model canonical_slugs (immutable identifiers) | [
"openai/gpt-5.2-20251211",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] | -| `AllowedProviders` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"google"
] | -| `CreatedAt` | `string` | :heavy_check_mark: | ISO 8601 timestamp of when the guardrail was created | 2025-08-24T10:30:00Z | -| `Description` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Description of the guardrail | Guardrail for production environment | -| `EnforceZdr` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | Whether to enforce zero data retention | false | -| `ID` | `string` | :heavy_check_mark: | Unique identifier for the guardrail | 550e8400-e29b-41d4-a716-446655440000 | -| `IgnoredModels` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Array of model canonical_slugs to exclude from routing | [
"openai/gpt-4o-mini-2024-07-18"
] | -| `IgnoredProviders` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | -| `LimitUsd` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | Spending limit in USD | 100 | -| `Name` | `string` | :heavy_check_mark: | Name of the guardrail | Production Guardrail | -| `ResetInterval` | optionalnullable.OptionalNullable[[components.GuardrailInterval](../../models/components/guardrailinterval.md)] | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | -| `UpdatedAt` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | ISO 8601 timestamp of when the guardrail was last updated | 2025-08-24T15:45:00Z | -| `WorkspaceID` | `string` | :heavy_check_mark: | The workspace ID this guardrail belongs to. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AllowedModels` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Array of model canonical_slugs (immutable identifiers) | [
"openai/gpt-5.2-20251211",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] | +| `AllowedProviders` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"google"
] | +| `ContentFilterBuiltins` | optionalnullable.OptionalNullable[[][components.ContentFilterBuiltinEntry](../../models/components/contentfilterbuiltinentry.md)] | :heavy_minus_sign: | Builtin content filters applied to requests. Includes PII detectors and the regex-based prompt injection detector. | [
{
"action": "redact",
"label": "[EMAIL]",
"slug": "email"
}
] | +| `ContentFilters` | optionalnullable.OptionalNullable[[][components.ContentFilterEntry](../../models/components/contentfilterentry.md)] | :heavy_minus_sign: | Custom regex content filters applied to request messages | [
{
"action": "redact",
"label": "[API_KEY]",
"pattern": "\\b(sk-[a-zA-Z0-9]{48})\\b"
}
] | +| `CreatedAt` | `string` | :heavy_check_mark: | ISO 8601 timestamp of when the guardrail was created | 2025-08-24T10:30:00Z | +| `Description` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Description of the guardrail | Guardrail for production environment | +| ~~`EnforceZdr`~~ | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. | false | +| `EnforceZdrAnthropic` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. | false | +| `EnforceZdrGoogle` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. | false | +| `EnforceZdrOpenai` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. | false | +| `EnforceZdrOther` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided. | false | +| `ID` | `string` | :heavy_check_mark: | Unique identifier for the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `IgnoredModels` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Array of model canonical_slugs to exclude from routing | [
"openai/gpt-4o-mini-2024-07-18"
] | +| `IgnoredProviders` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | +| `LimitUsd` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | Spending limit in USD | 100 | +| `Name` | `string` | :heavy_check_mark: | Name of the guardrail | Production Guardrail | +| `ResetInterval` | optionalnullable.OptionalNullable[[components.GuardrailInterval](../../models/components/guardrailinterval.md)] | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | +| `UpdatedAt` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | ISO 8601 timestamp of when the guardrail was last updated | 2025-08-24T15:45:00Z | +| `WorkspaceID` | `string` | :heavy_check_mark: | The workspace ID this guardrail belongs to. | 0df9e665-d932-5740-b2c7-b52af166bc11 | \ No newline at end of file diff --git a/docs/models/components/inputimagedetail.md b/docs/models/components/inputimagedetail.md index 73142de1..ffb72fef 100644 --- a/docs/models/components/inputimagedetail.md +++ b/docs/models/components/inputimagedetail.md @@ -16,8 +16,9 @@ custom := components.InputImageDetail("custom_value") ## Values -| Name | Value | -| ---------------------- | ---------------------- | -| `InputImageDetailAuto` | auto | -| `InputImageDetailHigh` | high | -| `InputImageDetailLow` | low | \ No newline at end of file +| Name | Value | +| -------------------------- | -------------------------- | +| `InputImageDetailAuto` | auto | +| `InputImageDetailHigh` | high | +| `InputImageDetailLow` | low | +| `InputImageDetailOriginal` | original | \ No newline at end of file diff --git a/docs/models/components/inputmessageitemcontentinputimage.md b/docs/models/components/inputmessageitemcontentinputimage.md index b7054739..1d2accfe 100644 --- a/docs/models/components/inputmessageitemcontentinputimage.md +++ b/docs/models/components/inputmessageitemcontentinputimage.md @@ -5,8 +5,8 @@ Image input content item ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `Detail` | [components.InputMessageItemDetail](../../models/components/inputmessageitemdetail.md) | :heavy_check_mark: | N/A | -| `ImageURL` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | -| `Type` | [components.InputMessageItemContentType](../../models/components/inputmessageitemcontenttype.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `Detail` | [components.InputMessageItemDetail](../../models/components/inputmessageitemdetail.md) | :heavy_check_mark: | N/A | +| `ImageURL` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `Type` | [components.InputMessageItemTypeInputImage](../../models/components/inputmessageitemtypeinputimage.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/inputmessageitemdetail.md b/docs/models/components/inputmessageitemdetail.md index 91863ccf..c8e85896 100644 --- a/docs/models/components/inputmessageitemdetail.md +++ b/docs/models/components/inputmessageitemdetail.md @@ -16,8 +16,9 @@ custom := components.InputMessageItemDetail("custom_value") ## Values -| Name | Value | -| ---------------------------- | ---------------------------- | -| `InputMessageItemDetailAuto` | auto | -| `InputMessageItemDetailHigh` | high | -| `InputMessageItemDetailLow` | low | \ No newline at end of file +| Name | Value | +| -------------------------------- | -------------------------------- | +| `InputMessageItemDetailAuto` | auto | +| `InputMessageItemDetailHigh` | high | +| `InputMessageItemDetailLow` | low | +| `InputMessageItemDetailOriginal` | original | \ No newline at end of file diff --git a/docs/models/components/inputmessageitemtypeinputimage.md b/docs/models/components/inputmessageitemtypeinputimage.md new file mode 100644 index 00000000..51e3d6c1 --- /dev/null +++ b/docs/models/components/inputmessageitemtypeinputimage.md @@ -0,0 +1,18 @@ +# InputMessageItemTypeInputImage + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.InputMessageItemTypeInputImageInputImage +``` + + +## Values + +| Name | Value | +| ------------------------------------------ | ------------------------------------------ | +| `InputMessageItemTypeInputImageInputImage` | input_image | \ No newline at end of file diff --git a/docs/models/components/inputreference.md b/docs/models/components/inputreference.md new file mode 100644 index 00000000..16408789 --- /dev/null +++ b/docs/models/components/inputreference.md @@ -0,0 +1,39 @@ +# InputReference + +A reference asset used to guide video generation. Image references are supported by all providers; audio and video references are only honored by providers that support them (currently BytePlus Seedance 2.0). + + +## Supported Types + +### ContentPartAudio + +```go +inputReference := components.CreateInputReferenceAudioURL(components.ContentPartAudio{/* values here */}) +``` + +### ContentPartImage + +```go +inputReference := components.CreateInputReferenceImageURL(components.ContentPartImage{/* values here */}) +``` + +### ContentPartVideo + +```go +inputReference := components.CreateInputReferenceVideoURL(components.ContentPartVideo{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch inputReference.Type { + case components.InputReferenceTypeAudioURL: + // inputReference.ContentPartAudio is populated + case components.InputReferenceTypeImageURL: + // inputReference.ContentPartImage is populated + case components.InputReferenceTypeVideoURL: + // inputReference.ContentPartVideo is populated +} +``` diff --git a/docs/models/components/inputschema.md b/docs/models/components/inputschema.md new file mode 100644 index 00000000..12fc3ec5 --- /dev/null +++ b/docs/models/components/inputschema.md @@ -0,0 +1,11 @@ +# InputSchema + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `Properties` | optionalnullable.OptionalNullable[`any`] | :heavy_minus_sign: | N/A | +| `Required` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | N/A | +| `Type` | `*string` | :heavy_minus_sign: | N/A | +| `AdditionalProperties` | map[string]`any` | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/inputsunion1.md b/docs/models/components/inputsunion1.md index 1ef29d73..2b792574 100644 --- a/docs/models/components/inputsunion1.md +++ b/docs/models/components/inputsunion1.md @@ -33,6 +33,18 @@ inputsUnion1 := components.CreateInputsUnion1FunctionCallItem(components.Functio inputsUnion1 := components.CreateInputsUnion1FunctionCallOutputItem(components.FunctionCallOutputItem{/* values here */}) ``` +### ApplyPatchCallItem + +```go +inputsUnion1 := components.CreateInputsUnion1ApplyPatchCallItem(components.ApplyPatchCallItem{/* values here */}) +``` + +### ApplyPatchCallOutputItem + +```go +inputsUnion1 := components.CreateInputsUnion1ApplyPatchCallOutputItem(components.ApplyPatchCallOutputItem{/* values here */}) +``` + ### InputsMessage ```go @@ -51,6 +63,12 @@ inputsUnion1 := components.CreateInputsUnion1InputsReasoning(components.InputsRe inputsUnion1 := components.CreateInputsUnion1OutputFunctionCallItem(components.OutputFunctionCallItem{/* values here */}) ``` +### OutputCustomToolCallItem + +```go +inputsUnion1 := components.CreateInputsUnion1OutputCustomToolCallItem(components.OutputCustomToolCallItem{/* values here */}) +``` + ### OutputWebSearchCallItem ```go @@ -69,6 +87,18 @@ inputsUnion1 := components.CreateInputsUnion1OutputFileSearchCallItem(components inputsUnion1 := components.CreateInputsUnion1OutputImageGenerationCallItem(components.OutputImageGenerationCallItem{/* values here */}) ``` +### OutputCodeInterpreterCallItem + +```go +inputsUnion1 := components.CreateInputsUnion1OutputCodeInterpreterCallItem(components.OutputCodeInterpreterCallItem{/* values here */}) +``` + +### OutputComputerCallItem + +```go +inputsUnion1 := components.CreateInputsUnion1OutputComputerCallItem(components.OutputComputerCallItem{/* values here */}) +``` + ### OutputDatetimeItem ```go @@ -81,6 +111,162 @@ inputsUnion1 := components.CreateInputsUnion1OutputDatetimeItem(components.Outpu inputsUnion1 := components.CreateInputsUnion1OutputWebSearchServerToolItem(components.OutputWebSearchServerToolItem{/* values here */}) ``` +### OutputCodeInterpreterServerToolItem + +```go +inputsUnion1 := components.CreateInputsUnion1OutputCodeInterpreterServerToolItem(components.OutputCodeInterpreterServerToolItem{/* values here */}) +``` + +### OutputFileSearchServerToolItem + +```go +inputsUnion1 := components.CreateInputsUnion1OutputFileSearchServerToolItem(components.OutputFileSearchServerToolItem{/* values here */}) +``` + +### OutputImageGenerationServerToolItem + +```go +inputsUnion1 := components.CreateInputsUnion1OutputImageGenerationServerToolItem(components.OutputImageGenerationServerToolItem{/* values here */}) +``` + +### OutputBrowserUseServerToolItem + +```go +inputsUnion1 := components.CreateInputsUnion1OutputBrowserUseServerToolItem(components.OutputBrowserUseServerToolItem{/* values here */}) +``` + +### OutputBashServerToolItem + +```go +inputsUnion1 := components.CreateInputsUnion1OutputBashServerToolItem(components.OutputBashServerToolItem{/* values here */}) +``` + +### OutputTextEditorServerToolItem + +```go +inputsUnion1 := components.CreateInputsUnion1OutputTextEditorServerToolItem(components.OutputTextEditorServerToolItem{/* values here */}) +``` + +### OutputApplyPatchServerToolItem + +```go +inputsUnion1 := components.CreateInputsUnion1OutputApplyPatchServerToolItem(components.OutputApplyPatchServerToolItem{/* values here */}) +``` + +### OutputWebFetchServerToolItem + +```go +inputsUnion1 := components.CreateInputsUnion1OutputWebFetchServerToolItem(components.OutputWebFetchServerToolItem{/* values here */}) +``` + +### OutputToolSearchServerToolItem + +```go +inputsUnion1 := components.CreateInputsUnion1OutputToolSearchServerToolItem(components.OutputToolSearchServerToolItem{/* values here */}) +``` + +### OutputMemoryServerToolItem + +```go +inputsUnion1 := components.CreateInputsUnion1OutputMemoryServerToolItem(components.OutputMemoryServerToolItem{/* values here */}) +``` + +### OutputMcpServerToolItem + +```go +inputsUnion1 := components.CreateInputsUnion1OutputMcpServerToolItem(components.OutputMcpServerToolItem{/* values here */}) +``` + +### OutputSearchModelsServerToolItem + +```go +inputsUnion1 := components.CreateInputsUnion1OutputSearchModelsServerToolItem(components.OutputSearchModelsServerToolItem{/* values here */}) +``` + +### OutputAdvisorServerToolItem + +```go +inputsUnion1 := components.CreateInputsUnion1OutputAdvisorServerToolItem(components.OutputAdvisorServerToolItem{/* values here */}) +``` + +### OutputSubagentServerToolItem + +```go +inputsUnion1 := components.CreateInputsUnion1OutputSubagentServerToolItem(components.OutputSubagentServerToolItem{/* values here */}) +``` + +### LocalShellCallItem + +```go +inputsUnion1 := components.CreateInputsUnion1LocalShellCallItem(components.LocalShellCallItem{/* values here */}) +``` + +### LocalShellCallOutputItem + +```go +inputsUnion1 := components.CreateInputsUnion1LocalShellCallOutputItem(components.LocalShellCallOutputItem{/* values here */}) +``` + +### ShellCallItem + +```go +inputsUnion1 := components.CreateInputsUnion1ShellCallItem(components.ShellCallItem{/* values here */}) +``` + +### ShellCallOutputItem + +```go +inputsUnion1 := components.CreateInputsUnion1ShellCallOutputItem(components.ShellCallOutputItem{/* values here */}) +``` + +### McpListToolsItem + +```go +inputsUnion1 := components.CreateInputsUnion1McpListToolsItem(components.McpListToolsItem{/* values here */}) +``` + +### McpApprovalRequestItem + +```go +inputsUnion1 := components.CreateInputsUnion1McpApprovalRequestItem(components.McpApprovalRequestItem{/* values here */}) +``` + +### McpApprovalResponseItem + +```go +inputsUnion1 := components.CreateInputsUnion1McpApprovalResponseItem(components.McpApprovalResponseItem{/* values here */}) +``` + +### McpCallItem + +```go +inputsUnion1 := components.CreateInputsUnion1McpCallItem(components.McpCallItem{/* values here */}) +``` + +### CustomToolCallItem + +```go +inputsUnion1 := components.CreateInputsUnion1CustomToolCallItem(components.CustomToolCallItem{/* values here */}) +``` + +### CustomToolCallOutputItem + +```go +inputsUnion1 := components.CreateInputsUnion1CustomToolCallOutputItem(components.CustomToolCallOutputItem{/* values here */}) +``` + +### CompactionItem + +```go +inputsUnion1 := components.CreateInputsUnion1CompactionItem(components.CompactionItem{/* values here */}) +``` + +### ItemReferenceItem + +```go +inputsUnion1 := components.CreateInputsUnion1ItemReferenceItem(components.ItemReferenceItem{/* values here */}) +``` + ## Union Discrimination Use the `Type` field to determine which variant is active, then access the corresponding field: @@ -97,21 +283,83 @@ switch inputsUnion1.Type { // inputsUnion1.FunctionCallItem is populated case components.InputsUnion1TypeFunctionCallOutputItem: // inputsUnion1.FunctionCallOutputItem is populated + case components.InputsUnion1TypeApplyPatchCallItem: + // inputsUnion1.ApplyPatchCallItem is populated + case components.InputsUnion1TypeApplyPatchCallOutputItem: + // inputsUnion1.ApplyPatchCallOutputItem is populated case components.InputsUnion1TypeInputsMessage: // inputsUnion1.InputsMessage is populated case components.InputsUnion1TypeInputsReasoning: // inputsUnion1.InputsReasoning is populated case components.InputsUnion1TypeOutputFunctionCallItem: // inputsUnion1.OutputFunctionCallItem is populated + case components.InputsUnion1TypeOutputCustomToolCallItem: + // inputsUnion1.OutputCustomToolCallItem is populated case components.InputsUnion1TypeOutputWebSearchCallItem: // inputsUnion1.OutputWebSearchCallItem is populated case components.InputsUnion1TypeOutputFileSearchCallItem: // inputsUnion1.OutputFileSearchCallItem is populated case components.InputsUnion1TypeOutputImageGenerationCallItem: // inputsUnion1.OutputImageGenerationCallItem is populated + case components.InputsUnion1TypeOutputCodeInterpreterCallItem: + // inputsUnion1.OutputCodeInterpreterCallItem is populated + case components.InputsUnion1TypeOutputComputerCallItem: + // inputsUnion1.OutputComputerCallItem is populated case components.InputsUnion1TypeOutputDatetimeItem: // inputsUnion1.OutputDatetimeItem is populated case components.InputsUnion1TypeOutputWebSearchServerToolItem: // inputsUnion1.OutputWebSearchServerToolItem is populated + case components.InputsUnion1TypeOutputCodeInterpreterServerToolItem: + // inputsUnion1.OutputCodeInterpreterServerToolItem is populated + case components.InputsUnion1TypeOutputFileSearchServerToolItem: + // inputsUnion1.OutputFileSearchServerToolItem is populated + case components.InputsUnion1TypeOutputImageGenerationServerToolItem: + // inputsUnion1.OutputImageGenerationServerToolItem is populated + case components.InputsUnion1TypeOutputBrowserUseServerToolItem: + // inputsUnion1.OutputBrowserUseServerToolItem is populated + case components.InputsUnion1TypeOutputBashServerToolItem: + // inputsUnion1.OutputBashServerToolItem is populated + case components.InputsUnion1TypeOutputTextEditorServerToolItem: + // inputsUnion1.OutputTextEditorServerToolItem is populated + case components.InputsUnion1TypeOutputApplyPatchServerToolItem: + // inputsUnion1.OutputApplyPatchServerToolItem is populated + case components.InputsUnion1TypeOutputWebFetchServerToolItem: + // inputsUnion1.OutputWebFetchServerToolItem is populated + case components.InputsUnion1TypeOutputToolSearchServerToolItem: + // inputsUnion1.OutputToolSearchServerToolItem is populated + case components.InputsUnion1TypeOutputMemoryServerToolItem: + // inputsUnion1.OutputMemoryServerToolItem is populated + case components.InputsUnion1TypeOutputMcpServerToolItem: + // inputsUnion1.OutputMcpServerToolItem is populated + case components.InputsUnion1TypeOutputSearchModelsServerToolItem: + // inputsUnion1.OutputSearchModelsServerToolItem is populated + case components.InputsUnion1TypeOutputAdvisorServerToolItem: + // inputsUnion1.OutputAdvisorServerToolItem is populated + case components.InputsUnion1TypeOutputSubagentServerToolItem: + // inputsUnion1.OutputSubagentServerToolItem is populated + case components.InputsUnion1TypeLocalShellCallItem: + // inputsUnion1.LocalShellCallItem is populated + case components.InputsUnion1TypeLocalShellCallOutputItem: + // inputsUnion1.LocalShellCallOutputItem is populated + case components.InputsUnion1TypeShellCallItem: + // inputsUnion1.ShellCallItem is populated + case components.InputsUnion1TypeShellCallOutputItem: + // inputsUnion1.ShellCallOutputItem is populated + case components.InputsUnion1TypeMcpListToolsItem: + // inputsUnion1.McpListToolsItem is populated + case components.InputsUnion1TypeMcpApprovalRequestItem: + // inputsUnion1.McpApprovalRequestItem is populated + case components.InputsUnion1TypeMcpApprovalResponseItem: + // inputsUnion1.McpApprovalResponseItem is populated + case components.InputsUnion1TypeMcpCallItem: + // inputsUnion1.McpCallItem is populated + case components.InputsUnion1TypeCustomToolCallItem: + // inputsUnion1.CustomToolCallItem is populated + case components.InputsUnion1TypeCustomToolCallOutputItem: + // inputsUnion1.CustomToolCallOutputItem is populated + case components.InputsUnion1TypeCompactionItem: + // inputsUnion1.CompactionItem is populated + case components.InputsUnion1TypeItemReferenceItem: + // inputsUnion1.ItemReferenceItem is populated } ``` diff --git a/docs/models/components/itemreferenceitem.md b/docs/models/components/itemreferenceitem.md new file mode 100644 index 00000000..36fd1828 --- /dev/null +++ b/docs/models/components/itemreferenceitem.md @@ -0,0 +1,11 @@ +# ItemReferenceItem + +A reference to a previous response item by ID + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `ID` | `string` | :heavy_check_mark: | N/A | +| `Type` | [components.ItemReferenceItemType](../../models/components/itemreferenceitemtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/itemreferenceitemtype.md b/docs/models/components/itemreferenceitemtype.md new file mode 100644 index 00000000..4095cc57 --- /dev/null +++ b/docs/models/components/itemreferenceitemtype.md @@ -0,0 +1,18 @@ +# ItemReferenceItemType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ItemReferenceItemTypeItemReference +``` + + +## Values + +| Name | Value | +| ------------------------------------ | ------------------------------------ | +| `ItemReferenceItemTypeItemReference` | item_reference | \ No newline at end of file diff --git a/docs/models/components/keep.md b/docs/models/components/keep.md new file mode 100644 index 00000000..a17c40d4 --- /dev/null +++ b/docs/models/components/keep.md @@ -0,0 +1,37 @@ +# Keep + + +## Supported Types + +### AnthropicThinkingTurns + +```go +keep := components.CreateKeepAnthropicThinkingTurns(components.AnthropicThinkingTurns{/* values here */}) +``` + +### KeepAll + +```go +keep := components.CreateKeepKeepAll(components.KeepAll{/* values here */}) +``` + +### KeepEnum + +```go +keep := components.CreateKeepKeepEnum(components.KeepEnum{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch keep.Type { + case components.KeepUnionTypeAnthropicThinkingTurns: + // keep.AnthropicThinkingTurns is populated + case components.KeepUnionTypeKeepAll: + // keep.KeepAll is populated + case components.KeepUnionTypeKeepEnum: + // keep.KeepEnum is populated +} +``` diff --git a/docs/models/components/keepall.md b/docs/models/components/keepall.md new file mode 100644 index 00000000..72ccebc0 --- /dev/null +++ b/docs/models/components/keepall.md @@ -0,0 +1,8 @@ +# KeepAll + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `Type` | [components.KeepType](../../models/components/keeptype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/keepenum.md b/docs/models/components/keepenum.md new file mode 100644 index 00000000..c0c92511 --- /dev/null +++ b/docs/models/components/keepenum.md @@ -0,0 +1,18 @@ +# KeepEnum + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.KeepEnumAll +``` + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `KeepEnumAll` | all | \ No newline at end of file diff --git a/docs/models/components/keeptype.md b/docs/models/components/keeptype.md new file mode 100644 index 00000000..8d1ea999 --- /dev/null +++ b/docs/models/components/keeptype.md @@ -0,0 +1,18 @@ +# KeepType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.KeepTypeAll +``` + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `KeepTypeAll` | all | \ No newline at end of file diff --git a/docs/models/components/legacywebsearchservertool.md b/docs/models/components/legacywebsearchservertool.md index 7c933a5f..a6f140c0 100644 --- a/docs/models/components/legacywebsearchservertool.md +++ b/docs/models/components/legacywebsearchservertool.md @@ -5,11 +5,11 @@ Web search tool configuration ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Engine` | [*components.WebSearchEngineEnum](../../models/components/websearchengineenum.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. | auto | -| `Filters` | optionalnullable.OptionalNullable[[components.WebSearchDomainFilter](../../models/components/websearchdomainfilter.md)] | :heavy_minus_sign: | N/A | {
"allowed_domains": [
"example.com"
],
"excluded_domains": [
"spam.com"
]
} | -| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and Parallel engines; ignored with native provider search. | 5 | -| `SearchContextSize` | [*components.SearchContextSizeEnum](../../models/components/searchcontextsizeenum.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | -| `Type` | [components.LegacyWebSearchServerToolType](../../models/components/legacywebsearchservertooltype.md) | :heavy_check_mark: | N/A | | -| `UserLocation` | optionalnullable.OptionalNullable[[components.WebSearchUserLocation](../../models/components/websearchuserlocation.md)] | :heavy_minus_sign: | User location information for web search | {
"city": "San Francisco",
"country": "USA",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Engine` | [*components.WebSearchEngineEnum](../../models/components/websearchengineenum.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). | auto | +| `Filters` | optionalnullable.OptionalNullable[[components.WebSearchDomainFilter](../../models/components/websearchdomainfilter.md)] | :heavy_minus_sign: | N/A | {
"allowed_domains": [
"example.com"
],
"excluded_domains": [
"spam.com"
]
} | +| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. | 5 | +| `SearchContextSize` | [*components.SearchContextSizeEnum](../../models/components/searchcontextsizeenum.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | +| `Type` | [components.LegacyWebSearchServerToolType](../../models/components/legacywebsearchservertooltype.md) | :heavy_check_mark: | N/A | | +| `UserLocation` | optionalnullable.OptionalNullable[[components.WebSearchUserLocation](../../models/components/websearchuserlocation.md)] | :heavy_minus_sign: | User location information for web search | {
"city": "San Francisco",
"country": "USA",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file diff --git a/docs/models/components/listbyokkeysresponse.md b/docs/models/components/listbyokkeysresponse.md new file mode 100644 index 00000000..9a42a0e8 --- /dev/null +++ b/docs/models/components/listbyokkeysresponse.md @@ -0,0 +1,9 @@ +# ListBYOKKeysResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `Data` | [][components.BYOKKey](../../models/components/byokkey.md) | :heavy_check_mark: | List of BYOK credentials. | | +| `TotalCount` | `int64` | :heavy_check_mark: | Total number of BYOK credentials matching the filters. | 1 | \ No newline at end of file diff --git a/docs/models/components/listobservabilitydestinationsresponse.md b/docs/models/components/listobservabilitydestinationsresponse.md new file mode 100644 index 00000000..3987e1c4 --- /dev/null +++ b/docs/models/components/listobservabilitydestinationsresponse.md @@ -0,0 +1,9 @@ +# ListObservabilityDestinationsResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `Data` | [][components.ObservabilityDestination](../../models/components/observabilitydestination.md) | :heavy_check_mark: | List of observability destinations. | | +| `TotalCount` | `int64` | :heavy_check_mark: | Total number of destinations matching the filters. | 1 | \ No newline at end of file diff --git a/docs/models/components/listpresetsresponse.md b/docs/models/components/listpresetsresponse.md new file mode 100644 index 00000000..04a71bf2 --- /dev/null +++ b/docs/models/components/listpresetsresponse.md @@ -0,0 +1,11 @@ +# ListPresetsResponse + +A paginated list of presets. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `Data` | [][components.Preset](../../models/components/preset.md) | :heavy_check_mark: | N/A | +| `TotalCount` | `int64` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/listpresetversionsresponse.md b/docs/models/components/listpresetversionsresponse.md new file mode 100644 index 00000000..1ab37956 --- /dev/null +++ b/docs/models/components/listpresetversionsresponse.md @@ -0,0 +1,11 @@ +# ListPresetVersionsResponse + +A paginated list of preset versions. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `Data` | [][*components.PresetDesignatedVersion](../../models/components/presetdesignatedversion.md) | :heavy_check_mark: | N/A | +| `TotalCount` | `int64` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/localshellcallitem.md b/docs/models/components/localshellcallitem.md new file mode 100644 index 00000000..8ff095f4 --- /dev/null +++ b/docs/models/components/localshellcallitem.md @@ -0,0 +1,14 @@ +# LocalShellCallItem + +A local shell command execution call + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `Action` | [components.LocalShellCallItemAction](../../models/components/localshellcallitemaction.md) | :heavy_check_mark: | N/A | | +| `CallID` | `string` | :heavy_check_mark: | N/A | | +| `ID` | `string` | :heavy_check_mark: | N/A | | +| `Status` | [components.ToolCallStatus](../../models/components/toolcallstatus.md) | :heavy_check_mark: | N/A | completed | +| `Type` | [components.TypeLocalShellCall](../../models/components/typelocalshellcall.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/localshellcallitemaction.md b/docs/models/components/localshellcallitemaction.md new file mode 100644 index 00000000..a94eb6e3 --- /dev/null +++ b/docs/models/components/localshellcallitemaction.md @@ -0,0 +1,13 @@ +# LocalShellCallItemAction + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `Command` | []`string` | :heavy_check_mark: | N/A | +| `Env` | map[string]`string` | :heavy_check_mark: | N/A | +| `TimeoutMs` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | N/A | +| `Type` | [components.TypeExec](../../models/components/typeexec.md) | :heavy_check_mark: | N/A | +| `User` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `WorkingDirectory` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/localshellcalloutputitem.md b/docs/models/components/localshellcalloutputitem.md new file mode 100644 index 00000000..8d43d880 --- /dev/null +++ b/docs/models/components/localshellcalloutputitem.md @@ -0,0 +1,13 @@ +# LocalShellCallOutputItem + +Output from a local shell command execution + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `ID` | `string` | :heavy_check_mark: | N/A | | +| `Output` | `string` | :heavy_check_mark: | N/A | | +| `Status` | optionalnullable.OptionalNullable[[components.LocalShellCallOutputItemStatus](../../models/components/localshellcalloutputitemstatus.md)] | :heavy_minus_sign: | N/A | completed | +| `Type` | [components.LocalShellCallOutputItemType](../../models/components/localshellcalloutputitemtype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/localshellcalloutputitemstatus.md b/docs/models/components/localshellcalloutputitemstatus.md new file mode 100644 index 00000000..15cc696c --- /dev/null +++ b/docs/models/components/localshellcalloutputitemstatus.md @@ -0,0 +1,23 @@ +# LocalShellCallOutputItemStatus + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.LocalShellCallOutputItemStatusInProgress + +// Open enum: custom values can be created with a direct type cast +custom := components.LocalShellCallOutputItemStatus("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------------------------ | ------------------------------------------ | +| `LocalShellCallOutputItemStatusInProgress` | in_progress | +| `LocalShellCallOutputItemStatusCompleted` | completed | +| `LocalShellCallOutputItemStatusIncomplete` | incomplete | \ No newline at end of file diff --git a/docs/models/components/localshellcalloutputitemtype.md b/docs/models/components/localshellcalloutputitemtype.md new file mode 100644 index 00000000..48acb94e --- /dev/null +++ b/docs/models/components/localshellcalloutputitemtype.md @@ -0,0 +1,18 @@ +# LocalShellCallOutputItemType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.LocalShellCallOutputItemTypeLocalShellCallOutput +``` + + +## Values + +| Name | Value | +| -------------------------------------------------- | -------------------------------------------------- | +| `LocalShellCallOutputItemTypeLocalShellCallOutput` | local_shell_call_output | \ No newline at end of file diff --git a/docs/models/components/logic.md b/docs/models/components/logic.md new file mode 100644 index 00000000..f6eba20b --- /dev/null +++ b/docs/models/components/logic.md @@ -0,0 +1,22 @@ +# Logic + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.LogicAnd + +// Open enum: custom values can be created with a direct type cast +custom := components.Logic("custom_value") +``` + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `LogicAnd` | and | +| `LogicOr` | or | \ No newline at end of file diff --git a/docs/models/components/mcpapprovalrequestitem.md b/docs/models/components/mcpapprovalrequestitem.md new file mode 100644 index 00000000..2a164015 --- /dev/null +++ b/docs/models/components/mcpapprovalrequestitem.md @@ -0,0 +1,14 @@ +# McpApprovalRequestItem + +Request for approval to execute an MCP tool + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `Arguments` | `string` | :heavy_check_mark: | N/A | +| `ID` | `string` | :heavy_check_mark: | N/A | +| `Name` | `string` | :heavy_check_mark: | N/A | +| `ServerLabel` | `string` | :heavy_check_mark: | N/A | +| `Type` | [components.McpApprovalRequestItemType](../../models/components/mcpapprovalrequestitemtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/mcpapprovalrequestitemtype.md b/docs/models/components/mcpapprovalrequestitemtype.md new file mode 100644 index 00000000..4e2248a9 --- /dev/null +++ b/docs/models/components/mcpapprovalrequestitemtype.md @@ -0,0 +1,18 @@ +# McpApprovalRequestItemType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.McpApprovalRequestItemTypeMcpApprovalRequest +``` + + +## Values + +| Name | Value | +| ---------------------------------------------- | ---------------------------------------------- | +| `McpApprovalRequestItemTypeMcpApprovalRequest` | mcp_approval_request | \ No newline at end of file diff --git a/docs/models/components/mcpapprovalresponseitem.md b/docs/models/components/mcpapprovalresponseitem.md new file mode 100644 index 00000000..497329f7 --- /dev/null +++ b/docs/models/components/mcpapprovalresponseitem.md @@ -0,0 +1,14 @@ +# McpApprovalResponseItem + +User response to an MCP tool approval request + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `ApprovalRequestID` | `string` | :heavy_check_mark: | N/A | +| `Approve` | `bool` | :heavy_check_mark: | N/A | +| `ID` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `Reason` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `Type` | [components.McpApprovalResponseItemType](../../models/components/mcpapprovalresponseitemtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/mcpapprovalresponseitemtype.md b/docs/models/components/mcpapprovalresponseitemtype.md new file mode 100644 index 00000000..41cd2fb8 --- /dev/null +++ b/docs/models/components/mcpapprovalresponseitemtype.md @@ -0,0 +1,18 @@ +# McpApprovalResponseItemType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.McpApprovalResponseItemTypeMcpApprovalResponse +``` + + +## Values + +| Name | Value | +| ------------------------------------------------ | ------------------------------------------------ | +| `McpApprovalResponseItemTypeMcpApprovalResponse` | mcp_approval_response | \ No newline at end of file diff --git a/docs/models/components/mcpcallitem.md b/docs/models/components/mcpcallitem.md new file mode 100644 index 00000000..51ed8c9b --- /dev/null +++ b/docs/models/components/mcpcallitem.md @@ -0,0 +1,16 @@ +# McpCallItem + +An MCP tool call with its output or error + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `Arguments` | `string` | :heavy_check_mark: | N/A | +| `Error` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `ID` | `string` | :heavy_check_mark: | N/A | +| `Name` | `string` | :heavy_check_mark: | N/A | +| `Output` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `ServerLabel` | `string` | :heavy_check_mark: | N/A | +| `Type` | [components.McpCallItemType](../../models/components/mcpcallitemtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/mcpcallitemtype.md b/docs/models/components/mcpcallitemtype.md new file mode 100644 index 00000000..9494e53e --- /dev/null +++ b/docs/models/components/mcpcallitemtype.md @@ -0,0 +1,18 @@ +# McpCallItemType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.McpCallItemTypeMcpCall +``` + + +## Values + +| Name | Value | +| ------------------------ | ------------------------ | +| `McpCallItemTypeMcpCall` | mcp_call | \ No newline at end of file diff --git a/docs/models/components/mcplisttoolsitem.md b/docs/models/components/mcplisttoolsitem.md new file mode 100644 index 00000000..649d5599 --- /dev/null +++ b/docs/models/components/mcplisttoolsitem.md @@ -0,0 +1,14 @@ +# McpListToolsItem + +List of available MCP tools from a server + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `Error` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `ID` | `string` | :heavy_check_mark: | N/A | +| `ServerLabel` | `string` | :heavy_check_mark: | N/A | +| `Tools` | [][components.McpListToolsItemTool](../../models/components/mcplisttoolsitemtool.md) | :heavy_check_mark: | N/A | +| `Type` | [components.McpListToolsItemType](../../models/components/mcplisttoolsitemtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/mcplisttoolsitemtool.md b/docs/models/components/mcplisttoolsitemtool.md new file mode 100644 index 00000000..a1d02577 --- /dev/null +++ b/docs/models/components/mcplisttoolsitemtool.md @@ -0,0 +1,11 @@ +# McpListToolsItemTool + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `Annotations` | optionalnullable.OptionalNullable[`any`] | :heavy_minus_sign: | N/A | +| `Description` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `InputSchema` | map[string]`any` | :heavy_check_mark: | N/A | +| `Name` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/mcplisttoolsitemtype.md b/docs/models/components/mcplisttoolsitemtype.md new file mode 100644 index 00000000..31b5c8cc --- /dev/null +++ b/docs/models/components/mcplisttoolsitemtype.md @@ -0,0 +1,18 @@ +# McpListToolsItemType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.McpListToolsItemTypeMcpListTools +``` + + +## Values + +| Name | Value | +| ---------------------------------- | ---------------------------------- | +| `McpListToolsItemTypeMcpListTools` | mcp_list_tools | \ No newline at end of file diff --git a/docs/models/components/messagesadvisortoolresultblock.md b/docs/models/components/messagesadvisortoolresultblock.md new file mode 100644 index 00000000..ac7ec626 --- /dev/null +++ b/docs/models/components/messagesadvisortoolresultblock.md @@ -0,0 +1,12 @@ +# MessagesAdvisorToolResultBlock + +Advisor tool result from a prior assistant turn, replayed back to the model on the next turn. Mirrors the block Anthropic returns in assistant content when the `advisor_20260301` tool runs. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `Content` | map[string]`any` | :heavy_check_mark: | N/A | +| `ToolUseID` | `string` | :heavy_check_mark: | N/A | +| `Type` | [components.MessagesAdvisorToolResultBlockType](../../models/components/messagesadvisortoolresultblocktype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/messagesadvisortoolresultblocktype.md b/docs/models/components/messagesadvisortoolresultblocktype.md new file mode 100644 index 00000000..475e7c9e --- /dev/null +++ b/docs/models/components/messagesadvisortoolresultblocktype.md @@ -0,0 +1,18 @@ +# MessagesAdvisorToolResultBlockType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.MessagesAdvisorToolResultBlockTypeAdvisorToolResult +``` + + +## Values + +| Name | Value | +| ----------------------------------------------------- | ----------------------------------------------------- | +| `MessagesAdvisorToolResultBlockTypeAdvisorToolResult` | advisor_tool_result | \ No newline at end of file diff --git a/docs/models/components/messagesfallbackparam.md b/docs/models/components/messagesfallbackparam.md new file mode 100644 index 00000000..4db01566 --- /dev/null +++ b/docs/models/components/messagesfallbackparam.md @@ -0,0 +1,11 @@ +# MessagesFallbackParam + +Fallback model to try when the primary model fails or refuses. Only the `model` field is supported; per-attempt overrides are rejected. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `Model` | `string` | :heavy_check_mark: | N/A | | +| `AdditionalProperties` | map[string]`any` | :heavy_minus_sign: | N/A | {
"model": "claude-opus-4-8"
} | \ No newline at end of file diff --git a/docs/models/components/messagesmessageparam.md b/docs/models/components/messagesmessageparam.md new file mode 100644 index 00000000..177199f2 --- /dev/null +++ b/docs/models/components/messagesmessageparam.md @@ -0,0 +1,11 @@ +# MessagesMessageParam + +Anthropic message with OpenRouter extensions + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `Content` | [components.MessagesMessageParamContentUnion5](../../models/components/messagesmessageparamcontentunion5.md) | :heavy_check_mark: | N/A | +| `Role` | [components.MessagesMessageParamRole](../../models/components/messagesmessageparamrole.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/messagesmessageparamcontentunion1.md b/docs/models/components/messagesmessageparamcontentunion1.md new file mode 100644 index 00000000..be4d0cf4 --- /dev/null +++ b/docs/models/components/messagesmessageparamcontentunion1.md @@ -0,0 +1,53 @@ +# MessagesMessageParamContentUnion1 + + +## Supported Types + +### AnthropicTextBlockParam + +```go +messagesMessageParamContentUnion1 := components.CreateMessagesMessageParamContentUnion1Text(components.AnthropicTextBlockParam{/* values here */}) +``` + +### AnthropicImageBlockParam + +```go +messagesMessageParamContentUnion1 := components.CreateMessagesMessageParamContentUnion1Image(components.AnthropicImageBlockParam{/* values here */}) +``` + +### ContentToolReference + +```go +messagesMessageParamContentUnion1 := components.CreateMessagesMessageParamContentUnion1ToolReference(components.ContentToolReference{/* values here */}) +``` + +### AnthropicSearchResultBlockParam + +```go +messagesMessageParamContentUnion1 := components.CreateMessagesMessageParamContentUnion1SearchResult(components.AnthropicSearchResultBlockParam{/* values here */}) +``` + +### AnthropicDocumentBlockParam + +```go +messagesMessageParamContentUnion1 := components.CreateMessagesMessageParamContentUnion1Document(components.AnthropicDocumentBlockParam{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch messagesMessageParamContentUnion1.Type { + case components.MessagesMessageParamContentUnion1TypeText: + // messagesMessageParamContentUnion1.AnthropicTextBlockParam is populated + case components.MessagesMessageParamContentUnion1TypeImage: + // messagesMessageParamContentUnion1.AnthropicImageBlockParam is populated + case components.MessagesMessageParamContentUnion1TypeToolReference: + // messagesMessageParamContentUnion1.ContentToolReference is populated + case components.MessagesMessageParamContentUnion1TypeSearchResult: + // messagesMessageParamContentUnion1.AnthropicSearchResultBlockParam is populated + case components.MessagesMessageParamContentUnion1TypeDocument: + // messagesMessageParamContentUnion1.AnthropicDocumentBlockParam is populated +} +``` diff --git a/docs/models/components/messagesmessageparamcontentunion2.md b/docs/models/components/messagesmessageparamcontentunion2.md new file mode 100644 index 00000000..03b4c6e1 --- /dev/null +++ b/docs/models/components/messagesmessageparamcontentunion2.md @@ -0,0 +1,29 @@ +# MessagesMessageParamContentUnion2 + + +## Supported Types + +### + +```go +messagesMessageParamContentUnion2 := components.CreateMessagesMessageParamContentUnion2Str(string{/* values here */}) +``` + +### + +```go +messagesMessageParamContentUnion2 := components.CreateMessagesMessageParamContentUnion2ArrayOfMessagesMessageParamContentUnion1([]components.MessagesMessageParamContentUnion1{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch messagesMessageParamContentUnion2.Type { + case components.MessagesMessageParamContentUnion2TypeStr: + // messagesMessageParamContentUnion2.Str is populated + case components.MessagesMessageParamContentUnion2TypeArrayOfMessagesMessageParamContentUnion1: + // messagesMessageParamContentUnion2.ArrayOfMessagesMessageParamContentUnion1 is populated +} +``` diff --git a/docs/models/components/messagesmessageparamcontentunion3.md b/docs/models/components/messagesmessageparamcontentunion3.md new file mode 100644 index 00000000..abfd6218 --- /dev/null +++ b/docs/models/components/messagesmessageparamcontentunion3.md @@ -0,0 +1,29 @@ +# MessagesMessageParamContentUnion3 + + +## Supported Types + +### + +```go +messagesMessageParamContentUnion3 := components.CreateMessagesMessageParamContentUnion3ArrayOfAnthropicWebSearchResultBlockParam([]components.AnthropicWebSearchResultBlockParam{/* values here */}) +``` + +### ContentWebSearchToolResultError + +```go +messagesMessageParamContentUnion3 := components.CreateMessagesMessageParamContentUnion3ContentWebSearchToolResultError(components.ContentWebSearchToolResultError{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch messagesMessageParamContentUnion3.Type { + case components.MessagesMessageParamContentUnion3TypeArrayOfAnthropicWebSearchResultBlockParam: + // messagesMessageParamContentUnion3.ArrayOfAnthropicWebSearchResultBlockParam is populated + case components.MessagesMessageParamContentUnion3TypeContentWebSearchToolResultError: + // messagesMessageParamContentUnion3.ContentWebSearchToolResultError is populated +} +``` diff --git a/docs/models/components/messagesmessageparamcontentunion4.md b/docs/models/components/messagesmessageparamcontentunion4.md new file mode 100644 index 00000000..c9bc2d46 --- /dev/null +++ b/docs/models/components/messagesmessageparamcontentunion4.md @@ -0,0 +1,109 @@ +# MessagesMessageParamContentUnion4 + + +## Supported Types + +### AnthropicTextBlockParam + +```go +messagesMessageParamContentUnion4 := components.CreateMessagesMessageParamContentUnion4Text(components.AnthropicTextBlockParam{/* values here */}) +``` + +### AnthropicImageBlockParam + +```go +messagesMessageParamContentUnion4 := components.CreateMessagesMessageParamContentUnion4Image(components.AnthropicImageBlockParam{/* values here */}) +``` + +### AnthropicDocumentBlockParam + +```go +messagesMessageParamContentUnion4 := components.CreateMessagesMessageParamContentUnion4Document(components.AnthropicDocumentBlockParam{/* values here */}) +``` + +### ContentToolUse + +```go +messagesMessageParamContentUnion4 := components.CreateMessagesMessageParamContentUnion4ToolUse(components.ContentToolUse{/* values here */}) +``` + +### ContentToolResult + +```go +messagesMessageParamContentUnion4 := components.CreateMessagesMessageParamContentUnion4ToolResult(components.ContentToolResult{/* values here */}) +``` + +### ContentThinking + +```go +messagesMessageParamContentUnion4 := components.CreateMessagesMessageParamContentUnion4Thinking(components.ContentThinking{/* values here */}) +``` + +### ContentRedactedThinking + +```go +messagesMessageParamContentUnion4 := components.CreateMessagesMessageParamContentUnion4RedactedThinking(components.ContentRedactedThinking{/* values here */}) +``` + +### ContentServerToolUse + +```go +messagesMessageParamContentUnion4 := components.CreateMessagesMessageParamContentUnion4ServerToolUse(components.ContentServerToolUse{/* values here */}) +``` + +### ContentWebSearchToolResult + +```go +messagesMessageParamContentUnion4 := components.CreateMessagesMessageParamContentUnion4WebSearchToolResult(components.ContentWebSearchToolResult{/* values here */}) +``` + +### AnthropicSearchResultBlockParam + +```go +messagesMessageParamContentUnion4 := components.CreateMessagesMessageParamContentUnion4SearchResult(components.AnthropicSearchResultBlockParam{/* values here */}) +``` + +### ContentCompaction + +```go +messagesMessageParamContentUnion4 := components.CreateMessagesMessageParamContentUnion4Compaction(components.ContentCompaction{/* values here */}) +``` + +### MessagesAdvisorToolResultBlock + +```go +messagesMessageParamContentUnion4 := components.CreateMessagesMessageParamContentUnion4AdvisorToolResult(components.MessagesAdvisorToolResultBlock{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch messagesMessageParamContentUnion4.Type { + case components.MessagesMessageParamContentUnion4TypeText: + // messagesMessageParamContentUnion4.AnthropicTextBlockParam is populated + case components.MessagesMessageParamContentUnion4TypeImage: + // messagesMessageParamContentUnion4.AnthropicImageBlockParam is populated + case components.MessagesMessageParamContentUnion4TypeDocument: + // messagesMessageParamContentUnion4.AnthropicDocumentBlockParam is populated + case components.MessagesMessageParamContentUnion4TypeToolUse: + // messagesMessageParamContentUnion4.ContentToolUse is populated + case components.MessagesMessageParamContentUnion4TypeToolResult: + // messagesMessageParamContentUnion4.ContentToolResult is populated + case components.MessagesMessageParamContentUnion4TypeThinking: + // messagesMessageParamContentUnion4.ContentThinking is populated + case components.MessagesMessageParamContentUnion4TypeRedactedThinking: + // messagesMessageParamContentUnion4.ContentRedactedThinking is populated + case components.MessagesMessageParamContentUnion4TypeServerToolUse: + // messagesMessageParamContentUnion4.ContentServerToolUse is populated + case components.MessagesMessageParamContentUnion4TypeWebSearchToolResult: + // messagesMessageParamContentUnion4.ContentWebSearchToolResult is populated + case components.MessagesMessageParamContentUnion4TypeSearchResult: + // messagesMessageParamContentUnion4.AnthropicSearchResultBlockParam is populated + case components.MessagesMessageParamContentUnion4TypeCompaction: + // messagesMessageParamContentUnion4.ContentCompaction is populated + case components.MessagesMessageParamContentUnion4TypeAdvisorToolResult: + // messagesMessageParamContentUnion4.MessagesAdvisorToolResultBlock is populated +} +``` diff --git a/docs/models/components/messagesmessageparamcontentunion5.md b/docs/models/components/messagesmessageparamcontentunion5.md new file mode 100644 index 00000000..29035fd2 --- /dev/null +++ b/docs/models/components/messagesmessageparamcontentunion5.md @@ -0,0 +1,29 @@ +# MessagesMessageParamContentUnion5 + + +## Supported Types + +### + +```go +messagesMessageParamContentUnion5 := components.CreateMessagesMessageParamContentUnion5Str(string{/* values here */}) +``` + +### + +```go +messagesMessageParamContentUnion5 := components.CreateMessagesMessageParamContentUnion5ArrayOfMessagesMessageParamContentUnion4([]components.MessagesMessageParamContentUnion4{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch messagesMessageParamContentUnion5.Type { + case components.MessagesMessageParamContentUnion5TypeStr: + // messagesMessageParamContentUnion5.Str is populated + case components.MessagesMessageParamContentUnion5TypeArrayOfMessagesMessageParamContentUnion4: + // messagesMessageParamContentUnion5.ArrayOfMessagesMessageParamContentUnion4 is populated +} +``` diff --git a/docs/models/components/messagesmessageparamrole.md b/docs/models/components/messagesmessageparamrole.md new file mode 100644 index 00000000..e79114a5 --- /dev/null +++ b/docs/models/components/messagesmessageparamrole.md @@ -0,0 +1,23 @@ +# MessagesMessageParamRole + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.MessagesMessageParamRoleUser + +// Open enum: custom values can be created with a direct type cast +custom := components.MessagesMessageParamRole("custom_value") +``` + + +## Values + +| Name | Value | +| ----------------------------------- | ----------------------------------- | +| `MessagesMessageParamRoleUser` | user | +| `MessagesMessageParamRoleAssistant` | assistant | +| `MessagesMessageParamRoleSystem` | system | \ No newline at end of file diff --git a/docs/models/components/messagesmessageparamtypecompaction.md b/docs/models/components/messagesmessageparamtypecompaction.md new file mode 100644 index 00000000..f3c44964 --- /dev/null +++ b/docs/models/components/messagesmessageparamtypecompaction.md @@ -0,0 +1,18 @@ +# MessagesMessageParamTypeCompaction + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.MessagesMessageParamTypeCompactionCompaction +``` + + +## Values + +| Name | Value | +| ---------------------------------------------- | ---------------------------------------------- | +| `MessagesMessageParamTypeCompactionCompaction` | compaction | \ No newline at end of file diff --git a/docs/models/components/messagesoutputconfig.md b/docs/models/components/messagesoutputconfig.md new file mode 100644 index 00000000..650b93bc --- /dev/null +++ b/docs/models/components/messagesoutputconfig.md @@ -0,0 +1,12 @@ +# MessagesOutputConfig + +Configuration for controlling output behavior. Supports the effort parameter and structured output format. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Effort` | optionalnullable.OptionalNullable[[components.MessagesOutputConfigEffort](../../models/components/messagesoutputconfigeffort.md)] | :heavy_minus_sign: | How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer. Valid values are `low`, `medium`, `high`, `xhigh`, or `max`. | medium | +| `Format` | optionalnullable.OptionalNullable[[components.MessagesOutputConfigFormat](../../models/components/messagesoutputconfigformat.md)] | :heavy_minus_sign: | A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs). | | +| `TaskBudget` | optionalnullable.OptionalNullable[[components.TaskBudget](../../models/components/taskbudget.md)] | :heavy_minus_sign: | Task budget for an agentic turn. The model sees a countdown of remaining tokens and uses it to prioritize work and wind down gracefully. Advisory — does not enforce a hard cap. | {
"total": 400000,
"type": "tokens"
} | \ No newline at end of file diff --git a/docs/models/components/messagesoutputconfigeffort.md b/docs/models/components/messagesoutputconfigeffort.md new file mode 100644 index 00000000..8d2eccf5 --- /dev/null +++ b/docs/models/components/messagesoutputconfigeffort.md @@ -0,0 +1,27 @@ +# MessagesOutputConfigEffort + +How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer. Valid values are `low`, `medium`, `high`, `xhigh`, or `max`. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.MessagesOutputConfigEffortLow + +// Open enum: custom values can be created with a direct type cast +custom := components.MessagesOutputConfigEffort("custom_value") +``` + + +## Values + +| Name | Value | +| ---------------------------------- | ---------------------------------- | +| `MessagesOutputConfigEffortLow` | low | +| `MessagesOutputConfigEffortMedium` | medium | +| `MessagesOutputConfigEffortHigh` | high | +| `MessagesOutputConfigEffortXhigh` | xhigh | +| `MessagesOutputConfigEffortMax` | max | \ No newline at end of file diff --git a/docs/models/components/messagesoutputconfigformat.md b/docs/models/components/messagesoutputconfigformat.md new file mode 100644 index 00000000..7101a64e --- /dev/null +++ b/docs/models/components/messagesoutputconfigformat.md @@ -0,0 +1,11 @@ +# MessagesOutputConfigFormat + +A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs). + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `Schema` | map[string]`any` | :heavy_check_mark: | N/A | +| `Type` | [components.MessagesOutputConfigTypeJSONSchema](../../models/components/messagesoutputconfigtypejsonschema.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/messagesoutputconfigtypejsonschema.md b/docs/models/components/messagesoutputconfigtypejsonschema.md new file mode 100644 index 00000000..d9b624b6 --- /dev/null +++ b/docs/models/components/messagesoutputconfigtypejsonschema.md @@ -0,0 +1,18 @@ +# MessagesOutputConfigTypeJSONSchema + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.MessagesOutputConfigTypeJSONSchemaJSONSchema +``` + + +## Values + +| Name | Value | +| ---------------------------------------------- | ---------------------------------------------- | +| `MessagesOutputConfigTypeJSONSchemaJSONSchema` | json_schema | \ No newline at end of file diff --git a/docs/models/components/messagesrequest.md b/docs/models/components/messagesrequest.md new file mode 100644 index 00000000..7b6fd798 --- /dev/null +++ b/docs/models/components/messagesrequest.md @@ -0,0 +1,35 @@ +# MessagesRequest + +Request schema for Anthropic Messages API endpoint + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CacheControl` | [*components.AnthropicCacheControlDirective](../../models/components/anthropiccachecontroldirective.md) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | {
"type": "ephemeral"
} | +| `ContextManagement` | optionalnullable.OptionalNullable[[components.ContextManagement](../../models/components/contextmanagement.md)] | :heavy_minus_sign: | N/A | | +| `Fallbacks` | optionalnullable.OptionalNullable[[][components.MessagesFallbackParam](../../models/components/messagesfallbackparam.md)] | :heavy_minus_sign: | Fallback models to try if the primary model fails or refuses, in order. Handled by OpenRouter multi-model routing rather than Anthropic server-side fallbacks; cannot be combined with `models`. Each entry accepts only `model`. Maximum of 3 entries. | [
{
"model": "claude-opus-4-8"
}
] | +| `MaxTokens` | `*int64` | :heavy_minus_sign: | N/A | | +| `Messages` | [][components.MessagesMessageParam](../../models/components/messagesmessageparam.md) | :heavy_check_mark: | N/A | | +| `Metadata` | [*components.Metadata](../../models/components/metadata.md) | :heavy_minus_sign: | N/A | | +| `Model` | `string` | :heavy_check_mark: | N/A | | +| `Models` | []`string` | :heavy_minus_sign: | N/A | | +| `OutputConfig` | [*components.MessagesOutputConfig](../../models/components/messagesoutputconfig.md) | :heavy_minus_sign: | Configuration for controlling output behavior. Supports the effort parameter and structured output format. | {
"effort": "medium"
} | +| `Plugins` | [][components.MessagesRequestPlugin](../../models/components/messagesrequestplugin.md) | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | | +| `Provider` | optionalnullable.OptionalNullable[[components.ProviderPreferences](../../models/components/providerpreferences.md)] | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | {
"allow_fallbacks": true
} | +| `ServiceTier` | `*string` | :heavy_minus_sign: | N/A | | +| `SessionID` | `*string` | :heavy_minus_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. | | +| `Speed` | optionalnullable.OptionalNullable[[components.Speed](../../models/components/speed.md)] | :heavy_minus_sign: | N/A | fast | +| `StopSequences` | []`string` | :heavy_minus_sign: | N/A | | +| `StopServerToolsWhen` | [][components.StopServerToolsWhenCondition](../../models/components/stopservertoolswhencondition.md) | :heavy_minus_sign: | Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`. | [
{
"step_count": 5,
"type": "step_count_is"
},
{
"max_cost_in_dollars": 0.5,
"type": "max_cost"
}
] | +| `Stream` | `*bool` | :heavy_minus_sign: | N/A | | +| `System` | [*components.System](../../models/components/system.md) | :heavy_minus_sign: | N/A | | +| `Temperature` | `*float64` | :heavy_minus_sign: | N/A | | +| `Thinking` | [*components.Thinking](../../models/components/thinking.md) | :heavy_minus_sign: | N/A | | +| `ToolChoice` | [*components.ToolChoice](../../models/components/toolchoice.md) | :heavy_minus_sign: | N/A | | +| `Tools` | [][components.MessagesRequestToolUnion](../../models/components/messagesrequesttoolunion.md) | :heavy_minus_sign: | N/A | | +| `TopK` | `*int64` | :heavy_minus_sign: | N/A | | +| `TopP` | `*float64` | :heavy_minus_sign: | N/A | | +| `Trace` | [*components.TraceConfig](../../models/components/traceconfig.md) | :heavy_minus_sign: | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | {
"trace_id": "trace-abc123",
"trace_name": "my-app-trace"
} | +| `User` | `*string` | :heavy_minus_sign: | A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 256 characters. | | \ No newline at end of file diff --git a/docs/models/components/messagesrequestplugin.md b/docs/models/components/messagesrequestplugin.md new file mode 100644 index 00000000..22119165 --- /dev/null +++ b/docs/models/components/messagesrequestplugin.md @@ -0,0 +1,85 @@ +# MessagesRequestPlugin + + +## Supported Types + +### AutoRouterPlugin + +```go +messagesRequestPlugin := components.CreateMessagesRequestPluginAutoRouter(components.AutoRouterPlugin{/* values here */}) +``` + +### ContextCompressionPlugin + +```go +messagesRequestPlugin := components.CreateMessagesRequestPluginContextCompression(components.ContextCompressionPlugin{/* values here */}) +``` + +### FileParserPlugin + +```go +messagesRequestPlugin := components.CreateMessagesRequestPluginFileParser(components.FileParserPlugin{/* values here */}) +``` + +### FusionPlugin + +```go +messagesRequestPlugin := components.CreateMessagesRequestPluginFusion(components.FusionPlugin{/* values here */}) +``` + +### ModerationPlugin + +```go +messagesRequestPlugin := components.CreateMessagesRequestPluginModeration(components.ModerationPlugin{/* values here */}) +``` + +### ParetoRouterPlugin + +```go +messagesRequestPlugin := components.CreateMessagesRequestPluginParetoRouter(components.ParetoRouterPlugin{/* values here */}) +``` + +### ResponseHealingPlugin + +```go +messagesRequestPlugin := components.CreateMessagesRequestPluginResponseHealing(components.ResponseHealingPlugin{/* values here */}) +``` + +### WebSearchPlugin + +```go +messagesRequestPlugin := components.CreateMessagesRequestPluginWeb(components.WebSearchPlugin{/* values here */}) +``` + +### WebFetchPlugin + +```go +messagesRequestPlugin := components.CreateMessagesRequestPluginWebFetch(components.WebFetchPlugin{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch messagesRequestPlugin.Type { + case components.MessagesRequestPluginTypeAutoRouter: + // messagesRequestPlugin.AutoRouterPlugin is populated + case components.MessagesRequestPluginTypeContextCompression: + // messagesRequestPlugin.ContextCompressionPlugin is populated + case components.MessagesRequestPluginTypeFileParser: + // messagesRequestPlugin.FileParserPlugin is populated + case components.MessagesRequestPluginTypeFusion: + // messagesRequestPlugin.FusionPlugin is populated + case components.MessagesRequestPluginTypeModeration: + // messagesRequestPlugin.ModerationPlugin is populated + case components.MessagesRequestPluginTypeParetoRouter: + // messagesRequestPlugin.ParetoRouterPlugin is populated + case components.MessagesRequestPluginTypeResponseHealing: + // messagesRequestPlugin.ResponseHealingPlugin is populated + case components.MessagesRequestPluginTypeWeb: + // messagesRequestPlugin.WebSearchPlugin is populated + case components.MessagesRequestPluginTypeWebFetch: + // messagesRequestPlugin.WebFetchPlugin is populated +} +``` diff --git a/docs/models/components/messagesrequesttool.md b/docs/models/components/messagesrequesttool.md new file mode 100644 index 00000000..3a47ca16 --- /dev/null +++ b/docs/models/components/messagesrequesttool.md @@ -0,0 +1,9 @@ +# MessagesRequestTool + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `Type` | `string` | :heavy_check_mark: | N/A | +| `AdditionalProperties` | map[string]`any` | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/messagesrequesttoolunion.md b/docs/models/components/messagesrequesttoolunion.md new file mode 100644 index 00000000..05a6ffa7 --- /dev/null +++ b/docs/models/components/messagesrequesttoolunion.md @@ -0,0 +1,117 @@ +# MessagesRequestToolUnion + + +## Supported Types + +### ToolCustom + +```go +messagesRequestToolUnion := components.CreateMessagesRequestToolUnionToolCustom(components.ToolCustom{/* values here */}) +``` + +### ToolBash20250124 + +```go +messagesRequestToolUnion := components.CreateMessagesRequestToolUnionToolBash20250124(components.ToolBash20250124{/* values here */}) +``` + +### ToolTextEditor20250124 + +```go +messagesRequestToolUnion := components.CreateMessagesRequestToolUnionToolTextEditor20250124(components.ToolTextEditor20250124{/* values here */}) +``` + +### ToolWebSearch20250305 + +```go +messagesRequestToolUnion := components.CreateMessagesRequestToolUnionToolWebSearch20250305(components.ToolWebSearch20250305{/* values here */}) +``` + +### ToolWebSearch20260209 + +```go +messagesRequestToolUnion := components.CreateMessagesRequestToolUnionToolWebSearch20260209(components.ToolWebSearch20260209{/* values here */}) +``` + +### ToolAdvisor20260301 + +```go +messagesRequestToolUnion := components.CreateMessagesRequestToolUnionToolAdvisor20260301(components.ToolAdvisor20260301{/* values here */}) +``` + +### BashServerTool + +```go +messagesRequestToolUnion := components.CreateMessagesRequestToolUnionBashServerTool(components.BashServerTool{/* values here */}) +``` + +### DatetimeServerTool + +```go +messagesRequestToolUnion := components.CreateMessagesRequestToolUnionDatetimeServerTool(components.DatetimeServerTool{/* values here */}) +``` + +### ImageGenerationServerToolOpenRouter + +```go +messagesRequestToolUnion := components.CreateMessagesRequestToolUnionImageGenerationServerToolOpenRouter(components.ImageGenerationServerToolOpenRouter{/* values here */}) +``` + +### ChatSearchModelsServerTool + +```go +messagesRequestToolUnion := components.CreateMessagesRequestToolUnionChatSearchModelsServerTool(components.ChatSearchModelsServerTool{/* values here */}) +``` + +### WebFetchServerTool + +```go +messagesRequestToolUnion := components.CreateMessagesRequestToolUnionWebFetchServerTool(components.WebFetchServerTool{/* values here */}) +``` + +### OpenRouterWebSearchServerTool + +```go +messagesRequestToolUnion := components.CreateMessagesRequestToolUnionOpenRouterWebSearchServerTool(components.OpenRouterWebSearchServerTool{/* values here */}) +``` + +### MessagesRequestTool + +```go +messagesRequestToolUnion := components.CreateMessagesRequestToolUnionMessagesRequestTool(components.MessagesRequestTool{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch messagesRequestToolUnion.Type { + case components.MessagesRequestToolUnionTypeToolCustom: + // messagesRequestToolUnion.ToolCustom is populated + case components.MessagesRequestToolUnionTypeToolBash20250124: + // messagesRequestToolUnion.ToolBash20250124 is populated + case components.MessagesRequestToolUnionTypeToolTextEditor20250124: + // messagesRequestToolUnion.ToolTextEditor20250124 is populated + case components.MessagesRequestToolUnionTypeToolWebSearch20250305: + // messagesRequestToolUnion.ToolWebSearch20250305 is populated + case components.MessagesRequestToolUnionTypeToolWebSearch20260209: + // messagesRequestToolUnion.ToolWebSearch20260209 is populated + case components.MessagesRequestToolUnionTypeToolAdvisor20260301: + // messagesRequestToolUnion.ToolAdvisor20260301 is populated + case components.MessagesRequestToolUnionTypeBashServerTool: + // messagesRequestToolUnion.BashServerTool is populated + case components.MessagesRequestToolUnionTypeDatetimeServerTool: + // messagesRequestToolUnion.DatetimeServerTool is populated + case components.MessagesRequestToolUnionTypeImageGenerationServerToolOpenRouter: + // messagesRequestToolUnion.ImageGenerationServerToolOpenRouter is populated + case components.MessagesRequestToolUnionTypeChatSearchModelsServerTool: + // messagesRequestToolUnion.ChatSearchModelsServerTool is populated + case components.MessagesRequestToolUnionTypeWebFetchServerTool: + // messagesRequestToolUnion.WebFetchServerTool is populated + case components.MessagesRequestToolUnionTypeOpenRouterWebSearchServerTool: + // messagesRequestToolUnion.OpenRouterWebSearchServerTool is populated + case components.MessagesRequestToolUnionTypeMessagesRequestTool: + // messagesRequestToolUnion.MessagesRequestTool is populated +} +``` diff --git a/docs/models/components/metadata.md b/docs/models/components/metadata.md new file mode 100644 index 00000000..abeea6e4 --- /dev/null +++ b/docs/models/components/metadata.md @@ -0,0 +1,8 @@ +# Metadata + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `UserID` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/metadatalevel.md b/docs/models/components/metadatalevel.md new file mode 100644 index 00000000..2afd9665 --- /dev/null +++ b/docs/models/components/metadatalevel.md @@ -0,0 +1,24 @@ +# MetadataLevel + +Opt-in level for surfacing routing metadata on the response under `openrouter_metadata`. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.MetadataLevelDisabled + +// Open enum: custom values can be created with a direct type cast +custom := components.MetadataLevel("custom_value") +``` + + +## Values + +| Name | Value | +| ----------------------- | ----------------------- | +| `MetadataLevelDisabled` | disabled | +| `MetadataLevelEnabled` | enabled | \ No newline at end of file diff --git a/docs/models/components/method.md b/docs/models/components/method.md new file mode 100644 index 00000000..64b22539 --- /dev/null +++ b/docs/models/components/method.md @@ -0,0 +1,22 @@ +# Method + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.MethodPost + +// Open enum: custom values can be created with a direct type cast +custom := components.Method("custom_value") +``` + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `MethodPost` | POST | +| `MethodPut` | PUT | \ No newline at end of file diff --git a/docs/models/components/model.md b/docs/models/components/model.md index 2b98042e..972e5229 100644 --- a/docs/models/components/model.md +++ b/docs/models/components/model.md @@ -5,21 +5,23 @@ Information about an AI model available on OpenRouter ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Architecture` | [components.ModelArchitecture](../../models/components/modelarchitecture.md) | :heavy_check_mark: | Model architecture information | {
"input_modalities": [
"text"
],
"instruct_type": "chatml",
"modality": "text-\u003etext",
"output_modalities": [
"text"
],
"tokenizer": "GPT"
} | -| `CanonicalSlug` | `string` | :heavy_check_mark: | Canonical slug for the model | openai/gpt-4 | -| `ContextLength` | `*int64` | :heavy_check_mark: | Maximum context length in tokens | 8192 | -| `Created` | `int64` | :heavy_check_mark: | Unix timestamp of when the model was created | 1692901234 | -| `DefaultParameters` | [*components.DefaultParameters](../../models/components/defaultparameters.md) | :heavy_check_mark: | Default parameters for this model | {
"frequency_penalty": 0,
"presence_penalty": 0,
"repetition_penalty": 1,
"temperature": 0.7,
"top_k": 0,
"top_p": 0.9
} | -| `Description` | `*string` | :heavy_minus_sign: | Description of the model | GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. | -| `ExpirationDate` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration. | 2025-06-01 | -| `HuggingFaceID` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Hugging Face model identifier, if applicable | microsoft/DialoGPT-medium | -| `ID` | `string` | :heavy_check_mark: | Unique identifier for the model | openai/gpt-4 | -| `KnowledgeCutoff` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | The date up to which the model was trained on data. ISO 8601 date string (YYYY-MM-DD) or null if unknown. | 2024-10-01 | -| `Links` | [components.ModelLinks](../../models/components/modellinks.md) | :heavy_check_mark: | Related API endpoints and resources for this model. | {
"details": "/api/v1/models/openai/gpt-5.4/endpoints"
} | -| `Name` | `string` | :heavy_check_mark: | Display name of the model | GPT-4 | -| `PerRequestLimits` | [*components.PerRequestLimits](../../models/components/perrequestlimits.md) | :heavy_check_mark: | Per-request token limits | {
"completion_tokens": 1000,
"prompt_tokens": 1000
} | -| `Pricing` | [components.PublicPricing](../../models/components/publicpricing.md) | :heavy_check_mark: | Pricing information for the model | {
"completion": "0.00006",
"image": "0",
"prompt": "0.00003",
"request": "0"
} | -| `SupportedParameters` | [][components.Parameter](../../models/components/parameter.md) | :heavy_check_mark: | List of supported parameters for this model | | -| `TopProvider` | [components.TopProviderInfo](../../models/components/topproviderinfo.md) | :heavy_check_mark: | Information about the top provider for this model | {
"context_length": 8192,
"is_moderated": true,
"max_completion_tokens": 4096
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Architecture` | [components.ModelArchitecture](../../models/components/modelarchitecture.md) | :heavy_check_mark: | Model architecture information | {
"input_modalities": [
"text"
],
"instruct_type": "chatml",
"modality": "text-\u003etext",
"output_modalities": [
"text"
],
"tokenizer": "GPT"
} | +| `Benchmarks` | [*components.ModelBenchmarks](../../models/components/modelbenchmarks.md) | :heavy_minus_sign: | Third-party benchmark rankings for this model. Omitted when no benchmark data is available. | {
"artificial_analysis": {
"agentic_index": 55.8,
"coding_index": 63.2,
"intelligence_index": 71.4
},
"design_arena": [
{
"arena": "models",
"category": "website",
"elo": 1385.2,
"rank": 5,
"win_rate": 62.5
}
]
} | +| `CanonicalSlug` | `string` | :heavy_check_mark: | Canonical slug for the model | openai/gpt-4 | +| `ContextLength` | `*int64` | :heavy_check_mark: | Maximum context length in tokens | 8192 | +| `Created` | `int64` | :heavy_check_mark: | Unix timestamp of when the model was created | 1692901234 | +| `DefaultParameters` | [*components.DefaultParameters](../../models/components/defaultparameters.md) | :heavy_check_mark: | Default parameters for this model | {
"frequency_penalty": 0,
"presence_penalty": 0,
"repetition_penalty": 1,
"temperature": 0.7,
"top_k": 0,
"top_p": 0.9
} | +| `Description` | `*string` | :heavy_minus_sign: | Description of the model | GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. | +| `ExpirationDate` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration. | 2025-06-01 | +| `HuggingFaceID` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Hugging Face model identifier, if applicable | microsoft/DialoGPT-medium | +| `ID` | `string` | :heavy_check_mark: | Unique identifier for the model | openai/gpt-4 | +| `KnowledgeCutoff` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | The date up to which the model was trained on data. ISO 8601 date string (YYYY-MM-DD) or null if unknown. | 2024-10-01 | +| `Links` | [components.ModelLinks](../../models/components/modellinks.md) | :heavy_check_mark: | Related API endpoints and resources for this model. | {
"details": "/api/v1/models/openai/gpt-5.4/endpoints"
} | +| `Name` | `string` | :heavy_check_mark: | Display name of the model | GPT-4 | +| `PerRequestLimits` | [*components.PerRequestLimits](../../models/components/perrequestlimits.md) | :heavy_check_mark: | Per-request token limits | {
"completion_tokens": 1000,
"prompt_tokens": 1000
} | +| `Pricing` | [components.PublicPricing](../../models/components/publicpricing.md) | :heavy_check_mark: | Pricing information for the model | {
"completion": "0.00006",
"image": "0",
"prompt": "0.00003",
"request": "0"
} | +| `SupportedParameters` | [][components.Parameter](../../models/components/parameter.md) | :heavy_check_mark: | List of supported parameters for this model | | +| `SupportedVoices` | []`string` | :heavy_check_mark: | List of supported voice identifiers for TTS models. Null for non-TTS models. | null | +| `TopProvider` | [components.TopProviderInfo](../../models/components/topproviderinfo.md) | :heavy_check_mark: | Information about the top provider for this model | {
"context_length": 8192,
"is_moderated": true,
"max_completion_tokens": 4096
} | \ No newline at end of file diff --git a/docs/models/components/modelbenchmarks.md b/docs/models/components/modelbenchmarks.md new file mode 100644 index 00000000..27de268e --- /dev/null +++ b/docs/models/components/modelbenchmarks.md @@ -0,0 +1,11 @@ +# ModelBenchmarks + +Third-party benchmark rankings for this model. Omitted when no benchmark data is available. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `ArtificialAnalysis` | [*components.AABenchmarkEntry](../../models/components/aabenchmarkentry.md) | :heavy_minus_sign: | Artificial Analysis benchmark index scores. | {
"agentic_index": 55.8,
"coding_index": 63.2,
"intelligence_index": 71.4
} | +| `DesignArena` | [][components.DABenchmarkEntry](../../models/components/dabenchmarkentry.md) | :heavy_check_mark: | Design Arena ELO rankings across arena+category pairs. | [
{
"arena": "models",
"category": "website",
"elo": 1385.2,
"rank": 5,
"win_rate": 62.5
}
] | \ No newline at end of file diff --git a/docs/models/components/modelresponse.md b/docs/models/components/modelresponse.md new file mode 100644 index 00000000..81933622 --- /dev/null +++ b/docs/models/components/modelresponse.md @@ -0,0 +1,10 @@ +# ModelResponse + +Single model response + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Data` | [components.Model](../../models/components/model.md) | :heavy_check_mark: | Information about an AI model available on OpenRouter | {
"architecture": {
"input_modalities": [
"text"
],
"instruct_type": "chatml",
"modality": "text-\u003etext",
"output_modalities": [
"text"
],
"tokenizer": "GPT"
},
"canonical_slug": "openai/gpt-4",
"context_length": 8192,
"created": 1692901234,
"default_parameters": null,
"description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.",
"expiration_date": null,
"id": "openai/gpt-4",
"knowledge_cutoff": null,
"links": {
"details": "/api/v1/models/openai/gpt-5.4/endpoints"
},
"name": "GPT-4",
"per_request_limits": null,
"pricing": {
"completion": "0.00006",
"image": "0",
"prompt": "0.00003",
"request": "0"
},
"supported_parameters": [
"temperature",
"top_p",
"max_tokens"
],
"supported_voices": null,
"top_provider": {
"context_length": 8192,
"is_moderated": true,
"max_completion_tokens": 4096
}
} | \ No newline at end of file diff --git a/docs/models/components/modelslistresponse.md b/docs/models/components/modelslistresponse.md index 8f74a7c2..c7ec3c2c 100644 --- a/docs/models/components/modelslistresponse.md +++ b/docs/models/components/modelslistresponse.md @@ -5,6 +5,6 @@ List of available models ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Data` | [][components.Model](../../models/components/model.md) | :heavy_check_mark: | List of available models | [
{
"architecture": {
"input_modalities": [
"text"
],
"instruct_type": "chatml",
"modality": "text-\u003etext",
"output_modalities": [
"text"
],
"tokenizer": "GPT"
},
"canonical_slug": "openai/gpt-4",
"context_length": 8192,
"created": 1692901234,
"default_parameters": null,
"description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.",
"expiration_date": null,
"id": "openai/gpt-4",
"knowledge_cutoff": null,
"links": {
"details": "/api/v1/models/openai/gpt-5.4/endpoints"
},
"name": "GPT-4",
"per_request_limits": null,
"pricing": {
"completion": "0.00006",
"image": "0",
"prompt": "0.00003",
"request": "0"
},
"supported_parameters": [
"temperature",
"top_p",
"max_tokens"
],
"top_provider": {
"context_length": 8192,
"is_moderated": true,
"max_completion_tokens": 4096
}
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Data` | [][components.Model](../../models/components/model.md) | :heavy_check_mark: | List of available models | [
{
"architecture": {
"input_modalities": [
"text"
],
"instruct_type": "chatml",
"modality": "text-\u003etext",
"output_modalities": [
"text"
],
"tokenizer": "GPT"
},
"canonical_slug": "openai/gpt-4",
"context_length": 8192,
"created": 1692901234,
"default_parameters": null,
"description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.",
"expiration_date": null,
"id": "openai/gpt-4",
"knowledge_cutoff": null,
"links": {
"details": "/api/v1/models/openai/gpt-5.4/endpoints"
},
"name": "GPT-4",
"per_request_limits": null,
"pricing": {
"completion": "0.00006",
"image": "0",
"prompt": "0.00003",
"request": "0"
},
"supported_parameters": [
"temperature",
"top_p",
"max_tokens"
],
"supported_voices": null,
"top_provider": {
"context_length": 8192,
"is_moderated": true,
"max_completion_tokens": 4096
}
}
] | \ No newline at end of file diff --git a/docs/models/components/multimodalmedia.md b/docs/models/components/multimodalmedia.md new file mode 100644 index 00000000..ea77c574 --- /dev/null +++ b/docs/models/components/multimodalmedia.md @@ -0,0 +1,9 @@ +# MultimodalMedia + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Data` | `string` | :heavy_check_mark: | N/A | +| `Format` | `*string` | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/nameadvisor.md b/docs/models/components/nameadvisor.md new file mode 100644 index 00000000..6138f266 --- /dev/null +++ b/docs/models/components/nameadvisor.md @@ -0,0 +1,18 @@ +# NameAdvisor + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.NameAdvisorAdvisor +``` + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `NameAdvisorAdvisor` | advisor | \ No newline at end of file diff --git a/docs/models/components/namebash.md b/docs/models/components/namebash.md new file mode 100644 index 00000000..69ff4bbe --- /dev/null +++ b/docs/models/components/namebash.md @@ -0,0 +1,18 @@ +# NameBash + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.NameBashBash +``` + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `NameBashBash` | bash | \ No newline at end of file diff --git a/docs/models/components/namestrreplaceeditor.md b/docs/models/components/namestrreplaceeditor.md new file mode 100644 index 00000000..a4b107ad --- /dev/null +++ b/docs/models/components/namestrreplaceeditor.md @@ -0,0 +1,18 @@ +# NameStrReplaceEditor + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.NameStrReplaceEditorStrReplaceEditor +``` + + +## Values + +| Name | Value | +| -------------------------------------- | -------------------------------------- | +| `NameStrReplaceEditorStrReplaceEditor` | str_replace_editor | \ No newline at end of file diff --git a/docs/models/components/namewebsearch1.md b/docs/models/components/namewebsearch1.md new file mode 100644 index 00000000..73e10722 --- /dev/null +++ b/docs/models/components/namewebsearch1.md @@ -0,0 +1,18 @@ +# NameWebSearch1 + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.NameWebSearch1WebSearch +``` + + +## Values + +| Name | Value | +| ------------------------- | ------------------------- | +| `NameWebSearch1WebSearch` | web_search | \ No newline at end of file diff --git a/docs/models/components/namewebsearch2.md b/docs/models/components/namewebsearch2.md new file mode 100644 index 00000000..2e4a6629 --- /dev/null +++ b/docs/models/components/namewebsearch2.md @@ -0,0 +1,18 @@ +# NameWebSearch2 + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.NameWebSearch2WebSearch +``` + + +## Values + +| Name | Value | +| ------------------------- | ------------------------- | +| `NameWebSearch2WebSearch` | web_search | \ No newline at end of file diff --git a/docs/models/components/observabilityarizedestination.md b/docs/models/components/observabilityarizedestination.md new file mode 100644 index 00000000..ab2a41a2 --- /dev/null +++ b/docs/models/components/observabilityarizedestination.md @@ -0,0 +1,19 @@ +# ObservabilityArizeDestination + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `Config` | [components.ObservabilityArizeDestinationConfig](../../models/components/observabilityarizedestinationconfig.md) | :heavy_check_mark: | N/A | | +| `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | +| `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | +| `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | +| `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | +| `SamplingRate` | `float64` | :heavy_check_mark: | Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). | 1 | +| `Type` | [components.ObservabilityArizeDestinationType](../../models/components/observabilityarizedestinationtype.md) | :heavy_check_mark: | N/A | | +| `UpdatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was last updated. | 2025-08-24T15:45:00Z | +| `WorkspaceID` | `string` | :heavy_check_mark: | ID of the workspace this destination belongs to. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/components/observabilityarizedestinationconfig.md b/docs/models/components/observabilityarizedestinationconfig.md new file mode 100644 index 00000000..27cf64ee --- /dev/null +++ b/docs/models/components/observabilityarizedestinationconfig.md @@ -0,0 +1,12 @@ +# ObservabilityArizeDestinationConfig + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `APIKey` | `string` | :heavy_check_mark: | N/A | +| `BaseURL` | `*string` | :heavy_minus_sign: | N/A | +| `Headers` | map[string]`string` | :heavy_minus_sign: | Custom HTTP headers to include in requests to this destination. | +| `ModelID` | `string` | :heavy_check_mark: | N/A | +| `SpaceKey` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/observabilityarizedestinationtype.md b/docs/models/components/observabilityarizedestinationtype.md new file mode 100644 index 00000000..404681cd --- /dev/null +++ b/docs/models/components/observabilityarizedestinationtype.md @@ -0,0 +1,18 @@ +# ObservabilityArizeDestinationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ObservabilityArizeDestinationTypeArize +``` + + +## Values + +| Name | Value | +| ---------------------------------------- | ---------------------------------------- | +| `ObservabilityArizeDestinationTypeArize` | arize | \ No newline at end of file diff --git a/docs/models/components/observabilitybraintrustdestination.md b/docs/models/components/observabilitybraintrustdestination.md new file mode 100644 index 00000000..f094ce6f --- /dev/null +++ b/docs/models/components/observabilitybraintrustdestination.md @@ -0,0 +1,19 @@ +# ObservabilityBraintrustDestination + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `Config` | [components.ObservabilityBraintrustDestinationConfig](../../models/components/observabilitybraintrustdestinationconfig.md) | :heavy_check_mark: | N/A | | +| `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | +| `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | +| `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | +| `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | +| `SamplingRate` | `float64` | :heavy_check_mark: | Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). | 1 | +| `Type` | [components.ObservabilityBraintrustDestinationType](../../models/components/observabilitybraintrustdestinationtype.md) | :heavy_check_mark: | N/A | | +| `UpdatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was last updated. | 2025-08-24T15:45:00Z | +| `WorkspaceID` | `string` | :heavy_check_mark: | ID of the workspace this destination belongs to. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/components/observabilitybraintrustdestinationconfig.md b/docs/models/components/observabilitybraintrustdestinationconfig.md new file mode 100644 index 00000000..64682360 --- /dev/null +++ b/docs/models/components/observabilitybraintrustdestinationconfig.md @@ -0,0 +1,11 @@ +# ObservabilityBraintrustDestinationConfig + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `APIKey` | `string` | :heavy_check_mark: | N/A | +| `BaseURL` | `*string` | :heavy_minus_sign: | N/A | +| `Headers` | map[string]`string` | :heavy_minus_sign: | Custom HTTP headers to include in requests to this destination. | +| `ProjectID` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/observabilitybraintrustdestinationtype.md b/docs/models/components/observabilitybraintrustdestinationtype.md new file mode 100644 index 00000000..8653e21a --- /dev/null +++ b/docs/models/components/observabilitybraintrustdestinationtype.md @@ -0,0 +1,18 @@ +# ObservabilityBraintrustDestinationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ObservabilityBraintrustDestinationTypeBraintrust +``` + + +## Values + +| Name | Value | +| -------------------------------------------------- | -------------------------------------------------- | +| `ObservabilityBraintrustDestinationTypeBraintrust` | braintrust | \ No newline at end of file diff --git a/docs/models/components/observabilityclickhousedestination.md b/docs/models/components/observabilityclickhousedestination.md new file mode 100644 index 00000000..734b530b --- /dev/null +++ b/docs/models/components/observabilityclickhousedestination.md @@ -0,0 +1,19 @@ +# ObservabilityClickhouseDestination + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `Config` | [components.ObservabilityClickhouseDestinationConfig](../../models/components/observabilityclickhousedestinationconfig.md) | :heavy_check_mark: | N/A | | +| `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | +| `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | +| `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | +| `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | +| `SamplingRate` | `float64` | :heavy_check_mark: | Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). | 1 | +| `Type` | [components.ObservabilityClickhouseDestinationType](../../models/components/observabilityclickhousedestinationtype.md) | :heavy_check_mark: | N/A | | +| `UpdatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was last updated. | 2025-08-24T15:45:00Z | +| `WorkspaceID` | `string` | :heavy_check_mark: | ID of the workspace this destination belongs to. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/components/observabilityclickhousedestinationconfig.md b/docs/models/components/observabilityclickhousedestinationconfig.md new file mode 100644 index 00000000..feef46ea --- /dev/null +++ b/docs/models/components/observabilityclickhousedestinationconfig.md @@ -0,0 +1,13 @@ +# ObservabilityClickhouseDestinationConfig + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `Database` | `string` | :heavy_check_mark: | N/A | +| `Headers` | map[string]`string` | :heavy_minus_sign: | Custom HTTP headers to include in requests to this destination. | +| `Host` | `string` | :heavy_check_mark: | N/A | +| `Password` | `string` | :heavy_check_mark: | N/A | +| `Table` | `*string` | :heavy_minus_sign: | N/A | +| `Username` | `string` | :heavy_check_mark: | If you have not set a specific username in ClickHouse, simply type in 'default' below. | \ No newline at end of file diff --git a/docs/models/components/observabilityclickhousedestinationtype.md b/docs/models/components/observabilityclickhousedestinationtype.md new file mode 100644 index 00000000..0c549d1f --- /dev/null +++ b/docs/models/components/observabilityclickhousedestinationtype.md @@ -0,0 +1,18 @@ +# ObservabilityClickhouseDestinationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ObservabilityClickhouseDestinationTypeClickhouse +``` + + +## Values + +| Name | Value | +| -------------------------------------------------- | -------------------------------------------------- | +| `ObservabilityClickhouseDestinationTypeClickhouse` | clickhouse | \ No newline at end of file diff --git a/docs/models/components/observabilitydatadogdestination.md b/docs/models/components/observabilitydatadogdestination.md new file mode 100644 index 00000000..03ccf243 --- /dev/null +++ b/docs/models/components/observabilitydatadogdestination.md @@ -0,0 +1,19 @@ +# ObservabilityDatadogDestination + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `Config` | [components.ObservabilityDatadogDestinationConfig](../../models/components/observabilitydatadogdestinationconfig.md) | :heavy_check_mark: | N/A | | +| `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | +| `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | +| `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | +| `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | +| `SamplingRate` | `float64` | :heavy_check_mark: | Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). | 1 | +| `Type` | [components.ObservabilityDatadogDestinationType](../../models/components/observabilitydatadogdestinationtype.md) | :heavy_check_mark: | N/A | | +| `UpdatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was last updated. | 2025-08-24T15:45:00Z | +| `WorkspaceID` | `string` | :heavy_check_mark: | ID of the workspace this destination belongs to. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/components/observabilitydatadogdestinationconfig.md b/docs/models/components/observabilitydatadogdestinationconfig.md new file mode 100644 index 00000000..efcc23c9 --- /dev/null +++ b/docs/models/components/observabilitydatadogdestinationconfig.md @@ -0,0 +1,11 @@ +# ObservabilityDatadogDestinationConfig + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `APIKey` | `string` | :heavy_check_mark: | Datadog API key must have LLM Observability permissions. Create at: | +| `Headers` | map[string]`string` | :heavy_minus_sign: | Custom HTTP headers to include in requests to this destination. | +| `MlApp` | `string` | :heavy_check_mark: | Name to identify your application in Datadog LLM Observability | +| `URL` | `*string` | :heavy_minus_sign: | Datadog API URL for your region (e.g., https://api.datadoghq.com, https://api.us3.datadoghq.com, https://api.datadoghq.eu) | \ No newline at end of file diff --git a/docs/models/components/observabilitydatadogdestinationtype.md b/docs/models/components/observabilitydatadogdestinationtype.md new file mode 100644 index 00000000..a09dec8d --- /dev/null +++ b/docs/models/components/observabilitydatadogdestinationtype.md @@ -0,0 +1,18 @@ +# ObservabilityDatadogDestinationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ObservabilityDatadogDestinationTypeDatadog +``` + + +## Values + +| Name | Value | +| -------------------------------------------- | -------------------------------------------- | +| `ObservabilityDatadogDestinationTypeDatadog` | datadog | \ No newline at end of file diff --git a/docs/models/components/observabilitydestination.md b/docs/models/components/observabilitydestination.md new file mode 100644 index 00000000..6ba3804e --- /dev/null +++ b/docs/models/components/observabilitydestination.md @@ -0,0 +1,151 @@ +# ObservabilityDestination + + +## Supported Types + +### ObservabilityArizeDestination + +```go +observabilityDestination := components.CreateObservabilityDestinationArize(components.ObservabilityArizeDestination{/* values here */}) +``` + +### ObservabilityBraintrustDestination + +```go +observabilityDestination := components.CreateObservabilityDestinationBraintrust(components.ObservabilityBraintrustDestination{/* values here */}) +``` + +### ObservabilityClickhouseDestination + +```go +observabilityDestination := components.CreateObservabilityDestinationClickhouse(components.ObservabilityClickhouseDestination{/* values here */}) +``` + +### ObservabilityDatadogDestination + +```go +observabilityDestination := components.CreateObservabilityDestinationDatadog(components.ObservabilityDatadogDestination{/* values here */}) +``` + +### ObservabilityGrafanaDestination + +```go +observabilityDestination := components.CreateObservabilityDestinationGrafana(components.ObservabilityGrafanaDestination{/* values here */}) +``` + +### ObservabilityLangfuseDestination + +```go +observabilityDestination := components.CreateObservabilityDestinationLangfuse(components.ObservabilityLangfuseDestination{/* values here */}) +``` + +### ObservabilityLangsmithDestination + +```go +observabilityDestination := components.CreateObservabilityDestinationLangsmith(components.ObservabilityLangsmithDestination{/* values here */}) +``` + +### ObservabilityNewrelicDestination + +```go +observabilityDestination := components.CreateObservabilityDestinationNewrelic(components.ObservabilityNewrelicDestination{/* values here */}) +``` + +### ObservabilityOpikDestination + +```go +observabilityDestination := components.CreateObservabilityDestinationOpik(components.ObservabilityOpikDestination{/* values here */}) +``` + +### ObservabilityOtelCollectorDestination + +```go +observabilityDestination := components.CreateObservabilityDestinationOtelCollector(components.ObservabilityOtelCollectorDestination{/* values here */}) +``` + +### ObservabilityPosthogDestination + +```go +observabilityDestination := components.CreateObservabilityDestinationPosthog(components.ObservabilityPosthogDestination{/* values here */}) +``` + +### ObservabilityRampDestination + +```go +observabilityDestination := components.CreateObservabilityDestinationRamp(components.ObservabilityRampDestination{/* values here */}) +``` + +### ObservabilityS3Destination + +```go +observabilityDestination := components.CreateObservabilityDestinationS3(components.ObservabilityS3Destination{/* values here */}) +``` + +### ObservabilitySentryDestination + +```go +observabilityDestination := components.CreateObservabilityDestinationSentry(components.ObservabilitySentryDestination{/* values here */}) +``` + +### ObservabilitySnowflakeDestination + +```go +observabilityDestination := components.CreateObservabilityDestinationSnowflake(components.ObservabilitySnowflakeDestination{/* values here */}) +``` + +### ObservabilityWeaveDestination + +```go +observabilityDestination := components.CreateObservabilityDestinationWeave(components.ObservabilityWeaveDestination{/* values here */}) +``` + +### ObservabilityWebhookDestination + +```go +observabilityDestination := components.CreateObservabilityDestinationWebhook(components.ObservabilityWebhookDestination{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch observabilityDestination.Type { + case components.ObservabilityDestinationTypeArize: + // observabilityDestination.ObservabilityArizeDestination is populated + case components.ObservabilityDestinationTypeBraintrust: + // observabilityDestination.ObservabilityBraintrustDestination is populated + case components.ObservabilityDestinationTypeClickhouse: + // observabilityDestination.ObservabilityClickhouseDestination is populated + case components.ObservabilityDestinationTypeDatadog: + // observabilityDestination.ObservabilityDatadogDestination is populated + case components.ObservabilityDestinationTypeGrafana: + // observabilityDestination.ObservabilityGrafanaDestination is populated + case components.ObservabilityDestinationTypeLangfuse: + // observabilityDestination.ObservabilityLangfuseDestination is populated + case components.ObservabilityDestinationTypeLangsmith: + // observabilityDestination.ObservabilityLangsmithDestination is populated + case components.ObservabilityDestinationTypeNewrelic: + // observabilityDestination.ObservabilityNewrelicDestination is populated + case components.ObservabilityDestinationTypeOpik: + // observabilityDestination.ObservabilityOpikDestination is populated + case components.ObservabilityDestinationTypeOtelCollector: + // observabilityDestination.ObservabilityOtelCollectorDestination is populated + case components.ObservabilityDestinationTypePosthog: + // observabilityDestination.ObservabilityPosthogDestination is populated + case components.ObservabilityDestinationTypeRamp: + // observabilityDestination.ObservabilityRampDestination is populated + case components.ObservabilityDestinationTypeS3: + // observabilityDestination.ObservabilityS3Destination is populated + case components.ObservabilityDestinationTypeSentry: + // observabilityDestination.ObservabilitySentryDestination is populated + case components.ObservabilityDestinationTypeSnowflake: + // observabilityDestination.ObservabilitySnowflakeDestination is populated + case components.ObservabilityDestinationTypeWeave: + // observabilityDestination.ObservabilityWeaveDestination is populated + case components.ObservabilityDestinationTypeWebhook: + // observabilityDestination.ObservabilityWebhookDestination is populated + default: + // Unknown type - use observabilityDestination.GetUnknownRaw() for raw JSON +} +``` diff --git a/docs/models/components/observabilityfilterrulesconfig.md b/docs/models/components/observabilityfilterrulesconfig.md new file mode 100644 index 00000000..b37eb9f8 --- /dev/null +++ b/docs/models/components/observabilityfilterrulesconfig.md @@ -0,0 +1,11 @@ +# ObservabilityFilterRulesConfig + +Optional structured filter rules controlling which events are forwarded. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `Enabled` | `*bool` | :heavy_minus_sign: | N/A | +| `Groups` | [][components.Group](../../models/components/group.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/observabilityfilterrulesconfigvalue.md b/docs/models/components/observabilityfilterrulesconfigvalue.md new file mode 100644 index 00000000..331202a7 --- /dev/null +++ b/docs/models/components/observabilityfilterrulesconfigvalue.md @@ -0,0 +1,29 @@ +# ObservabilityFilterRulesConfigValue + + +## Supported Types + +### + +```go +observabilityFilterRulesConfigValue := components.CreateObservabilityFilterRulesConfigValueStr(string{/* values here */}) +``` + +### + +```go +observabilityFilterRulesConfigValue := components.CreateObservabilityFilterRulesConfigValueNumber(float64{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch observabilityFilterRulesConfigValue.Type { + case components.ObservabilityFilterRulesConfigValueTypeStr: + // observabilityFilterRulesConfigValue.Str is populated + case components.ObservabilityFilterRulesConfigValueTypeNumber: + // observabilityFilterRulesConfigValue.Number is populated +} +``` diff --git a/docs/models/components/observabilitygrafanadestination.md b/docs/models/components/observabilitygrafanadestination.md new file mode 100644 index 00000000..31bfc3ad --- /dev/null +++ b/docs/models/components/observabilitygrafanadestination.md @@ -0,0 +1,19 @@ +# ObservabilityGrafanaDestination + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `Config` | [components.ObservabilityGrafanaDestinationConfig](../../models/components/observabilitygrafanadestinationconfig.md) | :heavy_check_mark: | N/A | | +| `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | +| `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | +| `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | +| `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | +| `SamplingRate` | `float64` | :heavy_check_mark: | Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). | 1 | +| `Type` | [components.ObservabilityGrafanaDestinationType](../../models/components/observabilitygrafanadestinationtype.md) | :heavy_check_mark: | N/A | | +| `UpdatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was last updated. | 2025-08-24T15:45:00Z | +| `WorkspaceID` | `string` | :heavy_check_mark: | ID of the workspace this destination belongs to. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/components/observabilitygrafanadestinationconfig.md b/docs/models/components/observabilitygrafanadestinationconfig.md new file mode 100644 index 00000000..918dfd13 --- /dev/null +++ b/docs/models/components/observabilitygrafanadestinationconfig.md @@ -0,0 +1,11 @@ +# ObservabilityGrafanaDestinationConfig + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `APIKey` | `string` | :heavy_check_mark: | N/A | +| `BaseURL` | `*string` | :heavy_minus_sign: | N/A | +| `Headers` | map[string]`string` | :heavy_minus_sign: | Custom HTTP headers to include in requests to this destination. | +| `InstanceID` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/observabilitygrafanadestinationtype.md b/docs/models/components/observabilitygrafanadestinationtype.md new file mode 100644 index 00000000..47d91d56 --- /dev/null +++ b/docs/models/components/observabilitygrafanadestinationtype.md @@ -0,0 +1,18 @@ +# ObservabilityGrafanaDestinationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ObservabilityGrafanaDestinationTypeGrafana +``` + + +## Values + +| Name | Value | +| -------------------------------------------- | -------------------------------------------- | +| `ObservabilityGrafanaDestinationTypeGrafana` | grafana | \ No newline at end of file diff --git a/docs/models/components/observabilitylangfusedestination.md b/docs/models/components/observabilitylangfusedestination.md new file mode 100644 index 00000000..7f43f6c7 --- /dev/null +++ b/docs/models/components/observabilitylangfusedestination.md @@ -0,0 +1,19 @@ +# ObservabilityLangfuseDestination + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `Config` | [components.ObservabilityLangfuseDestinationConfig](../../models/components/observabilitylangfusedestinationconfig.md) | :heavy_check_mark: | N/A | | +| `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | +| `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | +| `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | +| `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | +| `SamplingRate` | `float64` | :heavy_check_mark: | Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). | 1 | +| `Type` | [components.ObservabilityLangfuseDestinationType](../../models/components/observabilitylangfusedestinationtype.md) | :heavy_check_mark: | N/A | | +| `UpdatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was last updated. | 2025-08-24T15:45:00Z | +| `WorkspaceID` | `string` | :heavy_check_mark: | ID of the workspace this destination belongs to. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/components/observabilitylangfusedestinationconfig.md b/docs/models/components/observabilitylangfusedestinationconfig.md new file mode 100644 index 00000000..e49c906f --- /dev/null +++ b/docs/models/components/observabilitylangfusedestinationconfig.md @@ -0,0 +1,11 @@ +# ObservabilityLangfuseDestinationConfig + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `BaseURL` | `*string` | :heavy_minus_sign: | N/A | +| `Headers` | map[string]`string` | :heavy_minus_sign: | Custom HTTP headers to include in requests to this destination. | +| `PublicKey` | `string` | :heavy_check_mark: | N/A | +| `SecretKey` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/observabilitylangfusedestinationtype.md b/docs/models/components/observabilitylangfusedestinationtype.md new file mode 100644 index 00000000..87c20422 --- /dev/null +++ b/docs/models/components/observabilitylangfusedestinationtype.md @@ -0,0 +1,18 @@ +# ObservabilityLangfuseDestinationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ObservabilityLangfuseDestinationTypeLangfuse +``` + + +## Values + +| Name | Value | +| ---------------------------------------------- | ---------------------------------------------- | +| `ObservabilityLangfuseDestinationTypeLangfuse` | langfuse | \ No newline at end of file diff --git a/docs/models/components/observabilitylangsmithdestination.md b/docs/models/components/observabilitylangsmithdestination.md new file mode 100644 index 00000000..a1c8b04d --- /dev/null +++ b/docs/models/components/observabilitylangsmithdestination.md @@ -0,0 +1,19 @@ +# ObservabilityLangsmithDestination + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `Config` | [components.ObservabilityLangsmithDestinationConfig](../../models/components/observabilitylangsmithdestinationconfig.md) | :heavy_check_mark: | N/A | | +| `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | +| `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | +| `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | +| `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | +| `SamplingRate` | `float64` | :heavy_check_mark: | Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). | 1 | +| `Type` | [components.ObservabilityLangsmithDestinationType](../../models/components/observabilitylangsmithdestinationtype.md) | :heavy_check_mark: | N/A | | +| `UpdatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was last updated. | 2025-08-24T15:45:00Z | +| `WorkspaceID` | `string` | :heavy_check_mark: | ID of the workspace this destination belongs to. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/components/observabilitylangsmithdestinationconfig.md b/docs/models/components/observabilitylangsmithdestinationconfig.md new file mode 100644 index 00000000..9c72d284 --- /dev/null +++ b/docs/models/components/observabilitylangsmithdestinationconfig.md @@ -0,0 +1,12 @@ +# ObservabilityLangsmithDestinationConfig + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `APIKey` | `string` | :heavy_check_mark: | N/A | +| `Endpoint` | `*string` | :heavy_minus_sign: | N/A | +| `Headers` | map[string]`string` | :heavy_minus_sign: | Custom HTTP headers to include in requests to this destination. | +| `Project` | `*string` | :heavy_minus_sign: | The name for this project, such as pr-openrouter-demo. Defaults to "main" if not set. | +| `WorkspaceID` | `*string` | :heavy_minus_sign: | Required for org-scoped API keys. Find this in your LangSmith workspace settings. | \ No newline at end of file diff --git a/docs/models/components/observabilitylangsmithdestinationtype.md b/docs/models/components/observabilitylangsmithdestinationtype.md new file mode 100644 index 00000000..b973da3e --- /dev/null +++ b/docs/models/components/observabilitylangsmithdestinationtype.md @@ -0,0 +1,18 @@ +# ObservabilityLangsmithDestinationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ObservabilityLangsmithDestinationTypeLangsmith +``` + + +## Values + +| Name | Value | +| ------------------------------------------------ | ------------------------------------------------ | +| `ObservabilityLangsmithDestinationTypeLangsmith` | langsmith | \ No newline at end of file diff --git a/docs/models/components/observabilitynewrelicdestination.md b/docs/models/components/observabilitynewrelicdestination.md new file mode 100644 index 00000000..d89136a3 --- /dev/null +++ b/docs/models/components/observabilitynewrelicdestination.md @@ -0,0 +1,19 @@ +# ObservabilityNewrelicDestination + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `Config` | [components.ObservabilityNewrelicDestinationConfig](../../models/components/observabilitynewrelicdestinationconfig.md) | :heavy_check_mark: | N/A | | +| `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | +| `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | +| `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | +| `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | +| `SamplingRate` | `float64` | :heavy_check_mark: | Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). | 1 | +| `Type` | [components.ObservabilityNewrelicDestinationType](../../models/components/observabilitynewrelicdestinationtype.md) | :heavy_check_mark: | N/A | | +| `UpdatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was last updated. | 2025-08-24T15:45:00Z | +| `WorkspaceID` | `string` | :heavy_check_mark: | ID of the workspace this destination belongs to. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/components/observabilitynewrelicdestinationconfig.md b/docs/models/components/observabilitynewrelicdestinationconfig.md new file mode 100644 index 00000000..b70332a3 --- /dev/null +++ b/docs/models/components/observabilitynewrelicdestinationconfig.md @@ -0,0 +1,10 @@ +# ObservabilityNewrelicDestinationConfig + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `Headers` | map[string]`string` | :heavy_minus_sign: | Custom HTTP headers to include in requests to this destination. | +| `LicenseKey` | `string` | :heavy_check_mark: | N/A | +| `Region` | [*components.Region](../../models/components/region.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/observabilitynewrelicdestinationtype.md b/docs/models/components/observabilitynewrelicdestinationtype.md new file mode 100644 index 00000000..8e661d4a --- /dev/null +++ b/docs/models/components/observabilitynewrelicdestinationtype.md @@ -0,0 +1,18 @@ +# ObservabilityNewrelicDestinationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ObservabilityNewrelicDestinationTypeNewrelic +``` + + +## Values + +| Name | Value | +| ---------------------------------------------- | ---------------------------------------------- | +| `ObservabilityNewrelicDestinationTypeNewrelic` | newrelic | \ No newline at end of file diff --git a/docs/models/components/observabilityopikdestination.md b/docs/models/components/observabilityopikdestination.md new file mode 100644 index 00000000..648ed936 --- /dev/null +++ b/docs/models/components/observabilityopikdestination.md @@ -0,0 +1,19 @@ +# ObservabilityOpikDestination + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `Config` | [components.ObservabilityOpikDestinationConfig](../../models/components/observabilityopikdestinationconfig.md) | :heavy_check_mark: | N/A | | +| `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | +| `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | +| `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | +| `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | +| `SamplingRate` | `float64` | :heavy_check_mark: | Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). | 1 | +| `Type` | [components.ObservabilityOpikDestinationType](../../models/components/observabilityopikdestinationtype.md) | :heavy_check_mark: | N/A | | +| `UpdatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was last updated. | 2025-08-24T15:45:00Z | +| `WorkspaceID` | `string` | :heavy_check_mark: | ID of the workspace this destination belongs to. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/components/observabilityopikdestinationconfig.md b/docs/models/components/observabilityopikdestinationconfig.md new file mode 100644 index 00000000..9c340876 --- /dev/null +++ b/docs/models/components/observabilityopikdestinationconfig.md @@ -0,0 +1,11 @@ +# ObservabilityOpikDestinationConfig + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `APIKey` | `string` | :heavy_check_mark: | N/A | +| `Headers` | map[string]`string` | :heavy_minus_sign: | Custom HTTP headers to include in requests to this destination. | +| `ProjectName` | `string` | :heavy_check_mark: | N/A | +| `Workspace` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/observabilityopikdestinationtype.md b/docs/models/components/observabilityopikdestinationtype.md new file mode 100644 index 00000000..6e249d59 --- /dev/null +++ b/docs/models/components/observabilityopikdestinationtype.md @@ -0,0 +1,18 @@ +# ObservabilityOpikDestinationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ObservabilityOpikDestinationTypeOpik +``` + + +## Values + +| Name | Value | +| -------------------------------------- | -------------------------------------- | +| `ObservabilityOpikDestinationTypeOpik` | opik | \ No newline at end of file diff --git a/docs/models/components/observabilityotelcollectordestination.md b/docs/models/components/observabilityotelcollectordestination.md new file mode 100644 index 00000000..a36b3741 --- /dev/null +++ b/docs/models/components/observabilityotelcollectordestination.md @@ -0,0 +1,19 @@ +# ObservabilityOtelCollectorDestination + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `Config` | [components.ObservabilityOtelCollectorDestinationConfig](../../models/components/observabilityotelcollectordestinationconfig.md) | :heavy_check_mark: | N/A | | +| `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | +| `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | +| `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | +| `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | +| `SamplingRate` | `float64` | :heavy_check_mark: | Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). | 1 | +| `Type` | [components.ObservabilityOtelCollectorDestinationType](../../models/components/observabilityotelcollectordestinationtype.md) | :heavy_check_mark: | N/A | | +| `UpdatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was last updated. | 2025-08-24T15:45:00Z | +| `WorkspaceID` | `string` | :heavy_check_mark: | ID of the workspace this destination belongs to. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/components/observabilityotelcollectordestinationconfig.md b/docs/models/components/observabilityotelcollectordestinationconfig.md new file mode 100644 index 00000000..24efc61b --- /dev/null +++ b/docs/models/components/observabilityotelcollectordestinationconfig.md @@ -0,0 +1,9 @@ +# ObservabilityOtelCollectorDestinationConfig + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `Endpoint` | `string` | :heavy_check_mark: | N/A | +| `Headers` | map[string]`string` | :heavy_minus_sign: | Custom HTTP headers as a JSON object. For Axiom, use {"Authorization": "Bearer xaat-xxx", "X-Axiom-Dataset": "your-dataset"} | \ No newline at end of file diff --git a/docs/models/components/observabilityotelcollectordestinationtype.md b/docs/models/components/observabilityotelcollectordestinationtype.md new file mode 100644 index 00000000..b1c89d19 --- /dev/null +++ b/docs/models/components/observabilityotelcollectordestinationtype.md @@ -0,0 +1,18 @@ +# ObservabilityOtelCollectorDestinationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ObservabilityOtelCollectorDestinationTypeOtelCollector +``` + + +## Values + +| Name | Value | +| -------------------------------------------------------- | -------------------------------------------------------- | +| `ObservabilityOtelCollectorDestinationTypeOtelCollector` | otel-collector | \ No newline at end of file diff --git a/docs/models/components/observabilityposthogdestination.md b/docs/models/components/observabilityposthogdestination.md new file mode 100644 index 00000000..3dc1bfa7 --- /dev/null +++ b/docs/models/components/observabilityposthogdestination.md @@ -0,0 +1,19 @@ +# ObservabilityPosthogDestination + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `Config` | [components.ObservabilityPosthogDestinationConfig](../../models/components/observabilityposthogdestinationconfig.md) | :heavy_check_mark: | N/A | | +| `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | +| `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | +| `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | +| `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | +| `SamplingRate` | `float64` | :heavy_check_mark: | Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). | 1 | +| `Type` | [components.ObservabilityPosthogDestinationType](../../models/components/observabilityposthogdestinationtype.md) | :heavy_check_mark: | N/A | | +| `UpdatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was last updated. | 2025-08-24T15:45:00Z | +| `WorkspaceID` | `string` | :heavy_check_mark: | ID of the workspace this destination belongs to. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/components/observabilityposthogdestinationconfig.md b/docs/models/components/observabilityposthogdestinationconfig.md new file mode 100644 index 00000000..8d15b9d3 --- /dev/null +++ b/docs/models/components/observabilityposthogdestinationconfig.md @@ -0,0 +1,10 @@ +# ObservabilityPosthogDestinationConfig + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `APIKey` | `string` | :heavy_check_mark: | N/A | +| `Endpoint` | `*string` | :heavy_minus_sign: | N/A | +| `Headers` | map[string]`string` | :heavy_minus_sign: | Custom HTTP headers to include in requests to this destination. | \ No newline at end of file diff --git a/docs/models/components/observabilityposthogdestinationtype.md b/docs/models/components/observabilityposthogdestinationtype.md new file mode 100644 index 00000000..d3e82bdf --- /dev/null +++ b/docs/models/components/observabilityposthogdestinationtype.md @@ -0,0 +1,18 @@ +# ObservabilityPosthogDestinationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ObservabilityPosthogDestinationTypePosthog +``` + + +## Values + +| Name | Value | +| -------------------------------------------- | -------------------------------------------- | +| `ObservabilityPosthogDestinationTypePosthog` | posthog | \ No newline at end of file diff --git a/docs/models/components/observabilityrampdestination.md b/docs/models/components/observabilityrampdestination.md new file mode 100644 index 00000000..a4479d68 --- /dev/null +++ b/docs/models/components/observabilityrampdestination.md @@ -0,0 +1,19 @@ +# ObservabilityRampDestination + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `Config` | [components.ObservabilityRampDestinationConfig](../../models/components/observabilityrampdestinationconfig.md) | :heavy_check_mark: | N/A | | +| `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | +| `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | +| `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | +| `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | +| `SamplingRate` | `float64` | :heavy_check_mark: | Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). | 1 | +| `Type` | [components.ObservabilityRampDestinationType](../../models/components/observabilityrampdestinationtype.md) | :heavy_check_mark: | N/A | | +| `UpdatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was last updated. | 2025-08-24T15:45:00Z | +| `WorkspaceID` | `string` | :heavy_check_mark: | ID of the workspace this destination belongs to. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/components/observabilityrampdestinationconfig.md b/docs/models/components/observabilityrampdestinationconfig.md new file mode 100644 index 00000000..7025dbb3 --- /dev/null +++ b/docs/models/components/observabilityrampdestinationconfig.md @@ -0,0 +1,10 @@ +# ObservabilityRampDestinationConfig + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +| `APIKey` | `string` | :heavy_check_mark: | Generate this in your Ramp integration settings. | +| `BaseURL` | `*string` | :heavy_minus_sign: | N/A | +| `Headers` | map[string]`string` | :heavy_minus_sign: | Custom HTTP headers to include in requests to Ramp. | \ No newline at end of file diff --git a/docs/models/components/observabilityrampdestinationtype.md b/docs/models/components/observabilityrampdestinationtype.md new file mode 100644 index 00000000..391b1b24 --- /dev/null +++ b/docs/models/components/observabilityrampdestinationtype.md @@ -0,0 +1,18 @@ +# ObservabilityRampDestinationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ObservabilityRampDestinationTypeRamp +``` + + +## Values + +| Name | Value | +| -------------------------------------- | -------------------------------------- | +| `ObservabilityRampDestinationTypeRamp` | ramp | \ No newline at end of file diff --git a/docs/models/components/observabilitys3destination.md b/docs/models/components/observabilitys3destination.md new file mode 100644 index 00000000..979e99a1 --- /dev/null +++ b/docs/models/components/observabilitys3destination.md @@ -0,0 +1,19 @@ +# ObservabilityS3Destination + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `Config` | [components.ObservabilityS3DestinationConfig](../../models/components/observabilitys3destinationconfig.md) | :heavy_check_mark: | N/A | | +| `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | +| `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | +| `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | +| `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | +| `SamplingRate` | `float64` | :heavy_check_mark: | Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). | 1 | +| `Type` | [components.ObservabilityS3DestinationType](../../models/components/observabilitys3destinationtype.md) | :heavy_check_mark: | N/A | | +| `UpdatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was last updated. | 2025-08-24T15:45:00Z | +| `WorkspaceID` | `string` | :heavy_check_mark: | ID of the workspace this destination belongs to. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/components/observabilitys3destinationconfig.md b/docs/models/components/observabilitys3destinationconfig.md new file mode 100644 index 00000000..48423abd --- /dev/null +++ b/docs/models/components/observabilitys3destinationconfig.md @@ -0,0 +1,16 @@ +# ObservabilityS3DestinationConfig + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AccessKeyID` | `string` | :heavy_check_mark: | N/A | +| `BucketName` | `string` | :heavy_check_mark: | N/A | +| `Endpoint` | `*string` | :heavy_minus_sign: | Only for S3-compatible services like Cloudflare R2 (https://account-id.r2.cloudflarestorage.com) or MinIO. Leave blank for standard AWS S3. | +| `Headers` | map[string]`string` | :heavy_minus_sign: | Custom HTTP headers to include in requests to this destination. | +| `PathTemplate` | `*string` | :heavy_minus_sign: | Template for S3 object path. The filename ({traceId}-{timestamp}.json) is automatically appended. Available variables: {prefix}, {date}, {year}, {month}, {day}, {apiKeyName} | +| `Prefix` | `*string` | :heavy_minus_sign: | N/A | +| `Region` | `*string` | :heavy_minus_sign: | N/A | +| `SecretAccessKey` | `string` | :heavy_check_mark: | N/A | +| `SessionToken` | `*string` | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/observabilitys3destinationtype.md b/docs/models/components/observabilitys3destinationtype.md new file mode 100644 index 00000000..ac59cfec --- /dev/null +++ b/docs/models/components/observabilitys3destinationtype.md @@ -0,0 +1,18 @@ +# ObservabilityS3DestinationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ObservabilityS3DestinationTypeS3 +``` + + +## Values + +| Name | Value | +| ---------------------------------- | ---------------------------------- | +| `ObservabilityS3DestinationTypeS3` | s3 | \ No newline at end of file diff --git a/docs/models/components/observabilitysentrydestination.md b/docs/models/components/observabilitysentrydestination.md new file mode 100644 index 00000000..1b0ba3cf --- /dev/null +++ b/docs/models/components/observabilitysentrydestination.md @@ -0,0 +1,19 @@ +# ObservabilitySentryDestination + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `Config` | [components.ObservabilitySentryDestinationConfig](../../models/components/observabilitysentrydestinationconfig.md) | :heavy_check_mark: | N/A | | +| `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | +| `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | +| `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | +| `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | +| `SamplingRate` | `float64` | :heavy_check_mark: | Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). | 1 | +| `Type` | [components.ObservabilitySentryDestinationType](../../models/components/observabilitysentrydestinationtype.md) | :heavy_check_mark: | N/A | | +| `UpdatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was last updated. | 2025-08-24T15:45:00Z | +| `WorkspaceID` | `string` | :heavy_check_mark: | ID of the workspace this destination belongs to. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/components/observabilitysentrydestinationconfig.md b/docs/models/components/observabilitysentrydestinationconfig.md new file mode 100644 index 00000000..3dc6bf97 --- /dev/null +++ b/docs/models/components/observabilitysentrydestinationconfig.md @@ -0,0 +1,10 @@ +# ObservabilitySentryDestinationConfig + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `Dsn` | `string` | :heavy_check_mark: | N/A | +| `Headers` | map[string]`string` | :heavy_minus_sign: | Custom HTTP headers to include in requests to this destination. | +| `OtlpEndpoint` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/observabilitysentrydestinationtype.md b/docs/models/components/observabilitysentrydestinationtype.md new file mode 100644 index 00000000..5fdd8bab --- /dev/null +++ b/docs/models/components/observabilitysentrydestinationtype.md @@ -0,0 +1,18 @@ +# ObservabilitySentryDestinationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ObservabilitySentryDestinationTypeSentry +``` + + +## Values + +| Name | Value | +| ------------------------------------------ | ------------------------------------------ | +| `ObservabilitySentryDestinationTypeSentry` | sentry | \ No newline at end of file diff --git a/docs/models/components/observabilitysnowflakedestination.md b/docs/models/components/observabilitysnowflakedestination.md new file mode 100644 index 00000000..a7ecd0a2 --- /dev/null +++ b/docs/models/components/observabilitysnowflakedestination.md @@ -0,0 +1,19 @@ +# ObservabilitySnowflakeDestination + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `Config` | [components.ObservabilitySnowflakeDestinationConfig](../../models/components/observabilitysnowflakedestinationconfig.md) | :heavy_check_mark: | N/A | | +| `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | +| `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | +| `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | +| `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | +| `SamplingRate` | `float64` | :heavy_check_mark: | Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). | 1 | +| `Type` | [components.ObservabilitySnowflakeDestinationType](../../models/components/observabilitysnowflakedestinationtype.md) | :heavy_check_mark: | N/A | | +| `UpdatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was last updated. | 2025-08-24T15:45:00Z | +| `WorkspaceID` | `string` | :heavy_check_mark: | ID of the workspace this destination belongs to. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/components/observabilitysnowflakedestinationconfig.md b/docs/models/components/observabilitysnowflakedestinationconfig.md new file mode 100644 index 00000000..9c3fb52c --- /dev/null +++ b/docs/models/components/observabilitysnowflakedestinationconfig.md @@ -0,0 +1,14 @@ +# ObservabilitySnowflakeDestinationConfig + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `Account` | `string` | :heavy_check_mark: | N/A | +| `Database` | `*string` | :heavy_minus_sign: | N/A | +| `Headers` | map[string]`string` | :heavy_minus_sign: | Custom HTTP headers to include in requests to this destination. | +| `Schema` | `*string` | :heavy_minus_sign: | N/A | +| `Table` | `*string` | :heavy_minus_sign: | N/A | +| `Token` | `string` | :heavy_check_mark: | N/A | +| `Warehouse` | `*string` | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/observabilitysnowflakedestinationtype.md b/docs/models/components/observabilitysnowflakedestinationtype.md new file mode 100644 index 00000000..972b70f8 --- /dev/null +++ b/docs/models/components/observabilitysnowflakedestinationtype.md @@ -0,0 +1,18 @@ +# ObservabilitySnowflakeDestinationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ObservabilitySnowflakeDestinationTypeSnowflake +``` + + +## Values + +| Name | Value | +| ------------------------------------------------ | ------------------------------------------------ | +| `ObservabilitySnowflakeDestinationTypeSnowflake` | snowflake | \ No newline at end of file diff --git a/docs/models/components/observabilityweavedestination.md b/docs/models/components/observabilityweavedestination.md new file mode 100644 index 00000000..92ba6a9e --- /dev/null +++ b/docs/models/components/observabilityweavedestination.md @@ -0,0 +1,19 @@ +# ObservabilityWeaveDestination + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `Config` | [components.ObservabilityWeaveDestinationConfig](../../models/components/observabilityweavedestinationconfig.md) | :heavy_check_mark: | N/A | | +| `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | +| `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | +| `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | +| `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | +| `SamplingRate` | `float64` | :heavy_check_mark: | Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). | 1 | +| `Type` | [components.ObservabilityWeaveDestinationType](../../models/components/observabilityweavedestinationtype.md) | :heavy_check_mark: | N/A | | +| `UpdatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was last updated. | 2025-08-24T15:45:00Z | +| `WorkspaceID` | `string` | :heavy_check_mark: | ID of the workspace this destination belongs to. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/components/observabilityweavedestinationconfig.md b/docs/models/components/observabilityweavedestinationconfig.md new file mode 100644 index 00000000..4c8d47f1 --- /dev/null +++ b/docs/models/components/observabilityweavedestinationconfig.md @@ -0,0 +1,12 @@ +# ObservabilityWeaveDestinationConfig + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `APIKey` | `string` | :heavy_check_mark: | N/A | +| `BaseURL` | `*string` | :heavy_minus_sign: | N/A | +| `Entity` | `string` | :heavy_check_mark: | N/A | +| `Headers` | map[string]`string` | :heavy_minus_sign: | Custom HTTP headers to include in requests to this destination. | +| `Project` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/observabilityweavedestinationtype.md b/docs/models/components/observabilityweavedestinationtype.md new file mode 100644 index 00000000..0c0cfdbd --- /dev/null +++ b/docs/models/components/observabilityweavedestinationtype.md @@ -0,0 +1,18 @@ +# ObservabilityWeaveDestinationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ObservabilityWeaveDestinationTypeWeave +``` + + +## Values + +| Name | Value | +| ---------------------------------------- | ---------------------------------------- | +| `ObservabilityWeaveDestinationTypeWeave` | weave | \ No newline at end of file diff --git a/docs/models/components/observabilitywebhookdestination.md b/docs/models/components/observabilitywebhookdestination.md new file mode 100644 index 00000000..988bb009 --- /dev/null +++ b/docs/models/components/observabilitywebhookdestination.md @@ -0,0 +1,19 @@ +# ObservabilityWebhookDestination + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `APIKeyHashes` | []`string` | :heavy_check_mark: | Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. | null | +| `Config` | [components.ObservabilityWebhookDestinationConfig](../../models/components/observabilitywebhookdestinationconfig.md) | :heavy_check_mark: | N/A | | +| `CreatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was created. | 2025-08-24T10:30:00Z | +| `Enabled` | `bool` | :heavy_check_mark: | Whether this destination is currently enabled. | true | +| `FilterRules` | [*components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md) | :heavy_check_mark: | Optional structured filter rules controlling which events are forwarded. | null | +| `ID` | `string` | :heavy_check_mark: | Stable public identifier for this destination. | 99999999-aaaa-bbbb-cccc-dddddddddddd | +| `Name` | `*string` | :heavy_check_mark: | Human-readable name for the destination. | Production Langfuse | +| `PrivacyMode` | `bool` | :heavy_check_mark: | When true, request/response bodies are not forwarded to this destination — only metadata. | false | +| `SamplingRate` | `float64` | :heavy_check_mark: | Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). | 1 | +| `Type` | [components.ObservabilityWebhookDestinationType](../../models/components/observabilitywebhookdestinationtype.md) | :heavy_check_mark: | N/A | | +| `UpdatedAt` | `string` | :heavy_check_mark: | ISO timestamp of when the destination was last updated. | 2025-08-24T15:45:00Z | +| `WorkspaceID` | `string` | :heavy_check_mark: | ID of the workspace this destination belongs to. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/components/observabilitywebhookdestinationconfig.md b/docs/models/components/observabilitywebhookdestinationconfig.md new file mode 100644 index 00000000..38ebf13f --- /dev/null +++ b/docs/models/components/observabilitywebhookdestinationconfig.md @@ -0,0 +1,10 @@ +# ObservabilityWebhookDestinationConfig + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `Headers` | map[string]`string` | :heavy_minus_sign: | N/A | +| `Method` | [*components.Method](../../models/components/method.md) | :heavy_minus_sign: | N/A | +| `URL` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/observabilitywebhookdestinationtype.md b/docs/models/components/observabilitywebhookdestinationtype.md new file mode 100644 index 00000000..e9edf290 --- /dev/null +++ b/docs/models/components/observabilitywebhookdestinationtype.md @@ -0,0 +1,18 @@ +# ObservabilityWebhookDestinationType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ObservabilityWebhookDestinationTypeWebhook +``` + + +## Values + +| Name | Value | +| -------------------------------------------- | -------------------------------------------- | +| `ObservabilityWebhookDestinationTypeWebhook` | webhook | \ No newline at end of file diff --git a/docs/models/components/openairesponsecustomtoolcall.md b/docs/models/components/openairesponsecustomtoolcall.md new file mode 100644 index 00000000..2157d295 --- /dev/null +++ b/docs/models/components/openairesponsecustomtoolcall.md @@ -0,0 +1,13 @@ +# OpenAIResponseCustomToolCall + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `CallID` | `string` | :heavy_check_mark: | N/A | +| `ID` | `*string` | :heavy_minus_sign: | N/A | +| `Input` | `string` | :heavy_check_mark: | N/A | +| `Name` | `string` | :heavy_check_mark: | N/A | +| `Namespace` | `*string` | :heavy_minus_sign: | Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) | +| `Type` | [components.OpenAIResponseCustomToolCallType](../../models/components/openairesponsecustomtoolcalltype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/openairesponsecustomtoolcalloutput.md b/docs/models/components/openairesponsecustomtoolcalloutput.md new file mode 100644 index 00000000..35c86835 --- /dev/null +++ b/docs/models/components/openairesponsecustomtoolcalloutput.md @@ -0,0 +1,11 @@ +# OpenAIResponseCustomToolCallOutput + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `CallID` | `string` | :heavy_check_mark: | N/A | +| `ID` | `*string` | :heavy_minus_sign: | N/A | +| `Output` | [components.OpenAIResponseCustomToolCallOutputOutput2](../../models/components/openairesponsecustomtoolcalloutputoutput2.md) | :heavy_check_mark: | N/A | +| `Type` | [components.OpenAIResponseCustomToolCallOutputType](../../models/components/openairesponsecustomtoolcalloutputtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/openairesponsecustomtoolcalloutputoutput1.md b/docs/models/components/openairesponsecustomtoolcalloutputoutput1.md new file mode 100644 index 00000000..78cdec6c --- /dev/null +++ b/docs/models/components/openairesponsecustomtoolcalloutputoutput1.md @@ -0,0 +1,39 @@ +# OpenAIResponseCustomToolCallOutputOutput1 + + +## Supported Types + +### InputFile + +```go +openAIResponseCustomToolCallOutputOutput1 := components.CreateOpenAIResponseCustomToolCallOutputOutput1InputFile(components.InputFile{/* values here */}) +``` + +### InputImage + +```go +openAIResponseCustomToolCallOutputOutput1 := components.CreateOpenAIResponseCustomToolCallOutputOutput1InputImage(components.InputImage{/* values here */}) +``` + +### InputText + +```go +openAIResponseCustomToolCallOutputOutput1 := components.CreateOpenAIResponseCustomToolCallOutputOutput1InputText(components.InputText{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch openAIResponseCustomToolCallOutputOutput1.Type { + case components.OpenAIResponseCustomToolCallOutputOutput1TypeInputFile: + // openAIResponseCustomToolCallOutputOutput1.InputFile is populated + case components.OpenAIResponseCustomToolCallOutputOutput1TypeInputImage: + // openAIResponseCustomToolCallOutputOutput1.InputImage is populated + case components.OpenAIResponseCustomToolCallOutputOutput1TypeInputText: + // openAIResponseCustomToolCallOutputOutput1.InputText is populated + default: + // Unknown type - use openAIResponseCustomToolCallOutputOutput1.GetUnknownRaw() for raw JSON +} +``` diff --git a/docs/models/components/openairesponsecustomtoolcalloutputoutput2.md b/docs/models/components/openairesponsecustomtoolcalloutputoutput2.md new file mode 100644 index 00000000..518fc09b --- /dev/null +++ b/docs/models/components/openairesponsecustomtoolcalloutputoutput2.md @@ -0,0 +1,29 @@ +# OpenAIResponseCustomToolCallOutputOutput2 + + +## Supported Types + +### + +```go +openAIResponseCustomToolCallOutputOutput2 := components.CreateOpenAIResponseCustomToolCallOutputOutput2Str(string{/* values here */}) +``` + +### + +```go +openAIResponseCustomToolCallOutputOutput2 := components.CreateOpenAIResponseCustomToolCallOutputOutput2ArrayOfOpenAIResponseCustomToolCallOutputOutput1([]components.OpenAIResponseCustomToolCallOutputOutput1{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch openAIResponseCustomToolCallOutputOutput2.Type { + case components.OpenAIResponseCustomToolCallOutputOutput2TypeStr: + // openAIResponseCustomToolCallOutputOutput2.Str is populated + case components.OpenAIResponseCustomToolCallOutputOutput2TypeArrayOfOpenAIResponseCustomToolCallOutputOutput1: + // openAIResponseCustomToolCallOutputOutput2.ArrayOfOpenAIResponseCustomToolCallOutputOutput1 is populated +} +``` diff --git a/docs/models/components/openairesponsecustomtoolcalloutputtype.md b/docs/models/components/openairesponsecustomtoolcalloutputtype.md new file mode 100644 index 00000000..ab0c176e --- /dev/null +++ b/docs/models/components/openairesponsecustomtoolcalloutputtype.md @@ -0,0 +1,18 @@ +# OpenAIResponseCustomToolCallOutputType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.OpenAIResponseCustomToolCallOutputTypeCustomToolCallOutput +``` + + +## Values + +| Name | Value | +| ------------------------------------------------------------ | ------------------------------------------------------------ | +| `OpenAIResponseCustomToolCallOutputTypeCustomToolCallOutput` | custom_tool_call_output | \ No newline at end of file diff --git a/docs/models/components/openairesponsecustomtoolcalltype.md b/docs/models/components/openairesponsecustomtoolcalltype.md new file mode 100644 index 00000000..58ba1eb9 --- /dev/null +++ b/docs/models/components/openairesponsecustomtoolcalltype.md @@ -0,0 +1,18 @@ +# OpenAIResponseCustomToolCallType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.OpenAIResponseCustomToolCallTypeCustomToolCall +``` + + +## Values + +| Name | Value | +| ------------------------------------------------ | ------------------------------------------------ | +| `OpenAIResponseCustomToolCallTypeCustomToolCall` | custom_tool_call | \ No newline at end of file diff --git a/docs/models/components/openairesponsefunctiontoolcall.md b/docs/models/components/openairesponsefunctiontoolcall.md index 6130dc76..61779a91 100644 --- a/docs/models/components/openairesponsefunctiontoolcall.md +++ b/docs/models/components/openairesponsefunctiontoolcall.md @@ -9,5 +9,6 @@ | `CallID` | `string` | :heavy_check_mark: | N/A | | | `ID` | `*string` | :heavy_minus_sign: | N/A | | | `Name` | `string` | :heavy_check_mark: | N/A | | +| `Namespace` | `*string` | :heavy_minus_sign: | Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) | | | `Status` | [*components.ToolCallStatus](../../models/components/toolcallstatus.md) | :heavy_minus_sign: | N/A | completed | | `Type` | [components.OpenAIResponseFunctionToolCallType](../../models/components/openairesponsefunctiontoolcalltype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/openairesponsestoolchoiceapplypatch.md b/docs/models/components/openairesponsestoolchoiceapplypatch.md new file mode 100644 index 00000000..17d5c9ab --- /dev/null +++ b/docs/models/components/openairesponsestoolchoiceapplypatch.md @@ -0,0 +1,8 @@ +# OpenAIResponsesToolChoiceApplyPatch + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `Type` | [components.OpenAIResponsesToolChoiceTypeApplyPatch](../../models/components/openairesponsestoolchoicetypeapplypatch.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/openairesponsestoolchoiceshell.md b/docs/models/components/openairesponsestoolchoiceshell.md new file mode 100644 index 00000000..b006de91 --- /dev/null +++ b/docs/models/components/openairesponsestoolchoiceshell.md @@ -0,0 +1,8 @@ +# OpenAIResponsesToolChoiceShell + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `Type` | [components.OpenAIResponsesToolChoiceTypeShell](../../models/components/openairesponsestoolchoicetypeshell.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/openairesponsestoolchoicetypeapplypatch.md b/docs/models/components/openairesponsestoolchoicetypeapplypatch.md new file mode 100644 index 00000000..a87ba9ab --- /dev/null +++ b/docs/models/components/openairesponsestoolchoicetypeapplypatch.md @@ -0,0 +1,18 @@ +# OpenAIResponsesToolChoiceTypeApplyPatch + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.OpenAIResponsesToolChoiceTypeApplyPatchApplyPatch +``` + + +## Values + +| Name | Value | +| --------------------------------------------------- | --------------------------------------------------- | +| `OpenAIResponsesToolChoiceTypeApplyPatchApplyPatch` | apply_patch | \ No newline at end of file diff --git a/docs/models/components/openairesponsestoolchoicetypeshell.md b/docs/models/components/openairesponsestoolchoicetypeshell.md new file mode 100644 index 00000000..e24eeb52 --- /dev/null +++ b/docs/models/components/openairesponsestoolchoicetypeshell.md @@ -0,0 +1,18 @@ +# OpenAIResponsesToolChoiceTypeShell + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.OpenAIResponsesToolChoiceTypeShellShell +``` + + +## Values + +| Name | Value | +| ----------------------------------------- | ----------------------------------------- | +| `OpenAIResponsesToolChoiceTypeShellShell` | shell | \ No newline at end of file diff --git a/docs/models/components/openairesponsestoolchoiceunion.md b/docs/models/components/openairesponsestoolchoiceunion.md index ad95ca9a..3ffa5123 100644 --- a/docs/models/components/openairesponsestoolchoiceunion.md +++ b/docs/models/components/openairesponsestoolchoiceunion.md @@ -39,6 +39,18 @@ openAIResponsesToolChoiceUnion := components.CreateOpenAIResponsesToolChoiceUnio openAIResponsesToolChoiceUnion := components.CreateOpenAIResponsesToolChoiceUnionToolChoiceAllowed(components.ToolChoiceAllowed{/* values here */}) ``` +### OpenAIResponsesToolChoiceApplyPatch + +```go +openAIResponsesToolChoiceUnion := components.CreateOpenAIResponsesToolChoiceUnionOpenAIResponsesToolChoiceApplyPatch(components.OpenAIResponsesToolChoiceApplyPatch{/* values here */}) +``` + +### OpenAIResponsesToolChoiceShell + +```go +openAIResponsesToolChoiceUnion := components.CreateOpenAIResponsesToolChoiceUnionOpenAIResponsesToolChoiceShell(components.OpenAIResponsesToolChoiceShell{/* values here */}) +``` + ## Union Discrimination Use the `Type` field to determine which variant is active, then access the corresponding field: @@ -57,5 +69,9 @@ switch openAIResponsesToolChoiceUnion.Type { // openAIResponsesToolChoiceUnion.OpenAIResponsesToolChoice is populated case components.OpenAIResponsesToolChoiceUnionTypeToolChoiceAllowed: // openAIResponsesToolChoiceUnion.ToolChoiceAllowed is populated + case components.OpenAIResponsesToolChoiceUnionTypeOpenAIResponsesToolChoiceApplyPatch: + // openAIResponsesToolChoiceUnion.OpenAIResponsesToolChoiceApplyPatch is populated + case components.OpenAIResponsesToolChoiceUnionTypeOpenAIResponsesToolChoiceShell: + // openAIResponsesToolChoiceUnion.OpenAIResponsesToolChoiceShell is populated } ``` diff --git a/docs/models/components/openresponsesresult.md b/docs/models/components/openresponsesresult.md index 2d0bdc7c..954f4e70 100644 --- a/docs/models/components/openresponsesresult.md +++ b/docs/models/components/openresponsesresult.md @@ -40,4 +40,5 @@ Complete non-streaming response from the Responses API | `TopP` | `*float64` | :heavy_check_mark: | N/A | | | `Truncation` | optionalnullable.OptionalNullable[[components.Truncation](../../models/components/truncation.md)] | :heavy_minus_sign: | N/A | auto | | `Usage` | optionalnullable.OptionalNullable[[components.Usage](../../models/components/usage.md)] | :heavy_minus_sign: | Token usage information for the response | {
"cost": 0.0012,
"cost_details": {
"upstream_inference_cost": null,
"upstream_inference_input_cost": 0.0008,
"upstream_inference_output_cost": 0.0004
},
"input_tokens": 10,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 25,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 35
} | -| `User` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `User` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | | +| `OpenrouterMetadata` | [*components.OpenRouterMetadata](../../models/components/openroutermetadata.md) | :heavy_minus_sign: | N/A | {
"attempt": 1,
"endpoints": {
"available": [
{
"model": "openai/gpt-4o",
"provider": "OpenAI",
"selected": true
}
],
"total": 1
},
"is_byok": false,
"region": "iad",
"requested": "openai/gpt-4o",
"strategy": "direct",
"summary": "available=1, selected=OpenAI"
} | \ No newline at end of file diff --git a/docs/models/components/openroutermetadata.md b/docs/models/components/openroutermetadata.md new file mode 100644 index 00000000..d88e7699 --- /dev/null +++ b/docs/models/components/openroutermetadata.md @@ -0,0 +1,17 @@ +# OpenRouterMetadata + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `Attempt` | `int64` | :heavy_check_mark: | N/A | | +| `Attempts` | [][components.RouterAttempt](../../models/components/routerattempt.md) | :heavy_minus_sign: | N/A | | +| `Endpoints` | [components.EndpointsMetadata](../../models/components/endpointsmetadata.md) | :heavy_check_mark: | N/A | {
"available": [
{
"model": "openai/gpt-4o",
"provider": "OpenAI",
"selected": true
}
],
"total": 3
} | +| `IsByok` | `bool` | :heavy_check_mark: | N/A | | +| `Params` | [*components.RouterParams](../../models/components/routerparams.md) | :heavy_minus_sign: | N/A | {
"version_group": "anthropic/claude-sonnet-4"
} | +| `Pipeline` | [][components.PipelineStage](../../models/components/pipelinestage.md) | :heavy_minus_sign: | N/A | | +| `Region` | `*string` | :heavy_check_mark: | N/A | | +| `Requested` | `string` | :heavy_check_mark: | N/A | | +| `Strategy` | [components.RoutingStrategy](../../models/components/routingstrategy.md) | :heavy_check_mark: | N/A | direct | +| `Summary` | `string` | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/operator.md b/docs/models/components/operator.md new file mode 100644 index 00000000..3f5da38f --- /dev/null +++ b/docs/models/components/operator.md @@ -0,0 +1,33 @@ +# Operator + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.OperatorEquals + +// Open enum: custom values can be created with a direct type cast +custom := components.Operator("custom_value") +``` + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `OperatorEquals` | equals | +| `OperatorNotEquals` | not_equals | +| `OperatorContains` | contains | +| `OperatorNotContains` | not_contains | +| `OperatorRegex` | regex | +| `OperatorStartsWith` | starts_with | +| `OperatorEndsWith` | ends_with | +| `OperatorGt` | gt | +| `OperatorLt` | lt | +| `OperatorGte` | gte | +| `OperatorLte` | lte | +| `OperatorExists` | exists | +| `OperatorNotExists` | not_exists | \ No newline at end of file diff --git a/docs/models/components/speechrequestoptions.md b/docs/models/components/optionsobj.md similarity index 93% rename from docs/models/components/speechrequestoptions.md rename to docs/models/components/optionsobj.md index fb8888e3..685624c6 100644 --- a/docs/models/components/speechrequestoptions.md +++ b/docs/models/components/optionsobj.md @@ -1,4 +1,4 @@ -# SpeechRequestOptions +# OptionsObj Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. @@ -34,10 +34,14 @@ Provider-specific options keyed by provider slug. The options for the matched pr | `Cloudflare` | map[string]`any` | :heavy_minus_sign: | N/A | | `Cohere` | map[string]`any` | :heavy_minus_sign: | N/A | | `Crofai` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Crucible` | map[string]`any` | :heavy_minus_sign: | N/A | | `Crusoe` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Darkbloom` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Decart` | map[string]`any` | :heavy_minus_sign: | N/A | | `Deepinfra` | map[string]`any` | :heavy_minus_sign: | N/A | | `Deepseek` | map[string]`any` | :heavy_minus_sign: | N/A | | `Dekallm` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Digitalocean` | map[string]`any` | :heavy_minus_sign: | N/A | | `Enfer` | map[string]`any` | :heavy_minus_sign: | N/A | | `FakeProvider` | map[string]`any` | :heavy_minus_sign: | N/A | | `Featherless` | map[string]`any` | :heavy_minus_sign: | N/A | @@ -78,6 +82,7 @@ Provider-specific options keyed by provider slug. The options for the matched pr | `Morph` | map[string]`any` | :heavy_minus_sign: | N/A | | `Ncompass` | map[string]`any` | :heavy_minus_sign: | N/A | | `Nebius` | map[string]`any` | :heavy_minus_sign: | N/A | +| `NexAgi` | map[string]`any` | :heavy_minus_sign: | N/A | | `Nextbit` | map[string]`any` | :heavy_minus_sign: | N/A | | `Nineteen` | map[string]`any` | :heavy_minus_sign: | N/A | | `Novita` | map[string]`any` | :heavy_minus_sign: | N/A | @@ -86,8 +91,10 @@ Provider-specific options keyed by provider slug. The options for the matched pr | `OpenInference` | map[string]`any` | :heavy_minus_sign: | N/A | | `Openai` | map[string]`any` | :heavy_minus_sign: | N/A | | `Parasail` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Perceptron` | map[string]`any` | :heavy_minus_sign: | N/A | | `Perplexity` | map[string]`any` | :heavy_minus_sign: | N/A | | `Phala` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Poolside` | map[string]`any` | :heavy_minus_sign: | N/A | | `Recraft` | map[string]`any` | :heavy_minus_sign: | N/A | | `Recursal` | map[string]`any` | :heavy_minus_sign: | N/A | | `Reflection` | map[string]`any` | :heavy_minus_sign: | N/A | @@ -110,6 +117,7 @@ Provider-specific options keyed by provider slug. The options for the matched pr | `Ubicloud` | map[string]`any` | :heavy_minus_sign: | N/A | | `Upstage` | map[string]`any` | :heavy_minus_sign: | N/A | | `Venice` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Wafer` | map[string]`any` | :heavy_minus_sign: | N/A | | `Wandb` | map[string]`any` | :heavy_minus_sign: | N/A | | `Xai` | map[string]`any` | :heavy_minus_sign: | N/A | | `Xiaomi` | map[string]`any` | :heavy_minus_sign: | N/A | diff --git a/docs/models/components/outcome.md b/docs/models/components/outcome.md new file mode 100644 index 00000000..18e35fd0 --- /dev/null +++ b/docs/models/components/outcome.md @@ -0,0 +1,31 @@ +# Outcome + + +## Supported Types + +### OutcomeExit + +```go +outcome := components.CreateOutcomeExit(components.OutcomeExit{/* values here */}) +``` + +### OutcomeTimeout + +```go +outcome := components.CreateOutcomeTimeoutObj(components.OutcomeTimeout{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch outcome.Type { + case components.OutcomeTypeExit: + // outcome.OutcomeExit is populated + case components.OutcomeTypeTimeoutObj: + // outcome.OutcomeTimeout is populated + default: + // Unknown type - use outcome.GetUnknownRaw() for raw JSON +} +``` diff --git a/docs/models/components/outcomeexit.md b/docs/models/components/outcomeexit.md new file mode 100644 index 00000000..779978a9 --- /dev/null +++ b/docs/models/components/outcomeexit.md @@ -0,0 +1,9 @@ +# OutcomeExit + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `ExitCode` | `int64` | :heavy_check_mark: | N/A | +| `Type` | [components.TypeExit](../../models/components/typeexit.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/outcometimeout.md b/docs/models/components/outcometimeout.md new file mode 100644 index 00000000..1eae9d87 --- /dev/null +++ b/docs/models/components/outcometimeout.md @@ -0,0 +1,8 @@ +# OutcomeTimeout + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `Type` | [components.TypeTimeout](../../models/components/typetimeout.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/outputadvisorservertoolitem.md b/docs/models/components/outputadvisorservertoolitem.md new file mode 100644 index 00000000..ccf98129 --- /dev/null +++ b/docs/models/components/outputadvisorservertoolitem.md @@ -0,0 +1,17 @@ +# OutputAdvisorServerToolItem + +An openrouter:advisor server tool output item + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Advice` | `*string` | :heavy_minus_sign: | The advisor model's response (the advice text returned to the executor). | | +| `Error` | `*string` | :heavy_minus_sign: | Error message when the advisor call did not produce advice. | | +| `ID` | `*string` | :heavy_minus_sign: | N/A | | +| `InstanceName` | `*string` | :heavy_minus_sign: | Provider-safe function name of the specific advisor instance that produced this item (e.g. `openrouter_advisor__1`). Present only when more than one advisor tool is configured; omitted for the default single advisor. Echo this field back unchanged so the advisor's cross-request memory stays namespaced to the correct instance. This identity is positional: it is derived from the index of the advisor entry in the request `tools` array, so clients must keep the order of advisor tool entries stable across requests in a conversation. Reordering or inserting advisor entries shifts these names and causes each advisor's cross-request memory to be attributed to the wrong instance. | openrouter_advisor__1 | +| `Model` | `*string` | :heavy_minus_sign: | Slug of the advisor model that was consulted. | | +| `Prompt` | `*string` | :heavy_minus_sign: | The prompt the executor sent to the advisor. | | +| `Status` | [components.ToolCallStatus](../../models/components/toolcallstatus.md) | :heavy_check_mark: | N/A | completed | +| `Type` | [components.OutputAdvisorServerToolItemType](../../models/components/outputadvisorservertoolitemtype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/outputadvisorservertoolitemtype.md b/docs/models/components/outputadvisorservertoolitemtype.md new file mode 100644 index 00000000..6c6f41b3 --- /dev/null +++ b/docs/models/components/outputadvisorservertoolitemtype.md @@ -0,0 +1,18 @@ +# OutputAdvisorServerToolItemType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.OutputAdvisorServerToolItemTypeOpenrouterAdvisor +``` + + +## Values + +| Name | Value | +| -------------------------------------------------- | -------------------------------------------------- | +| `OutputAdvisorServerToolItemTypeOpenrouterAdvisor` | openrouter:advisor | \ No newline at end of file diff --git a/docs/models/components/outputapplypatchcallitem.md b/docs/models/components/outputapplypatchcallitem.md new file mode 100644 index 00000000..1f9390f7 --- /dev/null +++ b/docs/models/components/outputapplypatchcallitem.md @@ -0,0 +1,14 @@ +# OutputApplyPatchCallItem + +A native `apply_patch_call` output item matching OpenAI's Responses API shape. Emitted when the client requested the `apply_patch` shorthand. + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `CallID` | `string` | :heavy_check_mark: | N/A | | +| `ID` | `string` | :heavy_check_mark: | N/A | | +| `Operation` | [components.ApplyPatchCallOperation](../../models/components/applypatchcalloperation.md) | :heavy_check_mark: | The patch operation requested by an `apply_patch_call`. `create_file` and `update_file` carry a V4A diff; `delete_file` omits it. | {
"diff": "@@ function main() {\n+ console.log(\"hi\");\n }",
"path": "/src/main.ts",
"type": "update_file"
} | +| `Status` | [components.ApplyPatchCallStatus](../../models/components/applypatchcallstatus.md) | :heavy_check_mark: | Lifecycle state of an `apply_patch_call` output item. | completed | +| `Type` | [components.OutputApplyPatchCallItemType](../../models/components/outputapplypatchcallitemtype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/outputapplypatchcallitemtype.md b/docs/models/components/outputapplypatchcallitemtype.md new file mode 100644 index 00000000..f4adcd44 --- /dev/null +++ b/docs/models/components/outputapplypatchcallitemtype.md @@ -0,0 +1,18 @@ +# OutputApplyPatchCallItemType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.OutputApplyPatchCallItemTypeApplyPatchCall +``` + + +## Values + +| Name | Value | +| -------------------------------------------- | -------------------------------------------- | +| `OutputApplyPatchCallItemTypeApplyPatchCall` | apply_patch_call | \ No newline at end of file diff --git a/docs/models/components/outputapplypatchservertoolitem.md b/docs/models/components/outputapplypatchservertoolitem.md index a25a1392..f5caed23 100644 --- a/docs/models/components/outputapplypatchservertoolitem.md +++ b/docs/models/components/outputapplypatchservertoolitem.md @@ -1,14 +1,14 @@ # OutputApplyPatchServerToolItem -An openrouter:apply_patch server tool output item +An openrouter:apply_patch server tool output item. The turn halts when validation succeeds so the client can apply the patch and echo an `apply_patch_call_output` on the next turn. ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `FilePath` | `*string` | :heavy_minus_sign: | N/A | | -| `ID` | `*string` | :heavy_minus_sign: | N/A | | -| `Patch` | `*string` | :heavy_minus_sign: | N/A | | -| `Status` | [components.ToolCallStatus](../../models/components/toolcallstatus.md) | :heavy_check_mark: | N/A | completed | -| `Type` | [components.OutputApplyPatchServerToolItemType](../../models/components/outputapplypatchservertoolitemtype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `CallID` | `*string` | :heavy_minus_sign: | N/A | | +| `ID` | `*string` | :heavy_minus_sign: | N/A | | +| `Operation` | [*components.ApplyPatchCallOperation](../../models/components/applypatchcalloperation.md) | :heavy_minus_sign: | The patch operation requested by an `apply_patch_call`. `create_file` and `update_file` carry a V4A diff; `delete_file` omits it. | {
"diff": "@@ function main() {\n+ console.log(\"hi\");\n }",
"path": "/src/main.ts",
"type": "update_file"
} | +| `Status` | [components.ToolCallStatus](../../models/components/toolcallstatus.md) | :heavy_check_mark: | N/A | completed | +| `Type` | [components.OutputApplyPatchServerToolItemType](../../models/components/outputapplypatchservertoolitemtype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/outputcodeinterpretercallitemtypeimage.md b/docs/models/components/outputcodeinterpretercallitemtypeimage.md new file mode 100644 index 00000000..b9d19963 --- /dev/null +++ b/docs/models/components/outputcodeinterpretercallitemtypeimage.md @@ -0,0 +1,18 @@ +# OutputCodeInterpreterCallItemTypeImage + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.OutputCodeInterpreterCallItemTypeImageImage +``` + + +## Values + +| Name | Value | +| --------------------------------------------- | --------------------------------------------- | +| `OutputCodeInterpreterCallItemTypeImageImage` | image | \ No newline at end of file diff --git a/docs/models/components/outputcustomtoolcallitem.md b/docs/models/components/outputcustomtoolcallitem.md new file mode 100644 index 00000000..ab736afa --- /dev/null +++ b/docs/models/components/outputcustomtoolcallitem.md @@ -0,0 +1,15 @@ +# OutputCustomToolCallItem + +A call to a custom (freeform-grammar) tool created by the model — distinct from `function_call`. Used for tools like Codex CLI's `apply_patch` whose payload is opaque text rather than JSON arguments. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `CallID` | `string` | :heavy_check_mark: | N/A | +| `ID` | `*string` | :heavy_minus_sign: | N/A | +| `Input` | `string` | :heavy_check_mark: | N/A | +| `Name` | `string` | :heavy_check_mark: | N/A | +| `Namespace` | `*string` | :heavy_minus_sign: | Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) | +| `Type` | [components.OutputCustomToolCallItemType](../../models/components/outputcustomtoolcallitemtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/outputcustomtoolcallitemtype.md b/docs/models/components/outputcustomtoolcallitemtype.md new file mode 100644 index 00000000..d08a2d8d --- /dev/null +++ b/docs/models/components/outputcustomtoolcallitemtype.md @@ -0,0 +1,18 @@ +# OutputCustomToolCallItemType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.OutputCustomToolCallItemTypeCustomToolCall +``` + + +## Values + +| Name | Value | +| -------------------------------------------- | -------------------------------------------- | +| `OutputCustomToolCallItemTypeCustomToolCall` | custom_tool_call | \ No newline at end of file diff --git a/docs/models/components/outputfunctioncallitem.md b/docs/models/components/outputfunctioncallitem.md index 122f051d..111847f8 100644 --- a/docs/models/components/outputfunctioncallitem.md +++ b/docs/models/components/outputfunctioncallitem.md @@ -9,5 +9,6 @@ | `CallID` | `string` | :heavy_check_mark: | N/A | | `ID` | `*string` | :heavy_minus_sign: | N/A | | `Name` | `string` | :heavy_check_mark: | N/A | +| `Namespace` | `*string` | :heavy_minus_sign: | Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) | | `Status` | [*components.OutputFunctionCallItemStatusUnion](../../models/components/outputfunctioncallitemstatusunion.md) | :heavy_minus_sign: | N/A | | `Type` | [components.OutputFunctionCallItemType](../../models/components/outputfunctioncallitemtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/outputfusionservertoolitem.md b/docs/models/components/outputfusionservertoolitem.md new file mode 100644 index 00000000..be0896fd --- /dev/null +++ b/docs/models/components/outputfusionservertoolitem.md @@ -0,0 +1,17 @@ +# OutputFusionServerToolItem + +An openrouter:fusion server tool output item + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Analysis` | [*components.FusionAnalysisResult](../../models/components/fusionanalysisresult.md) | :heavy_minus_sign: | Structured analysis produced by the fusion judge model. | {
"blind_spots": [
"No model considered the impact on existing API consumers."
],
"consensus": [
"All panel models agree the request is asking for a concise summary."
],
"contradictions": [
{
"stances": [
{
"model": "openai/gpt-5",
"stance": "Favors an incremental rollout."
},
{
"model": "anthropic/claude-sonnet-4.5",
"stance": "Favors a single coordinated migration."
}
],
"topic": "Recommended approach"
}
],
"partial_coverage": [
{
"models": [
"openai/gpt-5"
],
"point": "Only one model addressed the rollback strategy."
}
],
"unique_insights": [
{
"insight": "Highlighted a backwards-compatibility risk the other models missed.",
"model": "anthropic/claude-sonnet-4.5"
}
]
} | +| `Error` | `*string` | :heavy_minus_sign: | Error message when the fusion run did not produce an analysis result. | | +| `FailedModels` | [][components.FailedModel](../../models/components/failedmodel.md) | :heavy_minus_sign: | Models that were requested as part of the analysis panel but did not produce a response. Present when at least one requested analysis model failed. The fusion result is still usable but was produced from a degraded panel. | | +| `FailureReason` | `*string` | :heavy_minus_sign: | Typed failure reason when the fusion run failed. Possible values include: all_panels_failed, insufficient_credits, rate_limited, judge_not_valid_json, judge_schema_mismatch, judge_upstream_error, judge_empty_completion. | | +| `ID` | `*string` | :heavy_minus_sign: | N/A | | +| `Responses` | [][components.Response](../../models/components/response.md) | :heavy_minus_sign: | Analysis models that produced a response in this fusion run, with each model's full panel content. | | +| `Status` | [components.ToolCallStatus](../../models/components/toolcallstatus.md) | :heavy_check_mark: | N/A | completed | +| `Type` | [components.OutputFusionServerToolItemType](../../models/components/outputfusionservertoolitemtype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/outputfusionservertoolitemtype.md b/docs/models/components/outputfusionservertoolitemtype.md new file mode 100644 index 00000000..00b7516e --- /dev/null +++ b/docs/models/components/outputfusionservertoolitemtype.md @@ -0,0 +1,18 @@ +# OutputFusionServerToolItemType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.OutputFusionServerToolItemTypeOpenrouterFusion +``` + + +## Values + +| Name | Value | +| ------------------------------------------------ | ------------------------------------------------ | +| `OutputFusionServerToolItemTypeOpenrouterFusion` | openrouter:fusion | \ No newline at end of file diff --git a/docs/models/components/outputimage.md b/docs/models/components/outputimage.md index b3f6fdf8..4cedac17 100644 --- a/docs/models/components/outputimage.md +++ b/docs/models/components/outputimage.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `Type` | [components.TypeImage](../../models/components/typeimage.md) | :heavy_check_mark: | N/A | -| `URL` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `Type` | [components.OutputCodeInterpreterCallItemTypeImage](../../models/components/outputcodeinterpretercallitemtypeimage.md) | :heavy_check_mark: | N/A | +| `URL` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/outputinputimage.md b/docs/models/components/outputinputimage.md deleted file mode 100644 index 8d034c77..00000000 --- a/docs/models/components/outputinputimage.md +++ /dev/null @@ -1,12 +0,0 @@ -# OutputInputImage - -Image input content item - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `Detail` | [components.FunctionCallOutputItemDetail](../../models/components/functioncalloutputitemdetail.md) | :heavy_check_mark: | N/A | -| `ImageURL` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | -| `Type` | [components.FunctionCallOutputItemOutputType](../../models/components/functioncalloutputitemoutputtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/outputitems.md b/docs/models/components/outputitems.md index be815183..c82b4bcd 100644 --- a/docs/models/components/outputitems.md +++ b/docs/models/components/outputitems.md @@ -5,6 +5,12 @@ An output item from the response ## Supported Types +### OutputApplyPatchCallItem + +```go +outputItems := components.CreateOutputItemsApplyPatchCall(components.OutputApplyPatchCallItem{/* values here */}) +``` + ### OutputCodeInterpreterCallItem ```go @@ -17,6 +23,12 @@ outputItems := components.CreateOutputItemsCodeInterpreterCall(components.Output outputItems := components.CreateOutputItemsComputerCall(components.OutputComputerCallItem{/* values here */}) ``` +### OutputCustomToolCallItem + +```go +outputItems := components.CreateOutputItemsCustomToolCall(components.OutputCustomToolCallItem{/* values here */}) +``` + ### OutputFileSearchCallItem ```go @@ -41,6 +53,12 @@ outputItems := components.CreateOutputItemsImageGenerationCall(components.Output outputItems := components.CreateOutputItemsMessage(components.OutputMessageItem{/* values here */}) ``` +### OutputAdvisorServerToolItem + +```go +outputItems := components.CreateOutputItemsOpenrouterAdvisor(components.OutputAdvisorServerToolItem{/* values here */}) +``` + ### OutputApplyPatchServerToolItem ```go @@ -83,6 +101,12 @@ outputItems := components.CreateOutputItemsOpenrouterExperimentalSearchModels(co outputItems := components.CreateOutputItemsOpenrouterFileSearch(components.OutputFileSearchServerToolItem{/* values here */}) ``` +### OutputFusionServerToolItem + +```go +outputItems := components.CreateOutputItemsOpenrouterFusion(components.OutputFusionServerToolItem{/* values here */}) +``` + ### OutputImageGenerationServerToolItem ```go @@ -101,6 +125,12 @@ outputItems := components.CreateOutputItemsOpenrouterMcp(components.OutputMcpSer outputItems := components.CreateOutputItemsOpenrouterMemory(components.OutputMemoryServerToolItem{/* values here */}) ``` +### OutputSubagentServerToolItem + +```go +outputItems := components.CreateOutputItemsOpenrouterSubagent(components.OutputSubagentServerToolItem{/* values here */}) +``` + ### OutputTextEditorServerToolItem ```go @@ -131,6 +161,18 @@ outputItems := components.CreateOutputItemsOpenrouterWebSearch(components.Output outputItems := components.CreateOutputItemsReasoning(components.OutputReasoningItem{/* values here */}) ``` +### OutputShellCallItem + +```go +outputItems := components.CreateOutputItemsShellCall(components.OutputShellCallItem{/* values here */}) +``` + +### OutputShellCallOutputItem + +```go +outputItems := components.CreateOutputItemsShellCallOutput(components.OutputShellCallOutputItem{/* values here */}) +``` + ### OutputWebSearchCallItem ```go @@ -143,10 +185,14 @@ Use the `Type` field to determine which variant is active, then access the corre ```go switch outputItems.Type { + case components.OutputItemsTypeApplyPatchCall: + // outputItems.OutputApplyPatchCallItem is populated case components.OutputItemsTypeCodeInterpreterCall: // outputItems.OutputCodeInterpreterCallItem is populated case components.OutputItemsTypeComputerCall: // outputItems.OutputComputerCallItem is populated + case components.OutputItemsTypeCustomToolCall: + // outputItems.OutputCustomToolCallItem is populated case components.OutputItemsTypeFileSearchCall: // outputItems.OutputFileSearchCallItem is populated case components.OutputItemsTypeFunctionCall: @@ -155,6 +201,8 @@ switch outputItems.Type { // outputItems.OutputImageGenerationCallItem is populated case components.OutputItemsTypeMessage: // outputItems.OutputMessageItem is populated + case components.OutputItemsTypeOpenrouterAdvisor: + // outputItems.OutputAdvisorServerToolItem is populated case components.OutputItemsTypeOpenrouterApplyPatch: // outputItems.OutputApplyPatchServerToolItem is populated case components.OutputItemsTypeOpenrouterBash: @@ -169,12 +217,16 @@ switch outputItems.Type { // outputItems.OutputSearchModelsServerToolItem is populated case components.OutputItemsTypeOpenrouterFileSearch: // outputItems.OutputFileSearchServerToolItem is populated + case components.OutputItemsTypeOpenrouterFusion: + // outputItems.OutputFusionServerToolItem is populated case components.OutputItemsTypeOpenrouterImageGeneration: // outputItems.OutputImageGenerationServerToolItem is populated case components.OutputItemsTypeOpenrouterMcp: // outputItems.OutputMcpServerToolItem is populated case components.OutputItemsTypeOpenrouterMemory: // outputItems.OutputMemoryServerToolItem is populated + case components.OutputItemsTypeOpenrouterSubagent: + // outputItems.OutputSubagentServerToolItem is populated case components.OutputItemsTypeOpenrouterTextEditor: // outputItems.OutputTextEditorServerToolItem is populated case components.OutputItemsTypeOpenrouterToolSearch: @@ -185,6 +237,10 @@ switch outputItems.Type { // outputItems.OutputWebSearchServerToolItem is populated case components.OutputItemsTypeReasoning: // outputItems.OutputReasoningItem is populated + case components.OutputItemsTypeShellCall: + // outputItems.OutputShellCallItem is populated + case components.OutputItemsTypeShellCallOutput: + // outputItems.OutputShellCallOutputItem is populated case components.OutputItemsTypeWebSearchCall: // outputItems.OutputWebSearchCallItem is populated default: diff --git a/docs/models/components/outputmodality.md b/docs/models/components/outputmodality.md index 60031d7d..445cb046 100644 --- a/docs/models/components/outputmodality.md +++ b/docs/models/components/outputmodality.md @@ -16,12 +16,13 @@ custom := components.OutputModality("custom_value") ## Values -| Name | Value | -| -------------------------- | -------------------------- | -| `OutputModalityText` | text | -| `OutputModalityImage` | image | -| `OutputModalityEmbeddings` | embeddings | -| `OutputModalityAudio` | audio | -| `OutputModalityVideo` | video | -| `OutputModalityRerank` | rerank | -| `OutputModalityTts` | tts | \ No newline at end of file +| Name | Value | +| ----------------------------- | ----------------------------- | +| `OutputModalityText` | text | +| `OutputModalityImage` | image | +| `OutputModalityEmbeddings` | embeddings | +| `OutputModalityAudio` | audio | +| `OutputModalityVideo` | video | +| `OutputModalityRerank` | rerank | +| `OutputModalitySpeech` | speech | +| `OutputModalityTranscription` | transcription | \ No newline at end of file diff --git a/docs/models/components/outputshellcallitem.md b/docs/models/components/outputshellcallitem.md new file mode 100644 index 00000000..50128889 --- /dev/null +++ b/docs/models/components/outputshellcallitem.md @@ -0,0 +1,14 @@ +# OutputShellCallItem + +A native `shell_call` output item matching OpenAI's Responses API shape. Emitted for the sandbox-backed `shell` tool. + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `Action` | [*components.OutputShellCallItemAction](../../models/components/outputshellcallitemaction.md) | :heavy_minus_sign: | N/A | | +| `CallID` | `string` | :heavy_check_mark: | N/A | | +| `ID` | `string` | :heavy_check_mark: | N/A | | +| `Status` | [components.ShellCallStatus](../../models/components/shellcallstatus.md) | :heavy_check_mark: | Status of a shell call or its output. | completed | +| `Type` | [components.OutputShellCallItemType](../../models/components/outputshellcallitemtype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/outputshellcallitemaction.md b/docs/models/components/outputshellcallitemaction.md new file mode 100644 index 00000000..07b589e2 --- /dev/null +++ b/docs/models/components/outputshellcallitemaction.md @@ -0,0 +1,10 @@ +# OutputShellCallItemAction + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Commands` | []`string` | :heavy_check_mark: | N/A | +| `MaxOutputLength` | `*int64` | :heavy_check_mark: | N/A | +| `TimeoutMs` | `*int64` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/outputshellcallitemtype.md b/docs/models/components/outputshellcallitemtype.md new file mode 100644 index 00000000..8ea342be --- /dev/null +++ b/docs/models/components/outputshellcallitemtype.md @@ -0,0 +1,18 @@ +# OutputShellCallItemType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.OutputShellCallItemTypeShellCall +``` + + +## Values + +| Name | Value | +| ---------------------------------- | ---------------------------------- | +| `OutputShellCallItemTypeShellCall` | shell_call | \ No newline at end of file diff --git a/docs/models/components/outputshellcalloutputitem.md b/docs/models/components/outputshellcalloutputitem.md new file mode 100644 index 00000000..9c0ae6ad --- /dev/null +++ b/docs/models/components/outputshellcalloutputitem.md @@ -0,0 +1,15 @@ +# OutputShellCallOutputItem + +A native `shell_call_output` item matching OpenAI's Responses API shape. Carries per-command stdout, stderr, and the exit/timeout outcome. + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `CallID` | `string` | :heavy_check_mark: | N/A | | +| `ID` | `string` | :heavy_check_mark: | N/A | | +| `MaxOutputLength` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | N/A | | +| `Output` | [][components.OutputShellCallOutputItemOutput](../../models/components/outputshellcalloutputitemoutput.md) | :heavy_check_mark: | N/A | | +| `Status` | [components.ShellCallStatus](../../models/components/shellcallstatus.md) | :heavy_check_mark: | Status of a shell call or its output. | completed | +| `Type` | [components.OutputShellCallOutputItemTypeShellCallOutput](../../models/components/outputshellcalloutputitemtypeshellcalloutput.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/outputshellcalloutputitemoutput.md b/docs/models/components/outputshellcalloutputitemoutput.md new file mode 100644 index 00000000..60318705 --- /dev/null +++ b/docs/models/components/outputshellcalloutputitemoutput.md @@ -0,0 +1,10 @@ +# OutputShellCallOutputItemOutput + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `Outcome` | [components.Outcome](../../models/components/outcome.md) | :heavy_check_mark: | N/A | +| `Stderr` | `string` | :heavy_check_mark: | N/A | +| `Stdout` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/outputshellcalloutputitemtypeshellcalloutput.md b/docs/models/components/outputshellcalloutputitemtypeshellcalloutput.md new file mode 100644 index 00000000..2fdfc96b --- /dev/null +++ b/docs/models/components/outputshellcalloutputitemtypeshellcalloutput.md @@ -0,0 +1,18 @@ +# OutputShellCallOutputItemTypeShellCallOutput + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.OutputShellCallOutputItemTypeShellCallOutputShellCallOutput +``` + + +## Values + +| Name | Value | +| ------------------------------------------------------------- | ------------------------------------------------------------- | +| `OutputShellCallOutputItemTypeShellCallOutputShellCallOutput` | shell_call_output | \ No newline at end of file diff --git a/docs/models/components/outputsubagentservertoolitem.md b/docs/models/components/outputsubagentservertoolitem.md new file mode 100644 index 00000000..937b61ee --- /dev/null +++ b/docs/models/components/outputsubagentservertoolitem.md @@ -0,0 +1,17 @@ +# OutputSubagentServerToolItem + +An openrouter:subagent server tool output item + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `Error` | `*string` | :heavy_minus_sign: | Error message when the subagent task did not produce an outcome. | | +| `ID` | `*string` | :heavy_minus_sign: | N/A | | +| `Model` | `*string` | :heavy_minus_sign: | Slug of the worker model that executed the task. | | +| `Outcome` | `*string` | :heavy_minus_sign: | The worker model's result (the outcome text returned to the delegating model). | | +| `Status` | [components.ToolCallStatus](../../models/components/toolcallstatus.md) | :heavy_check_mark: | N/A | completed | +| `TaskDescription` | `*string` | :heavy_minus_sign: | The task description the delegating model sent to the worker. | | +| `TaskName` | `*string` | :heavy_minus_sign: | The short task identifier the delegating model supplied. | | +| `Type` | [components.OutputSubagentServerToolItemType](../../models/components/outputsubagentservertoolitemtype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/outputsubagentservertoolitemtype.md b/docs/models/components/outputsubagentservertoolitemtype.md new file mode 100644 index 00000000..a38c4a26 --- /dev/null +++ b/docs/models/components/outputsubagentservertoolitemtype.md @@ -0,0 +1,18 @@ +# OutputSubagentServerToolItemType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.OutputSubagentServerToolItemTypeOpenrouterSubagent +``` + + +## Values + +| Name | Value | +| ---------------------------------------------------- | ---------------------------------------------------- | +| `OutputSubagentServerToolItemTypeOpenrouterSubagent` | openrouter:subagent | \ No newline at end of file diff --git a/docs/models/components/outputwebfetchservertoolitem.md b/docs/models/components/outputwebfetchservertoolitem.md index 81959064..2f854497 100644 --- a/docs/models/components/outputwebfetchservertoolitem.md +++ b/docs/models/components/outputwebfetchservertoolitem.md @@ -8,6 +8,8 @@ An openrouter:web_fetch server tool output item | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | | `Content` | `*string` | :heavy_minus_sign: | N/A | | +| `Error` | `*string` | :heavy_minus_sign: | The error message if the fetch failed. | | +| `HTTPStatus` | `*int64` | :heavy_minus_sign: | The HTTP status code returned by the upstream URL fetch. | | | `ID` | `*string` | :heavy_minus_sign: | N/A | | | `Status` | [components.ToolCallStatus](../../models/components/toolcallstatus.md) | :heavy_check_mark: | N/A | completed | | `Title` | `*string` | :heavy_minus_sign: | N/A | | diff --git a/docs/models/components/outputwebsearchcallitem.md b/docs/models/components/outputwebsearchcallitem.md index 7424cd91..458bcaad 100644 --- a/docs/models/components/outputwebsearchcallitem.md +++ b/docs/models/components/outputwebsearchcallitem.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `Action` | [components.Action](../../models/components/action.md) | :heavy_check_mark: | N/A | | +| `Action` | [*components.Action](../../models/components/action.md) | :heavy_minus_sign: | N/A | | | `ID` | `string` | :heavy_check_mark: | N/A | | | `Status` | [components.WebSearchStatus](../../models/components/websearchstatus.md) | :heavy_check_mark: | N/A | completed | | `Type` | [components.TypeWebSearchCall](../../models/components/typewebsearchcall.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/actionsearch.md b/docs/models/components/outputwebsearchcallitemactionsearch.md similarity index 91% rename from docs/models/components/actionsearch.md rename to docs/models/components/outputwebsearchcallitemactionsearch.md index 1a3bfae1..b4199c4d 100644 --- a/docs/models/components/actionsearch.md +++ b/docs/models/components/outputwebsearchcallitemactionsearch.md @@ -1,4 +1,4 @@ -# ActionSearch +# OutputWebSearchCallItemActionSearch ## Fields @@ -8,4 +8,4 @@ | `Queries` | []`string` | :heavy_minus_sign: | N/A | | `Query` | `string` | :heavy_check_mark: | N/A | | `Sources` | [][components.WebSearchSource](../../models/components/websearchsource.md) | :heavy_minus_sign: | N/A | -| `Type` | [components.TypeSearch](../../models/components/typesearch.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| `Type` | [components.ActionTypeSearch](../../models/components/actiontypesearch.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/outputwebsearchservertoolitem.md b/docs/models/components/outputwebsearchservertoolitem.md index ed91d836..e3423a42 100644 --- a/docs/models/components/outputwebsearchservertoolitem.md +++ b/docs/models/components/outputwebsearchservertoolitem.md @@ -5,8 +5,9 @@ An openrouter:web_search server tool output item ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `ID` | `*string` | :heavy_minus_sign: | N/A | | -| `Status` | [components.ToolCallStatus](../../models/components/toolcallstatus.md) | :heavy_check_mark: | N/A | completed | -| `Type` | [components.OutputWebSearchServerToolItemType](../../models/components/outputwebsearchservertoolitemtype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Action` | [*components.OutputWebSearchServerToolItemAction](../../models/components/outputwebsearchservertoolitemaction.md) | :heavy_minus_sign: | The search action performed, matching OpenAI web_search_call.action shape. Includes the query the model issued and optional source URLs returned by the search provider. | | +| `ID` | `*string` | :heavy_minus_sign: | N/A | | +| `Status` | [components.ToolCallStatus](../../models/components/toolcallstatus.md) | :heavy_check_mark: | N/A | completed | +| `Type` | [components.OutputWebSearchServerToolItemTypeOpenrouterWebSearch](../../models/components/outputwebsearchservertoolitemtypeopenrouterwebsearch.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/outputwebsearchservertoolitemaction.md b/docs/models/components/outputwebsearchservertoolitemaction.md new file mode 100644 index 00000000..e8c80927 --- /dev/null +++ b/docs/models/components/outputwebsearchservertoolitemaction.md @@ -0,0 +1,12 @@ +# OutputWebSearchServerToolItemAction + +The search action performed, matching OpenAI web_search_call.action shape. Includes the query the model issued and optional source URLs returned by the search provider. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `Query` | `string` | :heavy_check_mark: | N/A | +| `Sources` | [][components.OutputWebSearchServerToolItemSource](../../models/components/outputwebsearchservertoolitemsource.md) | :heavy_minus_sign: | N/A | +| `Type` | [components.OutputWebSearchServerToolItemTypeSearch](../../models/components/outputwebsearchservertoolitemtypesearch.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/outputwebsearchservertoolitemsource.md b/docs/models/components/outputwebsearchservertoolitemsource.md new file mode 100644 index 00000000..7b6a99a1 --- /dev/null +++ b/docs/models/components/outputwebsearchservertoolitemsource.md @@ -0,0 +1,9 @@ +# OutputWebSearchServerToolItemSource + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `Type` | [components.OutputWebSearchServerToolItemTypeURL](../../models/components/outputwebsearchservertoolitemtypeurl.md) | :heavy_check_mark: | N/A | +| `URL` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/outputwebsearchservertoolitemtypeopenrouterwebsearch.md b/docs/models/components/outputwebsearchservertoolitemtypeopenrouterwebsearch.md new file mode 100644 index 00000000..94ba8767 --- /dev/null +++ b/docs/models/components/outputwebsearchservertoolitemtypeopenrouterwebsearch.md @@ -0,0 +1,18 @@ +# OutputWebSearchServerToolItemTypeOpenrouterWebSearch + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.OutputWebSearchServerToolItemTypeOpenrouterWebSearchOpenrouterWebSearch +``` + + +## Values + +| Name | Value | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `OutputWebSearchServerToolItemTypeOpenrouterWebSearchOpenrouterWebSearch` | openrouter:web_search | \ No newline at end of file diff --git a/docs/models/components/outputwebsearchservertoolitemtypesearch.md b/docs/models/components/outputwebsearchservertoolitemtypesearch.md new file mode 100644 index 00000000..44a8eb94 --- /dev/null +++ b/docs/models/components/outputwebsearchservertoolitemtypesearch.md @@ -0,0 +1,18 @@ +# OutputWebSearchServerToolItemTypeSearch + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.OutputWebSearchServerToolItemTypeSearchSearch +``` + + +## Values + +| Name | Value | +| ----------------------------------------------- | ----------------------------------------------- | +| `OutputWebSearchServerToolItemTypeSearchSearch` | search | \ No newline at end of file diff --git a/docs/models/components/outputwebsearchservertoolitemtypeurl.md b/docs/models/components/outputwebsearchservertoolitemtypeurl.md new file mode 100644 index 00000000..2f1ebc8a --- /dev/null +++ b/docs/models/components/outputwebsearchservertoolitemtypeurl.md @@ -0,0 +1,18 @@ +# OutputWebSearchServerToolItemTypeURL + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.OutputWebSearchServerToolItemTypeURLURL +``` + + +## Values + +| Name | Value | +| ----------------------------------------- | ----------------------------------------- | +| `OutputWebSearchServerToolItemTypeURLURL` | url | \ No newline at end of file diff --git a/docs/models/components/parameters.md b/docs/models/components/parameters.md deleted file mode 100644 index e3c6c80c..00000000 --- a/docs/models/components/parameters.md +++ /dev/null @@ -1,9 +0,0 @@ -# Parameters - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. | 5 | -| `MaxTotalResults` | `*int64` | :heavy_minus_sign: | Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. | 20 | \ No newline at end of file diff --git a/docs/models/components/partialcoverage.md b/docs/models/components/partialcoverage.md new file mode 100644 index 00000000..0256d6e8 --- /dev/null +++ b/docs/models/components/partialcoverage.md @@ -0,0 +1,9 @@ +# PartialCoverage + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Models` | []`string` | :heavy_check_mark: | N/A | +| `Point` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/pipelinestage.md b/docs/models/components/pipelinestage.md new file mode 100644 index 00000000..3eb50a2a --- /dev/null +++ b/docs/models/components/pipelinestage.md @@ -0,0 +1,14 @@ +# PipelineStage + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `CostUsd` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | N/A | | +| `Data` | map[string]`any` | :heavy_minus_sign: | N/A | | +| `GuardrailID` | `*string` | :heavy_minus_sign: | N/A | | +| `GuardrailScope` | `*string` | :heavy_minus_sign: | N/A | | +| `Name` | `string` | :heavy_check_mark: | N/A | | +| `Summary` | `*string` | :heavy_minus_sign: | N/A | | +| `Type` | [components.PipelineStageType](../../models/components/pipelinestagetype.md) | :heavy_check_mark: | Categorical kind of a pipeline stage. Multiple plugins can share a type (e.g. all guardrail-level plugins emit `guardrail`); the `name` field disambiguates which plugin emitted it. | guardrail | \ No newline at end of file diff --git a/docs/models/components/pipelinestagetype.md b/docs/models/components/pipelinestagetype.md new file mode 100644 index 00000000..49d9a63a --- /dev/null +++ b/docs/models/components/pipelinestagetype.md @@ -0,0 +1,27 @@ +# PipelineStageType + +Categorical kind of a pipeline stage. Multiple plugins can share a type (e.g. all guardrail-level plugins emit `guardrail`); the `name` field disambiguates which plugin emitted it. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.PipelineStageTypeGuardrail + +// Open enum: custom values can be created with a direct type cast +custom := components.PipelineStageType("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------------------- | ------------------------------------- | +| `PipelineStageTypeGuardrail` | guardrail | +| `PipelineStageTypePlugin` | plugin | +| `PipelineStageTypeServerTools` | server_tools | +| `PipelineStageTypeResponseHealing` | response_healing | +| `PipelineStageTypeContextCompression` | context_compression | \ No newline at end of file diff --git a/docs/models/components/preset.md b/docs/models/components/preset.md new file mode 100644 index 00000000..c5963f26 --- /dev/null +++ b/docs/models/components/preset.md @@ -0,0 +1,20 @@ +# Preset + +A preset without version details. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `CreatedAt` | `string` | :heavy_check_mark: | N/A | | +| `CreatorUserID` | `*string` | :heavy_check_mark: | N/A | | +| `Description` | `*string` | :heavy_check_mark: | N/A | | +| `DesignatedVersionID` | `*string` | :heavy_check_mark: | N/A | | +| `ID` | `string` | :heavy_check_mark: | N/A | | +| `Name` | `string` | :heavy_check_mark: | N/A | | +| `Slug` | `string` | :heavy_check_mark: | N/A | | +| `Status` | [components.PresetStatus](../../models/components/presetstatus.md) | :heavy_check_mark: | The status of a preset. | active | +| `StatusUpdatedAt` | `*string` | :heavy_check_mark: | N/A | | +| `UpdatedAt` | `string` | :heavy_check_mark: | N/A | | +| `WorkspaceID` | `*string` | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/presetdesignatedversion.md b/docs/models/components/presetdesignatedversion.md new file mode 100644 index 00000000..0b52d2be --- /dev/null +++ b/docs/models/components/presetdesignatedversion.md @@ -0,0 +1,17 @@ +# PresetDesignatedVersion + +A specific version of a preset, containing config and optional system prompt. + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Config` | map[string]`any` | :heavy_check_mark: | N/A | +| `CreatedAt` | `string` | :heavy_check_mark: | N/A | +| `CreatorID` | `string` | :heavy_check_mark: | N/A | +| `ID` | `string` | :heavy_check_mark: | N/A | +| `PresetID` | `string` | :heavy_check_mark: | N/A | +| `SystemPrompt` | `*string` | :heavy_check_mark: | N/A | +| `UpdatedAt` | `string` | :heavy_check_mark: | N/A | +| `Version` | `int64` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/presetstatus.md b/docs/models/components/presetstatus.md new file mode 100644 index 00000000..11b7feca --- /dev/null +++ b/docs/models/components/presetstatus.md @@ -0,0 +1,25 @@ +# PresetStatus + +The status of a preset. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.PresetStatusActive + +// Open enum: custom values can be created with a direct type cast +custom := components.PresetStatus("custom_value") +``` + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `PresetStatusActive` | active | +| `PresetStatusDisabled` | disabled | +| `PresetStatusArchived` | archived | \ No newline at end of file diff --git a/docs/models/components/presetwithdesignatedversion.md b/docs/models/components/presetwithdesignatedversion.md new file mode 100644 index 00000000..3671689a --- /dev/null +++ b/docs/models/components/presetwithdesignatedversion.md @@ -0,0 +1,21 @@ +# PresetWithDesignatedVersion + +A preset with its currently designated version. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CreatedAt` | `string` | :heavy_check_mark: | N/A | | +| `CreatorUserID` | `*string` | :heavy_check_mark: | N/A | | +| `Description` | `*string` | :heavy_check_mark: | N/A | | +| `DesignatedVersionID` | `*string` | :heavy_check_mark: | N/A | | +| `ID` | `string` | :heavy_check_mark: | N/A | | +| `Name` | `string` | :heavy_check_mark: | N/A | | +| `Slug` | `string` | :heavy_check_mark: | N/A | | +| `Status` | [components.PresetStatus](../../models/components/presetstatus.md) | :heavy_check_mark: | The status of a preset. | active | +| `StatusUpdatedAt` | `*string` | :heavy_check_mark: | N/A | | +| `UpdatedAt` | `string` | :heavy_check_mark: | N/A | | +| `WorkspaceID` | `*string` | :heavy_check_mark: | N/A | | +| `DesignatedVersion` | [*components.PresetDesignatedVersion](../../models/components/presetdesignatedversion.md) | :heavy_check_mark: | A specific version of a preset, containing config and optional system prompt. | {
"config": {
"model": "openai/gpt-4o",
"temperature": 0.7
},
"created_at": "2026-04-20T10:00:00Z",
"creator_id": "user_2dHFtVWx2n56w6HkM0000000000",
"id": "550e8400-e29b-41d4-a716-446655440000",
"preset_id": "650e8400-e29b-41d4-a716-446655440001",
"system_prompt": "You are a helpful assistant.",
"updated_at": "2026-04-20T10:00:00Z",
"version": 1
} | \ No newline at end of file diff --git a/docs/models/components/preview20250311websearchservertool.md b/docs/models/components/preview20250311websearchservertool.md index 50fd35a6..4754cf55 100644 --- a/docs/models/components/preview20250311websearchservertool.md +++ b/docs/models/components/preview20250311websearchservertool.md @@ -5,11 +5,11 @@ Web search preview tool configuration (2025-03-11 version) ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Engine` | [*components.WebSearchEngineEnum](../../models/components/websearchengineenum.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. | auto | -| `Filters` | optionalnullable.OptionalNullable[[components.WebSearchDomainFilter](../../models/components/websearchdomainfilter.md)] | :heavy_minus_sign: | N/A | {
"allowed_domains": [
"example.com"
],
"excluded_domains": [
"spam.com"
]
} | -| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and Parallel engines; ignored with native provider search. | 5 | -| `SearchContextSize` | [*components.SearchContextSizeEnum](../../models/components/searchcontextsizeenum.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | -| `Type` | [components.Preview20250311WebSearchServerToolType](../../models/components/preview20250311websearchservertooltype.md) | :heavy_check_mark: | N/A | | -| `UserLocation` | optionalnullable.OptionalNullable[[components.PreviewWebSearchUserLocation](../../models/components/previewwebsearchuserlocation.md)] | :heavy_minus_sign: | N/A | {
"city": "San Francisco",
"country": "USA",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Engine` | [*components.WebSearchEngineEnum](../../models/components/websearchengineenum.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). | auto | +| `Filters` | optionalnullable.OptionalNullable[[components.WebSearchDomainFilter](../../models/components/websearchdomainfilter.md)] | :heavy_minus_sign: | N/A | {
"allowed_domains": [
"example.com"
],
"excluded_domains": [
"spam.com"
]
} | +| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. | 5 | +| `SearchContextSize` | [*components.SearchContextSizeEnum](../../models/components/searchcontextsizeenum.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | +| `Type` | [components.Preview20250311WebSearchServerToolType](../../models/components/preview20250311websearchservertooltype.md) | :heavy_check_mark: | N/A | | +| `UserLocation` | optionalnullable.OptionalNullable[[components.PreviewWebSearchUserLocation](../../models/components/previewwebsearchuserlocation.md)] | :heavy_minus_sign: | N/A | {
"city": "San Francisco",
"country": "USA",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file diff --git a/docs/models/components/previewwebsearchservertool.md b/docs/models/components/previewwebsearchservertool.md index ff81696a..324f28b9 100644 --- a/docs/models/components/previewwebsearchservertool.md +++ b/docs/models/components/previewwebsearchservertool.md @@ -5,11 +5,11 @@ Web search preview tool configuration ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Engine` | [*components.WebSearchEngineEnum](../../models/components/websearchengineenum.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. | auto | -| `Filters` | optionalnullable.OptionalNullable[[components.WebSearchDomainFilter](../../models/components/websearchdomainfilter.md)] | :heavy_minus_sign: | N/A | {
"allowed_domains": [
"example.com"
],
"excluded_domains": [
"spam.com"
]
} | -| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and Parallel engines; ignored with native provider search. | 5 | -| `SearchContextSize` | [*components.SearchContextSizeEnum](../../models/components/searchcontextsizeenum.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | -| `Type` | [components.PreviewWebSearchServerToolType](../../models/components/previewwebsearchservertooltype.md) | :heavy_check_mark: | N/A | | -| `UserLocation` | optionalnullable.OptionalNullable[[components.PreviewWebSearchUserLocation](../../models/components/previewwebsearchuserlocation.md)] | :heavy_minus_sign: | N/A | {
"city": "San Francisco",
"country": "USA",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Engine` | [*components.WebSearchEngineEnum](../../models/components/websearchengineenum.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). | auto | +| `Filters` | optionalnullable.OptionalNullable[[components.WebSearchDomainFilter](../../models/components/websearchdomainfilter.md)] | :heavy_minus_sign: | N/A | {
"allowed_domains": [
"example.com"
],
"excluded_domains": [
"spam.com"
]
} | +| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. | 5 | +| `SearchContextSize` | [*components.SearchContextSizeEnum](../../models/components/searchcontextsizeenum.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | +| `Type` | [components.PreviewWebSearchServerToolType](../../models/components/previewwebsearchservertooltype.md) | :heavy_check_mark: | N/A | | +| `UserLocation` | optionalnullable.OptionalNullable[[components.PreviewWebSearchUserLocation](../../models/components/previewwebsearchuserlocation.md)] | :heavy_minus_sign: | N/A | {
"city": "San Francisco",
"country": "USA",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file diff --git a/docs/models/components/promptinjectionscanscope.md b/docs/models/components/promptinjectionscanscope.md new file mode 100644 index 00000000..3e852eb8 --- /dev/null +++ b/docs/models/components/promptinjectionscanscope.md @@ -0,0 +1,24 @@ +# PromptInjectionScanScope + +Which message roles to scan for prompt injection. Only applies to the regex-prompt-injection builtin. Defaults to all_messages. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.PromptInjectionScanScopeUserOnly + +// Open enum: custom values can be created with a direct type cast +custom := components.PromptInjectionScanScope("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------------------- | ------------------------------------- | +| `PromptInjectionScanScopeUserOnly` | user_only | +| `PromptInjectionScanScopeAllMessages` | all_messages | \ No newline at end of file diff --git a/docs/models/components/providername.md b/docs/models/components/providername.md index 8a121c3a..f881f951 100644 --- a/docs/models/components/providername.md +++ b/docs/models/components/providername.md @@ -40,10 +40,14 @@ custom := components.ProviderName("custom_value") | `ProviderNameClarifai` | Clarifai | | `ProviderNameCloudflare` | Cloudflare | | `ProviderNameCohere` | Cohere | +| `ProviderNameCrucible` | Crucible | | `ProviderNameCrusoe` | Crusoe | +| `ProviderNameDarkbloom` | Darkbloom | +| `ProviderNameDecart` | Decart | | `ProviderNameDeepInfra` | DeepInfra | | `ProviderNameDeepSeek` | DeepSeek | | `ProviderNameDekaLlm` | DekaLLM | +| `ProviderNameDigitalOcean` | DigitalOcean | | `ProviderNameFeatherless` | Featherless | | `ProviderNameFireworks` | Fireworks | | `ProviderNameFriendli` | Friendli | @@ -51,7 +55,6 @@ custom := components.ProviderName("custom_value") | `ProviderNameGoogle` | Google | | `ProviderNameGoogleAiStudio` | Google AI Studio | | `ProviderNameGroq` | Groq | -| `ProviderNameHyperbolic` | Hyperbolic | | `ProviderNameInception` | Inception | | `ProviderNameInceptron` | Inceptron | | `ProviderNameInferenceNet` | InferenceNet | @@ -70,12 +73,15 @@ custom := components.ProviderName("custom_value") | `ProviderNameMorph` | Morph | | `ProviderNameNCompass` | NCompass | | `ProviderNameNebius` | Nebius | +| `ProviderNameNexAgi` | Nex AGI | | `ProviderNameNextBit` | NextBit | | `ProviderNameNovita` | Novita | | `ProviderNameNvidia` | Nvidia | | `ProviderNameOpenAi` | OpenAI | | `ProviderNameOpenInference` | OpenInference | | `ProviderNameParasail` | Parasail | +| `ProviderNamePoolside` | Poolside | +| `ProviderNamePerceptron` | Perceptron | | `ProviderNamePerplexity` | Perplexity | | `ProviderNamePhala` | Phala | | `ProviderNameRecraft` | Recraft | @@ -92,6 +98,7 @@ custom := components.ProviderName("custom_value") | `ProviderNameTogether` | Together | | `ProviderNameUpstage` | Upstage | | `ProviderNameVenice` | Venice | +| `ProviderNameWafer` | Wafer | | `ProviderNameWandB` | WandB | | `ProviderNameXiaomi` | Xiaomi | | `ProviderNameXAi` | xAI | diff --git a/docs/models/components/videogenerationrequestoptions.md b/docs/models/components/provideroptions.md similarity index 93% rename from docs/models/components/videogenerationrequestoptions.md rename to docs/models/components/provideroptions.md index 0603e740..e27a7066 100644 --- a/docs/models/components/videogenerationrequestoptions.md +++ b/docs/models/components/provideroptions.md @@ -1,4 +1,4 @@ -# VideoGenerationRequestOptions +# ProviderOptions Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. @@ -34,10 +34,14 @@ Provider-specific options keyed by provider slug. The options for the matched pr | `Cloudflare` | map[string]`any` | :heavy_minus_sign: | N/A | | `Cohere` | map[string]`any` | :heavy_minus_sign: | N/A | | `Crofai` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Crucible` | map[string]`any` | :heavy_minus_sign: | N/A | | `Crusoe` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Darkbloom` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Decart` | map[string]`any` | :heavy_minus_sign: | N/A | | `Deepinfra` | map[string]`any` | :heavy_minus_sign: | N/A | | `Deepseek` | map[string]`any` | :heavy_minus_sign: | N/A | | `Dekallm` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Digitalocean` | map[string]`any` | :heavy_minus_sign: | N/A | | `Enfer` | map[string]`any` | :heavy_minus_sign: | N/A | | `FakeProvider` | map[string]`any` | :heavy_minus_sign: | N/A | | `Featherless` | map[string]`any` | :heavy_minus_sign: | N/A | @@ -78,6 +82,7 @@ Provider-specific options keyed by provider slug. The options for the matched pr | `Morph` | map[string]`any` | :heavy_minus_sign: | N/A | | `Ncompass` | map[string]`any` | :heavy_minus_sign: | N/A | | `Nebius` | map[string]`any` | :heavy_minus_sign: | N/A | +| `NexAgi` | map[string]`any` | :heavy_minus_sign: | N/A | | `Nextbit` | map[string]`any` | :heavy_minus_sign: | N/A | | `Nineteen` | map[string]`any` | :heavy_minus_sign: | N/A | | `Novita` | map[string]`any` | :heavy_minus_sign: | N/A | @@ -86,8 +91,10 @@ Provider-specific options keyed by provider slug. The options for the matched pr | `OpenInference` | map[string]`any` | :heavy_minus_sign: | N/A | | `Openai` | map[string]`any` | :heavy_minus_sign: | N/A | | `Parasail` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Perceptron` | map[string]`any` | :heavy_minus_sign: | N/A | | `Perplexity` | map[string]`any` | :heavy_minus_sign: | N/A | | `Phala` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Poolside` | map[string]`any` | :heavy_minus_sign: | N/A | | `Recraft` | map[string]`any` | :heavy_minus_sign: | N/A | | `Recursal` | map[string]`any` | :heavy_minus_sign: | N/A | | `Reflection` | map[string]`any` | :heavy_minus_sign: | N/A | @@ -110,6 +117,7 @@ Provider-specific options keyed by provider slug. The options for the matched pr | `Ubicloud` | map[string]`any` | :heavy_minus_sign: | N/A | | `Upstage` | map[string]`any` | :heavy_minus_sign: | N/A | | `Venice` | map[string]`any` | :heavy_minus_sign: | N/A | +| `Wafer` | map[string]`any` | :heavy_minus_sign: | N/A | | `Wandb` | map[string]`any` | :heavy_minus_sign: | N/A | | `Xai` | map[string]`any` | :heavy_minus_sign: | N/A | | `Xiaomi` | map[string]`any` | :heavy_minus_sign: | N/A | diff --git a/docs/models/components/providerresponse.md b/docs/models/components/providerresponse.md index 879fc60c..27c027bf 100644 --- a/docs/models/components/providerresponse.md +++ b/docs/models/components/providerresponse.md @@ -13,4 +13,4 @@ Details of a provider response for a generation attempt | `Latency` | `*float64` | :heavy_minus_sign: | Response latency in milliseconds | 1200 | | `ModelPermaslug` | `*string` | :heavy_minus_sign: | Canonical model slug | openai/gpt-4 | | `ProviderName` | [*components.ProviderResponseProviderName](../../models/components/providerresponseprovidername.md) | :heavy_minus_sign: | Name of the provider | OpenAI | -| `Status` | `*float64` | :heavy_check_mark: | HTTP status code from the provider | 200 | \ No newline at end of file +| `Status` | `*int64` | :heavy_check_mark: | HTTP status code from the provider | 200 | \ No newline at end of file diff --git a/docs/models/components/providerresponseprovidername.md b/docs/models/components/providerresponseprovidername.md index c0e1e4ab..c5ff82d0 100644 --- a/docs/models/components/providerresponseprovidername.md +++ b/docs/models/components/providerresponseprovidername.md @@ -27,6 +27,7 @@ custom := components.ProviderResponseProviderName("custom_value") | `ProviderResponseProviderNameEnfer` | Enfer | | `ProviderResponseProviderNameGoPomelo` | GoPomelo | | `ProviderResponseProviderNameHuggingFace` | HuggingFace | +| `ProviderResponseProviderNameHyperbolic` | Hyperbolic | | `ProviderResponseProviderNameHyperbolic2` | Hyperbolic 2 | | `ProviderResponseProviderNameInoCloud` | InoCloud | | `ProviderResponseProviderNameKluster` | Kluster | @@ -70,10 +71,14 @@ custom := components.ProviderResponseProviderName("custom_value") | `ProviderResponseProviderNameClarifai` | Clarifai | | `ProviderResponseProviderNameCloudflare` | Cloudflare | | `ProviderResponseProviderNameCohere` | Cohere | +| `ProviderResponseProviderNameCrucible` | Crucible | | `ProviderResponseProviderNameCrusoe` | Crusoe | +| `ProviderResponseProviderNameDarkbloom` | Darkbloom | +| `ProviderResponseProviderNameDecart` | Decart | | `ProviderResponseProviderNameDeepInfra` | DeepInfra | | `ProviderResponseProviderNameDeepSeek` | DeepSeek | | `ProviderResponseProviderNameDekaLlm` | DekaLLM | +| `ProviderResponseProviderNameDigitalOcean` | DigitalOcean | | `ProviderResponseProviderNameFeatherless` | Featherless | | `ProviderResponseProviderNameFireworks` | Fireworks | | `ProviderResponseProviderNameFriendli` | Friendli | @@ -81,7 +86,6 @@ custom := components.ProviderResponseProviderName("custom_value") | `ProviderResponseProviderNameGoogle` | Google | | `ProviderResponseProviderNameGoogleAiStudio` | Google AI Studio | | `ProviderResponseProviderNameGroq` | Groq | -| `ProviderResponseProviderNameHyperbolic` | Hyperbolic | | `ProviderResponseProviderNameInception` | Inception | | `ProviderResponseProviderNameInceptron` | Inceptron | | `ProviderResponseProviderNameInferenceNet` | InferenceNet | @@ -100,12 +104,15 @@ custom := components.ProviderResponseProviderName("custom_value") | `ProviderResponseProviderNameMorph` | Morph | | `ProviderResponseProviderNameNCompass` | NCompass | | `ProviderResponseProviderNameNebius` | Nebius | +| `ProviderResponseProviderNameNexAgi` | Nex AGI | | `ProviderResponseProviderNameNextBit` | NextBit | | `ProviderResponseProviderNameNovita` | Novita | | `ProviderResponseProviderNameNvidia` | Nvidia | | `ProviderResponseProviderNameOpenAi` | OpenAI | | `ProviderResponseProviderNameOpenInference` | OpenInference | | `ProviderResponseProviderNameParasail` | Parasail | +| `ProviderResponseProviderNamePoolside` | Poolside | +| `ProviderResponseProviderNamePerceptron` | Perceptron | | `ProviderResponseProviderNamePerplexity` | Perplexity | | `ProviderResponseProviderNamePhala` | Phala | | `ProviderResponseProviderNameRecraft` | Recraft | @@ -122,6 +129,7 @@ custom := components.ProviderResponseProviderName("custom_value") | `ProviderResponseProviderNameTogether` | Together | | `ProviderResponseProviderNameUpstage` | Upstage | | `ProviderResponseProviderNameVenice` | Venice | +| `ProviderResponseProviderNameWafer` | Wafer | | `ProviderResponseProviderNameWandB` | WandB | | `ProviderResponseProviderNameXiaomi` | Xiaomi | | `ProviderResponseProviderNameXAi` | xAI | diff --git a/docs/models/components/rankingsdailyitem.md b/docs/models/components/rankingsdailyitem.md new file mode 100644 index 00000000..4bd3cc08 --- /dev/null +++ b/docs/models/components/rankingsdailyitem.md @@ -0,0 +1,10 @@ +# RankingsDailyItem + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Date` | `string` | :heavy_check_mark: | UTC calendar date the row is aggregated over (YYYY-MM-DD). | 2026-05-11 | +| `ModelPermaslug` | `string` | :heavy_check_mark: | Model variant permaslug (e.g. `openai/gpt-4o-2024-05-13`, `openai/gpt-4o-2024-05-13:free`). Non-default variants include a `:variant` suffix and are ranked as their own entry. The reserved value `other` denotes the aggregated row covering every model outside the daily top 50 for that date — always sorted last within its date. | openai/gpt-4o-2024-05-13 | +| `TotalTokens` | `string` | :heavy_check_mark: | Sum of `prompt_tokens + completion_tokens` for the day, returned as a decimal string so 64-bit values are not truncated. | 12345678 | \ No newline at end of file diff --git a/docs/models/components/rankingsdailymeta.md b/docs/models/components/rankingsdailymeta.md new file mode 100644 index 00000000..c11e479d --- /dev/null +++ b/docs/models/components/rankingsdailymeta.md @@ -0,0 +1,11 @@ +# RankingsDailyMeta + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AsOf` | `string` | :heavy_check_mark: | ISO-8601 timestamp of when the response was generated. Reflects data-freshness because the underlying materialized view continuously ingests upstream events. | 2026-05-12T02:00:00Z | +| `EndDate` | `string` | :heavy_check_mark: | Resolved end of the date window (UTC, inclusive). | 2026-05-11 | +| `StartDate` | `string` | :heavy_check_mark: | Resolved start of the date window (UTC, inclusive). | 2026-04-12 | +| `Version` | [components.RankingsDailyMetaVersion](../../models/components/rankingsdailymetaversion.md) | :heavy_check_mark: | Dataset version. Field names and grain are stable for the life of `v1`. | | \ No newline at end of file diff --git a/docs/models/components/rankingsdailymetaversion.md b/docs/models/components/rankingsdailymetaversion.md new file mode 100644 index 00000000..b9e4297e --- /dev/null +++ b/docs/models/components/rankingsdailymetaversion.md @@ -0,0 +1,20 @@ +# RankingsDailyMetaVersion + +Dataset version. Field names and grain are stable for the life of `v1`. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.RankingsDailyMetaVersionV1 +``` + + +## Values + +| Name | Value | +| ---------------------------- | ---------------------------- | +| `RankingsDailyMetaVersionV1` | v1 | \ No newline at end of file diff --git a/docs/models/components/rankingsdailyresponse.md b/docs/models/components/rankingsdailyresponse.md new file mode 100644 index 00000000..e9c9eb2b --- /dev/null +++ b/docs/models/components/rankingsdailyresponse.md @@ -0,0 +1,9 @@ +# RankingsDailyResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Data` | [][components.RankingsDailyItem](../../models/components/rankingsdailyitem.md) | :heavy_check_mark: | Up to 51 rows per day — the top 50 public models by `total_tokens` for each UTC calendar date in the window, plus one aggregated `other` row summing every model outside that top 50 (omitted when the long tail is empty). Rows are sorted by `date` ascending, then by `total_tokens` descending, with `other` pinned last within its date. Ties between real models break alphabetically on `model_permaslug` so the order is stable across requests. | | +| `Meta` | [components.RankingsDailyMeta](../../models/components/rankingsdailymeta.md) | :heavy_check_mark: | N/A | {
"as_of": "2026-05-12T02:00:00Z",
"end_date": "2026-05-11",
"start_date": "2026-04-12",
"version": "v1"
} | \ No newline at end of file diff --git a/docs/models/components/region.md b/docs/models/components/region.md new file mode 100644 index 00000000..fe53e0c7 --- /dev/null +++ b/docs/models/components/region.md @@ -0,0 +1,22 @@ +# Region + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.RegionUs + +// Open enum: custom values can be created with a direct type cast +custom := components.Region("custom_value") +``` + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `RegionUs` | us | +| `RegionEu` | eu | \ No newline at end of file diff --git a/docs/models/components/response.md b/docs/models/components/response.md new file mode 100644 index 00000000..8b40d70c --- /dev/null +++ b/docs/models/components/response.md @@ -0,0 +1,9 @@ +# Response + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Content` | `*string` | :heavy_minus_sign: | N/A | +| `Model` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/responsesrequest.md b/docs/models/components/responsesrequest.md index 3008dbe5..31fc559c 100644 --- a/docs/models/components/responsesrequest.md +++ b/docs/models/components/responsesrequest.md @@ -5,40 +5,42 @@ Request schema for Responses endpoint ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Background` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | N/A | | -| `FrequencyPenalty` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | N/A | | -| `ImageConfig` | map[string][components.ImageConfig](../../models/components/imageconfig.md) | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. | {
"aspect_ratio": "16:9",
"quality": "high"
} | -| `Include` | optionalnullable.OptionalNullable[[][components.ResponseIncludesEnum](../../models/components/responseincludesenum.md)] | :heavy_minus_sign: | N/A | | -| `Input` | [*components.InputsUnion](../../models/components/inputsunion.md) | :heavy_minus_sign: | Input for a response request - can be a string or array of items | [
{
"content": "What is the weather today?",
"role": "user"
}
] | -| `Instructions` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | | -| `MaxOutputTokens` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | N/A | | -| `MaxToolCalls` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | N/A | | -| `Metadata` | optionalnullable.OptionalNullable[map[string]`string`] | :heavy_minus_sign: | Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed. | {
"session_id": "abc-def-ghi",
"user_id": "123"
} | -| `Modalities` | [][components.OutputModalityEnum](../../models/components/outputmodalityenum.md) | :heavy_minus_sign: | Output modalities for the response. Supported values are "text" and "image". | [
"text",
"image"
] | -| `Model` | `*string` | :heavy_minus_sign: | N/A | | -| `Models` | []`string` | :heavy_minus_sign: | N/A | | -| `ParallelToolCalls` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | N/A | | -| `Plugins` | [][components.ResponsesRequestPlugin](../../models/components/responsesrequestplugin.md) | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | | -| `PresencePenalty` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | N/A | | -| `PreviousResponseID` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | | -| `Prompt` | optionalnullable.OptionalNullable[[components.StoredPromptTemplate](../../models/components/storedprompttemplate.md)] | :heavy_minus_sign: | N/A | {
"id": "prompt-abc123",
"variables": {
"name": "John"
}
} | -| `PromptCacheKey` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | | -| `Provider` | optionalnullable.OptionalNullable[[components.ProviderPreferences](../../models/components/providerpreferences.md)] | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | {
"allow_fallbacks": true
} | -| `Reasoning` | optionalnullable.OptionalNullable[[components.ReasoningConfig](../../models/components/reasoningconfig.md)] | :heavy_minus_sign: | Configuration for reasoning mode in the response | {
"enabled": true,
"summary": "auto"
} | -| `SafetyIdentifier` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | | -| `ServiceTier` | optionalnullable.OptionalNullable[[components.ResponsesRequestServiceTier](../../models/components/responsesrequestservicetier.md)] | :heavy_minus_sign: | N/A | | -| `SessionID` | `*string` | :heavy_minus_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. | | -| `Store` | `*bool` | :heavy_minus_sign: | N/A | | -| `Stream` | `*bool` | :heavy_minus_sign: | N/A | | -| `Temperature` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | N/A | | -| `Text` | [*components.TextExtendedConfig](../../models/components/textextendedconfig.md) | :heavy_minus_sign: | Text output configuration including format and verbosity | {
"format": {
"type": "text"
}
} | -| `ToolChoice` | [*components.OpenAIResponsesToolChoiceUnion](../../models/components/openairesponsestoolchoiceunion.md) | :heavy_minus_sign: | N/A | auto | -| `Tools` | [][components.ResponsesRequestToolUnion](../../models/components/responsesrequesttoolunion.md) | :heavy_minus_sign: | N/A | | -| `TopK` | `*int64` | :heavy_minus_sign: | N/A | | -| `TopLogprobs` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | N/A | | -| `TopP` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | N/A | | -| `Trace` | [*components.TraceConfig](../../models/components/traceconfig.md) | :heavy_minus_sign: | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | {
"trace_id": "trace-abc123",
"trace_name": "my-app-trace"
} | -| `Truncation` | optionalnullable.OptionalNullable[[components.OpenAIResponsesTruncation](../../models/components/openairesponsestruncation.md)] | :heavy_minus_sign: | N/A | auto | -| `User` | `*string` | :heavy_minus_sign: | A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 256 characters. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Background` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | N/A | | +| `CacheControl` | [*components.AnthropicCacheControlDirective](../../models/components/anthropiccachecontroldirective.md) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | {
"type": "ephemeral"
} | +| `FrequencyPenalty` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | N/A | | +| `ImageConfig` | map[string][components.ImageConfig](../../models/components/imageconfig.md) | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. | {
"aspect_ratio": "16:9",
"quality": "high"
} | +| `Include` | optionalnullable.OptionalNullable[[][components.ResponseIncludesEnum](../../models/components/responseincludesenum.md)] | :heavy_minus_sign: | N/A | | +| `Input` | [*components.InputsUnion](../../models/components/inputsunion.md) | :heavy_minus_sign: | Input for a response request - can be a string or array of items | [
{
"content": "What is the weather today?",
"role": "user"
}
] | +| `Instructions` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | | +| `MaxOutputTokens` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | N/A | | +| `MaxToolCalls` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | N/A | | +| `Metadata` | optionalnullable.OptionalNullable[map[string]`string`] | :heavy_minus_sign: | Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed. | {
"session_id": "abc-def-ghi",
"user_id": "123"
} | +| `Modalities` | [][components.OutputModalityEnum](../../models/components/outputmodalityenum.md) | :heavy_minus_sign: | Output modalities for the response. Supported values are "text" and "image". | [
"text",
"image"
] | +| `Model` | `*string` | :heavy_minus_sign: | N/A | | +| `Models` | []`string` | :heavy_minus_sign: | N/A | | +| `ParallelToolCalls` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | N/A | | +| `Plugins` | [][components.ResponsesRequestPlugin](../../models/components/responsesrequestplugin.md) | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | | +| `PresencePenalty` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | N/A | | +| `PreviousResponseID` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | | +| `Prompt` | optionalnullable.OptionalNullable[[components.StoredPromptTemplate](../../models/components/storedprompttemplate.md)] | :heavy_minus_sign: | N/A | {
"id": "prompt-abc123",
"variables": {
"name": "John"
}
} | +| `PromptCacheKey` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | | +| `Provider` | optionalnullable.OptionalNullable[[components.ProviderPreferences](../../models/components/providerpreferences.md)] | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | {
"allow_fallbacks": true
} | +| `Reasoning` | optionalnullable.OptionalNullable[[components.ReasoningConfig](../../models/components/reasoningconfig.md)] | :heavy_minus_sign: | Configuration for reasoning mode in the response | {
"enabled": true,
"summary": "auto"
} | +| `SafetyIdentifier` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | | +| `ServiceTier` | optionalnullable.OptionalNullable[[components.ResponsesRequestServiceTier](../../models/components/responsesrequestservicetier.md)] | :heavy_minus_sign: | N/A | | +| `SessionID` | `*string` | :heavy_minus_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. | | +| `StopServerToolsWhen` | [][components.StopServerToolsWhenCondition](../../models/components/stopservertoolswhencondition.md) | :heavy_minus_sign: | Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`. | [
{
"step_count": 5,
"type": "step_count_is"
},
{
"max_cost_in_dollars": 0.5,
"type": "max_cost"
}
] | +| `Store` | `*bool` | :heavy_minus_sign: | N/A | | +| `Stream` | `*bool` | :heavy_minus_sign: | N/A | | +| `Temperature` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | N/A | | +| `Text` | [*components.TextExtendedConfig](../../models/components/textextendedconfig.md) | :heavy_minus_sign: | Text output configuration including format and verbosity | {
"format": {
"type": "text"
}
} | +| `ToolChoice` | [*components.OpenAIResponsesToolChoiceUnion](../../models/components/openairesponsestoolchoiceunion.md) | :heavy_minus_sign: | N/A | auto | +| `Tools` | [][components.ResponsesRequestToolUnion](../../models/components/responsesrequesttoolunion.md) | :heavy_minus_sign: | N/A | | +| `TopK` | `*int64` | :heavy_minus_sign: | N/A | | +| `TopLogprobs` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | N/A | | +| `TopP` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | N/A | | +| `Trace` | [*components.TraceConfig](../../models/components/traceconfig.md) | :heavy_minus_sign: | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | {
"trace_id": "trace-abc123",
"trace_name": "my-app-trace"
} | +| `Truncation` | optionalnullable.OptionalNullable[[components.OpenAIResponsesTruncation](../../models/components/openairesponsestruncation.md)] | :heavy_minus_sign: | N/A | auto | +| `User` | `*string` | :heavy_minus_sign: | A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 256 characters. | | \ No newline at end of file diff --git a/docs/models/components/responsesrequestplugin.md b/docs/models/components/responsesrequestplugin.md index 262a2f83..5a45ba54 100644 --- a/docs/models/components/responsesrequestplugin.md +++ b/docs/models/components/responsesrequestplugin.md @@ -21,6 +21,12 @@ responsesRequestPlugin := components.CreateResponsesRequestPluginContextCompress responsesRequestPlugin := components.CreateResponsesRequestPluginFileParser(components.FileParserPlugin{/* values here */}) ``` +### FusionPlugin + +```go +responsesRequestPlugin := components.CreateResponsesRequestPluginFusion(components.FusionPlugin{/* values here */}) +``` + ### ModerationPlugin ```go @@ -45,6 +51,12 @@ responsesRequestPlugin := components.CreateResponsesRequestPluginResponseHealing responsesRequestPlugin := components.CreateResponsesRequestPluginWeb(components.WebSearchPlugin{/* values here */}) ``` +### WebFetchPlugin + +```go +responsesRequestPlugin := components.CreateResponsesRequestPluginWebFetch(components.WebFetchPlugin{/* values here */}) +``` + ## Union Discrimination Use the `Type` field to determine which variant is active, then access the corresponding field: @@ -57,6 +69,8 @@ switch responsesRequestPlugin.Type { // responsesRequestPlugin.ContextCompressionPlugin is populated case components.ResponsesRequestPluginTypeFileParser: // responsesRequestPlugin.FileParserPlugin is populated + case components.ResponsesRequestPluginTypeFusion: + // responsesRequestPlugin.FusionPlugin is populated case components.ResponsesRequestPluginTypeModeration: // responsesRequestPlugin.ModerationPlugin is populated case components.ResponsesRequestPluginTypeParetoRouter: @@ -65,5 +79,7 @@ switch responsesRequestPlugin.Type { // responsesRequestPlugin.ResponseHealingPlugin is populated case components.ResponsesRequestPluginTypeWeb: // responsesRequestPlugin.WebSearchPlugin is populated + case components.ResponsesRequestPluginTypeWebFetch: + // responsesRequestPlugin.WebFetchPlugin is populated } ``` diff --git a/docs/models/components/responsesrequesttoolunion.md b/docs/models/components/responsesrequesttoolunion.md index 6e7ebf7a..dbab58ad 100644 --- a/docs/models/components/responsesrequesttoolunion.md +++ b/docs/models/components/responsesrequesttoolunion.md @@ -87,12 +87,30 @@ responsesRequestToolUnion := components.CreateResponsesRequestToolUnionApplyPatc responsesRequestToolUnion := components.CreateResponsesRequestToolUnionCustom(components.CustomTool{/* values here */}) ``` +### AdvisorServerToolOpenRouter + +```go +responsesRequestToolUnion := components.CreateResponsesRequestToolUnionOpenrouterAdvisor(components.AdvisorServerToolOpenRouter{/* values here */}) +``` + +### SubagentServerToolOpenRouter + +```go +responsesRequestToolUnion := components.CreateResponsesRequestToolUnionOpenrouterSubagent(components.SubagentServerToolOpenRouter{/* values here */}) +``` + ### DatetimeServerTool ```go responsesRequestToolUnion := components.CreateResponsesRequestToolUnionOpenrouterDatetime(components.DatetimeServerTool{/* values here */}) ``` +### FusionServerToolOpenRouter + +```go +responsesRequestToolUnion := components.CreateResponsesRequestToolUnionOpenrouterFusion(components.FusionServerToolOpenRouter{/* values here */}) +``` + ### ImageGenerationServerToolOpenRouter ```go @@ -105,12 +123,36 @@ responsesRequestToolUnion := components.CreateResponsesRequestToolUnionOpenroute responsesRequestToolUnion := components.CreateResponsesRequestToolUnionOpenrouterExperimentalSearchModels(components.ChatSearchModelsServerTool{/* values here */}) ``` +### WebFetchServerTool + +```go +responsesRequestToolUnion := components.CreateResponsesRequestToolUnionOpenrouterWebFetch(components.WebFetchServerTool{/* values here */}) +``` + ### WebSearchServerToolOpenRouter ```go responsesRequestToolUnion := components.CreateResponsesRequestToolUnionOpenrouterWebSearch(components.WebSearchServerToolOpenRouter{/* values here */}) ``` +### ApplyPatchServerToolOpenRouter + +```go +responsesRequestToolUnion := components.CreateResponsesRequestToolUnionOpenrouterApplyPatch(components.ApplyPatchServerToolOpenRouter{/* values here */}) +``` + +### BashServerTool + +```go +responsesRequestToolUnion := components.CreateResponsesRequestToolUnionOpenrouterBash(components.BashServerTool{/* values here */}) +``` + +### ShellServerToolOpenRouter + +```go +responsesRequestToolUnion := components.CreateResponsesRequestToolUnionOpenrouterShell(components.ShellServerToolOpenRouter{/* values here */}) +``` + ## Union Discrimination Use the `Type` field to determine which variant is active, then access the corresponding field: @@ -145,13 +187,27 @@ switch responsesRequestToolUnion.Type { // responsesRequestToolUnion.ApplyPatchServerTool is populated case components.ResponsesRequestToolUnionTypeCustom: // responsesRequestToolUnion.CustomTool is populated + case components.ResponsesRequestToolUnionTypeOpenrouterAdvisor: + // responsesRequestToolUnion.AdvisorServerToolOpenRouter is populated + case components.ResponsesRequestToolUnionTypeOpenrouterSubagent: + // responsesRequestToolUnion.SubagentServerToolOpenRouter is populated case components.ResponsesRequestToolUnionTypeOpenrouterDatetime: // responsesRequestToolUnion.DatetimeServerTool is populated + case components.ResponsesRequestToolUnionTypeOpenrouterFusion: + // responsesRequestToolUnion.FusionServerToolOpenRouter is populated case components.ResponsesRequestToolUnionTypeOpenrouterImageGeneration: // responsesRequestToolUnion.ImageGenerationServerToolOpenRouter is populated case components.ResponsesRequestToolUnionTypeOpenrouterExperimentalSearchModels: // responsesRequestToolUnion.ChatSearchModelsServerTool is populated + case components.ResponsesRequestToolUnionTypeOpenrouterWebFetch: + // responsesRequestToolUnion.WebFetchServerTool is populated case components.ResponsesRequestToolUnionTypeOpenrouterWebSearch: // responsesRequestToolUnion.WebSearchServerToolOpenRouter is populated + case components.ResponsesRequestToolUnionTypeOpenrouterApplyPatch: + // responsesRequestToolUnion.ApplyPatchServerToolOpenRouter is populated + case components.ResponsesRequestToolUnionTypeOpenrouterBash: + // responsesRequestToolUnion.BashServerTool is populated + case components.ResponsesRequestToolUnionTypeOpenrouterShell: + // responsesRequestToolUnion.ShellServerToolOpenRouter is populated } ``` diff --git a/docs/models/operations/createresponsesresponsebody.md b/docs/models/components/responsesstreamingresponse.md similarity index 99% rename from docs/models/operations/createresponsesresponsebody.md rename to docs/models/components/responsesstreamingresponse.md index bcf31ee7..3dfdd56c 100644 --- a/docs/models/operations/createresponsesresponsebody.md +++ b/docs/models/components/responsesstreamingresponse.md @@ -1,6 +1,4 @@ -# CreateResponsesResponseBody - -Successful response +# ResponsesStreamingResponse ## Fields diff --git a/docs/models/components/routerattempt.md b/docs/models/components/routerattempt.md new file mode 100644 index 00000000..1fcee918 --- /dev/null +++ b/docs/models/components/routerattempt.md @@ -0,0 +1,10 @@ +# RouterAttempt + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Model` | `string` | :heavy_check_mark: | N/A | +| `Provider` | `string` | :heavy_check_mark: | N/A | +| `Status` | `int64` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/routerparams.md b/docs/models/components/routerparams.md new file mode 100644 index 00000000..bc551dfb --- /dev/null +++ b/docs/models/components/routerparams.md @@ -0,0 +1,11 @@ +# RouterParams + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `QualityFloor` | `*float64` | :heavy_minus_sign: | N/A | | +| `ThroughputFloor` | `*float64` | :heavy_minus_sign: | N/A | | +| `VersionGroup` | `*string` | :heavy_minus_sign: | N/A | | +| `AdditionalProperties` | map[string]`any` | :heavy_minus_sign: | N/A | {
"version_group": "anthropic/claude-sonnet-4"
} | \ No newline at end of file diff --git a/docs/models/components/routingstrategy.md b/docs/models/components/routingstrategy.md new file mode 100644 index 00000000..c6fd093d --- /dev/null +++ b/docs/models/components/routingstrategy.md @@ -0,0 +1,29 @@ +# RoutingStrategy + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.RoutingStrategyDirect + +// Open enum: custom values can be created with a direct type cast +custom := components.RoutingStrategy("custom_value") +``` + + +## Values + +| Name | Value | +| ---------------------------- | ---------------------------- | +| `RoutingStrategyDirect` | direct | +| `RoutingStrategyAuto` | auto | +| `RoutingStrategyFree` | free | +| `RoutingStrategyLatest` | latest | +| `RoutingStrategyAlias` | alias | +| `RoutingStrategyFallback` | fallback | +| `RoutingStrategyPareto` | pareto | +| `RoutingStrategyBodybuilder` | bodybuilder | +| `RoutingStrategyFusion` | fusion | \ No newline at end of file diff --git a/docs/models/components/rule.md b/docs/models/components/rule.md new file mode 100644 index 00000000..7a1eb0da --- /dev/null +++ b/docs/models/components/rule.md @@ -0,0 +1,10 @@ +# Rule + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `Field` | [components.Field](../../models/components/field.md) | :heavy_check_mark: | N/A | +| `Operator` | [components.Operator](../../models/components/operator.md) | :heavy_check_mark: | N/A | +| `Value` | [*components.ObservabilityFilterRulesConfigValue](../../models/components/observabilityfilterrulesconfigvalue.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/searchqualitylevel.md b/docs/models/components/searchqualitylevel.md index efcd8df6..0b01ccc3 100644 --- a/docs/models/components/searchqualitylevel.md +++ b/docs/models/components/searchqualitylevel.md @@ -1,6 +1,6 @@ # SearchQualityLevel -How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search. +How much context to retrieve per result. Applies to Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, pins a fixed per-result character cap (low=5,000, medium=15,000, high=30,000); when omitted, Exa picks an adaptive size per query and document (typically ~2,000–4,000 characters per result). For Parallel, controls the total characters across all results; when omitted, Parallel uses its own default size. For Perplexity, maps directly to the Search API's native search_context_size parameter. Overridden by `max_characters` when both are set. ## Example Usage diff --git a/docs/models/components/shellcallitem.md b/docs/models/components/shellcallitem.md new file mode 100644 index 00000000..72ff8b73 --- /dev/null +++ b/docs/models/components/shellcallitem.md @@ -0,0 +1,15 @@ +# ShellCallItem + +A shell command execution call (newer variant) + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| `Action` | [components.ShellCallItemAction](../../models/components/shellcallitemaction.md) | :heavy_check_mark: | N/A | | +| `CallID` | `string` | :heavy_check_mark: | N/A | | +| `Environment` | optionalnullable.OptionalNullable[`any`] | :heavy_minus_sign: | N/A | | +| `ID` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | | +| `Status` | optionalnullable.OptionalNullable[[components.ShellCallItemStatus](../../models/components/shellcallitemstatus.md)] | :heavy_minus_sign: | N/A | completed | +| `Type` | [components.ShellCallItemType](../../models/components/shellcallitemtype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/shellcallitemaction.md b/docs/models/components/shellcallitemaction.md new file mode 100644 index 00000000..03c1c40a --- /dev/null +++ b/docs/models/components/shellcallitemaction.md @@ -0,0 +1,10 @@ +# ShellCallItemAction + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `Commands` | []`string` | :heavy_check_mark: | N/A | +| `MaxOutputLength` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | N/A | +| `TimeoutMs` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/shellcallitemstatus.md b/docs/models/components/shellcallitemstatus.md new file mode 100644 index 00000000..fd111d49 --- /dev/null +++ b/docs/models/components/shellcallitemstatus.md @@ -0,0 +1,23 @@ +# ShellCallItemStatus + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ShellCallItemStatusInProgress + +// Open enum: custom values can be created with a direct type cast +custom := components.ShellCallItemStatus("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------------- | ------------------------------- | +| `ShellCallItemStatusInProgress` | in_progress | +| `ShellCallItemStatusCompleted` | completed | +| `ShellCallItemStatusIncomplete` | incomplete | \ No newline at end of file diff --git a/docs/models/components/shellcallitemtype.md b/docs/models/components/shellcallitemtype.md new file mode 100644 index 00000000..a8272cd8 --- /dev/null +++ b/docs/models/components/shellcallitemtype.md @@ -0,0 +1,18 @@ +# ShellCallItemType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ShellCallItemTypeShellCall +``` + + +## Values + +| Name | Value | +| ---------------------------- | ---------------------------- | +| `ShellCallItemTypeShellCall` | shell_call | \ No newline at end of file diff --git a/docs/models/components/shellcalloutputitem.md b/docs/models/components/shellcalloutputitem.md new file mode 100644 index 00000000..da9e2f60 --- /dev/null +++ b/docs/models/components/shellcalloutputitem.md @@ -0,0 +1,15 @@ +# ShellCallOutputItem + +Output from a shell command execution (newer variant) + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `CallID` | `string` | :heavy_check_mark: | N/A | | +| `ID` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | | +| `MaxOutputLength` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | N/A | | +| `Output` | [][components.ShellCallOutputItemOutput](../../models/components/shellcalloutputitemoutput.md) | :heavy_check_mark: | N/A | | +| `Status` | optionalnullable.OptionalNullable[[components.ShellCallOutputItemStatus](../../models/components/shellcalloutputitemstatus.md)] | :heavy_minus_sign: | N/A | completed | +| `Type` | [components.ShellCallOutputItemType](../../models/components/shellcalloutputitemtype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/shellcalloutputitemoutput.md b/docs/models/components/shellcalloutputitemoutput.md new file mode 100644 index 00000000..4e7c0237 --- /dev/null +++ b/docs/models/components/shellcalloutputitemoutput.md @@ -0,0 +1,11 @@ +# ShellCallOutputItemOutput + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `Content` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `ExitCode` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | N/A | +| `Type` | `string` | :heavy_check_mark: | N/A | +| `AdditionalProperties` | map[string]`any` | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/shellcalloutputitemstatus.md b/docs/models/components/shellcalloutputitemstatus.md new file mode 100644 index 00000000..bd90fe3c --- /dev/null +++ b/docs/models/components/shellcalloutputitemstatus.md @@ -0,0 +1,23 @@ +# ShellCallOutputItemStatus + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ShellCallOutputItemStatusInProgress + +// Open enum: custom values can be created with a direct type cast +custom := components.ShellCallOutputItemStatus("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------------------- | ------------------------------------- | +| `ShellCallOutputItemStatusInProgress` | in_progress | +| `ShellCallOutputItemStatusCompleted` | completed | +| `ShellCallOutputItemStatusIncomplete` | incomplete | \ No newline at end of file diff --git a/docs/models/components/shellcalloutputitemtype.md b/docs/models/components/shellcalloutputitemtype.md new file mode 100644 index 00000000..be1f1646 --- /dev/null +++ b/docs/models/components/shellcalloutputitemtype.md @@ -0,0 +1,18 @@ +# ShellCallOutputItemType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ShellCallOutputItemTypeShellCallOutput +``` + + +## Values + +| Name | Value | +| ---------------------------------------- | ---------------------------------------- | +| `ShellCallOutputItemTypeShellCallOutput` | shell_call_output | \ No newline at end of file diff --git a/docs/models/components/shellcallstatus.md b/docs/models/components/shellcallstatus.md new file mode 100644 index 00000000..3e5cfed1 --- /dev/null +++ b/docs/models/components/shellcallstatus.md @@ -0,0 +1,25 @@ +# ShellCallStatus + +Status of a shell call or its output. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ShellCallStatusInProgress + +// Open enum: custom values can be created with a direct type cast +custom := components.ShellCallStatus("custom_value") +``` + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `ShellCallStatusInProgress` | in_progress | +| `ShellCallStatusCompleted` | completed | +| `ShellCallStatusIncomplete` | incomplete | \ No newline at end of file diff --git a/docs/models/components/shellservertoolconfig.md b/docs/models/components/shellservertoolconfig.md new file mode 100644 index 00000000..0a6b03b7 --- /dev/null +++ b/docs/models/components/shellservertoolconfig.md @@ -0,0 +1,12 @@ +# ShellServerToolConfig + +Configuration for the openrouter:shell server tool + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Engine` | [*components.ShellServerToolEngine](../../models/components/shellservertoolengine.md) | :heavy_minus_sign: | Which shell engine to use. "openrouter" runs commands server-side in the OpenRouter sandbox. "auto" (default) keeps the provider's native hosted shell when available (OpenAI); on other providers the call is routed to the OpenRouter sandbox. | openrouter | +| `Environment` | [*components.ShellServerToolEnvironment](../../models/components/shellservertoolenvironment.md) | :heavy_minus_sign: | Server-side execution environment for the shell tool. Only container-backed environments are supported; "local" shells are not. | {
"type": "container_auto"
} | +| `SleepAfterSeconds` | `*int64` | :heavy_minus_sign: | How long (in seconds) the container stays warm after its last command before sleeping, freeing its capacity slot. Idle-based: each command renews the timer. Defaults to 900 (15 minutes); capped at 2592000 (30 days). | 900 | \ No newline at end of file diff --git a/docs/models/components/shellservertoolengine.md b/docs/models/components/shellservertoolengine.md new file mode 100644 index 00000000..e8242df0 --- /dev/null +++ b/docs/models/components/shellservertoolengine.md @@ -0,0 +1,24 @@ +# ShellServerToolEngine + +Which shell engine to use. "openrouter" runs commands server-side in the OpenRouter sandbox. "auto" (default) keeps the provider's native hosted shell when available (OpenAI); on other providers the call is routed to the OpenRouter sandbox. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ShellServerToolEngineAuto + +// Open enum: custom values can be created with a direct type cast +custom := components.ShellServerToolEngine("custom_value") +``` + + +## Values + +| Name | Value | +| --------------------------------- | --------------------------------- | +| `ShellServerToolEngineAuto` | auto | +| `ShellServerToolEngineOpenrouter` | openrouter | \ No newline at end of file diff --git a/docs/models/components/shellservertoolenvironment.md b/docs/models/components/shellservertoolenvironment.md new file mode 100644 index 00000000..9939a5f0 --- /dev/null +++ b/docs/models/components/shellservertoolenvironment.md @@ -0,0 +1,31 @@ +# ShellServerToolEnvironment + +Server-side execution environment for the shell tool. Only container-backed environments are supported; "local" shells are not. + + +## Supported Types + +### ContainerAutoEnvironment + +```go +shellServerToolEnvironment := components.CreateShellServerToolEnvironmentContainerAuto(components.ContainerAutoEnvironment{/* values here */}) +``` + +### ContainerReferenceEnvironment + +```go +shellServerToolEnvironment := components.CreateShellServerToolEnvironmentContainerReference(components.ContainerReferenceEnvironment{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch shellServerToolEnvironment.Type { + case components.ShellServerToolEnvironmentTypeContainerAuto: + // shellServerToolEnvironment.ContainerAutoEnvironment is populated + case components.ShellServerToolEnvironmentTypeContainerReference: + // shellServerToolEnvironment.ContainerReferenceEnvironment is populated +} +``` diff --git a/docs/models/components/shellservertoolopenrouter.md b/docs/models/components/shellservertoolopenrouter.md new file mode 100644 index 00000000..37e3e54b --- /dev/null +++ b/docs/models/components/shellservertoolopenrouter.md @@ -0,0 +1,11 @@ +# ShellServerToolOpenRouter + +OpenRouter built-in server tool: runs shell commands server-side in a sandboxed container (a sandbox-backed clone of OpenAI's hosted shell tool) + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `Parameters` | [*components.ShellServerToolConfig](../../models/components/shellservertoolconfig.md) | :heavy_minus_sign: | Configuration for the openrouter:shell server tool | {
"engine": "openrouter",
"environment": {
"type": "container_auto"
}
} | +| `Type` | [components.ShellServerToolOpenRouterType](../../models/components/shellservertoolopenroutertype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/shellservertoolopenroutertype.md b/docs/models/components/shellservertoolopenroutertype.md new file mode 100644 index 00000000..8c4aa861 --- /dev/null +++ b/docs/models/components/shellservertoolopenroutertype.md @@ -0,0 +1,18 @@ +# ShellServerToolOpenRouterType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ShellServerToolOpenRouterTypeOpenrouterShell +``` + + +## Values + +| Name | Value | +| ---------------------------------------------- | ---------------------------------------------- | +| `ShellServerToolOpenRouterTypeOpenrouterShell` | openrouter:shell | \ No newline at end of file diff --git a/docs/models/components/sourcecontent.md b/docs/models/components/sourcecontent.md new file mode 100644 index 00000000..03bd2208 --- /dev/null +++ b/docs/models/components/sourcecontent.md @@ -0,0 +1,9 @@ +# SourceContent + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `Content` | [components.AnthropicDocumentBlockParamContent2](../../models/components/anthropicdocumentblockparamcontent2.md) | :heavy_check_mark: | N/A | +| `Type` | [components.SourceType](../../models/components/sourcetype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/sourcetype.md b/docs/models/components/sourcetype.md new file mode 100644 index 00000000..b4f850a3 --- /dev/null +++ b/docs/models/components/sourcetype.md @@ -0,0 +1,18 @@ +# SourceType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.SourceTypeContent +``` + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `SourceTypeContent` | content | \ No newline at end of file diff --git a/docs/models/components/speechrequestprovider.md b/docs/models/components/speechrequestprovider.md index 3171e82f..5eb2fbd1 100644 --- a/docs/models/components/speechrequestprovider.md +++ b/docs/models/components/speechrequestprovider.md @@ -5,6 +5,6 @@ Provider-specific passthrough configuration ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -| `Options` | [*components.SpeechRequestOptions](../../models/components/speechrequestoptions.md) | :heavy_minus_sign: | Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `Options` | [*components.ProviderOptions](../../models/components/provideroptions.md) | :heavy_minus_sign: | Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. | {
"openai": {
"max_tokens": 1000
}
} | \ No newline at end of file diff --git a/docs/models/components/speed.md b/docs/models/components/speed.md new file mode 100644 index 00000000..1900f760 --- /dev/null +++ b/docs/models/components/speed.md @@ -0,0 +1,24 @@ +# Speed + +Controls output generation speed. When set to `fast`, uses a higher-speed inference configuration at premium pricing. Defaults to `standard` when omitted. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.SpeedFast + +// Open enum: custom values can be created with a direct type cast +custom := components.Speed("custom_value") +``` + + +## Values + +| Name | Value | +| --------------- | --------------- | +| `SpeedFast` | fast | +| `SpeedStandard` | standard | \ No newline at end of file diff --git a/docs/models/components/stance.md b/docs/models/components/stance.md new file mode 100644 index 00000000..d89aee89 --- /dev/null +++ b/docs/models/components/stance.md @@ -0,0 +1,9 @@ +# Stance + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Model` | `string` | :heavy_check_mark: | N/A | +| `Stance` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/stopservertoolswhencondition.md b/docs/models/components/stopservertoolswhencondition.md new file mode 100644 index 00000000..0c319fa6 --- /dev/null +++ b/docs/models/components/stopservertoolswhencondition.md @@ -0,0 +1,55 @@ +# StopServerToolsWhenCondition + +A single condition that, when met, halts the server-tool agent loop. + + +## Supported Types + +### StopServerToolsWhenFinishReasonIs + +```go +stopServerToolsWhenCondition := components.CreateStopServerToolsWhenConditionFinishReasonIs(components.StopServerToolsWhenFinishReasonIs{/* values here */}) +``` + +### StopServerToolsWhenHasToolCall + +```go +stopServerToolsWhenCondition := components.CreateStopServerToolsWhenConditionHasToolCall(components.StopServerToolsWhenHasToolCall{/* values here */}) +``` + +### StopServerToolsWhenMaxCost + +```go +stopServerToolsWhenCondition := components.CreateStopServerToolsWhenConditionMaxCost(components.StopServerToolsWhenMaxCost{/* values here */}) +``` + +### StopServerToolsWhenMaxTokensUsed + +```go +stopServerToolsWhenCondition := components.CreateStopServerToolsWhenConditionMaxTokensUsed(components.StopServerToolsWhenMaxTokensUsed{/* values here */}) +``` + +### StopServerToolsWhenStepCountIs + +```go +stopServerToolsWhenCondition := components.CreateStopServerToolsWhenConditionStepCountIs(components.StopServerToolsWhenStepCountIs{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch stopServerToolsWhenCondition.Type { + case components.StopServerToolsWhenConditionTypeFinishReasonIs: + // stopServerToolsWhenCondition.StopServerToolsWhenFinishReasonIs is populated + case components.StopServerToolsWhenConditionTypeHasToolCall: + // stopServerToolsWhenCondition.StopServerToolsWhenHasToolCall is populated + case components.StopServerToolsWhenConditionTypeMaxCost: + // stopServerToolsWhenCondition.StopServerToolsWhenMaxCost is populated + case components.StopServerToolsWhenConditionTypeMaxTokensUsed: + // stopServerToolsWhenCondition.StopServerToolsWhenMaxTokensUsed is populated + case components.StopServerToolsWhenConditionTypeStepCountIs: + // stopServerToolsWhenCondition.StopServerToolsWhenStepCountIs is populated +} +``` diff --git a/docs/models/components/stopservertoolswhenfinishreasonis.md b/docs/models/components/stopservertoolswhenfinishreasonis.md new file mode 100644 index 00000000..33541eae --- /dev/null +++ b/docs/models/components/stopservertoolswhenfinishreasonis.md @@ -0,0 +1,11 @@ +# StopServerToolsWhenFinishReasonIs + +Stop when the upstream model emits this finish reason (e.g. `length`). + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `Reason` | `string` | :heavy_check_mark: | N/A | +| `Type` | [components.StopServerToolsWhenFinishReasonIsType](../../models/components/stopservertoolswhenfinishreasonistype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/stopservertoolswhenfinishreasonistype.md b/docs/models/components/stopservertoolswhenfinishreasonistype.md new file mode 100644 index 00000000..d5f7cd5a --- /dev/null +++ b/docs/models/components/stopservertoolswhenfinishreasonistype.md @@ -0,0 +1,18 @@ +# StopServerToolsWhenFinishReasonIsType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.StopServerToolsWhenFinishReasonIsTypeFinishReasonIs +``` + + +## Values + +| Name | Value | +| ----------------------------------------------------- | ----------------------------------------------------- | +| `StopServerToolsWhenFinishReasonIsTypeFinishReasonIs` | finish_reason_is | \ No newline at end of file diff --git a/docs/models/components/stopservertoolswhenhastoolcall.md b/docs/models/components/stopservertoolswhenhastoolcall.md new file mode 100644 index 00000000..e40bb2ca --- /dev/null +++ b/docs/models/components/stopservertoolswhenhastoolcall.md @@ -0,0 +1,11 @@ +# StopServerToolsWhenHasToolCall + +Stop after a tool with this name has been called. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `ToolName` | `string` | :heavy_check_mark: | N/A | +| `Type` | [components.StopServerToolsWhenHasToolCallType](../../models/components/stopservertoolswhenhastoolcalltype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/stopservertoolswhenhastoolcalltype.md b/docs/models/components/stopservertoolswhenhastoolcalltype.md new file mode 100644 index 00000000..4ec1bb7b --- /dev/null +++ b/docs/models/components/stopservertoolswhenhastoolcalltype.md @@ -0,0 +1,18 @@ +# StopServerToolsWhenHasToolCallType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.StopServerToolsWhenHasToolCallTypeHasToolCall +``` + + +## Values + +| Name | Value | +| ----------------------------------------------- | ----------------------------------------------- | +| `StopServerToolsWhenHasToolCallTypeHasToolCall` | has_tool_call | \ No newline at end of file diff --git a/docs/models/components/stopservertoolswhenmaxcost.md b/docs/models/components/stopservertoolswhenmaxcost.md new file mode 100644 index 00000000..9d397096 --- /dev/null +++ b/docs/models/components/stopservertoolswhenmaxcost.md @@ -0,0 +1,11 @@ +# StopServerToolsWhenMaxCost + +Stop once cumulative cost across the loop exceeds this dollar threshold. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `MaxCostInDollars` | `float64` | :heavy_check_mark: | N/A | +| `Type` | [components.StopServerToolsWhenMaxCostType](../../models/components/stopservertoolswhenmaxcosttype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/inputmessageitemcontenttype.md b/docs/models/components/stopservertoolswhenmaxcosttype.md similarity index 66% rename from docs/models/components/inputmessageitemcontenttype.md rename to docs/models/components/stopservertoolswhenmaxcosttype.md index 5f53764e..877a98fb 100644 --- a/docs/models/components/inputmessageitemcontenttype.md +++ b/docs/models/components/stopservertoolswhenmaxcosttype.md @@ -1,4 +1,4 @@ -# InputMessageItemContentType +# StopServerToolsWhenMaxCostType ## Example Usage @@ -7,7 +7,7 @@ import ( "github.com/OpenRouterTeam/go-sdk/models/components" ) -value := components.InputMessageItemContentTypeInputImage +value := components.StopServerToolsWhenMaxCostTypeMaxCost ``` @@ -15,4 +15,4 @@ value := components.InputMessageItemContentTypeInputImage | Name | Value | | --------------------------------------- | --------------------------------------- | -| `InputMessageItemContentTypeInputImage` | input_image | \ No newline at end of file +| `StopServerToolsWhenMaxCostTypeMaxCost` | max_cost | \ No newline at end of file diff --git a/docs/models/components/stopservertoolswhenmaxtokensused.md b/docs/models/components/stopservertoolswhenmaxtokensused.md new file mode 100644 index 00000000..4e74ee75 --- /dev/null +++ b/docs/models/components/stopservertoolswhenmaxtokensused.md @@ -0,0 +1,11 @@ +# StopServerToolsWhenMaxTokensUsed + +Stop once cumulative token usage across the loop exceeds this threshold. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `MaxTokens` | `int64` | :heavy_check_mark: | N/A | +| `Type` | [components.StopServerToolsWhenMaxTokensUsedType](../../models/components/stopservertoolswhenmaxtokensusedtype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/stopservertoolswhenmaxtokensusedtype.md b/docs/models/components/stopservertoolswhenmaxtokensusedtype.md new file mode 100644 index 00000000..9f857ee2 --- /dev/null +++ b/docs/models/components/stopservertoolswhenmaxtokensusedtype.md @@ -0,0 +1,18 @@ +# StopServerToolsWhenMaxTokensUsedType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.StopServerToolsWhenMaxTokensUsedTypeMaxTokensUsed +``` + + +## Values + +| Name | Value | +| --------------------------------------------------- | --------------------------------------------------- | +| `StopServerToolsWhenMaxTokensUsedTypeMaxTokensUsed` | max_tokens_used | \ No newline at end of file diff --git a/docs/models/components/stopservertoolswhenstepcountis.md b/docs/models/components/stopservertoolswhenstepcountis.md new file mode 100644 index 00000000..35061e60 --- /dev/null +++ b/docs/models/components/stopservertoolswhenstepcountis.md @@ -0,0 +1,11 @@ +# StopServerToolsWhenStepCountIs + +Stop after the agent loop has executed this many steps. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `StepCount` | `int64` | :heavy_check_mark: | N/A | +| `Type` | [components.StopServerToolsWhenStepCountIsType](../../models/components/stopservertoolswhenstepcountistype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/stopservertoolswhenstepcountistype.md b/docs/models/components/stopservertoolswhenstepcountistype.md new file mode 100644 index 00000000..c6920695 --- /dev/null +++ b/docs/models/components/stopservertoolswhenstepcountistype.md @@ -0,0 +1,18 @@ +# StopServerToolsWhenStepCountIsType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.StopServerToolsWhenStepCountIsTypeStepCountIs +``` + + +## Values + +| Name | Value | +| ----------------------------------------------- | ----------------------------------------------- | +| `StopServerToolsWhenStepCountIsTypeStepCountIs` | step_count_is | \ No newline at end of file diff --git a/docs/models/components/streamevents.md b/docs/models/components/streamevents.md index 12e3c3f2..903929d3 100644 --- a/docs/models/components/streamevents.md +++ b/docs/models/components/streamevents.md @@ -11,6 +11,18 @@ Union of all possible event types emitted during response streaming streamEvents := components.CreateStreamEventsError(components.ErrorEvent{/* values here */}) ``` +### ApplyPatchCallOperationDiffDeltaEvent + +```go +streamEvents := components.CreateStreamEventsResponseApplyPatchCallOperationDiffDelta(components.ApplyPatchCallOperationDiffDeltaEvent{/* values here */}) +``` + +### ApplyPatchCallOperationDiffDoneEvent + +```go +streamEvents := components.CreateStreamEventsResponseApplyPatchCallOperationDiffDone(components.ApplyPatchCallOperationDiffDoneEvent{/* values here */}) +``` + ### StreamEventsResponseCompleted ```go @@ -35,6 +47,18 @@ streamEvents := components.CreateStreamEventsResponseContentPartDone(components. streamEvents := components.CreateStreamEventsResponseCreated(components.OpenResponsesCreatedEvent{/* values here */}) ``` +### CustomToolCallInputDeltaEvent + +```go +streamEvents := components.CreateStreamEventsResponseCustomToolCallInputDelta(components.CustomToolCallInputDeltaEvent{/* values here */}) +``` + +### CustomToolCallInputDoneEvent + +```go +streamEvents := components.CreateStreamEventsResponseCustomToolCallInputDone(components.CustomToolCallInputDoneEvent{/* values here */}) +``` + ### StreamEventsResponseFailed ```go @@ -53,6 +77,60 @@ streamEvents := components.CreateStreamEventsResponseFunctionCallArgumentsDelta( streamEvents := components.CreateStreamEventsResponseFunctionCallArgumentsDone(components.FunctionCallArgsDoneEvent{/* values here */}) ``` +### FusionCallAnalysisCompletedEvent + +```go +streamEvents := components.CreateStreamEventsResponseFusionCallAnalysisCompleted(components.FusionCallAnalysisCompletedEvent{/* values here */}) +``` + +### FusionCallAnalysisInProgressEvent + +```go +streamEvents := components.CreateStreamEventsResponseFusionCallAnalysisInProgress(components.FusionCallAnalysisInProgressEvent{/* values here */}) +``` + +### FusionCallCompletedEvent + +```go +streamEvents := components.CreateStreamEventsResponseFusionCallCompleted(components.FusionCallCompletedEvent{/* values here */}) +``` + +### FusionCallInProgressEvent + +```go +streamEvents := components.CreateStreamEventsResponseFusionCallInProgress(components.FusionCallInProgressEvent{/* values here */}) +``` + +### FusionCallPanelAddedEvent + +```go +streamEvents := components.CreateStreamEventsResponseFusionCallPanelAdded(components.FusionCallPanelAddedEvent{/* values here */}) +``` + +### FusionCallPanelCompletedEvent + +```go +streamEvents := components.CreateStreamEventsResponseFusionCallPanelCompleted(components.FusionCallPanelCompletedEvent{/* values here */}) +``` + +### FusionCallPanelDeltaEvent + +```go +streamEvents := components.CreateStreamEventsResponseFusionCallPanelDelta(components.FusionCallPanelDeltaEvent{/* values here */}) +``` + +### FusionCallPanelFailedEvent + +```go +streamEvents := components.CreateStreamEventsResponseFusionCallPanelFailed(components.FusionCallPanelFailedEvent{/* values here */}) +``` + +### FusionCallPanelReasoningDeltaEvent + +```go +streamEvents := components.CreateStreamEventsResponseFusionCallPanelReasoningDelta(components.FusionCallPanelReasoningDeltaEvent{/* values here */}) +``` + ### ImageGenCallCompletedEvent ```go @@ -193,6 +271,10 @@ Use the `Type` field to determine which variant is active, then access the corre switch streamEvents.Type { case components.StreamEventsTypeError: // streamEvents.ErrorEvent is populated + case components.StreamEventsTypeResponseApplyPatchCallOperationDiffDelta: + // streamEvents.ApplyPatchCallOperationDiffDeltaEvent is populated + case components.StreamEventsTypeResponseApplyPatchCallOperationDiffDone: + // streamEvents.ApplyPatchCallOperationDiffDoneEvent is populated case components.StreamEventsTypeResponseCompleted: // streamEvents.StreamEventsResponseCompleted is populated case components.StreamEventsTypeResponseContentPartAdded: @@ -201,12 +283,34 @@ switch streamEvents.Type { // streamEvents.ContentPartDoneEvent is populated case components.StreamEventsTypeResponseCreated: // streamEvents.OpenResponsesCreatedEvent is populated + case components.StreamEventsTypeResponseCustomToolCallInputDelta: + // streamEvents.CustomToolCallInputDeltaEvent is populated + case components.StreamEventsTypeResponseCustomToolCallInputDone: + // streamEvents.CustomToolCallInputDoneEvent is populated case components.StreamEventsTypeResponseFailed: // streamEvents.StreamEventsResponseFailed is populated case components.StreamEventsTypeResponseFunctionCallArgumentsDelta: // streamEvents.FunctionCallArgsDeltaEvent is populated case components.StreamEventsTypeResponseFunctionCallArgumentsDone: // streamEvents.FunctionCallArgsDoneEvent is populated + case components.StreamEventsTypeResponseFusionCallAnalysisCompleted: + // streamEvents.FusionCallAnalysisCompletedEvent is populated + case components.StreamEventsTypeResponseFusionCallAnalysisInProgress: + // streamEvents.FusionCallAnalysisInProgressEvent is populated + case components.StreamEventsTypeResponseFusionCallCompleted: + // streamEvents.FusionCallCompletedEvent is populated + case components.StreamEventsTypeResponseFusionCallInProgress: + // streamEvents.FusionCallInProgressEvent is populated + case components.StreamEventsTypeResponseFusionCallPanelAdded: + // streamEvents.FusionCallPanelAddedEvent is populated + case components.StreamEventsTypeResponseFusionCallPanelCompleted: + // streamEvents.FusionCallPanelCompletedEvent is populated + case components.StreamEventsTypeResponseFusionCallPanelDelta: + // streamEvents.FusionCallPanelDeltaEvent is populated + case components.StreamEventsTypeResponseFusionCallPanelFailed: + // streamEvents.FusionCallPanelFailedEvent is populated + case components.StreamEventsTypeResponseFusionCallPanelReasoningDelta: + // streamEvents.FusionCallPanelReasoningDeltaEvent is populated case components.StreamEventsTypeResponseImageGenerationCallCompleted: // streamEvents.ImageGenCallCompletedEvent is populated case components.StreamEventsTypeResponseImageGenerationCallGenerating: diff --git a/docs/models/components/sttinputaudio.md b/docs/models/components/sttinputaudio.md new file mode 100644 index 00000000..deec8b63 --- /dev/null +++ b/docs/models/components/sttinputaudio.md @@ -0,0 +1,11 @@ +# STTInputAudio + +Base64-encoded audio to transcribe + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `Data` | `string` | :heavy_check_mark: | Base64-encoded audio data (raw bytes, not a data URI) | +| `Format` | `string` | :heavy_check_mark: | Audio format (e.g., wav, mp3, flac, m4a, ogg, webm, aac). Supported formats vary by provider. | \ No newline at end of file diff --git a/docs/models/components/sttrequest.md b/docs/models/components/sttrequest.md new file mode 100644 index 00000000..d2c36beb --- /dev/null +++ b/docs/models/components/sttrequest.md @@ -0,0 +1,14 @@ +# STTRequest + +Speech-to-text request input. Accepts a JSON body with input_audio containing base64-encoded audio. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `InputAudio` | [components.STTInputAudio](../../models/components/sttinputaudio.md) | :heavy_check_mark: | Base64-encoded audio to transcribe | {
"data": "UklGRiQA...",
"format": "wav"
} | +| `Language` | `*string` | :heavy_minus_sign: | ISO-639-1 language code (e.g., "en", "ja"). Auto-detected if omitted. | en | +| `Model` | `string` | :heavy_check_mark: | STT model identifier | openai/whisper-large-v3 | +| `Provider` | [*components.STTRequestProvider](../../models/components/sttrequestprovider.md) | :heavy_minus_sign: | Provider-specific passthrough configuration | | +| `Temperature` | `*float64` | :heavy_minus_sign: | Sampling temperature for transcription | 0 | \ No newline at end of file diff --git a/docs/models/components/sttrequestprovider.md b/docs/models/components/sttrequestprovider.md new file mode 100644 index 00000000..9e2700d1 --- /dev/null +++ b/docs/models/components/sttrequestprovider.md @@ -0,0 +1,10 @@ +# STTRequestProvider + +Provider-specific passthrough configuration + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `Options` | [*components.ProviderOptions](../../models/components/provideroptions.md) | :heavy_minus_sign: | Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. | {
"openai": {
"max_tokens": 1000
}
} | \ No newline at end of file diff --git a/docs/models/components/sttresponse.md b/docs/models/components/sttresponse.md new file mode 100644 index 00000000..3bc8dcf1 --- /dev/null +++ b/docs/models/components/sttresponse.md @@ -0,0 +1,11 @@ +# STTResponse + +STT response containing transcribed text and optional usage statistics + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `Text` | `string` | :heavy_check_mark: | The transcribed text | Hello, this is a test of OpenAI speech-to-text transcription. The weather is sunny today and the temperature is around 72 degrees. | +| `Usage` | [*components.STTUsage](../../models/components/sttusage.md) | :heavy_minus_sign: | Aggregated usage statistics for the request | {
"cost": 0.000508,
"input_tokens": 83,
"output_tokens": 30,
"seconds": 9.2,
"total_tokens": 113
} | \ No newline at end of file diff --git a/docs/models/components/sttusage.md b/docs/models/components/sttusage.md new file mode 100644 index 00000000..f1c12e7a --- /dev/null +++ b/docs/models/components/sttusage.md @@ -0,0 +1,14 @@ +# STTUsage + +Aggregated usage statistics for the request + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `Cost` | `*float64` | :heavy_minus_sign: | Total cost of the request in USD | 0.000508 | +| `InputTokens` | `*int64` | :heavy_minus_sign: | Number of input tokens billed for this request | 83 | +| `OutputTokens` | `*int64` | :heavy_minus_sign: | Number of output tokens generated | 30 | +| `Seconds` | `*float64` | :heavy_minus_sign: | Duration of the input audio in seconds | 9.2 | +| `TotalTokens` | `*int64` | :heavy_minus_sign: | Total number of tokens used (input + output) | 113 | \ No newline at end of file diff --git a/docs/models/components/subagentnestedtool.md b/docs/models/components/subagentnestedtool.md new file mode 100644 index 00000000..a7f5dad8 --- /dev/null +++ b/docs/models/components/subagentnestedtool.md @@ -0,0 +1,12 @@ +# SubagentNestedTool + +A tool made available to the subagent. Only OpenRouter server tools (e.g. openrouter:web_search) are supported; function tools are rejected because the worker has no way to execute them. The subagent tool may not list itself. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | +| `Parameters` | map[string]`any` | :heavy_minus_sign: | N/A | | +| `Type` | `string` | :heavy_check_mark: | N/A | | +| `AdditionalProperties` | map[string]`any` | :heavy_minus_sign: | N/A | {
"type": "openrouter:web_search"
} | \ No newline at end of file diff --git a/docs/models/components/subagentreasoning.md b/docs/models/components/subagentreasoning.md new file mode 100644 index 00000000..9748930d --- /dev/null +++ b/docs/models/components/subagentreasoning.md @@ -0,0 +1,11 @@ +# SubagentReasoning + +Reasoning configuration forwarded to the subagent call. Use this to control reasoning effort and token budget for models that support extended thinking. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `Effort` | [*components.SubagentReasoningEffort](../../models/components/subagentreasoningeffort.md) | :heavy_minus_sign: | Reasoning effort level for the subagent call. | +| `MaxTokens` | `*int64` | :heavy_minus_sign: | Maximum number of reasoning tokens the subagent may use. Accepted and validated but not yet forwarded to the subagent call. | \ No newline at end of file diff --git a/docs/models/components/subagentreasoningeffort.md b/docs/models/components/subagentreasoningeffort.md new file mode 100644 index 00000000..101dcfa1 --- /dev/null +++ b/docs/models/components/subagentreasoningeffort.md @@ -0,0 +1,28 @@ +# SubagentReasoningEffort + +Reasoning effort level for the subagent call. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.SubagentReasoningEffortXhigh + +// Open enum: custom values can be created with a direct type cast +custom := components.SubagentReasoningEffort("custom_value") +``` + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `SubagentReasoningEffortXhigh` | xhigh | +| `SubagentReasoningEffortHigh` | high | +| `SubagentReasoningEffortMedium` | medium | +| `SubagentReasoningEffortLow` | low | +| `SubagentReasoningEffortMinimal` | minimal | +| `SubagentReasoningEffortNone` | none | \ No newline at end of file diff --git a/docs/models/components/subagentservertoolconfig.md b/docs/models/components/subagentservertoolconfig.md new file mode 100644 index 00000000..88187215 --- /dev/null +++ b/docs/models/components/subagentservertoolconfig.md @@ -0,0 +1,16 @@ +# SubagentServerToolConfig + +Configuration for the openrouter:subagent server tool. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Instructions` | `*string` | :heavy_minus_sign: | System instructions for the subagent. When omitted, the subagent responds with no system prompt of its own. | You are a fast, focused worker. Complete the task exactly as described. | +| `MaxCompletionTokens` | `*int64` | :heavy_minus_sign: | Maximum number of output tokens (including reasoning) the subagent may produce. When omitted, the provider's default applies. | 2048 | +| `MaxToolCalls` | `*int64` | :heavy_minus_sign: | Maximum number of tool-calling steps the subagent may take during its agentic loop. Capped at 25. Only relevant when the subagent is given tools. Accepted and validated but not yet enforced on the subagent call. | 5 | +| `Model` | `*string` | :heavy_minus_sign: | Slug of the model that executes delegated tasks (any OpenRouter model). Typically a smaller, cheaper, faster model than the one delegating. When omitted, the model from the outer API request is used. The subagent tool itself cannot be the subagent model. | ~anthropic/claude-haiku-latest | +| `Reasoning` | [*components.SubagentReasoning](../../models/components/subagentreasoning.md) | :heavy_minus_sign: | Reasoning configuration forwarded to the subagent call. Use this to control reasoning effort and token budget for models that support extended thinking. | {
"effort": "low"
} | +| `Temperature` | `*float64` | :heavy_minus_sign: | Sampling temperature forwarded to the subagent call. When omitted, the provider's default applies. | 0.7 | +| `Tools` | [][components.SubagentNestedTool](../../models/components/subagentnestedtool.md) | :heavy_minus_sign: | Tools the subagent may use while executing a delegated task. The subagent runs as an agentic sub-agent over these tools, then returns its outcome. Only OpenRouter server tools are supported — function tools are rejected — and the list must not include the subagent tool itself. | | \ No newline at end of file diff --git a/docs/models/components/subagentservertoolopenrouter.md b/docs/models/components/subagentservertoolopenrouter.md new file mode 100644 index 00000000..9f92b242 --- /dev/null +++ b/docs/models/components/subagentservertoolopenrouter.md @@ -0,0 +1,11 @@ +# SubagentServerToolOpenRouter + +OpenRouter built-in server tool: delegates self-contained tasks to a smaller, cheaper, faster worker model (any OpenRouter model) mid-generation and returns its outcome. The worker may run as a sub-agent with its own tools. + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `Parameters` | [*components.SubagentServerToolConfig](../../models/components/subagentservertoolconfig.md) | :heavy_minus_sign: | Configuration for the openrouter:subagent server tool. | {
"model": "~anthropic/claude-haiku-latest"
} | +| `Type` | [components.SubagentServerToolOpenRouterType](../../models/components/subagentservertoolopenroutertype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/subagentservertoolopenroutertype.md b/docs/models/components/subagentservertoolopenroutertype.md new file mode 100644 index 00000000..874a6c29 --- /dev/null +++ b/docs/models/components/subagentservertoolopenroutertype.md @@ -0,0 +1,18 @@ +# SubagentServerToolOpenRouterType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.SubagentServerToolOpenRouterTypeOpenrouterSubagent +``` + + +## Values + +| Name | Value | +| ---------------------------------------------------- | ---------------------------------------------------- | +| `SubagentServerToolOpenRouterTypeOpenrouterSubagent` | openrouter:subagent | \ No newline at end of file diff --git a/docs/models/components/supportedaspectratio.md b/docs/models/components/supportedaspectratio.md index 16424da4..b909916f 100644 --- a/docs/models/components/supportedaspectratio.md +++ b/docs/models/components/supportedaspectratio.md @@ -23,5 +23,7 @@ custom := components.SupportedAspectRatio("custom_value") | `SupportedAspectRatioEleven` | 1:1 | | `SupportedAspectRatioFortyThree` | 4:3 | | `SupportedAspectRatioThirtyFour` | 3:4 | +| `SupportedAspectRatioThirtyTwo` | 3:2 | +| `SupportedAspectRatioTwentyThree` | 2:3 | | `SupportedAspectRatioTwoHundredAndNineteen` | 21:9 | | `SupportedAspectRatioNineHundredAndTwentyOne` | 9:21 | \ No newline at end of file diff --git a/docs/models/components/supportedsize.md b/docs/models/components/supportedsize.md index d723b90f..b42d7877 100644 --- a/docs/models/components/supportedsize.md +++ b/docs/models/components/supportedsize.md @@ -20,29 +20,37 @@ custom := components.SupportedSize("custom_value") | ----------------------------------------------------- | ----------------------------------------------------- | | `SupportedSizeFourHundredAndEightyx480` | 480x480 | | `SupportedSizeFourHundredAndEightyx640` | 480x640 | +| `SupportedSizeFourHundredAndEightyx720` | 480x720 | | `SupportedSizeFourHundredAndEightyx854` | 480x854 | | `SupportedSizeFourHundredAndEightyx1120` | 480x1120 | | `SupportedSizeSixHundredAndFortyx480` | 640x480 | +| `SupportedSizeSevenHundredAndTwentyx480` | 720x480 | | `SupportedSizeSevenHundredAndTwentyx720` | 720x720 | | `SupportedSizeSevenHundredAndTwentyx960` | 720x960 | +| `SupportedSizeSevenHundredAndTwentyx1080` | 720x1080 | | `SupportedSizeSevenHundredAndTwentyx1280` | 720x1280 | | `SupportedSizeSevenHundredAndTwentyx1680` | 720x1680 | | `SupportedSizeEightHundredAndFiftyFourx480` | 854x480 | | `SupportedSizeNineHundredAndSixtyx720` | 960x720 | +| `SupportedSizeOneThousandAndEightyx720` | 1080x720 | | `SupportedSizeOneThousandAndEightyx1080` | 1080x1080 | | `SupportedSizeOneThousandAndEightyx1440` | 1080x1440 | +| `SupportedSizeOneThousandAndEightyx1620` | 1080x1620 | | `SupportedSizeOneThousandAndEightyx1920` | 1080x1920 | | `SupportedSizeOneThousandAndEightyx2520` | 1080x2520 | | `SupportedSizeOneThousandOneHundredAndTwentyx480` | 1120x480 | | `SupportedSizeOneThousandTwoHundredAndEightyx720` | 1280x720 | | `SupportedSizeOneThousandFourHundredAndFortyx1080` | 1440x1080 | +| `SupportedSizeOneThousandSixHundredAndTwentyx1080` | 1620x1080 | | `SupportedSizeOneThousandSixHundredAndEightyx720` | 1680x720 | | `SupportedSizeOneThousandNineHundredAndTwentyx1080` | 1920x1080 | | `SupportedSizeTwoThousandOneHundredAndSixtyx2160` | 2160x2160 | | `SupportedSizeTwoThousandOneHundredAndSixtyx2880` | 2160x2880 | +| `SupportedSizeTwoThousandOneHundredAndSixtyx3240` | 2160x3240 | | `SupportedSizeTwoThousandOneHundredAndSixtyx3840` | 2160x3840 | | `SupportedSizeTwoThousandOneHundredAndSixtyx5040` | 2160x5040 | | `SupportedSizeTwoThousandFiveHundredAndTwentyx1080` | 2520x1080 | | `SupportedSizeTwoThousandEightHundredAndEightyx2160` | 2880x2160 | +| `SupportedSizeThreeThousandTwoHundredAndFortyx2160` | 3240x2160 | | `SupportedSizeThreeThousandEightHundredAndFortyx2160` | 3840x2160 | | `SupportedSizeFiveThousandAndFortyx2160` | 5040x2160 | \ No newline at end of file diff --git a/docs/models/components/system.md b/docs/models/components/system.md new file mode 100644 index 00000000..8834f4f2 --- /dev/null +++ b/docs/models/components/system.md @@ -0,0 +1,29 @@ +# System + + +## Supported Types + +### + +```go +system := components.CreateSystemStr(string{/* values here */}) +``` + +### + +```go +system := components.CreateSystemArrayOfAnthropicTextBlockParam([]components.AnthropicTextBlockParam{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch system.Type { + case components.SystemTypeStr: + // system.Str is populated + case components.SystemTypeArrayOfAnthropicTextBlockParam: + // system.ArrayOfAnthropicTextBlockParam is populated +} +``` diff --git a/docs/models/components/taskbudget.md b/docs/models/components/taskbudget.md new file mode 100644 index 00000000..1f4b73ca --- /dev/null +++ b/docs/models/components/taskbudget.md @@ -0,0 +1,12 @@ +# TaskBudget + +Task budget for an agentic turn. The model sees a countdown of remaining tokens and uses it to prioritize work and wind down gracefully. Advisory — does not enforce a hard cap. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Remaining` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | N/A | +| `Total` | `int64` | :heavy_check_mark: | N/A | +| `Type` | [components.TypeTokens](../../models/components/typetokens.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/thinking.md b/docs/models/components/thinking.md new file mode 100644 index 00000000..54d4cdae --- /dev/null +++ b/docs/models/components/thinking.md @@ -0,0 +1,37 @@ +# Thinking + + +## Supported Types + +### ThinkingEnabled + +```go +thinking := components.CreateThinkingEnabled(components.ThinkingEnabled{/* values here */}) +``` + +### ThinkingDisabled + +```go +thinking := components.CreateThinkingDisabled(components.ThinkingDisabled{/* values here */}) +``` + +### ThinkingAdaptive + +```go +thinking := components.CreateThinkingAdaptive(components.ThinkingAdaptive{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch thinking.Type { + case components.ThinkingTypeEnabled: + // thinking.ThinkingEnabled is populated + case components.ThinkingTypeDisabled: + // thinking.ThinkingDisabled is populated + case components.ThinkingTypeAdaptive: + // thinking.ThinkingAdaptive is populated +} +``` diff --git a/docs/models/components/thinkingadaptive.md b/docs/models/components/thinkingadaptive.md new file mode 100644 index 00000000..e1e0e948 --- /dev/null +++ b/docs/models/components/thinkingadaptive.md @@ -0,0 +1,9 @@ +# ThinkingAdaptive + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `Display` | optionalnullable.OptionalNullable[[components.AnthropicThinkingDisplay](../../models/components/anthropicthinkingdisplay.md)] | :heavy_minus_sign: | N/A | summarized | +| `Type` | [components.TypeAdaptive](../../models/components/typeadaptive.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/thinkingdisabled.md b/docs/models/components/thinkingdisabled.md new file mode 100644 index 00000000..5143813d --- /dev/null +++ b/docs/models/components/thinkingdisabled.md @@ -0,0 +1,8 @@ +# ThinkingDisabled + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `Type` | [components.TypeDisabled](../../models/components/typedisabled.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/thinkingenabled.md b/docs/models/components/thinkingenabled.md new file mode 100644 index 00000000..aa41ae79 --- /dev/null +++ b/docs/models/components/thinkingenabled.md @@ -0,0 +1,10 @@ +# ThinkingEnabled + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `BudgetTokens` | `int64` | :heavy_check_mark: | N/A | | +| `Display` | optionalnullable.OptionalNullable[[components.AnthropicThinkingDisplay](../../models/components/anthropicthinkingdisplay.md)] | :heavy_minus_sign: | N/A | summarized | +| `Type` | [components.TypeEnabled](../../models/components/typeenabled.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/tooladvisor20260301.md b/docs/models/components/tooladvisor20260301.md new file mode 100644 index 00000000..0a61a819 --- /dev/null +++ b/docs/models/components/tooladvisor20260301.md @@ -0,0 +1,15 @@ +# ToolAdvisor20260301 + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AllowedCallers` | [][components.AnthropicAllowedCallers](../../models/components/anthropicallowedcallers.md) | :heavy_minus_sign: | N/A | [
"direct"
] | +| `CacheControl` | [*components.AnthropicCacheControlDirective](../../models/components/anthropiccachecontroldirective.md) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | {
"type": "ephemeral"
} | +| `Caching` | optionalnullable.OptionalNullable[[components.Caching](../../models/components/caching.md)] | :heavy_minus_sign: | N/A | {
"type": "ephemeral"
} | +| `DeferLoading` | `*bool` | :heavy_minus_sign: | N/A | | +| `MaxUses` | `*int64` | :heavy_minus_sign: | N/A | | +| `Model` | `string` | :heavy_check_mark: | N/A | | +| `Name` | [components.NameAdvisor](../../models/components/nameadvisor.md) | :heavy_check_mark: | N/A | | +| `Type` | [components.TypeAdvisor20260301](../../models/components/typeadvisor20260301.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/toolbash20250124.md b/docs/models/components/toolbash20250124.md new file mode 100644 index 00000000..af0c36cb --- /dev/null +++ b/docs/models/components/toolbash20250124.md @@ -0,0 +1,10 @@ +# ToolBash20250124 + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CacheControl` | [*components.AnthropicCacheControlDirective](../../models/components/anthropiccachecontroldirective.md) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | {
"type": "ephemeral"
} | +| `Name` | [components.NameBash](../../models/components/namebash.md) | :heavy_check_mark: | N/A | | +| `Type` | [components.TypeBash20250124](../../models/components/typebash20250124.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/toolchoice.md b/docs/models/components/toolchoice.md new file mode 100644 index 00000000..8275ca64 --- /dev/null +++ b/docs/models/components/toolchoice.md @@ -0,0 +1,45 @@ +# ToolChoice + + +## Supported Types + +### ToolChoiceAuto + +```go +toolChoice := components.CreateToolChoiceAuto(components.ToolChoiceAuto{/* values here */}) +``` + +### ToolChoiceAny + +```go +toolChoice := components.CreateToolChoiceAny(components.ToolChoiceAny{/* values here */}) +``` + +### ToolChoiceNone + +```go +toolChoice := components.CreateToolChoiceNone(components.ToolChoiceNone{/* values here */}) +``` + +### ToolChoiceTool + +```go +toolChoice := components.CreateToolChoiceTool(components.ToolChoiceTool{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch toolChoice.Type { + case components.ToolChoiceTypeAutoValue: + // toolChoice.ToolChoiceAuto is populated + case components.ToolChoiceTypeAny: + // toolChoice.ToolChoiceAny is populated + case components.ToolChoiceTypeNone: + // toolChoice.ToolChoiceNone is populated + case components.ToolChoiceTypeTool: + // toolChoice.ToolChoiceTool is populated +} +``` diff --git a/docs/models/components/toolchoiceany.md b/docs/models/components/toolchoiceany.md new file mode 100644 index 00000000..4e9c46d9 --- /dev/null +++ b/docs/models/components/toolchoiceany.md @@ -0,0 +1,9 @@ +# ToolChoiceAny + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `DisableParallelToolUse` | `*bool` | :heavy_minus_sign: | N/A | +| `Type` | [components.TypeAny](../../models/components/typeany.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/toolchoiceauto.md b/docs/models/components/toolchoiceauto.md new file mode 100644 index 00000000..6b749db3 --- /dev/null +++ b/docs/models/components/toolchoiceauto.md @@ -0,0 +1,9 @@ +# ToolChoiceAuto + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `DisableParallelToolUse` | `*bool` | :heavy_minus_sign: | N/A | +| `Type` | [components.ToolChoiceTypeAuto](../../models/components/toolchoicetypeauto.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/toolchoicenone.md b/docs/models/components/toolchoicenone.md new file mode 100644 index 00000000..9995ccdd --- /dev/null +++ b/docs/models/components/toolchoicenone.md @@ -0,0 +1,8 @@ +# ToolChoiceNone + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `Type` | [components.TypeNone](../../models/components/typenone.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/toolchoicetool.md b/docs/models/components/toolchoicetool.md new file mode 100644 index 00000000..e3af09d6 --- /dev/null +++ b/docs/models/components/toolchoicetool.md @@ -0,0 +1,10 @@ +# ToolChoiceTool + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `DisableParallelToolUse` | `*bool` | :heavy_minus_sign: | N/A | +| `Name` | `string` | :heavy_check_mark: | N/A | +| `Type` | [components.TypeTool](../../models/components/typetool.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/toolchoicetypeauto.md b/docs/models/components/toolchoicetypeauto.md new file mode 100644 index 00000000..67edcead --- /dev/null +++ b/docs/models/components/toolchoicetypeauto.md @@ -0,0 +1,18 @@ +# ToolChoiceTypeAuto + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ToolChoiceTypeAutoAuto +``` + + +## Values + +| Name | Value | +| ------------------------ | ------------------------ | +| `ToolChoiceTypeAutoAuto` | auto | \ No newline at end of file diff --git a/docs/models/components/toolcustom.md b/docs/models/components/toolcustom.md new file mode 100644 index 00000000..8c6f6a60 --- /dev/null +++ b/docs/models/components/toolcustom.md @@ -0,0 +1,12 @@ +# ToolCustom + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CacheControl` | [*components.AnthropicCacheControlDirective](../../models/components/anthropiccachecontroldirective.md) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | {
"type": "ephemeral"
} | +| `Description` | `*string` | :heavy_minus_sign: | N/A | | +| `InputSchema` | [components.InputSchema](../../models/components/inputschema.md) | :heavy_check_mark: | N/A | | +| `Name` | `string` | :heavy_check_mark: | N/A | | +| `Type` | [*components.ToolTypeCustom](../../models/components/tooltypecustom.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/tooltexteditor20250124.md b/docs/models/components/tooltexteditor20250124.md new file mode 100644 index 00000000..5adf1568 --- /dev/null +++ b/docs/models/components/tooltexteditor20250124.md @@ -0,0 +1,10 @@ +# ToolTextEditor20250124 + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CacheControl` | [*components.AnthropicCacheControlDirective](../../models/components/anthropiccachecontroldirective.md) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | {
"type": "ephemeral"
} | +| `Name` | [components.NameStrReplaceEditor](../../models/components/namestrreplaceeditor.md) | :heavy_check_mark: | N/A | | +| `Type` | [components.TypeTextEditor20250124](../../models/components/typetexteditor20250124.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/tooltypecustom.md b/docs/models/components/tooltypecustom.md new file mode 100644 index 00000000..5169f055 --- /dev/null +++ b/docs/models/components/tooltypecustom.md @@ -0,0 +1,18 @@ +# ToolTypeCustom + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ToolTypeCustomCustom +``` + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `ToolTypeCustomCustom` | custom | \ No newline at end of file diff --git a/docs/models/components/tooltypeephemeral.md b/docs/models/components/tooltypeephemeral.md new file mode 100644 index 00000000..7e5d2c32 --- /dev/null +++ b/docs/models/components/tooltypeephemeral.md @@ -0,0 +1,18 @@ +# ToolTypeEphemeral + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.ToolTypeEphemeralEphemeral +``` + + +## Values + +| Name | Value | +| ---------------------------- | ---------------------------- | +| `ToolTypeEphemeralEphemeral` | ephemeral | \ No newline at end of file diff --git a/docs/models/components/toolwebsearch20250305.md b/docs/models/components/toolwebsearch20250305.md new file mode 100644 index 00000000..add9f42e --- /dev/null +++ b/docs/models/components/toolwebsearch20250305.md @@ -0,0 +1,14 @@ +# ToolWebSearch20250305 + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AllowedDomains` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | N/A | | +| `BlockedDomains` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | N/A | | +| `CacheControl` | [*components.AnthropicCacheControlDirective](../../models/components/anthropiccachecontroldirective.md) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | {
"type": "ephemeral"
} | +| `MaxUses` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | N/A | | +| `Name` | [components.NameWebSearch1](../../models/components/namewebsearch1.md) | :heavy_check_mark: | N/A | | +| `Type` | [components.TypeWebSearch20250305](../../models/components/typewebsearch20250305.md) | :heavy_check_mark: | N/A | | +| `UserLocation` | optionalnullable.OptionalNullable[[components.AnthropicWebSearchToolUserLocation](../../models/components/anthropicwebsearchtooluserlocation.md)] | :heavy_minus_sign: | N/A | {
"city": "San Francisco",
"country": "US",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file diff --git a/docs/models/components/toolwebsearch20260209.md b/docs/models/components/toolwebsearch20260209.md new file mode 100644 index 00000000..593061d3 --- /dev/null +++ b/docs/models/components/toolwebsearch20260209.md @@ -0,0 +1,15 @@ +# ToolWebSearch20260209 + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AllowedCallers` | [][components.AnthropicAllowedCallers](../../models/components/anthropicallowedcallers.md) | :heavy_minus_sign: | N/A | [
"direct"
] | +| `AllowedDomains` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | N/A | | +| `BlockedDomains` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | N/A | | +| `CacheControl` | [*components.AnthropicCacheControlDirective](../../models/components/anthropiccachecontroldirective.md) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | {
"type": "ephemeral"
} | +| `MaxUses` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | N/A | | +| `Name` | [components.NameWebSearch2](../../models/components/namewebsearch2.md) | :heavy_check_mark: | N/A | | +| `Type` | [components.TypeWebSearch20260209](../../models/components/typewebsearch20260209.md) | :heavy_check_mark: | N/A | | +| `UserLocation` | optionalnullable.OptionalNullable[[components.AnthropicWebSearchToolUserLocation](../../models/components/anthropicwebsearchtooluserlocation.md)] | :heavy_minus_sign: | N/A | {
"city": "San Francisco",
"country": "US",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file diff --git a/docs/models/components/tournamentstats.md b/docs/models/components/tournamentstats.md new file mode 100644 index 00000000..baa1fc48 --- /dev/null +++ b/docs/models/components/tournamentstats.md @@ -0,0 +1,14 @@ +# TournamentStats + +Placement distribution from tournament matches. + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `FirstPlace` | `*int64` | :heavy_check_mark: | N/A | +| `FourthPlace` | `*int64` | :heavy_check_mark: | N/A | +| `SecondPlace` | `*int64` | :heavy_check_mark: | N/A | +| `ThirdPlace` | `*int64` | :heavy_check_mark: | N/A | +| `Total` | `*int64` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/trigger.md b/docs/models/components/trigger.md new file mode 100644 index 00000000..256e8018 --- /dev/null +++ b/docs/models/components/trigger.md @@ -0,0 +1,29 @@ +# Trigger + + +## Supported Types + +### AnthropicInputTokensTrigger + +```go +trigger := components.CreateTriggerInputTokens(components.AnthropicInputTokensTrigger{/* values here */}) +``` + +### AnthropicToolUsesTrigger + +```go +trigger := components.CreateTriggerToolUses(components.AnthropicToolUsesTrigger{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch trigger.Type { + case components.TriggerTypeInputTokens: + // trigger.AnthropicInputTokensTrigger is populated + case components.TriggerTypeToolUses: + // trigger.AnthropicToolUsesTrigger is populated +} +``` diff --git a/docs/models/components/triggerinputtokens.md b/docs/models/components/triggerinputtokens.md new file mode 100644 index 00000000..047250e8 --- /dev/null +++ b/docs/models/components/triggerinputtokens.md @@ -0,0 +1,9 @@ +# TriggerInputTokens + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `Type` | [components.EditTypeInputTokens](../../models/components/edittypeinputtokens.md) | :heavy_check_mark: | N/A | +| `Value` | `int64` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/typeadaptive.md b/docs/models/components/typeadaptive.md new file mode 100644 index 00000000..e086e37c --- /dev/null +++ b/docs/models/components/typeadaptive.md @@ -0,0 +1,18 @@ +# TypeAdaptive + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeAdaptiveAdaptive +``` + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `TypeAdaptiveAdaptive` | adaptive | \ No newline at end of file diff --git a/docs/models/components/typeadvisor20260301.md b/docs/models/components/typeadvisor20260301.md new file mode 100644 index 00000000..bf2330c4 --- /dev/null +++ b/docs/models/components/typeadvisor20260301.md @@ -0,0 +1,18 @@ +# TypeAdvisor20260301 + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeAdvisor20260301Advisor20260301 +``` + + +## Values + +| Name | Value | +| ------------------------------------ | ------------------------------------ | +| `TypeAdvisor20260301Advisor20260301` | advisor_20260301 | \ No newline at end of file diff --git a/docs/models/components/typeany.md b/docs/models/components/typeany.md new file mode 100644 index 00000000..f8178487 --- /dev/null +++ b/docs/models/components/typeany.md @@ -0,0 +1,18 @@ +# TypeAny + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeAnyAny +``` + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `TypeAnyAny` | any | \ No newline at end of file diff --git a/docs/models/components/typebash20250124.md b/docs/models/components/typebash20250124.md new file mode 100644 index 00000000..4d03d5f9 --- /dev/null +++ b/docs/models/components/typebash20250124.md @@ -0,0 +1,18 @@ +# TypeBash20250124 + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeBash20250124Bash20250124 +``` + + +## Values + +| Name | Value | +| ------------------------------ | ------------------------------ | +| `TypeBash20250124Bash20250124` | bash_20250124 | \ No newline at end of file diff --git a/docs/models/components/typeclearthinking20251015.md b/docs/models/components/typeclearthinking20251015.md new file mode 100644 index 00000000..901bddbc --- /dev/null +++ b/docs/models/components/typeclearthinking20251015.md @@ -0,0 +1,18 @@ +# TypeClearThinking20251015 + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeClearThinking20251015ClearThinking20251015 +``` + + +## Values + +| Name | Value | +| ------------------------------------------------ | ------------------------------------------------ | +| `TypeClearThinking20251015ClearThinking20251015` | clear_thinking_20251015 | \ No newline at end of file diff --git a/docs/models/components/typecleartooluses20250919.md b/docs/models/components/typecleartooluses20250919.md new file mode 100644 index 00000000..364c245c --- /dev/null +++ b/docs/models/components/typecleartooluses20250919.md @@ -0,0 +1,18 @@ +# TypeClearToolUses20250919 + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeClearToolUses20250919ClearToolUses20250919 +``` + + +## Values + +| Name | Value | +| ------------------------------------------------ | ------------------------------------------------ | +| `TypeClearToolUses20250919ClearToolUses20250919` | clear_tool_uses_20250919 | \ No newline at end of file diff --git a/docs/models/components/typecompact20260112.md b/docs/models/components/typecompact20260112.md new file mode 100644 index 00000000..3d40a15a --- /dev/null +++ b/docs/models/components/typecompact20260112.md @@ -0,0 +1,18 @@ +# TypeCompact20260112 + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeCompact20260112Compact20260112 +``` + + +## Values + +| Name | Value | +| ------------------------------------ | ------------------------------------ | +| `TypeCompact20260112Compact20260112` | compact_20260112 | \ No newline at end of file diff --git a/docs/models/components/typecustom.md b/docs/models/components/typecustom.md deleted file mode 100644 index dacb60d8..00000000 --- a/docs/models/components/typecustom.md +++ /dev/null @@ -1,18 +0,0 @@ -# TypeCustom - -## Example Usage - -```go -import ( - "github.com/OpenRouterTeam/go-sdk/models/components" -) - -value := components.TypeCustomCustom -``` - - -## Values - -| Name | Value | -| ------------------ | ------------------ | -| `TypeCustomCustom` | custom | \ No newline at end of file diff --git a/docs/models/components/typedisabled.md b/docs/models/components/typedisabled.md new file mode 100644 index 00000000..9d98160c --- /dev/null +++ b/docs/models/components/typedisabled.md @@ -0,0 +1,18 @@ +# TypeDisabled + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeDisabledDisabled +``` + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `TypeDisabledDisabled` | disabled | \ No newline at end of file diff --git a/docs/models/components/typedocument.md b/docs/models/components/typedocument.md new file mode 100644 index 00000000..b0bae218 --- /dev/null +++ b/docs/models/components/typedocument.md @@ -0,0 +1,18 @@ +# TypeDocument + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeDocumentDocument +``` + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `TypeDocumentDocument` | document | \ No newline at end of file diff --git a/docs/models/components/typeenabled.md b/docs/models/components/typeenabled.md new file mode 100644 index 00000000..e1789413 --- /dev/null +++ b/docs/models/components/typeenabled.md @@ -0,0 +1,18 @@ +# TypeEnabled + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeEnabledEnabled +``` + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `TypeEnabledEnabled` | enabled | \ No newline at end of file diff --git a/docs/models/components/typeexec.md b/docs/models/components/typeexec.md new file mode 100644 index 00000000..fdf7666a --- /dev/null +++ b/docs/models/components/typeexec.md @@ -0,0 +1,18 @@ +# TypeExec + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeExecExec +``` + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `TypeExecExec` | exec | \ No newline at end of file diff --git a/docs/models/components/typeexit.md b/docs/models/components/typeexit.md new file mode 100644 index 00000000..16ad0846 --- /dev/null +++ b/docs/models/components/typeexit.md @@ -0,0 +1,18 @@ +# TypeExit + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeExitExit +``` + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `TypeExitExit` | exit | \ No newline at end of file diff --git a/docs/models/components/typeimage.md b/docs/models/components/typeimage.md deleted file mode 100644 index 92d543e2..00000000 --- a/docs/models/components/typeimage.md +++ /dev/null @@ -1,18 +0,0 @@ -# TypeImage - -## Example Usage - -```go -import ( - "github.com/OpenRouterTeam/go-sdk/models/components" -) - -value := components.TypeImageImage -``` - - -## Values - -| Name | Value | -| ---------------- | ---------------- | -| `TypeImageImage` | image | \ No newline at end of file diff --git a/docs/models/components/typelocalshellcall.md b/docs/models/components/typelocalshellcall.md new file mode 100644 index 00000000..9c48d27f --- /dev/null +++ b/docs/models/components/typelocalshellcall.md @@ -0,0 +1,18 @@ +# TypeLocalShellCall + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeLocalShellCallLocalShellCall +``` + + +## Values + +| Name | Value | +| ---------------------------------- | ---------------------------------- | +| `TypeLocalShellCallLocalShellCall` | local_shell_call | \ No newline at end of file diff --git a/docs/models/components/typenone.md b/docs/models/components/typenone.md new file mode 100644 index 00000000..725ae370 --- /dev/null +++ b/docs/models/components/typenone.md @@ -0,0 +1,18 @@ +# TypeNone + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeNoneNone +``` + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `TypeNoneNone` | none | \ No newline at end of file diff --git a/docs/models/components/typeredactedthinking.md b/docs/models/components/typeredactedthinking.md new file mode 100644 index 00000000..c5847135 --- /dev/null +++ b/docs/models/components/typeredactedthinking.md @@ -0,0 +1,18 @@ +# TypeRedactedThinking + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeRedactedThinkingRedactedThinking +``` + + +## Values + +| Name | Value | +| -------------------------------------- | -------------------------------------- | +| `TypeRedactedThinkingRedactedThinking` | redacted_thinking | \ No newline at end of file diff --git a/docs/models/components/typeservertooluse.md b/docs/models/components/typeservertooluse.md new file mode 100644 index 00000000..f6f127c8 --- /dev/null +++ b/docs/models/components/typeservertooluse.md @@ -0,0 +1,18 @@ +# TypeServerToolUse + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeServerToolUseServerToolUse +``` + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `TypeServerToolUseServerToolUse` | server_tool_use | \ No newline at end of file diff --git a/docs/models/components/typetexteditor20250124.md b/docs/models/components/typetexteditor20250124.md new file mode 100644 index 00000000..b5683c44 --- /dev/null +++ b/docs/models/components/typetexteditor20250124.md @@ -0,0 +1,18 @@ +# TypeTextEditor20250124 + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeTextEditor20250124TextEditor20250124 +``` + + +## Values + +| Name | Value | +| ------------------------------------------ | ------------------------------------------ | +| `TypeTextEditor20250124TextEditor20250124` | text_editor_20250124 | \ No newline at end of file diff --git a/docs/models/components/typethinking.md b/docs/models/components/typethinking.md new file mode 100644 index 00000000..e235c198 --- /dev/null +++ b/docs/models/components/typethinking.md @@ -0,0 +1,18 @@ +# TypeThinking + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeThinkingThinking +``` + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `TypeThinkingThinking` | thinking | \ No newline at end of file diff --git a/docs/models/components/typetimeout.md b/docs/models/components/typetimeout.md new file mode 100644 index 00000000..acb1a418 --- /dev/null +++ b/docs/models/components/typetimeout.md @@ -0,0 +1,18 @@ +# TypeTimeout + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeTimeoutTimeout +``` + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `TypeTimeoutTimeout` | timeout | \ No newline at end of file diff --git a/docs/models/components/typesearch.md b/docs/models/components/typetokens.md similarity index 67% rename from docs/models/components/typesearch.md rename to docs/models/components/typetokens.md index 3601265a..7817f599 100644 --- a/docs/models/components/typesearch.md +++ b/docs/models/components/typetokens.md @@ -1,4 +1,4 @@ -# TypeSearch +# TypeTokens ## Example Usage @@ -7,7 +7,7 @@ import ( "github.com/OpenRouterTeam/go-sdk/models/components" ) -value := components.TypeSearchSearch +value := components.TypeTokensTokens ``` @@ -15,4 +15,4 @@ value := components.TypeSearchSearch | Name | Value | | ------------------ | ------------------ | -| `TypeSearchSearch` | search | \ No newline at end of file +| `TypeTokensTokens` | tokens | \ No newline at end of file diff --git a/docs/models/components/typetool.md b/docs/models/components/typetool.md new file mode 100644 index 00000000..04d932cc --- /dev/null +++ b/docs/models/components/typetool.md @@ -0,0 +1,18 @@ +# TypeTool + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeToolTool +``` + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `TypeToolTool` | tool | \ No newline at end of file diff --git a/docs/models/components/typetoolreference.md b/docs/models/components/typetoolreference.md new file mode 100644 index 00000000..95bbdc91 --- /dev/null +++ b/docs/models/components/typetoolreference.md @@ -0,0 +1,18 @@ +# TypeToolReference + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeToolReferenceToolReference +``` + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `TypeToolReferenceToolReference` | tool_reference | \ No newline at end of file diff --git a/docs/models/components/typetoolresult.md b/docs/models/components/typetoolresult.md new file mode 100644 index 00000000..fc81170e --- /dev/null +++ b/docs/models/components/typetoolresult.md @@ -0,0 +1,18 @@ +# TypeToolResult + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeToolResultToolResult +``` + + +## Values + +| Name | Value | +| -------------------------- | -------------------------- | +| `TypeToolResultToolResult` | tool_result | \ No newline at end of file diff --git a/docs/models/components/typetooluse.md b/docs/models/components/typetooluse.md new file mode 100644 index 00000000..7027b4c5 --- /dev/null +++ b/docs/models/components/typetooluse.md @@ -0,0 +1,18 @@ +# TypeToolUse + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeToolUseToolUse +``` + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `TypeToolUseToolUse` | tool_use | \ No newline at end of file diff --git a/docs/models/components/typewebsearch20250305.md b/docs/models/components/typewebsearch20250305.md new file mode 100644 index 00000000..dd4cdeb5 --- /dev/null +++ b/docs/models/components/typewebsearch20250305.md @@ -0,0 +1,18 @@ +# TypeWebSearch20250305 + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeWebSearch20250305WebSearch20250305 +``` + + +## Values + +| Name | Value | +| ---------------------------------------- | ---------------------------------------- | +| `TypeWebSearch20250305WebSearch20250305` | web_search_20250305 | \ No newline at end of file diff --git a/docs/models/components/typewebsearch20260209.md b/docs/models/components/typewebsearch20260209.md new file mode 100644 index 00000000..f46930e3 --- /dev/null +++ b/docs/models/components/typewebsearch20260209.md @@ -0,0 +1,18 @@ +# TypeWebSearch20260209 + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeWebSearch20260209WebSearch20260209 +``` + + +## Values + +| Name | Value | +| ---------------------------------------- | ---------------------------------------- | +| `TypeWebSearch20260209WebSearch20260209` | web_search_20260209 | \ No newline at end of file diff --git a/docs/models/components/typewebsearchtoolresult.md b/docs/models/components/typewebsearchtoolresult.md new file mode 100644 index 00000000..d5420446 --- /dev/null +++ b/docs/models/components/typewebsearchtoolresult.md @@ -0,0 +1,18 @@ +# TypeWebSearchToolResult + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.TypeWebSearchToolResultWebSearchToolResult +``` + + +## Values + +| Name | Value | +| -------------------------------------------- | -------------------------------------------- | +| `TypeWebSearchToolResultWebSearchToolResult` | web_search_tool_result | \ No newline at end of file diff --git a/docs/models/components/outputwebsearchservertoolitemtype.md b/docs/models/components/typewebsearchtoolresulterror.md similarity index 60% rename from docs/models/components/outputwebsearchservertoolitemtype.md rename to docs/models/components/typewebsearchtoolresulterror.md index fd5bdfc9..96182c70 100644 --- a/docs/models/components/outputwebsearchservertoolitemtype.md +++ b/docs/models/components/typewebsearchtoolresulterror.md @@ -1,4 +1,4 @@ -# OutputWebSearchServerToolItemType +# TypeWebSearchToolResultError ## Example Usage @@ -7,7 +7,7 @@ import ( "github.com/OpenRouterTeam/go-sdk/models/components" ) -value := components.OutputWebSearchServerToolItemTypeOpenrouterWebSearch +value := components.TypeWebSearchToolResultErrorWebSearchToolResultError ``` @@ -15,4 +15,4 @@ value := components.OutputWebSearchServerToolItemTypeOpenrouterWebSearch | Name | Value | | ------------------------------------------------------ | ------------------------------------------------------ | -| `OutputWebSearchServerToolItemTypeOpenrouterWebSearch` | openrouter:web_search | \ No newline at end of file +| `TypeWebSearchToolResultErrorWebSearchToolResultError` | web_search_tool_result_error | \ No newline at end of file diff --git a/docs/models/components/uniqueinsight.md b/docs/models/components/uniqueinsight.md new file mode 100644 index 00000000..4a226787 --- /dev/null +++ b/docs/models/components/uniqueinsight.md @@ -0,0 +1,9 @@ +# UniqueInsight + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Insight` | `string` | :heavy_check_mark: | N/A | +| `Model` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/updatebyokkeyrequest.md b/docs/models/components/updatebyokkeyrequest.md new file mode 100644 index 00000000..b4403546 --- /dev/null +++ b/docs/models/components/updatebyokkeyrequest.md @@ -0,0 +1,13 @@ +# UpdateBYOKKeyRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AllowedModels` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Optional allowlist of model slugs this credential may be used for. `null` means no restriction. | null | +| `AllowedUserIds` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Optional allowlist of user IDs that may use this credential. `null` means no restriction. | null | +| `Disabled` | `*bool` | :heavy_minus_sign: | Whether this credential is disabled. | false | +| `IsFallback` | `*bool` | :heavy_minus_sign: | Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried. | false | +| `Key` | `*string` | :heavy_minus_sign: | A new raw provider API key to rotate the credential in-place. The previous key material is overwritten and the masked label is regenerated. Encrypted at rest and never returned in API responses. | sk-proj-newkey456... | +| `Name` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Optional human-readable name for the credential. | Updated OpenAI Key | \ No newline at end of file diff --git a/docs/models/components/updatebyokkeyresponse.md b/docs/models/components/updatebyokkeyresponse.md new file mode 100644 index 00000000..45aaa004 --- /dev/null +++ b/docs/models/components/updatebyokkeyresponse.md @@ -0,0 +1,8 @@ +# UpdateBYOKKeyResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Data` | [components.BYOKKey](../../models/components/byokkey.md) | :heavy_check_mark: | N/A | {
"allowed_api_key_hashes": null,
"allowed_models": null,
"allowed_user_ids": null,
"created_at": "2025-08-24T10:30:00Z",
"disabled": false,
"id": "11111111-2222-3333-4444-555555555555",
"is_fallback": false,
"label": "sk-...AbCd",
"name": "Production OpenAI Key",
"provider": "openai",
"sort_order": 0,
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
} | \ No newline at end of file diff --git a/docs/models/components/updateguardrailrequest.md b/docs/models/components/updateguardrailrequest.md index 2966bd91..c0137320 100644 --- a/docs/models/components/updateguardrailrequest.md +++ b/docs/models/components/updateguardrailrequest.md @@ -3,14 +3,20 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `AllowedModels` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2"
] | -| `AllowedProviders` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | New list of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | -| `Description` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | New description for the guardrail | Updated description | -| `EnforceZdr` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | Whether to enforce zero data retention | true | -| `IgnoredModels` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Array of model identifiers to exclude from routing (slug or canonical_slug accepted) | [
"openai/gpt-4o-mini"
] | -| `IgnoredProviders` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | -| `LimitUsd` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | New spending limit in USD | 75 | -| `Name` | `*string` | :heavy_minus_sign: | New name for the guardrail | Updated Guardrail Name | -| `ResetInterval` | optionalnullable.OptionalNullable[[components.GuardrailInterval](../../models/components/guardrailinterval.md)] | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AllowedModels` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2"
] | +| `AllowedProviders` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | New list of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | +| `ContentFilterBuiltins` | optionalnullable.OptionalNullable[[][components.ContentFilterBuiltinEntryInput](../../models/components/contentfilterbuiltinentryinput.md)] | :heavy_minus_sign: | Builtin content filters to apply. Set to null to remove. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only. | [
{
"action": "block",
"slug": "regex-prompt-injection"
}
] | +| `ContentFilters` | optionalnullable.OptionalNullable[[][components.ContentFilterEntry](../../models/components/contentfilterentry.md)] | :heavy_minus_sign: | Custom regex content filters to apply. Set to null to remove. | null | +| `Description` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | New description for the guardrail | Updated description | +| ~~`EnforceZdr`~~ | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. | true | +| `EnforceZdrAnthropic` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. | true | +| `EnforceZdrGoogle` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. | true | +| `EnforceZdrOpenai` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. | true | +| `EnforceZdrOther` | optionalnullable.OptionalNullable[`bool`] | :heavy_minus_sign: | Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided. | true | +| `IgnoredModels` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Array of model identifiers to exclude from routing (slug or canonical_slug accepted) | [
"openai/gpt-4o-mini"
] | +| `IgnoredProviders` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | +| `LimitUsd` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | New spending limit in USD | 75 | +| `Name` | `*string` | :heavy_minus_sign: | New name for the guardrail | Updated Guardrail Name | +| `ResetInterval` | optionalnullable.OptionalNullable[[components.GuardrailInterval](../../models/components/guardrailinterval.md)] | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | \ No newline at end of file diff --git a/docs/models/components/updateguardrailresponse.md b/docs/models/components/updateguardrailresponse.md index 44498fdb..b3ade8c3 100644 --- a/docs/models/components/updateguardrailresponse.md +++ b/docs/models/components/updateguardrailresponse.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Data` | [components.Guardrail](../../models/components/guardrail.md) | :heavy_check_mark: | N/A | {
"allowed_models": null,
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"created_at": "2025-08-24T10:30:00Z",
"description": "Guardrail for production environment",
"enforce_zdr": false,
"id": "550e8400-e29b-41d4-a716-446655440000",
"ignored_models": null,
"ignored_providers": null,
"limit_usd": 100,
"name": "Production Guardrail",
"reset_interval": "monthly",
"updated_at": "2025-08-24T15:45:00Z",
"workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Data` | [components.Guardrail](../../models/components/guardrail.md) | :heavy_check_mark: | N/A | {
"allowed_models": null,
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"content_filter_builtins": [
{
"action": "redact",
"label": "[EMAIL]",
"slug": "email"
}
],
"content_filters": null,
"created_at": "2025-08-24T10:30:00Z",
"description": "Guardrail for production environment",
"enforce_zdr": null,
"enforce_zdr_anthropic": true,
"enforce_zdr_google": false,
"enforce_zdr_openai": true,
"enforce_zdr_other": false,
"id": "550e8400-e29b-41d4-a716-446655440000",
"ignored_models": null,
"ignored_providers": null,
"limit_usd": 100,
"name": "Production Guardrail",
"reset_interval": "monthly",
"updated_at": "2025-08-24T15:45:00Z",
"workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"
} | \ No newline at end of file diff --git a/docs/models/components/updateobservabilitydestinationrequest.md b/docs/models/components/updateobservabilitydestinationrequest.md new file mode 100644 index 00000000..3aa8de7c --- /dev/null +++ b/docs/models/components/updateobservabilitydestinationrequest.md @@ -0,0 +1,14 @@ +# UpdateObservabilityDestinationRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `APIKeyHashes` | optionalnullable.OptionalNullable[[]`string`] | :heavy_minus_sign: | Optional allowlist of OpenRouter API key hashes. `null` clears the filter (all keys). Omitting leaves the current value. Must contain at least one hash if provided. | null | +| `Config` | map[string]`any` | :heavy_minus_sign: | Provider-specific configuration fields to update. Masked values are ignored; unset fields keep their current value. | {
"baseUrl": "https://us.cloud.langfuse.com",
"publicKey": "pk-l...EfGh",
"secretKey": "sk-l...AbCd"
} | +| `Enabled` | `*bool` | :heavy_minus_sign: | Whether the destination is enabled. | true | +| `FilterRules` | optionalnullable.OptionalNullable[[components.ObservabilityFilterRulesConfig](../../models/components/observabilityfilterrulesconfig.md)] | :heavy_minus_sign: | N/A | null | +| `Name` | `*string` | :heavy_minus_sign: | Human-readable name for the destination. | Production Langfuse | +| `PrivacyMode` | `*bool` | :heavy_minus_sign: | When true, request/response bodies are not forwarded — only metadata. | false | +| `SamplingRate` | `*float64` | :heavy_minus_sign: | Sampling rate between 0.0001 and 1 (1 = 100%). | 1 | \ No newline at end of file diff --git a/docs/models/components/updateobservabilitydestinationresponse.md b/docs/models/components/updateobservabilitydestinationresponse.md new file mode 100644 index 00000000..fa1ecfdb --- /dev/null +++ b/docs/models/components/updateobservabilitydestinationresponse.md @@ -0,0 +1,8 @@ +# UpdateObservabilityDestinationResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Data` | [components.ObservabilityDestination](../../models/components/observabilitydestination.md) | :heavy_check_mark: | N/A | {
"api_key_hashes": null,
"config": {
"baseUrl": "https://us.cloud.langfuse.com",
"publicKey": "pk-l...EfGh",
"secretKey": "sk-l...AbCd"
},
"created_at": "2025-08-24T10:30:00Z",
"enabled": true,
"filter_rules": null,
"id": "99999999-aaaa-bbbb-cccc-dddddddddddd",
"name": "Production Langfuse",
"privacy_mode": false,
"sampling_rate": 1,
"type": "langfuse",
"updated_at": "2025-08-24T15:45:00Z",
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
} | \ No newline at end of file diff --git a/docs/models/components/updateworkspacerequest.md b/docs/models/components/updateworkspacerequest.md index a1d4a167..83b157b5 100644 --- a/docs/models/components/updateworkspacerequest.md +++ b/docs/models/components/updateworkspacerequest.md @@ -3,14 +3,16 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `DefaultImageModel` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Default image model for this workspace | openai/dall-e-3 | -| `DefaultProviderSort` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Default provider sort preference (price, throughput, latency, exacto) | price | -| `DefaultTextModel` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Default text model for this workspace | openai/gpt-4o | -| `Description` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | New description for the workspace | Updated description | -| `IsDataDiscountLoggingEnabled` | `*bool` | :heavy_minus_sign: | Whether data discount logging is enabled | true | -| `IsObservabilityBroadcastEnabled` | `*bool` | :heavy_minus_sign: | Whether broadcast is enabled | false | -| `IsObservabilityIoLoggingEnabled` | `*bool` | :heavy_minus_sign: | Whether private logging is enabled | false | -| `Name` | `*string` | :heavy_minus_sign: | New name for the workspace | Updated Workspace | -| `Slug` | `*string` | :heavy_minus_sign: | New URL-friendly slug | updated-workspace | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `DefaultImageModel` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Default image model for this workspace | openai/dall-e-3 | +| `DefaultProviderSort` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Default provider sort preference (price, throughput, latency, exacto) | price | +| `DefaultTextModel` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | Default text model for this workspace | openai/gpt-4o | +| `Description` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | New description for the workspace | Updated description | +| `IoLoggingAPIKeyIds` | optionalnullable.OptionalNullable[[]`int64`] | :heavy_minus_sign: | Optional array of API key IDs to filter I/O logging | null | +| `IoLoggingSamplingRate` | `*float64` | :heavy_minus_sign: | Sampling rate for I/O logging (0.0001-1) | 1 | +| `IsDataDiscountLoggingEnabled` | `*bool` | :heavy_minus_sign: | Whether data discount logging is enabled | true | +| `IsObservabilityBroadcastEnabled` | `*bool` | :heavy_minus_sign: | Whether broadcast is enabled | false | +| `IsObservabilityIoLoggingEnabled` | `*bool` | :heavy_minus_sign: | Whether private logging is enabled | false | +| `Name` | `*string` | :heavy_minus_sign: | New name for the workspace | Updated Workspace | +| `Slug` | `*string` | :heavy_minus_sign: | New URL-friendly slug (lowercase alphanumeric segments separated by single hyphens, no leading/trailing hyphens) | updated-workspace | \ No newline at end of file diff --git a/docs/models/components/updateworkspaceresponse.md b/docs/models/components/updateworkspaceresponse.md index 42d38813..996da2b8 100644 --- a/docs/models/components/updateworkspaceresponse.md +++ b/docs/models/components/updateworkspaceresponse.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Data` | [components.Workspace](../../models/components/workspace.md) | :heavy_check_mark: | N/A | {
"created_at": "2025-08-24T10:30:00Z",
"created_by": "user_abc123",
"default_image_model": "openai/dall-e-3",
"default_provider_sort": "price",
"default_text_model": "openai/gpt-4o",
"description": "Production environment workspace",
"id": "550e8400-e29b-41d4-a716-446655440000",
"is_data_discount_logging_enabled": true,
"is_observability_broadcast_enabled": false,
"is_observability_io_logging_enabled": false,
"name": "Production",
"slug": "production",
"updated_at": "2025-08-24T15:45:00Z"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Data` | [components.Workspace](../../models/components/workspace.md) | :heavy_check_mark: | N/A | {
"created_at": "2025-08-24T10:30:00Z",
"created_by": "user_abc123",
"default_image_model": "openai/dall-e-3",
"default_provider_sort": "price",
"default_text_model": "openai/gpt-4o",
"description": "Production environment workspace",
"id": "550e8400-e29b-41d4-a716-446655440000",
"io_logging_api_key_ids": null,
"io_logging_sampling_rate": 1,
"is_data_discount_logging_enabled": true,
"is_observability_broadcast_enabled": false,
"is_observability_io_logging_enabled": false,
"name": "Production",
"slug": "production",
"updated_at": "2025-08-24T15:45:00Z"
} | \ No newline at end of file diff --git a/docs/models/components/urlcitation.md b/docs/models/components/urlcitation.md index 3914a626..eb835845 100644 --- a/docs/models/components/urlcitation.md +++ b/docs/models/components/urlcitation.md @@ -5,6 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `Content` | `*string` | :heavy_minus_sign: | N/A | | `EndIndex` | `int64` | :heavy_check_mark: | N/A | | `StartIndex` | `int64` | :heavy_check_mark: | N/A | | `Title` | `string` | :heavy_check_mark: | N/A | diff --git a/docs/models/components/usage.md b/docs/models/components/usage.md index 594806cc..9d66fbbd 100644 --- a/docs/models/components/usage.md +++ b/docs/models/components/usage.md @@ -13,5 +13,5 @@ Token usage information for the response | `OutputTokensDetails` | [components.OutputTokensDetails](../../models/components/outputtokensdetails.md) | :heavy_check_mark: | N/A | | `TotalTokens` | `int64` | :heavy_check_mark: | N/A | | `Cost` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | Cost of the completion | -| `CostDetails` | [*components.CostDetails](../../models/components/costdetails.md) | :heavy_minus_sign: | N/A | +| `CostDetails` | [*components.UsageCostDetails](../../models/components/usagecostdetails.md) | :heavy_minus_sign: | N/A | | `IsByok` | `*bool` | :heavy_minus_sign: | Whether a request was made using a Bring Your Own Key configuration | \ No newline at end of file diff --git a/docs/models/components/usagecostdetails.md b/docs/models/components/usagecostdetails.md new file mode 100644 index 00000000..467b7a4b --- /dev/null +++ b/docs/models/components/usagecostdetails.md @@ -0,0 +1,10 @@ +# UsageCostDetails + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `UpstreamInferenceCost` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | N/A | +| `UpstreamInferenceInputCost` | `float64` | :heavy_check_mark: | N/A | +| `UpstreamInferenceOutputCost` | `float64` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/userlocation.md b/docs/models/components/userlocation.md new file mode 100644 index 00000000..6dc967cd --- /dev/null +++ b/docs/models/components/userlocation.md @@ -0,0 +1,14 @@ +# UserLocation + +Approximate user location for location-biased search results. Passed through to native providers that support it (e.g. Anthropic). + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `City` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `Country` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `Region` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `Timezone` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `Type` | [components.WebSearchPluginType](../../models/components/websearchplugintype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/value1.md b/docs/models/components/value1.md deleted file mode 100644 index bc734a31..00000000 --- a/docs/models/components/value1.md +++ /dev/null @@ -1,29 +0,0 @@ -# Value1 - - -## Supported Types - -### - -```go -value1 := components.CreateValue1Str(string{/* values here */}) -``` - -### - -```go -value1 := components.CreateValue1Number(float64{/* values here */}) -``` - -## Union Discrimination - -Use the `Type` field to determine which variant is active, then access the corresponding field: - -```go -switch value1.Type { - case components.Value1TypeStr: - // value1.Str is populated - case components.Value1TypeNumber: - // value1.Number is populated -} -``` diff --git a/docs/models/components/value2.md b/docs/models/components/value2.md deleted file mode 100644 index d24c0fd7..00000000 --- a/docs/models/components/value2.md +++ /dev/null @@ -1,45 +0,0 @@ -# Value2 - - -## Supported Types - -### - -```go -value2 := components.CreateValue2Str(string{/* values here */}) -``` - -### - -```go -value2 := components.CreateValue2Number(float64{/* values here */}) -``` - -### - -```go -value2 := components.CreateValue2Boolean(bool{/* values here */}) -``` - -### - -```go -value2 := components.CreateValue2ArrayOfValue1([]components.Value1{/* values here */}) -``` - -## Union Discrimination - -Use the `Type` field to determine which variant is active, then access the corresponding field: - -```go -switch value2.Type { - case components.Value2TypeStr: - // value2.Str is populated - case components.Value2TypeNumber: - // value2.Number is populated - case components.Value2TypeBoolean: - // value2.Boolean is populated - case components.Value2TypeArrayOfValue1: - // value2.ArrayOfValue1 is populated -} -``` diff --git a/docs/models/components/videogenerationrequest.md b/docs/models/components/videogenerationrequest.md index 5eb30ea0..42fffa6b 100644 --- a/docs/models/components/videogenerationrequest.md +++ b/docs/models/components/videogenerationrequest.md @@ -3,16 +3,17 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AspectRatio` | [*components.AspectRatio](../../models/components/aspectratio.md) | :heavy_minus_sign: | Aspect ratio of the generated video | 16:9 | -| `Duration` | `*int64` | :heavy_minus_sign: | Duration of the generated video in seconds | 8 | -| `FrameImages` | [][components.FrameImage](../../models/components/frameimage.md) | :heavy_minus_sign: | Images to use as the first and/or last frame of the generated video. Each image must specify a frame_type of first_frame or last_frame. | | -| `GenerateAudio` | `*bool` | :heavy_minus_sign: | Whether to generate audio alongside the video. Defaults to the endpoint's generate_audio capability flag, false if not set. | true | -| `InputReferences` | [][components.ContentPartImage](../../models/components/contentpartimage.md) | :heavy_minus_sign: | Reference images to guide video generation | | -| `Model` | `string` | :heavy_check_mark: | N/A | | -| `Prompt` | `string` | :heavy_check_mark: | N/A | | -| `Provider` | [*components.VideoGenerationRequestProvider](../../models/components/videogenerationrequestprovider.md) | :heavy_minus_sign: | Provider-specific passthrough configuration | | -| `Resolution` | [*components.Resolution](../../models/components/resolution.md) | :heavy_minus_sign: | Resolution of the generated video | 720p | -| `Seed` | `*int64` | :heavy_minus_sign: | If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. | | -| `Size` | `*string` | :heavy_minus_sign: | Exact pixel dimensions of the generated video in "WIDTHxHEIGHT" format (e.g. "1280x720"). Interchangeable with resolution + aspect_ratio. | 1280x720 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AspectRatio` | [*components.AspectRatio](../../models/components/aspectratio.md) | :heavy_minus_sign: | Aspect ratio of the generated video | 16:9 | +| `CallbackURL` | `*string` | :heavy_minus_sign: | URL to receive a webhook notification when the video generation job completes. Overrides the workspace-level default callback URL if set. Must be HTTPS. | https://example.com/webhook | +| `Duration` | `*int64` | :heavy_minus_sign: | Duration of the generated video in seconds | 8 | +| `FrameImages` | [][components.FrameImage](../../models/components/frameimage.md) | :heavy_minus_sign: | Images to use as the first and/or last frame of the generated video. Each image must specify a frame_type of first_frame or last_frame. | | +| `GenerateAudio` | `*bool` | :heavy_minus_sign: | Whether to generate audio alongside the video. Defaults to the endpoint's generate_audio capability flag, false if not set. | true | +| `InputReferences` | [][components.InputReference](../../models/components/inputreference.md) | :heavy_minus_sign: | Reference assets to guide video generation. Accepts image, audio, and video references. Audio and video references are only honored by providers that support them (currently BytePlus Seedance 2.0); other providers use image references and ignore the rest. | | +| `Model` | `string` | :heavy_check_mark: | N/A | | +| `Prompt` | `string` | :heavy_check_mark: | N/A | | +| `Provider` | [*components.VideoGenerationRequestProvider](../../models/components/videogenerationrequestprovider.md) | :heavy_minus_sign: | Provider-specific passthrough configuration | | +| `Resolution` | [*components.Resolution](../../models/components/resolution.md) | :heavy_minus_sign: | Resolution of the generated video | 720p | +| `Seed` | `*int64` | :heavy_minus_sign: | If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. | | +| `Size` | `*string` | :heavy_minus_sign: | Exact pixel dimensions of the generated video in "WIDTHxHEIGHT" format (e.g. "1280x720"). Interchangeable with resolution + aspect_ratio. | 1280x720 | \ No newline at end of file diff --git a/docs/models/components/videogenerationrequestprovider.md b/docs/models/components/videogenerationrequestprovider.md index d5b125be..49a8222a 100644 --- a/docs/models/components/videogenerationrequestprovider.md +++ b/docs/models/components/videogenerationrequestprovider.md @@ -5,6 +5,6 @@ Provider-specific passthrough configuration ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -| `Options` | [*components.VideoGenerationRequestOptions](../../models/components/videogenerationrequestoptions.md) | :heavy_minus_sign: | Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. | {
"google-vertex": {
"output_config": {
"effort": "low"
}
}
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `Options` | [*components.OptionsObj](../../models/components/optionsobj.md) | :heavy_minus_sign: | N/A | {
"google-vertex": {
"output_config": {
"effort": "low"
}
}
} | \ No newline at end of file diff --git a/docs/models/components/videourl.md b/docs/models/components/videourl.md new file mode 100644 index 00000000..860df93d --- /dev/null +++ b/docs/models/components/videourl.md @@ -0,0 +1,8 @@ +# VideoURL + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `URL` | `string` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/webfetchengineenum.md b/docs/models/components/webfetchengineenum.md new file mode 100644 index 00000000..b7d5a915 --- /dev/null +++ b/docs/models/components/webfetchengineenum.md @@ -0,0 +1,28 @@ +# WebFetchEngineEnum + +Which fetch engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in fetch. "exa" uses Exa Contents API. "openrouter" uses direct HTTP fetch. "firecrawl" uses Firecrawl scrape (requires BYOK). "parallel" uses the Parallel extract API. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.WebFetchEngineEnumAuto + +// Open enum: custom values can be created with a direct type cast +custom := components.WebFetchEngineEnum("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------------ | ------------------------------ | +| `WebFetchEngineEnumAuto` | auto | +| `WebFetchEngineEnumNative` | native | +| `WebFetchEngineEnumOpenrouter` | openrouter | +| `WebFetchEngineEnumExa` | exa | +| `WebFetchEngineEnumParallel` | parallel | +| `WebFetchEngineEnumFirecrawl` | firecrawl | \ No newline at end of file diff --git a/docs/models/components/webfetchplugin.md b/docs/models/components/webfetchplugin.md new file mode 100644 index 00000000..87adf48e --- /dev/null +++ b/docs/models/components/webfetchplugin.md @@ -0,0 +1,12 @@ +# WebFetchPlugin + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `AllowedDomains` | []`string` | :heavy_minus_sign: | Only fetch from these domains. | +| `BlockedDomains` | []`string` | :heavy_minus_sign: | Never fetch from these domains. | +| `ID` | [components.WebFetchPluginID](../../models/components/webfetchpluginid.md) | :heavy_check_mark: | N/A | +| `MaxContentTokens` | `*int64` | :heavy_minus_sign: | Maximum content length in approximate tokens. Content exceeding this limit is truncated. | +| `MaxUses` | `*int64` | :heavy_minus_sign: | Maximum number of web fetches per request. Once exceeded, the tool returns an error. | \ No newline at end of file diff --git a/docs/models/components/webfetchpluginid.md b/docs/models/components/webfetchpluginid.md new file mode 100644 index 00000000..279056e5 --- /dev/null +++ b/docs/models/components/webfetchpluginid.md @@ -0,0 +1,18 @@ +# WebFetchPluginID + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.WebFetchPluginIDWebFetch +``` + + +## Values + +| Name | Value | +| -------------------------- | -------------------------- | +| `WebFetchPluginIDWebFetch` | web-fetch | \ No newline at end of file diff --git a/docs/models/components/webfetchservertool.md b/docs/models/components/webfetchservertool.md new file mode 100644 index 00000000..b846c09a --- /dev/null +++ b/docs/models/components/webfetchservertool.md @@ -0,0 +1,11 @@ +# WebFetchServerTool + +OpenRouter built-in server tool: fetches full content from a URL (web page or PDF) + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `Parameters` | [*components.WebFetchServerToolConfig](../../models/components/webfetchservertoolconfig.md) | :heavy_minus_sign: | Configuration for the openrouter:web_fetch server tool | {
"max_content_tokens": 100000,
"max_uses": 10
} | +| `Type` | [components.WebFetchServerToolType](../../models/components/webfetchservertooltype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/webfetchservertoolconfig.md b/docs/models/components/webfetchservertoolconfig.md new file mode 100644 index 00000000..b4febd02 --- /dev/null +++ b/docs/models/components/webfetchservertoolconfig.md @@ -0,0 +1,14 @@ +# WebFetchServerToolConfig + +Configuration for the openrouter:web_fetch server tool + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AllowedDomains` | []`string` | :heavy_minus_sign: | Only fetch from these domains. | | +| `BlockedDomains` | []`string` | :heavy_minus_sign: | Never fetch from these domains. | | +| `Engine` | [*components.WebFetchEngineEnum](../../models/components/webfetchengineenum.md) | :heavy_minus_sign: | Which fetch engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in fetch. "exa" uses Exa Contents API. "openrouter" uses direct HTTP fetch. "firecrawl" uses Firecrawl scrape (requires BYOK). "parallel" uses the Parallel extract API. | auto | +| `MaxContentTokens` | `*int64` | :heavy_minus_sign: | Maximum content length in approximate tokens. Content exceeding this limit is truncated. | 100000 | +| `MaxUses` | `*int64` | :heavy_minus_sign: | Maximum number of web fetches per request. Once exceeded, the tool returns an error. | 10 | \ No newline at end of file diff --git a/docs/models/components/webfetchservertooltype.md b/docs/models/components/webfetchservertooltype.md new file mode 100644 index 00000000..e5689fe0 --- /dev/null +++ b/docs/models/components/webfetchservertooltype.md @@ -0,0 +1,18 @@ +# WebFetchServerToolType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.WebFetchServerToolTypeOpenrouterWebFetch +``` + + +## Values + +| Name | Value | +| ------------------------------------------ | ------------------------------------------ | +| `WebFetchServerToolTypeOpenrouterWebFetch` | openrouter:web_fetch | \ No newline at end of file diff --git a/docs/models/components/websearchconfig.md b/docs/models/components/websearchconfig.md index a981df87..61fea616 100644 --- a/docs/models/components/websearchconfig.md +++ b/docs/models/components/websearchconfig.md @@ -3,12 +3,13 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `AllowedDomains` | []`string` | :heavy_minus_sign: | Limit search results to these domains. Supported by Exa, Parallel, and most native providers (Anthropic, OpenAI, xAI). Not supported with Firecrawl or Perplexity. | | -| `Engine` | [*components.WebSearchEngineEnum](../../models/components/websearchengineenum.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. | auto | -| `ExcludedDomains` | []`string` | :heavy_minus_sign: | Exclude search results from these domains. Supported by Exa, Parallel, Anthropic, and xAI. Not supported with Firecrawl, OpenAI (silently ignored), or Perplexity. | | -| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and Parallel engines; ignored with native provider search. | 5 | -| `MaxTotalResults` | `*int64` | :heavy_minus_sign: | Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. | 20 | -| `SearchContextSize` | [*components.SearchQualityLevel](../../models/components/searchqualitylevel.md) | :heavy_minus_sign: | How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search. | medium | -| `UserLocation` | [*components.WebSearchUserLocationServerTool](../../models/components/websearchuserlocationservertool.md) | :heavy_minus_sign: | Approximate user location for location-biased results. | {
"city": "San Francisco",
"country": "US",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AllowedDomains` | []`string` | :heavy_minus_sign: | Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI, xAI). Cannot be used with excluded_domains. | | +| `Engine` | [*components.WebSearchEngineEnum](../../models/components/websearchengineenum.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). | auto | +| `ExcludedDomains` | []`string` | :heavy_minus_sign: | Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, and xAI. Not supported with OpenAI (silently ignored). Cannot be used with allowed_domains. | | +| `MaxCharacters` | `*int64` | :heavy_minus_sign: | Exact maximum number of characters of content per search result. Applies to the Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, caps highlight content per result. For Parallel, caps excerpt content per result (default 1,500 when omitted). For Perplexity, maps to the native `max_tokens_per_page` parameter (converted from characters to tokens) and trims the response to the exact character cap. When both `max_characters` and `search_context_size` are set, `max_characters` takes precedence. When omitted, falls back to `search_context_size` mapping (Exa) or engine defaults (Parallel, Perplexity). | 2000 | +| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. | 5 | +| `MaxTotalResults` | `*int64` | :heavy_minus_sign: | Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. Defaults to 50 when not specified. | 50 | +| `SearchContextSize` | [*components.SearchQualityLevel](../../models/components/searchqualitylevel.md) | :heavy_minus_sign: | How much context to retrieve per result. Applies to Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, pins a fixed per-result character cap (low=5,000, medium=15,000, high=30,000); when omitted, Exa picks an adaptive size per query and document (typically ~2,000–4,000 characters per result). For Parallel, controls the total characters across all results; when omitted, Parallel uses its own default size. For Perplexity, maps directly to the Search API's native search_context_size parameter. Overridden by `max_characters` when both are set. | medium | +| `UserLocation` | [*components.WebSearchUserLocationServerTool](../../models/components/websearchuserlocationservertool.md) | :heavy_minus_sign: | Approximate user location for location-biased results. | {
"city": "San Francisco",
"country": "US",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file diff --git a/docs/models/components/websearchengine.md b/docs/models/components/websearchengine.md index 5a417e4b..bb96a4bc 100644 --- a/docs/models/components/websearchengine.md +++ b/docs/models/components/websearchengine.md @@ -18,9 +18,10 @@ custom := components.WebSearchEngine("custom_value") ## Values -| Name | Value | -| -------------------------- | -------------------------- | -| `WebSearchEngineNative` | native | -| `WebSearchEngineExa` | exa | -| `WebSearchEngineFirecrawl` | firecrawl | -| `WebSearchEngineParallel` | parallel | \ No newline at end of file +| Name | Value | +| --------------------------- | --------------------------- | +| `WebSearchEngineNative` | native | +| `WebSearchEngineExa` | exa | +| `WebSearchEngineFirecrawl` | firecrawl | +| `WebSearchEngineParallel` | parallel | +| `WebSearchEnginePerplexity` | perplexity | \ No newline at end of file diff --git a/docs/models/components/websearchengineenum.md b/docs/models/components/websearchengineenum.md index 7304d689..e3979eab 100644 --- a/docs/models/components/websearchengineenum.md +++ b/docs/models/components/websearchengineenum.md @@ -1,6 +1,6 @@ # WebSearchEngineEnum -Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. +Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). ## Example Usage @@ -9,7 +9,7 @@ import ( "github.com/OpenRouterTeam/go-sdk/models/components" ) -value := components.WebSearchEngineEnumAuto +value := components.WebSearchEngineEnumNative // Open enum: custom values can be created with a direct type cast custom := components.WebSearchEngineEnum("custom_value") @@ -18,10 +18,11 @@ custom := components.WebSearchEngineEnum("custom_value") ## Values -| Name | Value | -| ------------------------------ | ------------------------------ | -| `WebSearchEngineEnumAuto` | auto | -| `WebSearchEngineEnumNative` | native | -| `WebSearchEngineEnumExa` | exa | -| `WebSearchEngineEnumFirecrawl` | firecrawl | -| `WebSearchEngineEnumParallel` | parallel | \ No newline at end of file +| Name | Value | +| ------------------------------- | ------------------------------- | +| `WebSearchEngineEnumNative` | native | +| `WebSearchEngineEnumExa` | exa | +| `WebSearchEngineEnumParallel` | parallel | +| `WebSearchEngineEnumFirecrawl` | firecrawl | +| `WebSearchEngineEnumPerplexity` | perplexity | +| `WebSearchEngineEnumAuto` | auto | \ No newline at end of file diff --git a/docs/models/components/websearchplugin.md b/docs/models/components/websearchplugin.md index ddf8ec7b..6e50e3b8 100644 --- a/docs/models/components/websearchplugin.md +++ b/docs/models/components/websearchplugin.md @@ -3,12 +3,14 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `Enabled` | `*bool` | :heavy_minus_sign: | Set to false to disable the web-search plugin for this request. Defaults to true. | | -| `Engine` | [*components.WebSearchEngine](../../models/components/websearchengine.md) | :heavy_minus_sign: | The search engine to use for web search. | exa | -| `ExcludeDomains` | []`string` | :heavy_minus_sign: | A list of domains to exclude from web search results. Supports wildcards (e.g. "*.substack.com") and path filtering (e.g. "openai.com/blog"). | [
"example.com",
"*.substack.com",
"openai.com/blog"
] | -| `ID` | [components.WebSearchPluginID](../../models/components/websearchpluginid.md) | :heavy_check_mark: | N/A | | -| `IncludeDomains` | []`string` | :heavy_minus_sign: | A list of domains to restrict web search results to. Supports wildcards (e.g. "*.substack.com") and path filtering (e.g. "openai.com/blog"). | [
"example.com",
"*.substack.com",
"openai.com/blog"
] | -| `MaxResults` | `*int64` | :heavy_minus_sign: | N/A | | -| `SearchPrompt` | `*string` | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| `Enabled` | `*bool` | :heavy_minus_sign: | Set to false to disable the web-search plugin for this request. Defaults to true. | | +| `Engine` | [*components.WebSearchEngine](../../models/components/websearchengine.md) | :heavy_minus_sign: | The search engine to use for web search. | exa | +| `ExcludeDomains` | []`string` | :heavy_minus_sign: | A list of domains to exclude from web search results. Supports wildcards (e.g. "*.substack.com") and path filtering (e.g. "openai.com/blog"). | [
"example.com",
"*.substack.com",
"openai.com/blog"
] | +| `ID` | [components.WebSearchPluginID](../../models/components/websearchpluginid.md) | :heavy_check_mark: | N/A | | +| `IncludeDomains` | []`string` | :heavy_minus_sign: | A list of domains to restrict web search results to. Supports wildcards (e.g. "*.substack.com") and path filtering (e.g. "openai.com/blog"). | [
"example.com",
"*.substack.com",
"openai.com/blog"
] | +| `MaxResults` | `*int64` | :heavy_minus_sign: | N/A | | +| `MaxUses` | `*int64` | :heavy_minus_sign: | Maximum number of times the model can invoke web search in a single turn. Passed through to native providers that support it (e.g. Anthropic). | | +| `SearchPrompt` | `*string` | :heavy_minus_sign: | N/A | | +| `UserLocation` | optionalnullable.OptionalNullable[[components.UserLocation](../../models/components/userlocation.md)] | :heavy_minus_sign: | N/A | {
"city": "San Francisco",
"country": "US",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file diff --git a/docs/models/components/websearchplugintype.md b/docs/models/components/websearchplugintype.md new file mode 100644 index 00000000..0b97848f --- /dev/null +++ b/docs/models/components/websearchplugintype.md @@ -0,0 +1,18 @@ +# WebSearchPluginType + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +value := components.WebSearchPluginTypeApproximate +``` + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `WebSearchPluginTypeApproximate` | approximate | \ No newline at end of file diff --git a/docs/models/components/websearchservertool.md b/docs/models/components/websearchservertool.md index b4accd16..8d7df2c0 100644 --- a/docs/models/components/websearchservertool.md +++ b/docs/models/components/websearchservertool.md @@ -5,11 +5,11 @@ Web search tool configuration (2025-08-26 version) ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Engine` | [*components.WebSearchEngineEnum](../../models/components/websearchengineenum.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. | auto | -| `Filters` | optionalnullable.OptionalNullable[[components.WebSearchDomainFilter](../../models/components/websearchdomainfilter.md)] | :heavy_minus_sign: | N/A | {
"allowed_domains": [
"example.com"
],
"excluded_domains": [
"spam.com"
]
} | -| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and Parallel engines; ignored with native provider search. | 5 | -| `SearchContextSize` | [*components.SearchContextSizeEnum](../../models/components/searchcontextsizeenum.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | -| `Type` | [components.WebSearchServerToolType](../../models/components/websearchservertooltype.md) | :heavy_check_mark: | N/A | | -| `UserLocation` | optionalnullable.OptionalNullable[[components.WebSearchUserLocation](../../models/components/websearchuserlocation.md)] | :heavy_minus_sign: | User location information for web search | {
"city": "San Francisco",
"country": "USA",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Engine` | [*components.WebSearchEngineEnum](../../models/components/websearchengineenum.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). | auto | +| `Filters` | optionalnullable.OptionalNullable[[components.WebSearchDomainFilter](../../models/components/websearchdomainfilter.md)] | :heavy_minus_sign: | N/A | {
"allowed_domains": [
"example.com"
],
"excluded_domains": [
"spam.com"
]
} | +| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. | 5 | +| `SearchContextSize` | [*components.SearchContextSizeEnum](../../models/components/searchcontextsizeenum.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | +| `Type` | [components.WebSearchServerToolType](../../models/components/websearchservertooltype.md) | :heavy_check_mark: | N/A | | +| `UserLocation` | optionalnullable.OptionalNullable[[components.WebSearchUserLocation](../../models/components/websearchuserlocation.md)] | :heavy_minus_sign: | User location information for web search | {
"city": "San Francisco",
"country": "USA",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file diff --git a/docs/models/components/websearchservertoolconfig.md b/docs/models/components/websearchservertoolconfig.md new file mode 100644 index 00000000..5c15835a --- /dev/null +++ b/docs/models/components/websearchservertoolconfig.md @@ -0,0 +1,17 @@ +# WebSearchServerToolConfig + +Configuration for the openrouter:web_search server tool + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AllowedDomains` | []`string` | :heavy_minus_sign: | Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI, xAI). Cannot be used with excluded_domains. | | +| `Engine` | [*components.WebSearchEngineEnum](../../models/components/websearchengineenum.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). | auto | +| `ExcludedDomains` | []`string` | :heavy_minus_sign: | Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, and xAI. Not supported with OpenAI (silently ignored). Cannot be used with allowed_domains. | | +| `MaxCharacters` | `*int64` | :heavy_minus_sign: | Exact maximum number of characters of content per search result. Applies to the Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, caps highlight content per result. For Parallel, caps excerpt content per result (default 1,500 when omitted). For Perplexity, maps to the native `max_tokens_per_page` parameter (converted from characters to tokens) and trims the response to the exact character cap. When both `max_characters` and `search_context_size` are set, `max_characters` takes precedence. When omitted, falls back to `search_context_size` mapping (Exa) or engine defaults (Parallel, Perplexity). | 2000 | +| `MaxResults` | `*int64` | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. | 5 | +| `MaxTotalResults` | `*int64` | :heavy_minus_sign: | Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. Defaults to 50 when not specified. | 50 | +| `SearchContextSize` | [*components.SearchQualityLevel](../../models/components/searchqualitylevel.md) | :heavy_minus_sign: | How much context to retrieve per result. Applies to Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, pins a fixed per-result character cap (low=5,000, medium=15,000, high=30,000); when omitted, Exa picks an adaptive size per query and document (typically ~2,000–4,000 characters per result). For Parallel, controls the total characters across all results; when omitted, Parallel uses its own default size. For Perplexity, maps directly to the Search API's native search_context_size parameter. Overridden by `max_characters` when both are set. | medium | +| `UserLocation` | [*components.WebSearchUserLocationServerTool](../../models/components/websearchuserlocationservertool.md) | :heavy_minus_sign: | Approximate user location for location-biased results. | {
"city": "San Francisco",
"country": "US",
"region": "California",
"timezone": "America/Los_Angeles",
"type": "approximate"
} | \ No newline at end of file diff --git a/docs/models/components/websearchservertoolopenrouter.md b/docs/models/components/websearchservertoolopenrouter.md index 0848bf47..2d1ef0cf 100644 --- a/docs/models/components/websearchservertoolopenrouter.md +++ b/docs/models/components/websearchservertoolopenrouter.md @@ -5,7 +5,7 @@ OpenRouter built-in server tool: searches the web for current information ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `Parameters` | [*components.Parameters](../../models/components/parameters.md) | :heavy_minus_sign: | N/A | -| `Type` | [components.WebSearchServerToolOpenRouterType](../../models/components/websearchservertoolopenroutertype.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `Parameters` | [*components.WebSearchServerToolConfig](../../models/components/websearchservertoolconfig.md) | :heavy_minus_sign: | Configuration for the openrouter:web_search server tool | {
"max_results": 5,
"search_context_size": "medium"
} | +| `Type` | [components.WebSearchServerToolOpenRouterType](../../models/components/websearchservertoolopenroutertype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/websearchuserlocationservertool.md b/docs/models/components/websearchuserlocationservertool.md index 7b6bff2d..ddb0cbfe 100644 --- a/docs/models/components/websearchuserlocationservertool.md +++ b/docs/models/components/websearchuserlocationservertool.md @@ -7,8 +7,8 @@ Approximate user location for location-biased results. | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| `City` | `*string` | :heavy_minus_sign: | N/A | -| `Country` | `*string` | :heavy_minus_sign: | N/A | -| `Region` | `*string` | :heavy_minus_sign: | N/A | -| `Timezone` | `*string` | :heavy_minus_sign: | N/A | +| `City` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `Country` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `Region` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | +| `Timezone` | optionalnullable.OptionalNullable[`string`] | :heavy_minus_sign: | N/A | | `Type` | [*components.WebSearchUserLocationServerToolType](../../models/components/websearchuserlocationservertooltype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/workspace.md b/docs/models/components/workspace.md index d6122060..d478812b 100644 --- a/docs/models/components/workspace.md +++ b/docs/models/components/workspace.md @@ -3,18 +3,20 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `CreatedAt` | `string` | :heavy_check_mark: | ISO 8601 timestamp of when the workspace was created | 2025-08-24T10:30:00Z | -| `CreatedBy` | `*string` | :heavy_check_mark: | User ID of the workspace creator | user_abc123 | -| `DefaultImageModel` | `*string` | :heavy_check_mark: | Default image model for this workspace | openai/dall-e-3 | -| `DefaultProviderSort` | `*string` | :heavy_check_mark: | Default provider sort preference (price, throughput, latency, exacto) | price | -| `DefaultTextModel` | `*string` | :heavy_check_mark: | Default text model for this workspace | openai/gpt-4o | -| `Description` | `*string` | :heavy_check_mark: | Description of the workspace | Production environment workspace | -| `ID` | `string` | :heavy_check_mark: | Unique identifier for the workspace | 550e8400-e29b-41d4-a716-446655440000 | -| `IsDataDiscountLoggingEnabled` | `bool` | :heavy_check_mark: | Whether data discount logging is enabled for this workspace | true | -| `IsObservabilityBroadcastEnabled` | `bool` | :heavy_check_mark: | Whether broadcast is enabled for this workspace | false | -| `IsObservabilityIoLoggingEnabled` | `bool` | :heavy_check_mark: | Whether private logging is enabled for this workspace | false | -| `Name` | `string` | :heavy_check_mark: | Name of the workspace | Production | -| `Slug` | `string` | :heavy_check_mark: | URL-friendly slug for the workspace | production | -| `UpdatedAt` | `*string` | :heavy_check_mark: | ISO 8601 timestamp of when the workspace was last updated | 2025-08-24T15:45:00Z | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `CreatedAt` | `string` | :heavy_check_mark: | ISO 8601 timestamp of when the workspace was created | 2025-08-24T10:30:00Z | +| `CreatedBy` | `*string` | :heavy_check_mark: | User ID of the workspace creator | user_abc123 | +| `DefaultImageModel` | `*string` | :heavy_check_mark: | Default image model for this workspace | openai/dall-e-3 | +| `DefaultProviderSort` | `*string` | :heavy_check_mark: | Default provider sort preference (price, throughput, latency, exacto) | price | +| `DefaultTextModel` | `*string` | :heavy_check_mark: | Default text model for this workspace | openai/gpt-4o | +| `Description` | `*string` | :heavy_check_mark: | Description of the workspace | Production environment workspace | +| `ID` | `string` | :heavy_check_mark: | Unique identifier for the workspace | 550e8400-e29b-41d4-a716-446655440000 | +| `IoLoggingAPIKeyIds` | []`int64` | :heavy_check_mark: | Optional array of API key IDs to filter I/O logging. Null means all keys are logged. | null | +| `IoLoggingSamplingRate` | `float64` | :heavy_check_mark: | Sampling rate for I/O logging (0.0001-1). 1 means 100% of requests are logged. | 1 | +| `IsDataDiscountLoggingEnabled` | `bool` | :heavy_check_mark: | Whether data discount logging is enabled for this workspace | true | +| `IsObservabilityBroadcastEnabled` | `bool` | :heavy_check_mark: | Whether broadcast is enabled for this workspace | false | +| `IsObservabilityIoLoggingEnabled` | `bool` | :heavy_check_mark: | Whether private logging is enabled for this workspace | false | +| `Name` | `string` | :heavy_check_mark: | Name of the workspace | Production | +| `Slug` | `string` | :heavy_check_mark: | URL-friendly slug for the workspace | production | +| `UpdatedAt` | `*string` | :heavy_check_mark: | ISO 8601 timestamp of when the workspace was last updated | 2025-08-24T15:45:00Z | \ No newline at end of file diff --git a/docs/models/operations/arena.md b/docs/models/operations/arena.md new file mode 100644 index 00000000..dbf198a1 --- /dev/null +++ b/docs/models/operations/arena.md @@ -0,0 +1,25 @@ +# Arena + +Arena to query. Defaults to `models`. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/operations" +) + +value := operations.ArenaModels + +// Open enum: custom values can be created with a direct type cast +custom := operations.Arena("custom_value") +``` + + +## Values + +| Name | Value | +| --------------- | --------------- | +| `ArenaModels` | models | +| `ArenaBuilders` | builders | +| `ArenaAgents` | agents | \ No newline at end of file diff --git a/docs/models/operations/category.md b/docs/models/operations/category.md deleted file mode 100644 index ed303e08..00000000 --- a/docs/models/operations/category.md +++ /dev/null @@ -1,34 +0,0 @@ -# Category - -Filter models by use case category - -## Example Usage - -```go -import ( - "github.com/OpenRouterTeam/go-sdk/models/operations" -) - -value := operations.CategoryProgramming - -// Open enum: custom values can be created with a direct type cast -custom := operations.Category("custom_value") -``` - - -## Values - -| Name | Value | -| ---------------------- | ---------------------- | -| `CategoryProgramming` | programming | -| `CategoryRoleplay` | roleplay | -| `CategoryMarketing` | marketing | -| `CategoryMarketingSeo` | marketing/seo | -| `CategoryTechnology` | technology | -| `CategoryScience` | science | -| `CategoryTranslation` | translation | -| `CategoryLegal` | legal | -| `CategoryFinance` | finance | -| `CategoryHealth` | health | -| `CategoryTrivia` | trivia | -| `CategoryAcademia` | academia | \ No newline at end of file diff --git a/docs/models/operations/content.md b/docs/models/operations/content.md index 5c8d1e8e..efcacc58 100644 --- a/docs/models/operations/content.md +++ b/docs/models/operations/content.md @@ -15,6 +15,24 @@ content := operations.CreateContentText(operations.ContentText{/* values here */ content := operations.CreateContentImageURL(operations.ContentImageURL{/* values here */}) ``` +### ContentPartInputAudio + +```go +content := operations.CreateContentInputAudio(components.ContentPartInputAudio{/* values here */}) +``` + +### ContentPartInputVideo + +```go +content := operations.CreateContentInputVideo(components.ContentPartInputVideo{/* values here */}) +``` + +### ContentPartInputFile + +```go +content := operations.CreateContentInputFile(components.ContentPartInputFile{/* values here */}) +``` + ## Union Discrimination Use the `Type` field to determine which variant is active, then access the corresponding field: @@ -25,5 +43,11 @@ switch content.Type { // content.ContentText is populated case operations.ContentTypeImageURL: // content.ContentImageURL is populated + case operations.ContentTypeInputAudio: + // content.ContentPartInputAudio is populated + case operations.ContentTypeInputVideo: + // content.ContentPartInputVideo is populated + case operations.ContentTypeInputFile: + // content.ContentPartInputFile is populated } ``` diff --git a/docs/models/operations/createauthkeyscoderequest.md b/docs/models/operations/createauthkeyscoderequest.md index 75a6a036..b199fc6b 100644 --- a/docs/models/operations/createauthkeyscoderequest.md +++ b/docs/models/operations/createauthkeyscoderequest.md @@ -3,12 +3,13 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -| `CallbackURL` | `string` | :heavy_check_mark: | The callback URL to redirect to after authorization. Note, only https URLs on ports 443 and 3000 are allowed. | https://myapp.com/auth/callback | -| `CodeChallenge` | `*string` | :heavy_minus_sign: | PKCE code challenge for enhanced security | E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM | -| `CodeChallengeMethod` | [*operations.CreateAuthKeysCodeCodeChallengeMethod](../../models/operations/createauthkeyscodecodechallengemethod.md) | :heavy_minus_sign: | The method used to generate the code challenge | S256 | -| `ExpiresAt` | optionalnullable.OptionalNullable[[time.Time](https://pkg.go.dev/time#Time)] | :heavy_minus_sign: | Optional expiration time for the API key to be created | 2027-12-31T23:59:59Z | -| `KeyLabel` | `*string` | :heavy_minus_sign: | Optional custom label for the API key. Defaults to the app name if not provided. | My Custom Key | -| `Limit` | `*float64` | :heavy_minus_sign: | Credit limit for the API key to be created | 100 | -| `UsageLimitType` | [*operations.UsageLimitType](../../models/operations/usagelimittype.md) | :heavy_minus_sign: | Optional credit limit reset interval. When set, the credit limit resets on this interval. | monthly | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `CallbackURL` | `string` | :heavy_check_mark: | The callback URL to redirect to after authorization. Supports https URLs and localhost/127.0.0.1 URLs on any port for local CLI tools. | https://myapp.com/auth/callback | +| `CodeChallenge` | `*string` | :heavy_minus_sign: | PKCE code challenge for enhanced security | E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM | +| `CodeChallengeMethod` | [*operations.CreateAuthKeysCodeCodeChallengeMethod](../../models/operations/createauthkeyscodecodechallengemethod.md) | :heavy_minus_sign: | The method used to generate the code challenge | S256 | +| `ExpiresAt` | optionalnullable.OptionalNullable[[time.Time](https://pkg.go.dev/time#Time)] | :heavy_minus_sign: | Optional expiration time for the API key to be created | 2027-12-31T23:59:59Z | +| `KeyLabel` | `*string` | :heavy_minus_sign: | Optional custom label for the API key. Defaults to the app name if not provided. | My Custom Key | +| `Limit` | `*float64` | :heavy_minus_sign: | Credit limit for the API key to be created | 100 | +| `UsageLimitType` | [*operations.UsageLimitType](../../models/operations/usagelimittype.md) | :heavy_minus_sign: | Optional credit limit reset interval. When set, the credit limit resets on this interval. | monthly | +| `WorkspaceID` | `*string` | :heavy_minus_sign: | Optional workspace ID to associate the API key with | | \ No newline at end of file diff --git a/docs/models/operations/createpresetschatcompletionsrequest.md b/docs/models/operations/createpresetschatcompletionsrequest.md new file mode 100644 index 00000000..8f36bedc --- /dev/null +++ b/docs/models/operations/createpresetschatcompletionsrequest.md @@ -0,0 +1,9 @@ +# CreatePresetsChatCompletionsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Slug` | `string` | :heavy_check_mark: | URL-safe slug identifying the preset. Created if it does not exist. | my-preset | +| `ChatRequest` | [components.ChatRequest](../../models/components/chatrequest.md) | :heavy_check_mark: | N/A | {
"max_tokens": 150,
"messages": [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "What is the capital of France?",
"role": "user"
}
],
"model": "openai/gpt-4",
"temperature": 0.7
} | \ No newline at end of file diff --git a/docs/models/operations/createpresetsmessagesrequest.md b/docs/models/operations/createpresetsmessagesrequest.md new file mode 100644 index 00000000..bc20b477 --- /dev/null +++ b/docs/models/operations/createpresetsmessagesrequest.md @@ -0,0 +1,9 @@ +# CreatePresetsMessagesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Slug` | `string` | :heavy_check_mark: | URL-safe slug identifying the preset. Created if it does not exist. | my-preset | +| `MessagesRequest` | [components.MessagesRequest](../../models/components/messagesrequest.md) | :heavy_check_mark: | N/A | {
"max_tokens": 1024,
"messages": [
{
"content": "Hello, how are you?",
"role": "user"
}
],
"model": "anthropic/claude-4.5-sonnet-20250929",
"temperature": 0.7
} | \ No newline at end of file diff --git a/docs/models/operations/createpresetsresponsesrequest.md b/docs/models/operations/createpresetsresponsesrequest.md new file mode 100644 index 00000000..4dc0d403 --- /dev/null +++ b/docs/models/operations/createpresetsresponsesrequest.md @@ -0,0 +1,9 @@ +# CreatePresetsResponsesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Slug` | `string` | :heavy_check_mark: | URL-safe slug identifying the preset. Created if it does not exist. | my-preset | +| `ResponsesRequest` | [components.ResponsesRequest](../../models/components/responsesrequest.md) | :heavy_check_mark: | N/A | {
"input": [
{
"content": "Hello, how are you?",
"role": "user",
"type": "message"
}
],
"model": "anthropic/claude-4.5-sonnet-20250929",
"temperature": 0.7,
"tools": [
{
"description": "Get the current weather in a given location",
"name": "get_current_weather",
"parameters": {
"properties": {
"location": {
"type": "string"
}
},
"type": "object"
},
"type": "function"
}
],
"top_p": 0.9
} | \ No newline at end of file diff --git a/docs/models/operations/creatererankrequest.md b/docs/models/operations/creatererankrequest.md index e81ec4a5..f7ebc86e 100644 --- a/docs/models/operations/creatererankrequest.md +++ b/docs/models/operations/creatererankrequest.md @@ -5,10 +5,10 @@ Rerank request input ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | -| `Documents` | []`string` | :heavy_check_mark: | The list of documents to rerank | [
"Paris is the capital of France.",
"Berlin is the capital of Germany."
] | -| `Model` | `string` | :heavy_check_mark: | The rerank model to use | cohere/rerank-v3.5 | -| `Provider` | optionalnullable.OptionalNullable[[components.ProviderPreferences](../../models/components/providerpreferences.md)] | :heavy_minus_sign: | N/A | {
"allow_fallbacks": true
} | -| `Query` | `string` | :heavy_check_mark: | The search query to rerank documents against | What is the capital of France? | -| `TopN` | `*int64` | :heavy_minus_sign: | Number of most relevant documents to return | 3 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Documents` | [][operations.Document](../../models/operations/document.md) | :heavy_check_mark: | The list of documents to rerank. Documents may be plain strings, or structured objects with `text` and/or `image` for multimodal models. | [
"Paris is the capital of France.",
"Berlin is the capital of Germany."
] | +| `Model` | `string` | :heavy_check_mark: | The rerank model to use | cohere/rerank-v3.5 | +| `Provider` | optionalnullable.OptionalNullable[[components.ProviderPreferences](../../models/components/providerpreferences.md)] | :heavy_minus_sign: | N/A | {
"allow_fallbacks": true
} | +| `Query` | `string` | :heavy_check_mark: | The search query to rerank documents against | What is the capital of France? | +| `TopN` | `*int64` | :heavy_minus_sign: | Number of most relevant documents to return | 3 | \ No newline at end of file diff --git a/docs/models/operations/createresponsesrequest.md b/docs/models/operations/createresponsesrequest.md new file mode 100644 index 00000000..50f05ab8 --- /dev/null +++ b/docs/models/operations/createresponsesrequest.md @@ -0,0 +1,9 @@ +# CreateResponsesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `XOpenRouterMetadata` | [*components.MetadataLevel](../../models/components/metadatalevel.md) | :heavy_minus_sign: | Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. | enabled | +| `ResponsesRequest` | [components.ResponsesRequest](../../models/components/responsesrequest.md) | :heavy_check_mark: | N/A | {
"input": [
{
"content": "Hello, how are you?",
"role": "user",
"type": "message"
}
],
"model": "anthropic/claude-4.5-sonnet-20250929",
"temperature": 0.7,
"tools": [
{
"description": "Get the current weather in a given location",
"name": "get_current_weather",
"parameters": {
"properties": {
"location": {
"type": "string"
}
},
"type": "object"
},
"type": "function"
}
],
"top_p": 0.9
} | \ No newline at end of file diff --git a/docs/models/operations/createresponsesresponse.md b/docs/models/operations/createresponsesresponse.md index abb70753..0a9f53cd 100644 --- a/docs/models/operations/createresponsesresponse.md +++ b/docs/models/operations/createresponsesresponse.md @@ -12,7 +12,7 @@ createResponsesResponse := operations.CreateCreateResponsesResponseOpenResponses ### ```go -createResponsesResponse := operations.CreateCreateResponsesResponseEventStream(*stream.EventStream[operations.CreateResponsesResponseBody]{/* values here */}) +createResponsesResponse := operations.CreateCreateResponsesResponseEventStream(*stream.EventStream[components.ResponsesStreamingResponse]{/* values here */}) ``` ## Union Discrimination diff --git a/docs/models/operations/deletebyokkeyrequest.md b/docs/models/operations/deletebyokkeyrequest.md new file mode 100644 index 00000000..8561fa22 --- /dev/null +++ b/docs/models/operations/deletebyokkeyrequest.md @@ -0,0 +1,8 @@ +# DeleteBYOKKeyRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `ID` | `string` | :heavy_check_mark: | The BYOK credential ID (UUID). | 11111111-2222-3333-4444-555555555555 | \ No newline at end of file diff --git a/docs/models/operations/deletefilerequest.md b/docs/models/operations/deletefilerequest.md new file mode 100644 index 00000000..487dd202 --- /dev/null +++ b/docs/models/operations/deletefilerequest.md @@ -0,0 +1,9 @@ +# DeleteFileRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `FileID` | `string` | :heavy_check_mark: | N/A | file_011CNha8iCJcU1wXNR6q4V8w | +| `WorkspaceID` | `*string` | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 | \ No newline at end of file diff --git a/docs/models/operations/deleteobservabilitydestinationrequest.md b/docs/models/operations/deleteobservabilitydestinationrequest.md new file mode 100644 index 00000000..83ec9435 --- /dev/null +++ b/docs/models/operations/deleteobservabilitydestinationrequest.md @@ -0,0 +1,8 @@ +# DeleteObservabilityDestinationRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `ID` | `string` | :heavy_check_mark: | The destination ID (UUID). | 99999999-aaaa-bbbb-cccc-dddddddddddd | \ No newline at end of file diff --git a/docs/models/operations/dimension.md b/docs/models/operations/dimension.md new file mode 100644 index 00000000..bcd1f4c7 --- /dev/null +++ b/docs/models/operations/dimension.md @@ -0,0 +1,9 @@ +# Dimension + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `DisplayLabel` | `string` | :heavy_check_mark: | Human-readable label | Model | +| `Name` | `string` | :heavy_check_mark: | Dimension identifier used in query requests | model | \ No newline at end of file diff --git a/docs/models/operations/direction.md b/docs/models/operations/direction.md new file mode 100644 index 00000000..5256f72e --- /dev/null +++ b/docs/models/operations/direction.md @@ -0,0 +1,22 @@ +# Direction + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/operations" +) + +value := operations.DirectionAsc + +// Open enum: custom values can be created with a direct type cast +custom := operations.Direction("custom_value") +``` + + +## Values + +| Name | Value | +| --------------- | --------------- | +| `DirectionAsc` | asc | +| `DirectionDesc` | desc | \ No newline at end of file diff --git a/docs/models/operations/displayformat.md b/docs/models/operations/displayformat.md new file mode 100644 index 00000000..7cebb69d --- /dev/null +++ b/docs/models/operations/displayformat.md @@ -0,0 +1,27 @@ +# DisplayFormat + +How this metric value should be formatted for display (e.g. percent → multiply by 100 and append %, currency → prefix with $) + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/operations" +) + +value := operations.DisplayFormatNumber + +// Open enum: custom values can be created with a direct type cast +custom := operations.DisplayFormat("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------- | ------------------------- | +| `DisplayFormatNumber` | number | +| `DisplayFormatCurrency` | currency | +| `DisplayFormatPercent` | percent | +| `DisplayFormatLatency` | latency | +| `DisplayFormatThroughput` | throughput | \ No newline at end of file diff --git a/docs/models/operations/distillable.md b/docs/models/operations/distillable.md new file mode 100644 index 00000000..458de901 --- /dev/null +++ b/docs/models/operations/distillable.md @@ -0,0 +1,24 @@ +# Distillable + +Filter by distillation capability. "true" returns only distillable models, "false" excludes them. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/operations" +) + +value := operations.DistillableTrue + +// Open enum: custom values can be created with a direct type cast +custom := operations.Distillable("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------ | ------------------ | +| `DistillableTrue` | true | +| `DistillableFalse` | false | \ No newline at end of file diff --git a/docs/models/operations/document.md b/docs/models/operations/document.md index 835610de..af7226de 100644 --- a/docs/models/operations/document.md +++ b/docs/models/operations/document.md @@ -1,10 +1,31 @@ # Document -The document object containing the original text +A document to rerank. Either a plain string, or a structured object with optional `text` and/or `image`. -## Fields +## Supported Types -| Field | Type | Required | Description | Example | -| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | -| `Text` | `string` | :heavy_check_mark: | The document text | Paris is the capital of France. | \ No newline at end of file +### + +```go +document := operations.CreateDocumentStr(string{/* values here */}) +``` + +### DocumentRequest + +```go +document := operations.CreateDocumentDocumentRequest(operations.DocumentRequest{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch document.Type { + case operations.DocumentTypeStr: + // document.Str is populated + case operations.DocumentTypeDocumentRequest: + // document.DocumentRequest is populated +} +``` diff --git a/docs/models/operations/documentrequest.md b/docs/models/operations/documentrequest.md new file mode 100644 index 00000000..ee41677a --- /dev/null +++ b/docs/models/operations/documentrequest.md @@ -0,0 +1,11 @@ +# DocumentRequest + +A structured document with optional text and/or image content. At least one of `text` or `image` must be provided. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `Image` | `*string` | :heavy_minus_sign: | An image associated with the document, as a remote URL (http/https) or a base64-encoded data URI (data:image/...). | https://upload.wikimedia.org/wikipedia/commons/thumb/8/8b/Phytogenic.png | +| `Text` | `*string` | :heavy_minus_sign: | The document text | AI enables robots to perceive, plan, and act autonomously. | \ No newline at end of file diff --git a/docs/models/operations/documentresponse.md b/docs/models/operations/documentresponse.md new file mode 100644 index 00000000..5374ba53 --- /dev/null +++ b/docs/models/operations/documentresponse.md @@ -0,0 +1,11 @@ +# DocumentResponse + +The document object echoing the original input (text and/or image) + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `Image` | `*string` | :heavy_minus_sign: | The image (URL or data URI) from the original document | https://example.com/image.png | +| `Text` | `*string` | :heavy_minus_sign: | The document text | Paris is the capital of France. | \ No newline at end of file diff --git a/docs/models/operations/downloadfilecontentrequest.md b/docs/models/operations/downloadfilecontentrequest.md new file mode 100644 index 00000000..3a696c06 --- /dev/null +++ b/docs/models/operations/downloadfilecontentrequest.md @@ -0,0 +1,9 @@ +# DownloadFileContentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `FileID` | `string` | :heavy_check_mark: | N/A | file_011CNha8iCJcU1wXNR6q4V8w | +| `WorkspaceID` | `*string` | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 | \ No newline at end of file diff --git a/docs/models/operations/file.md b/docs/models/operations/file.md new file mode 100644 index 00000000..cde537f2 --- /dev/null +++ b/docs/models/operations/file.md @@ -0,0 +1,9 @@ +# File + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `FileName` | `string` | :heavy_check_mark: | N/A | +| `Content` | `any` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/filter.md b/docs/models/operations/filter.md new file mode 100644 index 00000000..271d3b53 --- /dev/null +++ b/docs/models/operations/filter.md @@ -0,0 +1,10 @@ +# Filter + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `Field` | `string` | :heavy_check_mark: | Dimension to filter on | model | +| `Operator` | `string` | :heavy_check_mark: | Filter operator | eq | +| `Value` | [operations.Value1](../../models/operations/value1.md) | :heavy_check_mark: | Filter value (scalar or array depending on operator) | | \ No newline at end of file diff --git a/docs/models/operations/getanalyticsmetadata.md b/docs/models/operations/getanalyticsmetadata.md new file mode 100644 index 00000000..0256765d --- /dev/null +++ b/docs/models/operations/getanalyticsmetadata.md @@ -0,0 +1,11 @@ +# GetAnalyticsMetaData + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `Dimensions` | [][operations.Dimension](../../models/operations/dimension.md) | :heavy_check_mark: | N/A | +| `Granularities` | [][operations.Granularity](../../models/operations/granularity.md) | :heavy_check_mark: | N/A | +| `Metrics` | [][operations.Metric](../../models/operations/metric.md) | :heavy_check_mark: | N/A | +| `Operators` | [][operations.Operator](../../models/operations/operator.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getanalyticsmetaresponse.md b/docs/models/operations/getanalyticsmetaresponse.md new file mode 100644 index 00000000..d1ad1abe --- /dev/null +++ b/docs/models/operations/getanalyticsmetaresponse.md @@ -0,0 +1,10 @@ +# GetAnalyticsMetaResponse + +Returns analytics query metadata + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `Data` | [operations.GetAnalyticsMetaData](../../models/operations/getanalyticsmetadata.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getapprankingscategory.md b/docs/models/operations/getapprankingscategory.md new file mode 100644 index 00000000..e839e72f --- /dev/null +++ b/docs/models/operations/getapprankingscategory.md @@ -0,0 +1,26 @@ +# GetAppRankingsCategory + +Marketplace category group to filter by (e.g. `coding`). Only apps tagged with a subcategory inside this group are returned. Mutually combinable with `subcategory` — when both are supplied the `subcategory` must belong to the `category` group. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/operations" +) + +value := operations.GetAppRankingsCategoryCoding + +// Open enum: custom values can be created with a direct type cast +custom := operations.GetAppRankingsCategory("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------------------- | ------------------------------------- | +| `GetAppRankingsCategoryCoding` | coding | +| `GetAppRankingsCategoryCreative` | creative | +| `GetAppRankingsCategoryProductivity` | productivity | +| `GetAppRankingsCategoryEntertainment` | entertainment | \ No newline at end of file diff --git a/docs/models/operations/getapprankingsrequest.md b/docs/models/operations/getapprankingsrequest.md new file mode 100644 index 00000000..90758f36 --- /dev/null +++ b/docs/models/operations/getapprankingsrequest.md @@ -0,0 +1,14 @@ +# GetAppRankingsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Category` | [*operations.GetAppRankingsCategory](../../models/operations/getapprankingscategory.md) | :heavy_minus_sign: | Marketplace category group to filter by (e.g. `coding`). Only apps tagged with a subcategory inside this group are returned. Mutually combinable with `subcategory` — when both are supplied the `subcategory` must belong to the `category` group. | coding | +| `Subcategory` | [*operations.Subcategory](../../models/operations/subcategory.md) | :heavy_minus_sign: | Marketplace subcategory to filter by (e.g. `cli-agent`). Takes precedence over `category` for the actual filter; when `category` is also supplied the pair must be consistent. | cli-agent | +| `Sort` | [*operations.GetAppRankingsSort](../../models/operations/getapprankingssort.md) | :heavy_minus_sign: | `popular` ranks apps by total token volume inside the date window. `trending` ranks apps by absolute excess token growth: window volume minus the average volume of the three equal-length periods immediately preceding the window. Apps with no excess growth are omitted from `trending` results. | popular | +| `StartDate` | `*string` | :heavy_minus_sign: | Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`. | 2026-04-12 | +| `EndDate` | `*string` | :heavy_minus_sign: | End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400. | 2026-05-11 | +| `Limit` | `*int64` | :heavy_minus_sign: | Maximum number of apps to return (1-100). Defaults to 50. | 50 | +| `Offset` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Number of ranked apps to skip before the first returned row (0-100). Defaults to 0. `rank` stays absolute, so the first row of `offset=50` is `rank: 51`. | 0 | \ No newline at end of file diff --git a/docs/models/operations/getapprankingsresponse.md b/docs/models/operations/getapprankingsresponse.md new file mode 100644 index 00000000..bf0c385f --- /dev/null +++ b/docs/models/operations/getapprankingsresponse.md @@ -0,0 +1,8 @@ +# GetAppRankingsResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Result` | [components.AppRankingsResponse](../../models/components/apprankingsresponse.md) | :heavy_check_mark: | N/A | {
"data": [
{
"app_id": 12345,
"app_name": "Cline",
"rank": 1,
"total_requests": 4321,
"total_tokens": "12345678"
},
{
"app_id": 67890,
"app_name": "Roo Code",
"rank": 2,
"total_requests": 2109,
"total_tokens": "9876543"
}
],
"meta": {
"as_of": "2026-05-12T02:00:00Z",
"end_date": "2026-05-11",
"start_date": "2026-04-12",
"version": "v1"
}
} | \ No newline at end of file diff --git a/docs/models/operations/getapprankingssort.md b/docs/models/operations/getapprankingssort.md new file mode 100644 index 00000000..ab76ec61 --- /dev/null +++ b/docs/models/operations/getapprankingssort.md @@ -0,0 +1,24 @@ +# GetAppRankingsSort + +`popular` ranks apps by total token volume inside the date window. `trending` ranks apps by absolute excess token growth: window volume minus the average volume of the three equal-length periods immediately preceding the window. Apps with no excess growth are omitted from `trending` results. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/operations" +) + +value := operations.GetAppRankingsSortPopular + +// Open enum: custom values can be created with a direct type cast +custom := operations.GetAppRankingsSort("custom_value") +``` + + +## Values + +| Name | Value | +| ---------------------------- | ---------------------------- | +| `GetAppRankingsSortPopular` | popular | +| `GetAppRankingsSortTrending` | trending | \ No newline at end of file diff --git a/docs/models/operations/getbenchmarksartificialanalysisrequest.md b/docs/models/operations/getbenchmarksartificialanalysisrequest.md new file mode 100644 index 00000000..c539db4b --- /dev/null +++ b/docs/models/operations/getbenchmarksartificialanalysisrequest.md @@ -0,0 +1,8 @@ +# GetBenchmarksArtificialAnalysisRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `MaxResults` | `*int64` | :heavy_minus_sign: | Max results to return (1–100, default 50). | 20 | \ No newline at end of file diff --git a/docs/models/operations/getbenchmarksdesignarenarequest.md b/docs/models/operations/getbenchmarksdesignarenarequest.md new file mode 100644 index 00000000..4499b65d --- /dev/null +++ b/docs/models/operations/getbenchmarksdesignarenarequest.md @@ -0,0 +1,10 @@ +# GetBenchmarksDesignArenaRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Arena` | [*operations.Arena](../../models/operations/arena.md) | :heavy_minus_sign: | Arena to query. Defaults to `models`. | models | +| `Category` | `*string` | :heavy_minus_sign: | Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. | codecategories | +| `MaxResults` | `*int64` | :heavy_minus_sign: | Max results to return: per category when no category filter is applied (1–100, default 50). | 20 | \ No newline at end of file diff --git a/docs/models/operations/getbyokkeyrequest.md b/docs/models/operations/getbyokkeyrequest.md new file mode 100644 index 00000000..1af3cbf3 --- /dev/null +++ b/docs/models/operations/getbyokkeyrequest.md @@ -0,0 +1,8 @@ +# GetBYOKKeyRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `ID` | `string` | :heavy_check_mark: | The BYOK credential ID (UUID). | 11111111-2222-3333-4444-555555555555 | \ No newline at end of file diff --git a/docs/models/operations/getfilemetadatarequest.md b/docs/models/operations/getfilemetadatarequest.md new file mode 100644 index 00000000..bb9bd54a --- /dev/null +++ b/docs/models/operations/getfilemetadatarequest.md @@ -0,0 +1,9 @@ +# GetFileMetadataRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `FileID` | `string` | :heavy_check_mark: | N/A | file_011CNha8iCJcU1wXNR6q4V8w | +| `WorkspaceID` | `*string` | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 | \ No newline at end of file diff --git a/docs/models/operations/getmodelrequest.md b/docs/models/operations/getmodelrequest.md new file mode 100644 index 00000000..3d762a27 --- /dev/null +++ b/docs/models/operations/getmodelrequest.md @@ -0,0 +1,9 @@ +# GetModelRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `Author` | `string` | :heavy_check_mark: | The author/organization of the model | openai | +| `Slug` | `string` | :heavy_check_mark: | The model slug, optionally including a variant suffix (e.g. gpt-4 or gpt-4:free) | gpt-4 | \ No newline at end of file diff --git a/docs/models/operations/getmodelscategory.md b/docs/models/operations/getmodelscategory.md new file mode 100644 index 00000000..355ad994 --- /dev/null +++ b/docs/models/operations/getmodelscategory.md @@ -0,0 +1,34 @@ +# GetModelsCategory + +Filter models by use case category + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/operations" +) + +value := operations.GetModelsCategoryProgramming + +// Open enum: custom values can be created with a direct type cast +custom := operations.GetModelsCategory("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------------- | ------------------------------- | +| `GetModelsCategoryProgramming` | programming | +| `GetModelsCategoryRoleplay` | roleplay | +| `GetModelsCategoryMarketing` | marketing | +| `GetModelsCategoryMarketingSeo` | marketing/seo | +| `GetModelsCategoryTechnology` | technology | +| `GetModelsCategoryScience` | science | +| `GetModelsCategoryTranslation` | translation | +| `GetModelsCategoryLegal` | legal | +| `GetModelsCategoryFinance` | finance | +| `GetModelsCategoryHealth` | health | +| `GetModelsCategoryTrivia` | trivia | +| `GetModelsCategoryAcademia` | academia | \ No newline at end of file diff --git a/docs/models/operations/getmodelsrequest.md b/docs/models/operations/getmodelsrequest.md index 5cf808a2..3dcd88a3 100644 --- a/docs/models/operations/getmodelsrequest.md +++ b/docs/models/operations/getmodelsrequest.md @@ -3,8 +3,20 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Category` | [*operations.Category](../../models/operations/category.md) | :heavy_minus_sign: | Filter models by use case category | programming | -| `SupportedParameters` | `*string` | :heavy_minus_sign: | Filter models by supported parameter (comma-separated) | temperature | -| `OutputModalities` | `*string` | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Category` | [*operations.GetModelsCategory](../../models/operations/getmodelscategory.md) | :heavy_minus_sign: | Filter models by use case category | programming | +| `SupportedParameters` | `*string` | :heavy_minus_sign: | Filter models by supported parameter (comma-separated) | temperature | +| `OutputModalities` | `*string` | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text | +| `Sort` | [*operations.GetModelsSort](../../models/operations/getmodelssort.md) | :heavy_minus_sign: | Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date). When omitted, the existing default ordering is preserved. | newest | +| `Q` | `*string` | :heavy_minus_sign: | Free-text search by model name or slug. | gpt-4 | +| `InputModalities` | `*string` | :heavy_minus_sign: | Filter models by input modality. Comma-separated list of: text, image, audio, file. | text,image | +| `Context` | `*int64` | :heavy_minus_sign: | Minimum context length (tokens). Models with smaller context are excluded. | 128000 | +| `MinPrice` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | Minimum prompt price in $/M tokens. | 0 | +| `MaxPrice` | optionalnullable.OptionalNullable[`float64`] | :heavy_minus_sign: | Maximum prompt price in $/M tokens. | 10 | +| `Arch` | `*string` | :heavy_minus_sign: | Filter models by architecture/model family (e.g. GPT, Claude, Gemini, Llama). | GPT | +| `ModelAuthors` | `*string` | :heavy_minus_sign: | Filter models by the organization that created the model. Comma-separated list of author slugs. | openai,anthropic | +| `Providers` | `*string` | :heavy_minus_sign: | Filter models by hosting provider. Comma-separated list of provider names. | OpenAI,Anthropic | +| `Distillable` | [*operations.Distillable](../../models/operations/distillable.md) | :heavy_minus_sign: | Filter by distillation capability. "true" returns only distillable models, "false" excludes them. | true | +| `Zdr` | [*operations.Zdr](../../models/operations/zdr.md) | :heavy_minus_sign: | When set to "true", return only models with zero data retention endpoints. | true | +| `Region` | [*operations.Region](../../models/operations/region.md) | :heavy_minus_sign: | Filter to models with endpoints in the given data region. Currently only "eu" is supported. | eu | \ No newline at end of file diff --git a/docs/models/operations/getmodelssort.md b/docs/models/operations/getmodelssort.md new file mode 100644 index 00000000..9c4e8dc9 --- /dev/null +++ b/docs/models/operations/getmodelssort.md @@ -0,0 +1,30 @@ +# GetModelsSort + +Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date). When omitted, the existing default ordering is preserved. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/operations" +) + +value := operations.GetModelsSortMostPopular + +// Open enum: custom values can be created with a direct type cast +custom := operations.GetModelsSort("custom_value") +``` + + +## Values + +| Name | Value | +| ---------------------------------- | ---------------------------------- | +| `GetModelsSortMostPopular` | most-popular | +| `GetModelsSortNewest` | newest | +| `GetModelsSortTopWeekly` | top-weekly | +| `GetModelsSortPricingLowToHigh` | pricing-low-to-high | +| `GetModelsSortPricingHighToLow` | pricing-high-to-low | +| `GetModelsSortContextHighToLow` | context-high-to-low | +| `GetModelsSortThroughputHighToLow` | throughput-high-to-low | +| `GetModelsSortLatencyLowToHigh` | latency-low-to-high | \ No newline at end of file diff --git a/docs/models/operations/getobservabilitydestinationrequest.md b/docs/models/operations/getobservabilitydestinationrequest.md new file mode 100644 index 00000000..7b435f1f --- /dev/null +++ b/docs/models/operations/getobservabilitydestinationrequest.md @@ -0,0 +1,8 @@ +# GetObservabilityDestinationRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `ID` | `string` | :heavy_check_mark: | The destination ID (UUID). | 99999999-aaaa-bbbb-cccc-dddddddddddd | \ No newline at end of file diff --git a/docs/models/operations/getpresetrequest.md b/docs/models/operations/getpresetrequest.md new file mode 100644 index 00000000..42cf01fe --- /dev/null +++ b/docs/models/operations/getpresetrequest.md @@ -0,0 +1,8 @@ +# GetPresetRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `Slug` | `string` | :heavy_check_mark: | URL-safe slug identifying the preset. | my-preset | \ No newline at end of file diff --git a/docs/models/operations/getpresetversionrequest.md b/docs/models/operations/getpresetversionrequest.md new file mode 100644 index 00000000..c5172c6d --- /dev/null +++ b/docs/models/operations/getpresetversionrequest.md @@ -0,0 +1,9 @@ +# GetPresetVersionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `Slug` | `string` | :heavy_check_mark: | URL-safe slug identifying the preset. | my-preset | +| `Version` | `string` | :heavy_check_mark: | Version number of the preset. | 1 | \ No newline at end of file diff --git a/docs/models/operations/getrankingsdailyrequest.md b/docs/models/operations/getrankingsdailyrequest.md new file mode 100644 index 00000000..1c4ba344 --- /dev/null +++ b/docs/models/operations/getrankingsdailyrequest.md @@ -0,0 +1,9 @@ +# GetRankingsDailyRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `StartDate` | `*string` | :heavy_minus_sign: | Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`. | 2026-04-12 | +| `EndDate` | `*string` | :heavy_minus_sign: | End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400. | 2026-05-11 | \ No newline at end of file diff --git a/docs/models/operations/granularity.md b/docs/models/operations/granularity.md new file mode 100644 index 00000000..0ad18e83 --- /dev/null +++ b/docs/models/operations/granularity.md @@ -0,0 +1,9 @@ +# Granularity + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `DisplayLabel` | `string` | :heavy_check_mark: | Human-readable label | Day | +| `Name` | [operations.GranularityName](../../models/operations/granularityname.md) | :heavy_check_mark: | Granularity identifier | day | \ No newline at end of file diff --git a/docs/models/operations/granularityname.md b/docs/models/operations/granularityname.md new file mode 100644 index 00000000..fb236a66 --- /dev/null +++ b/docs/models/operations/granularityname.md @@ -0,0 +1,27 @@ +# GranularityName + +Granularity identifier + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/operations" +) + +value := operations.GranularityNameMinute + +// Open enum: custom values can be created with a direct type cast +custom := operations.GranularityName("custom_value") +``` + + +## Values + +| Name | Value | +| ----------------------- | ----------------------- | +| `GranularityNameMinute` | minute | +| `GranularityNameHour` | hour | +| `GranularityNameDay` | day | +| `GranularityNameWeek` | week | +| `GranularityNameMonth` | month | \ No newline at end of file diff --git a/docs/models/operations/listbyokkeysrequest.md b/docs/models/operations/listbyokkeysrequest.md new file mode 100644 index 00000000..68a7ae5c --- /dev/null +++ b/docs/models/operations/listbyokkeysrequest.md @@ -0,0 +1,11 @@ +# ListBYOKKeysRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `Offset` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `Limit` | `*int64` | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | +| `WorkspaceID` | `*string` | :heavy_minus_sign: | Optional workspace ID to filter by. Defaults to the authenticated entity's default workspace. | 550e8400-e29b-41d4-a716-446655440000 | +| `Provider` | [*operations.Provider](../../models/operations/provider.md) | :heavy_minus_sign: | Optional provider slug to filter by (e.g. `openai`, `anthropic`, `amazon-bedrock`). | openai | \ No newline at end of file diff --git a/docs/models/operations/listbyokkeysresponse.md b/docs/models/operations/listbyokkeysresponse.md new file mode 100644 index 00000000..2d9ee5de --- /dev/null +++ b/docs/models/operations/listbyokkeysresponse.md @@ -0,0 +1,8 @@ +# ListBYOKKeysResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Result` | [components.ListBYOKKeysResponse](../../models/components/listbyokkeysresponse.md) | :heavy_check_mark: | N/A | {
"data": [
{
"allowed_api_key_hashes": null,
"allowed_models": null,
"allowed_user_ids": null,
"created_at": "2025-08-24T10:30:00Z",
"disabled": false,
"id": "11111111-2222-3333-4444-555555555555",
"is_fallback": false,
"label": "sk-...AbCd",
"name": "Production OpenAI Key",
"provider": "openai",
"sort_order": 0,
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"total_count": 1
} | \ No newline at end of file diff --git a/docs/models/operations/listfilesrequest.md b/docs/models/operations/listfilesrequest.md new file mode 100644 index 00000000..a10f432e --- /dev/null +++ b/docs/models/operations/listfilesrequest.md @@ -0,0 +1,10 @@ +# ListFilesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `Limit` | `*int64` | :heavy_minus_sign: | Maximum number of files to return (1–1000). | 100 | +| `Cursor` | `*string` | :heavy_minus_sign: | Opaque pagination cursor from a previous response. | eyJjdXJzb3IiOiJmaWxlXzAxMUNOaGE4aUNKY1Uxd1hOUjZxNFY4dyJ9 | +| `WorkspaceID` | `*string` | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 | \ No newline at end of file diff --git a/docs/models/operations/listfilesresponse.md b/docs/models/operations/listfilesresponse.md new file mode 100644 index 00000000..ce89761c --- /dev/null +++ b/docs/models/operations/listfilesresponse.md @@ -0,0 +1,8 @@ +# ListFilesResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Result` | [components.FileListResponse](../../models/components/filelistresponse.md) | :heavy_check_mark: | N/A | {
"cursor": null,
"data": [
{
"created_at": "2025-01-01T00:00:00Z",
"downloadable": false,
"filename": "document.pdf",
"id": "file_011CNha8iCJcU1wXNR6q4V8w",
"mime_type": "application/pdf",
"size_bytes": 1024000,
"type": "file"
}
],
"first_id": "file_011CNha8iCJcU1wXNR6q4V8w",
"has_more": false,
"last_id": "file_011CNha8iCJcU1wXNR6q4V8w"
} | \ No newline at end of file diff --git a/docs/models/operations/listguardrailsresponse.md b/docs/models/operations/listguardrailsresponse.md index cb6dd7f2..9b52aa70 100644 --- a/docs/models/operations/listguardrailsresponse.md +++ b/docs/models/operations/listguardrailsresponse.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Result` | [components.ListGuardrailsResponse](../../models/components/listguardrailsresponse.md) | :heavy_check_mark: | N/A | {
"data": [
{
"allowed_models": null,
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"created_at": "2025-08-24T10:30:00Z",
"description": "Guardrail for production environment",
"enforce_zdr": false,
"id": "550e8400-e29b-41d4-a716-446655440000",
"ignored_models": null,
"ignored_providers": null,
"limit_usd": 100,
"name": "Production Guardrail",
"reset_interval": "monthly",
"updated_at": "2025-08-24T15:45:00Z",
"workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"
}
],
"total_count": 1
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Result` | [components.ListGuardrailsResponse](../../models/components/listguardrailsresponse.md) | :heavy_check_mark: | N/A | {
"data": [
{
"allowed_models": null,
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"content_filter_builtins": [
{
"action": "redact",
"label": "[EMAIL]",
"slug": "email"
}
],
"content_filters": null,
"created_at": "2025-08-24T10:30:00Z",
"description": "Guardrail for production environment",
"enforce_zdr": null,
"enforce_zdr_anthropic": true,
"enforce_zdr_google": false,
"enforce_zdr_openai": true,
"enforce_zdr_other": false,
"id": "550e8400-e29b-41d4-a716-446655440000",
"ignored_models": null,
"ignored_providers": null,
"limit_usd": 100,
"name": "Production Guardrail",
"reset_interval": "monthly",
"updated_at": "2025-08-24T15:45:00Z",
"workspace_id": "0df9e665-d932-5740-b2c7-b52af166bc11"
}
],
"total_count": 1
} | \ No newline at end of file diff --git a/docs/models/operations/listobservabilitydestinationsrequest.md b/docs/models/operations/listobservabilitydestinationsrequest.md new file mode 100644 index 00000000..9ea5a8be --- /dev/null +++ b/docs/models/operations/listobservabilitydestinationsrequest.md @@ -0,0 +1,10 @@ +# ListObservabilityDestinationsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `Offset` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `Limit` | `*int64` | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | +| `WorkspaceID` | `*string` | :heavy_minus_sign: | Optional workspace ID to filter by. Defaults to the authenticated entity's default workspace. | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/models/operations/listobservabilitydestinationsresponse.md b/docs/models/operations/listobservabilitydestinationsresponse.md new file mode 100644 index 00000000..892bd15b --- /dev/null +++ b/docs/models/operations/listobservabilitydestinationsresponse.md @@ -0,0 +1,8 @@ +# ListObservabilityDestinationsResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Result` | [components.ListObservabilityDestinationsResponse](../../models/components/listobservabilitydestinationsresponse.md) | :heavy_check_mark: | N/A | {
"data": [
{
"api_key_hashes": null,
"config": {
"baseUrl": "https://us.cloud.langfuse.com",
"publicKey": "pk-l...EfGh",
"secretKey": "sk-l...AbCd"
},
"created_at": "2025-08-24T10:30:00Z",
"enabled": true,
"filter_rules": null,
"id": "99999999-aaaa-bbbb-cccc-dddddddddddd",
"name": "Production Langfuse",
"privacy_mode": false,
"sampling_rate": 1,
"type": "langfuse",
"updated_at": "2025-08-24T15:45:00Z",
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"total_count": 1
} | \ No newline at end of file diff --git a/docs/models/operations/listpresetsrequest.md b/docs/models/operations/listpresetsrequest.md new file mode 100644 index 00000000..4000ca3a --- /dev/null +++ b/docs/models/operations/listpresetsrequest.md @@ -0,0 +1,9 @@ +# ListPresetsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `Offset` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `Limit` | `*int64` | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | \ No newline at end of file diff --git a/docs/models/operations/listpresetsresponse.md b/docs/models/operations/listpresetsresponse.md new file mode 100644 index 00000000..bc60bff4 --- /dev/null +++ b/docs/models/operations/listpresetsresponse.md @@ -0,0 +1,8 @@ +# ListPresetsResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Result` | [components.ListPresetsResponse](../../models/components/listpresetsresponse.md) | :heavy_check_mark: | N/A | {
"data": [
{
"created_at": "2026-04-20T10:00:00Z",
"creator_user_id": "user_2dHFtVWx2n56w6HkM0000000000",
"description": null,
"designated_version_id": "550e8400-e29b-41d4-a716-446655440000",
"id": "650e8400-e29b-41d4-a716-446655440001",
"name": "my-preset",
"slug": "my-preset",
"status": "active",
"status_updated_at": null,
"updated_at": "2026-04-20T10:00:00Z",
"workspace_id": "750e8400-e29b-41d4-a716-446655440002"
}
],
"total_count": 1
} | \ No newline at end of file diff --git a/docs/models/operations/listpresetversionsrequest.md b/docs/models/operations/listpresetversionsrequest.md new file mode 100644 index 00000000..aa97f566 --- /dev/null +++ b/docs/models/operations/listpresetversionsrequest.md @@ -0,0 +1,10 @@ +# ListPresetVersionsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `Slug` | `string` | :heavy_check_mark: | URL-safe slug identifying the preset. | my-preset | +| `Offset` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `Limit` | `*int64` | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | \ No newline at end of file diff --git a/docs/models/operations/listpresetversionsresponse.md b/docs/models/operations/listpresetversionsresponse.md new file mode 100644 index 00000000..6cfe4dea --- /dev/null +++ b/docs/models/operations/listpresetversionsresponse.md @@ -0,0 +1,8 @@ +# ListPresetVersionsResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Result` | [components.ListPresetVersionsResponse](../../models/components/listpresetversionsresponse.md) | :heavy_check_mark: | N/A | {
"data": [
{
"config": {
"model": "openai/gpt-4o",
"temperature": 0.7
},
"created_at": "2026-04-20T10:00:00Z",
"creator_id": "user_2dHFtVWx2n56w6HkM0000000000",
"id": "550e8400-e29b-41d4-a716-446655440000",
"preset_id": "650e8400-e29b-41d4-a716-446655440001",
"system_prompt": "You are a helpful assistant.",
"updated_at": "2026-04-20T10:00:00Z",
"version": 1
}
],
"total_count": 1
} | \ No newline at end of file diff --git a/docs/models/operations/listworkspacesresponse.md b/docs/models/operations/listworkspacesresponse.md index d0729cee..c90db8b4 100644 --- a/docs/models/operations/listworkspacesresponse.md +++ b/docs/models/operations/listworkspacesresponse.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Result` | [components.ListWorkspacesResponse](../../models/components/listworkspacesresponse.md) | :heavy_check_mark: | N/A | {
"data": [
{
"created_at": "2025-08-24T10:30:00Z",
"created_by": "user_abc123",
"default_image_model": "openai/dall-e-3",
"default_provider_sort": "price",
"default_text_model": "openai/gpt-4o",
"description": "Production environment workspace",
"id": "550e8400-e29b-41d4-a716-446655440000",
"is_data_discount_logging_enabled": true,
"is_observability_broadcast_enabled": false,
"is_observability_io_logging_enabled": false,
"name": "Production",
"slug": "production",
"updated_at": "2025-08-24T15:45:00Z"
}
],
"total_count": 1
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Result` | [components.ListWorkspacesResponse](../../models/components/listworkspacesresponse.md) | :heavy_check_mark: | N/A | {
"data": [
{
"created_at": "2025-08-24T10:30:00Z",
"created_by": "user_abc123",
"default_image_model": "openai/dall-e-3",
"default_provider_sort": "price",
"default_text_model": "openai/gpt-4o",
"description": "Production environment workspace",
"id": "550e8400-e29b-41d4-a716-446655440000",
"io_logging_api_key_ids": null,
"io_logging_sampling_rate": 1,
"is_data_discount_logging_enabled": true,
"is_observability_broadcast_enabled": false,
"is_observability_io_logging_enabled": false,
"name": "Production",
"slug": "production",
"updated_at": "2025-08-24T15:45:00Z"
}
],
"total_count": 1
} | \ No newline at end of file diff --git a/docs/models/operations/metadata.md b/docs/models/operations/metadata.md new file mode 100644 index 00000000..de56094c --- /dev/null +++ b/docs/models/operations/metadata.md @@ -0,0 +1,10 @@ +# Metadata + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `QueryTimeMs` | `float64` | :heavy_check_mark: | N/A | +| `RowCount` | `int64` | :heavy_check_mark: | N/A | +| `Truncated` | `bool` | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/metric.md b/docs/models/operations/metric.md new file mode 100644 index 00000000..92dbb3fa --- /dev/null +++ b/docs/models/operations/metric.md @@ -0,0 +1,11 @@ +# Metric + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `DisplayFormat` | [operations.DisplayFormat](../../models/operations/displayformat.md) | :heavy_check_mark: | How this metric value should be formatted for display (e.g. percent → multiply by 100 and append %, currency → prefix with $) | number | +| `DisplayLabel` | `string` | :heavy_check_mark: | Human-readable label | Request Count | +| `IsRate` | `bool` | :heavy_check_mark: | Whether this metric is a rate/ratio (averaged, not summed) | | +| `Name` | `string` | :heavy_check_mark: | Metric identifier used in query requests | request_count | \ No newline at end of file diff --git a/docs/models/operations/operator.md b/docs/models/operations/operator.md new file mode 100644 index 00000000..6c5ff908 --- /dev/null +++ b/docs/models/operations/operator.md @@ -0,0 +1,9 @@ +# Operator + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `Name` | [operations.OperatorName](../../models/operations/operatorname.md) | :heavy_check_mark: | Operator identifier used in filter definitions | eq | +| `ValueType` | [operations.ValueType](../../models/operations/valuetype.md) | :heavy_check_mark: | Whether the operator expects a single value or an array | | \ No newline at end of file diff --git a/docs/models/operations/operatorname.md b/docs/models/operations/operatorname.md new file mode 100644 index 00000000..d8083538 --- /dev/null +++ b/docs/models/operations/operatorname.md @@ -0,0 +1,30 @@ +# OperatorName + +Operator identifier used in filter definitions + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/operations" +) + +value := operations.OperatorNameEq + +// Open enum: custom values can be created with a direct type cast +custom := operations.OperatorName("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `OperatorNameEq` | eq | +| `OperatorNameNeq` | neq | +| `OperatorNameIn` | in | +| `OperatorNameNotIn` | not_in | +| `OperatorNameGt` | gt | +| `OperatorNameGte` | gte | +| `OperatorNameLt` | lt | +| `OperatorNameLte` | lte | \ No newline at end of file diff --git a/docs/models/operations/orderby.md b/docs/models/operations/orderby.md new file mode 100644 index 00000000..a8a0d05f --- /dev/null +++ b/docs/models/operations/orderby.md @@ -0,0 +1,9 @@ +# OrderBy + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `Direction` | [operations.Direction](../../models/operations/direction.md) | :heavy_check_mark: | N/A | | +| `Field` | `string` | :heavy_check_mark: | Field to order by | request_count | \ No newline at end of file diff --git a/docs/models/operations/prompttokensdetails.md b/docs/models/operations/prompttokensdetails.md index 5cfad8f8..d032d3ee 100644 --- a/docs/models/operations/prompttokensdetails.md +++ b/docs/models/operations/prompttokensdetails.md @@ -5,9 +5,10 @@ Per-modality token breakdown. Only present when the input contains 2+ modalities ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `AudioTokens` | `*int64` | :heavy_minus_sign: | Number of audio tokens in the input | | -| `ImageTokens` | `*int64` | :heavy_minus_sign: | Number of image tokens in the input | 258 | -| `TextTokens` | `*int64` | :heavy_minus_sign: | Number of text tokens in the input | 8 | -| `VideoTokens` | `*int64` | :heavy_minus_sign: | Number of video tokens in the input | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `AudioTokens` | `*int64` | :heavy_minus_sign: | Number of audio tokens in the input | | +| `FileTokens` | `*int64` | :heavy_minus_sign: | Number of file/document tokens in the input | | +| `ImageTokens` | `*int64` | :heavy_minus_sign: | Number of image tokens in the input | 258 | +| `TextTokens` | `*int64` | :heavy_minus_sign: | Number of text tokens in the input | 8 | +| `VideoTokens` | `*int64` | :heavy_minus_sign: | Number of video tokens in the input | | \ No newline at end of file diff --git a/docs/models/operations/provider.md b/docs/models/operations/provider.md new file mode 100644 index 00000000..c4fb2f32 --- /dev/null +++ b/docs/models/operations/provider.md @@ -0,0 +1,105 @@ +# Provider + +Optional provider slug to filter by (e.g. `openai`, `anthropic`, `amazon-bedrock`). + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/operations" +) + +value := operations.ProviderAi21 + +// Open enum: custom values can be created with a direct type cast +custom := operations.Provider("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------- | ------------------------- | +| `ProviderAi21` | ai21 | +| `ProviderAionLabs` | aion-labs | +| `ProviderAkashml` | akashml | +| `ProviderAlibaba` | alibaba | +| `ProviderAmazonBedrock` | amazon-bedrock | +| `ProviderAmazonNova` | amazon-nova | +| `ProviderAmbient` | ambient | +| `ProviderAnthropic` | anthropic | +| `ProviderArceeAi` | arcee-ai | +| `ProviderAtlasCloud` | atlas-cloud | +| `ProviderAvian` | avian | +| `ProviderAzure` | azure | +| `ProviderBaidu` | baidu | +| `ProviderBaseten` | baseten | +| `ProviderBlackForestLabs` | black-forest-labs | +| `ProviderByteplus` | byteplus | +| `ProviderCerebras` | cerebras | +| `ProviderChutes` | chutes | +| `ProviderCirrascale` | cirrascale | +| `ProviderClarifai` | clarifai | +| `ProviderCloudflare` | cloudflare | +| `ProviderCohere` | cohere | +| `ProviderCrusoe` | crusoe | +| `ProviderDarkbloom` | darkbloom | +| `ProviderDecart` | decart | +| `ProviderDeepinfra` | deepinfra | +| `ProviderDeepseek` | deepseek | +| `ProviderDekallm` | dekallm | +| `ProviderDigitalocean` | digitalocean | +| `ProviderFeatherless` | featherless | +| `ProviderFireworks` | fireworks | +| `ProviderFriendli` | friendli | +| `ProviderGmicloud` | gmicloud | +| `ProviderGoogleAiStudio` | google-ai-studio | +| `ProviderGoogleVertex` | google-vertex | +| `ProviderGroq` | groq | +| `ProviderInception` | inception | +| `ProviderInceptron` | inceptron | +| `ProviderInferenceNet` | inference-net | +| `ProviderInfermatic` | infermatic | +| `ProviderInflection` | inflection | +| `ProviderIoNet` | io-net | +| `ProviderIonstream` | ionstream | +| `ProviderLiquid` | liquid | +| `ProviderMancer` | mancer | +| `ProviderMara` | mara | +| `ProviderMinimax` | minimax | +| `ProviderMistral` | mistral | +| `ProviderModelrun` | modelrun | +| `ProviderModular` | modular | +| `ProviderMoonshotai` | moonshotai | +| `ProviderMorph` | morph | +| `ProviderNcompass` | ncompass | +| `ProviderNebius` | nebius | +| `ProviderNexAgi` | nex-agi | +| `ProviderNextbit` | nextbit | +| `ProviderNovita` | novita | +| `ProviderNvidia` | nvidia | +| `ProviderOpenInference` | open-inference | +| `ProviderOpenai` | openai | +| `ProviderParasail` | parasail | +| `ProviderPerceptron` | perceptron | +| `ProviderPerplexity` | perplexity | +| `ProviderPhala` | phala | +| `ProviderPoolside` | poolside | +| `ProviderRecraft` | recraft | +| `ProviderReka` | reka | +| `ProviderRelace` | relace | +| `ProviderSambanova` | sambanova | +| `ProviderSeed` | seed | +| `ProviderSiliconflow` | siliconflow | +| `ProviderSourceful` | sourceful | +| `ProviderStepfun` | stepfun | +| `ProviderStreamlake` | streamlake | +| `ProviderSwitchpoint` | switchpoint | +| `ProviderTogether` | together | +| `ProviderUpstage` | upstage | +| `ProviderVenice` | venice | +| `ProviderWafer` | wafer | +| `ProviderWandb` | wandb | +| `ProviderXai` | xai | +| `ProviderXiaomi` | xiaomi | +| `ProviderZAi` | z-ai | \ No newline at end of file diff --git a/docs/models/operations/queryanalyticsdata1.md b/docs/models/operations/queryanalyticsdata1.md new file mode 100644 index 00000000..055291f2 --- /dev/null +++ b/docs/models/operations/queryanalyticsdata1.md @@ -0,0 +1,9 @@ +# QueryAnalyticsData1 + +A row of analytics data with metric/dimension values + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/queryanalyticsdata2.md b/docs/models/operations/queryanalyticsdata2.md new file mode 100644 index 00000000..8b00559b --- /dev/null +++ b/docs/models/operations/queryanalyticsdata2.md @@ -0,0 +1,10 @@ +# QueryAnalyticsData2 + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `CachedAt` | `*float64` | :heavy_minus_sign: | N/A | +| `Data` | [][operations.QueryAnalyticsData1](../../models/operations/queryanalyticsdata1.md) | :heavy_check_mark: | N/A | +| `Metadata` | [operations.Metadata](../../models/operations/metadata.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/queryanalyticsrequest.md b/docs/models/operations/queryanalyticsrequest.md new file mode 100644 index 00000000..021e26bc --- /dev/null +++ b/docs/models/operations/queryanalyticsrequest.md @@ -0,0 +1,15 @@ +# QueryAnalyticsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Dimensions` | []`string` | :heavy_minus_sign: | N/A | | +| `Filters` | [][operations.Filter](../../models/operations/filter.md) | :heavy_minus_sign: | N/A | | +| `Granularity` | `*string` | :heavy_minus_sign: | Time granularity | day | +| `GroupLimit` | `*int64` | :heavy_minus_sign: | Maximum rows per distinct combination of dimensions. When omitted on time-series queries (granularity + dimensions), auto-computed to avoid truncating time windows. Explicit values override the default and may truncate time buckets if set lower than the number of buckets in the range. Ignored when no dimensions are specified. | 100 | +| `Limit` | `*int64` | :heavy_minus_sign: | Maximum total rows returned. Defaults to 1000. On time-series queries with dimensions and no explicit group_limit, the server may raise this to accommodate the expected number of unique time-bucket/dimension combinations. | | +| `Metrics` | []`string` | :heavy_check_mark: | N/A | | +| `OrderBy` | [*operations.OrderBy](../../models/operations/orderby.md) | :heavy_minus_sign: | N/A | | +| `TimeRange` | [*operations.TimeRange](../../models/operations/timerange.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/queryanalyticsresponse.md b/docs/models/operations/queryanalyticsresponse.md new file mode 100644 index 00000000..3b6b47fc --- /dev/null +++ b/docs/models/operations/queryanalyticsresponse.md @@ -0,0 +1,10 @@ +# QueryAnalyticsResponse + +Analytics query results + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `Data` | [operations.QueryAnalyticsData2](../../models/operations/queryanalyticsdata2.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/region.md b/docs/models/operations/region.md new file mode 100644 index 00000000..b685f321 --- /dev/null +++ b/docs/models/operations/region.md @@ -0,0 +1,20 @@ +# Region + +Filter to models with endpoints in the given data region. Currently only "eu" is supported. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/operations" +) + +value := operations.RegionEu +``` + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `RegionEu` | eu | \ No newline at end of file diff --git a/docs/models/operations/result.md b/docs/models/operations/result.md index 45f71a86..b5f74db0 100644 --- a/docs/models/operations/result.md +++ b/docs/models/operations/result.md @@ -5,8 +5,8 @@ A single rerank result ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `Document` | [operations.Document](../../models/operations/document.md) | :heavy_check_mark: | The document object containing the original text | | -| `Index` | `int64` | :heavy_check_mark: | Index of the document in the original input list | 0 | -| `RelevanceScore` | `float64` | :heavy_check_mark: | Relevance score of the document to the query | 0.98 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `Document` | [operations.DocumentResponse](../../models/operations/documentresponse.md) | :heavy_check_mark: | The document object echoing the original input (text and/or image) | | +| `Index` | `int64` | :heavy_check_mark: | Index of the document in the original input list | 0 | +| `RelevanceScore` | `float64` | :heavy_check_mark: | Relevance score of the document to the query | 0.98 | \ No newline at end of file diff --git a/docs/models/operations/sendchatcompletionrequestrequest.md b/docs/models/operations/sendchatcompletionrequestrequest.md new file mode 100644 index 00000000..613d868e --- /dev/null +++ b/docs/models/operations/sendchatcompletionrequestrequest.md @@ -0,0 +1,9 @@ +# SendChatCompletionRequestRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `XOpenRouterMetadata` | [*components.MetadataLevel](../../models/components/metadatalevel.md) | :heavy_minus_sign: | Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. | enabled | +| `ChatRequest` | [components.ChatRequest](../../models/components/chatrequest.md) | :heavy_check_mark: | N/A | {
"max_tokens": 150,
"messages": [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "What is the capital of France?",
"role": "user"
}
],
"model": "openai/gpt-4",
"temperature": 0.7
} | \ No newline at end of file diff --git a/docs/models/operations/sendchatcompletionrequestresponse.md b/docs/models/operations/sendchatcompletionrequestresponse.md index 1ea9ffd3..7846dda3 100644 --- a/docs/models/operations/sendchatcompletionrequestresponse.md +++ b/docs/models/operations/sendchatcompletionrequestresponse.md @@ -12,7 +12,7 @@ sendChatCompletionRequestResponse := operations.CreateSendChatCompletionRequestR ### ```go -sendChatCompletionRequestResponse := operations.CreateSendChatCompletionRequestResponseEventStream(*stream.EventStream[operations.SendChatCompletionRequestResponseBody]{/* values here */}) +sendChatCompletionRequestResponse := operations.CreateSendChatCompletionRequestResponseEventStream(*stream.EventStream[components.ChatStreamingResponse]{/* values here */}) ``` ## Union Discrimination diff --git a/docs/models/operations/subcategory.md b/docs/models/operations/subcategory.md new file mode 100644 index 00000000..ca0251d7 --- /dev/null +++ b/docs/models/operations/subcategory.md @@ -0,0 +1,37 @@ +# Subcategory + +Marketplace subcategory to filter by (e.g. `cli-agent`). Takes precedence over `category` for the actual filter; when `category` is also supplied the pair must be consistent. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/operations" +) + +value := operations.SubcategoryCliAgent + +// Open enum: custom values can be created with a direct type cast +custom := operations.Subcategory("custom_value") +``` + + +## Values + +| Name | Value | +| ----------------------------- | ----------------------------- | +| `SubcategoryCliAgent` | cli-agent | +| `SubcategoryIdeExtension` | ide-extension | +| `SubcategoryCloudAgent` | cloud-agent | +| `SubcategoryProgrammingApp` | programming-app | +| `SubcategoryNativeAppBuilder` | native-app-builder | +| `SubcategoryCreativeWriting` | creative-writing | +| `SubcategoryVideoGen` | video-gen | +| `SubcategoryImageGen` | image-gen | +| `SubcategoryAudioGen` | audio-gen | +| `SubcategoryRoleplay` | roleplay | +| `SubcategoryGame` | game | +| `SubcategoryWritingAssistant` | writing-assistant | +| `SubcategoryGeneralChat` | general-chat | +| `SubcategoryPersonalAgent` | personal-agent | +| `SubcategoryLegal` | legal | \ No newline at end of file diff --git a/docs/models/operations/timerange.md b/docs/models/operations/timerange.md new file mode 100644 index 00000000..9185beef --- /dev/null +++ b/docs/models/operations/timerange.md @@ -0,0 +1,9 @@ +# TimeRange + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `End` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | +| `Start` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updatebyokkeyrequest.md b/docs/models/operations/updatebyokkeyrequest.md new file mode 100644 index 00000000..22a5584e --- /dev/null +++ b/docs/models/operations/updatebyokkeyrequest.md @@ -0,0 +1,9 @@ +# UpdateBYOKKeyRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `ID` | `string` | :heavy_check_mark: | The BYOK credential ID (UUID). | 11111111-2222-3333-4444-555555555555 | +| `UpdateBYOKKeyRequest` | [components.UpdateBYOKKeyRequest](../../models/components/updatebyokkeyrequest.md) | :heavy_check_mark: | N/A | {
"disabled": false,
"name": "Updated OpenAI Key"
} | \ No newline at end of file diff --git a/docs/models/operations/updateobservabilitydestinationrequest.md b/docs/models/operations/updateobservabilitydestinationrequest.md new file mode 100644 index 00000000..7ebb41c0 --- /dev/null +++ b/docs/models/operations/updateobservabilitydestinationrequest.md @@ -0,0 +1,9 @@ +# UpdateObservabilityDestinationRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `ID` | `string` | :heavy_check_mark: | The destination ID (UUID). | 99999999-aaaa-bbbb-cccc-dddddddddddd | +| `UpdateObservabilityDestinationRequest` | [components.UpdateObservabilityDestinationRequest](../../models/components/updateobservabilitydestinationrequest.md) | :heavy_check_mark: | N/A | {
"enabled": false,
"name": "Updated Langfuse"
} | \ No newline at end of file diff --git a/docs/models/operations/uploadfilerequest.md b/docs/models/operations/uploadfilerequest.md new file mode 100644 index 00000000..5a893a47 --- /dev/null +++ b/docs/models/operations/uploadfilerequest.md @@ -0,0 +1,9 @@ +# UploadFileRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `WorkspaceID` | `*string` | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 | +| `RequestBody` | [operations.UploadFileRequestBody](../../models/operations/uploadfilerequestbody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/uploadfilerequestbody.md b/docs/models/operations/uploadfilerequestbody.md new file mode 100644 index 00000000..047e417f --- /dev/null +++ b/docs/models/operations/uploadfilerequestbody.md @@ -0,0 +1,8 @@ +# UploadFileRequestBody + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `File` | [operations.File](../../models/operations/file.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/value1.md b/docs/models/operations/value1.md new file mode 100644 index 00000000..0dc6a591 --- /dev/null +++ b/docs/models/operations/value1.md @@ -0,0 +1,39 @@ +# Value1 + +Filter value (scalar or array depending on operator) + + +## Supported Types + +### + +```go +value1 := operations.CreateValue1Str(string{/* values here */}) +``` + +### + +```go +value1 := operations.CreateValue1Number(float64{/* values here */}) +``` + +### + +```go +value1 := operations.CreateValue1ArrayOfValue2([]operations.Value2{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch value1.Type { + case operations.Value1TypeStr: + // value1.Str is populated + case operations.Value1TypeNumber: + // value1.Number is populated + case operations.Value1TypeArrayOfValue2: + // value1.ArrayOfValue2 is populated +} +``` diff --git a/docs/models/operations/value2.md b/docs/models/operations/value2.md new file mode 100644 index 00000000..459ce85e --- /dev/null +++ b/docs/models/operations/value2.md @@ -0,0 +1,29 @@ +# Value2 + + +## Supported Types + +### + +```go +value2 := operations.CreateValue2Str(string{/* values here */}) +``` + +### + +```go +value2 := operations.CreateValue2Number(float64{/* values here */}) +``` + +## Union Discrimination + +Use the `Type` field to determine which variant is active, then access the corresponding field: + +```go +switch value2.Type { + case operations.Value2TypeStr: + // value2.Str is populated + case operations.Value2TypeNumber: + // value2.Number is populated +} +``` diff --git a/docs/models/operations/valuetype.md b/docs/models/operations/valuetype.md new file mode 100644 index 00000000..b9af9a6d --- /dev/null +++ b/docs/models/operations/valuetype.md @@ -0,0 +1,24 @@ +# ValueType + +Whether the operator expects a single value or an array + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/operations" +) + +value := operations.ValueTypeScalar + +// Open enum: custom values can be created with a direct type cast +custom := operations.ValueType("custom_value") +``` + + +## Values + +| Name | Value | +| ----------------- | ----------------- | +| `ValueTypeScalar` | scalar | +| `ValueTypeArray` | array | \ No newline at end of file diff --git a/docs/models/operations/zdr.md b/docs/models/operations/zdr.md new file mode 100644 index 00000000..06ea53e1 --- /dev/null +++ b/docs/models/operations/zdr.md @@ -0,0 +1,20 @@ +# Zdr + +When set to "true", return only models with zero data retention endpoints. + +## Example Usage + +```go +import ( + "github.com/OpenRouterTeam/go-sdk/models/operations" +) + +value := operations.ZdrTrue +``` + + +## Values + +| Name | Value | +| --------- | --------- | +| `ZdrTrue` | true | \ No newline at end of file diff --git a/docs/models/sdkerrors/badgatewayresponseerror.md b/docs/models/sdkerrors/badgatewayresponseerror.md index 50473141..dae1cda5 100644 --- a/docs/models/sdkerrors/badgatewayresponseerror.md +++ b/docs/models/sdkerrors/badgatewayresponseerror.md @@ -8,4 +8,5 @@ Bad Gateway - Provider/upstream API failure | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | | `Error` | [components.BadGatewayResponseErrorData](../../models/components/badgatewayresponseerrordata.md) | :heavy_check_mark: | Error data for BadGatewayResponse | {
"code": 502,
"message": "Provider returned error"
} | +| `OpenrouterMetadata` | map[string]`any` | :heavy_minus_sign: | N/A | | | `UserID` | `*string` | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/sdkerrors/badrequestresponseerror.md b/docs/models/sdkerrors/badrequestresponseerror.md index 22cc743c..01f36be4 100644 --- a/docs/models/sdkerrors/badrequestresponseerror.md +++ b/docs/models/sdkerrors/badrequestresponseerror.md @@ -8,4 +8,5 @@ Bad Request - Invalid request parameters or malformed input | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | | `Error` | [components.BadRequestResponseErrorData](../../models/components/badrequestresponseerrordata.md) | :heavy_check_mark: | Error data for BadRequestResponse | {
"code": 400,
"message": "Invalid request parameters"
} | +| `OpenrouterMetadata` | map[string]`any` | :heavy_minus_sign: | N/A | | | `UserID` | `*string` | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/sdkerrors/conflictresponseerror.md b/docs/models/sdkerrors/conflictresponseerror.md index b91f94f5..c14cb120 100644 --- a/docs/models/sdkerrors/conflictresponseerror.md +++ b/docs/models/sdkerrors/conflictresponseerror.md @@ -8,4 +8,5 @@ Conflict - Resource conflict or concurrent modification | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | | `Error` | [components.ConflictResponseErrorData](../../models/components/conflictresponseerrordata.md) | :heavy_check_mark: | Error data for ConflictResponse | {
"code": 409,
"message": "Resource conflict. Please try again later."
} | +| `OpenrouterMetadata` | map[string]`any` | :heavy_minus_sign: | N/A | | | `UserID` | `*string` | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/sdkerrors/edgenetworktimeoutresponseerror.md b/docs/models/sdkerrors/edgenetworktimeoutresponseerror.md index b46d6677..a65715df 100644 --- a/docs/models/sdkerrors/edgenetworktimeoutresponseerror.md +++ b/docs/models/sdkerrors/edgenetworktimeoutresponseerror.md @@ -8,4 +8,5 @@ Infrastructure Timeout - Provider request timed out at edge network | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | | `Error` | [components.EdgeNetworkTimeoutResponseErrorData](../../models/components/edgenetworktimeoutresponseerrordata.md) | :heavy_check_mark: | Error data for EdgeNetworkTimeoutResponse | {
"code": 524,
"message": "Request timed out. Please try again later."
} | +| `OpenrouterMetadata` | map[string]`any` | :heavy_minus_sign: | N/A | | | `UserID` | `*string` | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/sdkerrors/forbiddenresponseerror.md b/docs/models/sdkerrors/forbiddenresponseerror.md index 9b912ad6..128ca103 100644 --- a/docs/models/sdkerrors/forbiddenresponseerror.md +++ b/docs/models/sdkerrors/forbiddenresponseerror.md @@ -8,4 +8,5 @@ Forbidden - Authentication successful but insufficient permissions | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | | `Error` | [components.ForbiddenResponseErrorData](../../models/components/forbiddenresponseerrordata.md) | :heavy_check_mark: | Error data for ForbiddenResponse | {
"code": 403,
"message": "Only management keys can perform this operation"
} | +| `OpenrouterMetadata` | map[string]`any` | :heavy_minus_sign: | N/A | | | `UserID` | `*string` | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/sdkerrors/internalserverresponseerror.md b/docs/models/sdkerrors/internalserverresponseerror.md index 24890222..e11af301 100644 --- a/docs/models/sdkerrors/internalserverresponseerror.md +++ b/docs/models/sdkerrors/internalserverresponseerror.md @@ -8,4 +8,5 @@ Internal Server Error - Unexpected server error | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | | `Error` | [components.InternalServerResponseErrorData](../../models/components/internalserverresponseerrordata.md) | :heavy_check_mark: | Error data for InternalServerResponse | {
"code": 500,
"message": "Internal Server Error"
} | +| `OpenrouterMetadata` | map[string]`any` | :heavy_minus_sign: | N/A | | | `UserID` | `*string` | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/sdkerrors/notfoundresponseerror.md b/docs/models/sdkerrors/notfoundresponseerror.md index 75d83888..92bfd239 100644 --- a/docs/models/sdkerrors/notfoundresponseerror.md +++ b/docs/models/sdkerrors/notfoundresponseerror.md @@ -8,4 +8,5 @@ Not Found - Resource does not exist | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | | `Error` | [components.NotFoundResponseErrorData](../../models/components/notfoundresponseerrordata.md) | :heavy_check_mark: | Error data for NotFoundResponse | {
"code": 404,
"message": "Resource not found"
} | +| `OpenrouterMetadata` | map[string]`any` | :heavy_minus_sign: | N/A | | | `UserID` | `*string` | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/sdkerrors/payloadtoolargeresponseerror.md b/docs/models/sdkerrors/payloadtoolargeresponseerror.md index c94959b6..b386559b 100644 --- a/docs/models/sdkerrors/payloadtoolargeresponseerror.md +++ b/docs/models/sdkerrors/payloadtoolargeresponseerror.md @@ -8,4 +8,5 @@ Payload Too Large - Request payload exceeds size limits | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | | `Error` | [components.PayloadTooLargeResponseErrorData](../../models/components/payloadtoolargeresponseerrordata.md) | :heavy_check_mark: | Error data for PayloadTooLargeResponse | {
"code": 413,
"message": "Request payload too large"
} | +| `OpenrouterMetadata` | map[string]`any` | :heavy_minus_sign: | N/A | | | `UserID` | `*string` | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/sdkerrors/paymentrequiredresponseerror.md b/docs/models/sdkerrors/paymentrequiredresponseerror.md index 1b161ef8..22241972 100644 --- a/docs/models/sdkerrors/paymentrequiredresponseerror.md +++ b/docs/models/sdkerrors/paymentrequiredresponseerror.md @@ -8,4 +8,5 @@ Payment Required - Insufficient credits or quota to complete request | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | | `Error` | [components.PaymentRequiredResponseErrorData](../../models/components/paymentrequiredresponseerrordata.md) | :heavy_check_mark: | Error data for PaymentRequiredResponse | {
"code": 402,
"message": "Insufficient credits. Add more using https://openrouter.ai/credits"
} | +| `OpenrouterMetadata` | map[string]`any` | :heavy_minus_sign: | N/A | | | `UserID` | `*string` | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/sdkerrors/provideroverloadedresponseerror.md b/docs/models/sdkerrors/provideroverloadedresponseerror.md index 7592d310..2960117d 100644 --- a/docs/models/sdkerrors/provideroverloadedresponseerror.md +++ b/docs/models/sdkerrors/provideroverloadedresponseerror.md @@ -8,4 +8,5 @@ Provider Overloaded - Provider is temporarily overloaded | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | | `Error` | [components.ProviderOverloadedResponseErrorData](../../models/components/provideroverloadedresponseerrordata.md) | :heavy_check_mark: | Error data for ProviderOverloadedResponse | {
"code": 529,
"message": "Provider returned error"
} | +| `OpenrouterMetadata` | map[string]`any` | :heavy_minus_sign: | N/A | | | `UserID` | `*string` | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/sdkerrors/requesttimeoutresponseerror.md b/docs/models/sdkerrors/requesttimeoutresponseerror.md index d8fda8c5..4c0dbb2e 100644 --- a/docs/models/sdkerrors/requesttimeoutresponseerror.md +++ b/docs/models/sdkerrors/requesttimeoutresponseerror.md @@ -8,4 +8,5 @@ Request Timeout - Operation exceeded time limit | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | | `Error` | [components.RequestTimeoutResponseErrorData](../../models/components/requesttimeoutresponseerrordata.md) | :heavy_check_mark: | Error data for RequestTimeoutResponse | {
"code": 408,
"message": "Operation timed out. Please try again later."
} | +| `OpenrouterMetadata` | map[string]`any` | :heavy_minus_sign: | N/A | | | `UserID` | `*string` | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/sdkerrors/serviceunavailableresponseerror.md b/docs/models/sdkerrors/serviceunavailableresponseerror.md index 1c2fc482..2c961fee 100644 --- a/docs/models/sdkerrors/serviceunavailableresponseerror.md +++ b/docs/models/sdkerrors/serviceunavailableresponseerror.md @@ -8,4 +8,5 @@ Service Unavailable - Service temporarily unavailable | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | | `Error` | [components.ServiceUnavailableResponseErrorData](../../models/components/serviceunavailableresponseerrordata.md) | :heavy_check_mark: | Error data for ServiceUnavailableResponse | {
"code": 503,
"message": "Service temporarily unavailable"
} | +| `OpenrouterMetadata` | map[string]`any` | :heavy_minus_sign: | N/A | | | `UserID` | `*string` | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/sdkerrors/toomanyrequestsresponseerror.md b/docs/models/sdkerrors/toomanyrequestsresponseerror.md index 24555b71..3536e13b 100644 --- a/docs/models/sdkerrors/toomanyrequestsresponseerror.md +++ b/docs/models/sdkerrors/toomanyrequestsresponseerror.md @@ -8,4 +8,5 @@ Too Many Requests - Rate limit exceeded | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | | `Error` | [components.TooManyRequestsResponseErrorData](../../models/components/toomanyrequestsresponseerrordata.md) | :heavy_check_mark: | Error data for TooManyRequestsResponse | {
"code": 429,
"message": "Rate limit exceeded"
} | +| `OpenrouterMetadata` | map[string]`any` | :heavy_minus_sign: | N/A | | | `UserID` | `*string` | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/sdkerrors/unauthorizedresponseerror.md b/docs/models/sdkerrors/unauthorizedresponseerror.md index 30041061..d039f688 100644 --- a/docs/models/sdkerrors/unauthorizedresponseerror.md +++ b/docs/models/sdkerrors/unauthorizedresponseerror.md @@ -8,4 +8,5 @@ Unauthorized - Authentication required or invalid credentials | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | | `Error` | [components.UnauthorizedResponseErrorData](../../models/components/unauthorizedresponseerrordata.md) | :heavy_check_mark: | Error data for UnauthorizedResponse | {
"code": 401,
"message": "Missing Authentication header"
} | +| `OpenrouterMetadata` | map[string]`any` | :heavy_minus_sign: | N/A | | | `UserID` | `*string` | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/sdkerrors/unprocessableentityresponseerror.md b/docs/models/sdkerrors/unprocessableentityresponseerror.md index b6cb5985..1c0a4829 100644 --- a/docs/models/sdkerrors/unprocessableentityresponseerror.md +++ b/docs/models/sdkerrors/unprocessableentityresponseerror.md @@ -8,4 +8,5 @@ Unprocessable Entity - Semantic validation failure | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | | `Error` | [components.UnprocessableEntityResponseErrorData](../../models/components/unprocessableentityresponseerrordata.md) | :heavy_check_mark: | Error data for UnprocessableEntityResponse | {
"code": 422,
"message": "Invalid argument"
} | +| `OpenrouterMetadata` | map[string]`any` | :heavy_minus_sign: | N/A | | | `UserID` | `*string` | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdks/betaanalytics/README.md b/docs/sdks/betaanalytics/README.md new file mode 100644 index 00000000..4824b2ed --- /dev/null +++ b/docs/sdks/betaanalytics/README.md @@ -0,0 +1,136 @@ +# Beta.Analytics + +## Overview + +beta.Analytics endpoints + +### Available Operations + +* [GetAnalyticsMeta](#getanalyticsmeta) - Get available analytics metrics and dimensions +* [QueryAnalytics](#queryanalytics) - Query analytics data + +## GetAnalyticsMeta + +Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Beta.Analytics.GetAnalyticsMeta(ctx) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetAnalyticsMetaResponse](../../models/operations/getanalyticsmetaresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.ForbiddenResponseError | 403 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## QueryAnalytics + +Execute an analytics query with specified metrics, dimensions, filters, and time range. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "github.com/OpenRouterTeam/go-sdk/types" + "github.com/OpenRouterTeam/go-sdk/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Beta.Analytics.QueryAnalytics(ctx, operations.QueryAnalyticsRequest{ + Dimensions: []string{ + "model", + }, + Granularity: openrouter.Pointer("day"), + Limit: openrouter.Pointer[int64](100), + Metrics: []string{ + "request_count", + }, + TimeRange: &operations.TimeRange{ + End: types.MustTimeFromString("2025-01-08T00:00:00Z"), + Start: types.MustTimeFromString("2025-01-01T00:00:00Z"), + }, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.QueryAnalyticsRequest](../../models/operations/queryanalyticsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.QueryAnalyticsResponse](../../models/operations/queryanalyticsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.ForbiddenResponseError | 403 | application/json | +| sdkerrors.RequestTimeoutResponseError | 408 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/byok/README.md b/docs/sdks/byok/README.md new file mode 100644 index 00000000..3d402414 --- /dev/null +++ b/docs/sdks/byok/README.md @@ -0,0 +1,317 @@ +# Byok + +## Overview + +BYOK endpoints + +### Available Operations + +* [List](#list) - List BYOK provider credentials +* [Create](#create) - Create a BYOK provider credential +* [Delete](#delete) - Delete a BYOK provider credential +* [Get](#get) - Get a BYOK provider credential +* [Update](#update) - Update a BYOK provider credential + +## List + +List the bring-your-own-key (BYOK) provider credentials for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace, or the `provider` query parameter to filter by upstream provider. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Byok.List(ctx, optionalnullable.From[int64](nil), nil, nil, nil) + if err != nil { + log.Fatal(err) + } + if res != nil { + for { + // handle items + + res, err = res.Next() + + if err != nil { + // handle error + } + + if res == nil { + break + } + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `offset` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `limit` | `*int64` | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | +| `workspaceID` | `*string` | :heavy_minus_sign: | Optional workspace ID to filter by. Defaults to the authenticated entity's default workspace. | 550e8400-e29b-41d4-a716-446655440000 | +| `provider` | [*operations.Provider](../../models/operations/provider.md) | :heavy_minus_sign: | Optional provider slug to filter by (e.g. `openai`, `anthropic`, `amazon-bedrock`). | openai | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*operations.ListBYOKKeysResponse](../../models/operations/listbyokkeysresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## Create + +Create a new bring-your-own-key (BYOK) provider credential. The raw key is encrypted at rest and never returned in API responses. Defaults to the authenticated entity's default workspace; use the `workspace_id` body field to scope to a different workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" + "github.com/OpenRouterTeam/go-sdk/models/components" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Byok.Create(ctx, components.CreateBYOKKeyRequest{ + Key: "sk-proj-abc123...", + Name: optionalnullable.From(openrouter.Pointer("Production OpenAI Key")), + Provider: components.BYOKProviderSlugOpenai, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [components.CreateBYOKKeyRequest](../../models/components/createbyokkeyrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*components.CreateBYOKKeyResponse](../../models/components/createbyokkeyresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.ForbiddenResponseError | 403 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## Delete + +Delete (soft-delete) a bring-your-own-key (BYOK) provider credential by its `id`. The encrypted key material is wiped and the record is marked as deleted. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Byok.Delete(ctx, "11111111-2222-3333-4444-555555555555") + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `id` | `string` | :heavy_check_mark: | The BYOK credential ID (UUID). | 11111111-2222-3333-4444-555555555555 | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*components.DeleteBYOKKeyResponse](../../models/components/deletebyokkeyresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.NotFoundResponseError | 404 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## Get + +Get a single bring-your-own-key (BYOK) provider credential by its `id`. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Byok.Get(ctx, "11111111-2222-3333-4444-555555555555") + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `id` | `string` | :heavy_check_mark: | The BYOK credential ID (UUID). | 11111111-2222-3333-4444-555555555555 | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*components.GetBYOKKeyResponse](../../models/components/getbyokkeyresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.NotFoundResponseError | 404 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## Update + +Update an existing bring-your-own-key (BYOK) provider credential by its `id`. Include the `key` field to rotate the raw provider API key in-place (the previous key material is overwritten). [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" + "github.com/OpenRouterTeam/go-sdk/models/components" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Byok.Update(ctx, "11111111-2222-3333-4444-555555555555", components.UpdateBYOKKeyRequest{ + Disabled: openrouter.Pointer(false), + Name: optionalnullable.From(openrouter.Pointer("Updated OpenAI Key")), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `id` | `string` | :heavy_check_mark: | The BYOK credential ID (UUID). | 11111111-2222-3333-4444-555555555555 | +| `updateBYOKKeyRequest` | [components.UpdateBYOKKeyRequest](../../models/components/updatebyokkeyrequest.md) | :heavy_check_mark: | N/A | {
"disabled": false,
"name": "Updated OpenAI Key"
} | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*components.UpdateBYOKKeyResponse](../../models/components/updatebyokkeyresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.NotFoundResponseError | 404 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/chat/README.md b/docs/sdks/chat/README.md index 2e19d9c7..99c934ac 100644 --- a/docs/sdks/chat/README.md +++ b/docs/sdks/chat/README.md @@ -10,9 +10,9 @@ Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes. -### Example Usage +### Example Usage: guardrail-blocked - + ```go package main @@ -20,7 +20,6 @@ import( "context" "os" openrouter "github.com/OpenRouterTeam/go-sdk" - "github.com/OpenRouterTeam/go-sdk/optionalnullable" "github.com/OpenRouterTeam/go-sdk/models/components" "log" ) @@ -33,7 +32,6 @@ func main() { ) res, err := s.Chat.Send(ctx, components.ChatRequest{ - MaxTokens: optionalnullable.From(openrouter.Pointer[int64](150)), Messages: []components.ChatMessages{ components.CreateChatMessagesSystem( components.ChatSystemMessage{ @@ -52,17 +50,70 @@ func main() { }, ), }, - Model: openrouter.Pointer("openai/gpt-4"), - Temperature: optionalnullable.From(openrouter.Pointer[float64](0.7)), - }) + }, nil) if err != nil { log.Fatal(err) } if res != nil { - defer res.Object.Close() + defer res.ChatStreamingResponse.Close() - for res.Object.Next() { - event := res.Object.Value() + for res.ChatStreamingResponse.Next() { + event := res.ChatStreamingResponse.Value() + log.Print(event) + // Handle the event + } + } +} +``` +### Example Usage: insufficient-permissions + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "github.com/OpenRouterTeam/go-sdk/models/components" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Chat.Send(ctx, components.ChatRequest{ + Messages: []components.ChatMessages{ + components.CreateChatMessagesSystem( + components.ChatSystemMessage{ + Content: components.CreateChatSystemMessageContentStr( + "You are a helpful assistant.", + ), + Role: components.ChatSystemMessageRoleSystem, + }, + ), + components.CreateChatMessagesUser( + components.ChatUserMessage{ + Content: components.CreateChatUserMessageContentStr( + "What is the capital of France?", + ), + Role: components.ChatUserMessageRoleUser, + }, + ), + }, + }, nil) + if err != nil { + log.Fatal(err) + } + if res != nil { + defer res.ChatStreamingResponse.Close() + + for res.ChatStreamingResponse.Next() { + event := res.ChatStreamingResponse.Value() log.Print(event) // Handle the event } @@ -72,11 +123,12 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `request` | [components.ChatRequest](../../models/components/chatrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `chatRequest` | [components.ChatRequest](../../models/components/chatrequest.md) | :heavy_check_mark: | N/A | {
"max_tokens": 150,
"messages": [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "What is the capital of France?",
"role": "user"
}
],
"model": "openai/gpt-4",
"temperature": 0.7
} | +| `xOpenRouterMetadata` | [*components.MetadataLevel](../../models/components/metadatalevel.md) | :heavy_minus_sign: | Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. | enabled | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | ### Response @@ -89,6 +141,7 @@ func main() { | sdkerrors.BadRequestResponseError | 400 | application/json | | sdkerrors.UnauthorizedResponseError | 401 | application/json | | sdkerrors.PaymentRequiredResponseError | 402 | application/json | +| sdkerrors.ForbiddenResponseError | 403 | application/json | | sdkerrors.NotFoundResponseError | 404 | application/json | | sdkerrors.RequestTimeoutResponseError | 408 | application/json | | sdkerrors.PayloadTooLargeResponseError | 413 | application/json | diff --git a/docs/sdks/datasets/README.md b/docs/sdks/datasets/README.md new file mode 100644 index 00000000..4efd8239 --- /dev/null +++ b/docs/sdks/datasets/README.md @@ -0,0 +1,293 @@ +# Datasets + +## Overview + +Datasets endpoints + +### Available Operations + +* [GetAppRankings](#getapprankings) - Top apps by token usage +* [GetBenchmarksArtificialAnalysis](#getbenchmarksartificialanalysis) - Artificial Analysis Benchmark Indices +* [GetBenchmarksDesignArena](#getbenchmarksdesignarena) - Design Arena Benchmark Rankings +* [GetRankingsDaily](#getrankingsdaily) - Daily token totals for top 50 models + +## GetAppRankings + +Returns the top public apps on OpenRouter ranked by token usage inside the requested +date window, matching the public apps marketplace on openrouter.ai/apps. Token totals +are `prompt_tokens + completion_tokens`; hidden and private apps are excluded and +traffic from related app aliases is merged into the canonical visible app. + +`sort=popular` (default) ranks by total token volume inside the window. +`sort=trending` ranks by absolute excess token growth: window volume minus the average +volume of the three equal-length periods immediately preceding the window. Apps with +no excess growth are omitted, so `trending` may return fewer than `limit` rows. + +Filter with `category` (marketplace category group, e.g. `coding`) or `subcategory` +(e.g. `cli-agent`). Ranks are re-numbered 1..N after filtering. Page with `offset` — +`rank` stays absolute, so the first row of `offset=50` is `rank: 51`. + +Authenticate with any valid OpenRouter API key (same key used for inference). +Rate-limited to 30 requests/minute per key and 500 requests/day per account. + +When republishing or quoting this dataset, OpenRouter must be cited as: +"Source: OpenRouter (openrouter.ai/apps), as of {as_of}." + +Token counts come from each upstream provider's own tokenizer, so a token attributed +to one app is not directly comparable to a token attributed to another app whose +traffic flows through a different provider. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "github.com/OpenRouterTeam/go-sdk/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Datasets.GetAppRankings(ctx, &operations.GetAppRankingsRequest{}) + if err != nil { + log.Fatal(err) + } + if res != nil { + for { + // handle items + + res, err = res.Next() + + if err != nil { + // handle error + } + + if res == nil { + break + } + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetAppRankingsRequest](../../models/operations/getapprankingsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.GetAppRankingsResponse](../../models/operations/getapprankingsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.TooManyRequestsResponseError | 429 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## GetBenchmarksArtificialAnalysis + +Returns composite index scores (Intelligence, Coding, Agentic) from Artificial Analysis for LLM models. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Datasets.GetBenchmarksArtificialAnalysis(ctx, openrouter.Pointer[int64](20)) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `maxResults` | `*int64` | :heavy_minus_sign: | Max results to return (1–100, default 50). | 20 | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*components.BenchmarksAAResponse](../../models/components/benchmarksaaresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.TooManyRequestsResponseError | 429 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## GetBenchmarksDesignArena + +Returns ELO ratings from head-to-head arena battles on Design Arena. Filterable by arena (models/builders/agents) and category. Includes OpenRouter pricing per model. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "github.com/OpenRouterTeam/go-sdk/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Datasets.GetBenchmarksDesignArena(ctx, operations.ArenaModels.ToPointer(), nil, openrouter.Pointer[int64](20)) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `arena` | [*operations.Arena](../../models/operations/arena.md) | :heavy_minus_sign: | Arena to query. Defaults to `models`. | models | +| `category` | `*string` | :heavy_minus_sign: | Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. | codecategories | +| `maxResults` | `*int64` | :heavy_minus_sign: | Max results to return: per category when no category filter is applied (1–100, default 50). | 20 | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*components.BenchmarksDAResponse](../../models/components/benchmarksdaresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.TooManyRequestsResponseError | 429 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## GetRankingsDaily + +Returns the top 50 public models per day by total token usage on OpenRouter, plus a +single aggregated `other` row per day that sums every model outside that top 50. +Token totals are `prompt_tokens + completion_tokens`, matching the public rankings +chart on openrouter.ai/rankings. + +Each row is a distinct `(date, model_permaslug)` pair. The `other` row uses the +reserved permaslug `other` and is always returned last within its date, so callers +can compute `top-50 traffic / total daily traffic` without a second request. + +Authenticate with any valid OpenRouter API key (same key used for inference). +Rate-limited to 30 requests/minute per key and 500 requests/day per account. + +When republishing or quoting this dataset, OpenRouter must be cited as: +"Source: OpenRouter (openrouter.ai/rankings), as of {as_of}." + +Token counts come from each upstream provider's own tokenizer (Anthropic counts +are as reported by Anthropic, OpenAI counts are as reported by OpenAI, etc.), so +a token in one row is not directly comparable to a token in another row from a +different provider. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Datasets.GetRankingsDaily(ctx, nil, nil) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `startDate` | `*string` | :heavy_minus_sign: | Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`. | 2026-04-12 | +| `endDate` | `*string` | :heavy_minus_sign: | End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400. | 2026-05-11 | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*components.RankingsDailyResponse](../../models/components/rankingsdailyresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.TooManyRequestsResponseError | 429 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/files/README.md b/docs/sdks/files/README.md new file mode 100644 index 00000000..5a89ea86 --- /dev/null +++ b/docs/sdks/files/README.md @@ -0,0 +1,325 @@ +# Files + +## Overview + +Files endpoints + +### Available Operations + +* [List](#list) - List files +* [Upload](#upload) - Upload a file +* [Delete](#delete) - Delete a file +* [Retrieve](#retrieve) - Get file metadata +* [Download](#download) - Download file content + +## List + +Lists files belonging to the workspace of the authenticating API key. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Files.List(ctx, nil, nil, nil) + if err != nil { + log.Fatal(err) + } + if res != nil { + for { + // handle items + + res, err = res.Next() + + if err != nil { + // handle error + } + + if res == nil { + break + } + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `limit` | `*int64` | :heavy_minus_sign: | Maximum number of files to return (1–1000). | 100 | +| `cursor` | `*string` | :heavy_minus_sign: | Opaque pagination cursor from a previous response. | eyJjdXJzb3IiOiJmaWxlXzAxMUNOaGE4aUNKY1Uxd1hOUjZxNFY4dyJ9 | +| `workspaceID` | `*string` | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*operations.ListFilesResponse](../../models/operations/listfilesresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.TooManyRequestsResponseError | 429 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## Upload + +Uploads a file to be referenced in future API calls. The file is stored under the workspace of the authenticating API key. Maximum file size: 100 MB. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "github.com/OpenRouterTeam/go-sdk/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + example, fileErr := os.Open("example.file") + if fileErr != nil { + panic(fileErr) + } + + res, err := s.Files.Upload(ctx, operations.UploadFileRequestBody{ + File: operations.File{ + FileName: "example.file", + Content: example, + }, + }, nil) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `requestBody` | [operations.UploadFileRequestBody](../../models/operations/uploadfilerequestbody.md) | :heavy_check_mark: | N/A | | +| `workspaceID` | `*string` | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*components.FileMetadata](../../models/components/filemetadata.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.ForbiddenResponseError | 403 | application/json | +| sdkerrors.PayloadTooLargeResponseError | 413 | application/json | +| sdkerrors.TooManyRequestsResponseError | 429 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## Delete + +Deletes a file owned by the requesting workspace. Deletion is irreversible. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Files.Delete(ctx, "file_011CNha8iCJcU1wXNR6q4V8w", nil) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `fileID` | `string` | :heavy_check_mark: | N/A | file_011CNha8iCJcU1wXNR6q4V8w | +| `workspaceID` | `*string` | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*components.FileDeleteResponse](../../models/components/filedeleteresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.NotFoundResponseError | 404 | application/json | +| sdkerrors.TooManyRequestsResponseError | 429 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## Retrieve + +Retrieves metadata for a single file owned by the requesting workspace. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Files.Retrieve(ctx, "file_011CNha8iCJcU1wXNR6q4V8w", nil) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `fileID` | `string` | :heavy_check_mark: | N/A | file_011CNha8iCJcU1wXNR6q4V8w | +| `workspaceID` | `*string` | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*components.FileMetadata](../../models/components/filemetadata.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.NotFoundResponseError | 404 | application/json | +| sdkerrors.TooManyRequestsResponseError | 429 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## Download + +Downloads the raw bytes of a file. Only files created server-side are downloadable; uploaded files return 400. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Files.Download(ctx, "file_011CNha8iCJcU1wXNR6q4V8w", nil) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `fileID` | `string` | :heavy_check_mark: | N/A | file_011CNha8iCJcU1wXNR6q4V8w | +| `workspaceID` | `*string` | :heavy_minus_sign: | Workspace to scope the request to. Defaults to the caller’s default workspace. | a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7 | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[io.ReadCloser](../../.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.NotFoundResponseError | 404 | application/json | +| sdkerrors.TooManyRequestsResponseError | 429 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/guardrails/README.md b/docs/sdks/guardrails/README.md index 88da56c7..9fdcbcc7 100644 --- a/docs/sdks/guardrails/README.md +++ b/docs/sdks/guardrails/README.md @@ -123,7 +123,10 @@ func main() { "deepseek", })), Description: optionalnullable.From(openrouter.Pointer("A guardrail for limiting API usage")), - EnforceZdr: optionalnullable.From(openrouter.Pointer(false)), + EnforceZdrAnthropic: optionalnullable.From(openrouter.Pointer(true)), + EnforceZdrGoogle: optionalnullable.From(openrouter.Pointer(false)), + EnforceZdrOpenai: optionalnullable.From(openrouter.Pointer(true)), + EnforceZdrOther: optionalnullable.From(openrouter.Pointer(false)), IgnoredModels: optionalnullable.From[[]string](nil), IgnoredProviders: optionalnullable.From[[]string](nil), LimitUsd: optionalnullable.From(openrouter.Pointer[float64](50.0)), diff --git a/docs/sdks/models/README.md b/docs/sdks/models/README.md index 9c01c0a0..7e9a21c1 100644 --- a/docs/sdks/models/README.md +++ b/docs/sdks/models/README.md @@ -6,10 +6,66 @@ Model information endpoints ### Available Operations +* [Get](#get) - Get a model by its slug * [List](#list) - List all models and their properties * [Count](#count) - Get total count of available models * [ListForUser](#listforuser) - List models filtered by user provider preferences, privacy settings, and guardrails +## Get + +Returns full details for a single model identified by its author and slug (e.g. openai/gpt-4). Supports variant suffixes (e.g. openai/gpt-4:free) and resolves known slug aliases. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Models.Get(ctx, "openai", "gpt-4") + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `author` | `string` | :heavy_check_mark: | The author/organization of the model | openai | +| `slug` | `string` | :heavy_check_mark: | The model slug, optionally including a variant suffix (e.g. gpt-4 or gpt-4:free) | gpt-4 | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*components.ModelResponse](../../models/components/modelresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.NotFoundResponseError | 404 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + ## List List all models and their properties @@ -34,7 +90,7 @@ func main() { openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), ) - res, err := s.Models.List(ctx, nil, nil, nil) + res, err := s.Models.List(ctx, nil) if err != nil { log.Fatal(err) } @@ -46,13 +102,11 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | -| `category` | [*operations.Category](../../models/operations/category.md) | :heavy_minus_sign: | Filter models by use case category | programming | -| `supportedParameters` | `*string` | :heavy_minus_sign: | Filter models by supported parameter (comma-separated) | temperature | -| `outputModalities` | `*string` | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetModelsRequest](../../models/operations/getmodelsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response diff --git a/docs/sdks/oauth/README.md b/docs/sdks/oauth/README.md index d20c9324..ec69cb99 100644 --- a/docs/sdks/oauth/README.md +++ b/docs/sdks/oauth/README.md @@ -128,6 +128,7 @@ func main() { | ------------------------------------- | ------------------------------------- | ------------------------------------- | | sdkerrors.BadRequestResponseError | 400 | application/json | | sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.ForbiddenResponseError | 403 | application/json | | sdkerrors.ConflictResponseError | 409 | application/json | | sdkerrors.InternalServerResponseError | 500 | application/json | | sdkerrors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/observability/README.md b/docs/sdks/observability/README.md new file mode 100644 index 00000000..106234b8 --- /dev/null +++ b/docs/sdks/observability/README.md @@ -0,0 +1,435 @@ +# Observability + +## Overview + +Observability endpoints + +### Available Operations + +* [List](#list) - List observability destinations +* [Create](#create) - Create an observability destination +* [Delete](#delete) - Delete an observability destination +* [Get](#get) - Get an observability destination +* [Update](#update) - Update an observability destination + +## List + +List the observability destinations configured for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace. Only destinations with stable release status are surfaced — destinations of other types are excluded. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Observability.List(ctx, optionalnullable.From[int64](nil), nil, nil) + if err != nil { + log.Fatal(err) + } + if res != nil { + for { + // handle items + + res, err = res.Next() + + if err != nil { + // handle error + } + + if res == nil { + break + } + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `offset` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `limit` | `*int64` | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | +| `workspaceID` | `*string` | :heavy_minus_sign: | Optional workspace ID to filter by. Defaults to the authenticated entity's default workspace. | 550e8400-e29b-41d4-a716-446655440000 | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*operations.ListObservabilityDestinationsResponse](../../models/operations/listobservabilitydestinationsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## Create + +Create a new observability destination. A maximum of 5 destinations per type is allowed. Defaults to the authenticated entity's default workspace; use the `workspace_id` body field to scope to a different workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "github.com/OpenRouterTeam/go-sdk/models/components" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Observability.Create(ctx, components.CreateObservabilityDestinationRequest{ + Config: map[string]any{ + "baseUrl": "https://us.cloud.langfuse.com", + "publicKey": "pk-l...EfGh", + "secretKey": "sk-l...AbCd", + }, + Name: "Production Langfuse", + Type: components.CreateObservabilityDestinationRequestTypeLangfuse, + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + switch res.Data.Type { + case components.ObservabilityDestinationTypeArize: + // res.Data.ObservabilityArizeDestination is populated + case components.ObservabilityDestinationTypeBraintrust: + // res.Data.ObservabilityBraintrustDestination is populated + case components.ObservabilityDestinationTypeClickhouse: + // res.Data.ObservabilityClickhouseDestination is populated + case components.ObservabilityDestinationTypeDatadog: + // res.Data.ObservabilityDatadogDestination is populated + case components.ObservabilityDestinationTypeGrafana: + // res.Data.ObservabilityGrafanaDestination is populated + case components.ObservabilityDestinationTypeLangfuse: + // res.Data.ObservabilityLangfuseDestination is populated + case components.ObservabilityDestinationTypeLangsmith: + // res.Data.ObservabilityLangsmithDestination is populated + case components.ObservabilityDestinationTypeNewrelic: + // res.Data.ObservabilityNewrelicDestination is populated + case components.ObservabilityDestinationTypeOpik: + // res.Data.ObservabilityOpikDestination is populated + case components.ObservabilityDestinationTypeOtelCollector: + // res.Data.ObservabilityOtelCollectorDestination is populated + case components.ObservabilityDestinationTypePosthog: + // res.Data.ObservabilityPosthogDestination is populated + case components.ObservabilityDestinationTypeRamp: + // res.Data.ObservabilityRampDestination is populated + case components.ObservabilityDestinationTypeS3: + // res.Data.ObservabilityS3Destination is populated + case components.ObservabilityDestinationTypeSentry: + // res.Data.ObservabilitySentryDestination is populated + case components.ObservabilityDestinationTypeSnowflake: + // res.Data.ObservabilitySnowflakeDestination is populated + case components.ObservabilityDestinationTypeWeave: + // res.Data.ObservabilityWeaveDestination is populated + case components.ObservabilityDestinationTypeWebhook: + // res.Data.ObservabilityWebhookDestination is populated + default: + // Unknown type - use res.Data.GetUnknownRaw() for raw JSON + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [components.CreateObservabilityDestinationRequest](../../models/components/createobservabilitydestinationrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*components.CreateObservabilityDestinationResponse](../../models/components/createobservabilitydestinationresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.ForbiddenResponseError | 403 | application/json | +| sdkerrors.ConflictResponseError | 409 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## Delete + +Delete an existing observability destination. This performs a soft delete. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Observability.Delete(ctx, "99999999-aaaa-bbbb-cccc-dddddddddddd") + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `id` | `string` | :heavy_check_mark: | The destination ID (UUID). | 99999999-aaaa-bbbb-cccc-dddddddddddd | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*components.DeleteObservabilityDestinationResponse](../../models/components/deleteobservabilitydestinationresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.NotFoundResponseError | 404 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## Get + +Fetch a single observability destination by its UUID. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "log" + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Observability.Get(ctx, "99999999-aaaa-bbbb-cccc-dddddddddddd") + if err != nil { + log.Fatal(err) + } + if res != nil { + switch res.Data.Type { + case components.ObservabilityDestinationTypeArize: + // res.Data.ObservabilityArizeDestination is populated + case components.ObservabilityDestinationTypeBraintrust: + // res.Data.ObservabilityBraintrustDestination is populated + case components.ObservabilityDestinationTypeClickhouse: + // res.Data.ObservabilityClickhouseDestination is populated + case components.ObservabilityDestinationTypeDatadog: + // res.Data.ObservabilityDatadogDestination is populated + case components.ObservabilityDestinationTypeGrafana: + // res.Data.ObservabilityGrafanaDestination is populated + case components.ObservabilityDestinationTypeLangfuse: + // res.Data.ObservabilityLangfuseDestination is populated + case components.ObservabilityDestinationTypeLangsmith: + // res.Data.ObservabilityLangsmithDestination is populated + case components.ObservabilityDestinationTypeNewrelic: + // res.Data.ObservabilityNewrelicDestination is populated + case components.ObservabilityDestinationTypeOpik: + // res.Data.ObservabilityOpikDestination is populated + case components.ObservabilityDestinationTypeOtelCollector: + // res.Data.ObservabilityOtelCollectorDestination is populated + case components.ObservabilityDestinationTypePosthog: + // res.Data.ObservabilityPosthogDestination is populated + case components.ObservabilityDestinationTypeRamp: + // res.Data.ObservabilityRampDestination is populated + case components.ObservabilityDestinationTypeS3: + // res.Data.ObservabilityS3Destination is populated + case components.ObservabilityDestinationTypeSentry: + // res.Data.ObservabilitySentryDestination is populated + case components.ObservabilityDestinationTypeSnowflake: + // res.Data.ObservabilitySnowflakeDestination is populated + case components.ObservabilityDestinationTypeWeave: + // res.Data.ObservabilityWeaveDestination is populated + case components.ObservabilityDestinationTypeWebhook: + // res.Data.ObservabilityWebhookDestination is populated + default: + // Unknown type - use res.Data.GetUnknownRaw() for raw JSON + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `id` | `string` | :heavy_check_mark: | The destination ID (UUID). | 99999999-aaaa-bbbb-cccc-dddddddddddd | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*components.GetObservabilityDestinationResponse](../../models/components/getobservabilitydestinationresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.NotFoundResponseError | 404 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## Update + +Update an existing observability destination. Only the fields provided in the request body are updated. [Management key](/docs/guides/overview/auth/management-api-keys) required. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "github.com/OpenRouterTeam/go-sdk/models/components" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Observability.Update(ctx, "99999999-aaaa-bbbb-cccc-dddddddddddd", components.UpdateObservabilityDestinationRequest{ + Enabled: openrouter.Pointer(false), + Name: openrouter.Pointer("Updated Langfuse"), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + switch res.Data.Type { + case components.ObservabilityDestinationTypeArize: + // res.Data.ObservabilityArizeDestination is populated + case components.ObservabilityDestinationTypeBraintrust: + // res.Data.ObservabilityBraintrustDestination is populated + case components.ObservabilityDestinationTypeClickhouse: + // res.Data.ObservabilityClickhouseDestination is populated + case components.ObservabilityDestinationTypeDatadog: + // res.Data.ObservabilityDatadogDestination is populated + case components.ObservabilityDestinationTypeGrafana: + // res.Data.ObservabilityGrafanaDestination is populated + case components.ObservabilityDestinationTypeLangfuse: + // res.Data.ObservabilityLangfuseDestination is populated + case components.ObservabilityDestinationTypeLangsmith: + // res.Data.ObservabilityLangsmithDestination is populated + case components.ObservabilityDestinationTypeNewrelic: + // res.Data.ObservabilityNewrelicDestination is populated + case components.ObservabilityDestinationTypeOpik: + // res.Data.ObservabilityOpikDestination is populated + case components.ObservabilityDestinationTypeOtelCollector: + // res.Data.ObservabilityOtelCollectorDestination is populated + case components.ObservabilityDestinationTypePosthog: + // res.Data.ObservabilityPosthogDestination is populated + case components.ObservabilityDestinationTypeRamp: + // res.Data.ObservabilityRampDestination is populated + case components.ObservabilityDestinationTypeS3: + // res.Data.ObservabilityS3Destination is populated + case components.ObservabilityDestinationTypeSentry: + // res.Data.ObservabilitySentryDestination is populated + case components.ObservabilityDestinationTypeSnowflake: + // res.Data.ObservabilitySnowflakeDestination is populated + case components.ObservabilityDestinationTypeWeave: + // res.Data.ObservabilityWeaveDestination is populated + case components.ObservabilityDestinationTypeWebhook: + // res.Data.ObservabilityWebhookDestination is populated + default: + // Unknown type - use res.Data.GetUnknownRaw() for raw JSON + } + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `id` | `string` | :heavy_check_mark: | The destination ID (UUID). | 99999999-aaaa-bbbb-cccc-dddddddddddd | +| `updateObservabilityDestinationRequest` | [components.UpdateObservabilityDestinationRequest](../../models/components/updateobservabilitydestinationrequest.md) | :heavy_check_mark: | N/A | {
"enabled": false,
"name": "Updated Langfuse"
} | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*components.UpdateObservabilityDestinationResponse](../../models/components/updateobservabilitydestinationresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.NotFoundResponseError | 404 | application/json | +| sdkerrors.ConflictResponseError | 409 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/presets/README.md b/docs/sdks/presets/README.md new file mode 100644 index 00000000..8eddf994 --- /dev/null +++ b/docs/sdks/presets/README.md @@ -0,0 +1,491 @@ +# Presets + +## Overview + +Presets endpoints + +### Available Operations + +* [List](#list) - List presets +* [Get](#get) - Get a preset +* [CreatePresetsChatCompletions](#createpresetschatcompletions) - Create a preset from a chat-completions request body +* [CreatePresetsMessages](#createpresetsmessages) - Create a preset from a messages request body +* [CreatePresetsResponses](#createpresetsresponses) - Create a preset from a responses request body +* [ListVersions](#listversions) - List versions of a preset +* [GetVersion](#getversion) - Get a specific version of a preset + +## List + +Lists all presets for the authenticated user, ordered by most recently updated first. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Presets.List(ctx, optionalnullable.From[int64](nil), nil) + if err != nil { + log.Fatal(err) + } + if res != nil { + for { + // handle items + + res, err = res.Next() + + if err != nil { + // handle error + } + + if res == nil { + break + } + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `offset` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `limit` | `*int64` | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*operations.ListPresetsResponse](../../models/operations/listpresetsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## Get + +Retrieves a preset by its slug with its currently designated version inline. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Presets.Get(ctx, "my-preset") + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `slug` | `string` | :heavy_check_mark: | URL-safe slug identifying the preset. | my-preset | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*components.GetPresetResponse](../../models/components/getpresetresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.NotFoundResponseError | 404 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## CreatePresetsChatCompletions + +Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. `messages`, `stream`, `prompt`) are silently ignored. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "github.com/OpenRouterTeam/go-sdk/models/components" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Presets.CreatePresetsChatCompletions(ctx, "my-preset", components.ChatRequest{ + Messages: []components.ChatMessages{ + components.CreateChatMessagesSystem( + components.ChatSystemMessage{ + Content: components.CreateChatSystemMessageContentStr( + "You are a helpful assistant.", + ), + Role: components.ChatSystemMessageRoleSystem, + }, + ), + components.CreateChatMessagesUser( + components.ChatUserMessage{ + Content: components.CreateChatUserMessageContentStr( + "Hello!", + ), + Role: components.ChatUserMessageRoleUser, + }, + ), + }, + Model: openrouter.Pointer("openai/gpt-5.4"), + Temperature: optionalnullable.From(openrouter.Pointer[float64](0.7)), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `slug` | `string` | :heavy_check_mark: | URL-safe slug identifying the preset. Created if it does not exist. | my-preset | +| `chatRequest` | [components.ChatRequest](../../models/components/chatrequest.md) | :heavy_check_mark: | N/A | {
"max_tokens": 150,
"messages": [
{
"content": "You are a helpful assistant.",
"role": "system"
},
{
"content": "What is the capital of France?",
"role": "user"
}
],
"model": "openai/gpt-4",
"temperature": 0.7
} | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*components.CreatePresetFromInferenceResponse](../../models/components/createpresetfrominferenceresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.ForbiddenResponseError | 403 | application/json | +| sdkerrors.NotFoundResponseError | 404 | application/json | +| sdkerrors.ConflictResponseError | 409 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## CreatePresetsMessages + +Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. `messages`, `stream`, `prompt`) are silently ignored. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "github.com/OpenRouterTeam/go-sdk/models/components" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Presets.CreatePresetsMessages(ctx, "my-preset", components.MessagesRequest{ + MaxTokens: openrouter.Pointer[int64](1024), + Messages: []components.MessagesMessageParam{ + components.MessagesMessageParam{ + Content: components.CreateMessagesMessageParamContentUnion5Str( + "Hello!", + ), + Role: components.MessagesMessageParamRoleUser, + }, + }, + Model: "anthropic/claude-4.6-sonnet", + System: openrouter.Pointer(components.CreateSystemStr( + "You are a helpful assistant.", + )), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `slug` | `string` | :heavy_check_mark: | URL-safe slug identifying the preset. Created if it does not exist. | my-preset | +| `messagesRequest` | [components.MessagesRequest](../../models/components/messagesrequest.md) | :heavy_check_mark: | N/A | {
"max_tokens": 1024,
"messages": [
{
"content": "Hello, how are you?",
"role": "user"
}
],
"model": "anthropic/claude-4.5-sonnet-20250929",
"temperature": 0.7
} | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*components.CreatePresetFromInferenceResponse](../../models/components/createpresetfrominferenceresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.ForbiddenResponseError | 403 | application/json | +| sdkerrors.NotFoundResponseError | 404 | application/json | +| sdkerrors.ConflictResponseError | 409 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## CreatePresetsResponses + +Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. `messages`, `stream`, `prompt`) are silently ignored. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "github.com/OpenRouterTeam/go-sdk/models/components" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Presets.CreatePresetsResponses(ctx, "my-preset", components.ResponsesRequest{ + Input: openrouter.Pointer(components.CreateInputsUnionStr( + "Hello!", + )), + Instructions: optionalnullable.From(openrouter.Pointer("You are a helpful assistant.")), + Model: openrouter.Pointer("openai/gpt-5.4"), + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `slug` | `string` | :heavy_check_mark: | URL-safe slug identifying the preset. Created if it does not exist. | my-preset | +| `responsesRequest` | [components.ResponsesRequest](../../models/components/responsesrequest.md) | :heavy_check_mark: | N/A | {
"input": [
{
"content": "Hello, how are you?",
"role": "user",
"type": "message"
}
],
"model": "anthropic/claude-4.5-sonnet-20250929",
"temperature": 0.7,
"tools": [
{
"description": "Get the current weather in a given location",
"name": "get_current_weather",
"parameters": {
"properties": {
"location": {
"type": "string"
}
},
"type": "object"
},
"type": "function"
}
],
"top_p": 0.9
} | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*components.CreatePresetFromInferenceResponse](../../models/components/createpresetfrominferenceresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.ForbiddenResponseError | 403 | application/json | +| sdkerrors.NotFoundResponseError | 404 | application/json | +| sdkerrors.ConflictResponseError | 409 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## ListVersions + +Lists all versions of a preset, ordered by version number ascending (oldest first). + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Presets.ListVersions(ctx, "my-preset", optionalnullable.From[int64](nil), nil) + if err != nil { + log.Fatal(err) + } + if res != nil { + for { + // handle items + + res, err = res.Next() + + if err != nil { + // handle error + } + + if res == nil { + break + } + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `slug` | `string` | :heavy_check_mark: | URL-safe slug identifying the preset. | my-preset | +| `offset` | optionalnullable.OptionalNullable[`int64`] | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `limit` | `*int64` | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*operations.ListPresetVersionsResponse](../../models/operations/listpresetversionsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.NotFoundResponseError | 404 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | + +## GetVersion + +Retrieves a specific version of a preset by its slug and version number. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Presets.GetVersion(ctx, "my-preset", "1") + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `slug` | `string` | :heavy_check_mark: | URL-safe slug identifying the preset. | my-preset | +| `version` | `string` | :heavy_check_mark: | Version number of the preset. | 1 | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | + +### Response + +**[*components.GetPresetVersionResponse](../../models/components/getpresetversionresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.NotFoundResponseError | 404 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/rerank/README.md b/docs/sdks/rerank/README.md index d8ce32de..94daa832 100644 --- a/docs/sdks/rerank/README.md +++ b/docs/sdks/rerank/README.md @@ -34,9 +34,13 @@ func main() { ) res, err := s.Rerank.Rerank(ctx, operations.CreateRerankRequest{ - Documents: []string{ - "Paris is the capital of France.", - "Berlin is the capital of Germany.", + Documents: []operations.Document{ + operations.CreateDocumentStr( + "Paris is the capital of France.", + ), + operations.CreateDocumentStr( + "Berlin is the capital of Germany.", + ), }, Model: "cohere/rerank-v3.5", Query: "What is the capital of France?", diff --git a/docs/sdks/responses/README.md b/docs/sdks/responses/README.md index 9724e617..e6e0ccc9 100644 --- a/docs/sdks/responses/README.md +++ b/docs/sdks/responses/README.md @@ -12,9 +12,9 @@ beta.responses endpoints Creates a streaming or non-streaming response using OpenResponses API format -### Example Usage +### Example Usage: guardrail-blocked - + ```go package main @@ -33,20 +33,51 @@ func main() { openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), ) - res, err := s.Beta.Responses.Send(ctx, components.ResponsesRequest{ - Input: openrouter.Pointer(components.CreateInputsUnionStr( - "Tell me a joke", - )), - Model: openrouter.Pointer("openai/gpt-4o"), - }) + res, err := s.Beta.Responses.Send(ctx, components.ResponsesRequest{}, nil) if err != nil { log.Fatal(err) } if res != nil { - defer res.Object.Close() + defer res.ResponsesStreamingResponse.Close() - for res.Object.Next() { - event := res.Object.Value() + for res.ResponsesStreamingResponse.Next() { + event := res.ResponsesStreamingResponse.Value() + log.Print(event) + // Handle the event + } + } +} +``` +### Example Usage: insufficient-permissions + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "github.com/OpenRouterTeam/go-sdk/models/components" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Beta.Responses.Send(ctx, components.ResponsesRequest{}, nil) + if err != nil { + log.Fatal(err) + } + if res != nil { + defer res.ResponsesStreamingResponse.Close() + + for res.ResponsesStreamingResponse.Next() { + event := res.ResponsesStreamingResponse.Value() log.Print(event) // Handle the event } @@ -56,11 +87,12 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `request` | [components.ResponsesRequest](../../models/components/responsesrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `responsesRequest` | [components.ResponsesRequest](../../models/components/responsesrequest.md) | :heavy_check_mark: | N/A | {
"input": [
{
"content": "Hello, how are you?",
"role": "user",
"type": "message"
}
],
"model": "anthropic/claude-4.5-sonnet-20250929",
"temperature": 0.7,
"tools": [
{
"description": "Get the current weather in a given location",
"name": "get_current_weather",
"parameters": {
"properties": {
"location": {
"type": "string"
}
},
"type": "object"
},
"type": "function"
}
],
"top_p": 0.9
} | +| `xOpenRouterMetadata` | [*components.MetadataLevel](../../models/components/metadatalevel.md) | :heavy_minus_sign: | Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. | enabled | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | ### Response @@ -73,6 +105,7 @@ func main() { | sdkerrors.BadRequestResponseError | 400 | application/json | | sdkerrors.UnauthorizedResponseError | 401 | application/json | | sdkerrors.PaymentRequiredResponseError | 402 | application/json | +| sdkerrors.ForbiddenResponseError | 403 | application/json | | sdkerrors.NotFoundResponseError | 404 | application/json | | sdkerrors.RequestTimeoutResponseError | 408 | application/json | | sdkerrors.PayloadTooLargeResponseError | 413 | application/json | diff --git a/docs/sdks/stt/README.md b/docs/sdks/stt/README.md new file mode 100644 index 00000000..ff2f106b --- /dev/null +++ b/docs/sdks/stt/README.md @@ -0,0 +1,79 @@ +# Stt + +## Overview + +Speech-to-text endpoints + +### Available Operations + +* [CreateTranscription](#createtranscription) - Create transcription + +## CreateTranscription + +Transcribes audio into text. Accepts base64-encoded audio input and returns the transcribed text. + +### Example Usage + + +```go +package main + +import( + "context" + "os" + openrouter "github.com/OpenRouterTeam/go-sdk" + "github.com/OpenRouterTeam/go-sdk/models/components" + "log" +) + +func main() { + ctx := context.Background() + + s := openrouter.New( + openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")), + ) + + res, err := s.Stt.CreateTranscription(ctx, components.STTRequest{ + InputAudio: components.STTInputAudio{ + Data: "UklGRiQA...", + Format: "wav", + }, + Language: openrouter.Pointer("en"), + Model: "openai/whisper-large-v3", + }) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [components.STTRequest](../../models/components/sttrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*components.STTResponse](../../models/components/sttresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| sdkerrors.BadRequestResponseError | 400 | application/json | +| sdkerrors.UnauthorizedResponseError | 401 | application/json | +| sdkerrors.PaymentRequiredResponseError | 402 | application/json | +| sdkerrors.NotFoundResponseError | 404 | application/json | +| sdkerrors.TooManyRequestsResponseError | 429 | application/json | +| sdkerrors.InternalServerResponseError | 500 | application/json | +| sdkerrors.BadGatewayResponseError | 502 | application/json | +| sdkerrors.ServiceUnavailableResponseError | 503 | application/json | +| sdkerrors.EdgeNetworkTimeoutResponseError | 524 | application/json | +| sdkerrors.ProviderOverloadedResponseError | 529 | application/json | +| sdkerrors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/tts/README.md b/docs/sdks/tts/README.md index ee25e635..57635c65 100644 --- a/docs/sdks/tts/README.md +++ b/docs/sdks/tts/README.md @@ -10,7 +10,7 @@ Text-to-speech endpoints ## CreateSpeech -Synthesizes audio from the input text +Synthesizes audio from the input text. Returns a raw audio bytestream in the requested format (e.g. mp3, pcm, wav). ### Example Usage diff --git a/embeddings.go b/embeddings.go index b5e36e8d..7133eb10 100644 --- a/embeddings.go +++ b/embeddings.go @@ -189,7 +189,7 @@ func (s *Embeddings) Generate(ctx context.Context, request operations.CreateEmbe _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "402", "404", "429", "4XX", "500", "502", "503", "524", "529", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -613,7 +613,7 @@ func (s *Embeddings) ListModels(ctx context.Context, opts ...operations.Option) _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/endpoints.go b/endpoints.go index ba124e6e..2ce8a37c 100644 --- a/endpoints.go +++ b/endpoints.go @@ -174,7 +174,7 @@ func (s *Endpoints) ListZdrEndpoints(ctx context.Context, opts ...operations.Opt _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -404,7 +404,7 @@ func (s *Endpoints) List(ctx context.Context, author string, slug string, opts . _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"404", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/files.go b/files.go new file mode 100644 index 00000000..8524208f --- /dev/null +++ b/files.go @@ -0,0 +1,1649 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package openrouter + +import ( + "bytes" + "context" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/config" + "github.com/OpenRouterTeam/go-sdk/internal/hooks" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/models/components" + "github.com/OpenRouterTeam/go-sdk/models/operations" + "github.com/OpenRouterTeam/go-sdk/models/sdkerrors" + "github.com/OpenRouterTeam/go-sdk/retry" + "github.com/spyzhov/ajson" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Files endpoints +type Files struct { + rootSDK *OpenRouter + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newFiles(rootSDK *OpenRouter, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Files { + return &Files{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// List files +// Lists files belonging to the workspace of the authenticating API key. +func (s *Files) List(ctx context.Context, limit *int64, cursor *string, workspaceID *string, opts ...operations.Option) (*operations.ListFilesResponse, error) { + request := operations.ListFilesRequest{ + Limit: limit, + Cursor: cursor, + WorkspaceID: workspaceID, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/files") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "listFiles", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListFilesResponse{} + res.Next = func() (*operations.ListFilesResponse, error) { + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + b, err := ajson.Unmarshal(rawBody) + if err != nil { + return nil, err + } + nC, err := ajson.Eval(b, "$.cursor") + if err != nil { + return nil, err + } + var nCVal string + + if nC.IsNumeric() { + numVal, err := nC.GetNumeric() + if err != nil { + return nil, err + } + // GetNumeric returns as float64 so convert to the appropriate type. + nCVal = strconv.FormatFloat(numVal, 'f', 0, 64) + } else { + val, err := nC.Value() + if err != nil { + return nil, err + } + if val == nil { + return nil, nil + } + nCVal = val.(string) + if strings.TrimSpace(nCVal) == "" { + return nil, nil + } + } + r, err := ajson.Eval(b, "$.data") + if err != nil { + return nil, err + } + if !r.IsArray() { + return nil, nil + } + arr, err := r.GetArray() + if err != nil { + return nil, err + } + if len(arr) == 0 { + return nil, nil + } + + return s.List( + ctx, + limit, + &nCVal, + workspaceID, + opts..., + ) + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.FileListResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Result = out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.BadRequestResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.TooManyRequestsResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Upload a file +// Uploads a file to be referenced in future API calls. The file is stored under the workspace of the authenticating API key. Maximum file size: 100 MB. +func (s *Files) Upload(ctx context.Context, requestBody operations.UploadFileRequestBody, workspaceID *string, opts ...operations.Option) (*components.FileMetadata, error) { + request := operations.UploadFileRequest{ + RequestBody: requestBody, + WorkspaceID: workspaceID, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/files") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "uploadFile", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "RequestBody", "multipart", `request:"mediaType=multipart/form-data"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.FileMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.BadRequestResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 403: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.ForbiddenResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 413: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.PayloadTooLargeResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.TooManyRequestsResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} + +// Delete a file +// Deletes a file owned by the requesting workspace. Deletion is irreversible. +func (s *Files) Delete(ctx context.Context, fileID string, workspaceID *string, opts ...operations.Option) (*components.FileDeleteResponse, error) { + request := operations.DeleteFileRequest{ + FileID: fileID, + WorkspaceID: workspaceID, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/files/{file_id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteFile", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.FileDeleteResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.NotFoundResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.TooManyRequestsResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} + +// Retrieve - Get file metadata +// Retrieves metadata for a single file owned by the requesting workspace. +func (s *Files) Retrieve(ctx context.Context, fileID string, workspaceID *string, opts ...operations.Option) (*components.FileMetadata, error) { + request := operations.GetFileMetadataRequest{ + FileID: fileID, + WorkspaceID: workspaceID, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/files/{file_id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getFileMetadata", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.FileMetadata + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.NotFoundResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.TooManyRequestsResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} + +// Download file content +// Downloads the raw bytes of a file. Only files created server-side are downloadable; uploaded files return 400. +func (s *Files) Download(ctx context.Context, fileID string, workspaceID *string, opts ...operations.Option) (io.ReadCloser, error) { + request := operations.DownloadFileContentRequest{ + FileID: fileID, + WorkspaceID: workspaceID, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/files/{file_id}/content", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "downloadFileContent", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/octet-stream") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/octet-stream`): + return httpRes.Body, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.BadRequestResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.NotFoundResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.TooManyRequestsResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} diff --git a/generations.go b/generations.go index 0fbcab30..fb4140bf 100644 --- a/generations.go +++ b/generations.go @@ -183,7 +183,7 @@ func (s *Generations) GetGeneration(ctx context.Context, id string, opts ...oper _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"401", "402", "404", "429", "4XX", "500", "502", "524", "529", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -563,7 +563,7 @@ func (s *Generations) ListGenerationContent(ctx context.Context, id string, opts _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"401", "403", "404", "429", "4XX", "500", "502", "524", "529", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/go.mod b/go.mod index 798cc5dd..ddbd7334 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/OpenRouterTeam/go-sdk -go 1.22 +go 1.25.10 require ( github.com/spyzhov/ajson v0.8.0 diff --git a/guardrails.go b/guardrails.go index d61dc1fa..dee01315 100644 --- a/guardrails.go +++ b/guardrails.go @@ -188,7 +188,7 @@ func (s *Guardrails) List(ctx context.Context, offset optionalnullable.OptionalN _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"401", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -491,7 +491,7 @@ func (s *Guardrails) Create(ctx context.Context, request components.CreateGuardr _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -784,7 +784,7 @@ func (s *Guardrails) Delete(ctx context.Context, id string, opts ...operations.O _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1056,7 +1056,7 @@ func (s *Guardrails) Get(ctx context.Context, id string, opts ...operations.Opti _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1336,7 +1336,7 @@ func (s *Guardrails) Update(ctx context.Context, id string, updateGuardrailReque _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1635,7 +1635,7 @@ func (s *Guardrails) ListGuardrailKeyAssignments(ctx context.Context, id string, _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1964,7 +1964,7 @@ func (s *Guardrails) BulkAssignKeys(ctx context.Context, id string, bulkAssignKe _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -2265,7 +2265,7 @@ func (s *Guardrails) BulkUnassignKeys(ctx context.Context, id string, bulkUnassi _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -2564,7 +2564,7 @@ func (s *Guardrails) ListGuardrailMemberAssignments(ctx context.Context, id stri _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -2893,7 +2893,7 @@ func (s *Guardrails) BulkAssignMembers(ctx context.Context, id string, bulkAssig _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -3194,7 +3194,7 @@ func (s *Guardrails) BulkUnassignMembers(ctx context.Context, id string, bulkUna _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -3492,7 +3492,7 @@ func (s *Guardrails) ListKeyAssignments(ctx context.Context, offset optionalnull _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"401", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -3796,7 +3796,7 @@ func (s *Guardrails) ListMemberAssignments(ctx context.Context, offset optionaln _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"401", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/internal/utils/json.go b/internal/utils/json.go index 9d1e56ec..a5a64183 100644 --- a/internal/utils/json.go +++ b/internal/utils/json.go @@ -512,6 +512,13 @@ func unmarshalValue(value json.RawMessage, v reflect.Value, tag reflect.StructTa return nil } case reflect.Map: + if implementsJSONUnmarshaler(v.Type()) { + if v.CanAddr() { + return json.Unmarshal(value, v.Addr().Interface()) + } + return json.Unmarshal(value, v.Interface()) + } + if bytes.Equal(value, []byte("null")) || !isComplexValueType(dereferenceTypePointer(typ.Elem())) { if v.CanAddr() { return json.Unmarshal(value, v.Addr().Interface()) diff --git a/internal/utils/union.go b/internal/utils/union.go index bc6a1ee1..12348ff4 100644 --- a/internal/utils/union.go +++ b/internal/utils/union.go @@ -128,8 +128,8 @@ func countFieldsRecursive(candidate *UnionCandidate, typ reflect.Type, val refle // Handle unions if isUnion, activeVariant, variantVal := findActiveUnionVariant(typ, val); isUnion { - if activeVariant != nil && !variantVal.IsNil() { - countFieldsRecursive(candidate, activeVariant.Type.Elem(), variantVal.Elem(), raw) + if activeVariant != nil { + countFieldsRecursive(candidate, activeVariant.Type, variantVal, raw) } return } @@ -253,7 +253,6 @@ func findActiveUnionVariant(typ reflect.Type, val reflect.Value) (bool, *reflect isUnion = true - // All union variants are pointers - only set active if non-nil fieldVal := val.Field(i) if !fieldVal.IsNil() { activeVariant = &field diff --git a/internal/utils/union_test.go b/internal/utils/union_test.go index f66814c7..138f7e2a 100644 --- a/internal/utils/union_test.go +++ b/internal/utils/union_test.go @@ -585,3 +585,73 @@ func TestPickBestUnionCandidate_AnyFieldType(t *testing.T) { require.NotNil(t, result) assert.IsType(t, B{}, result.Type) } + +func TestPickBestUnionCandidate_NonPointerUnionVariants(t *testing.T) { + type Inner struct { + Foo string `json:"foo"` + } + type SliceUnion struct { + AsObject *Inner `union:"member"` + AsList []string `union:"member"` + } + type MapUnion struct { + AsObject *Inner `union:"member"` + AsMap map[string]string `union:"member"` + } + type AnyUnion struct { + AsObject *Inner `union:"member"` + AsAny any `union:"member"` + } + + cases := []struct { + name string + payload string + candidates []UnionCandidate + wantType string + }{ + { + name: "slice variant wins for array payload", + payload: `["a", "b"]`, + candidates: []UnionCandidate{ + {Type: "object", Value: SliceUnion{AsObject: &Inner{}}}, + {Type: "list", Value: SliceUnion{AsList: []string{"a", "b"}}}, + }, + wantType: "list", + }, + { + name: "map variant wins for object payload with no matching struct fields", + payload: `{"k1": "v1", "k2": "v2"}`, + candidates: []UnionCandidate{ + {Type: "object", Value: MapUnion{AsObject: &Inner{}}}, + {Type: "map", Value: MapUnion{AsMap: map[string]string{"k1": "v1", "k2": "v2"}}}, + }, + wantType: "map", + }, + { + name: "any variant wins as catch-all when struct can't fit a scalar", + payload: `"scalar"`, + candidates: []UnionCandidate{ + {Type: "object", Value: AnyUnion{AsObject: &Inner{}}}, + {Type: "any", Value: AnyUnion{AsAny: "scalar"}}, + }, + wantType: "any", + }, + { + name: "structured variant beats any on a matching object payload", + payload: `{"foo": "x"}`, + candidates: []UnionCandidate{ + {Type: "object", Value: AnyUnion{AsObject: &Inner{Foo: "x"}}}, + {Type: "any", Value: AnyUnion{AsAny: map[string]any{"foo": "x"}}}, + }, + wantType: "object", + }, + } + + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + result := PickBestUnionCandidate(tc.candidates, []byte(tc.payload)) + require.NotNil(t, result) + assert.Equal(t, tc.wantType, result.Type) + }) + } +} diff --git a/models.go b/models.go index 3f933b77..507277c0 100644 --- a/models.go +++ b/models.go @@ -32,14 +32,260 @@ func newModels(rootSDK *OpenRouter, sdkConfig config.SDKConfiguration, hooks *ho } } -// List all models and their properties -func (s *Models) List(ctx context.Context, category *operations.Category, supportedParameters *string, outputModalities *string, opts ...operations.Option) (*components.ModelsListResponse, error) { - request := operations.GetModelsRequest{ - Category: category, - SupportedParameters: supportedParameters, - OutputModalities: outputModalities, +// Get a model by its slug +// Returns full details for a single model identified by its author and slug (e.g. openai/gpt-4). Supports variant suffixes (e.g. openai/gpt-4:free) and resolves known slug aliases. +func (s *Models) Get(ctx context.Context, author string, slug string, opts ...operations.Option) (*components.ModelResponse, error) { + request := operations.GetModelRequest{ + Author: author, + Slug: slug, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/model/{author}/{slug}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getModel", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } } + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.ModelResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.NotFoundResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} + +// List all models and their properties +func (s *Models) List(ctx context.Context, request *operations.GetModelsRequest, opts ...operations.Option) (*components.ModelsListResponse, error) { o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -185,7 +431,7 @@ func (s *Models) List(ctx context.Context, category *operations.Category, suppor _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -439,7 +685,7 @@ func (s *Models) Count(ctx context.Context, outputModalities *string, opts ...op _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -686,7 +932,7 @@ func (s *Models) ListForUser(ctx context.Context, security operations.ListModels _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/models/components/aabenchmarkentry.go b/models/components/aabenchmarkentry.go new file mode 100644 index 00000000..16b9a9ef --- /dev/null +++ b/models/components/aabenchmarkentry.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// AABenchmarkEntry - Artificial Analysis benchmark index scores. +type AABenchmarkEntry struct { + // Artificial Analysis Agentic Index score + AgenticIndex *float64 `json:"agentic_index"` + // Artificial Analysis Coding Index score + CodingIndex *float64 `json:"coding_index"` + // Artificial Analysis Intelligence Index score + IntelligenceIndex *float64 `json:"intelligence_index"` +} + +func (a *AABenchmarkEntry) GetAgenticIndex() *float64 { + if a == nil { + return nil + } + return a.AgenticIndex +} + +func (a *AABenchmarkEntry) GetCodingIndex() *float64 { + if a == nil { + return nil + } + return a.CodingIndex +} + +func (a *AABenchmarkEntry) GetIntelligenceIndex() *float64 { + if a == nil { + return nil + } + return a.IntelligenceIndex +} diff --git a/models/components/advisornestedtool.go b/models/components/advisornestedtool.go new file mode 100644 index 00000000..1b3f6189 --- /dev/null +++ b/models/components/advisornestedtool.go @@ -0,0 +1,46 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// AdvisorNestedTool - A tool made available to the advisor sub-agent. Only OpenRouter server tools (e.g. openrouter:web_search) are supported; function tools are rejected because the advisor has no way to execute them. The advisor tool may not list itself. +type AdvisorNestedTool struct { + Parameters map[string]any `json:"parameters,omitzero"` + Type string `json:"type"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (a AdvisorNestedTool) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AdvisorNestedTool) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AdvisorNestedTool) GetParameters() map[string]any { + if a == nil { + return nil + } + return a.Parameters +} + +func (a *AdvisorNestedTool) GetType() string { + if a == nil { + return "" + } + return a.Type +} + +func (a *AdvisorNestedTool) GetAdditionalProperties() map[string]any { + if a == nil { + return nil + } + return a.AdditionalProperties +} diff --git a/models/components/advisorreasoning.go b/models/components/advisorreasoning.go new file mode 100644 index 00000000..9cd505e6 --- /dev/null +++ b/models/components/advisorreasoning.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// AdvisorReasoningEffort - Reasoning effort level for the advisor call. +type AdvisorReasoningEffort string + +const ( + AdvisorReasoningEffortXhigh AdvisorReasoningEffort = "xhigh" + AdvisorReasoningEffortHigh AdvisorReasoningEffort = "high" + AdvisorReasoningEffortMedium AdvisorReasoningEffort = "medium" + AdvisorReasoningEffortLow AdvisorReasoningEffort = "low" + AdvisorReasoningEffortMinimal AdvisorReasoningEffort = "minimal" + AdvisorReasoningEffortNone AdvisorReasoningEffort = "none" +) + +func (e AdvisorReasoningEffort) ToPointer() *AdvisorReasoningEffort { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *AdvisorReasoningEffort) IsExact() bool { + if e != nil { + switch *e { + case "xhigh", "high", "medium", "low", "minimal", "none": + return true + } + } + return false +} + +// AdvisorReasoning - Reasoning configuration forwarded to the advisor call. Use this to control reasoning effort and token budget for models that support extended thinking. +type AdvisorReasoning struct { + // Reasoning effort level for the advisor call. + Effort *AdvisorReasoningEffort `json:"effort,omitzero"` + // Maximum number of reasoning tokens the advisor may use. + MaxTokens *int64 `json:"max_tokens,omitzero"` +} + +func (a AdvisorReasoning) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AdvisorReasoning) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AdvisorReasoning) GetEffort() *AdvisorReasoningEffort { + if a == nil { + return nil + } + return a.Effort +} + +func (a *AdvisorReasoning) GetMaxTokens() *int64 { + if a == nil { + return nil + } + return a.MaxTokens +} diff --git a/models/components/advisorservertoolconfig.go b/models/components/advisorservertoolconfig.go new file mode 100644 index 00000000..2990e719 --- /dev/null +++ b/models/components/advisorservertoolconfig.go @@ -0,0 +1,112 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// AdvisorServerToolConfig - Configuration for one openrouter:advisor server tool entry. +type AdvisorServerToolConfig struct { + // When true, the full parent conversation is forwarded to the advisor so it sees the same context the executor does (and the tool-call `prompt`, if given, is appended as a final user turn). When false or omitted, the advisor receives only the `prompt` the executor passes in the tool call. + ForwardTranscript *bool `json:"forward_transcript,omitzero"` + // System instructions for the advisor sub-agent. When omitted, the advisor responds with no system prompt of its own. + Instructions *string `json:"instructions,omitzero"` + // Maximum number of output tokens (including reasoning) the advisor may produce. When omitted, the provider's default applies. + MaxCompletionTokens *int64 `json:"max_completion_tokens,omitzero"` + // Maximum number of tool-calling steps the advisor sub-agent may take during its agentic loop. Capped at 25. Only relevant when the advisor is given tools. + MaxToolCalls *int64 `json:"max_tool_calls,omitzero"` + // Slug of the advisor model to consult (any OpenRouter model). When omitted, the executor can choose it via the tool call's `model` argument; if neither is set, the model from the outer API request is used. The advisor tool itself cannot be the advisor model. + Model *string `json:"model,omitzero"` + // Optional name for this advisor. The model sees one tool per named advisor (and one default for an unnamed entry). Names must be unique across advisor entries. Letters, digits, spaces, underscores, and dashes; trimmed; 1–64 chars. + Name *string `json:"name,omitzero"` + // Reasoning configuration forwarded to the advisor call. Use this to control reasoning effort and token budget for models that support extended thinking. + Reasoning *AdvisorReasoning `json:"reasoning,omitzero"` + // When true, the advisor's advice streams incrementally as it is produced. In the Responses API this emits `response.output_text.delta` events targeting the advisor output item; the final `advice` field is still set on the completed item. Has no effect on the Chat Completions API (where the advice arrives only as the final tool result). When false or omitted, the advice arrives only as the final result. + Stream *bool `json:"stream,omitzero"` + // Sampling temperature forwarded to the advisor call. When omitted, the provider's default applies. + Temperature *float64 `json:"temperature,omitzero"` + // Tools the advisor sub-agent may use while forming its advice. The advisor runs as an agentic sub-agent over these tools, then returns its text. Only OpenRouter server tools are supported — function tools are rejected — and the list must not include the advisor tool itself. + Tools []AdvisorNestedTool `json:"tools,omitzero"` +} + +func (a AdvisorServerToolConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AdvisorServerToolConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AdvisorServerToolConfig) GetForwardTranscript() *bool { + if a == nil { + return nil + } + return a.ForwardTranscript +} + +func (a *AdvisorServerToolConfig) GetInstructions() *string { + if a == nil { + return nil + } + return a.Instructions +} + +func (a *AdvisorServerToolConfig) GetMaxCompletionTokens() *int64 { + if a == nil { + return nil + } + return a.MaxCompletionTokens +} + +func (a *AdvisorServerToolConfig) GetMaxToolCalls() *int64 { + if a == nil { + return nil + } + return a.MaxToolCalls +} + +func (a *AdvisorServerToolConfig) GetModel() *string { + if a == nil { + return nil + } + return a.Model +} + +func (a *AdvisorServerToolConfig) GetName() *string { + if a == nil { + return nil + } + return a.Name +} + +func (a *AdvisorServerToolConfig) GetReasoning() *AdvisorReasoning { + if a == nil { + return nil + } + return a.Reasoning +} + +func (a *AdvisorServerToolConfig) GetStream() *bool { + if a == nil { + return nil + } + return a.Stream +} + +func (a *AdvisorServerToolConfig) GetTemperature() *float64 { + if a == nil { + return nil + } + return a.Temperature +} + +func (a *AdvisorServerToolConfig) GetTools() []AdvisorNestedTool { + if a == nil { + return nil + } + return a.Tools +} diff --git a/models/components/advisorservertoolopenrouter.go b/models/components/advisorservertoolopenrouter.go new file mode 100644 index 00000000..72c99e3a --- /dev/null +++ b/models/components/advisorservertoolopenrouter.go @@ -0,0 +1,64 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type AdvisorServerToolOpenRouterType string + +const ( + AdvisorServerToolOpenRouterTypeOpenrouterAdvisor AdvisorServerToolOpenRouterType = "openrouter:advisor" +) + +func (e AdvisorServerToolOpenRouterType) ToPointer() *AdvisorServerToolOpenRouterType { + return &e +} +func (e *AdvisorServerToolOpenRouterType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "openrouter:advisor": + *e = AdvisorServerToolOpenRouterType(v) + return nil + default: + return fmt.Errorf("invalid value for AdvisorServerToolOpenRouterType: %v", v) + } +} + +// AdvisorServerToolOpenRouter - OpenRouter built-in server tool: consults a higher-intelligence advisor model (any OpenRouter model) for guidance mid-generation and returns its response. The advisor may run as a sub-agent with its own tools. Include multiple entries to offer several named advisors; at most one entry may omit `name` to act as the default advisor. +type AdvisorServerToolOpenRouter struct { + // Configuration for one openrouter:advisor server tool entry. + Parameters *AdvisorServerToolConfig `json:"parameters,omitzero"` + Type AdvisorServerToolOpenRouterType `json:"type"` +} + +func (a AdvisorServerToolOpenRouter) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AdvisorServerToolOpenRouter) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AdvisorServerToolOpenRouter) GetParameters() *AdvisorServerToolConfig { + if a == nil { + return nil + } + return a.Parameters +} + +func (a *AdvisorServerToolOpenRouter) GetType() AdvisorServerToolOpenRouterType { + if a == nil { + return AdvisorServerToolOpenRouterType("") + } + return a.Type +} diff --git a/models/components/anthropicallowedcallers.go b/models/components/anthropicallowedcallers.go new file mode 100644 index 00000000..d46dcb4f --- /dev/null +++ b/models/components/anthropicallowedcallers.go @@ -0,0 +1,26 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type AnthropicAllowedCallers string + +const ( + AnthropicAllowedCallersDirect AnthropicAllowedCallers = "direct" + AnthropicAllowedCallersCodeExecution20250825 AnthropicAllowedCallers = "code_execution_20250825" + AnthropicAllowedCallersCodeExecution20260120 AnthropicAllowedCallers = "code_execution_20260120" +) + +func (e AnthropicAllowedCallers) ToPointer() *AnthropicAllowedCallers { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *AnthropicAllowedCallers) IsExact() bool { + if e != nil { + switch *e { + case "direct", "code_execution_20250825", "code_execution_20260120": + return true + } + } + return false +} diff --git a/models/components/anthropicbase64imagesource.go b/models/components/anthropicbase64imagesource.go new file mode 100644 index 00000000..c8dd68a4 --- /dev/null +++ b/models/components/anthropicbase64imagesource.go @@ -0,0 +1,73 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type AnthropicBase64ImageSourceType string + +const ( + AnthropicBase64ImageSourceTypeBase64 AnthropicBase64ImageSourceType = "base64" +) + +func (e AnthropicBase64ImageSourceType) ToPointer() *AnthropicBase64ImageSourceType { + return &e +} +func (e *AnthropicBase64ImageSourceType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "base64": + *e = AnthropicBase64ImageSourceType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicBase64ImageSourceType: %v", v) + } +} + +type AnthropicBase64ImageSource struct { + Data string `json:"data"` + MediaType AnthropicImageMimeType `json:"media_type"` + Type AnthropicBase64ImageSourceType `json:"type"` +} + +func (a AnthropicBase64ImageSource) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicBase64ImageSource) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicBase64ImageSource) GetData() string { + if a == nil { + return "" + } + return a.Data +} + +func (a *AnthropicBase64ImageSource) GetMediaType() AnthropicImageMimeType { + if a == nil { + return AnthropicImageMimeType("") + } + return a.MediaType +} + +func (a *AnthropicBase64ImageSource) GetType() AnthropicBase64ImageSourceType { + if a == nil { + return AnthropicBase64ImageSourceType("") + } + return a.Type +} + +// #region class-body-anthropicbase64imagesource +// #endregion class-body-anthropicbase64imagesource diff --git a/models/components/anthropicbase64pdfsource.go b/models/components/anthropicbase64pdfsource.go new file mode 100644 index 00000000..d2e4cc37 --- /dev/null +++ b/models/components/anthropicbase64pdfsource.go @@ -0,0 +1,96 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type AnthropicBase64PdfSourceMediaType string + +const ( + AnthropicBase64PdfSourceMediaTypeApplicationPdf AnthropicBase64PdfSourceMediaType = "application/pdf" +) + +func (e AnthropicBase64PdfSourceMediaType) ToPointer() *AnthropicBase64PdfSourceMediaType { + return &e +} +func (e *AnthropicBase64PdfSourceMediaType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "application/pdf": + *e = AnthropicBase64PdfSourceMediaType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicBase64PdfSourceMediaType: %v", v) + } +} + +type AnthropicBase64PdfSourceType string + +const ( + AnthropicBase64PdfSourceTypeBase64 AnthropicBase64PdfSourceType = "base64" +) + +func (e AnthropicBase64PdfSourceType) ToPointer() *AnthropicBase64PdfSourceType { + return &e +} +func (e *AnthropicBase64PdfSourceType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "base64": + *e = AnthropicBase64PdfSourceType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicBase64PdfSourceType: %v", v) + } +} + +type AnthropicBase64PdfSource struct { + Data string `json:"data"` + MediaType AnthropicBase64PdfSourceMediaType `json:"media_type"` + Type AnthropicBase64PdfSourceType `json:"type"` +} + +func (a AnthropicBase64PdfSource) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicBase64PdfSource) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicBase64PdfSource) GetData() string { + if a == nil { + return "" + } + return a.Data +} + +func (a *AnthropicBase64PdfSource) GetMediaType() AnthropicBase64PdfSourceMediaType { + if a == nil { + return AnthropicBase64PdfSourceMediaType("") + } + return a.MediaType +} + +func (a *AnthropicBase64PdfSource) GetType() AnthropicBase64PdfSourceType { + if a == nil { + return AnthropicBase64PdfSourceType("") + } + return a.Type +} + +// #region class-body-anthropicbase64pdfsource +// #endregion class-body-anthropicbase64pdfsource diff --git a/models/components/anthropiccachecontroldirective.go b/models/components/anthropiccachecontroldirective.go index 8138027f..6ec1088e 100644 --- a/models/components/anthropiccachecontroldirective.go +++ b/models/components/anthropiccachecontroldirective.go @@ -30,7 +30,7 @@ func (e *AnthropicCacheControlDirectiveType) UnmarshalJSON(data []byte) error { } } -// AnthropicCacheControlDirective - Enable automatic prompt caching. When set, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. +// AnthropicCacheControlDirective - Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. type AnthropicCacheControlDirective struct { TTL *AnthropicCacheControlTTL `json:"ttl,omitzero"` Type AnthropicCacheControlDirectiveType `json:"type"` diff --git a/models/components/anthropiccitationcharlocationparam.go b/models/components/anthropiccitationcharlocationparam.go new file mode 100644 index 00000000..0c8269a5 --- /dev/null +++ b/models/components/anthropiccitationcharlocationparam.go @@ -0,0 +1,94 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type AnthropicCitationCharLocationParamType string + +const ( + AnthropicCitationCharLocationParamTypeCharLocation AnthropicCitationCharLocationParamType = "char_location" +) + +func (e AnthropicCitationCharLocationParamType) ToPointer() *AnthropicCitationCharLocationParamType { + return &e +} +func (e *AnthropicCitationCharLocationParamType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "char_location": + *e = AnthropicCitationCharLocationParamType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicCitationCharLocationParamType: %v", v) + } +} + +type AnthropicCitationCharLocationParam struct { + CitedText string `json:"cited_text"` + DocumentIndex int64 `json:"document_index"` + DocumentTitle *string `json:"document_title"` + EndCharIndex int64 `json:"end_char_index"` + StartCharIndex int64 `json:"start_char_index"` + Type AnthropicCitationCharLocationParamType `json:"type"` +} + +func (a AnthropicCitationCharLocationParam) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicCitationCharLocationParam) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicCitationCharLocationParam) GetCitedText() string { + if a == nil { + return "" + } + return a.CitedText +} + +func (a *AnthropicCitationCharLocationParam) GetDocumentIndex() int64 { + if a == nil { + return 0 + } + return a.DocumentIndex +} + +func (a *AnthropicCitationCharLocationParam) GetDocumentTitle() *string { + if a == nil { + return nil + } + return a.DocumentTitle +} + +func (a *AnthropicCitationCharLocationParam) GetEndCharIndex() int64 { + if a == nil { + return 0 + } + return a.EndCharIndex +} + +func (a *AnthropicCitationCharLocationParam) GetStartCharIndex() int64 { + if a == nil { + return 0 + } + return a.StartCharIndex +} + +func (a *AnthropicCitationCharLocationParam) GetType() AnthropicCitationCharLocationParamType { + if a == nil { + return AnthropicCitationCharLocationParamType("") + } + return a.Type +} diff --git a/models/components/anthropiccitationcontentblocklocationparam.go b/models/components/anthropiccitationcontentblocklocationparam.go new file mode 100644 index 00000000..10b724c6 --- /dev/null +++ b/models/components/anthropiccitationcontentblocklocationparam.go @@ -0,0 +1,94 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type AnthropicCitationContentBlockLocationParamType string + +const ( + AnthropicCitationContentBlockLocationParamTypeContentBlockLocation AnthropicCitationContentBlockLocationParamType = "content_block_location" +) + +func (e AnthropicCitationContentBlockLocationParamType) ToPointer() *AnthropicCitationContentBlockLocationParamType { + return &e +} +func (e *AnthropicCitationContentBlockLocationParamType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "content_block_location": + *e = AnthropicCitationContentBlockLocationParamType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicCitationContentBlockLocationParamType: %v", v) + } +} + +type AnthropicCitationContentBlockLocationParam struct { + CitedText string `json:"cited_text"` + DocumentIndex int64 `json:"document_index"` + DocumentTitle *string `json:"document_title"` + EndBlockIndex int64 `json:"end_block_index"` + StartBlockIndex int64 `json:"start_block_index"` + Type AnthropicCitationContentBlockLocationParamType `json:"type"` +} + +func (a AnthropicCitationContentBlockLocationParam) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicCitationContentBlockLocationParam) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicCitationContentBlockLocationParam) GetCitedText() string { + if a == nil { + return "" + } + return a.CitedText +} + +func (a *AnthropicCitationContentBlockLocationParam) GetDocumentIndex() int64 { + if a == nil { + return 0 + } + return a.DocumentIndex +} + +func (a *AnthropicCitationContentBlockLocationParam) GetDocumentTitle() *string { + if a == nil { + return nil + } + return a.DocumentTitle +} + +func (a *AnthropicCitationContentBlockLocationParam) GetEndBlockIndex() int64 { + if a == nil { + return 0 + } + return a.EndBlockIndex +} + +func (a *AnthropicCitationContentBlockLocationParam) GetStartBlockIndex() int64 { + if a == nil { + return 0 + } + return a.StartBlockIndex +} + +func (a *AnthropicCitationContentBlockLocationParam) GetType() AnthropicCitationContentBlockLocationParamType { + if a == nil { + return AnthropicCitationContentBlockLocationParamType("") + } + return a.Type +} diff --git a/models/components/anthropiccitationpagelocationparam.go b/models/components/anthropiccitationpagelocationparam.go new file mode 100644 index 00000000..dd7252a0 --- /dev/null +++ b/models/components/anthropiccitationpagelocationparam.go @@ -0,0 +1,94 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type AnthropicCitationPageLocationParamType string + +const ( + AnthropicCitationPageLocationParamTypePageLocation AnthropicCitationPageLocationParamType = "page_location" +) + +func (e AnthropicCitationPageLocationParamType) ToPointer() *AnthropicCitationPageLocationParamType { + return &e +} +func (e *AnthropicCitationPageLocationParamType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "page_location": + *e = AnthropicCitationPageLocationParamType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicCitationPageLocationParamType: %v", v) + } +} + +type AnthropicCitationPageLocationParam struct { + CitedText string `json:"cited_text"` + DocumentIndex int64 `json:"document_index"` + DocumentTitle *string `json:"document_title"` + EndPageNumber int64 `json:"end_page_number"` + StartPageNumber int64 `json:"start_page_number"` + Type AnthropicCitationPageLocationParamType `json:"type"` +} + +func (a AnthropicCitationPageLocationParam) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicCitationPageLocationParam) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicCitationPageLocationParam) GetCitedText() string { + if a == nil { + return "" + } + return a.CitedText +} + +func (a *AnthropicCitationPageLocationParam) GetDocumentIndex() int64 { + if a == nil { + return 0 + } + return a.DocumentIndex +} + +func (a *AnthropicCitationPageLocationParam) GetDocumentTitle() *string { + if a == nil { + return nil + } + return a.DocumentTitle +} + +func (a *AnthropicCitationPageLocationParam) GetEndPageNumber() int64 { + if a == nil { + return 0 + } + return a.EndPageNumber +} + +func (a *AnthropicCitationPageLocationParam) GetStartPageNumber() int64 { + if a == nil { + return 0 + } + return a.StartPageNumber +} + +func (a *AnthropicCitationPageLocationParam) GetType() AnthropicCitationPageLocationParamType { + if a == nil { + return AnthropicCitationPageLocationParamType("") + } + return a.Type +} diff --git a/models/components/anthropiccitationsearchresultlocation.go b/models/components/anthropiccitationsearchresultlocation.go new file mode 100644 index 00000000..879e6da5 --- /dev/null +++ b/models/components/anthropiccitationsearchresultlocation.go @@ -0,0 +1,102 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type AnthropicCitationSearchResultLocationType string + +const ( + AnthropicCitationSearchResultLocationTypeSearchResultLocation AnthropicCitationSearchResultLocationType = "search_result_location" +) + +func (e AnthropicCitationSearchResultLocationType) ToPointer() *AnthropicCitationSearchResultLocationType { + return &e +} +func (e *AnthropicCitationSearchResultLocationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "search_result_location": + *e = AnthropicCitationSearchResultLocationType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicCitationSearchResultLocationType: %v", v) + } +} + +type AnthropicCitationSearchResultLocation struct { + CitedText string `json:"cited_text"` + EndBlockIndex int64 `json:"end_block_index"` + SearchResultIndex int64 `json:"search_result_index"` + Source string `json:"source"` + StartBlockIndex int64 `json:"start_block_index"` + Title *string `json:"title"` + Type AnthropicCitationSearchResultLocationType `json:"type"` +} + +func (a AnthropicCitationSearchResultLocation) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicCitationSearchResultLocation) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicCitationSearchResultLocation) GetCitedText() string { + if a == nil { + return "" + } + return a.CitedText +} + +func (a *AnthropicCitationSearchResultLocation) GetEndBlockIndex() int64 { + if a == nil { + return 0 + } + return a.EndBlockIndex +} + +func (a *AnthropicCitationSearchResultLocation) GetSearchResultIndex() int64 { + if a == nil { + return 0 + } + return a.SearchResultIndex +} + +func (a *AnthropicCitationSearchResultLocation) GetSource() string { + if a == nil { + return "" + } + return a.Source +} + +func (a *AnthropicCitationSearchResultLocation) GetStartBlockIndex() int64 { + if a == nil { + return 0 + } + return a.StartBlockIndex +} + +func (a *AnthropicCitationSearchResultLocation) GetTitle() *string { + if a == nil { + return nil + } + return a.Title +} + +func (a *AnthropicCitationSearchResultLocation) GetType() AnthropicCitationSearchResultLocationType { + if a == nil { + return AnthropicCitationSearchResultLocationType("") + } + return a.Type +} diff --git a/models/components/anthropiccitationwebsearchresultlocation.go b/models/components/anthropiccitationwebsearchresultlocation.go new file mode 100644 index 00000000..bf7a4100 --- /dev/null +++ b/models/components/anthropiccitationwebsearchresultlocation.go @@ -0,0 +1,86 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type AnthropicCitationWebSearchResultLocationType string + +const ( + AnthropicCitationWebSearchResultLocationTypeWebSearchResultLocation AnthropicCitationWebSearchResultLocationType = "web_search_result_location" +) + +func (e AnthropicCitationWebSearchResultLocationType) ToPointer() *AnthropicCitationWebSearchResultLocationType { + return &e +} +func (e *AnthropicCitationWebSearchResultLocationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "web_search_result_location": + *e = AnthropicCitationWebSearchResultLocationType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicCitationWebSearchResultLocationType: %v", v) + } +} + +type AnthropicCitationWebSearchResultLocation struct { + CitedText string `json:"cited_text"` + EncryptedIndex string `json:"encrypted_index"` + Title *string `json:"title"` + Type AnthropicCitationWebSearchResultLocationType `json:"type"` + URL string `json:"url"` +} + +func (a AnthropicCitationWebSearchResultLocation) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicCitationWebSearchResultLocation) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicCitationWebSearchResultLocation) GetCitedText() string { + if a == nil { + return "" + } + return a.CitedText +} + +func (a *AnthropicCitationWebSearchResultLocation) GetEncryptedIndex() string { + if a == nil { + return "" + } + return a.EncryptedIndex +} + +func (a *AnthropicCitationWebSearchResultLocation) GetTitle() *string { + if a == nil { + return nil + } + return a.Title +} + +func (a *AnthropicCitationWebSearchResultLocation) GetType() AnthropicCitationWebSearchResultLocationType { + if a == nil { + return AnthropicCitationWebSearchResultLocationType("") + } + return a.Type +} + +func (a *AnthropicCitationWebSearchResultLocation) GetURL() string { + if a == nil { + return "" + } + return a.URL +} diff --git a/models/components/anthropicdocumentblockparam.go b/models/components/anthropicdocumentblockparam.go new file mode 100644 index 00000000..3a3eff0a --- /dev/null +++ b/models/components/anthropicdocumentblockparam.go @@ -0,0 +1,501 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "errors" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type AnthropicDocumentBlockParamCitations struct { + Enabled *bool `json:"enabled,omitzero"` +} + +func (a AnthropicDocumentBlockParamCitations) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicDocumentBlockParamCitations) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicDocumentBlockParamCitations) GetEnabled() *bool { + if a == nil { + return nil + } + return a.Enabled +} + +type AnthropicDocumentBlockParamContent1Type string + +const ( + AnthropicDocumentBlockParamContent1TypeImage AnthropicDocumentBlockParamContent1Type = "image" + AnthropicDocumentBlockParamContent1TypeText AnthropicDocumentBlockParamContent1Type = "text" +) + +type AnthropicDocumentBlockParamContent1 struct { + AnthropicTextBlockParam *AnthropicTextBlockParam `queryParam:"inline" union:"member"` + AnthropicImageBlockParam *AnthropicImageBlockParam `queryParam:"inline" union:"member"` + + Type AnthropicDocumentBlockParamContent1Type +} + +func CreateAnthropicDocumentBlockParamContent1Image(image AnthropicImageBlockParam) AnthropicDocumentBlockParamContent1 { + typ := AnthropicDocumentBlockParamContent1TypeImage + + typStr := AnthropicImageBlockParamType(typ) + image.Type = typStr + + return AnthropicDocumentBlockParamContent1{ + AnthropicImageBlockParam: &image, + Type: typ, + } +} + +func CreateAnthropicDocumentBlockParamContent1Text(text AnthropicTextBlockParam) AnthropicDocumentBlockParamContent1 { + typ := AnthropicDocumentBlockParamContent1TypeText + + typStr := AnthropicTextBlockParamType(typ) + text.Type = typStr + + return AnthropicDocumentBlockParamContent1{ + AnthropicTextBlockParam: &text, + Type: typ, + } +} + +func (u *AnthropicDocumentBlockParamContent1) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + return fmt.Errorf("could not unmarshal discriminator: %w", err) + } + + switch dis.Type { + case "image": + anthropicImageBlockParam := new(AnthropicImageBlockParam) + if err := utils.UnmarshalJSON(data, &anthropicImageBlockParam, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == image) type AnthropicImageBlockParam within AnthropicDocumentBlockParamContent1: %w", string(data), err) + } + + u.AnthropicImageBlockParam = anthropicImageBlockParam + u.Type = AnthropicDocumentBlockParamContent1TypeImage + return nil + case "text": + anthropicTextBlockParam := new(AnthropicTextBlockParam) + if err := utils.UnmarshalJSON(data, &anthropicTextBlockParam, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == text) type AnthropicTextBlockParam within AnthropicDocumentBlockParamContent1: %w", string(data), err) + } + + u.AnthropicTextBlockParam = anthropicTextBlockParam + u.Type = AnthropicDocumentBlockParamContent1TypeText + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for AnthropicDocumentBlockParamContent1", string(data)) +} + +func (u AnthropicDocumentBlockParamContent1) MarshalJSON() ([]byte, error) { + if u.AnthropicTextBlockParam != nil { + return utils.MarshalJSON(u.AnthropicTextBlockParam, "", true) + } + + if u.AnthropicImageBlockParam != nil { + return utils.MarshalJSON(u.AnthropicImageBlockParam, "", true) + } + + return nil, errors.New("could not marshal union type AnthropicDocumentBlockParamContent1: all fields are null") +} + +type AnthropicDocumentBlockParamContent2Type string + +const ( + AnthropicDocumentBlockParamContent2TypeStr AnthropicDocumentBlockParamContent2Type = "str" + AnthropicDocumentBlockParamContent2TypeArrayOfAnthropicDocumentBlockParamContent1 AnthropicDocumentBlockParamContent2Type = "arrayOfAnthropicDocumentBlockParamContent1" +) + +type AnthropicDocumentBlockParamContent2 struct { + Str *string `queryParam:"inline" union:"member"` + ArrayOfAnthropicDocumentBlockParamContent1 []AnthropicDocumentBlockParamContent1 `queryParam:"inline" union:"member"` + + Type AnthropicDocumentBlockParamContent2Type +} + +func CreateAnthropicDocumentBlockParamContent2Str(str string) AnthropicDocumentBlockParamContent2 { + typ := AnthropicDocumentBlockParamContent2TypeStr + + return AnthropicDocumentBlockParamContent2{ + Str: &str, + Type: typ, + } +} + +func CreateAnthropicDocumentBlockParamContent2ArrayOfAnthropicDocumentBlockParamContent1(arrayOfAnthropicDocumentBlockParamContent1 []AnthropicDocumentBlockParamContent1) AnthropicDocumentBlockParamContent2 { + typ := AnthropicDocumentBlockParamContent2TypeArrayOfAnthropicDocumentBlockParamContent1 + + return AnthropicDocumentBlockParamContent2{ + ArrayOfAnthropicDocumentBlockParamContent1: arrayOfAnthropicDocumentBlockParamContent1, + Type: typ, + } +} + +func (u *AnthropicDocumentBlockParamContent2) UnmarshalJSON(data []byte) error { + + var candidates []utils.UnionCandidate + + // Collect all valid candidates + var str string = "" + if err := utils.UnmarshalJSON(data, &str, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: AnthropicDocumentBlockParamContent2TypeStr, + Value: &str, + }) + } + + var arrayOfAnthropicDocumentBlockParamContent1 []AnthropicDocumentBlockParamContent1 = []AnthropicDocumentBlockParamContent1{} + if err := utils.UnmarshalJSON(data, &arrayOfAnthropicDocumentBlockParamContent1, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: AnthropicDocumentBlockParamContent2TypeArrayOfAnthropicDocumentBlockParamContent1, + Value: arrayOfAnthropicDocumentBlockParamContent1, + }) + } + + if len(candidates) == 0 { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for AnthropicDocumentBlockParamContent2", string(data)) + } + + // Pick the best candidate using multi-stage filtering + best := utils.PickBestUnionCandidate(candidates, data) + if best == nil { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for AnthropicDocumentBlockParamContent2", string(data)) + } + + // Set the union type and value based on the best candidate + u.Type = best.Type.(AnthropicDocumentBlockParamContent2Type) + switch best.Type { + case AnthropicDocumentBlockParamContent2TypeStr: + u.Str = best.Value.(*string) + return nil + case AnthropicDocumentBlockParamContent2TypeArrayOfAnthropicDocumentBlockParamContent1: + u.ArrayOfAnthropicDocumentBlockParamContent1 = best.Value.([]AnthropicDocumentBlockParamContent1) + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for AnthropicDocumentBlockParamContent2", string(data)) +} + +func (u AnthropicDocumentBlockParamContent2) MarshalJSON() ([]byte, error) { + if u.Str != nil { + return utils.MarshalJSON(u.Str, "", true) + } + + if u.ArrayOfAnthropicDocumentBlockParamContent1 != nil { + return utils.MarshalJSON(u.ArrayOfAnthropicDocumentBlockParamContent1, "", true) + } + + return nil, errors.New("could not marshal union type AnthropicDocumentBlockParamContent2: all fields are null") +} + +type SourceType string + +const ( + SourceTypeContent SourceType = "content" +) + +func (e SourceType) ToPointer() *SourceType { + return &e +} +func (e *SourceType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "content": + *e = SourceType(v) + return nil + default: + return fmt.Errorf("invalid value for SourceType: %v", v) + } +} + +type SourceContent struct { + Content AnthropicDocumentBlockParamContent2 `json:"content"` + Type SourceType `json:"type"` +} + +func (s SourceContent) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SourceContent) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *SourceContent) GetContent() AnthropicDocumentBlockParamContent2 { + if s == nil { + return AnthropicDocumentBlockParamContent2{} + } + return s.Content +} + +func (s *SourceContent) GetType() SourceType { + if s == nil { + return SourceType("") + } + return s.Type +} + +type AnthropicDocumentBlockParamSourceUnionType string + +const ( + AnthropicDocumentBlockParamSourceUnionTypeBase64 AnthropicDocumentBlockParamSourceUnionType = "base64" + AnthropicDocumentBlockParamSourceUnionTypeText AnthropicDocumentBlockParamSourceUnionType = "text" + AnthropicDocumentBlockParamSourceUnionTypeContent AnthropicDocumentBlockParamSourceUnionType = "content" + AnthropicDocumentBlockParamSourceUnionTypeURLObj AnthropicDocumentBlockParamSourceUnionType = "url" +) + +type AnthropicDocumentBlockParamSourceUnion struct { + AnthropicBase64PdfSource *AnthropicBase64PdfSource `queryParam:"inline" union:"member"` + AnthropicPlainTextSource *AnthropicPlainTextSource `queryParam:"inline" union:"member"` + SourceContent *SourceContent `queryParam:"inline" union:"member"` + AnthropicURLPdfSource *AnthropicURLPdfSource `queryParam:"inline" union:"member"` + + Type AnthropicDocumentBlockParamSourceUnionType +} + +func CreateAnthropicDocumentBlockParamSourceUnionBase64(base64 AnthropicBase64PdfSource) AnthropicDocumentBlockParamSourceUnion { + typ := AnthropicDocumentBlockParamSourceUnionTypeBase64 + + typStr := AnthropicBase64PdfSourceType(typ) + base64.Type = typStr + + return AnthropicDocumentBlockParamSourceUnion{ + AnthropicBase64PdfSource: &base64, + Type: typ, + } +} + +func CreateAnthropicDocumentBlockParamSourceUnionText(text AnthropicPlainTextSource) AnthropicDocumentBlockParamSourceUnion { + typ := AnthropicDocumentBlockParamSourceUnionTypeText + + typStr := AnthropicPlainTextSourceType(typ) + text.Type = typStr + + return AnthropicDocumentBlockParamSourceUnion{ + AnthropicPlainTextSource: &text, + Type: typ, + } +} + +func CreateAnthropicDocumentBlockParamSourceUnionContent(content SourceContent) AnthropicDocumentBlockParamSourceUnion { + typ := AnthropicDocumentBlockParamSourceUnionTypeContent + + typStr := SourceType(typ) + content.Type = typStr + + return AnthropicDocumentBlockParamSourceUnion{ + SourceContent: &content, + Type: typ, + } +} + +func CreateAnthropicDocumentBlockParamSourceUnionURLObj(urlT AnthropicURLPdfSource) AnthropicDocumentBlockParamSourceUnion { + typ := AnthropicDocumentBlockParamSourceUnionTypeURLObj + + typStr := AnthropicURLPdfSourceType(typ) + urlT.Type = typStr + + return AnthropicDocumentBlockParamSourceUnion{ + AnthropicURLPdfSource: &urlT, + Type: typ, + } +} + +func (u *AnthropicDocumentBlockParamSourceUnion) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + return fmt.Errorf("could not unmarshal discriminator: %w", err) + } + + switch dis.Type { + case "base64": + anthropicBase64PdfSource := new(AnthropicBase64PdfSource) + if err := utils.UnmarshalJSON(data, &anthropicBase64PdfSource, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == base64) type AnthropicBase64PdfSource within AnthropicDocumentBlockParamSourceUnion: %w", string(data), err) + } + + u.AnthropicBase64PdfSource = anthropicBase64PdfSource + u.Type = AnthropicDocumentBlockParamSourceUnionTypeBase64 + return nil + case "text": + anthropicPlainTextSource := new(AnthropicPlainTextSource) + if err := utils.UnmarshalJSON(data, &anthropicPlainTextSource, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == text) type AnthropicPlainTextSource within AnthropicDocumentBlockParamSourceUnion: %w", string(data), err) + } + + u.AnthropicPlainTextSource = anthropicPlainTextSource + u.Type = AnthropicDocumentBlockParamSourceUnionTypeText + return nil + case "content": + sourceContent := new(SourceContent) + if err := utils.UnmarshalJSON(data, &sourceContent, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == content) type SourceContent within AnthropicDocumentBlockParamSourceUnion: %w", string(data), err) + } + + u.SourceContent = sourceContent + u.Type = AnthropicDocumentBlockParamSourceUnionTypeContent + return nil + case "url": + anthropicURLPdfSource := new(AnthropicURLPdfSource) + if err := utils.UnmarshalJSON(data, &anthropicURLPdfSource, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == url) type AnthropicURLPdfSource within AnthropicDocumentBlockParamSourceUnion: %w", string(data), err) + } + + u.AnthropicURLPdfSource = anthropicURLPdfSource + u.Type = AnthropicDocumentBlockParamSourceUnionTypeURLObj + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for AnthropicDocumentBlockParamSourceUnion", string(data)) +} + +func (u AnthropicDocumentBlockParamSourceUnion) MarshalJSON() ([]byte, error) { + if u.AnthropicBase64PdfSource != nil { + return utils.MarshalJSON(u.AnthropicBase64PdfSource, "", true) + } + + if u.AnthropicPlainTextSource != nil { + return utils.MarshalJSON(u.AnthropicPlainTextSource, "", true) + } + + if u.SourceContent != nil { + return utils.MarshalJSON(u.SourceContent, "", true) + } + + if u.AnthropicURLPdfSource != nil { + return utils.MarshalJSON(u.AnthropicURLPdfSource, "", true) + } + + return nil, errors.New("could not marshal union type AnthropicDocumentBlockParamSourceUnion: all fields are null") +} + +type TypeDocument string + +const ( + TypeDocumentDocument TypeDocument = "document" +) + +func (e TypeDocument) ToPointer() *TypeDocument { + return &e +} +func (e *TypeDocument) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "document": + *e = TypeDocument(v) + return nil + default: + return fmt.Errorf("invalid value for TypeDocument: %v", v) + } +} + +type AnthropicDocumentBlockParam struct { + // Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + CacheControl *AnthropicCacheControlDirective `json:"cache_control,omitzero"` + Citations optionalnullable.OptionalNullable[AnthropicDocumentBlockParamCitations] `json:"citations,omitzero"` + Context optionalnullable.OptionalNullable[string] `json:"context,omitzero"` + Source AnthropicDocumentBlockParamSourceUnion `json:"source"` + Title optionalnullable.OptionalNullable[string] `json:"title,omitzero"` + Type TypeDocument `json:"type"` +} + +func (a AnthropicDocumentBlockParam) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicDocumentBlockParam) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicDocumentBlockParam) GetCacheControl() *AnthropicCacheControlDirective { + if a == nil { + return nil + } + return a.CacheControl +} + +func (a *AnthropicDocumentBlockParam) GetCitations() optionalnullable.OptionalNullable[AnthropicDocumentBlockParamCitations] { + if a == nil { + return nil + } + return a.Citations +} + +func (a *AnthropicDocumentBlockParam) GetContext() optionalnullable.OptionalNullable[string] { + if a == nil { + return nil + } + return a.Context +} + +func (a *AnthropicDocumentBlockParam) GetSource() AnthropicDocumentBlockParamSourceUnion { + if a == nil { + return AnthropicDocumentBlockParamSourceUnion{} + } + return a.Source +} + +func (a *AnthropicDocumentBlockParam) GetSourceBase64() *AnthropicBase64PdfSource { + return a.GetSource().AnthropicBase64PdfSource +} + +func (a *AnthropicDocumentBlockParam) GetSourceText() *AnthropicPlainTextSource { + return a.GetSource().AnthropicPlainTextSource +} + +func (a *AnthropicDocumentBlockParam) GetSourceContent() *SourceContent { + return a.GetSource().SourceContent +} + +func (a *AnthropicDocumentBlockParam) GetSourceURLObj() *AnthropicURLPdfSource { + return a.GetSource().AnthropicURLPdfSource +} + +func (a *AnthropicDocumentBlockParam) GetTitle() optionalnullable.OptionalNullable[string] { + if a == nil { + return nil + } + return a.Title +} + +func (a *AnthropicDocumentBlockParam) GetType() TypeDocument { + if a == nil { + return TypeDocument("") + } + return a.Type +} diff --git a/models/components/anthropicimageblockparam.go b/models/components/anthropicimageblockparam.go new file mode 100644 index 00000000..00c85a2c --- /dev/null +++ b/models/components/anthropicimageblockparam.go @@ -0,0 +1,165 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "errors" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type AnthropicImageBlockParamSourceType string + +const ( + AnthropicImageBlockParamSourceTypeBase64 AnthropicImageBlockParamSourceType = "base64" + AnthropicImageBlockParamSourceTypeURLObj AnthropicImageBlockParamSourceType = "url" +) + +type AnthropicImageBlockParamSource struct { + AnthropicBase64ImageSource *AnthropicBase64ImageSource `queryParam:"inline" union:"member"` + AnthropicURLImageSource *AnthropicURLImageSource `queryParam:"inline" union:"member"` + + Type AnthropicImageBlockParamSourceType +} + +func CreateAnthropicImageBlockParamSourceBase64(base64 AnthropicBase64ImageSource) AnthropicImageBlockParamSource { + typ := AnthropicImageBlockParamSourceTypeBase64 + + typStr := AnthropicBase64ImageSourceType(typ) + base64.Type = typStr + + return AnthropicImageBlockParamSource{ + AnthropicBase64ImageSource: &base64, + Type: typ, + } +} + +func CreateAnthropicImageBlockParamSourceURLObj(urlT AnthropicURLImageSource) AnthropicImageBlockParamSource { + typ := AnthropicImageBlockParamSourceTypeURLObj + + typStr := AnthropicURLImageSourceType(typ) + urlT.Type = typStr + + return AnthropicImageBlockParamSource{ + AnthropicURLImageSource: &urlT, + Type: typ, + } +} + +func (u *AnthropicImageBlockParamSource) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + return fmt.Errorf("could not unmarshal discriminator: %w", err) + } + + switch dis.Type { + case "base64": + anthropicBase64ImageSource := new(AnthropicBase64ImageSource) + if err := utils.UnmarshalJSON(data, &anthropicBase64ImageSource, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == base64) type AnthropicBase64ImageSource within AnthropicImageBlockParamSource: %w", string(data), err) + } + + u.AnthropicBase64ImageSource = anthropicBase64ImageSource + u.Type = AnthropicImageBlockParamSourceTypeBase64 + return nil + case "url": + anthropicURLImageSource := new(AnthropicURLImageSource) + if err := utils.UnmarshalJSON(data, &anthropicURLImageSource, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == url) type AnthropicURLImageSource within AnthropicImageBlockParamSource: %w", string(data), err) + } + + u.AnthropicURLImageSource = anthropicURLImageSource + u.Type = AnthropicImageBlockParamSourceTypeURLObj + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for AnthropicImageBlockParamSource", string(data)) +} + +func (u AnthropicImageBlockParamSource) MarshalJSON() ([]byte, error) { + if u.AnthropicBase64ImageSource != nil { + return utils.MarshalJSON(u.AnthropicBase64ImageSource, "", true) + } + + if u.AnthropicURLImageSource != nil { + return utils.MarshalJSON(u.AnthropicURLImageSource, "", true) + } + + return nil, errors.New("could not marshal union type AnthropicImageBlockParamSource: all fields are null") +} + +type AnthropicImageBlockParamType string + +const ( + AnthropicImageBlockParamTypeImage AnthropicImageBlockParamType = "image" +) + +func (e AnthropicImageBlockParamType) ToPointer() *AnthropicImageBlockParamType { + return &e +} +func (e *AnthropicImageBlockParamType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "image": + *e = AnthropicImageBlockParamType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicImageBlockParamType: %v", v) + } +} + +type AnthropicImageBlockParam struct { + // Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + CacheControl *AnthropicCacheControlDirective `json:"cache_control,omitzero"` + Source AnthropicImageBlockParamSource `json:"source"` + Type AnthropicImageBlockParamType `json:"type"` +} + +func (a AnthropicImageBlockParam) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicImageBlockParam) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicImageBlockParam) GetCacheControl() *AnthropicCacheControlDirective { + if a == nil { + return nil + } + return a.CacheControl +} + +func (a *AnthropicImageBlockParam) GetSource() AnthropicImageBlockParamSource { + if a == nil { + return AnthropicImageBlockParamSource{} + } + return a.Source +} + +func (a *AnthropicImageBlockParam) GetSourceBase64() *AnthropicBase64ImageSource { + return a.GetSource().AnthropicBase64ImageSource +} + +func (a *AnthropicImageBlockParam) GetSourceURLObj() *AnthropicURLImageSource { + return a.GetSource().AnthropicURLImageSource +} + +func (a *AnthropicImageBlockParam) GetType() AnthropicImageBlockParamType { + if a == nil { + return AnthropicImageBlockParamType("") + } + return a.Type +} diff --git a/models/components/anthropicimagemimetype.go b/models/components/anthropicimagemimetype.go new file mode 100644 index 00000000..a53a85fe --- /dev/null +++ b/models/components/anthropicimagemimetype.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type AnthropicImageMimeType string + +const ( + AnthropicImageMimeTypeImageJpeg AnthropicImageMimeType = "image/jpeg" + AnthropicImageMimeTypeImagePng AnthropicImageMimeType = "image/png" + AnthropicImageMimeTypeImageGif AnthropicImageMimeType = "image/gif" + AnthropicImageMimeTypeImageWebp AnthropicImageMimeType = "image/webp" +) + +func (e AnthropicImageMimeType) ToPointer() *AnthropicImageMimeType { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *AnthropicImageMimeType) IsExact() bool { + if e != nil { + switch *e { + case "image/jpeg", "image/png", "image/gif", "image/webp": + return true + } + } + return false +} diff --git a/models/components/anthropicinputtokensclearatleast.go b/models/components/anthropicinputtokensclearatleast.go new file mode 100644 index 00000000..4240f446 --- /dev/null +++ b/models/components/anthropicinputtokensclearatleast.go @@ -0,0 +1,62 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type AnthropicInputTokensClearAtLeastType string + +const ( + AnthropicInputTokensClearAtLeastTypeInputTokens AnthropicInputTokensClearAtLeastType = "input_tokens" +) + +func (e AnthropicInputTokensClearAtLeastType) ToPointer() *AnthropicInputTokensClearAtLeastType { + return &e +} +func (e *AnthropicInputTokensClearAtLeastType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "input_tokens": + *e = AnthropicInputTokensClearAtLeastType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicInputTokensClearAtLeastType: %v", v) + } +} + +type AnthropicInputTokensClearAtLeast struct { + Type AnthropicInputTokensClearAtLeastType `json:"type"` + Value int64 `json:"value"` +} + +func (a AnthropicInputTokensClearAtLeast) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicInputTokensClearAtLeast) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicInputTokensClearAtLeast) GetType() AnthropicInputTokensClearAtLeastType { + if a == nil { + return AnthropicInputTokensClearAtLeastType("") + } + return a.Type +} + +func (a *AnthropicInputTokensClearAtLeast) GetValue() int64 { + if a == nil { + return 0 + } + return a.Value +} diff --git a/models/components/anthropicinputtokenstrigger.go b/models/components/anthropicinputtokenstrigger.go new file mode 100644 index 00000000..601fb13f --- /dev/null +++ b/models/components/anthropicinputtokenstrigger.go @@ -0,0 +1,62 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type AnthropicInputTokensTriggerType string + +const ( + AnthropicInputTokensTriggerTypeInputTokens AnthropicInputTokensTriggerType = "input_tokens" +) + +func (e AnthropicInputTokensTriggerType) ToPointer() *AnthropicInputTokensTriggerType { + return &e +} +func (e *AnthropicInputTokensTriggerType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "input_tokens": + *e = AnthropicInputTokensTriggerType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicInputTokensTriggerType: %v", v) + } +} + +type AnthropicInputTokensTrigger struct { + Type AnthropicInputTokensTriggerType `json:"type"` + Value int64 `json:"value"` +} + +func (a AnthropicInputTokensTrigger) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicInputTokensTrigger) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicInputTokensTrigger) GetType() AnthropicInputTokensTriggerType { + if a == nil { + return AnthropicInputTokensTriggerType("") + } + return a.Type +} + +func (a *AnthropicInputTokensTrigger) GetValue() int64 { + if a == nil { + return 0 + } + return a.Value +} diff --git a/models/components/anthropicplaintextsource.go b/models/components/anthropicplaintextsource.go new file mode 100644 index 00000000..f855349e --- /dev/null +++ b/models/components/anthropicplaintextsource.go @@ -0,0 +1,93 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type AnthropicPlainTextSourceMediaType string + +const ( + AnthropicPlainTextSourceMediaTypeTextPlain AnthropicPlainTextSourceMediaType = "text/plain" +) + +func (e AnthropicPlainTextSourceMediaType) ToPointer() *AnthropicPlainTextSourceMediaType { + return &e +} +func (e *AnthropicPlainTextSourceMediaType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "text/plain": + *e = AnthropicPlainTextSourceMediaType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicPlainTextSourceMediaType: %v", v) + } +} + +type AnthropicPlainTextSourceType string + +const ( + AnthropicPlainTextSourceTypeText AnthropicPlainTextSourceType = "text" +) + +func (e AnthropicPlainTextSourceType) ToPointer() *AnthropicPlainTextSourceType { + return &e +} +func (e *AnthropicPlainTextSourceType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "text": + *e = AnthropicPlainTextSourceType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicPlainTextSourceType: %v", v) + } +} + +type AnthropicPlainTextSource struct { + Data string `json:"data"` + MediaType AnthropicPlainTextSourceMediaType `json:"media_type"` + Type AnthropicPlainTextSourceType `json:"type"` +} + +func (a AnthropicPlainTextSource) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicPlainTextSource) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicPlainTextSource) GetData() string { + if a == nil { + return "" + } + return a.Data +} + +func (a *AnthropicPlainTextSource) GetMediaType() AnthropicPlainTextSourceMediaType { + if a == nil { + return AnthropicPlainTextSourceMediaType("") + } + return a.MediaType +} + +func (a *AnthropicPlainTextSource) GetType() AnthropicPlainTextSourceType { + if a == nil { + return AnthropicPlainTextSourceType("") + } + return a.Type +} diff --git a/models/components/anthropicsearchresultblockparam.go b/models/components/anthropicsearchresultblockparam.go new file mode 100644 index 00000000..15573d5e --- /dev/null +++ b/models/components/anthropicsearchresultblockparam.go @@ -0,0 +1,117 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type AnthropicSearchResultBlockParamCitations struct { + Enabled *bool `json:"enabled,omitzero"` +} + +func (a AnthropicSearchResultBlockParamCitations) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicSearchResultBlockParamCitations) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicSearchResultBlockParamCitations) GetEnabled() *bool { + if a == nil { + return nil + } + return a.Enabled +} + +type AnthropicSearchResultBlockParamType string + +const ( + AnthropicSearchResultBlockParamTypeSearchResult AnthropicSearchResultBlockParamType = "search_result" +) + +func (e AnthropicSearchResultBlockParamType) ToPointer() *AnthropicSearchResultBlockParamType { + return &e +} +func (e *AnthropicSearchResultBlockParamType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "search_result": + *e = AnthropicSearchResultBlockParamType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicSearchResultBlockParamType: %v", v) + } +} + +type AnthropicSearchResultBlockParam struct { + // Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + CacheControl *AnthropicCacheControlDirective `json:"cache_control,omitzero"` + Citations *AnthropicSearchResultBlockParamCitations `json:"citations,omitzero"` + Content []AnthropicTextBlockParam `json:"content"` + Source string `json:"source"` + Title string `json:"title"` + Type AnthropicSearchResultBlockParamType `json:"type"` +} + +func (a AnthropicSearchResultBlockParam) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicSearchResultBlockParam) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicSearchResultBlockParam) GetCacheControl() *AnthropicCacheControlDirective { + if a == nil { + return nil + } + return a.CacheControl +} + +func (a *AnthropicSearchResultBlockParam) GetCitations() *AnthropicSearchResultBlockParamCitations { + if a == nil { + return nil + } + return a.Citations +} + +func (a *AnthropicSearchResultBlockParam) GetContent() []AnthropicTextBlockParam { + if a == nil { + return []AnthropicTextBlockParam{} + } + return a.Content +} + +func (a *AnthropicSearchResultBlockParam) GetSource() string { + if a == nil { + return "" + } + return a.Source +} + +func (a *AnthropicSearchResultBlockParam) GetTitle() string { + if a == nil { + return "" + } + return a.Title +} + +func (a *AnthropicSearchResultBlockParam) GetType() AnthropicSearchResultBlockParamType { + if a == nil { + return AnthropicSearchResultBlockParamType("") + } + return a.Type +} diff --git a/models/components/anthropictextblockparam.go b/models/components/anthropictextblockparam.go new file mode 100644 index 00000000..6ac4f6fa --- /dev/null +++ b/models/components/anthropictextblockparam.go @@ -0,0 +1,247 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "errors" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type CitationType string + +const ( + CitationTypeCharLocation CitationType = "char_location" + CitationTypeContentBlockLocation CitationType = "content_block_location" + CitationTypePageLocation CitationType = "page_location" + CitationTypeSearchResultLocation CitationType = "search_result_location" + CitationTypeWebSearchResultLocation CitationType = "web_search_result_location" +) + +type Citation struct { + AnthropicCitationCharLocationParam *AnthropicCitationCharLocationParam `queryParam:"inline" union:"member"` + AnthropicCitationPageLocationParam *AnthropicCitationPageLocationParam `queryParam:"inline" union:"member"` + AnthropicCitationContentBlockLocationParam *AnthropicCitationContentBlockLocationParam `queryParam:"inline" union:"member"` + AnthropicCitationWebSearchResultLocation *AnthropicCitationWebSearchResultLocation `queryParam:"inline" union:"member"` + AnthropicCitationSearchResultLocation *AnthropicCitationSearchResultLocation `queryParam:"inline" union:"member"` + + Type CitationType +} + +func CreateCitationCharLocation(charLocation AnthropicCitationCharLocationParam) Citation { + typ := CitationTypeCharLocation + + typStr := AnthropicCitationCharLocationParamType(typ) + charLocation.Type = typStr + + return Citation{ + AnthropicCitationCharLocationParam: &charLocation, + Type: typ, + } +} + +func CreateCitationContentBlockLocation(contentBlockLocation AnthropicCitationContentBlockLocationParam) Citation { + typ := CitationTypeContentBlockLocation + + typStr := AnthropicCitationContentBlockLocationParamType(typ) + contentBlockLocation.Type = typStr + + return Citation{ + AnthropicCitationContentBlockLocationParam: &contentBlockLocation, + Type: typ, + } +} + +func CreateCitationPageLocation(pageLocation AnthropicCitationPageLocationParam) Citation { + typ := CitationTypePageLocation + + typStr := AnthropicCitationPageLocationParamType(typ) + pageLocation.Type = typStr + + return Citation{ + AnthropicCitationPageLocationParam: &pageLocation, + Type: typ, + } +} + +func CreateCitationSearchResultLocation(searchResultLocation AnthropicCitationSearchResultLocation) Citation { + typ := CitationTypeSearchResultLocation + + typStr := AnthropicCitationSearchResultLocationType(typ) + searchResultLocation.Type = typStr + + return Citation{ + AnthropicCitationSearchResultLocation: &searchResultLocation, + Type: typ, + } +} + +func CreateCitationWebSearchResultLocation(webSearchResultLocation AnthropicCitationWebSearchResultLocation) Citation { + typ := CitationTypeWebSearchResultLocation + + typStr := AnthropicCitationWebSearchResultLocationType(typ) + webSearchResultLocation.Type = typStr + + return Citation{ + AnthropicCitationWebSearchResultLocation: &webSearchResultLocation, + Type: typ, + } +} + +func (u *Citation) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + return fmt.Errorf("could not unmarshal discriminator: %w", err) + } + + switch dis.Type { + case "char_location": + anthropicCitationCharLocationParam := new(AnthropicCitationCharLocationParam) + if err := utils.UnmarshalJSON(data, &anthropicCitationCharLocationParam, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == char_location) type AnthropicCitationCharLocationParam within Citation: %w", string(data), err) + } + + u.AnthropicCitationCharLocationParam = anthropicCitationCharLocationParam + u.Type = CitationTypeCharLocation + return nil + case "content_block_location": + anthropicCitationContentBlockLocationParam := new(AnthropicCitationContentBlockLocationParam) + if err := utils.UnmarshalJSON(data, &anthropicCitationContentBlockLocationParam, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == content_block_location) type AnthropicCitationContentBlockLocationParam within Citation: %w", string(data), err) + } + + u.AnthropicCitationContentBlockLocationParam = anthropicCitationContentBlockLocationParam + u.Type = CitationTypeContentBlockLocation + return nil + case "page_location": + anthropicCitationPageLocationParam := new(AnthropicCitationPageLocationParam) + if err := utils.UnmarshalJSON(data, &anthropicCitationPageLocationParam, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == page_location) type AnthropicCitationPageLocationParam within Citation: %w", string(data), err) + } + + u.AnthropicCitationPageLocationParam = anthropicCitationPageLocationParam + u.Type = CitationTypePageLocation + return nil + case "search_result_location": + anthropicCitationSearchResultLocation := new(AnthropicCitationSearchResultLocation) + if err := utils.UnmarshalJSON(data, &anthropicCitationSearchResultLocation, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == search_result_location) type AnthropicCitationSearchResultLocation within Citation: %w", string(data), err) + } + + u.AnthropicCitationSearchResultLocation = anthropicCitationSearchResultLocation + u.Type = CitationTypeSearchResultLocation + return nil + case "web_search_result_location": + anthropicCitationWebSearchResultLocation := new(AnthropicCitationWebSearchResultLocation) + if err := utils.UnmarshalJSON(data, &anthropicCitationWebSearchResultLocation, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == web_search_result_location) type AnthropicCitationWebSearchResultLocation within Citation: %w", string(data), err) + } + + u.AnthropicCitationWebSearchResultLocation = anthropicCitationWebSearchResultLocation + u.Type = CitationTypeWebSearchResultLocation + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for Citation", string(data)) +} + +func (u Citation) MarshalJSON() ([]byte, error) { + if u.AnthropicCitationCharLocationParam != nil { + return utils.MarshalJSON(u.AnthropicCitationCharLocationParam, "", true) + } + + if u.AnthropicCitationPageLocationParam != nil { + return utils.MarshalJSON(u.AnthropicCitationPageLocationParam, "", true) + } + + if u.AnthropicCitationContentBlockLocationParam != nil { + return utils.MarshalJSON(u.AnthropicCitationContentBlockLocationParam, "", true) + } + + if u.AnthropicCitationWebSearchResultLocation != nil { + return utils.MarshalJSON(u.AnthropicCitationWebSearchResultLocation, "", true) + } + + if u.AnthropicCitationSearchResultLocation != nil { + return utils.MarshalJSON(u.AnthropicCitationSearchResultLocation, "", true) + } + + return nil, errors.New("could not marshal union type Citation: all fields are null") +} + +type AnthropicTextBlockParamType string + +const ( + AnthropicTextBlockParamTypeText AnthropicTextBlockParamType = "text" +) + +func (e AnthropicTextBlockParamType) ToPointer() *AnthropicTextBlockParamType { + return &e +} +func (e *AnthropicTextBlockParamType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "text": + *e = AnthropicTextBlockParamType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicTextBlockParamType: %v", v) + } +} + +type AnthropicTextBlockParam struct { + // Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + CacheControl *AnthropicCacheControlDirective `json:"cache_control,omitzero"` + Citations optionalnullable.OptionalNullable[[]Citation] `json:"citations,omitzero"` + Text string `json:"text"` + Type AnthropicTextBlockParamType `json:"type"` +} + +func (a AnthropicTextBlockParam) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicTextBlockParam) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicTextBlockParam) GetCacheControl() *AnthropicCacheControlDirective { + if a == nil { + return nil + } + return a.CacheControl +} + +func (a *AnthropicTextBlockParam) GetCitations() optionalnullable.OptionalNullable[[]Citation] { + if a == nil { + return nil + } + return a.Citations +} + +func (a *AnthropicTextBlockParam) GetText() string { + if a == nil { + return "" + } + return a.Text +} + +func (a *AnthropicTextBlockParam) GetType() AnthropicTextBlockParamType { + if a == nil { + return AnthropicTextBlockParamType("") + } + return a.Type +} diff --git a/models/components/anthropicthinkingdisplay.go b/models/components/anthropicthinkingdisplay.go new file mode 100644 index 00000000..7b398775 --- /dev/null +++ b/models/components/anthropicthinkingdisplay.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type AnthropicThinkingDisplay string + +const ( + AnthropicThinkingDisplaySummarized AnthropicThinkingDisplay = "summarized" + AnthropicThinkingDisplayOmitted AnthropicThinkingDisplay = "omitted" +) + +func (e AnthropicThinkingDisplay) ToPointer() *AnthropicThinkingDisplay { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *AnthropicThinkingDisplay) IsExact() bool { + if e != nil { + switch *e { + case "summarized", "omitted": + return true + } + } + return false +} diff --git a/models/components/anthropicthinkingturns.go b/models/components/anthropicthinkingturns.go new file mode 100644 index 00000000..f2f72cce --- /dev/null +++ b/models/components/anthropicthinkingturns.go @@ -0,0 +1,62 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type AnthropicThinkingTurnsType string + +const ( + AnthropicThinkingTurnsTypeThinkingTurns AnthropicThinkingTurnsType = "thinking_turns" +) + +func (e AnthropicThinkingTurnsType) ToPointer() *AnthropicThinkingTurnsType { + return &e +} +func (e *AnthropicThinkingTurnsType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "thinking_turns": + *e = AnthropicThinkingTurnsType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicThinkingTurnsType: %v", v) + } +} + +type AnthropicThinkingTurns struct { + Type AnthropicThinkingTurnsType `json:"type"` + Value int64 `json:"value"` +} + +func (a AnthropicThinkingTurns) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicThinkingTurns) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicThinkingTurns) GetType() AnthropicThinkingTurnsType { + if a == nil { + return AnthropicThinkingTurnsType("") + } + return a.Type +} + +func (a *AnthropicThinkingTurns) GetValue() int64 { + if a == nil { + return 0 + } + return a.Value +} diff --git a/models/components/anthropictooluseskeep.go b/models/components/anthropictooluseskeep.go new file mode 100644 index 00000000..38074b4c --- /dev/null +++ b/models/components/anthropictooluseskeep.go @@ -0,0 +1,62 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type AnthropicToolUsesKeepType string + +const ( + AnthropicToolUsesKeepTypeToolUses AnthropicToolUsesKeepType = "tool_uses" +) + +func (e AnthropicToolUsesKeepType) ToPointer() *AnthropicToolUsesKeepType { + return &e +} +func (e *AnthropicToolUsesKeepType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "tool_uses": + *e = AnthropicToolUsesKeepType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicToolUsesKeepType: %v", v) + } +} + +type AnthropicToolUsesKeep struct { + Type AnthropicToolUsesKeepType `json:"type"` + Value int64 `json:"value"` +} + +func (a AnthropicToolUsesKeep) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicToolUsesKeep) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicToolUsesKeep) GetType() AnthropicToolUsesKeepType { + if a == nil { + return AnthropicToolUsesKeepType("") + } + return a.Type +} + +func (a *AnthropicToolUsesKeep) GetValue() int64 { + if a == nil { + return 0 + } + return a.Value +} diff --git a/models/components/anthropictoolusestrigger.go b/models/components/anthropictoolusestrigger.go new file mode 100644 index 00000000..6a346067 --- /dev/null +++ b/models/components/anthropictoolusestrigger.go @@ -0,0 +1,62 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type AnthropicToolUsesTriggerType string + +const ( + AnthropicToolUsesTriggerTypeToolUses AnthropicToolUsesTriggerType = "tool_uses" +) + +func (e AnthropicToolUsesTriggerType) ToPointer() *AnthropicToolUsesTriggerType { + return &e +} +func (e *AnthropicToolUsesTriggerType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "tool_uses": + *e = AnthropicToolUsesTriggerType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicToolUsesTriggerType: %v", v) + } +} + +type AnthropicToolUsesTrigger struct { + Type AnthropicToolUsesTriggerType `json:"type"` + Value int64 `json:"value"` +} + +func (a AnthropicToolUsesTrigger) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicToolUsesTrigger) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicToolUsesTrigger) GetType() AnthropicToolUsesTriggerType { + if a == nil { + return AnthropicToolUsesTriggerType("") + } + return a.Type +} + +func (a *AnthropicToolUsesTrigger) GetValue() int64 { + if a == nil { + return 0 + } + return a.Value +} diff --git a/models/components/anthropicurlimagesource.go b/models/components/anthropicurlimagesource.go new file mode 100644 index 00000000..a049fb05 --- /dev/null +++ b/models/components/anthropicurlimagesource.go @@ -0,0 +1,62 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type AnthropicURLImageSourceType string + +const ( + AnthropicURLImageSourceTypeURL AnthropicURLImageSourceType = "url" +) + +func (e AnthropicURLImageSourceType) ToPointer() *AnthropicURLImageSourceType { + return &e +} +func (e *AnthropicURLImageSourceType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "url": + *e = AnthropicURLImageSourceType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicURLImageSourceType: %v", v) + } +} + +type AnthropicURLImageSource struct { + Type AnthropicURLImageSourceType `json:"type"` + URL string `json:"url"` +} + +func (a AnthropicURLImageSource) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicURLImageSource) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicURLImageSource) GetType() AnthropicURLImageSourceType { + if a == nil { + return AnthropicURLImageSourceType("") + } + return a.Type +} + +func (a *AnthropicURLImageSource) GetURL() string { + if a == nil { + return "" + } + return a.URL +} diff --git a/models/components/anthropicurlpdfsource.go b/models/components/anthropicurlpdfsource.go new file mode 100644 index 00000000..35c61a58 --- /dev/null +++ b/models/components/anthropicurlpdfsource.go @@ -0,0 +1,62 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type AnthropicURLPdfSourceType string + +const ( + AnthropicURLPdfSourceTypeURL AnthropicURLPdfSourceType = "url" +) + +func (e AnthropicURLPdfSourceType) ToPointer() *AnthropicURLPdfSourceType { + return &e +} +func (e *AnthropicURLPdfSourceType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "url": + *e = AnthropicURLPdfSourceType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicURLPdfSourceType: %v", v) + } +} + +type AnthropicURLPdfSource struct { + Type AnthropicURLPdfSourceType `json:"type"` + URL string `json:"url"` +} + +func (a AnthropicURLPdfSource) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicURLPdfSource) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicURLPdfSource) GetType() AnthropicURLPdfSourceType { + if a == nil { + return AnthropicURLPdfSourceType("") + } + return a.Type +} + +func (a *AnthropicURLPdfSource) GetURL() string { + if a == nil { + return "" + } + return a.URL +} diff --git a/models/components/anthropicwebsearchresultblockparam.go b/models/components/anthropicwebsearchresultblockparam.go new file mode 100644 index 00000000..d1ff4c14 --- /dev/null +++ b/models/components/anthropicwebsearchresultblockparam.go @@ -0,0 +1,87 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type AnthropicWebSearchResultBlockParamType string + +const ( + AnthropicWebSearchResultBlockParamTypeWebSearchResult AnthropicWebSearchResultBlockParamType = "web_search_result" +) + +func (e AnthropicWebSearchResultBlockParamType) ToPointer() *AnthropicWebSearchResultBlockParamType { + return &e +} +func (e *AnthropicWebSearchResultBlockParamType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "web_search_result": + *e = AnthropicWebSearchResultBlockParamType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicWebSearchResultBlockParamType: %v", v) + } +} + +type AnthropicWebSearchResultBlockParam struct { + EncryptedContent string `json:"encrypted_content"` + PageAge optionalnullable.OptionalNullable[string] `json:"page_age,omitzero"` + Title string `json:"title"` + Type AnthropicWebSearchResultBlockParamType `json:"type"` + URL string `json:"url"` +} + +func (a AnthropicWebSearchResultBlockParam) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicWebSearchResultBlockParam) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicWebSearchResultBlockParam) GetEncryptedContent() string { + if a == nil { + return "" + } + return a.EncryptedContent +} + +func (a *AnthropicWebSearchResultBlockParam) GetPageAge() optionalnullable.OptionalNullable[string] { + if a == nil { + return nil + } + return a.PageAge +} + +func (a *AnthropicWebSearchResultBlockParam) GetTitle() string { + if a == nil { + return "" + } + return a.Title +} + +func (a *AnthropicWebSearchResultBlockParam) GetType() AnthropicWebSearchResultBlockParamType { + if a == nil { + return AnthropicWebSearchResultBlockParamType("") + } + return a.Type +} + +func (a *AnthropicWebSearchResultBlockParam) GetURL() string { + if a == nil { + return "" + } + return a.URL +} diff --git a/models/components/anthropicwebsearchtooluserlocation.go b/models/components/anthropicwebsearchtooluserlocation.go new file mode 100644 index 00000000..b759f472 --- /dev/null +++ b/models/components/anthropicwebsearchtooluserlocation.go @@ -0,0 +1,87 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type AnthropicWebSearchToolUserLocationType string + +const ( + AnthropicWebSearchToolUserLocationTypeApproximate AnthropicWebSearchToolUserLocationType = "approximate" +) + +func (e AnthropicWebSearchToolUserLocationType) ToPointer() *AnthropicWebSearchToolUserLocationType { + return &e +} +func (e *AnthropicWebSearchToolUserLocationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "approximate": + *e = AnthropicWebSearchToolUserLocationType(v) + return nil + default: + return fmt.Errorf("invalid value for AnthropicWebSearchToolUserLocationType: %v", v) + } +} + +type AnthropicWebSearchToolUserLocation struct { + City optionalnullable.OptionalNullable[string] `json:"city,omitzero"` + Country optionalnullable.OptionalNullable[string] `json:"country,omitzero"` + Region optionalnullable.OptionalNullable[string] `json:"region,omitzero"` + Timezone optionalnullable.OptionalNullable[string] `json:"timezone,omitzero"` + Type AnthropicWebSearchToolUserLocationType `json:"type"` +} + +func (a AnthropicWebSearchToolUserLocation) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AnthropicWebSearchToolUserLocation) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AnthropicWebSearchToolUserLocation) GetCity() optionalnullable.OptionalNullable[string] { + if a == nil { + return nil + } + return a.City +} + +func (a *AnthropicWebSearchToolUserLocation) GetCountry() optionalnullable.OptionalNullable[string] { + if a == nil { + return nil + } + return a.Country +} + +func (a *AnthropicWebSearchToolUserLocation) GetRegion() optionalnullable.OptionalNullable[string] { + if a == nil { + return nil + } + return a.Region +} + +func (a *AnthropicWebSearchToolUserLocation) GetTimezone() optionalnullable.OptionalNullable[string] { + if a == nil { + return nil + } + return a.Timezone +} + +func (a *AnthropicWebSearchToolUserLocation) GetType() AnthropicWebSearchToolUserLocationType { + if a == nil { + return AnthropicWebSearchToolUserLocationType("") + } + return a.Type +} diff --git a/models/components/applypatchcallitem.go b/models/components/applypatchcallitem.go new file mode 100644 index 00000000..afada19a --- /dev/null +++ b/models/components/applypatchcallitem.go @@ -0,0 +1,102 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type ApplyPatchCallItemType string + +const ( + ApplyPatchCallItemTypeApplyPatchCall ApplyPatchCallItemType = "apply_patch_call" +) + +func (e ApplyPatchCallItemType) ToPointer() *ApplyPatchCallItemType { + return &e +} +func (e *ApplyPatchCallItemType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "apply_patch_call": + *e = ApplyPatchCallItemType(v) + return nil + default: + return fmt.Errorf("invalid value for ApplyPatchCallItemType: %v", v) + } +} + +// ApplyPatchCallItem - A tool call emitted by the model requesting a V4A patch operation. The client applies the patch and echoes an `apply_patch_call_output` on the next turn. +type ApplyPatchCallItem struct { + CallID string `json:"call_id"` + ID optionalnullable.OptionalNullable[string] `json:"id,omitzero"` + // The patch operation requested by an `apply_patch_call`. `create_file` and `update_file` carry a V4A diff; `delete_file` omits it. + Operation ApplyPatchCallOperation `json:"operation"` + // Lifecycle state of an `apply_patch_call` output item. + Status ApplyPatchCallStatus `json:"status"` + Type ApplyPatchCallItemType `json:"type"` +} + +func (a ApplyPatchCallItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *ApplyPatchCallItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *ApplyPatchCallItem) GetCallID() string { + if a == nil { + return "" + } + return a.CallID +} + +func (a *ApplyPatchCallItem) GetID() optionalnullable.OptionalNullable[string] { + if a == nil { + return nil + } + return a.ID +} + +func (a *ApplyPatchCallItem) GetOperation() ApplyPatchCallOperation { + if a == nil { + return ApplyPatchCallOperation{} + } + return a.Operation +} + +func (a *ApplyPatchCallItem) GetOperationCreateFile() *ApplyPatchCreateFileOperation { + return a.GetOperation().ApplyPatchCreateFileOperation +} + +func (a *ApplyPatchCallItem) GetOperationDeleteFile() *ApplyPatchDeleteFileOperation { + return a.GetOperation().ApplyPatchDeleteFileOperation +} + +func (a *ApplyPatchCallItem) GetOperationUpdateFile() *ApplyPatchUpdateFileOperation { + return a.GetOperation().ApplyPatchUpdateFileOperation +} + +func (a *ApplyPatchCallItem) GetStatus() ApplyPatchCallStatus { + if a == nil { + return ApplyPatchCallStatus("") + } + return a.Status +} + +func (a *ApplyPatchCallItem) GetType() ApplyPatchCallItemType { + if a == nil { + return ApplyPatchCallItemType("") + } + return a.Type +} diff --git a/models/components/applypatchcalloperation.go b/models/components/applypatchcalloperation.go new file mode 100644 index 00000000..fde9a79e --- /dev/null +++ b/models/components/applypatchcalloperation.go @@ -0,0 +1,153 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "errors" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ApplyPatchCallOperationType string + +const ( + ApplyPatchCallOperationTypeCreateFile ApplyPatchCallOperationType = "create_file" + ApplyPatchCallOperationTypeDeleteFile ApplyPatchCallOperationType = "delete_file" + ApplyPatchCallOperationTypeUpdateFile ApplyPatchCallOperationType = "update_file" + ApplyPatchCallOperationTypeUnknown ApplyPatchCallOperationType = "UNKNOWN" +) + +// ApplyPatchCallOperation - The patch operation requested by an `apply_patch_call`. `create_file` and `update_file` carry a V4A diff; `delete_file` omits it. +type ApplyPatchCallOperation struct { + ApplyPatchCreateFileOperation *ApplyPatchCreateFileOperation `queryParam:"inline" union:"member"` + ApplyPatchUpdateFileOperation *ApplyPatchUpdateFileOperation `queryParam:"inline" union:"member"` + ApplyPatchDeleteFileOperation *ApplyPatchDeleteFileOperation `queryParam:"inline" union:"member"` + UnknownRaw json.RawMessage `json:"-" union:"unknown"` + + Type ApplyPatchCallOperationType +} + +func CreateApplyPatchCallOperationCreateFile(createFile ApplyPatchCreateFileOperation) ApplyPatchCallOperation { + typ := ApplyPatchCallOperationTypeCreateFile + + typStr := ApplyPatchCreateFileOperationType(typ) + createFile.Type = typStr + + return ApplyPatchCallOperation{ + ApplyPatchCreateFileOperation: &createFile, + Type: typ, + } +} + +func CreateApplyPatchCallOperationDeleteFile(deleteFile ApplyPatchDeleteFileOperation) ApplyPatchCallOperation { + typ := ApplyPatchCallOperationTypeDeleteFile + + typStr := ApplyPatchDeleteFileOperationType(typ) + deleteFile.Type = typStr + + return ApplyPatchCallOperation{ + ApplyPatchDeleteFileOperation: &deleteFile, + Type: typ, + } +} + +func CreateApplyPatchCallOperationUpdateFile(updateFile ApplyPatchUpdateFileOperation) ApplyPatchCallOperation { + typ := ApplyPatchCallOperationTypeUpdateFile + + typStr := ApplyPatchUpdateFileOperationType(typ) + updateFile.Type = typStr + + return ApplyPatchCallOperation{ + ApplyPatchUpdateFileOperation: &updateFile, + Type: typ, + } +} + +func CreateApplyPatchCallOperationUnknown(raw json.RawMessage) ApplyPatchCallOperation { + return ApplyPatchCallOperation{ + UnknownRaw: raw, + Type: ApplyPatchCallOperationTypeUnknown, + } +} + +func (u ApplyPatchCallOperation) GetUnknownRaw() json.RawMessage { + return u.UnknownRaw +} + +func (u ApplyPatchCallOperation) IsUnknown() bool { + return u.Type == ApplyPatchCallOperationTypeUnknown +} + +func (u *ApplyPatchCallOperation) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + u.UnknownRaw = json.RawMessage(data) + u.Type = ApplyPatchCallOperationTypeUnknown + return nil + } + if dis == nil { + u.UnknownRaw = json.RawMessage(data) + u.Type = ApplyPatchCallOperationTypeUnknown + return nil + } + + switch dis.Type { + case "create_file": + applyPatchCreateFileOperation := new(ApplyPatchCreateFileOperation) + if err := utils.UnmarshalJSON(data, &applyPatchCreateFileOperation, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == create_file) type ApplyPatchCreateFileOperation within ApplyPatchCallOperation: %w", string(data), err) + } + + u.ApplyPatchCreateFileOperation = applyPatchCreateFileOperation + u.Type = ApplyPatchCallOperationTypeCreateFile + return nil + case "delete_file": + applyPatchDeleteFileOperation := new(ApplyPatchDeleteFileOperation) + if err := utils.UnmarshalJSON(data, &applyPatchDeleteFileOperation, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == delete_file) type ApplyPatchDeleteFileOperation within ApplyPatchCallOperation: %w", string(data), err) + } + + u.ApplyPatchDeleteFileOperation = applyPatchDeleteFileOperation + u.Type = ApplyPatchCallOperationTypeDeleteFile + return nil + case "update_file": + applyPatchUpdateFileOperation := new(ApplyPatchUpdateFileOperation) + if err := utils.UnmarshalJSON(data, &applyPatchUpdateFileOperation, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == update_file) type ApplyPatchUpdateFileOperation within ApplyPatchCallOperation: %w", string(data), err) + } + + u.ApplyPatchUpdateFileOperation = applyPatchUpdateFileOperation + u.Type = ApplyPatchCallOperationTypeUpdateFile + return nil + default: + u.UnknownRaw = json.RawMessage(data) + u.Type = ApplyPatchCallOperationTypeUnknown + return nil + } + +} + +func (u ApplyPatchCallOperation) MarshalJSON() ([]byte, error) { + if u.ApplyPatchCreateFileOperation != nil { + return utils.MarshalJSON(u.ApplyPatchCreateFileOperation, "", true) + } + + if u.ApplyPatchUpdateFileOperation != nil { + return utils.MarshalJSON(u.ApplyPatchUpdateFileOperation, "", true) + } + + if u.ApplyPatchDeleteFileOperation != nil { + return utils.MarshalJSON(u.ApplyPatchDeleteFileOperation, "", true) + } + + if u.UnknownRaw != nil { + return json.RawMessage(u.UnknownRaw), nil + } + return nil, errors.New("could not marshal union type ApplyPatchCallOperation: all fields are null") +} diff --git a/models/components/applypatchcalloperationdiffdeltaevent.go b/models/components/applypatchcalloperationdiffdeltaevent.go new file mode 100644 index 00000000..d8507eeb --- /dev/null +++ b/models/components/applypatchcalloperationdiffdeltaevent.go @@ -0,0 +1,87 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ApplyPatchCallOperationDiffDeltaEventType string + +const ( + ApplyPatchCallOperationDiffDeltaEventTypeResponseApplyPatchCallOperationDiffDelta ApplyPatchCallOperationDiffDeltaEventType = "response.apply_patch_call_operation_diff.delta" +) + +func (e ApplyPatchCallOperationDiffDeltaEventType) ToPointer() *ApplyPatchCallOperationDiffDeltaEventType { + return &e +} +func (e *ApplyPatchCallOperationDiffDeltaEventType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "response.apply_patch_call_operation_diff.delta": + *e = ApplyPatchCallOperationDiffDeltaEventType(v) + return nil + default: + return fmt.Errorf("invalid value for ApplyPatchCallOperationDiffDeltaEventType: %v", v) + } +} + +// ApplyPatchCallOperationDiffDeltaEvent - Incremental chunk of `operation.diff` for an `apply_patch_call`. Matches OpenAI's streaming shape. +type ApplyPatchCallOperationDiffDeltaEvent struct { + Delta string `json:"delta"` + ItemID string `json:"item_id"` + OutputIndex int64 `json:"output_index"` + SequenceNumber int64 `json:"sequence_number"` + Type ApplyPatchCallOperationDiffDeltaEventType `json:"type"` +} + +func (a ApplyPatchCallOperationDiffDeltaEvent) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *ApplyPatchCallOperationDiffDeltaEvent) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *ApplyPatchCallOperationDiffDeltaEvent) GetDelta() string { + if a == nil { + return "" + } + return a.Delta +} + +func (a *ApplyPatchCallOperationDiffDeltaEvent) GetItemID() string { + if a == nil { + return "" + } + return a.ItemID +} + +func (a *ApplyPatchCallOperationDiffDeltaEvent) GetOutputIndex() int64 { + if a == nil { + return 0 + } + return a.OutputIndex +} + +func (a *ApplyPatchCallOperationDiffDeltaEvent) GetSequenceNumber() int64 { + if a == nil { + return 0 + } + return a.SequenceNumber +} + +func (a *ApplyPatchCallOperationDiffDeltaEvent) GetType() ApplyPatchCallOperationDiffDeltaEventType { + if a == nil { + return ApplyPatchCallOperationDiffDeltaEventType("") + } + return a.Type +} diff --git a/models/components/applypatchcalloperationdiffdoneevent.go b/models/components/applypatchcalloperationdiffdoneevent.go new file mode 100644 index 00000000..ba3fd5e1 --- /dev/null +++ b/models/components/applypatchcalloperationdiffdoneevent.go @@ -0,0 +1,87 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ApplyPatchCallOperationDiffDoneEventType string + +const ( + ApplyPatchCallOperationDiffDoneEventTypeResponseApplyPatchCallOperationDiffDone ApplyPatchCallOperationDiffDoneEventType = "response.apply_patch_call_operation_diff.done" +) + +func (e ApplyPatchCallOperationDiffDoneEventType) ToPointer() *ApplyPatchCallOperationDiffDoneEventType { + return &e +} +func (e *ApplyPatchCallOperationDiffDoneEventType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "response.apply_patch_call_operation_diff.done": + *e = ApplyPatchCallOperationDiffDoneEventType(v) + return nil + default: + return fmt.Errorf("invalid value for ApplyPatchCallOperationDiffDoneEventType: %v", v) + } +} + +// ApplyPatchCallOperationDiffDoneEvent - Emitted when `operation.diff` streaming completes for an `apply_patch_call`. +type ApplyPatchCallOperationDiffDoneEvent struct { + Diff string `json:"diff"` + ItemID string `json:"item_id"` + OutputIndex int64 `json:"output_index"` + SequenceNumber int64 `json:"sequence_number"` + Type ApplyPatchCallOperationDiffDoneEventType `json:"type"` +} + +func (a ApplyPatchCallOperationDiffDoneEvent) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *ApplyPatchCallOperationDiffDoneEvent) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *ApplyPatchCallOperationDiffDoneEvent) GetDiff() string { + if a == nil { + return "" + } + return a.Diff +} + +func (a *ApplyPatchCallOperationDiffDoneEvent) GetItemID() string { + if a == nil { + return "" + } + return a.ItemID +} + +func (a *ApplyPatchCallOperationDiffDoneEvent) GetOutputIndex() int64 { + if a == nil { + return 0 + } + return a.OutputIndex +} + +func (a *ApplyPatchCallOperationDiffDoneEvent) GetSequenceNumber() int64 { + if a == nil { + return 0 + } + return a.SequenceNumber +} + +func (a *ApplyPatchCallOperationDiffDoneEvent) GetType() ApplyPatchCallOperationDiffDoneEventType { + if a == nil { + return ApplyPatchCallOperationDiffDoneEventType("") + } + return a.Type +} diff --git a/models/components/applypatchcalloutputitem.go b/models/components/applypatchcalloutputitem.go new file mode 100644 index 00000000..60afddeb --- /dev/null +++ b/models/components/applypatchcalloutputitem.go @@ -0,0 +1,110 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type ApplyPatchCallOutputItemStatus string + +const ( + ApplyPatchCallOutputItemStatusCompleted ApplyPatchCallOutputItemStatus = "completed" + ApplyPatchCallOutputItemStatusFailed ApplyPatchCallOutputItemStatus = "failed" +) + +func (e ApplyPatchCallOutputItemStatus) ToPointer() *ApplyPatchCallOutputItemStatus { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ApplyPatchCallOutputItemStatus) IsExact() bool { + if e != nil { + switch *e { + case "completed", "failed": + return true + } + } + return false +} + +type ApplyPatchCallOutputItemType string + +const ( + ApplyPatchCallOutputItemTypeApplyPatchCallOutput ApplyPatchCallOutputItemType = "apply_patch_call_output" +) + +func (e ApplyPatchCallOutputItemType) ToPointer() *ApplyPatchCallOutputItemType { + return &e +} +func (e *ApplyPatchCallOutputItemType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "apply_patch_call_output": + *e = ApplyPatchCallOutputItemType(v) + return nil + default: + return fmt.Errorf("invalid value for ApplyPatchCallOutputItemType: %v", v) + } +} + +// ApplyPatchCallOutputItem - The client's echo of an `apply_patch_call` after applying the patch. `output` is an optional human-readable log; `status` is `completed` when the patch was applied successfully, `failed` otherwise. +type ApplyPatchCallOutputItem struct { + CallID string `json:"call_id"` + ID optionalnullable.OptionalNullable[string] `json:"id,omitzero"` + Output optionalnullable.OptionalNullable[string] `json:"output,omitzero"` + Status ApplyPatchCallOutputItemStatus `json:"status"` + Type ApplyPatchCallOutputItemType `json:"type"` +} + +func (a ApplyPatchCallOutputItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *ApplyPatchCallOutputItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *ApplyPatchCallOutputItem) GetCallID() string { + if a == nil { + return "" + } + return a.CallID +} + +func (a *ApplyPatchCallOutputItem) GetID() optionalnullable.OptionalNullable[string] { + if a == nil { + return nil + } + return a.ID +} + +func (a *ApplyPatchCallOutputItem) GetOutput() optionalnullable.OptionalNullable[string] { + if a == nil { + return nil + } + return a.Output +} + +func (a *ApplyPatchCallOutputItem) GetStatus() ApplyPatchCallOutputItemStatus { + if a == nil { + return ApplyPatchCallOutputItemStatus("") + } + return a.Status +} + +func (a *ApplyPatchCallOutputItem) GetType() ApplyPatchCallOutputItemType { + if a == nil { + return ApplyPatchCallOutputItemType("") + } + return a.Type +} diff --git a/models/components/applypatchcallstatus.go b/models/components/applypatchcallstatus.go new file mode 100644 index 00000000..047dd8bc --- /dev/null +++ b/models/components/applypatchcallstatus.go @@ -0,0 +1,26 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ApplyPatchCallStatus - Lifecycle state of an `apply_patch_call` output item. +type ApplyPatchCallStatus string + +const ( + ApplyPatchCallStatusInProgress ApplyPatchCallStatus = "in_progress" + ApplyPatchCallStatusCompleted ApplyPatchCallStatus = "completed" +) + +func (e ApplyPatchCallStatus) ToPointer() *ApplyPatchCallStatus { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ApplyPatchCallStatus) IsExact() bool { + if e != nil { + switch *e { + case "in_progress", "completed": + return true + } + } + return false +} diff --git a/models/components/applypatchcreatefileoperation.go b/models/components/applypatchcreatefileoperation.go new file mode 100644 index 00000000..4701f8bc --- /dev/null +++ b/models/components/applypatchcreatefileoperation.go @@ -0,0 +1,71 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ApplyPatchCreateFileOperationType string + +const ( + ApplyPatchCreateFileOperationTypeCreateFile ApplyPatchCreateFileOperationType = "create_file" +) + +func (e ApplyPatchCreateFileOperationType) ToPointer() *ApplyPatchCreateFileOperationType { + return &e +} +func (e *ApplyPatchCreateFileOperationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "create_file": + *e = ApplyPatchCreateFileOperationType(v) + return nil + default: + return fmt.Errorf("invalid value for ApplyPatchCreateFileOperationType: %v", v) + } +} + +// ApplyPatchCreateFileOperation - The `create_file` variant of an `apply_patch_call.operation`. Carries a V4A diff describing the new file contents. +type ApplyPatchCreateFileOperation struct { + Diff string `json:"diff"` + Path string `json:"path"` + Type ApplyPatchCreateFileOperationType `json:"type"` +} + +func (a ApplyPatchCreateFileOperation) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *ApplyPatchCreateFileOperation) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *ApplyPatchCreateFileOperation) GetDiff() string { + if a == nil { + return "" + } + return a.Diff +} + +func (a *ApplyPatchCreateFileOperation) GetPath() string { + if a == nil { + return "" + } + return a.Path +} + +func (a *ApplyPatchCreateFileOperation) GetType() ApplyPatchCreateFileOperationType { + if a == nil { + return ApplyPatchCreateFileOperationType("") + } + return a.Type +} diff --git a/models/components/applypatchdeletefileoperation.go b/models/components/applypatchdeletefileoperation.go new file mode 100644 index 00000000..68bd055d --- /dev/null +++ b/models/components/applypatchdeletefileoperation.go @@ -0,0 +1,63 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ApplyPatchDeleteFileOperationType string + +const ( + ApplyPatchDeleteFileOperationTypeDeleteFile ApplyPatchDeleteFileOperationType = "delete_file" +) + +func (e ApplyPatchDeleteFileOperationType) ToPointer() *ApplyPatchDeleteFileOperationType { + return &e +} +func (e *ApplyPatchDeleteFileOperationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "delete_file": + *e = ApplyPatchDeleteFileOperationType(v) + return nil + default: + return fmt.Errorf("invalid value for ApplyPatchDeleteFileOperationType: %v", v) + } +} + +// ApplyPatchDeleteFileOperation - The `delete_file` variant of an `apply_patch_call.operation`. Identifies the file to remove; no diff is required. +type ApplyPatchDeleteFileOperation struct { + Path string `json:"path"` + Type ApplyPatchDeleteFileOperationType `json:"type"` +} + +func (a ApplyPatchDeleteFileOperation) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *ApplyPatchDeleteFileOperation) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *ApplyPatchDeleteFileOperation) GetPath() string { + if a == nil { + return "" + } + return a.Path +} + +func (a *ApplyPatchDeleteFileOperation) GetType() ApplyPatchDeleteFileOperationType { + if a == nil { + return ApplyPatchDeleteFileOperationType("") + } + return a.Type +} diff --git a/models/components/applypatchengineenum.go b/models/components/applypatchengineenum.go new file mode 100644 index 00000000..dae72e48 --- /dev/null +++ b/models/components/applypatchengineenum.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ApplyPatchEngineEnum - Which apply_patch engine to use. "auto" (default) uses native passthrough when the endpoint advertises native apply_patch support, otherwise falls back to OpenRouter's HITL validator. "native" forces native passthrough — when the endpoint does not support native, the request falls back to HITL. "openrouter" always runs the HITL validator. Native passthrough streams the diff incrementally via `apply_patch_call_operation_diff.delta` events; HITL buffers the diff for atomic delivery as a single delta. +type ApplyPatchEngineEnum string + +const ( + ApplyPatchEngineEnumAuto ApplyPatchEngineEnum = "auto" + ApplyPatchEngineEnumNative ApplyPatchEngineEnum = "native" + ApplyPatchEngineEnumOpenrouter ApplyPatchEngineEnum = "openrouter" +) + +func (e ApplyPatchEngineEnum) ToPointer() *ApplyPatchEngineEnum { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ApplyPatchEngineEnum) IsExact() bool { + if e != nil { + switch *e { + case "auto", "native", "openrouter": + return true + } + } + return false +} diff --git a/models/components/applypatchservertoolconfig.go b/models/components/applypatchservertoolconfig.go new file mode 100644 index 00000000..1f9207e8 --- /dev/null +++ b/models/components/applypatchservertoolconfig.go @@ -0,0 +1,31 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// ApplyPatchServerToolConfig - Configuration for the openrouter:apply_patch server tool +type ApplyPatchServerToolConfig struct { + // Which apply_patch engine to use. "auto" (default) uses native passthrough when the endpoint advertises native apply_patch support, otherwise falls back to OpenRouter's HITL validator. "native" forces native passthrough — when the endpoint does not support native, the request falls back to HITL. "openrouter" always runs the HITL validator. Native passthrough streams the diff incrementally via `apply_patch_call_operation_diff.delta` events; HITL buffers the diff for atomic delivery as a single delta. + Engine *ApplyPatchEngineEnum `json:"engine,omitzero"` +} + +func (a ApplyPatchServerToolConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *ApplyPatchServerToolConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *ApplyPatchServerToolConfig) GetEngine() *ApplyPatchEngineEnum { + if a == nil { + return nil + } + return a.Engine +} diff --git a/models/components/applypatchservertoolopenrouter.go b/models/components/applypatchservertoolopenrouter.go new file mode 100644 index 00000000..462beb26 --- /dev/null +++ b/models/components/applypatchservertoolopenrouter.go @@ -0,0 +1,64 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ApplyPatchServerToolOpenRouterType string + +const ( + ApplyPatchServerToolOpenRouterTypeOpenrouterApplyPatch ApplyPatchServerToolOpenRouterType = "openrouter:apply_patch" +) + +func (e ApplyPatchServerToolOpenRouterType) ToPointer() *ApplyPatchServerToolOpenRouterType { + return &e +} +func (e *ApplyPatchServerToolOpenRouterType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "openrouter:apply_patch": + *e = ApplyPatchServerToolOpenRouterType(v) + return nil + default: + return fmt.Errorf("invalid value for ApplyPatchServerToolOpenRouterType: %v", v) + } +} + +// ApplyPatchServerToolOpenRouter - OpenRouter built-in server tool: validates V4A diff patches for file operations (create, update, delete). Restricted to the Responses API. +type ApplyPatchServerToolOpenRouter struct { + // Configuration for the openrouter:apply_patch server tool + Parameters *ApplyPatchServerToolConfig `json:"parameters,omitzero"` + Type ApplyPatchServerToolOpenRouterType `json:"type"` +} + +func (a ApplyPatchServerToolOpenRouter) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *ApplyPatchServerToolOpenRouter) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *ApplyPatchServerToolOpenRouter) GetParameters() *ApplyPatchServerToolConfig { + if a == nil { + return nil + } + return a.Parameters +} + +func (a *ApplyPatchServerToolOpenRouter) GetType() ApplyPatchServerToolOpenRouterType { + if a == nil { + return ApplyPatchServerToolOpenRouterType("") + } + return a.Type +} diff --git a/models/components/applypatchupdatefileoperation.go b/models/components/applypatchupdatefileoperation.go new file mode 100644 index 00000000..009277fe --- /dev/null +++ b/models/components/applypatchupdatefileoperation.go @@ -0,0 +1,71 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ApplyPatchUpdateFileOperationType string + +const ( + ApplyPatchUpdateFileOperationTypeUpdateFile ApplyPatchUpdateFileOperationType = "update_file" +) + +func (e ApplyPatchUpdateFileOperationType) ToPointer() *ApplyPatchUpdateFileOperationType { + return &e +} +func (e *ApplyPatchUpdateFileOperationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "update_file": + *e = ApplyPatchUpdateFileOperationType(v) + return nil + default: + return fmt.Errorf("invalid value for ApplyPatchUpdateFileOperationType: %v", v) + } +} + +// ApplyPatchUpdateFileOperation - The `update_file` variant of an `apply_patch_call.operation`. Carries a V4A diff describing edits to an existing file. +type ApplyPatchUpdateFileOperation struct { + Diff string `json:"diff"` + Path string `json:"path"` + Type ApplyPatchUpdateFileOperationType `json:"type"` +} + +func (a ApplyPatchUpdateFileOperation) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *ApplyPatchUpdateFileOperation) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *ApplyPatchUpdateFileOperation) GetDiff() string { + if a == nil { + return "" + } + return a.Diff +} + +func (a *ApplyPatchUpdateFileOperation) GetPath() string { + if a == nil { + return "" + } + return a.Path +} + +func (a *ApplyPatchUpdateFileOperation) GetType() ApplyPatchUpdateFileOperationType { + if a == nil { + return ApplyPatchUpdateFileOperationType("") + } + return a.Type +} diff --git a/models/components/apprankingsitem.go b/models/components/apprankingsitem.go new file mode 100644 index 00000000..14948421 --- /dev/null +++ b/models/components/apprankingsitem.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type AppRankingsItem struct { + // Stable numeric identifier of the app on OpenRouter. + AppID int64 `json:"app_id"` + // Public display name of the app. + AppName string `json:"app_name"` + // 1-based position of the app within this response, per the requested `sort`. + Rank int64 `json:"rank"` + // Number of requests attributed to the app inside the date window. + TotalRequests int64 `json:"total_requests"` + // Sum of `prompt_tokens + completion_tokens` attributed to the app inside the date window, returned as a decimal string so 64-bit values are not truncated. + TotalTokens string `json:"total_tokens"` +} + +func (a *AppRankingsItem) GetAppID() int64 { + if a == nil { + return 0 + } + return a.AppID +} + +func (a *AppRankingsItem) GetAppName() string { + if a == nil { + return "" + } + return a.AppName +} + +func (a *AppRankingsItem) GetRank() int64 { + if a == nil { + return 0 + } + return a.Rank +} + +func (a *AppRankingsItem) GetTotalRequests() int64 { + if a == nil { + return 0 + } + return a.TotalRequests +} + +func (a *AppRankingsItem) GetTotalTokens() string { + if a == nil { + return "" + } + return a.TotalTokens +} diff --git a/models/components/apprankingsresponse.go b/models/components/apprankingsresponse.go new file mode 100644 index 00000000..30a27396 --- /dev/null +++ b/models/components/apprankingsresponse.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type AppRankingsResponse struct { + // Apps ranked per the requested `sort`, re-numbered 1..N after category filtering. `popular` sorts by `total_tokens` descending; `trending` sorts by absolute excess token growth descending and may return fewer than `limit` rows when few apps are growing. + Data []AppRankingsItem `json:"data"` + Meta RankingsDailyMeta `json:"meta"` +} + +func (a *AppRankingsResponse) GetData() []AppRankingsItem { + if a == nil { + return []AppRankingsItem{} + } + return a.Data +} + +func (a *AppRankingsResponse) GetMeta() RankingsDailyMeta { + if a == nil { + return RankingsDailyMeta{} + } + return a.Meta +} diff --git a/models/components/autorouterplugin.go b/models/components/autorouterplugin.go index 8ff53e4a..d1f1b575 100644 --- a/models/components/autorouterplugin.go +++ b/models/components/autorouterplugin.go @@ -34,6 +34,8 @@ func (e *AutoRouterPluginID) UnmarshalJSON(data []byte) error { type AutoRouterPlugin struct { // List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, uses the default supported models list. AllowedModels []string `json:"allowed_models,omitzero"` + // Controls cost vs. quality routing tradeoff (0–10). 0 = pure quality (best model regardless of cost), 10 = maximize for cost (cheapest model wins). Intermediate values blend quality and cost signals continuously. Defaults to 7. + CostQualityTradeoff *int64 `json:"cost_quality_tradeoff,omitzero"` // Set to false to disable the auto-router plugin for this request. Defaults to true. Enabled *bool `json:"enabled,omitzero"` ID AutoRouterPluginID `json:"id"` @@ -57,6 +59,13 @@ func (a *AutoRouterPlugin) GetAllowedModels() []string { return a.AllowedModels } +func (a *AutoRouterPlugin) GetCostQualityTradeoff() *int64 { + if a == nil { + return nil + } + return a.CostQualityTradeoff +} + func (a *AutoRouterPlugin) GetEnabled() *bool { if a == nil { return nil diff --git a/models/components/baseinputsunion.go b/models/components/baseinputsunion.go index 8326149f..395f8d29 100644 --- a/models/components/baseinputsunion.go +++ b/models/components/baseinputsunion.go @@ -740,6 +740,10 @@ const ( BaseInputsUnion1TypeOpenAIResponseFunctionToolCall BaseInputsUnion1Type = "OpenAIResponseFunctionToolCall" BaseInputsUnion1TypeOutputItemImageGenerationCall BaseInputsUnion1Type = "OutputItemImageGenerationCall" BaseInputsUnion1TypeOutputMessage BaseInputsUnion1Type = "OutputMessage" + BaseInputsUnion1TypeOpenAIResponseCustomToolCall BaseInputsUnion1Type = "OpenAIResponseCustomToolCall" + BaseInputsUnion1TypeOpenAIResponseCustomToolCallOutput BaseInputsUnion1Type = "OpenAIResponseCustomToolCallOutput" + BaseInputsUnion1TypeApplyPatchCallItem BaseInputsUnion1Type = "ApplyPatchCallItem" + BaseInputsUnion1TypeApplyPatchCallOutputItem BaseInputsUnion1Type = "ApplyPatchCallOutputItem" ) type BaseInputsUnion1 struct { @@ -749,6 +753,10 @@ type BaseInputsUnion1 struct { OpenAIResponseFunctionToolCall *OpenAIResponseFunctionToolCall `queryParam:"inline" union:"member"` OutputItemImageGenerationCall *OutputItemImageGenerationCall `queryParam:"inline" union:"member"` OutputMessage *OutputMessage `queryParam:"inline" union:"member"` + OpenAIResponseCustomToolCall *OpenAIResponseCustomToolCall `queryParam:"inline" union:"member"` + OpenAIResponseCustomToolCallOutput *OpenAIResponseCustomToolCallOutput `queryParam:"inline" union:"member"` + ApplyPatchCallItem *ApplyPatchCallItem `queryParam:"inline" union:"member"` + ApplyPatchCallOutputItem *ApplyPatchCallOutputItem `queryParam:"inline" union:"member"` Type BaseInputsUnion1Type } @@ -807,6 +815,42 @@ func CreateBaseInputsUnion1OutputMessage(outputMessage OutputMessage) BaseInputs } } +func CreateBaseInputsUnion1OpenAIResponseCustomToolCall(openAIResponseCustomToolCall OpenAIResponseCustomToolCall) BaseInputsUnion1 { + typ := BaseInputsUnion1TypeOpenAIResponseCustomToolCall + + return BaseInputsUnion1{ + OpenAIResponseCustomToolCall: &openAIResponseCustomToolCall, + Type: typ, + } +} + +func CreateBaseInputsUnion1OpenAIResponseCustomToolCallOutput(openAIResponseCustomToolCallOutput OpenAIResponseCustomToolCallOutput) BaseInputsUnion1 { + typ := BaseInputsUnion1TypeOpenAIResponseCustomToolCallOutput + + return BaseInputsUnion1{ + OpenAIResponseCustomToolCallOutput: &openAIResponseCustomToolCallOutput, + Type: typ, + } +} + +func CreateBaseInputsUnion1ApplyPatchCallItem(applyPatchCallItem ApplyPatchCallItem) BaseInputsUnion1 { + typ := BaseInputsUnion1TypeApplyPatchCallItem + + return BaseInputsUnion1{ + ApplyPatchCallItem: &applyPatchCallItem, + Type: typ, + } +} + +func CreateBaseInputsUnion1ApplyPatchCallOutputItem(applyPatchCallOutputItem ApplyPatchCallOutputItem) BaseInputsUnion1 { + typ := BaseInputsUnion1TypeApplyPatchCallOutputItem + + return BaseInputsUnion1{ + ApplyPatchCallOutputItem: &applyPatchCallOutputItem, + Type: typ, + } +} + func (u *BaseInputsUnion1) UnmarshalJSON(data []byte) error { var candidates []utils.UnionCandidate @@ -860,6 +904,38 @@ func (u *BaseInputsUnion1) UnmarshalJSON(data []byte) error { }) } + var openAIResponseCustomToolCall OpenAIResponseCustomToolCall = OpenAIResponseCustomToolCall{} + if err := utils.UnmarshalJSON(data, &openAIResponseCustomToolCall, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: BaseInputsUnion1TypeOpenAIResponseCustomToolCall, + Value: &openAIResponseCustomToolCall, + }) + } + + var openAIResponseCustomToolCallOutput OpenAIResponseCustomToolCallOutput = OpenAIResponseCustomToolCallOutput{} + if err := utils.UnmarshalJSON(data, &openAIResponseCustomToolCallOutput, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: BaseInputsUnion1TypeOpenAIResponseCustomToolCallOutput, + Value: &openAIResponseCustomToolCallOutput, + }) + } + + var applyPatchCallItem ApplyPatchCallItem = ApplyPatchCallItem{} + if err := utils.UnmarshalJSON(data, &applyPatchCallItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: BaseInputsUnion1TypeApplyPatchCallItem, + Value: &applyPatchCallItem, + }) + } + + var applyPatchCallOutputItem ApplyPatchCallOutputItem = ApplyPatchCallOutputItem{} + if err := utils.UnmarshalJSON(data, &applyPatchCallOutputItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: BaseInputsUnion1TypeApplyPatchCallOutputItem, + Value: &applyPatchCallOutputItem, + }) + } + if len(candidates) == 0 { return fmt.Errorf("could not unmarshal `%s` into any supported union types for BaseInputsUnion1", string(data)) } @@ -891,6 +967,18 @@ func (u *BaseInputsUnion1) UnmarshalJSON(data []byte) error { case BaseInputsUnion1TypeOutputMessage: u.OutputMessage = best.Value.(*OutputMessage) return nil + case BaseInputsUnion1TypeOpenAIResponseCustomToolCall: + u.OpenAIResponseCustomToolCall = best.Value.(*OpenAIResponseCustomToolCall) + return nil + case BaseInputsUnion1TypeOpenAIResponseCustomToolCallOutput: + u.OpenAIResponseCustomToolCallOutput = best.Value.(*OpenAIResponseCustomToolCallOutput) + return nil + case BaseInputsUnion1TypeApplyPatchCallItem: + u.ApplyPatchCallItem = best.Value.(*ApplyPatchCallItem) + return nil + case BaseInputsUnion1TypeApplyPatchCallOutputItem: + u.ApplyPatchCallOutputItem = best.Value.(*ApplyPatchCallOutputItem) + return nil } return fmt.Errorf("could not unmarshal `%s` into any supported union types for BaseInputsUnion1", string(data)) @@ -921,6 +1009,22 @@ func (u BaseInputsUnion1) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.OutputMessage, "", true) } + if u.OpenAIResponseCustomToolCall != nil { + return utils.MarshalJSON(u.OpenAIResponseCustomToolCall, "", true) + } + + if u.OpenAIResponseCustomToolCallOutput != nil { + return utils.MarshalJSON(u.OpenAIResponseCustomToolCallOutput, "", true) + } + + if u.ApplyPatchCallItem != nil { + return utils.MarshalJSON(u.ApplyPatchCallItem, "", true) + } + + if u.ApplyPatchCallOutputItem != nil { + return utils.MarshalJSON(u.ApplyPatchCallOutputItem, "", true) + } + return nil, errors.New("could not marshal union type BaseInputsUnion1: all fields are null") } diff --git a/models/components/bashservertool.go b/models/components/bashservertool.go new file mode 100644 index 00000000..93b9aed4 --- /dev/null +++ b/models/components/bashservertool.go @@ -0,0 +1,64 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type BashServerToolType string + +const ( + BashServerToolTypeOpenrouterBash BashServerToolType = "openrouter:bash" +) + +func (e BashServerToolType) ToPointer() *BashServerToolType { + return &e +} +func (e *BashServerToolType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "openrouter:bash": + *e = BashServerToolType(v) + return nil + default: + return fmt.Errorf("invalid value for BashServerToolType: %v", v) + } +} + +// BashServerTool - OpenRouter built-in server tool: runs shell commands server-side in a sandboxed container +type BashServerTool struct { + // Configuration for the openrouter:bash server tool + Parameters *BashServerToolConfig `json:"parameters,omitzero"` + Type BashServerToolType `json:"type"` +} + +func (b BashServerTool) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(b, "", false) +} + +func (b *BashServerTool) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &b, "", false, nil); err != nil { + return err + } + return nil +} + +func (b *BashServerTool) GetParameters() *BashServerToolConfig { + if b == nil { + return nil + } + return b.Parameters +} + +func (b *BashServerTool) GetType() BashServerToolType { + if b == nil { + return BashServerToolType("") + } + return b.Type +} diff --git a/models/components/bashservertoolconfig.go b/models/components/bashservertoolconfig.go new file mode 100644 index 00000000..8fafac1e --- /dev/null +++ b/models/components/bashservertoolconfig.go @@ -0,0 +1,63 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// BashServerToolConfig - Configuration for the openrouter:bash server tool +type BashServerToolConfig struct { + // Which bash engine to use. "openrouter" runs commands server-side in the OpenRouter sandbox. "auto" (default) and "native" use native passthrough, returning the tool call to your application to run client-side; OpenRouter does not execute the commands. + Engine *BashServerToolEngine `json:"engine,omitzero"` + // Execution environment for the bash server tool. + Environment *BashServerToolEnvironment `json:"environment,omitzero"` + // How long (in seconds) the container stays warm after its last command before sleeping, freeing its capacity slot. Idle-based: each command renews the timer. Defaults to 900 (15 minutes); capped at 2592000 (30 days). + SleepAfterSeconds *int64 `json:"sleep_after_seconds,omitzero"` +} + +func (b BashServerToolConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(b, "", false) +} + +func (b *BashServerToolConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &b, "", false, nil); err != nil { + return err + } + return nil +} + +func (b *BashServerToolConfig) GetEngine() *BashServerToolEngine { + if b == nil { + return nil + } + return b.Engine +} + +func (b *BashServerToolConfig) GetEnvironment() *BashServerToolEnvironment { + if b == nil { + return nil + } + return b.Environment +} + +func (b *BashServerToolConfig) GetEnvironmentContainerAuto() *ContainerAutoEnvironment { + if v := b.GetEnvironment(); v != nil { + return v.ContainerAutoEnvironment + } + return nil +} + +func (b *BashServerToolConfig) GetEnvironmentContainerReference() *ContainerReferenceEnvironment { + if v := b.GetEnvironment(); v != nil { + return v.ContainerReferenceEnvironment + } + return nil +} + +func (b *BashServerToolConfig) GetSleepAfterSeconds() *int64 { + if b == nil { + return nil + } + return b.SleepAfterSeconds +} diff --git a/models/components/bashservertoolengine.go b/models/components/bashservertoolengine.go new file mode 100644 index 00000000..779b5ccb --- /dev/null +++ b/models/components/bashservertoolengine.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// BashServerToolEngine - Which bash engine to use. "openrouter" runs commands server-side in the OpenRouter sandbox. "auto" (default) and "native" use native passthrough, returning the tool call to your application to run client-side; OpenRouter does not execute the commands. +type BashServerToolEngine string + +const ( + BashServerToolEngineAuto BashServerToolEngine = "auto" + BashServerToolEngineNative BashServerToolEngine = "native" + BashServerToolEngineOpenrouter BashServerToolEngine = "openrouter" +) + +func (e BashServerToolEngine) ToPointer() *BashServerToolEngine { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *BashServerToolEngine) IsExact() bool { + if e != nil { + switch *e { + case "auto", "native", "openrouter": + return true + } + } + return false +} diff --git a/models/components/bashservertoolenvironment.go b/models/components/bashservertoolenvironment.go new file mode 100644 index 00000000..8620c160 --- /dev/null +++ b/models/components/bashservertoolenvironment.go @@ -0,0 +1,96 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "errors" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type BashServerToolEnvironmentType string + +const ( + BashServerToolEnvironmentTypeContainerAuto BashServerToolEnvironmentType = "container_auto" + BashServerToolEnvironmentTypeContainerReference BashServerToolEnvironmentType = "container_reference" +) + +// BashServerToolEnvironment - Execution environment for the bash server tool. +type BashServerToolEnvironment struct { + ContainerAutoEnvironment *ContainerAutoEnvironment `queryParam:"inline" union:"member"` + ContainerReferenceEnvironment *ContainerReferenceEnvironment `queryParam:"inline" union:"member"` + + Type BashServerToolEnvironmentType +} + +func CreateBashServerToolEnvironmentContainerAuto(containerAuto ContainerAutoEnvironment) BashServerToolEnvironment { + typ := BashServerToolEnvironmentTypeContainerAuto + + typStr := ContainerAutoEnvironmentType(typ) + containerAuto.Type = typStr + + return BashServerToolEnvironment{ + ContainerAutoEnvironment: &containerAuto, + Type: typ, + } +} + +func CreateBashServerToolEnvironmentContainerReference(containerReference ContainerReferenceEnvironment) BashServerToolEnvironment { + typ := BashServerToolEnvironmentTypeContainerReference + + typStr := ContainerReferenceEnvironmentType(typ) + containerReference.Type = typStr + + return BashServerToolEnvironment{ + ContainerReferenceEnvironment: &containerReference, + Type: typ, + } +} + +func (u *BashServerToolEnvironment) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + return fmt.Errorf("could not unmarshal discriminator: %w", err) + } + + switch dis.Type { + case "container_auto": + containerAutoEnvironment := new(ContainerAutoEnvironment) + if err := utils.UnmarshalJSON(data, &containerAutoEnvironment, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == container_auto) type ContainerAutoEnvironment within BashServerToolEnvironment: %w", string(data), err) + } + + u.ContainerAutoEnvironment = containerAutoEnvironment + u.Type = BashServerToolEnvironmentTypeContainerAuto + return nil + case "container_reference": + containerReferenceEnvironment := new(ContainerReferenceEnvironment) + if err := utils.UnmarshalJSON(data, &containerReferenceEnvironment, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == container_reference) type ContainerReferenceEnvironment within BashServerToolEnvironment: %w", string(data), err) + } + + u.ContainerReferenceEnvironment = containerReferenceEnvironment + u.Type = BashServerToolEnvironmentTypeContainerReference + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for BashServerToolEnvironment", string(data)) +} + +func (u BashServerToolEnvironment) MarshalJSON() ([]byte, error) { + if u.ContainerAutoEnvironment != nil { + return utils.MarshalJSON(u.ContainerAutoEnvironment, "", true) + } + + if u.ContainerReferenceEnvironment != nil { + return utils.MarshalJSON(u.ContainerReferenceEnvironment, "", true) + } + + return nil, errors.New("could not marshal union type BashServerToolEnvironment: all fields are null") +} diff --git a/models/components/benchmarkpricing.go b/models/components/benchmarkpricing.go new file mode 100644 index 00000000..c09eb349 --- /dev/null +++ b/models/components/benchmarkpricing.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// BenchmarkPricing - OpenRouter pricing per token for this model. Null if pricing is unavailable. +type BenchmarkPricing struct { + // Cost per output token (USD, decimal string). + Completion string `json:"completion"` + // Cost per input token (USD, decimal string). + Prompt string `json:"prompt"` +} + +func (b *BenchmarkPricing) GetCompletion() string { + if b == nil { + return "" + } + return b.Completion +} + +func (b *BenchmarkPricing) GetPrompt() string { + if b == nil { + return "" + } + return b.Prompt +} diff --git a/models/components/benchmarksaaitem.go b/models/components/benchmarksaaitem.go new file mode 100644 index 00000000..0f7a7894 --- /dev/null +++ b/models/components/benchmarksaaitem.go @@ -0,0 +1,60 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type BenchmarksAAItem struct { + // Model name as listed on Artificial Analysis. + AaName string `json:"aa_name"` + // Artificial Analysis Agentic Index composite score. Higher is better. + AgenticIndex *float64 `json:"agentic_index"` + // Artificial Analysis Coding Index composite score. Higher is better. + CodingIndex *float64 `json:"coding_index"` + // Artificial Analysis Intelligence Index composite score. Higher is better. + IntelligenceIndex *float64 `json:"intelligence_index"` + // Stable OpenRouter model identifier. + ModelPermaslug string `json:"model_permaslug"` + // OpenRouter pricing per token for this model. Null if pricing is unavailable. + Pricing *BenchmarkPricing `json:"pricing"` +} + +func (b *BenchmarksAAItem) GetAaName() string { + if b == nil { + return "" + } + return b.AaName +} + +func (b *BenchmarksAAItem) GetAgenticIndex() *float64 { + if b == nil { + return nil + } + return b.AgenticIndex +} + +func (b *BenchmarksAAItem) GetCodingIndex() *float64 { + if b == nil { + return nil + } + return b.CodingIndex +} + +func (b *BenchmarksAAItem) GetIntelligenceIndex() *float64 { + if b == nil { + return nil + } + return b.IntelligenceIndex +} + +func (b *BenchmarksAAItem) GetModelPermaslug() string { + if b == nil { + return "" + } + return b.ModelPermaslug +} + +func (b *BenchmarksAAItem) GetPricing() *BenchmarkPricing { + if b == nil { + return nil + } + return b.Pricing +} diff --git a/models/components/benchmarksaameta.go b/models/components/benchmarksaameta.go new file mode 100644 index 00000000..a719dc06 --- /dev/null +++ b/models/components/benchmarksaameta.go @@ -0,0 +1,137 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// BenchmarksAAMetaSource - Data source identifier. +type BenchmarksAAMetaSource string + +const ( + BenchmarksAAMetaSourceArtificialAnalysis BenchmarksAAMetaSource = "artificial-analysis" +) + +func (e BenchmarksAAMetaSource) ToPointer() *BenchmarksAAMetaSource { + return &e +} +func (e *BenchmarksAAMetaSource) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "artificial-analysis": + *e = BenchmarksAAMetaSource(v) + return nil + default: + return fmt.Errorf("invalid value for BenchmarksAAMetaSource: %v", v) + } +} + +// BenchmarksAAMetaSourceURL - URL of the upstream data source. +type BenchmarksAAMetaSourceURL string + +const ( + BenchmarksAAMetaSourceURLHTTPSArtificialanalysisAi BenchmarksAAMetaSourceURL = "https://artificialanalysis.ai" +) + +func (e BenchmarksAAMetaSourceURL) ToPointer() *BenchmarksAAMetaSourceURL { + return &e +} +func (e *BenchmarksAAMetaSourceURL) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "https://artificialanalysis.ai": + *e = BenchmarksAAMetaSourceURL(v) + return nil + default: + return fmt.Errorf("invalid value for BenchmarksAAMetaSourceURL: %v", v) + } +} + +// BenchmarksAAMetaVersion - Dataset version. +type BenchmarksAAMetaVersion string + +const ( + BenchmarksAAMetaVersionV1 BenchmarksAAMetaVersion = "v1" +) + +func (e BenchmarksAAMetaVersion) ToPointer() *BenchmarksAAMetaVersion { + return &e +} +func (e *BenchmarksAAMetaVersion) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "v1": + *e = BenchmarksAAMetaVersion(v) + return nil + default: + return fmt.Errorf("invalid value for BenchmarksAAMetaVersion: %v", v) + } +} + +type BenchmarksAAMeta struct { + // ISO-8601 timestamp of when this data was last updated. + AsOf string `json:"as_of"` + // Required attribution when republishing this data. + Citation string `json:"citation"` + // Number of unique models in the response. + ModelCount int64 `json:"model_count"` + // Data source identifier. + Source BenchmarksAAMetaSource `json:"source"` + // URL of the upstream data source. + SourceURL BenchmarksAAMetaSourceURL `json:"source_url"` + // Dataset version. + Version BenchmarksAAMetaVersion `json:"version"` +} + +func (b *BenchmarksAAMeta) GetAsOf() string { + if b == nil { + return "" + } + return b.AsOf +} + +func (b *BenchmarksAAMeta) GetCitation() string { + if b == nil { + return "" + } + return b.Citation +} + +func (b *BenchmarksAAMeta) GetModelCount() int64 { + if b == nil { + return 0 + } + return b.ModelCount +} + +func (b *BenchmarksAAMeta) GetSource() BenchmarksAAMetaSource { + if b == nil { + return BenchmarksAAMetaSource("") + } + return b.Source +} + +func (b *BenchmarksAAMeta) GetSourceURL() BenchmarksAAMetaSourceURL { + if b == nil { + return BenchmarksAAMetaSourceURL("") + } + return b.SourceURL +} + +func (b *BenchmarksAAMeta) GetVersion() BenchmarksAAMetaVersion { + if b == nil { + return BenchmarksAAMetaVersion("") + } + return b.Version +} diff --git a/models/components/benchmarksaaresponse.go b/models/components/benchmarksaaresponse.go new file mode 100644 index 00000000..2ee03e3b --- /dev/null +++ b/models/components/benchmarksaaresponse.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type BenchmarksAAResponse struct { + Data []BenchmarksAAItem `json:"data"` + Meta BenchmarksAAMeta `json:"meta"` +} + +func (b *BenchmarksAAResponse) GetData() []BenchmarksAAItem { + if b == nil { + return []BenchmarksAAItem{} + } + return b.Data +} + +func (b *BenchmarksAAResponse) GetMeta() BenchmarksAAMeta { + if b == nil { + return BenchmarksAAMeta{} + } + return b.Meta +} diff --git a/models/components/benchmarksdaitem.go b/models/components/benchmarksdaitem.go new file mode 100644 index 00000000..fea8647b --- /dev/null +++ b/models/components/benchmarksdaitem.go @@ -0,0 +1,131 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// TournamentStats - Placement distribution from tournament matches. +type TournamentStats struct { + FirstPlace *int64 `json:"first_place"` + FourthPlace *int64 `json:"fourth_place"` + SecondPlace *int64 `json:"second_place"` + ThirdPlace *int64 `json:"third_place"` + Total *int64 `json:"total"` +} + +func (t *TournamentStats) GetFirstPlace() *int64 { + if t == nil { + return nil + } + return t.FirstPlace +} + +func (t *TournamentStats) GetFourthPlace() *int64 { + if t == nil { + return nil + } + return t.FourthPlace +} + +func (t *TournamentStats) GetSecondPlace() *int64 { + if t == nil { + return nil + } + return t.SecondPlace +} + +func (t *TournamentStats) GetThirdPlace() *int64 { + if t == nil { + return nil + } + return t.ThirdPlace +} + +func (t *TournamentStats) GetTotal() *int64 { + if t == nil { + return nil + } + return t.Total +} + +type BenchmarksDAItem struct { + // Arena this ranking belongs to. + Arena string `json:"arena"` + // Average generation time in milliseconds. + AvgGenerationTimeMs *float64 `json:"avg_generation_time_ms"` + // Category within the arena. + Category string `json:"category"` + // Human-readable model name from Design Arena. + DisplayName string `json:"display_name"` + // ELO rating from head-to-head arena battles. + Elo float64 `json:"elo"` + // Stable OpenRouter model identifier when the model is on OpenRouter; otherwise the upstream Design Arena model id. Use pricing != null to detect OpenRouter-mapped models. + ModelPermaslug string `json:"model_permaslug"` + // OpenRouter pricing per token for this model. Null if pricing is unavailable. + Pricing *BenchmarkPricing `json:"pricing"` + // Placement distribution from tournament matches. + TournamentStats TournamentStats `json:"tournament_stats"` + // Win rate as a percentage (0–100). + WinRate float64 `json:"win_rate"` +} + +func (b *BenchmarksDAItem) GetArena() string { + if b == nil { + return "" + } + return b.Arena +} + +func (b *BenchmarksDAItem) GetAvgGenerationTimeMs() *float64 { + if b == nil { + return nil + } + return b.AvgGenerationTimeMs +} + +func (b *BenchmarksDAItem) GetCategory() string { + if b == nil { + return "" + } + return b.Category +} + +func (b *BenchmarksDAItem) GetDisplayName() string { + if b == nil { + return "" + } + return b.DisplayName +} + +func (b *BenchmarksDAItem) GetElo() float64 { + if b == nil { + return 0.0 + } + return b.Elo +} + +func (b *BenchmarksDAItem) GetModelPermaslug() string { + if b == nil { + return "" + } + return b.ModelPermaslug +} + +func (b *BenchmarksDAItem) GetPricing() *BenchmarkPricing { + if b == nil { + return nil + } + return b.Pricing +} + +func (b *BenchmarksDAItem) GetTournamentStats() TournamentStats { + if b == nil { + return TournamentStats{} + } + return b.TournamentStats +} + +func (b *BenchmarksDAItem) GetWinRate() float64 { + if b == nil { + return 0.0 + } + return b.WinRate +} diff --git a/models/components/benchmarksdameta.go b/models/components/benchmarksdameta.go new file mode 100644 index 00000000..f0e46228 --- /dev/null +++ b/models/components/benchmarksdameta.go @@ -0,0 +1,186 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// EloBounds - ELO range across all returned models for normalization. +type EloBounds struct { + // Maximum ELO in the result set. + Max float64 `json:"max"` + // Minimum ELO in the result set. + Min float64 `json:"min"` +} + +func (e *EloBounds) GetMax() float64 { + if e == nil { + return 0.0 + } + return e.Max +} + +func (e *EloBounds) GetMin() float64 { + if e == nil { + return 0.0 + } + return e.Min +} + +// BenchmarksDAMetaSource - Data source identifier. +type BenchmarksDAMetaSource string + +const ( + BenchmarksDAMetaSourceDesignArena BenchmarksDAMetaSource = "design-arena" +) + +func (e BenchmarksDAMetaSource) ToPointer() *BenchmarksDAMetaSource { + return &e +} +func (e *BenchmarksDAMetaSource) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "design-arena": + *e = BenchmarksDAMetaSource(v) + return nil + default: + return fmt.Errorf("invalid value for BenchmarksDAMetaSource: %v", v) + } +} + +// BenchmarksDAMetaSourceURL - URL of the upstream data source. +type BenchmarksDAMetaSourceURL string + +const ( + BenchmarksDAMetaSourceURLHTTPSWwwDesignarenaAi BenchmarksDAMetaSourceURL = "https://www.designarena.ai" +) + +func (e BenchmarksDAMetaSourceURL) ToPointer() *BenchmarksDAMetaSourceURL { + return &e +} +func (e *BenchmarksDAMetaSourceURL) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "https://www.designarena.ai": + *e = BenchmarksDAMetaSourceURL(v) + return nil + default: + return fmt.Errorf("invalid value for BenchmarksDAMetaSourceURL: %v", v) + } +} + +// BenchmarksDAMetaVersion - Dataset version. +type BenchmarksDAMetaVersion string + +const ( + BenchmarksDAMetaVersionV1 BenchmarksDAMetaVersion = "v1" +) + +func (e BenchmarksDAMetaVersion) ToPointer() *BenchmarksDAMetaVersion { + return &e +} +func (e *BenchmarksDAMetaVersion) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "v1": + *e = BenchmarksDAMetaVersion(v) + return nil + default: + return fmt.Errorf("invalid value for BenchmarksDAMetaVersion: %v", v) + } +} + +type BenchmarksDAMeta struct { + // The arena filter applied. + Arena string `json:"arena"` + // ISO-8601 timestamp of when this data was generated. + AsOf string `json:"as_of"` + // The category filter applied, or null if showing all. + Category *string `json:"category"` + // Required attribution when republishing this data. + Citation string `json:"citation"` + // ELO range across all returned models for normalization. + EloBounds EloBounds `json:"elo_bounds"` + // Number of unique models in the response. + ModelCount int64 `json:"model_count"` + // Data source identifier. + Source BenchmarksDAMetaSource `json:"source"` + // URL of the upstream data source. + SourceURL BenchmarksDAMetaSourceURL `json:"source_url"` + // Dataset version. + Version BenchmarksDAMetaVersion `json:"version"` +} + +func (b *BenchmarksDAMeta) GetArena() string { + if b == nil { + return "" + } + return b.Arena +} + +func (b *BenchmarksDAMeta) GetAsOf() string { + if b == nil { + return "" + } + return b.AsOf +} + +func (b *BenchmarksDAMeta) GetCategory() *string { + if b == nil { + return nil + } + return b.Category +} + +func (b *BenchmarksDAMeta) GetCitation() string { + if b == nil { + return "" + } + return b.Citation +} + +func (b *BenchmarksDAMeta) GetEloBounds() EloBounds { + if b == nil { + return EloBounds{} + } + return b.EloBounds +} + +func (b *BenchmarksDAMeta) GetModelCount() int64 { + if b == nil { + return 0 + } + return b.ModelCount +} + +func (b *BenchmarksDAMeta) GetSource() BenchmarksDAMetaSource { + if b == nil { + return BenchmarksDAMetaSource("") + } + return b.Source +} + +func (b *BenchmarksDAMeta) GetSourceURL() BenchmarksDAMetaSourceURL { + if b == nil { + return BenchmarksDAMetaSourceURL("") + } + return b.SourceURL +} + +func (b *BenchmarksDAMeta) GetVersion() BenchmarksDAMetaVersion { + if b == nil { + return BenchmarksDAMetaVersion("") + } + return b.Version +} diff --git a/models/components/benchmarksdaresponse.go b/models/components/benchmarksdaresponse.go new file mode 100644 index 00000000..253dfea7 --- /dev/null +++ b/models/components/benchmarksdaresponse.go @@ -0,0 +1,22 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type BenchmarksDAResponse struct { + Data []BenchmarksDAItem `json:"data"` + Meta BenchmarksDAMeta `json:"meta"` +} + +func (b *BenchmarksDAResponse) GetData() []BenchmarksDAItem { + if b == nil { + return []BenchmarksDAItem{} + } + return b.Data +} + +func (b *BenchmarksDAResponse) GetMeta() BenchmarksDAMeta { + if b == nil { + return BenchmarksDAMeta{} + } + return b.Meta +} diff --git a/models/components/byokkey.go b/models/components/byokkey.go new file mode 100644 index 00000000..fe179d52 --- /dev/null +++ b/models/components/byokkey.go @@ -0,0 +1,118 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type BYOKKey struct { + // Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) that may use this credential. `null` means no restriction. + AllowedAPIKeyHashes []string `json:"allowed_api_key_hashes"` + // Optional allowlist of model slugs this credential may be used for. `null` means no restriction. + AllowedModels []string `json:"allowed_models"` + // Optional allowlist of user IDs that may use this credential. `null` means no restriction. + AllowedUserIds []string `json:"allowed_user_ids"` + // ISO timestamp of when the credential was created. + CreatedAt string `json:"created_at"` + // Whether this credential is currently disabled. + Disabled bool `json:"disabled"` + // Stable public identifier for this BYOK credential. + ID string `json:"id"` + // Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried. + IsFallback bool `json:"is_fallback"` + // Short masked snippet of the key (e.g. the first/last few characters) used to identify it in the UI. + Label string `json:"label"` + // Optional human-readable name for the credential. + Name optionalnullable.OptionalNullable[string] `json:"name,omitzero"` + // The upstream provider this credential authenticates against, as a lowercase slug (e.g. `openai`, `anthropic`, `amazon-bedrock`). + Provider BYOKProviderSlug `json:"provider"` + // Position within the provider — credentials are tried in ascending sort order. + SortOrder int64 `json:"sort_order"` + // ID of the workspace this credential belongs to. + WorkspaceID string `json:"workspace_id"` +} + +func (b *BYOKKey) GetAllowedAPIKeyHashes() []string { + if b == nil { + return nil + } + return b.AllowedAPIKeyHashes +} + +func (b *BYOKKey) GetAllowedModels() []string { + if b == nil { + return nil + } + return b.AllowedModels +} + +func (b *BYOKKey) GetAllowedUserIds() []string { + if b == nil { + return nil + } + return b.AllowedUserIds +} + +func (b *BYOKKey) GetCreatedAt() string { + if b == nil { + return "" + } + return b.CreatedAt +} + +func (b *BYOKKey) GetDisabled() bool { + if b == nil { + return false + } + return b.Disabled +} + +func (b *BYOKKey) GetID() string { + if b == nil { + return "" + } + return b.ID +} + +func (b *BYOKKey) GetIsFallback() bool { + if b == nil { + return false + } + return b.IsFallback +} + +func (b *BYOKKey) GetLabel() string { + if b == nil { + return "" + } + return b.Label +} + +func (b *BYOKKey) GetName() optionalnullable.OptionalNullable[string] { + if b == nil { + return nil + } + return b.Name +} + +func (b *BYOKKey) GetProvider() BYOKProviderSlug { + if b == nil { + return BYOKProviderSlug("") + } + return b.Provider +} + +func (b *BYOKKey) GetSortOrder() int64 { + if b == nil { + return 0 + } + return b.SortOrder +} + +func (b *BYOKKey) GetWorkspaceID() string { + if b == nil { + return "" + } + return b.WorkspaceID +} diff --git a/models/components/byokproviderslug.go b/models/components/byokproviderslug.go new file mode 100644 index 00000000..189516f7 --- /dev/null +++ b/models/components/byokproviderslug.go @@ -0,0 +1,107 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// BYOKProviderSlug - The upstream provider this credential authenticates against, as a lowercase slug (e.g. `openai`, `anthropic`, `amazon-bedrock`). +type BYOKProviderSlug string + +const ( + BYOKProviderSlugAi21 BYOKProviderSlug = "ai21" + BYOKProviderSlugAionLabs BYOKProviderSlug = "aion-labs" + BYOKProviderSlugAkashml BYOKProviderSlug = "akashml" + BYOKProviderSlugAlibaba BYOKProviderSlug = "alibaba" + BYOKProviderSlugAmazonBedrock BYOKProviderSlug = "amazon-bedrock" + BYOKProviderSlugAmazonNova BYOKProviderSlug = "amazon-nova" + BYOKProviderSlugAmbient BYOKProviderSlug = "ambient" + BYOKProviderSlugAnthropic BYOKProviderSlug = "anthropic" + BYOKProviderSlugArceeAi BYOKProviderSlug = "arcee-ai" + BYOKProviderSlugAtlasCloud BYOKProviderSlug = "atlas-cloud" + BYOKProviderSlugAvian BYOKProviderSlug = "avian" + BYOKProviderSlugAzure BYOKProviderSlug = "azure" + BYOKProviderSlugBaidu BYOKProviderSlug = "baidu" + BYOKProviderSlugBaseten BYOKProviderSlug = "baseten" + BYOKProviderSlugBlackForestLabs BYOKProviderSlug = "black-forest-labs" + BYOKProviderSlugByteplus BYOKProviderSlug = "byteplus" + BYOKProviderSlugCerebras BYOKProviderSlug = "cerebras" + BYOKProviderSlugChutes BYOKProviderSlug = "chutes" + BYOKProviderSlugCirrascale BYOKProviderSlug = "cirrascale" + BYOKProviderSlugClarifai BYOKProviderSlug = "clarifai" + BYOKProviderSlugCloudflare BYOKProviderSlug = "cloudflare" + BYOKProviderSlugCohere BYOKProviderSlug = "cohere" + BYOKProviderSlugCrusoe BYOKProviderSlug = "crusoe" + BYOKProviderSlugDarkbloom BYOKProviderSlug = "darkbloom" + BYOKProviderSlugDecart BYOKProviderSlug = "decart" + BYOKProviderSlugDeepinfra BYOKProviderSlug = "deepinfra" + BYOKProviderSlugDeepseek BYOKProviderSlug = "deepseek" + BYOKProviderSlugDekallm BYOKProviderSlug = "dekallm" + BYOKProviderSlugDigitalocean BYOKProviderSlug = "digitalocean" + BYOKProviderSlugFeatherless BYOKProviderSlug = "featherless" + BYOKProviderSlugFireworks BYOKProviderSlug = "fireworks" + BYOKProviderSlugFriendli BYOKProviderSlug = "friendli" + BYOKProviderSlugGmicloud BYOKProviderSlug = "gmicloud" + BYOKProviderSlugGoogleAiStudio BYOKProviderSlug = "google-ai-studio" + BYOKProviderSlugGoogleVertex BYOKProviderSlug = "google-vertex" + BYOKProviderSlugGroq BYOKProviderSlug = "groq" + BYOKProviderSlugInception BYOKProviderSlug = "inception" + BYOKProviderSlugInceptron BYOKProviderSlug = "inceptron" + BYOKProviderSlugInferenceNet BYOKProviderSlug = "inference-net" + BYOKProviderSlugInfermatic BYOKProviderSlug = "infermatic" + BYOKProviderSlugInflection BYOKProviderSlug = "inflection" + BYOKProviderSlugIoNet BYOKProviderSlug = "io-net" + BYOKProviderSlugIonstream BYOKProviderSlug = "ionstream" + BYOKProviderSlugLiquid BYOKProviderSlug = "liquid" + BYOKProviderSlugMancer BYOKProviderSlug = "mancer" + BYOKProviderSlugMara BYOKProviderSlug = "mara" + BYOKProviderSlugMinimax BYOKProviderSlug = "minimax" + BYOKProviderSlugMistral BYOKProviderSlug = "mistral" + BYOKProviderSlugModelrun BYOKProviderSlug = "modelrun" + BYOKProviderSlugModular BYOKProviderSlug = "modular" + BYOKProviderSlugMoonshotai BYOKProviderSlug = "moonshotai" + BYOKProviderSlugMorph BYOKProviderSlug = "morph" + BYOKProviderSlugNcompass BYOKProviderSlug = "ncompass" + BYOKProviderSlugNebius BYOKProviderSlug = "nebius" + BYOKProviderSlugNexAgi BYOKProviderSlug = "nex-agi" + BYOKProviderSlugNextbit BYOKProviderSlug = "nextbit" + BYOKProviderSlugNovita BYOKProviderSlug = "novita" + BYOKProviderSlugNvidia BYOKProviderSlug = "nvidia" + BYOKProviderSlugOpenInference BYOKProviderSlug = "open-inference" + BYOKProviderSlugOpenai BYOKProviderSlug = "openai" + BYOKProviderSlugParasail BYOKProviderSlug = "parasail" + BYOKProviderSlugPerceptron BYOKProviderSlug = "perceptron" + BYOKProviderSlugPerplexity BYOKProviderSlug = "perplexity" + BYOKProviderSlugPhala BYOKProviderSlug = "phala" + BYOKProviderSlugPoolside BYOKProviderSlug = "poolside" + BYOKProviderSlugRecraft BYOKProviderSlug = "recraft" + BYOKProviderSlugReka BYOKProviderSlug = "reka" + BYOKProviderSlugRelace BYOKProviderSlug = "relace" + BYOKProviderSlugSambanova BYOKProviderSlug = "sambanova" + BYOKProviderSlugSeed BYOKProviderSlug = "seed" + BYOKProviderSlugSiliconflow BYOKProviderSlug = "siliconflow" + BYOKProviderSlugSourceful BYOKProviderSlug = "sourceful" + BYOKProviderSlugStepfun BYOKProviderSlug = "stepfun" + BYOKProviderSlugStreamlake BYOKProviderSlug = "streamlake" + BYOKProviderSlugSwitchpoint BYOKProviderSlug = "switchpoint" + BYOKProviderSlugTogether BYOKProviderSlug = "together" + BYOKProviderSlugUpstage BYOKProviderSlug = "upstage" + BYOKProviderSlugVenice BYOKProviderSlug = "venice" + BYOKProviderSlugWafer BYOKProviderSlug = "wafer" + BYOKProviderSlugWandb BYOKProviderSlug = "wandb" + BYOKProviderSlugXai BYOKProviderSlug = "xai" + BYOKProviderSlugXiaomi BYOKProviderSlug = "xiaomi" + BYOKProviderSlugZAi BYOKProviderSlug = "z-ai" +) + +func (e BYOKProviderSlug) ToPointer() *BYOKProviderSlug { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *BYOKProviderSlug) IsExact() bool { + if e != nil { + switch *e { + case "ai21", "aion-labs", "akashml", "alibaba", "amazon-bedrock", "amazon-nova", "ambient", "anthropic", "arcee-ai", "atlas-cloud", "avian", "azure", "baidu", "baseten", "black-forest-labs", "byteplus", "cerebras", "chutes", "cirrascale", "clarifai", "cloudflare", "cohere", "crusoe", "darkbloom", "decart", "deepinfra", "deepseek", "dekallm", "digitalocean", "featherless", "fireworks", "friendli", "gmicloud", "google-ai-studio", "google-vertex", "groq", "inception", "inceptron", "inference-net", "infermatic", "inflection", "io-net", "ionstream", "liquid", "mancer", "mara", "minimax", "mistral", "modelrun", "modular", "moonshotai", "morph", "ncompass", "nebius", "nex-agi", "nextbit", "novita", "nvidia", "open-inference", "openai", "parasail", "perceptron", "perplexity", "phala", "poolside", "recraft", "reka", "relace", "sambanova", "seed", "siliconflow", "sourceful", "stepfun", "streamlake", "switchpoint", "together", "upstage", "venice", "wafer", "wandb", "xai", "xiaomi", "z-ai": + return true + } + } + return false +} diff --git a/models/components/chatfunctiontool.go b/models/components/chatfunctiontool.go index a1d90110..2cbb2508 100644 --- a/models/components/chatfunctiontool.go +++ b/models/components/chatfunctiontool.go @@ -128,9 +128,13 @@ type ChatFunctionToolUnionType string const ( ChatFunctionToolUnionTypeChatFunctionToolFunction ChatFunctionToolUnionType = "ChatFunctionTool_Function" + ChatFunctionToolUnionTypeAdvisorServerToolOpenRouter ChatFunctionToolUnionType = "AdvisorServerTool_OpenRouter" + ChatFunctionToolUnionTypeBashServerTool ChatFunctionToolUnionType = "BashServerTool" ChatFunctionToolUnionTypeDatetimeServerTool ChatFunctionToolUnionType = "DatetimeServerTool" ChatFunctionToolUnionTypeImageGenerationServerToolOpenRouter ChatFunctionToolUnionType = "ImageGenerationServerTool_OpenRouter" ChatFunctionToolUnionTypeChatSearchModelsServerTool ChatFunctionToolUnionType = "ChatSearchModelsServerTool" + ChatFunctionToolUnionTypeSubagentServerToolOpenRouter ChatFunctionToolUnionType = "SubagentServerTool_OpenRouter" + ChatFunctionToolUnionTypeWebFetchServerTool ChatFunctionToolUnionType = "WebFetchServerTool" ChatFunctionToolUnionTypeOpenRouterWebSearchServerTool ChatFunctionToolUnionType = "OpenRouterWebSearchServerTool" ChatFunctionToolUnionTypeChatWebSearchShorthand ChatFunctionToolUnionType = "ChatWebSearchShorthand" ) @@ -138,9 +142,13 @@ const ( // ChatFunctionTool - Tool definition for function calling (regular function or OpenRouter built-in server tool) type ChatFunctionTool struct { ChatFunctionToolFunction *ChatFunctionToolFunction `queryParam:"inline" union:"member"` + AdvisorServerToolOpenRouter *AdvisorServerToolOpenRouter `queryParam:"inline" union:"member"` + BashServerTool *BashServerTool `queryParam:"inline" union:"member"` DatetimeServerTool *DatetimeServerTool `queryParam:"inline" union:"member"` ImageGenerationServerToolOpenRouter *ImageGenerationServerToolOpenRouter `queryParam:"inline" union:"member"` ChatSearchModelsServerTool *ChatSearchModelsServerTool `queryParam:"inline" union:"member"` + SubagentServerToolOpenRouter *SubagentServerToolOpenRouter `queryParam:"inline" union:"member"` + WebFetchServerTool *WebFetchServerTool `queryParam:"inline" union:"member"` OpenRouterWebSearchServerTool *OpenRouterWebSearchServerTool `queryParam:"inline" union:"member"` ChatWebSearchShorthand *ChatWebSearchShorthand `queryParam:"inline" union:"member"` @@ -156,6 +164,24 @@ func CreateChatFunctionToolChatFunctionToolFunction(chatFunctionToolFunction Cha } } +func CreateChatFunctionToolAdvisorServerToolOpenRouter(advisorServerToolOpenRouter AdvisorServerToolOpenRouter) ChatFunctionTool { + typ := ChatFunctionToolUnionTypeAdvisorServerToolOpenRouter + + return ChatFunctionTool{ + AdvisorServerToolOpenRouter: &advisorServerToolOpenRouter, + Type: typ, + } +} + +func CreateChatFunctionToolBashServerTool(bashServerTool BashServerTool) ChatFunctionTool { + typ := ChatFunctionToolUnionTypeBashServerTool + + return ChatFunctionTool{ + BashServerTool: &bashServerTool, + Type: typ, + } +} + func CreateChatFunctionToolDatetimeServerTool(datetimeServerTool DatetimeServerTool) ChatFunctionTool { typ := ChatFunctionToolUnionTypeDatetimeServerTool @@ -183,6 +209,24 @@ func CreateChatFunctionToolChatSearchModelsServerTool(chatSearchModelsServerTool } } +func CreateChatFunctionToolSubagentServerToolOpenRouter(subagentServerToolOpenRouter SubagentServerToolOpenRouter) ChatFunctionTool { + typ := ChatFunctionToolUnionTypeSubagentServerToolOpenRouter + + return ChatFunctionTool{ + SubagentServerToolOpenRouter: &subagentServerToolOpenRouter, + Type: typ, + } +} + +func CreateChatFunctionToolWebFetchServerTool(webFetchServerTool WebFetchServerTool) ChatFunctionTool { + typ := ChatFunctionToolUnionTypeWebFetchServerTool + + return ChatFunctionTool{ + WebFetchServerTool: &webFetchServerTool, + Type: typ, + } +} + func CreateChatFunctionToolOpenRouterWebSearchServerTool(openRouterWebSearchServerTool OpenRouterWebSearchServerTool) ChatFunctionTool { typ := ChatFunctionToolUnionTypeOpenRouterWebSearchServerTool @@ -214,6 +258,22 @@ func (u *ChatFunctionTool) UnmarshalJSON(data []byte) error { }) } + var advisorServerToolOpenRouter AdvisorServerToolOpenRouter = AdvisorServerToolOpenRouter{} + if err := utils.UnmarshalJSON(data, &advisorServerToolOpenRouter, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: ChatFunctionToolUnionTypeAdvisorServerToolOpenRouter, + Value: &advisorServerToolOpenRouter, + }) + } + + var bashServerTool BashServerTool = BashServerTool{} + if err := utils.UnmarshalJSON(data, &bashServerTool, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: ChatFunctionToolUnionTypeBashServerTool, + Value: &bashServerTool, + }) + } + var datetimeServerTool DatetimeServerTool = DatetimeServerTool{} if err := utils.UnmarshalJSON(data, &datetimeServerTool, "", true, nil); err == nil { candidates = append(candidates, utils.UnionCandidate{ @@ -238,6 +298,22 @@ func (u *ChatFunctionTool) UnmarshalJSON(data []byte) error { }) } + var subagentServerToolOpenRouter SubagentServerToolOpenRouter = SubagentServerToolOpenRouter{} + if err := utils.UnmarshalJSON(data, &subagentServerToolOpenRouter, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: ChatFunctionToolUnionTypeSubagentServerToolOpenRouter, + Value: &subagentServerToolOpenRouter, + }) + } + + var webFetchServerTool WebFetchServerTool = WebFetchServerTool{} + if err := utils.UnmarshalJSON(data, &webFetchServerTool, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: ChatFunctionToolUnionTypeWebFetchServerTool, + Value: &webFetchServerTool, + }) + } + var openRouterWebSearchServerTool OpenRouterWebSearchServerTool = OpenRouterWebSearchServerTool{} if err := utils.UnmarshalJSON(data, &openRouterWebSearchServerTool, "", true, nil); err == nil { candidates = append(candidates, utils.UnionCandidate{ @@ -270,6 +346,12 @@ func (u *ChatFunctionTool) UnmarshalJSON(data []byte) error { case ChatFunctionToolUnionTypeChatFunctionToolFunction: u.ChatFunctionToolFunction = best.Value.(*ChatFunctionToolFunction) return nil + case ChatFunctionToolUnionTypeAdvisorServerToolOpenRouter: + u.AdvisorServerToolOpenRouter = best.Value.(*AdvisorServerToolOpenRouter) + return nil + case ChatFunctionToolUnionTypeBashServerTool: + u.BashServerTool = best.Value.(*BashServerTool) + return nil case ChatFunctionToolUnionTypeDatetimeServerTool: u.DatetimeServerTool = best.Value.(*DatetimeServerTool) return nil @@ -279,6 +361,12 @@ func (u *ChatFunctionTool) UnmarshalJSON(data []byte) error { case ChatFunctionToolUnionTypeChatSearchModelsServerTool: u.ChatSearchModelsServerTool = best.Value.(*ChatSearchModelsServerTool) return nil + case ChatFunctionToolUnionTypeSubagentServerToolOpenRouter: + u.SubagentServerToolOpenRouter = best.Value.(*SubagentServerToolOpenRouter) + return nil + case ChatFunctionToolUnionTypeWebFetchServerTool: + u.WebFetchServerTool = best.Value.(*WebFetchServerTool) + return nil case ChatFunctionToolUnionTypeOpenRouterWebSearchServerTool: u.OpenRouterWebSearchServerTool = best.Value.(*OpenRouterWebSearchServerTool) return nil @@ -295,6 +383,14 @@ func (u ChatFunctionTool) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.ChatFunctionToolFunction, "", true) } + if u.AdvisorServerToolOpenRouter != nil { + return utils.MarshalJSON(u.AdvisorServerToolOpenRouter, "", true) + } + + if u.BashServerTool != nil { + return utils.MarshalJSON(u.BashServerTool, "", true) + } + if u.DatetimeServerTool != nil { return utils.MarshalJSON(u.DatetimeServerTool, "", true) } @@ -307,6 +403,14 @@ func (u ChatFunctionTool) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.ChatSearchModelsServerTool, "", true) } + if u.SubagentServerToolOpenRouter != nil { + return utils.MarshalJSON(u.SubagentServerToolOpenRouter, "", true) + } + + if u.WebFetchServerTool != nil { + return utils.MarshalJSON(u.WebFetchServerTool, "", true) + } + if u.OpenRouterWebSearchServerTool != nil { return utils.MarshalJSON(u.OpenRouterWebSearchServerTool, "", true) } diff --git a/models/components/chatrequest.go b/models/components/chatrequest.go index f03b2cb7..59fc6d48 100644 --- a/models/components/chatrequest.go +++ b/models/components/chatrequest.go @@ -39,20 +39,24 @@ const ( ChatRequestPluginTypeAutoRouter ChatRequestPluginType = "auto-router" ChatRequestPluginTypeContextCompression ChatRequestPluginType = "context-compression" ChatRequestPluginTypeFileParser ChatRequestPluginType = "file-parser" + ChatRequestPluginTypeFusion ChatRequestPluginType = "fusion" ChatRequestPluginTypeModeration ChatRequestPluginType = "moderation" ChatRequestPluginTypeParetoRouter ChatRequestPluginType = "pareto-router" ChatRequestPluginTypeResponseHealing ChatRequestPluginType = "response-healing" ChatRequestPluginTypeWeb ChatRequestPluginType = "web" + ChatRequestPluginTypeWebFetch ChatRequestPluginType = "web-fetch" ) type ChatRequestPlugin struct { AutoRouterPlugin *AutoRouterPlugin `queryParam:"inline" union:"member"` ModerationPlugin *ModerationPlugin `queryParam:"inline" union:"member"` WebSearchPlugin *WebSearchPlugin `queryParam:"inline" union:"member"` + WebFetchPlugin *WebFetchPlugin `queryParam:"inline" union:"member"` FileParserPlugin *FileParserPlugin `queryParam:"inline" union:"member"` ResponseHealingPlugin *ResponseHealingPlugin `queryParam:"inline" union:"member"` ContextCompressionPlugin *ContextCompressionPlugin `queryParam:"inline" union:"member"` ParetoRouterPlugin *ParetoRouterPlugin `queryParam:"inline" union:"member"` + FusionPlugin *FusionPlugin `queryParam:"inline" union:"member"` Type ChatRequestPluginType } @@ -93,6 +97,18 @@ func CreateChatRequestPluginFileParser(fileParser FileParserPlugin) ChatRequestP } } +func CreateChatRequestPluginFusion(fusion FusionPlugin) ChatRequestPlugin { + typ := ChatRequestPluginTypeFusion + + typStr := FusionPluginID(typ) + fusion.ID = typStr + + return ChatRequestPlugin{ + FusionPlugin: &fusion, + Type: typ, + } +} + func CreateChatRequestPluginModeration(moderation ModerationPlugin) ChatRequestPlugin { typ := ChatRequestPluginTypeModeration @@ -141,6 +157,18 @@ func CreateChatRequestPluginWeb(web WebSearchPlugin) ChatRequestPlugin { } } +func CreateChatRequestPluginWebFetch(webFetch WebFetchPlugin) ChatRequestPlugin { + typ := ChatRequestPluginTypeWebFetch + + typStr := WebFetchPluginID(typ) + webFetch.ID = typStr + + return ChatRequestPlugin{ + WebFetchPlugin: &webFetch, + Type: typ, + } +} + func (u *ChatRequestPlugin) UnmarshalJSON(data []byte) error { type discriminator struct { @@ -180,6 +208,15 @@ func (u *ChatRequestPlugin) UnmarshalJSON(data []byte) error { u.FileParserPlugin = fileParserPlugin u.Type = ChatRequestPluginTypeFileParser return nil + case "fusion": + fusionPlugin := new(FusionPlugin) + if err := utils.UnmarshalJSON(data, &fusionPlugin, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (ID == fusion) type FusionPlugin within ChatRequestPlugin: %w", string(data), err) + } + + u.FusionPlugin = fusionPlugin + u.Type = ChatRequestPluginTypeFusion + return nil case "moderation": moderationPlugin := new(ModerationPlugin) if err := utils.UnmarshalJSON(data, &moderationPlugin, "", true, nil); err != nil { @@ -216,6 +253,15 @@ func (u *ChatRequestPlugin) UnmarshalJSON(data []byte) error { u.WebSearchPlugin = webSearchPlugin u.Type = ChatRequestPluginTypeWeb return nil + case "web-fetch": + webFetchPlugin := new(WebFetchPlugin) + if err := utils.UnmarshalJSON(data, &webFetchPlugin, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (ID == web-fetch) type WebFetchPlugin within ChatRequestPlugin: %w", string(data), err) + } + + u.WebFetchPlugin = webFetchPlugin + u.Type = ChatRequestPluginTypeWebFetch + return nil } return fmt.Errorf("could not unmarshal `%s` into any supported union types for ChatRequestPlugin", string(data)) @@ -234,6 +280,10 @@ func (u ChatRequestPlugin) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.WebSearchPlugin, "", true) } + if u.WebFetchPlugin != nil { + return utils.MarshalJSON(u.WebFetchPlugin, "", true) + } + if u.FileParserPlugin != nil { return utils.MarshalJSON(u.FileParserPlugin, "", true) } @@ -250,27 +300,31 @@ func (u ChatRequestPlugin) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.ParetoRouterPlugin, "", true) } + if u.FusionPlugin != nil { + return utils.MarshalJSON(u.FusionPlugin, "", true) + } + return nil, errors.New("could not marshal union type ChatRequestPlugin: all fields are null") } -// Effort - Constrains effort on reasoning for reasoning models -type Effort string +// ChatRequestEffort - Constrains effort on reasoning for reasoning models +type ChatRequestEffort string const ( - EffortXhigh Effort = "xhigh" - EffortHigh Effort = "high" - EffortMedium Effort = "medium" - EffortLow Effort = "low" - EffortMinimal Effort = "minimal" - EffortNone Effort = "none" + ChatRequestEffortXhigh ChatRequestEffort = "xhigh" + ChatRequestEffortHigh ChatRequestEffort = "high" + ChatRequestEffortMedium ChatRequestEffort = "medium" + ChatRequestEffortLow ChatRequestEffort = "low" + ChatRequestEffortMinimal ChatRequestEffort = "minimal" + ChatRequestEffortNone ChatRequestEffort = "none" ) -func (e Effort) ToPointer() *Effort { +func (e ChatRequestEffort) ToPointer() *ChatRequestEffort { return &e } // IsExact returns true if the value matches a known enum value, false otherwise. -func (e *Effort) IsExact() bool { +func (e *ChatRequestEffort) IsExact() bool { if e != nil { switch *e { case "xhigh", "high", "medium", "low", "minimal", "none": @@ -280,25 +334,52 @@ func (e *Effort) IsExact() bool { return false } -// Reasoning - Configuration options for reasoning models -type Reasoning struct { +// ChatRequestReasoning - Configuration options for reasoning models +type ChatRequestReasoning struct { // Constrains effort on reasoning for reasoning models - Effort optionalnullable.OptionalNullable[Effort] `json:"effort,omitzero"` + Effort optionalnullable.OptionalNullable[ChatRequestEffort] `json:"effort,omitzero"` Summary optionalnullable.OptionalNullable[ChatReasoningSummaryVerbosityEnum] `json:"summary,omitzero"` } -func (r *Reasoning) GetEffort() optionalnullable.OptionalNullable[Effort] { - if r == nil { +func (c *ChatRequestReasoning) GetEffort() optionalnullable.OptionalNullable[ChatRequestEffort] { + if c == nil { return nil } - return r.Effort + return c.Effort } -func (r *Reasoning) GetSummary() optionalnullable.OptionalNullable[ChatReasoningSummaryVerbosityEnum] { - if r == nil { +func (c *ChatRequestReasoning) GetSummary() optionalnullable.OptionalNullable[ChatReasoningSummaryVerbosityEnum] { + if c == nil { return nil } - return r.Summary + return c.Summary +} + +// ChatRequestReasoningEffort - Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. +type ChatRequestReasoningEffort string + +const ( + ChatRequestReasoningEffortXhigh ChatRequestReasoningEffort = "xhigh" + ChatRequestReasoningEffortHigh ChatRequestReasoningEffort = "high" + ChatRequestReasoningEffortMedium ChatRequestReasoningEffort = "medium" + ChatRequestReasoningEffortLow ChatRequestReasoningEffort = "low" + ChatRequestReasoningEffortMinimal ChatRequestReasoningEffort = "minimal" + ChatRequestReasoningEffortNone ChatRequestReasoningEffort = "none" +) + +func (e ChatRequestReasoningEffort) ToPointer() *ChatRequestReasoningEffort { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ChatRequestReasoningEffort) IsExact() bool { + if e != nil { + switch *e { + case "xhigh", "high", "medium", "low", "minimal", "none": + return true + } + } + return false } type ResponseFormatType string @@ -612,6 +693,7 @@ func (u Stop) MarshalJSON() ([]byte, error) { // ChatRequest - Chat completion request parameters type ChatRequest struct { + // Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. CacheControl *AnthropicCacheControlDirective `json:"cache_control,omitzero"` // Debug options for inspecting request transformations (streaming only) Debug *ChatDebugOptions `json:"debug,omitzero"` @@ -631,6 +713,8 @@ type ChatRequest struct { Messages []ChatMessages `json:"messages"` // Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) Metadata map[string]string `json:"metadata,omitzero"` + // Minimum probability threshold relative to the most likely token. Tokens with probability below min_p * (probability of top token) are filtered out. Not all providers support this parameter. + MinP optionalnullable.OptionalNullable[float64] `json:"min_p,omitzero"` // Output modalities for the response. Supported values are "text", "image", and "audio". Modalities []Modality `json:"modalities,omitzero"` // Model to use for completion @@ -646,17 +730,23 @@ type ChatRequest struct { // When multiple model providers are available, optionally indicate your routing preference. Provider optionalnullable.OptionalNullable[ProviderPreferences] `json:"provider,omitzero"` // Configuration options for reasoning models - Reasoning *Reasoning `json:"reasoning,omitzero"` + Reasoning *ChatRequestReasoning `json:"reasoning,omitzero"` + // Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. + ReasoningEffort optionalnullable.OptionalNullable[ChatRequestReasoningEffort] `json:"reasoning_effort,omitzero"` + // Penalizes tokens based on how much they have already appeared in the text. A value of 1.0 means no penalty. Values above 1.0 penalize repeated tokens more strongly. Not all providers support this parameter. + RepetitionPenalty optionalnullable.OptionalNullable[float64] `json:"repetition_penalty,omitzero"` // Response format configuration ResponseFormat *ResponseFormat `json:"response_format,omitzero"` // Random seed for deterministic outputs Seed optionalnullable.OptionalNullable[int64] `json:"seed,omitzero"` // The service tier to use for processing this request. ServiceTier optionalnullable.OptionalNullable[ChatRequestServiceTier] `json:"service_tier,omitzero"` - // A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. + // A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. SessionID *string `json:"session_id,omitzero"` // Stop sequences (up to 4) Stop optionalnullable.OptionalNullable[Stop] `json:"stop,omitzero"` + // Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`. + StopServerToolsWhen []StopServerToolsWhenCondition `json:"stop_server_tools_when,omitzero"` // Enable streaming response Stream *bool `default:"false" json:"stream"` // Streaming configuration options @@ -667,6 +757,10 @@ type ChatRequest struct { ToolChoice *ChatToolChoice `json:"tool_choice,omitzero"` // Available tools for function calling Tools []ChatFunctionTool `json:"tools,omitzero"` + // Consider only tokens with "sufficiently high" probabilities based on the probability of the most likely token. Not all providers support this parameter. + TopA optionalnullable.OptionalNullable[float64] `json:"top_a,omitzero"` + // Limits the model to choose from the top K most likely tokens at each step. A value of 1 means the model will always pick the most likely next token. Not all providers support this parameter. + TopK optionalnullable.OptionalNullable[int64] `json:"top_k,omitzero"` // Number of top log probabilities to return (0-20) TopLogprobs optionalnullable.OptionalNullable[int64] `json:"top_logprobs,omitzero"` // Nucleus sampling parameter (0-1) @@ -758,6 +852,13 @@ func (c *ChatRequest) GetMetadata() map[string]string { return c.Metadata } +func (c *ChatRequest) GetMinP() optionalnullable.OptionalNullable[float64] { + if c == nil { + return nil + } + return c.MinP +} + func (c *ChatRequest) GetModalities() []Modality { if c == nil { return nil @@ -807,13 +908,27 @@ func (c *ChatRequest) GetProvider() optionalnullable.OptionalNullable[ProviderPr return c.Provider } -func (c *ChatRequest) GetReasoning() *Reasoning { +func (c *ChatRequest) GetReasoning() *ChatRequestReasoning { if c == nil { return nil } return c.Reasoning } +func (c *ChatRequest) GetReasoningEffort() optionalnullable.OptionalNullable[ChatRequestReasoningEffort] { + if c == nil { + return nil + } + return c.ReasoningEffort +} + +func (c *ChatRequest) GetRepetitionPenalty() optionalnullable.OptionalNullable[float64] { + if c == nil { + return nil + } + return c.RepetitionPenalty +} + func (c *ChatRequest) GetResponseFormat() *ResponseFormat { if c == nil { return nil @@ -884,6 +999,13 @@ func (c *ChatRequest) GetStop() optionalnullable.OptionalNullable[Stop] { return c.Stop } +func (c *ChatRequest) GetStopServerToolsWhen() []StopServerToolsWhenCondition { + if c == nil { + return nil + } + return c.StopServerToolsWhen +} + func (c *ChatRequest) GetStream() *bool { if c == nil { return nil @@ -919,6 +1041,20 @@ func (c *ChatRequest) GetTools() []ChatFunctionTool { return c.Tools } +func (c *ChatRequest) GetTopA() optionalnullable.OptionalNullable[float64] { + if c == nil { + return nil + } + return c.TopA +} + +func (c *ChatRequest) GetTopK() optionalnullable.OptionalNullable[int64] { + if c == nil { + return nil + } + return c.TopK +} + func (c *ChatRequest) GetTopLogprobs() optionalnullable.OptionalNullable[int64] { if c == nil { return nil diff --git a/models/components/chatresult.go b/models/components/chatresult.go index 16a9169c..d368de53 100644 --- a/models/components/chatresult.go +++ b/models/components/chatresult.go @@ -41,8 +41,9 @@ type ChatResult struct { // Unique completion identifier ID string `json:"id"` // Model used for completion - Model string `json:"model"` - Object ChatResultObject `json:"object"` + Model string `json:"model"` + Object ChatResultObject `json:"object"` + OpenrouterMetadata *OpenRouterMetadata `json:"openrouter_metadata,omitzero"` // The service tier used by the upstream provider for this request ServiceTier optionalnullable.OptionalNullable[string] `json:"service_tier,omitzero"` // System fingerprint @@ -97,6 +98,13 @@ func (c *ChatResult) GetObject() ChatResultObject { return c.Object } +func (c *ChatResult) GetOpenrouterMetadata() *OpenRouterMetadata { + if c == nil { + return nil + } + return c.OpenrouterMetadata +} + func (c *ChatResult) GetServiceTier() optionalnullable.OptionalNullable[string] { if c == nil { return nil diff --git a/models/components/chatservertoolchoice.go b/models/components/chatservertoolchoice.go new file mode 100644 index 00000000..bd261469 --- /dev/null +++ b/models/components/chatservertoolchoice.go @@ -0,0 +1,31 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// ChatServerToolChoice - OpenRouter extension: force a specific server tool by naming it directly in `tool_choice.type` instead of wrapping it in `{ type: "function", function: { name } }`. +type ChatServerToolChoice struct { + // OpenRouter server-tool type to force (e.g. `openrouter:web_search`, `web_search`, `web_search_preview`). + Type string `json:"type"` +} + +func (c ChatServerToolChoice) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ChatServerToolChoice) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ChatServerToolChoice) GetType() string { + if c == nil { + return "" + } + return c.Type +} diff --git a/models/components/chatstreamchunk.go b/models/components/chatstreamchunk.go index cc54caa7..f371c556 100644 --- a/models/components/chatstreamchunk.go +++ b/models/components/chatstreamchunk.go @@ -65,8 +65,9 @@ type ChatStreamChunk struct { // Unique chunk identifier ID string `json:"id"` // Model used for completion - Model string `json:"model"` - Object ChatStreamChunkObject `json:"object"` + Model string `json:"model"` + Object ChatStreamChunkObject `json:"object"` + OpenrouterMetadata *OpenRouterMetadata `json:"openrouter_metadata,omitzero"` // The service tier used by the upstream provider for this request ServiceTier optionalnullable.OptionalNullable[string] `json:"service_tier,omitzero"` // System fingerprint @@ -128,6 +129,13 @@ func (c *ChatStreamChunk) GetObject() ChatStreamChunkObject { return c.Object } +func (c *ChatStreamChunk) GetOpenrouterMetadata() *OpenRouterMetadata { + if c == nil { + return nil + } + return c.OpenrouterMetadata +} + func (c *ChatStreamChunk) GetServiceTier() optionalnullable.OptionalNullable[string] { if c == nil { return nil diff --git a/models/components/chatstreamingresponse.go b/models/components/chatstreamingresponse.go new file mode 100644 index 00000000..affcf3d6 --- /dev/null +++ b/models/components/chatstreamingresponse.go @@ -0,0 +1,19 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ChatStreamingResponse struct { + // Streaming chat completion chunk + Data ChatStreamChunk `json:"data"` +} + +func (c *ChatStreamingResponse) GetData() ChatStreamChunk { + if c == nil { + return ChatStreamChunk{} + } + return c.Data +} + +func (c ChatStreamingResponse) GetEventEncoding(event string) (string, error) { + return "application/json", nil +} diff --git a/models/components/chattoolchoice.go b/models/components/chattoolchoice.go index 116bdc4f..e81c4499 100644 --- a/models/components/chattoolchoice.go +++ b/models/components/chattoolchoice.go @@ -85,6 +85,7 @@ const ( ChatToolChoiceTypeChatToolChoiceAuto ChatToolChoiceType = "ChatToolChoice_Auto" ChatToolChoiceTypeChatToolChoiceRequired ChatToolChoiceType = "ChatToolChoice_Required" ChatToolChoiceTypeChatNamedToolChoice ChatToolChoiceType = "ChatNamedToolChoice" + ChatToolChoiceTypeChatServerToolChoice ChatToolChoiceType = "ChatServerToolChoice" ) // ChatToolChoice - Tool choice configuration @@ -93,6 +94,7 @@ type ChatToolChoice struct { ChatToolChoiceAuto *ChatToolChoiceAuto `queryParam:"inline" union:"member"` ChatToolChoiceRequired *ChatToolChoiceRequired `queryParam:"inline" union:"member"` ChatNamedToolChoice *ChatNamedToolChoice `queryParam:"inline" union:"member"` + ChatServerToolChoice *ChatServerToolChoice `queryParam:"inline" union:"member"` Type ChatToolChoiceType } @@ -133,6 +135,15 @@ func CreateChatToolChoiceChatNamedToolChoice(chatNamedToolChoice ChatNamedToolCh } } +func CreateChatToolChoiceChatServerToolChoice(chatServerToolChoice ChatServerToolChoice) ChatToolChoice { + typ := ChatToolChoiceTypeChatServerToolChoice + + return ChatToolChoice{ + ChatServerToolChoice: &chatServerToolChoice, + Type: typ, + } +} + func (u *ChatToolChoice) UnmarshalJSON(data []byte) error { var candidates []utils.UnionCandidate @@ -170,6 +181,14 @@ func (u *ChatToolChoice) UnmarshalJSON(data []byte) error { }) } + var chatServerToolChoice ChatServerToolChoice = ChatServerToolChoice{} + if err := utils.UnmarshalJSON(data, &chatServerToolChoice, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: ChatToolChoiceTypeChatServerToolChoice, + Value: &chatServerToolChoice, + }) + } + if len(candidates) == 0 { return fmt.Errorf("could not unmarshal `%s` into any supported union types for ChatToolChoice", string(data)) } @@ -195,6 +214,9 @@ func (u *ChatToolChoice) UnmarshalJSON(data []byte) error { case ChatToolChoiceTypeChatNamedToolChoice: u.ChatNamedToolChoice = best.Value.(*ChatNamedToolChoice) return nil + case ChatToolChoiceTypeChatServerToolChoice: + u.ChatServerToolChoice = best.Value.(*ChatServerToolChoice) + return nil } return fmt.Errorf("could not unmarshal `%s` into any supported union types for ChatToolChoice", string(data)) @@ -217,5 +239,9 @@ func (u ChatToolChoice) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.ChatNamedToolChoice, "", true) } + if u.ChatServerToolChoice != nil { + return utils.MarshalJSON(u.ChatServerToolChoice, "", true) + } + return nil, errors.New("could not marshal union type ChatToolChoice: all fields are null") } diff --git a/models/components/chatusage.go b/models/components/chatusage.go index be9e58c1..9bde0130 100644 --- a/models/components/chatusage.go +++ b/models/components/chatusage.go @@ -93,6 +93,12 @@ type ChatUsage struct { CompletionTokens int64 `json:"completion_tokens"` // Detailed completion token usage CompletionTokensDetails optionalnullable.OptionalNullable[CompletionTokensDetails] `json:"completion_tokens_details,omitzero"` + // Cost of the completion + Cost optionalnullable.OptionalNullable[float64] `json:"cost,omitzero"` + // Breakdown of upstream inference costs + CostDetails optionalnullable.OptionalNullable[CostDetails] `json:"cost_details,omitzero"` + // Whether a request was made using a Bring Your Own Key configuration + IsByok *bool `json:"is_byok,omitzero"` // Number of tokens in the prompt PromptTokens int64 `json:"prompt_tokens"` // Detailed prompt token usage @@ -126,6 +132,27 @@ func (c *ChatUsage) GetCompletionTokensDetails() optionalnullable.OptionalNullab return c.CompletionTokensDetails } +func (c *ChatUsage) GetCost() optionalnullable.OptionalNullable[float64] { + if c == nil { + return nil + } + return c.Cost +} + +func (c *ChatUsage) GetCostDetails() optionalnullable.OptionalNullable[CostDetails] { + if c == nil { + return nil + } + return c.CostDetails +} + +func (c *ChatUsage) GetIsByok() *bool { + if c == nil { + return nil + } + return c.IsByok +} + func (c *ChatUsage) GetPromptTokens() int64 { if c == nil { return 0 diff --git a/models/components/chatwebsearchshorthand.go b/models/components/chatwebsearchshorthand.go index 1b37b4ae..b3ccbe56 100644 --- a/models/components/chatwebsearchshorthand.go +++ b/models/components/chatwebsearchshorthand.go @@ -32,18 +32,20 @@ func (e *ChatWebSearchShorthandType) IsExact() bool { // ChatWebSearchShorthand - Web search tool using OpenAI Responses API syntax. Automatically converted to openrouter:web_search. type ChatWebSearchShorthand struct { - // Limit search results to these domains. Supported by Exa, Parallel, and most native providers (Anthropic, OpenAI, xAI). Not supported with Firecrawl or Perplexity. + // Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI, xAI). Cannot be used with excluded_domains. AllowedDomains []string `json:"allowed_domains,omitzero"` - // Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. + // Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). Engine *WebSearchEngineEnum `json:"engine,omitzero"` - // Exclude search results from these domains. Supported by Exa, Parallel, Anthropic, and xAI. Not supported with Firecrawl, OpenAI (silently ignored), or Perplexity. + // Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, and xAI. Not supported with OpenAI (silently ignored). Cannot be used with allowed_domains. ExcludedDomains []string `json:"excluded_domains,omitzero"` - // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and Parallel engines; ignored with native provider search. + // Exact maximum number of characters of content per search result. Applies to the Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, caps highlight content per result. For Parallel, caps excerpt content per result (default 1,500 when omitted). For Perplexity, maps to the native `max_tokens_per_page` parameter (converted from characters to tokens) and trims the response to the exact character cap. When both `max_characters` and `search_context_size` are set, `max_characters` takes precedence. When omitted, falls back to `search_context_size` mapping (Exa) or engine defaults (Parallel, Perplexity). + MaxCharacters *int64 `json:"max_characters,omitzero"` + // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. MaxResults *int64 `json:"max_results,omitzero"` - // Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. + // Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. Defaults to 50 when not specified. MaxTotalResults *int64 `json:"max_total_results,omitzero"` Parameters *WebSearchConfig `json:"parameters,omitzero"` - // How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search. + // How much context to retrieve per result. Applies to Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, pins a fixed per-result character cap (low=5,000, medium=15,000, high=30,000); when omitted, Exa picks an adaptive size per query and document (typically ~2,000–4,000 characters per result). For Parallel, controls the total characters across all results; when omitted, Parallel uses its own default size. For Perplexity, maps directly to the Search API's native search_context_size parameter. Overridden by `max_characters` when both are set. SearchContextSize *SearchQualityLevel `json:"search_context_size,omitzero"` Type ChatWebSearchShorthandType `json:"type"` // Approximate user location for location-biased results. @@ -82,6 +84,13 @@ func (c *ChatWebSearchShorthand) GetExcludedDomains() []string { return c.ExcludedDomains } +func (c *ChatWebSearchShorthand) GetMaxCharacters() *int64 { + if c == nil { + return nil + } + return c.MaxCharacters +} + func (c *ChatWebSearchShorthand) GetMaxResults() *int64 { if c == nil { return nil diff --git a/models/components/compactionitem.go b/models/components/compactionitem.go new file mode 100644 index 00000000..69435d26 --- /dev/null +++ b/models/components/compactionitem.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type CompactionItemType string + +const ( + CompactionItemTypeCompaction CompactionItemType = "compaction" +) + +func (e CompactionItemType) ToPointer() *CompactionItemType { + return &e +} +func (e *CompactionItemType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "compaction": + *e = CompactionItemType(v) + return nil + default: + return fmt.Errorf("invalid value for CompactionItemType: %v", v) + } +} + +// CompactionItem - A context compaction marker with encrypted summary +type CompactionItem struct { + EncryptedContent string `json:"encrypted_content"` + ID optionalnullable.OptionalNullable[string] `json:"id,omitzero"` + Type CompactionItemType `json:"type"` +} + +func (c CompactionItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CompactionItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CompactionItem) GetEncryptedContent() string { + if c == nil { + return "" + } + return c.EncryptedContent +} + +func (c *CompactionItem) GetID() optionalnullable.OptionalNullable[string] { + if c == nil { + return nil + } + return c.ID +} + +func (c *CompactionItem) GetType() CompactionItemType { + if c == nil { + return CompactionItemType("") + } + return c.Type +} diff --git a/models/components/containerautoenvironment.go b/models/components/containerautoenvironment.go new file mode 100644 index 00000000..d98f2540 --- /dev/null +++ b/models/components/containerautoenvironment.go @@ -0,0 +1,55 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ContainerAutoEnvironmentType string + +const ( + ContainerAutoEnvironmentTypeContainerAuto ContainerAutoEnvironmentType = "container_auto" +) + +func (e ContainerAutoEnvironmentType) ToPointer() *ContainerAutoEnvironmentType { + return &e +} +func (e *ContainerAutoEnvironmentType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "container_auto": + *e = ContainerAutoEnvironmentType(v) + return nil + default: + return fmt.Errorf("invalid value for ContainerAutoEnvironmentType: %v", v) + } +} + +// ContainerAutoEnvironment - An OpenRouter-managed, auto-provisioned ephemeral container. +type ContainerAutoEnvironment struct { + Type ContainerAutoEnvironmentType `json:"type"` +} + +func (c ContainerAutoEnvironment) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ContainerAutoEnvironment) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ContainerAutoEnvironment) GetType() ContainerAutoEnvironmentType { + if c == nil { + return ContainerAutoEnvironmentType("") + } + return c.Type +} diff --git a/models/components/containerreferenceenvironment.go b/models/components/containerreferenceenvironment.go new file mode 100644 index 00000000..03744138 --- /dev/null +++ b/models/components/containerreferenceenvironment.go @@ -0,0 +1,64 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ContainerReferenceEnvironmentType string + +const ( + ContainerReferenceEnvironmentTypeContainerReference ContainerReferenceEnvironmentType = "container_reference" +) + +func (e ContainerReferenceEnvironmentType) ToPointer() *ContainerReferenceEnvironmentType { + return &e +} +func (e *ContainerReferenceEnvironmentType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "container_reference": + *e = ContainerReferenceEnvironmentType(v) + return nil + default: + return fmt.Errorf("invalid value for ContainerReferenceEnvironmentType: %v", v) + } +} + +// ContainerReferenceEnvironment - Reference to a previously created container to reuse. +type ContainerReferenceEnvironment struct { + // Identifier of an existing container to reuse (max 20 characters). + ContainerID string `json:"container_id"` + Type ContainerReferenceEnvironmentType `json:"type"` +} + +func (c ContainerReferenceEnvironment) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ContainerReferenceEnvironment) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ContainerReferenceEnvironment) GetContainerID() string { + if c == nil { + return "" + } + return c.ContainerID +} + +func (c *ContainerReferenceEnvironment) GetType() ContainerReferenceEnvironmentType { + if c == nil { + return ContainerReferenceEnvironmentType("") + } + return c.Type +} diff --git a/models/components/contentfilteraction.go b/models/components/contentfilteraction.go new file mode 100644 index 00000000..84c6e0ca --- /dev/null +++ b/models/components/contentfilteraction.go @@ -0,0 +1,26 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ContentFilterAction - Action taken when the pattern matches +type ContentFilterAction string + +const ( + ContentFilterActionRedact ContentFilterAction = "redact" + ContentFilterActionBlock ContentFilterAction = "block" +) + +func (e ContentFilterAction) ToPointer() *ContentFilterAction { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ContentFilterAction) IsExact() bool { + if e != nil { + switch *e { + case "redact", "block": + return true + } + } + return false +} diff --git a/models/components/contentfilterbuiltinaction.go b/models/components/contentfilterbuiltinaction.go new file mode 100644 index 00000000..36c43f3a --- /dev/null +++ b/models/components/contentfilterbuiltinaction.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ContentFilterBuiltinAction - Action taken when the builtin filter triggers +type ContentFilterBuiltinAction string + +const ( + ContentFilterBuiltinActionRedact ContentFilterBuiltinAction = "redact" + ContentFilterBuiltinActionBlock ContentFilterBuiltinAction = "block" + ContentFilterBuiltinActionFlag ContentFilterBuiltinAction = "flag" +) + +func (e ContentFilterBuiltinAction) ToPointer() *ContentFilterBuiltinAction { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ContentFilterBuiltinAction) IsExact() bool { + if e != nil { + switch *e { + case "redact", "block", "flag": + return true + } + } + return false +} diff --git a/models/components/contentfilterbuiltinentry.go b/models/components/contentfilterbuiltinentry.go new file mode 100644 index 00000000..5c316341 --- /dev/null +++ b/models/components/contentfilterbuiltinentry.go @@ -0,0 +1,43 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ContentFilterBuiltinEntry - A builtin content filter entry. Builtin filters include PII detectors and the regex-based prompt injection detector. +type ContentFilterBuiltinEntry struct { + // Action taken when the builtin filter triggers + Action ContentFilterBuiltinAction `json:"action"` + // Read-only, system-assigned redaction placeholder derived from the slug (e.g. "[EMAIL]", "[PHONE]"). Not settable by the caller. + Label *string `json:"label,omitzero"` + // Which message roles to scan for prompt injection. Only applies to the regex-prompt-injection builtin. Defaults to all_messages. + ScanScope *PromptInjectionScanScope `json:"scan_scope,omitzero"` + // The builtin filter identifier + Slug ContentFilterBuiltinSlug `json:"slug"` +} + +func (c *ContentFilterBuiltinEntry) GetAction() ContentFilterBuiltinAction { + if c == nil { + return ContentFilterBuiltinAction("") + } + return c.Action +} + +func (c *ContentFilterBuiltinEntry) GetLabel() *string { + if c == nil { + return nil + } + return c.Label +} + +func (c *ContentFilterBuiltinEntry) GetScanScope() *PromptInjectionScanScope { + if c == nil { + return nil + } + return c.ScanScope +} + +func (c *ContentFilterBuiltinEntry) GetSlug() ContentFilterBuiltinSlug { + if c == nil { + return ContentFilterBuiltinSlug("") + } + return c.Slug +} diff --git a/models/components/contentfilterbuiltinentryinput.go b/models/components/contentfilterbuiltinentryinput.go new file mode 100644 index 00000000..90ebdec2 --- /dev/null +++ b/models/components/contentfilterbuiltinentryinput.go @@ -0,0 +1,45 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ContentFilterBuiltinEntryInput - A builtin content filter entry for create/update requests. Labels are system-assigned and cannot be set by the caller. +type ContentFilterBuiltinEntryInput struct { + // Action taken when the builtin filter triggers + Action ContentFilterBuiltinAction `json:"action"` + // Deprecated: labels are system-assigned and cannot be set by the caller. Accepted for backward compatibility but silently ignored. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. + Label *string `json:"label,omitzero"` + // Which message roles to scan for prompt injection. Only applies to the regex-prompt-injection builtin. Defaults to all_messages. + ScanScope *PromptInjectionScanScope `json:"scan_scope,omitzero"` + // The builtin filter identifier + Slug ContentFilterBuiltinSlug `json:"slug"` +} + +func (c *ContentFilterBuiltinEntryInput) GetAction() ContentFilterBuiltinAction { + if c == nil { + return ContentFilterBuiltinAction("") + } + return c.Action +} + +func (c *ContentFilterBuiltinEntryInput) GetLabel() *string { + if c == nil { + return nil + } + return c.Label +} + +func (c *ContentFilterBuiltinEntryInput) GetScanScope() *PromptInjectionScanScope { + if c == nil { + return nil + } + return c.ScanScope +} + +func (c *ContentFilterBuiltinEntryInput) GetSlug() ContentFilterBuiltinSlug { + if c == nil { + return ContentFilterBuiltinSlug("") + } + return c.Slug +} diff --git a/models/components/contentfilterbuiltinslug.go b/models/components/contentfilterbuiltinslug.go new file mode 100644 index 00000000..6dd23893 --- /dev/null +++ b/models/components/contentfilterbuiltinslug.go @@ -0,0 +1,32 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ContentFilterBuiltinSlug - The builtin filter identifier +type ContentFilterBuiltinSlug string + +const ( + ContentFilterBuiltinSlugEmail ContentFilterBuiltinSlug = "email" + ContentFilterBuiltinSlugPhone ContentFilterBuiltinSlug = "phone" + ContentFilterBuiltinSlugSsn ContentFilterBuiltinSlug = "ssn" + ContentFilterBuiltinSlugCreditCard ContentFilterBuiltinSlug = "credit-card" + ContentFilterBuiltinSlugIPAddress ContentFilterBuiltinSlug = "ip-address" + ContentFilterBuiltinSlugPersonName ContentFilterBuiltinSlug = "person-name" + ContentFilterBuiltinSlugAddress ContentFilterBuiltinSlug = "address" + ContentFilterBuiltinSlugRegexPromptInjection ContentFilterBuiltinSlug = "regex-prompt-injection" +) + +func (e ContentFilterBuiltinSlug) ToPointer() *ContentFilterBuiltinSlug { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ContentFilterBuiltinSlug) IsExact() bool { + if e != nil { + switch *e { + case "email", "phone", "ssn", "credit-card", "ip-address", "person-name", "address", "regex-prompt-injection": + return true + } + } + return false +} diff --git a/models/components/contentfilterentry.go b/models/components/contentfilterentry.go new file mode 100644 index 00000000..f99162a0 --- /dev/null +++ b/models/components/contentfilterentry.go @@ -0,0 +1,38 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +// ContentFilterEntry - A custom regex content filter that scans request messages for matching patterns. +type ContentFilterEntry struct { + // Action taken when the pattern matches + Action ContentFilterAction `json:"action"` + // Optional label used in redaction placeholders or error messages + Label optionalnullable.OptionalNullable[string] `json:"label,omitzero"` + // A regex pattern to match against request content + Pattern string `json:"pattern"` +} + +func (c *ContentFilterEntry) GetAction() ContentFilterAction { + if c == nil { + return ContentFilterAction("") + } + return c.Action +} + +func (c *ContentFilterEntry) GetLabel() optionalnullable.OptionalNullable[string] { + if c == nil { + return nil + } + return c.Label +} + +func (c *ContentFilterEntry) GetPattern() string { + if c == nil { + return "" + } + return c.Pattern +} diff --git a/models/components/contentpartaudio.go b/models/components/contentpartaudio.go new file mode 100644 index 00000000..811ddc3c --- /dev/null +++ b/models/components/contentpartaudio.go @@ -0,0 +1,84 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type AudioURL struct { + URL string `json:"url"` +} + +func (a AudioURL) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AudioURL) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { + return err + } + return nil +} + +func (a *AudioURL) GetURL() string { + if a == nil { + return "" + } + return a.URL +} + +type ContentPartAudioType string + +const ( + ContentPartAudioTypeAudioURL ContentPartAudioType = "audio_url" +) + +func (e ContentPartAudioType) ToPointer() *ContentPartAudioType { + return &e +} +func (e *ContentPartAudioType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "audio_url": + *e = ContentPartAudioType(v) + return nil + default: + return fmt.Errorf("invalid value for ContentPartAudioType: %v", v) + } +} + +type ContentPartAudio struct { + AudioURL AudioURL `json:"audio_url"` + Type ContentPartAudioType `json:"type"` +} + +func (c ContentPartAudio) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ContentPartAudio) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ContentPartAudio) GetAudioURL() AudioURL { + if c == nil { + return AudioURL{} + } + return c.AudioURL +} + +func (c *ContentPartAudio) GetType() ContentPartAudioType { + if c == nil { + return ContentPartAudioType("") + } + return c.Type +} diff --git a/models/components/contentpartimage.go b/models/components/contentpartimage.go index 346d2d01..beb8d25e 100644 --- a/models/components/contentpartimage.go +++ b/models/components/contentpartimage.go @@ -5,12 +5,24 @@ package components import ( "encoding/json" "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" ) type ContentPartImageImageURL struct { URL string `json:"url"` } +func (c ContentPartImageImageURL) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ContentPartImageImageURL) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + func (c *ContentPartImageImageURL) GetURL() string { if c == nil { return "" @@ -46,6 +58,17 @@ type ContentPartImage struct { Type ContentPartImageType `json:"type"` } +func (c ContentPartImage) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ContentPartImage) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + func (c *ContentPartImage) GetImageURL() ContentPartImageImageURL { if c == nil { return ContentPartImageImageURL{} diff --git a/models/components/contentpartinputaudio.go b/models/components/contentpartinputaudio.go new file mode 100644 index 00000000..55ca5484 --- /dev/null +++ b/models/components/contentpartinputaudio.go @@ -0,0 +1,62 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ContentPartInputAudioType string + +const ( + ContentPartInputAudioTypeInputAudio ContentPartInputAudioType = "input_audio" +) + +func (e ContentPartInputAudioType) ToPointer() *ContentPartInputAudioType { + return &e +} +func (e *ContentPartInputAudioType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "input_audio": + *e = ContentPartInputAudioType(v) + return nil + default: + return fmt.Errorf("invalid value for ContentPartInputAudioType: %v", v) + } +} + +type ContentPartInputAudio struct { + InputAudio MultimodalMedia `json:"input_audio"` + Type ContentPartInputAudioType `json:"type"` +} + +func (c ContentPartInputAudio) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ContentPartInputAudio) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ContentPartInputAudio) GetInputAudio() MultimodalMedia { + if c == nil { + return MultimodalMedia{} + } + return c.InputAudio +} + +func (c *ContentPartInputAudio) GetType() ContentPartInputAudioType { + if c == nil { + return ContentPartInputAudioType("") + } + return c.Type +} diff --git a/models/components/contentpartinputfile.go b/models/components/contentpartinputfile.go new file mode 100644 index 00000000..9e8d4bd8 --- /dev/null +++ b/models/components/contentpartinputfile.go @@ -0,0 +1,62 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ContentPartInputFileType string + +const ( + ContentPartInputFileTypeInputFile ContentPartInputFileType = "input_file" +) + +func (e ContentPartInputFileType) ToPointer() *ContentPartInputFileType { + return &e +} +func (e *ContentPartInputFileType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "input_file": + *e = ContentPartInputFileType(v) + return nil + default: + return fmt.Errorf("invalid value for ContentPartInputFileType: %v", v) + } +} + +type ContentPartInputFile struct { + InputFile MultimodalMedia `json:"input_file"` + Type ContentPartInputFileType `json:"type"` +} + +func (c ContentPartInputFile) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ContentPartInputFile) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ContentPartInputFile) GetInputFile() MultimodalMedia { + if c == nil { + return MultimodalMedia{} + } + return c.InputFile +} + +func (c *ContentPartInputFile) GetType() ContentPartInputFileType { + if c == nil { + return ContentPartInputFileType("") + } + return c.Type +} diff --git a/models/components/contentpartinputvideo.go b/models/components/contentpartinputvideo.go new file mode 100644 index 00000000..1a389fa1 --- /dev/null +++ b/models/components/contentpartinputvideo.go @@ -0,0 +1,62 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ContentPartInputVideoType string + +const ( + ContentPartInputVideoTypeInputVideo ContentPartInputVideoType = "input_video" +) + +func (e ContentPartInputVideoType) ToPointer() *ContentPartInputVideoType { + return &e +} +func (e *ContentPartInputVideoType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "input_video": + *e = ContentPartInputVideoType(v) + return nil + default: + return fmt.Errorf("invalid value for ContentPartInputVideoType: %v", v) + } +} + +type ContentPartInputVideo struct { + InputVideo MultimodalMedia `json:"input_video"` + Type ContentPartInputVideoType `json:"type"` +} + +func (c ContentPartInputVideo) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ContentPartInputVideo) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ContentPartInputVideo) GetInputVideo() MultimodalMedia { + if c == nil { + return MultimodalMedia{} + } + return c.InputVideo +} + +func (c *ContentPartInputVideo) GetType() ContentPartInputVideoType { + if c == nil { + return ContentPartInputVideoType("") + } + return c.Type +} diff --git a/models/components/contentpartvideo.go b/models/components/contentpartvideo.go new file mode 100644 index 00000000..53d93bc1 --- /dev/null +++ b/models/components/contentpartvideo.go @@ -0,0 +1,84 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ContentPartVideoType string + +const ( + ContentPartVideoTypeVideoURL ContentPartVideoType = "video_url" +) + +func (e ContentPartVideoType) ToPointer() *ContentPartVideoType { + return &e +} +func (e *ContentPartVideoType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "video_url": + *e = ContentPartVideoType(v) + return nil + default: + return fmt.Errorf("invalid value for ContentPartVideoType: %v", v) + } +} + +type VideoURL struct { + URL string `json:"url"` +} + +func (v VideoURL) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(v, "", false) +} + +func (v *VideoURL) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &v, "", false, nil); err != nil { + return err + } + return nil +} + +func (v *VideoURL) GetURL() string { + if v == nil { + return "" + } + return v.URL +} + +type ContentPartVideo struct { + Type ContentPartVideoType `json:"type"` + VideoURL VideoURL `json:"video_url"` +} + +func (c ContentPartVideo) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ContentPartVideo) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ContentPartVideo) GetType() ContentPartVideoType { + if c == nil { + return ContentPartVideoType("") + } + return c.Type +} + +func (c *ContentPartVideo) GetVideoURL() VideoURL { + if c == nil { + return VideoURL{} + } + return c.VideoURL +} diff --git a/models/components/costdetails.go b/models/components/costdetails.go new file mode 100644 index 00000000..67bc4ecb --- /dev/null +++ b/models/components/costdetails.go @@ -0,0 +1,35 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +// CostDetails - Breakdown of upstream inference costs +type CostDetails struct { + UpstreamInferenceCompletionsCost float64 `json:"upstream_inference_completions_cost"` + UpstreamInferenceCost optionalnullable.OptionalNullable[float64] `json:"upstream_inference_cost,omitzero"` + UpstreamInferencePromptCost float64 `json:"upstream_inference_prompt_cost"` +} + +func (c *CostDetails) GetUpstreamInferenceCompletionsCost() float64 { + if c == nil { + return 0.0 + } + return c.UpstreamInferenceCompletionsCost +} + +func (c *CostDetails) GetUpstreamInferenceCost() optionalnullable.OptionalNullable[float64] { + if c == nil { + return nil + } + return c.UpstreamInferenceCost +} + +func (c *CostDetails) GetUpstreamInferencePromptCost() float64 { + if c == nil { + return 0.0 + } + return c.UpstreamInferencePromptCost +} diff --git a/models/components/createbyokkeyrequest.go b/models/components/createbyokkeyrequest.go new file mode 100644 index 00000000..f1cf5771 --- /dev/null +++ b/models/components/createbyokkeyrequest.go @@ -0,0 +1,94 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type CreateBYOKKeyRequest struct { + // Optional allowlist of model slugs this credential may be used for. `null` means no restriction. + AllowedModels optionalnullable.OptionalNullable[[]string] `json:"allowed_models,omitzero"` + // Optional allowlist of user IDs that may use this credential. `null` means no restriction. + AllowedUserIds optionalnullable.OptionalNullable[[]string] `json:"allowed_user_ids,omitzero"` + // Whether this credential should be created in a disabled state. + Disabled *bool `json:"disabled,omitzero"` + // Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried. + IsFallback *bool `json:"is_fallback,omitzero"` + // The raw provider API key or credential. This value is encrypted at rest and never returned in API responses. + Key string `json:"key"` + // Optional human-readable name for the credential. + Name optionalnullable.OptionalNullable[string] `json:"name,omitzero"` + // The upstream provider this credential authenticates against, as a lowercase slug (e.g. `openai`, `anthropic`, `amazon-bedrock`). + Provider BYOKProviderSlug `json:"provider"` + // Optional workspace ID. Defaults to the authenticated entity's default workspace. + WorkspaceID *string `json:"workspace_id,omitzero"` +} + +func (c CreateBYOKKeyRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateBYOKKeyRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CreateBYOKKeyRequest) GetAllowedModels() optionalnullable.OptionalNullable[[]string] { + if c == nil { + return nil + } + return c.AllowedModels +} + +func (c *CreateBYOKKeyRequest) GetAllowedUserIds() optionalnullable.OptionalNullable[[]string] { + if c == nil { + return nil + } + return c.AllowedUserIds +} + +func (c *CreateBYOKKeyRequest) GetDisabled() *bool { + if c == nil { + return nil + } + return c.Disabled +} + +func (c *CreateBYOKKeyRequest) GetIsFallback() *bool { + if c == nil { + return nil + } + return c.IsFallback +} + +func (c *CreateBYOKKeyRequest) GetKey() string { + if c == nil { + return "" + } + return c.Key +} + +func (c *CreateBYOKKeyRequest) GetName() optionalnullable.OptionalNullable[string] { + if c == nil { + return nil + } + return c.Name +} + +func (c *CreateBYOKKeyRequest) GetProvider() BYOKProviderSlug { + if c == nil { + return BYOKProviderSlug("") + } + return c.Provider +} + +func (c *CreateBYOKKeyRequest) GetWorkspaceID() *string { + if c == nil { + return nil + } + return c.WorkspaceID +} diff --git a/models/components/createbyokkeyresponse.go b/models/components/createbyokkeyresponse.go new file mode 100644 index 00000000..c3d386cf --- /dev/null +++ b/models/components/createbyokkeyresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CreateBYOKKeyResponse struct { + Data BYOKKey `json:"data"` +} + +func (c *CreateBYOKKeyResponse) GetData() BYOKKey { + if c == nil { + return BYOKKey{} + } + return c.Data +} diff --git a/models/components/createguardrailrequest.go b/models/components/createguardrailrequest.go index e4be1c92..854b2cc0 100644 --- a/models/components/createguardrailrequest.go +++ b/models/components/createguardrailrequest.go @@ -12,10 +12,24 @@ type CreateGuardrailRequest struct { AllowedModels optionalnullable.OptionalNullable[[]string] `json:"allowed_models,omitzero"` // List of allowed provider IDs AllowedProviders optionalnullable.OptionalNullable[[]string] `json:"allowed_providers,omitzero"` + // Builtin content filters to apply. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only. + ContentFilterBuiltins optionalnullable.OptionalNullable[[]ContentFilterBuiltinEntryInput] `json:"content_filter_builtins,omitzero"` + // Custom regex content filters to apply to request messages + ContentFilters optionalnullable.OptionalNullable[[]ContentFilterEntry] `json:"content_filters,omitzero"` // Description of the guardrail Description optionalnullable.OptionalNullable[string] `json:"description,omitzero"` - // Whether to enforce zero data retention + // Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. EnforceZdr optionalnullable.OptionalNullable[bool] `json:"enforce_zdr,omitzero"` + // Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. + EnforceZdrAnthropic optionalnullable.OptionalNullable[bool] `json:"enforce_zdr_anthropic,omitzero"` + // Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. + EnforceZdrGoogle optionalnullable.OptionalNullable[bool] `json:"enforce_zdr_google,omitzero"` + // Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. + EnforceZdrOpenai optionalnullable.OptionalNullable[bool] `json:"enforce_zdr_openai,omitzero"` + // Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided. + EnforceZdrOther optionalnullable.OptionalNullable[bool] `json:"enforce_zdr_other,omitzero"` // Array of model identifiers to exclude from routing (slug or canonical_slug accepted) IgnoredModels optionalnullable.OptionalNullable[[]string] `json:"ignored_models,omitzero"` // List of provider IDs to exclude from routing @@ -55,6 +69,20 @@ func (c *CreateGuardrailRequest) GetAllowedProviders() optionalnullable.Optional return c.AllowedProviders } +func (c *CreateGuardrailRequest) GetContentFilterBuiltins() optionalnullable.OptionalNullable[[]ContentFilterBuiltinEntryInput] { + if c == nil { + return nil + } + return c.ContentFilterBuiltins +} + +func (c *CreateGuardrailRequest) GetContentFilters() optionalnullable.OptionalNullable[[]ContentFilterEntry] { + if c == nil { + return nil + } + return c.ContentFilters +} + func (c *CreateGuardrailRequest) GetDescription() optionalnullable.OptionalNullable[string] { if c == nil { return nil @@ -69,6 +97,34 @@ func (c *CreateGuardrailRequest) GetEnforceZdr() optionalnullable.OptionalNullab return c.EnforceZdr } +func (c *CreateGuardrailRequest) GetEnforceZdrAnthropic() optionalnullable.OptionalNullable[bool] { + if c == nil { + return nil + } + return c.EnforceZdrAnthropic +} + +func (c *CreateGuardrailRequest) GetEnforceZdrGoogle() optionalnullable.OptionalNullable[bool] { + if c == nil { + return nil + } + return c.EnforceZdrGoogle +} + +func (c *CreateGuardrailRequest) GetEnforceZdrOpenai() optionalnullable.OptionalNullable[bool] { + if c == nil { + return nil + } + return c.EnforceZdrOpenai +} + +func (c *CreateGuardrailRequest) GetEnforceZdrOther() optionalnullable.OptionalNullable[bool] { + if c == nil { + return nil + } + return c.EnforceZdrOther +} + func (c *CreateGuardrailRequest) GetIgnoredModels() optionalnullable.OptionalNullable[[]string] { if c == nil { return nil diff --git a/models/components/createobservabilitydestinationrequest.go b/models/components/createobservabilitydestinationrequest.go new file mode 100644 index 00000000..d13d0461 --- /dev/null +++ b/models/components/createobservabilitydestinationrequest.go @@ -0,0 +1,141 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +// CreateObservabilityDestinationRequestType - The destination type. Only stable destination types are accepted. +type CreateObservabilityDestinationRequestType string + +const ( + CreateObservabilityDestinationRequestTypeArize CreateObservabilityDestinationRequestType = "arize" + CreateObservabilityDestinationRequestTypeBraintrust CreateObservabilityDestinationRequestType = "braintrust" + CreateObservabilityDestinationRequestTypeClickhouse CreateObservabilityDestinationRequestType = "clickhouse" + CreateObservabilityDestinationRequestTypeDatadog CreateObservabilityDestinationRequestType = "datadog" + CreateObservabilityDestinationRequestTypeGrafana CreateObservabilityDestinationRequestType = "grafana" + CreateObservabilityDestinationRequestTypeLangfuse CreateObservabilityDestinationRequestType = "langfuse" + CreateObservabilityDestinationRequestTypeLangsmith CreateObservabilityDestinationRequestType = "langsmith" + CreateObservabilityDestinationRequestTypeNewrelic CreateObservabilityDestinationRequestType = "newrelic" + CreateObservabilityDestinationRequestTypeOpik CreateObservabilityDestinationRequestType = "opik" + CreateObservabilityDestinationRequestTypeOtelCollector CreateObservabilityDestinationRequestType = "otel-collector" + CreateObservabilityDestinationRequestTypePosthog CreateObservabilityDestinationRequestType = "posthog" + CreateObservabilityDestinationRequestTypeRamp CreateObservabilityDestinationRequestType = "ramp" + CreateObservabilityDestinationRequestTypeS3 CreateObservabilityDestinationRequestType = "s3" + CreateObservabilityDestinationRequestTypeSentry CreateObservabilityDestinationRequestType = "sentry" + CreateObservabilityDestinationRequestTypeSnowflake CreateObservabilityDestinationRequestType = "snowflake" + CreateObservabilityDestinationRequestTypeWeave CreateObservabilityDestinationRequestType = "weave" + CreateObservabilityDestinationRequestTypeWebhook CreateObservabilityDestinationRequestType = "webhook" +) + +func (e CreateObservabilityDestinationRequestType) ToPointer() *CreateObservabilityDestinationRequestType { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *CreateObservabilityDestinationRequestType) IsExact() bool { + if e != nil { + switch *e { + case "arize", "braintrust", "clickhouse", "datadog", "grafana", "langfuse", "langsmith", "newrelic", "opik", "otel-collector", "posthog", "ramp", "s3", "sentry", "snowflake", "weave", "webhook": + return true + } + } + return false +} + +type CreateObservabilityDestinationRequest struct { + // Optional allowlist of OpenRouter API key hashes whose traffic is forwarded. `null` or omitted means all keys. Must contain at least one hash if provided. + APIKeyHashes optionalnullable.OptionalNullable[[]string] `json:"api_key_hashes,omitzero"` + // Provider-specific configuration. The shape depends on `type` and is validated server-side. + Config map[string]any `json:"config"` + // Whether this destination should be enabled immediately. + Enabled *bool `default:"true" json:"enabled"` + // Optional structured filter rules controlling which events are forwarded. + FilterRules optionalnullable.OptionalNullable[ObservabilityFilterRulesConfig] `json:"filter_rules,omitzero"` + // Human-readable name for the destination. + Name string `json:"name"` + // When true, request/response bodies are not forwarded — only metadata. + PrivacyMode *bool `default:"false" json:"privacy_mode"` + // Sampling rate between 0.0001 and 1 (1 = 100%). + SamplingRate *float64 `json:"sampling_rate,omitzero"` + // The destination type. Only stable destination types are accepted. + Type CreateObservabilityDestinationRequestType `json:"type"` + // Optional workspace ID. Defaults to the authenticated entity's default workspace. + WorkspaceID *string `json:"workspace_id,omitzero"` +} + +func (c CreateObservabilityDestinationRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateObservabilityDestinationRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CreateObservabilityDestinationRequest) GetAPIKeyHashes() optionalnullable.OptionalNullable[[]string] { + if c == nil { + return nil + } + return c.APIKeyHashes +} + +func (c *CreateObservabilityDestinationRequest) GetConfig() map[string]any { + if c == nil { + return map[string]any{} + } + return c.Config +} + +func (c *CreateObservabilityDestinationRequest) GetEnabled() *bool { + if c == nil { + return nil + } + return c.Enabled +} + +func (c *CreateObservabilityDestinationRequest) GetFilterRules() optionalnullable.OptionalNullable[ObservabilityFilterRulesConfig] { + if c == nil { + return nil + } + return c.FilterRules +} + +func (c *CreateObservabilityDestinationRequest) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +func (c *CreateObservabilityDestinationRequest) GetPrivacyMode() *bool { + if c == nil { + return nil + } + return c.PrivacyMode +} + +func (c *CreateObservabilityDestinationRequest) GetSamplingRate() *float64 { + if c == nil { + return nil + } + return c.SamplingRate +} + +func (c *CreateObservabilityDestinationRequest) GetType() CreateObservabilityDestinationRequestType { + if c == nil { + return CreateObservabilityDestinationRequestType("") + } + return c.Type +} + +func (c *CreateObservabilityDestinationRequest) GetWorkspaceID() *string { + if c == nil { + return nil + } + return c.WorkspaceID +} diff --git a/models/components/createobservabilitydestinationresponse.go b/models/components/createobservabilitydestinationresponse.go new file mode 100644 index 00000000..cd44f16a --- /dev/null +++ b/models/components/createobservabilitydestinationresponse.go @@ -0,0 +1,82 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type CreateObservabilityDestinationResponse struct { + Data ObservabilityDestination `json:"data"` +} + +func (c *CreateObservabilityDestinationResponse) GetData() ObservabilityDestination { + if c == nil { + return ObservabilityDestination{} + } + return c.Data +} + +func (c *CreateObservabilityDestinationResponse) GetDataArize() *ObservabilityArizeDestination { + return c.GetData().ObservabilityArizeDestination +} + +func (c *CreateObservabilityDestinationResponse) GetDataBraintrust() *ObservabilityBraintrustDestination { + return c.GetData().ObservabilityBraintrustDestination +} + +func (c *CreateObservabilityDestinationResponse) GetDataClickhouse() *ObservabilityClickhouseDestination { + return c.GetData().ObservabilityClickhouseDestination +} + +func (c *CreateObservabilityDestinationResponse) GetDataDatadog() *ObservabilityDatadogDestination { + return c.GetData().ObservabilityDatadogDestination +} + +func (c *CreateObservabilityDestinationResponse) GetDataGrafana() *ObservabilityGrafanaDestination { + return c.GetData().ObservabilityGrafanaDestination +} + +func (c *CreateObservabilityDestinationResponse) GetDataLangfuse() *ObservabilityLangfuseDestination { + return c.GetData().ObservabilityLangfuseDestination +} + +func (c *CreateObservabilityDestinationResponse) GetDataLangsmith() *ObservabilityLangsmithDestination { + return c.GetData().ObservabilityLangsmithDestination +} + +func (c *CreateObservabilityDestinationResponse) GetDataNewrelic() *ObservabilityNewrelicDestination { + return c.GetData().ObservabilityNewrelicDestination +} + +func (c *CreateObservabilityDestinationResponse) GetDataOpik() *ObservabilityOpikDestination { + return c.GetData().ObservabilityOpikDestination +} + +func (c *CreateObservabilityDestinationResponse) GetDataOtelCollector() *ObservabilityOtelCollectorDestination { + return c.GetData().ObservabilityOtelCollectorDestination +} + +func (c *CreateObservabilityDestinationResponse) GetDataPosthog() *ObservabilityPosthogDestination { + return c.GetData().ObservabilityPosthogDestination +} + +func (c *CreateObservabilityDestinationResponse) GetDataRamp() *ObservabilityRampDestination { + return c.GetData().ObservabilityRampDestination +} + +func (c *CreateObservabilityDestinationResponse) GetDataS3() *ObservabilityS3Destination { + return c.GetData().ObservabilityS3Destination +} + +func (c *CreateObservabilityDestinationResponse) GetDataSentry() *ObservabilitySentryDestination { + return c.GetData().ObservabilitySentryDestination +} + +func (c *CreateObservabilityDestinationResponse) GetDataSnowflake() *ObservabilitySnowflakeDestination { + return c.GetData().ObservabilitySnowflakeDestination +} + +func (c *CreateObservabilityDestinationResponse) GetDataWeave() *ObservabilityWeaveDestination { + return c.GetData().ObservabilityWeaveDestination +} + +func (c *CreateObservabilityDestinationResponse) GetDataWebhook() *ObservabilityWebhookDestination { + return c.GetData().ObservabilityWebhookDestination +} diff --git a/models/components/createpresetfrominferenceresponse.go b/models/components/createpresetfrominferenceresponse.go new file mode 100644 index 00000000..f45732ed --- /dev/null +++ b/models/components/createpresetfrominferenceresponse.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// CreatePresetFromInferenceResponse - Response containing the created preset with its designated version. +type CreatePresetFromInferenceResponse struct { + // A preset with its currently designated version. + Data PresetWithDesignatedVersion `json:"data"` +} + +func (c *CreatePresetFromInferenceResponse) GetData() PresetWithDesignatedVersion { + if c == nil { + return PresetWithDesignatedVersion{} + } + return c.Data +} diff --git a/models/components/createworkspacerequest.go b/models/components/createworkspacerequest.go index e7137050..9ff94714 100644 --- a/models/components/createworkspacerequest.go +++ b/models/components/createworkspacerequest.go @@ -3,6 +3,7 @@ package components import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" "github.com/OpenRouterTeam/go-sdk/optionalnullable" ) @@ -15,6 +16,10 @@ type CreateWorkspaceRequest struct { DefaultTextModel optionalnullable.OptionalNullable[string] `json:"default_text_model,omitzero"` // Description of the workspace Description optionalnullable.OptionalNullable[string] `json:"description,omitzero"` + // Optional array of API key IDs to filter I/O logging + IoLoggingAPIKeyIds optionalnullable.OptionalNullable[[]int64] `json:"io_logging_api_key_ids,omitzero"` + // Sampling rate for I/O logging (0.0001-1) + IoLoggingSamplingRate *float64 `json:"io_logging_sampling_rate,omitzero"` // Whether data discount logging is enabled IsDataDiscountLoggingEnabled *bool `json:"is_data_discount_logging_enabled,omitzero"` // Whether broadcast is enabled @@ -23,10 +28,21 @@ type CreateWorkspaceRequest struct { IsObservabilityIoLoggingEnabled *bool `json:"is_observability_io_logging_enabled,omitzero"` // Name for the new workspace Name string `json:"name"` - // URL-friendly slug (lowercase alphanumeric and hyphens only) + // URL-friendly slug (lowercase alphanumeric segments separated by single hyphens, no leading/trailing hyphens) Slug string `json:"slug"` } +func (c CreateWorkspaceRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CreateWorkspaceRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + func (c *CreateWorkspaceRequest) GetDefaultImageModel() optionalnullable.OptionalNullable[string] { if c == nil { return nil @@ -55,6 +71,20 @@ func (c *CreateWorkspaceRequest) GetDescription() optionalnullable.OptionalNulla return c.Description } +func (c *CreateWorkspaceRequest) GetIoLoggingAPIKeyIds() optionalnullable.OptionalNullable[[]int64] { + if c == nil { + return nil + } + return c.IoLoggingAPIKeyIds +} + +func (c *CreateWorkspaceRequest) GetIoLoggingSamplingRate() *float64 { + if c == nil { + return nil + } + return c.IoLoggingSamplingRate +} + func (c *CreateWorkspaceRequest) GetIsDataDiscountLoggingEnabled() *bool { if c == nil { return nil diff --git a/models/components/customtool.go b/models/components/customtool.go index 7d68ba64..18cd7bab 100644 --- a/models/components/customtool.go +++ b/models/components/customtool.go @@ -252,35 +252,35 @@ func (u Format) MarshalJSON() ([]byte, error) { return nil, errors.New("could not marshal union type Format: all fields are null") } -type TypeCustom string +type CustomToolTypeCustom string const ( - TypeCustomCustom TypeCustom = "custom" + CustomToolTypeCustomCustom CustomToolTypeCustom = "custom" ) -func (e TypeCustom) ToPointer() *TypeCustom { +func (e CustomToolTypeCustom) ToPointer() *CustomToolTypeCustom { return &e } -func (e *TypeCustom) UnmarshalJSON(data []byte) error { +func (e *CustomToolTypeCustom) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err } switch v { case "custom": - *e = TypeCustom(v) + *e = CustomToolTypeCustom(v) return nil default: - return fmt.Errorf("invalid value for TypeCustom: %v", v) + return fmt.Errorf("invalid value for CustomToolTypeCustom: %v", v) } } // CustomTool - Custom tool configuration type CustomTool struct { - Description *string `json:"description,omitzero"` - Format *Format `json:"format,omitzero"` - Name string `json:"name"` - Type TypeCustom `json:"type"` + Description *string `json:"description,omitzero"` + Format *Format `json:"format,omitzero"` + Name string `json:"name"` + Type CustomToolTypeCustom `json:"type"` } func (c CustomTool) MarshalJSON() ([]byte, error) { @@ -329,9 +329,9 @@ func (c *CustomTool) GetName() string { return c.Name } -func (c *CustomTool) GetType() TypeCustom { +func (c *CustomTool) GetType() CustomToolTypeCustom { if c == nil { - return TypeCustom("") + return CustomToolTypeCustom("") } return c.Type } diff --git a/models/components/customtoolcallinputdeltaevent.go b/models/components/customtoolcallinputdeltaevent.go new file mode 100644 index 00000000..f052db60 --- /dev/null +++ b/models/components/customtoolcallinputdeltaevent.go @@ -0,0 +1,87 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type CustomToolCallInputDeltaEventType string + +const ( + CustomToolCallInputDeltaEventTypeResponseCustomToolCallInputDelta CustomToolCallInputDeltaEventType = "response.custom_tool_call_input.delta" +) + +func (e CustomToolCallInputDeltaEventType) ToPointer() *CustomToolCallInputDeltaEventType { + return &e +} +func (e *CustomToolCallInputDeltaEventType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "response.custom_tool_call_input.delta": + *e = CustomToolCallInputDeltaEventType(v) + return nil + default: + return fmt.Errorf("invalid value for CustomToolCallInputDeltaEventType: %v", v) + } +} + +// CustomToolCallInputDeltaEvent - Event emitted when a custom tool call's freeform input is being streamed. Mirrors `response.function_call_arguments.delta` but for `custom` tools whose input is opaque text rather than JSON arguments. +type CustomToolCallInputDeltaEvent struct { + Delta string `json:"delta"` + ItemID string `json:"item_id"` + OutputIndex int64 `json:"output_index"` + SequenceNumber int64 `json:"sequence_number"` + Type CustomToolCallInputDeltaEventType `json:"type"` +} + +func (c CustomToolCallInputDeltaEvent) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CustomToolCallInputDeltaEvent) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CustomToolCallInputDeltaEvent) GetDelta() string { + if c == nil { + return "" + } + return c.Delta +} + +func (c *CustomToolCallInputDeltaEvent) GetItemID() string { + if c == nil { + return "" + } + return c.ItemID +} + +func (c *CustomToolCallInputDeltaEvent) GetOutputIndex() int64 { + if c == nil { + return 0 + } + return c.OutputIndex +} + +func (c *CustomToolCallInputDeltaEvent) GetSequenceNumber() int64 { + if c == nil { + return 0 + } + return c.SequenceNumber +} + +func (c *CustomToolCallInputDeltaEvent) GetType() CustomToolCallInputDeltaEventType { + if c == nil { + return CustomToolCallInputDeltaEventType("") + } + return c.Type +} diff --git a/models/components/customtoolcallinputdoneevent.go b/models/components/customtoolcallinputdoneevent.go new file mode 100644 index 00000000..04d4219f --- /dev/null +++ b/models/components/customtoolcallinputdoneevent.go @@ -0,0 +1,87 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type CustomToolCallInputDoneEventType string + +const ( + CustomToolCallInputDoneEventTypeResponseCustomToolCallInputDone CustomToolCallInputDoneEventType = "response.custom_tool_call_input.done" +) + +func (e CustomToolCallInputDoneEventType) ToPointer() *CustomToolCallInputDoneEventType { + return &e +} +func (e *CustomToolCallInputDoneEventType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "response.custom_tool_call_input.done": + *e = CustomToolCallInputDoneEventType(v) + return nil + default: + return fmt.Errorf("invalid value for CustomToolCallInputDoneEventType: %v", v) + } +} + +// CustomToolCallInputDoneEvent - Event emitted when a custom tool call's freeform input streaming is complete. Mirrors `response.function_call_arguments.done` but for `custom` tools. +type CustomToolCallInputDoneEvent struct { + Input string `json:"input"` + ItemID string `json:"item_id"` + OutputIndex int64 `json:"output_index"` + SequenceNumber int64 `json:"sequence_number"` + Type CustomToolCallInputDoneEventType `json:"type"` +} + +func (c CustomToolCallInputDoneEvent) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CustomToolCallInputDoneEvent) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CustomToolCallInputDoneEvent) GetInput() string { + if c == nil { + return "" + } + return c.Input +} + +func (c *CustomToolCallInputDoneEvent) GetItemID() string { + if c == nil { + return "" + } + return c.ItemID +} + +func (c *CustomToolCallInputDoneEvent) GetOutputIndex() int64 { + if c == nil { + return 0 + } + return c.OutputIndex +} + +func (c *CustomToolCallInputDoneEvent) GetSequenceNumber() int64 { + if c == nil { + return 0 + } + return c.SequenceNumber +} + +func (c *CustomToolCallInputDoneEvent) GetType() CustomToolCallInputDoneEventType { + if c == nil { + return CustomToolCallInputDoneEventType("") + } + return c.Type +} diff --git a/models/components/customtoolcallitem.go b/models/components/customtoolcallitem.go new file mode 100644 index 00000000..38dbc3f7 --- /dev/null +++ b/models/components/customtoolcallitem.go @@ -0,0 +1,96 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type CustomToolCallItemType string + +const ( + CustomToolCallItemTypeCustomToolCall CustomToolCallItemType = "custom_tool_call" +) + +func (e CustomToolCallItemType) ToPointer() *CustomToolCallItemType { + return &e +} +func (e *CustomToolCallItemType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "custom_tool_call": + *e = CustomToolCallItemType(v) + return nil + default: + return fmt.Errorf("invalid value for CustomToolCallItemType: %v", v) + } +} + +// CustomToolCallItem - A call to a custom (freeform-grammar) tool created by the model — distinct from `function_call`. Used for tools like Codex CLI's `apply_patch` whose payload is opaque text rather than JSON arguments. +type CustomToolCallItem struct { + CallID string `json:"call_id"` + ID *string `json:"id,omitzero"` + Input string `json:"input"` + Name string `json:"name"` + // Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) + Namespace *string `json:"namespace,omitzero"` + Type CustomToolCallItemType `json:"type"` +} + +func (c CustomToolCallItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CustomToolCallItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CustomToolCallItem) GetCallID() string { + if c == nil { + return "" + } + return c.CallID +} + +func (c *CustomToolCallItem) GetID() *string { + if c == nil { + return nil + } + return c.ID +} + +func (c *CustomToolCallItem) GetInput() string { + if c == nil { + return "" + } + return c.Input +} + +func (c *CustomToolCallItem) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +func (c *CustomToolCallItem) GetNamespace() *string { + if c == nil { + return nil + } + return c.Namespace +} + +func (c *CustomToolCallItem) GetType() CustomToolCallItemType { + if c == nil { + return CustomToolCallItemType("") + } + return c.Type +} diff --git a/models/components/customtoolcalloutputitem.go b/models/components/customtoolcalloutputitem.go new file mode 100644 index 00000000..d5f05654 --- /dev/null +++ b/models/components/customtoolcalloutputitem.go @@ -0,0 +1,368 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "errors" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type CustomToolCallOutputItemDetail string + +const ( + CustomToolCallOutputItemDetailAuto CustomToolCallOutputItemDetail = "auto" + CustomToolCallOutputItemDetailHigh CustomToolCallOutputItemDetail = "high" + CustomToolCallOutputItemDetailLow CustomToolCallOutputItemDetail = "low" + CustomToolCallOutputItemDetailOriginal CustomToolCallOutputItemDetail = "original" +) + +func (e CustomToolCallOutputItemDetail) ToPointer() *CustomToolCallOutputItemDetail { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *CustomToolCallOutputItemDetail) IsExact() bool { + if e != nil { + switch *e { + case "auto", "high", "low", "original": + return true + } + } + return false +} + +type CustomToolCallOutputItemTypeInputImage string + +const ( + CustomToolCallOutputItemTypeInputImageInputImage CustomToolCallOutputItemTypeInputImage = "input_image" +) + +func (e CustomToolCallOutputItemTypeInputImage) ToPointer() *CustomToolCallOutputItemTypeInputImage { + return &e +} +func (e *CustomToolCallOutputItemTypeInputImage) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "input_image": + *e = CustomToolCallOutputItemTypeInputImage(v) + return nil + default: + return fmt.Errorf("invalid value for CustomToolCallOutputItemTypeInputImage: %v", v) + } +} + +// CustomToolCallOutputItemOutputInputImage - Image input content item +type CustomToolCallOutputItemOutputInputImage struct { + Detail CustomToolCallOutputItemDetail `json:"detail"` + ImageURL optionalnullable.OptionalNullable[string] `json:"image_url,omitzero"` + Type CustomToolCallOutputItemTypeInputImage `json:"type"` +} + +func (c CustomToolCallOutputItemOutputInputImage) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CustomToolCallOutputItemOutputInputImage) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CustomToolCallOutputItemOutputInputImage) GetDetail() CustomToolCallOutputItemDetail { + if c == nil { + return CustomToolCallOutputItemDetail("") + } + return c.Detail +} + +func (c *CustomToolCallOutputItemOutputInputImage) GetImageURL() optionalnullable.OptionalNullable[string] { + if c == nil { + return nil + } + return c.ImageURL +} + +func (c *CustomToolCallOutputItemOutputInputImage) GetType() CustomToolCallOutputItemTypeInputImage { + if c == nil { + return CustomToolCallOutputItemTypeInputImage("") + } + return c.Type +} + +type CustomToolCallOutputItemOutputUnion1Type string + +const ( + CustomToolCallOutputItemOutputUnion1TypeInputText CustomToolCallOutputItemOutputUnion1Type = "input_text" + CustomToolCallOutputItemOutputUnion1TypeInputImage CustomToolCallOutputItemOutputUnion1Type = "input_image" + CustomToolCallOutputItemOutputUnion1TypeInputFile CustomToolCallOutputItemOutputUnion1Type = "input_file" +) + +type CustomToolCallOutputItemOutputUnion1 struct { + InputText *InputText `queryParam:"inline" union:"member"` + CustomToolCallOutputItemOutputInputImage *CustomToolCallOutputItemOutputInputImage `queryParam:"inline" union:"member"` + InputFile *InputFile `queryParam:"inline" union:"member"` + + Type CustomToolCallOutputItemOutputUnion1Type +} + +func CreateCustomToolCallOutputItemOutputUnion1InputText(inputText InputText) CustomToolCallOutputItemOutputUnion1 { + typ := CustomToolCallOutputItemOutputUnion1TypeInputText + + typStr := InputTextType(typ) + inputText.Type = typStr + + return CustomToolCallOutputItemOutputUnion1{ + InputText: &inputText, + Type: typ, + } +} + +func CreateCustomToolCallOutputItemOutputUnion1InputImage(inputImage CustomToolCallOutputItemOutputInputImage) CustomToolCallOutputItemOutputUnion1 { + typ := CustomToolCallOutputItemOutputUnion1TypeInputImage + + typStr := CustomToolCallOutputItemTypeInputImage(typ) + inputImage.Type = typStr + + return CustomToolCallOutputItemOutputUnion1{ + CustomToolCallOutputItemOutputInputImage: &inputImage, + Type: typ, + } +} + +func CreateCustomToolCallOutputItemOutputUnion1InputFile(inputFile InputFile) CustomToolCallOutputItemOutputUnion1 { + typ := CustomToolCallOutputItemOutputUnion1TypeInputFile + + typStr := InputFileType(typ) + inputFile.Type = typStr + + return CustomToolCallOutputItemOutputUnion1{ + InputFile: &inputFile, + Type: typ, + } +} + +func (u *CustomToolCallOutputItemOutputUnion1) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + return fmt.Errorf("could not unmarshal discriminator: %w", err) + } + + switch dis.Type { + case "input_text": + inputText := new(InputText) + if err := utils.UnmarshalJSON(data, &inputText, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == input_text) type InputText within CustomToolCallOutputItemOutputUnion1: %w", string(data), err) + } + + u.InputText = inputText + u.Type = CustomToolCallOutputItemOutputUnion1TypeInputText + return nil + case "input_image": + customToolCallOutputItemOutputInputImage := new(CustomToolCallOutputItemOutputInputImage) + if err := utils.UnmarshalJSON(data, &customToolCallOutputItemOutputInputImage, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == input_image) type CustomToolCallOutputItemOutputInputImage within CustomToolCallOutputItemOutputUnion1: %w", string(data), err) + } + + u.CustomToolCallOutputItemOutputInputImage = customToolCallOutputItemOutputInputImage + u.Type = CustomToolCallOutputItemOutputUnion1TypeInputImage + return nil + case "input_file": + inputFile := new(InputFile) + if err := utils.UnmarshalJSON(data, &inputFile, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == input_file) type InputFile within CustomToolCallOutputItemOutputUnion1: %w", string(data), err) + } + + u.InputFile = inputFile + u.Type = CustomToolCallOutputItemOutputUnion1TypeInputFile + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for CustomToolCallOutputItemOutputUnion1", string(data)) +} + +func (u CustomToolCallOutputItemOutputUnion1) MarshalJSON() ([]byte, error) { + if u.InputText != nil { + return utils.MarshalJSON(u.InputText, "", true) + } + + if u.CustomToolCallOutputItemOutputInputImage != nil { + return utils.MarshalJSON(u.CustomToolCallOutputItemOutputInputImage, "", true) + } + + if u.InputFile != nil { + return utils.MarshalJSON(u.InputFile, "", true) + } + + return nil, errors.New("could not marshal union type CustomToolCallOutputItemOutputUnion1: all fields are null") +} + +type CustomToolCallOutputItemOutputUnion2Type string + +const ( + CustomToolCallOutputItemOutputUnion2TypeStr CustomToolCallOutputItemOutputUnion2Type = "str" + CustomToolCallOutputItemOutputUnion2TypeArrayOfCustomToolCallOutputItemOutputUnion1 CustomToolCallOutputItemOutputUnion2Type = "arrayOfCustomToolCallOutputItemOutputUnion1" +) + +type CustomToolCallOutputItemOutputUnion2 struct { + Str *string `queryParam:"inline" union:"member"` + ArrayOfCustomToolCallOutputItemOutputUnion1 []CustomToolCallOutputItemOutputUnion1 `queryParam:"inline" union:"member"` + + Type CustomToolCallOutputItemOutputUnion2Type +} + +func CreateCustomToolCallOutputItemOutputUnion2Str(str string) CustomToolCallOutputItemOutputUnion2 { + typ := CustomToolCallOutputItemOutputUnion2TypeStr + + return CustomToolCallOutputItemOutputUnion2{ + Str: &str, + Type: typ, + } +} + +func CreateCustomToolCallOutputItemOutputUnion2ArrayOfCustomToolCallOutputItemOutputUnion1(arrayOfCustomToolCallOutputItemOutputUnion1 []CustomToolCallOutputItemOutputUnion1) CustomToolCallOutputItemOutputUnion2 { + typ := CustomToolCallOutputItemOutputUnion2TypeArrayOfCustomToolCallOutputItemOutputUnion1 + + return CustomToolCallOutputItemOutputUnion2{ + ArrayOfCustomToolCallOutputItemOutputUnion1: arrayOfCustomToolCallOutputItemOutputUnion1, + Type: typ, + } +} + +func (u *CustomToolCallOutputItemOutputUnion2) UnmarshalJSON(data []byte) error { + + var candidates []utils.UnionCandidate + + // Collect all valid candidates + var str string = "" + if err := utils.UnmarshalJSON(data, &str, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: CustomToolCallOutputItemOutputUnion2TypeStr, + Value: &str, + }) + } + + var arrayOfCustomToolCallOutputItemOutputUnion1 []CustomToolCallOutputItemOutputUnion1 = []CustomToolCallOutputItemOutputUnion1{} + if err := utils.UnmarshalJSON(data, &arrayOfCustomToolCallOutputItemOutputUnion1, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: CustomToolCallOutputItemOutputUnion2TypeArrayOfCustomToolCallOutputItemOutputUnion1, + Value: arrayOfCustomToolCallOutputItemOutputUnion1, + }) + } + + if len(candidates) == 0 { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for CustomToolCallOutputItemOutputUnion2", string(data)) + } + + // Pick the best candidate using multi-stage filtering + best := utils.PickBestUnionCandidate(candidates, data) + if best == nil { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for CustomToolCallOutputItemOutputUnion2", string(data)) + } + + // Set the union type and value based on the best candidate + u.Type = best.Type.(CustomToolCallOutputItemOutputUnion2Type) + switch best.Type { + case CustomToolCallOutputItemOutputUnion2TypeStr: + u.Str = best.Value.(*string) + return nil + case CustomToolCallOutputItemOutputUnion2TypeArrayOfCustomToolCallOutputItemOutputUnion1: + u.ArrayOfCustomToolCallOutputItemOutputUnion1 = best.Value.([]CustomToolCallOutputItemOutputUnion1) + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for CustomToolCallOutputItemOutputUnion2", string(data)) +} + +func (u CustomToolCallOutputItemOutputUnion2) MarshalJSON() ([]byte, error) { + if u.Str != nil { + return utils.MarshalJSON(u.Str, "", true) + } + + if u.ArrayOfCustomToolCallOutputItemOutputUnion1 != nil { + return utils.MarshalJSON(u.ArrayOfCustomToolCallOutputItemOutputUnion1, "", true) + } + + return nil, errors.New("could not marshal union type CustomToolCallOutputItemOutputUnion2: all fields are null") +} + +type CustomToolCallOutputItemTypeCustomToolCallOutput string + +const ( + CustomToolCallOutputItemTypeCustomToolCallOutputCustomToolCallOutput CustomToolCallOutputItemTypeCustomToolCallOutput = "custom_tool_call_output" +) + +func (e CustomToolCallOutputItemTypeCustomToolCallOutput) ToPointer() *CustomToolCallOutputItemTypeCustomToolCallOutput { + return &e +} +func (e *CustomToolCallOutputItemTypeCustomToolCallOutput) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "custom_tool_call_output": + *e = CustomToolCallOutputItemTypeCustomToolCallOutput(v) + return nil + default: + return fmt.Errorf("invalid value for CustomToolCallOutputItemTypeCustomToolCallOutput: %v", v) + } +} + +// CustomToolCallOutputItem - The output from a custom (freeform-grammar) tool call execution. Mirrors `function_call_output` but is matched to a `custom_tool_call` rather than a `function_call`. +type CustomToolCallOutputItem struct { + CallID string `json:"call_id"` + ID *string `json:"id,omitzero"` + Output CustomToolCallOutputItemOutputUnion2 `json:"output"` + Type CustomToolCallOutputItemTypeCustomToolCallOutput `json:"type"` +} + +func (c CustomToolCallOutputItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *CustomToolCallOutputItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *CustomToolCallOutputItem) GetCallID() string { + if c == nil { + return "" + } + return c.CallID +} + +func (c *CustomToolCallOutputItem) GetID() *string { + if c == nil { + return nil + } + return c.ID +} + +func (c *CustomToolCallOutputItem) GetOutput() CustomToolCallOutputItemOutputUnion2 { + if c == nil { + return CustomToolCallOutputItemOutputUnion2{} + } + return c.Output +} + +func (c *CustomToolCallOutputItem) GetType() CustomToolCallOutputItemTypeCustomToolCallOutput { + if c == nil { + return CustomToolCallOutputItemTypeCustomToolCallOutput("") + } + return c.Type +} diff --git a/models/components/dabenchmarkentry.go b/models/components/dabenchmarkentry.go new file mode 100644 index 00000000..62b4ae07 --- /dev/null +++ b/models/components/dabenchmarkentry.go @@ -0,0 +1,52 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// DABenchmarkEntry - A single Design Arena benchmark entry for a specific arena+category +type DABenchmarkEntry struct { + // Arena type (e.g. models, builders, agents) + Arena string `json:"arena"` + // Category within the arena (e.g. website, gamedev, uicomponent) + Category string `json:"category"` + // ELO rating from head-to-head arena battles + Elo float64 `json:"elo"` + // Rank position within this arena+category among models available on OpenRouter (1 = highest ELO) + Rank int64 `json:"rank"` + // Win rate percentage in arena battles + WinRate float64 `json:"win_rate"` +} + +func (d *DABenchmarkEntry) GetArena() string { + if d == nil { + return "" + } + return d.Arena +} + +func (d *DABenchmarkEntry) GetCategory() string { + if d == nil { + return "" + } + return d.Category +} + +func (d *DABenchmarkEntry) GetElo() float64 { + if d == nil { + return 0.0 + } + return d.Elo +} + +func (d *DABenchmarkEntry) GetRank() int64 { + if d == nil { + return 0 + } + return d.Rank +} + +func (d *DABenchmarkEntry) GetWinRate() float64 { + if d == nil { + return 0.0 + } + return d.WinRate +} diff --git a/models/components/deletebyokkeyresponse.go b/models/components/deletebyokkeyresponse.go new file mode 100644 index 00000000..70a06c79 --- /dev/null +++ b/models/components/deletebyokkeyresponse.go @@ -0,0 +1,28 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type DeleteBYOKKeyResponse struct { + // Confirmation that the BYOK credential was deleted. + //lint:ignore U1000 accessed via reflection for JSON marshaling + deleted bool `const:"true" json:"deleted"` +} + +func (d DeleteBYOKKeyResponse) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteBYOKKeyResponse) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DeleteBYOKKeyResponse) GetDeleted() bool { + return true +} diff --git a/models/components/deleteobservabilitydestinationresponse.go b/models/components/deleteobservabilitydestinationresponse.go new file mode 100644 index 00000000..fbf6d743 --- /dev/null +++ b/models/components/deleteobservabilitydestinationresponse.go @@ -0,0 +1,28 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type DeleteObservabilityDestinationResponse struct { + // Always `true` on success. + //lint:ignore U1000 accessed via reflection for JSON marshaling + deleted bool `const:"true" json:"deleted"` +} + +func (d DeleteObservabilityDestinationResponse) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DeleteObservabilityDestinationResponse) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DeleteObservabilityDestinationResponse) GetDeleted() bool { + return true +} diff --git a/models/components/easyinputmessage.go b/models/components/easyinputmessage.go index a3171fb1..7ee219bd 100644 --- a/models/components/easyinputmessage.go +++ b/models/components/easyinputmessage.go @@ -13,9 +13,10 @@ import ( type EasyInputMessageDetail string const ( - EasyInputMessageDetailAuto EasyInputMessageDetail = "auto" - EasyInputMessageDetailHigh EasyInputMessageDetail = "high" - EasyInputMessageDetailLow EasyInputMessageDetail = "low" + EasyInputMessageDetailAuto EasyInputMessageDetail = "auto" + EasyInputMessageDetailHigh EasyInputMessageDetail = "high" + EasyInputMessageDetailLow EasyInputMessageDetail = "low" + EasyInputMessageDetailOriginal EasyInputMessageDetail = "original" ) func (e EasyInputMessageDetail) ToPointer() *EasyInputMessageDetail { @@ -26,33 +27,33 @@ func (e EasyInputMessageDetail) ToPointer() *EasyInputMessageDetail { func (e *EasyInputMessageDetail) IsExact() bool { if e != nil { switch *e { - case "auto", "high", "low": + case "auto", "high", "low", "original": return true } } return false } -type EasyInputMessageContentType string +type EasyInputMessageTypeInputImage string const ( - EasyInputMessageContentTypeInputImage EasyInputMessageContentType = "input_image" + EasyInputMessageTypeInputImageInputImage EasyInputMessageTypeInputImage = "input_image" ) -func (e EasyInputMessageContentType) ToPointer() *EasyInputMessageContentType { +func (e EasyInputMessageTypeInputImage) ToPointer() *EasyInputMessageTypeInputImage { return &e } -func (e *EasyInputMessageContentType) UnmarshalJSON(data []byte) error { +func (e *EasyInputMessageTypeInputImage) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err } switch v { case "input_image": - *e = EasyInputMessageContentType(v) + *e = EasyInputMessageTypeInputImage(v) return nil default: - return fmt.Errorf("invalid value for EasyInputMessageContentType: %v", v) + return fmt.Errorf("invalid value for EasyInputMessageTypeInputImage: %v", v) } } @@ -60,7 +61,7 @@ func (e *EasyInputMessageContentType) UnmarshalJSON(data []byte) error { type EasyInputMessageContentInputImage struct { Detail EasyInputMessageDetail `json:"detail"` ImageURL optionalnullable.OptionalNullable[string] `json:"image_url,omitzero"` - Type EasyInputMessageContentType `json:"type"` + Type EasyInputMessageTypeInputImage `json:"type"` } func (e EasyInputMessageContentInputImage) MarshalJSON() ([]byte, error) { @@ -88,9 +89,9 @@ func (e *EasyInputMessageContentInputImage) GetImageURL() optionalnullable.Optio return e.ImageURL } -func (e *EasyInputMessageContentInputImage) GetType() EasyInputMessageContentType { +func (e *EasyInputMessageContentInputImage) GetType() EasyInputMessageTypeInputImage { if e == nil { - return EasyInputMessageContentType("") + return EasyInputMessageTypeInputImage("") } return e.Type } @@ -130,7 +131,7 @@ func CreateEasyInputMessageContentUnion1InputText(inputText InputText) EasyInput func CreateEasyInputMessageContentUnion1InputImage(inputImage EasyInputMessageContentInputImage) EasyInputMessageContentUnion1 { typ := EasyInputMessageContentUnion1TypeInputImage - typStr := EasyInputMessageContentType(typ) + typStr := EasyInputMessageTypeInputImage(typ) inputImage.Type = typStr return EasyInputMessageContentUnion1{ diff --git a/models/components/endpointinfo.go b/models/components/endpointinfo.go new file mode 100644 index 00000000..a7c755ba --- /dev/null +++ b/models/components/endpointinfo.go @@ -0,0 +1,45 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type EndpointInfo struct { + Model string `json:"model"` + Provider string `json:"provider"` + Selected bool `json:"selected"` +} + +func (e EndpointInfo) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *EndpointInfo) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, nil); err != nil { + return err + } + return nil +} + +func (e *EndpointInfo) GetModel() string { + if e == nil { + return "" + } + return e.Model +} + +func (e *EndpointInfo) GetProvider() string { + if e == nil { + return "" + } + return e.Provider +} + +func (e *EndpointInfo) GetSelected() bool { + if e == nil { + return false + } + return e.Selected +} diff --git a/models/components/endpointsmetadata.go b/models/components/endpointsmetadata.go new file mode 100644 index 00000000..9bfecae4 --- /dev/null +++ b/models/components/endpointsmetadata.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type EndpointsMetadata struct { + Available []EndpointInfo `json:"available"` + Total int64 `json:"total"` +} + +func (e EndpointsMetadata) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *EndpointsMetadata) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, nil); err != nil { + return err + } + return nil +} + +func (e *EndpointsMetadata) GetAvailable() []EndpointInfo { + if e == nil { + return []EndpointInfo{} + } + return e.Available +} + +func (e *EndpointsMetadata) GetTotal() int64 { + if e == nil { + return 0 + } + return e.Total +} diff --git a/models/components/filedeleteresponse.go b/models/components/filedeleteresponse.go new file mode 100644 index 00000000..cd4d25ad --- /dev/null +++ b/models/components/filedeleteresponse.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type FileDeleteResponseType string + +const ( + FileDeleteResponseTypeFileDeleted FileDeleteResponseType = "file_deleted" +) + +func (e FileDeleteResponseType) ToPointer() *FileDeleteResponseType { + return &e +} +func (e *FileDeleteResponseType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "file_deleted": + *e = FileDeleteResponseType(v) + return nil + default: + return fmt.Errorf("invalid value for FileDeleteResponseType: %v", v) + } +} + +// FileDeleteResponse - Confirmation that a file was deleted. +type FileDeleteResponse struct { + ID string `json:"id"` + Type FileDeleteResponseType `json:"type"` +} + +func (f *FileDeleteResponse) GetID() string { + if f == nil { + return "" + } + return f.ID +} + +func (f *FileDeleteResponse) GetType() FileDeleteResponseType { + if f == nil { + return FileDeleteResponseType("") + } + return f.Type +} diff --git a/models/components/filelistresponse.go b/models/components/filelistresponse.go new file mode 100644 index 00000000..11ffe9b7 --- /dev/null +++ b/models/components/filelistresponse.go @@ -0,0 +1,48 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// FileListResponse - A page of files belonging to the requesting workspace. +type FileListResponse struct { + // Opaque cursor for the next page; null when there are no more results. + Cursor *string `json:"cursor"` + Data []FileMetadata `json:"data"` + FirstID *string `json:"first_id"` + HasMore bool `json:"has_more"` + LastID *string `json:"last_id"` +} + +func (f *FileListResponse) GetCursor() *string { + if f == nil { + return nil + } + return f.Cursor +} + +func (f *FileListResponse) GetData() []FileMetadata { + if f == nil { + return []FileMetadata{} + } + return f.Data +} + +func (f *FileListResponse) GetFirstID() *string { + if f == nil { + return nil + } + return f.FirstID +} + +func (f *FileListResponse) GetHasMore() bool { + if f == nil { + return false + } + return f.HasMore +} + +func (f *FileListResponse) GetLastID() *string { + if f == nil { + return nil + } + return f.LastID +} diff --git a/models/components/filemetadata.go b/models/components/filemetadata.go new file mode 100644 index 00000000..df1cf9b9 --- /dev/null +++ b/models/components/filemetadata.go @@ -0,0 +1,91 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +type FileMetadataType string + +const ( + FileMetadataTypeFile FileMetadataType = "file" +) + +func (e FileMetadataType) ToPointer() *FileMetadataType { + return &e +} +func (e *FileMetadataType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "file": + *e = FileMetadataType(v) + return nil + default: + return fmt.Errorf("invalid value for FileMetadataType: %v", v) + } +} + +// FileMetadata - Metadata describing a stored file. +type FileMetadata struct { + CreatedAt string `json:"created_at"` + Downloadable bool `json:"downloadable"` + Filename string `json:"filename"` + ID string `json:"id"` + MimeType string `json:"mime_type"` + SizeBytes int64 `json:"size_bytes"` + Type FileMetadataType `json:"type"` +} + +func (f *FileMetadata) GetCreatedAt() string { + if f == nil { + return "" + } + return f.CreatedAt +} + +func (f *FileMetadata) GetDownloadable() bool { + if f == nil { + return false + } + return f.Downloadable +} + +func (f *FileMetadata) GetFilename() string { + if f == nil { + return "" + } + return f.Filename +} + +func (f *FileMetadata) GetID() string { + if f == nil { + return "" + } + return f.ID +} + +func (f *FileMetadata) GetMimeType() string { + if f == nil { + return "" + } + return f.MimeType +} + +func (f *FileMetadata) GetSizeBytes() int64 { + if f == nil { + return 0 + } + return f.SizeBytes +} + +func (f *FileMetadata) GetType() FileMetadataType { + if f == nil { + return FileMetadataType("") + } + return f.Type +} diff --git a/models/components/filesearchservertool.go b/models/components/filesearchservertool.go index eefcb921..a8e115ba 100644 --- a/models/components/filesearchservertool.go +++ b/models/components/filesearchservertool.go @@ -36,39 +36,39 @@ func (e *FiltersType) IsExact() bool { return false } -type Value1Type string +type FileSearchServerToolValue1Type string const ( - Value1TypeStr Value1Type = "str" - Value1TypeNumber Value1Type = "number" + FileSearchServerToolValue1TypeStr FileSearchServerToolValue1Type = "str" + FileSearchServerToolValue1TypeNumber FileSearchServerToolValue1Type = "number" ) -type Value1 struct { +type FileSearchServerToolValue1 struct { Str *string `queryParam:"inline" union:"member"` Number *float64 `queryParam:"inline" union:"member"` - Type Value1Type + Type FileSearchServerToolValue1Type } -func CreateValue1Str(str string) Value1 { - typ := Value1TypeStr +func CreateFileSearchServerToolValue1Str(str string) FileSearchServerToolValue1 { + typ := FileSearchServerToolValue1TypeStr - return Value1{ + return FileSearchServerToolValue1{ Str: &str, Type: typ, } } -func CreateValue1Number(number float64) Value1 { - typ := Value1TypeNumber +func CreateFileSearchServerToolValue1Number(number float64) FileSearchServerToolValue1 { + typ := FileSearchServerToolValue1TypeNumber - return Value1{ + return FileSearchServerToolValue1{ Number: &number, Type: typ, } } -func (u *Value1) UnmarshalJSON(data []byte) error { +func (u *FileSearchServerToolValue1) UnmarshalJSON(data []byte) error { var candidates []utils.UnionCandidate @@ -76,7 +76,7 @@ func (u *Value1) UnmarshalJSON(data []byte) error { var str string = "" if err := utils.UnmarshalJSON(data, &str, "", true, nil); err == nil { candidates = append(candidates, utils.UnionCandidate{ - Type: Value1TypeStr, + Type: FileSearchServerToolValue1TypeStr, Value: &str, }) } @@ -84,36 +84,36 @@ func (u *Value1) UnmarshalJSON(data []byte) error { var number float64 = float64(0) if err := utils.UnmarshalJSON(data, &number, "", true, nil); err == nil { candidates = append(candidates, utils.UnionCandidate{ - Type: Value1TypeNumber, + Type: FileSearchServerToolValue1TypeNumber, Value: &number, }) } if len(candidates) == 0 { - return fmt.Errorf("could not unmarshal `%s` into any supported union types for Value1", string(data)) + return fmt.Errorf("could not unmarshal `%s` into any supported union types for FileSearchServerToolValue1", string(data)) } // Pick the best candidate using multi-stage filtering best := utils.PickBestUnionCandidate(candidates, data) if best == nil { - return fmt.Errorf("could not unmarshal `%s` into any supported union types for Value1", string(data)) + return fmt.Errorf("could not unmarshal `%s` into any supported union types for FileSearchServerToolValue1", string(data)) } // Set the union type and value based on the best candidate - u.Type = best.Type.(Value1Type) + u.Type = best.Type.(FileSearchServerToolValue1Type) switch best.Type { - case Value1TypeStr: + case FileSearchServerToolValue1TypeStr: u.Str = best.Value.(*string) return nil - case Value1TypeNumber: + case FileSearchServerToolValue1TypeNumber: u.Number = best.Value.(*float64) return nil } - return fmt.Errorf("could not unmarshal `%s` into any supported union types for Value1", string(data)) + return fmt.Errorf("could not unmarshal `%s` into any supported union types for FileSearchServerToolValue1", string(data)) } -func (u Value1) MarshalJSON() ([]byte, error) { +func (u FileSearchServerToolValue1) MarshalJSON() ([]byte, error) { if u.Str != nil { return utils.MarshalJSON(u.Str, "", true) } @@ -122,64 +122,64 @@ func (u Value1) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.Number, "", true) } - return nil, errors.New("could not marshal union type Value1: all fields are null") + return nil, errors.New("could not marshal union type FileSearchServerToolValue1: all fields are null") } -type Value2Type string +type FileSearchServerToolValue2Type string const ( - Value2TypeStr Value2Type = "str" - Value2TypeNumber Value2Type = "number" - Value2TypeBoolean Value2Type = "boolean" - Value2TypeArrayOfValue1 Value2Type = "arrayOfValue1" + FileSearchServerToolValue2TypeStr FileSearchServerToolValue2Type = "str" + FileSearchServerToolValue2TypeNumber FileSearchServerToolValue2Type = "number" + FileSearchServerToolValue2TypeBoolean FileSearchServerToolValue2Type = "boolean" + FileSearchServerToolValue2TypeArrayOfFileSearchServerToolValue1 FileSearchServerToolValue2Type = "arrayOfFileSearchServerToolValue1" ) -type Value2 struct { - Str *string `queryParam:"inline" union:"member"` - Number *float64 `queryParam:"inline" union:"member"` - Boolean *bool `queryParam:"inline" union:"member"` - ArrayOfValue1 []Value1 `queryParam:"inline" union:"member"` +type FileSearchServerToolValue2 struct { + Str *string `queryParam:"inline" union:"member"` + Number *float64 `queryParam:"inline" union:"member"` + Boolean *bool `queryParam:"inline" union:"member"` + ArrayOfFileSearchServerToolValue1 []FileSearchServerToolValue1 `queryParam:"inline" union:"member"` - Type Value2Type + Type FileSearchServerToolValue2Type } -func CreateValue2Str(str string) Value2 { - typ := Value2TypeStr +func CreateFileSearchServerToolValue2Str(str string) FileSearchServerToolValue2 { + typ := FileSearchServerToolValue2TypeStr - return Value2{ + return FileSearchServerToolValue2{ Str: &str, Type: typ, } } -func CreateValue2Number(number float64) Value2 { - typ := Value2TypeNumber +func CreateFileSearchServerToolValue2Number(number float64) FileSearchServerToolValue2 { + typ := FileSearchServerToolValue2TypeNumber - return Value2{ + return FileSearchServerToolValue2{ Number: &number, Type: typ, } } -func CreateValue2Boolean(boolean bool) Value2 { - typ := Value2TypeBoolean +func CreateFileSearchServerToolValue2Boolean(boolean bool) FileSearchServerToolValue2 { + typ := FileSearchServerToolValue2TypeBoolean - return Value2{ + return FileSearchServerToolValue2{ Boolean: &boolean, Type: typ, } } -func CreateValue2ArrayOfValue1(arrayOfValue1 []Value1) Value2 { - typ := Value2TypeArrayOfValue1 +func CreateFileSearchServerToolValue2ArrayOfFileSearchServerToolValue1(arrayOfFileSearchServerToolValue1 []FileSearchServerToolValue1) FileSearchServerToolValue2 { + typ := FileSearchServerToolValue2TypeArrayOfFileSearchServerToolValue1 - return Value2{ - ArrayOfValue1: arrayOfValue1, - Type: typ, + return FileSearchServerToolValue2{ + ArrayOfFileSearchServerToolValue1: arrayOfFileSearchServerToolValue1, + Type: typ, } } -func (u *Value2) UnmarshalJSON(data []byte) error { +func (u *FileSearchServerToolValue2) UnmarshalJSON(data []byte) error { var candidates []utils.UnionCandidate @@ -187,7 +187,7 @@ func (u *Value2) UnmarshalJSON(data []byte) error { var str string = "" if err := utils.UnmarshalJSON(data, &str, "", true, nil); err == nil { candidates = append(candidates, utils.UnionCandidate{ - Type: Value2TypeStr, + Type: FileSearchServerToolValue2TypeStr, Value: &str, }) } @@ -195,7 +195,7 @@ func (u *Value2) UnmarshalJSON(data []byte) error { var number float64 = float64(0) if err := utils.UnmarshalJSON(data, &number, "", true, nil); err == nil { candidates = append(candidates, utils.UnionCandidate{ - Type: Value2TypeNumber, + Type: FileSearchServerToolValue2TypeNumber, Value: &number, }) } @@ -203,50 +203,50 @@ func (u *Value2) UnmarshalJSON(data []byte) error { var boolean bool = false if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { candidates = append(candidates, utils.UnionCandidate{ - Type: Value2TypeBoolean, + Type: FileSearchServerToolValue2TypeBoolean, Value: &boolean, }) } - var arrayOfValue1 []Value1 = []Value1{} - if err := utils.UnmarshalJSON(data, &arrayOfValue1, "", true, nil); err == nil { + var arrayOfFileSearchServerToolValue1 []FileSearchServerToolValue1 = []FileSearchServerToolValue1{} + if err := utils.UnmarshalJSON(data, &arrayOfFileSearchServerToolValue1, "", true, nil); err == nil { candidates = append(candidates, utils.UnionCandidate{ - Type: Value2TypeArrayOfValue1, - Value: arrayOfValue1, + Type: FileSearchServerToolValue2TypeArrayOfFileSearchServerToolValue1, + Value: arrayOfFileSearchServerToolValue1, }) } if len(candidates) == 0 { - return fmt.Errorf("could not unmarshal `%s` into any supported union types for Value2", string(data)) + return fmt.Errorf("could not unmarshal `%s` into any supported union types for FileSearchServerToolValue2", string(data)) } // Pick the best candidate using multi-stage filtering best := utils.PickBestUnionCandidate(candidates, data) if best == nil { - return fmt.Errorf("could not unmarshal `%s` into any supported union types for Value2", string(data)) + return fmt.Errorf("could not unmarshal `%s` into any supported union types for FileSearchServerToolValue2", string(data)) } // Set the union type and value based on the best candidate - u.Type = best.Type.(Value2Type) + u.Type = best.Type.(FileSearchServerToolValue2Type) switch best.Type { - case Value2TypeStr: + case FileSearchServerToolValue2TypeStr: u.Str = best.Value.(*string) return nil - case Value2TypeNumber: + case FileSearchServerToolValue2TypeNumber: u.Number = best.Value.(*float64) return nil - case Value2TypeBoolean: + case FileSearchServerToolValue2TypeBoolean: u.Boolean = best.Value.(*bool) return nil - case Value2TypeArrayOfValue1: - u.ArrayOfValue1 = best.Value.([]Value1) + case FileSearchServerToolValue2TypeArrayOfFileSearchServerToolValue1: + u.ArrayOfFileSearchServerToolValue1 = best.Value.([]FileSearchServerToolValue1) return nil } - return fmt.Errorf("could not unmarshal `%s` into any supported union types for Value2", string(data)) + return fmt.Errorf("could not unmarshal `%s` into any supported union types for FileSearchServerToolValue2", string(data)) } -func (u Value2) MarshalJSON() ([]byte, error) { +func (u FileSearchServerToolValue2) MarshalJSON() ([]byte, error) { if u.Str != nil { return utils.MarshalJSON(u.Str, "", true) } @@ -259,17 +259,17 @@ func (u Value2) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.Boolean, "", true) } - if u.ArrayOfValue1 != nil { - return utils.MarshalJSON(u.ArrayOfValue1, "", true) + if u.ArrayOfFileSearchServerToolValue1 != nil { + return utils.MarshalJSON(u.ArrayOfFileSearchServerToolValue1, "", true) } - return nil, errors.New("could not marshal union type Value2: all fields are null") + return nil, errors.New("could not marshal union type FileSearchServerToolValue2: all fields are null") } type Filters struct { - Key string `json:"key"` - Type FiltersType `json:"type"` - Value Value2 `json:"value"` + Key string `json:"key"` + Type FiltersType `json:"type"` + Value FileSearchServerToolValue2 `json:"value"` } func (f Filters) MarshalJSON() ([]byte, error) { @@ -297,9 +297,9 @@ func (f *Filters) GetType() FiltersType { return f.Type } -func (f *Filters) GetValue() Value2 { +func (f *Filters) GetValue() FileSearchServerToolValue2 { if f == nil { - return Value2{} + return FileSearchServerToolValue2{} } return f.Value } diff --git a/models/components/functioncallitem.go b/models/components/functioncallitem.go index 6c7282d7..fbc6275e 100644 --- a/models/components/functioncallitem.go +++ b/models/components/functioncallitem.go @@ -33,10 +33,12 @@ func (e *FunctionCallItemType) UnmarshalJSON(data []byte) error { // FunctionCallItem - A function call initiated by the model type FunctionCallItem struct { - Arguments string `json:"arguments"` - CallID string `json:"call_id"` - ID string `json:"id"` - Name string `json:"name"` + Arguments string `json:"arguments"` + CallID string `json:"call_id"` + ID string `json:"id"` + Name string `json:"name"` + // Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) + Namespace *string `json:"namespace,omitzero"` Status *ToolCallStatus `json:"status,omitzero"` Type FunctionCallItemType `json:"type"` } @@ -80,6 +82,13 @@ func (f *FunctionCallItem) GetName() string { return f.Name } +func (f *FunctionCallItem) GetNamespace() *string { + if f == nil { + return nil + } + return f.Namespace +} + func (f *FunctionCallItem) GetStatus() *ToolCallStatus { if f == nil { return nil diff --git a/models/components/functioncalloutputitem.go b/models/components/functioncalloutputitem.go index 7b549270..1f04a6e9 100644 --- a/models/components/functioncalloutputitem.go +++ b/models/components/functioncalloutputitem.go @@ -13,9 +13,10 @@ import ( type FunctionCallOutputItemDetail string const ( - FunctionCallOutputItemDetailAuto FunctionCallOutputItemDetail = "auto" - FunctionCallOutputItemDetailHigh FunctionCallOutputItemDetail = "high" - FunctionCallOutputItemDetailLow FunctionCallOutputItemDetail = "low" + FunctionCallOutputItemDetailAuto FunctionCallOutputItemDetail = "auto" + FunctionCallOutputItemDetailHigh FunctionCallOutputItemDetail = "high" + FunctionCallOutputItemDetailLow FunctionCallOutputItemDetail = "low" + FunctionCallOutputItemDetailOriginal FunctionCallOutputItemDetail = "original" ) func (e FunctionCallOutputItemDetail) ToPointer() *FunctionCallOutputItemDetail { @@ -26,73 +27,73 @@ func (e FunctionCallOutputItemDetail) ToPointer() *FunctionCallOutputItemDetail func (e *FunctionCallOutputItemDetail) IsExact() bool { if e != nil { switch *e { - case "auto", "high", "low": + case "auto", "high", "low", "original": return true } } return false } -type FunctionCallOutputItemOutputType string +type FunctionCallOutputItemTypeInputImage string const ( - FunctionCallOutputItemOutputTypeInputImage FunctionCallOutputItemOutputType = "input_image" + FunctionCallOutputItemTypeInputImageInputImage FunctionCallOutputItemTypeInputImage = "input_image" ) -func (e FunctionCallOutputItemOutputType) ToPointer() *FunctionCallOutputItemOutputType { +func (e FunctionCallOutputItemTypeInputImage) ToPointer() *FunctionCallOutputItemTypeInputImage { return &e } -func (e *FunctionCallOutputItemOutputType) UnmarshalJSON(data []byte) error { +func (e *FunctionCallOutputItemTypeInputImage) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err } switch v { case "input_image": - *e = FunctionCallOutputItemOutputType(v) + *e = FunctionCallOutputItemTypeInputImage(v) return nil default: - return fmt.Errorf("invalid value for FunctionCallOutputItemOutputType: %v", v) + return fmt.Errorf("invalid value for FunctionCallOutputItemTypeInputImage: %v", v) } } -// OutputInputImage - Image input content item -type OutputInputImage struct { +// FunctionCallOutputItemOutputInputImage - Image input content item +type FunctionCallOutputItemOutputInputImage struct { Detail FunctionCallOutputItemDetail `json:"detail"` ImageURL optionalnullable.OptionalNullable[string] `json:"image_url,omitzero"` - Type FunctionCallOutputItemOutputType `json:"type"` + Type FunctionCallOutputItemTypeInputImage `json:"type"` } -func (o OutputInputImage) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(o, "", false) +func (f FunctionCallOutputItemOutputInputImage) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) } -func (o *OutputInputImage) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { +func (f *FunctionCallOutputItemOutputInputImage) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { return err } return nil } -func (o *OutputInputImage) GetDetail() FunctionCallOutputItemDetail { - if o == nil { +func (f *FunctionCallOutputItemOutputInputImage) GetDetail() FunctionCallOutputItemDetail { + if f == nil { return FunctionCallOutputItemDetail("") } - return o.Detail + return f.Detail } -func (o *OutputInputImage) GetImageURL() optionalnullable.OptionalNullable[string] { - if o == nil { +func (f *FunctionCallOutputItemOutputInputImage) GetImageURL() optionalnullable.OptionalNullable[string] { + if f == nil { return nil } - return o.ImageURL + return f.ImageURL } -func (o *OutputInputImage) GetType() FunctionCallOutputItemOutputType { - if o == nil { - return FunctionCallOutputItemOutputType("") +func (f *FunctionCallOutputItemOutputInputImage) GetType() FunctionCallOutputItemTypeInputImage { + if f == nil { + return FunctionCallOutputItemTypeInputImage("") } - return o.Type + return f.Type } type FunctionCallOutputItemOutputUnion1Type string @@ -104,9 +105,9 @@ const ( ) type FunctionCallOutputItemOutputUnion1 struct { - InputText *InputText `queryParam:"inline" union:"member"` - OutputInputImage *OutputInputImage `queryParam:"inline" union:"member"` - InputFile *InputFile `queryParam:"inline" union:"member"` + InputText *InputText `queryParam:"inline" union:"member"` + FunctionCallOutputItemOutputInputImage *FunctionCallOutputItemOutputInputImage `queryParam:"inline" union:"member"` + InputFile *InputFile `queryParam:"inline" union:"member"` Type FunctionCallOutputItemOutputUnion1Type } @@ -123,15 +124,15 @@ func CreateFunctionCallOutputItemOutputUnion1InputText(inputText InputText) Func } } -func CreateFunctionCallOutputItemOutputUnion1InputImage(inputImage OutputInputImage) FunctionCallOutputItemOutputUnion1 { +func CreateFunctionCallOutputItemOutputUnion1InputImage(inputImage FunctionCallOutputItemOutputInputImage) FunctionCallOutputItemOutputUnion1 { typ := FunctionCallOutputItemOutputUnion1TypeInputImage - typStr := FunctionCallOutputItemOutputType(typ) + typStr := FunctionCallOutputItemTypeInputImage(typ) inputImage.Type = typStr return FunctionCallOutputItemOutputUnion1{ - OutputInputImage: &inputImage, - Type: typ, + FunctionCallOutputItemOutputInputImage: &inputImage, + Type: typ, } } @@ -169,12 +170,12 @@ func (u *FunctionCallOutputItemOutputUnion1) UnmarshalJSON(data []byte) error { u.Type = FunctionCallOutputItemOutputUnion1TypeInputText return nil case "input_image": - outputInputImage := new(OutputInputImage) - if err := utils.UnmarshalJSON(data, &outputInputImage, "", true, nil); err != nil { - return fmt.Errorf("could not unmarshal `%s` into expected (Type == input_image) type OutputInputImage within FunctionCallOutputItemOutputUnion1: %w", string(data), err) + functionCallOutputItemOutputInputImage := new(FunctionCallOutputItemOutputInputImage) + if err := utils.UnmarshalJSON(data, &functionCallOutputItemOutputInputImage, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == input_image) type FunctionCallOutputItemOutputInputImage within FunctionCallOutputItemOutputUnion1: %w", string(data), err) } - u.OutputInputImage = outputInputImage + u.FunctionCallOutputItemOutputInputImage = functionCallOutputItemOutputInputImage u.Type = FunctionCallOutputItemOutputUnion1TypeInputImage return nil case "input_file": @@ -196,8 +197,8 @@ func (u FunctionCallOutputItemOutputUnion1) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.InputText, "", true) } - if u.OutputInputImage != nil { - return utils.MarshalJSON(u.OutputInputImage, "", true) + if u.FunctionCallOutputItemOutputInputImage != nil { + return utils.MarshalJSON(u.FunctionCallOutputItemOutputInputImage, "", true) } if u.InputFile != nil { diff --git a/models/components/fusionanalysisresult.go b/models/components/fusionanalysisresult.go new file mode 100644 index 00000000..ddaa322d --- /dev/null +++ b/models/components/fusionanalysisresult.go @@ -0,0 +1,182 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type Stance struct { + Model string `json:"model"` + Stance string `json:"stance"` +} + +func (s Stance) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *Stance) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *Stance) GetModel() string { + if s == nil { + return "" + } + return s.Model +} + +func (s *Stance) GetStance() string { + if s == nil { + return "" + } + return s.Stance +} + +type Contradiction struct { + Stances []Stance `json:"stances"` + Topic string `json:"topic"` +} + +func (c Contradiction) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *Contradiction) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *Contradiction) GetStances() []Stance { + if c == nil { + return []Stance{} + } + return c.Stances +} + +func (c *Contradiction) GetTopic() string { + if c == nil { + return "" + } + return c.Topic +} + +type PartialCoverage struct { + Models []string `json:"models"` + Point string `json:"point"` +} + +func (p PartialCoverage) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PartialCoverage) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil +} + +func (p *PartialCoverage) GetModels() []string { + if p == nil { + return []string{} + } + return p.Models +} + +func (p *PartialCoverage) GetPoint() string { + if p == nil { + return "" + } + return p.Point +} + +type UniqueInsight struct { + Insight string `json:"insight"` + Model string `json:"model"` +} + +func (u UniqueInsight) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UniqueInsight) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, nil); err != nil { + return err + } + return nil +} + +func (u *UniqueInsight) GetInsight() string { + if u == nil { + return "" + } + return u.Insight +} + +func (u *UniqueInsight) GetModel() string { + if u == nil { + return "" + } + return u.Model +} + +// FusionAnalysisResult - Structured analysis produced by the fusion judge model. +type FusionAnalysisResult struct { + BlindSpots []string `json:"blind_spots"` + Consensus []string `json:"consensus"` + Contradictions []Contradiction `json:"contradictions"` + PartialCoverage []PartialCoverage `json:"partial_coverage"` + UniqueInsights []UniqueInsight `json:"unique_insights"` +} + +func (f FusionAnalysisResult) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FusionAnalysisResult) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { + return err + } + return nil +} + +func (f *FusionAnalysisResult) GetBlindSpots() []string { + if f == nil { + return []string{} + } + return f.BlindSpots +} + +func (f *FusionAnalysisResult) GetConsensus() []string { + if f == nil { + return []string{} + } + return f.Consensus +} + +func (f *FusionAnalysisResult) GetContradictions() []Contradiction { + if f == nil { + return []Contradiction{} + } + return f.Contradictions +} + +func (f *FusionAnalysisResult) GetPartialCoverage() []PartialCoverage { + if f == nil { + return []PartialCoverage{} + } + return f.PartialCoverage +} + +func (f *FusionAnalysisResult) GetUniqueInsights() []UniqueInsight { + if f == nil { + return []UniqueInsight{} + } + return f.UniqueInsights +} diff --git a/models/components/fusioncallanalysiscompletedevent.go b/models/components/fusioncallanalysiscompletedevent.go new file mode 100644 index 00000000..f9951eca --- /dev/null +++ b/models/components/fusioncallanalysiscompletedevent.go @@ -0,0 +1,88 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type FusionCallAnalysisCompletedEventType string + +const ( + FusionCallAnalysisCompletedEventTypeResponseFusionCallAnalysisCompleted FusionCallAnalysisCompletedEventType = "response.fusion_call.analysis.completed" +) + +func (e FusionCallAnalysisCompletedEventType) ToPointer() *FusionCallAnalysisCompletedEventType { + return &e +} +func (e *FusionCallAnalysisCompletedEventType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "response.fusion_call.analysis.completed": + *e = FusionCallAnalysisCompletedEventType(v) + return nil + default: + return fmt.Errorf("invalid value for FusionCallAnalysisCompletedEventType: %v", v) + } +} + +// FusionCallAnalysisCompletedEvent - Emitted when the fusion judge completes with the structured analysis. +type FusionCallAnalysisCompletedEvent struct { + // Structured analysis produced by the fusion judge model. + Analysis FusionAnalysisResult `json:"analysis"` + ItemID string `json:"item_id"` + OutputIndex int64 `json:"output_index"` + SequenceNumber int64 `json:"sequence_number"` + Type FusionCallAnalysisCompletedEventType `json:"type"` +} + +func (f FusionCallAnalysisCompletedEvent) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FusionCallAnalysisCompletedEvent) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { + return err + } + return nil +} + +func (f *FusionCallAnalysisCompletedEvent) GetAnalysis() FusionAnalysisResult { + if f == nil { + return FusionAnalysisResult{} + } + return f.Analysis +} + +func (f *FusionCallAnalysisCompletedEvent) GetItemID() string { + if f == nil { + return "" + } + return f.ItemID +} + +func (f *FusionCallAnalysisCompletedEvent) GetOutputIndex() int64 { + if f == nil { + return 0 + } + return f.OutputIndex +} + +func (f *FusionCallAnalysisCompletedEvent) GetSequenceNumber() int64 { + if f == nil { + return 0 + } + return f.SequenceNumber +} + +func (f *FusionCallAnalysisCompletedEvent) GetType() FusionCallAnalysisCompletedEventType { + if f == nil { + return FusionCallAnalysisCompletedEventType("") + } + return f.Type +} diff --git a/models/components/fusioncallanalysisinprogressevent.go b/models/components/fusioncallanalysisinprogressevent.go new file mode 100644 index 00000000..c77b429e --- /dev/null +++ b/models/components/fusioncallanalysisinprogressevent.go @@ -0,0 +1,87 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type FusionCallAnalysisInProgressEventType string + +const ( + FusionCallAnalysisInProgressEventTypeResponseFusionCallAnalysisInProgress FusionCallAnalysisInProgressEventType = "response.fusion_call.analysis.in_progress" +) + +func (e FusionCallAnalysisInProgressEventType) ToPointer() *FusionCallAnalysisInProgressEventType { + return &e +} +func (e *FusionCallAnalysisInProgressEventType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "response.fusion_call.analysis.in_progress": + *e = FusionCallAnalysisInProgressEventType(v) + return nil + default: + return fmt.Errorf("invalid value for FusionCallAnalysisInProgressEventType: %v", v) + } +} + +// FusionCallAnalysisInProgressEvent - Emitted when the fusion judge starts producing the structured analysis. +type FusionCallAnalysisInProgressEvent struct { + ItemID string `json:"item_id"` + JudgeModel string `json:"judge_model"` + OutputIndex int64 `json:"output_index"` + SequenceNumber int64 `json:"sequence_number"` + Type FusionCallAnalysisInProgressEventType `json:"type"` +} + +func (f FusionCallAnalysisInProgressEvent) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FusionCallAnalysisInProgressEvent) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { + return err + } + return nil +} + +func (f *FusionCallAnalysisInProgressEvent) GetItemID() string { + if f == nil { + return "" + } + return f.ItemID +} + +func (f *FusionCallAnalysisInProgressEvent) GetJudgeModel() string { + if f == nil { + return "" + } + return f.JudgeModel +} + +func (f *FusionCallAnalysisInProgressEvent) GetOutputIndex() int64 { + if f == nil { + return 0 + } + return f.OutputIndex +} + +func (f *FusionCallAnalysisInProgressEvent) GetSequenceNumber() int64 { + if f == nil { + return 0 + } + return f.SequenceNumber +} + +func (f *FusionCallAnalysisInProgressEvent) GetType() FusionCallAnalysisInProgressEventType { + if f == nil { + return FusionCallAnalysisInProgressEventType("") + } + return f.Type +} diff --git a/models/components/fusioncallcompletedevent.go b/models/components/fusioncallcompletedevent.go new file mode 100644 index 00000000..58dc5619 --- /dev/null +++ b/models/components/fusioncallcompletedevent.go @@ -0,0 +1,79 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type FusionCallCompletedEventType string + +const ( + FusionCallCompletedEventTypeResponseFusionCallCompleted FusionCallCompletedEventType = "response.fusion_call.completed" +) + +func (e FusionCallCompletedEventType) ToPointer() *FusionCallCompletedEventType { + return &e +} +func (e *FusionCallCompletedEventType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "response.fusion_call.completed": + *e = FusionCallCompletedEventType(v) + return nil + default: + return fmt.Errorf("invalid value for FusionCallCompletedEventType: %v", v) + } +} + +// FusionCallCompletedEvent - Emitted when the openrouter:fusion tool call finishes. +type FusionCallCompletedEvent struct { + ItemID string `json:"item_id"` + OutputIndex int64 `json:"output_index"` + SequenceNumber int64 `json:"sequence_number"` + Type FusionCallCompletedEventType `json:"type"` +} + +func (f FusionCallCompletedEvent) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FusionCallCompletedEvent) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { + return err + } + return nil +} + +func (f *FusionCallCompletedEvent) GetItemID() string { + if f == nil { + return "" + } + return f.ItemID +} + +func (f *FusionCallCompletedEvent) GetOutputIndex() int64 { + if f == nil { + return 0 + } + return f.OutputIndex +} + +func (f *FusionCallCompletedEvent) GetSequenceNumber() int64 { + if f == nil { + return 0 + } + return f.SequenceNumber +} + +func (f *FusionCallCompletedEvent) GetType() FusionCallCompletedEventType { + if f == nil { + return FusionCallCompletedEventType("") + } + return f.Type +} diff --git a/models/components/fusioncallinprogressevent.go b/models/components/fusioncallinprogressevent.go new file mode 100644 index 00000000..d98ba13c --- /dev/null +++ b/models/components/fusioncallinprogressevent.go @@ -0,0 +1,79 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type FusionCallInProgressEventType string + +const ( + FusionCallInProgressEventTypeResponseFusionCallInProgress FusionCallInProgressEventType = "response.fusion_call.in_progress" +) + +func (e FusionCallInProgressEventType) ToPointer() *FusionCallInProgressEventType { + return &e +} +func (e *FusionCallInProgressEventType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "response.fusion_call.in_progress": + *e = FusionCallInProgressEventType(v) + return nil + default: + return fmt.Errorf("invalid value for FusionCallInProgressEventType: %v", v) + } +} + +// FusionCallInProgressEvent - Emitted when an openrouter:fusion tool call begins executing. +type FusionCallInProgressEvent struct { + ItemID string `json:"item_id"` + OutputIndex int64 `json:"output_index"` + SequenceNumber int64 `json:"sequence_number"` + Type FusionCallInProgressEventType `json:"type"` +} + +func (f FusionCallInProgressEvent) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FusionCallInProgressEvent) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { + return err + } + return nil +} + +func (f *FusionCallInProgressEvent) GetItemID() string { + if f == nil { + return "" + } + return f.ItemID +} + +func (f *FusionCallInProgressEvent) GetOutputIndex() int64 { + if f == nil { + return 0 + } + return f.OutputIndex +} + +func (f *FusionCallInProgressEvent) GetSequenceNumber() int64 { + if f == nil { + return 0 + } + return f.SequenceNumber +} + +func (f *FusionCallInProgressEvent) GetType() FusionCallInProgressEventType { + if f == nil { + return FusionCallInProgressEventType("") + } + return f.Type +} diff --git a/models/components/fusioncallpaneladdedevent.go b/models/components/fusioncallpaneladdedevent.go new file mode 100644 index 00000000..4ca5f533 --- /dev/null +++ b/models/components/fusioncallpaneladdedevent.go @@ -0,0 +1,87 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type FusionCallPanelAddedEventType string + +const ( + FusionCallPanelAddedEventTypeResponseFusionCallPanelAdded FusionCallPanelAddedEventType = "response.fusion_call.panel.added" +) + +func (e FusionCallPanelAddedEventType) ToPointer() *FusionCallPanelAddedEventType { + return &e +} +func (e *FusionCallPanelAddedEventType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "response.fusion_call.panel.added": + *e = FusionCallPanelAddedEventType(v) + return nil + default: + return fmt.Errorf("invalid value for FusionCallPanelAddedEventType: %v", v) + } +} + +// FusionCallPanelAddedEvent - Emitted when a fusion analysis-panel model starts. +type FusionCallPanelAddedEvent struct { + ItemID string `json:"item_id"` + Model string `json:"model"` + OutputIndex int64 `json:"output_index"` + SequenceNumber int64 `json:"sequence_number"` + Type FusionCallPanelAddedEventType `json:"type"` +} + +func (f FusionCallPanelAddedEvent) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FusionCallPanelAddedEvent) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { + return err + } + return nil +} + +func (f *FusionCallPanelAddedEvent) GetItemID() string { + if f == nil { + return "" + } + return f.ItemID +} + +func (f *FusionCallPanelAddedEvent) GetModel() string { + if f == nil { + return "" + } + return f.Model +} + +func (f *FusionCallPanelAddedEvent) GetOutputIndex() int64 { + if f == nil { + return 0 + } + return f.OutputIndex +} + +func (f *FusionCallPanelAddedEvent) GetSequenceNumber() int64 { + if f == nil { + return 0 + } + return f.SequenceNumber +} + +func (f *FusionCallPanelAddedEvent) GetType() FusionCallPanelAddedEventType { + if f == nil { + return FusionCallPanelAddedEventType("") + } + return f.Type +} diff --git a/models/components/fusioncallpanelcompletedevent.go b/models/components/fusioncallpanelcompletedevent.go new file mode 100644 index 00000000..958ef2ac --- /dev/null +++ b/models/components/fusioncallpanelcompletedevent.go @@ -0,0 +1,95 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type FusionCallPanelCompletedEventType string + +const ( + FusionCallPanelCompletedEventTypeResponseFusionCallPanelCompleted FusionCallPanelCompletedEventType = "response.fusion_call.panel.completed" +) + +func (e FusionCallPanelCompletedEventType) ToPointer() *FusionCallPanelCompletedEventType { + return &e +} +func (e *FusionCallPanelCompletedEventType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "response.fusion_call.panel.completed": + *e = FusionCallPanelCompletedEventType(v) + return nil + default: + return fmt.Errorf("invalid value for FusionCallPanelCompletedEventType: %v", v) + } +} + +// FusionCallPanelCompletedEvent - Emitted when a fusion panel model finishes with its full content. +type FusionCallPanelCompletedEvent struct { + Content string `json:"content"` + ItemID string `json:"item_id"` + Model string `json:"model"` + OutputIndex int64 `json:"output_index"` + SequenceNumber int64 `json:"sequence_number"` + Type FusionCallPanelCompletedEventType `json:"type"` +} + +func (f FusionCallPanelCompletedEvent) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FusionCallPanelCompletedEvent) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { + return err + } + return nil +} + +func (f *FusionCallPanelCompletedEvent) GetContent() string { + if f == nil { + return "" + } + return f.Content +} + +func (f *FusionCallPanelCompletedEvent) GetItemID() string { + if f == nil { + return "" + } + return f.ItemID +} + +func (f *FusionCallPanelCompletedEvent) GetModel() string { + if f == nil { + return "" + } + return f.Model +} + +func (f *FusionCallPanelCompletedEvent) GetOutputIndex() int64 { + if f == nil { + return 0 + } + return f.OutputIndex +} + +func (f *FusionCallPanelCompletedEvent) GetSequenceNumber() int64 { + if f == nil { + return 0 + } + return f.SequenceNumber +} + +func (f *FusionCallPanelCompletedEvent) GetType() FusionCallPanelCompletedEventType { + if f == nil { + return FusionCallPanelCompletedEventType("") + } + return f.Type +} diff --git a/models/components/fusioncallpaneldeltaevent.go b/models/components/fusioncallpaneldeltaevent.go new file mode 100644 index 00000000..5b8f5017 --- /dev/null +++ b/models/components/fusioncallpaneldeltaevent.go @@ -0,0 +1,95 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type FusionCallPanelDeltaEventType string + +const ( + FusionCallPanelDeltaEventTypeResponseFusionCallPanelDelta FusionCallPanelDeltaEventType = "response.fusion_call.panel.delta" +) + +func (e FusionCallPanelDeltaEventType) ToPointer() *FusionCallPanelDeltaEventType { + return &e +} +func (e *FusionCallPanelDeltaEventType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "response.fusion_call.panel.delta": + *e = FusionCallPanelDeltaEventType(v) + return nil + default: + return fmt.Errorf("invalid value for FusionCallPanelDeltaEventType: %v", v) + } +} + +// FusionCallPanelDeltaEvent - Incremental content token from a fusion panel model. +type FusionCallPanelDeltaEvent struct { + Delta string `json:"delta"` + ItemID string `json:"item_id"` + Model string `json:"model"` + OutputIndex int64 `json:"output_index"` + SequenceNumber int64 `json:"sequence_number"` + Type FusionCallPanelDeltaEventType `json:"type"` +} + +func (f FusionCallPanelDeltaEvent) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FusionCallPanelDeltaEvent) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { + return err + } + return nil +} + +func (f *FusionCallPanelDeltaEvent) GetDelta() string { + if f == nil { + return "" + } + return f.Delta +} + +func (f *FusionCallPanelDeltaEvent) GetItemID() string { + if f == nil { + return "" + } + return f.ItemID +} + +func (f *FusionCallPanelDeltaEvent) GetModel() string { + if f == nil { + return "" + } + return f.Model +} + +func (f *FusionCallPanelDeltaEvent) GetOutputIndex() int64 { + if f == nil { + return 0 + } + return f.OutputIndex +} + +func (f *FusionCallPanelDeltaEvent) GetSequenceNumber() int64 { + if f == nil { + return 0 + } + return f.SequenceNumber +} + +func (f *FusionCallPanelDeltaEvent) GetType() FusionCallPanelDeltaEventType { + if f == nil { + return FusionCallPanelDeltaEventType("") + } + return f.Type +} diff --git a/models/components/fusioncallpanelfailedevent.go b/models/components/fusioncallpanelfailedevent.go new file mode 100644 index 00000000..294d26ed --- /dev/null +++ b/models/components/fusioncallpanelfailedevent.go @@ -0,0 +1,103 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type FusionCallPanelFailedEventType string + +const ( + FusionCallPanelFailedEventTypeResponseFusionCallPanelFailed FusionCallPanelFailedEventType = "response.fusion_call.panel.failed" +) + +func (e FusionCallPanelFailedEventType) ToPointer() *FusionCallPanelFailedEventType { + return &e +} +func (e *FusionCallPanelFailedEventType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "response.fusion_call.panel.failed": + *e = FusionCallPanelFailedEventType(v) + return nil + default: + return fmt.Errorf("invalid value for FusionCallPanelFailedEventType: %v", v) + } +} + +// FusionCallPanelFailedEvent - Emitted when a fusion panel model fails. +type FusionCallPanelFailedEvent struct { + Error string `json:"error"` + ItemID string `json:"item_id"` + Model string `json:"model"` + OutputIndex int64 `json:"output_index"` + SequenceNumber int64 `json:"sequence_number"` + StatusCode *int64 `json:"status_code,omitzero"` + Type FusionCallPanelFailedEventType `json:"type"` +} + +func (f FusionCallPanelFailedEvent) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FusionCallPanelFailedEvent) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { + return err + } + return nil +} + +func (f *FusionCallPanelFailedEvent) GetError() string { + if f == nil { + return "" + } + return f.Error +} + +func (f *FusionCallPanelFailedEvent) GetItemID() string { + if f == nil { + return "" + } + return f.ItemID +} + +func (f *FusionCallPanelFailedEvent) GetModel() string { + if f == nil { + return "" + } + return f.Model +} + +func (f *FusionCallPanelFailedEvent) GetOutputIndex() int64 { + if f == nil { + return 0 + } + return f.OutputIndex +} + +func (f *FusionCallPanelFailedEvent) GetSequenceNumber() int64 { + if f == nil { + return 0 + } + return f.SequenceNumber +} + +func (f *FusionCallPanelFailedEvent) GetStatusCode() *int64 { + if f == nil { + return nil + } + return f.StatusCode +} + +func (f *FusionCallPanelFailedEvent) GetType() FusionCallPanelFailedEventType { + if f == nil { + return FusionCallPanelFailedEventType("") + } + return f.Type +} diff --git a/models/components/fusioncallpanelreasoningdeltaevent.go b/models/components/fusioncallpanelreasoningdeltaevent.go new file mode 100644 index 00000000..1ea5a756 --- /dev/null +++ b/models/components/fusioncallpanelreasoningdeltaevent.go @@ -0,0 +1,95 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type FusionCallPanelReasoningDeltaEventType string + +const ( + FusionCallPanelReasoningDeltaEventTypeResponseFusionCallPanelReasoningDelta FusionCallPanelReasoningDeltaEventType = "response.fusion_call.panel.reasoning.delta" +) + +func (e FusionCallPanelReasoningDeltaEventType) ToPointer() *FusionCallPanelReasoningDeltaEventType { + return &e +} +func (e *FusionCallPanelReasoningDeltaEventType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "response.fusion_call.panel.reasoning.delta": + *e = FusionCallPanelReasoningDeltaEventType(v) + return nil + default: + return fmt.Errorf("invalid value for FusionCallPanelReasoningDeltaEventType: %v", v) + } +} + +// FusionCallPanelReasoningDeltaEvent - Incremental reasoning token from a fusion panel model. +type FusionCallPanelReasoningDeltaEvent struct { + Delta string `json:"delta"` + ItemID string `json:"item_id"` + Model string `json:"model"` + OutputIndex int64 `json:"output_index"` + SequenceNumber int64 `json:"sequence_number"` + Type FusionCallPanelReasoningDeltaEventType `json:"type"` +} + +func (f FusionCallPanelReasoningDeltaEvent) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FusionCallPanelReasoningDeltaEvent) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { + return err + } + return nil +} + +func (f *FusionCallPanelReasoningDeltaEvent) GetDelta() string { + if f == nil { + return "" + } + return f.Delta +} + +func (f *FusionCallPanelReasoningDeltaEvent) GetItemID() string { + if f == nil { + return "" + } + return f.ItemID +} + +func (f *FusionCallPanelReasoningDeltaEvent) GetModel() string { + if f == nil { + return "" + } + return f.Model +} + +func (f *FusionCallPanelReasoningDeltaEvent) GetOutputIndex() int64 { + if f == nil { + return 0 + } + return f.OutputIndex +} + +func (f *FusionCallPanelReasoningDeltaEvent) GetSequenceNumber() int64 { + if f == nil { + return 0 + } + return f.SequenceNumber +} + +func (f *FusionCallPanelReasoningDeltaEvent) GetType() FusionCallPanelReasoningDeltaEventType { + if f == nil { + return FusionCallPanelReasoningDeltaEventType("") + } + return f.Type +} diff --git a/models/components/fusionplugin.go b/models/components/fusionplugin.go new file mode 100644 index 00000000..79d4b100 --- /dev/null +++ b/models/components/fusionplugin.go @@ -0,0 +1,131 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type FusionPluginID string + +const ( + FusionPluginIDFusion FusionPluginID = "fusion" +) + +func (e FusionPluginID) ToPointer() *FusionPluginID { + return &e +} +func (e *FusionPluginID) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "fusion": + *e = FusionPluginID(v) + return nil + default: + return fmt.Errorf("invalid value for FusionPluginID: %v", v) + } +} + +type FusionPluginTool struct { + // Optional configuration forwarded as the tool's `parameters` object. + Parameters map[string]any `json:"parameters,omitzero"` + // Server tool type identifier (e.g. "openrouter:web_search", "openrouter:web_fetch"). + Type string `json:"type"` +} + +func (f FusionPluginTool) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FusionPluginTool) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { + return err + } + return nil +} + +func (f *FusionPluginTool) GetParameters() map[string]any { + if f == nil { + return nil + } + return f.Parameters +} + +func (f *FusionPluginTool) GetType() string { + if f == nil { + return "" + } + return f.Type +} + +type FusionPlugin struct { + // Slugs of models to run in parallel as the "expert panel" the judge analyzes. Each model receives the same user prompt with web_search + web_fetch enabled. Capped at 8 models to bound cost amplification. When omitted, defaults to the Quality preset from the /labs/fusion UI (~anthropic/claude-opus-latest, ~openai/gpt-latest, ~google/gemini-pro-latest). + AnalysisModels []string `json:"analysis_models,omitzero"` + // Set to false to disable the fusion plugin for this request. Defaults to true. + Enabled *bool `json:"enabled,omitzero"` + ID FusionPluginID `json:"id"` + // Maximum number of tool-calling steps each panelist (analysis model) and the judge model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to 8. Capped at 16. + MaxToolCalls *int64 `json:"max_tool_calls,omitzero"` + // Slug of the model that performs both the judge step (with web_search + web_fetch) and the final synthesis. When omitted, defaults to the first model in the Quality preset. + Model *string `json:"model,omitzero"` + // Server tools available to panelist and judge inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: "openrouter:web_search" }, { type: "openrouter:web_fetch" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only). + Tools []FusionPluginTool `json:"tools,omitzero"` +} + +func (f FusionPlugin) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FusionPlugin) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { + return err + } + return nil +} + +func (f *FusionPlugin) GetAnalysisModels() []string { + if f == nil { + return nil + } + return f.AnalysisModels +} + +func (f *FusionPlugin) GetEnabled() *bool { + if f == nil { + return nil + } + return f.Enabled +} + +func (f *FusionPlugin) GetID() FusionPluginID { + if f == nil { + return FusionPluginID("") + } + return f.ID +} + +func (f *FusionPlugin) GetMaxToolCalls() *int64 { + if f == nil { + return nil + } + return f.MaxToolCalls +} + +func (f *FusionPlugin) GetModel() *string { + if f == nil { + return nil + } + return f.Model +} + +func (f *FusionPlugin) GetTools() []FusionPluginTool { + if f == nil { + return nil + } + return f.Tools +} diff --git a/models/components/fusionservertoolconfig.go b/models/components/fusionservertoolconfig.go new file mode 100644 index 00000000..ad121f2f --- /dev/null +++ b/models/components/fusionservertoolconfig.go @@ -0,0 +1,177 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// FusionServerToolConfigEffort - Reasoning effort level for panelist and judge inner calls. +type FusionServerToolConfigEffort string + +const ( + FusionServerToolConfigEffortXhigh FusionServerToolConfigEffort = "xhigh" + FusionServerToolConfigEffortHigh FusionServerToolConfigEffort = "high" + FusionServerToolConfigEffortMedium FusionServerToolConfigEffort = "medium" + FusionServerToolConfigEffortLow FusionServerToolConfigEffort = "low" + FusionServerToolConfigEffortMinimal FusionServerToolConfigEffort = "minimal" + FusionServerToolConfigEffortNone FusionServerToolConfigEffort = "none" +) + +func (e FusionServerToolConfigEffort) ToPointer() *FusionServerToolConfigEffort { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *FusionServerToolConfigEffort) IsExact() bool { + if e != nil { + switch *e { + case "xhigh", "high", "medium", "low", "minimal", "none": + return true + } + } + return false +} + +// FusionServerToolConfigReasoning - Reasoning configuration forwarded to panelist and judge inner calls. Use this to control reasoning effort and token budget for models that support extended thinking. +type FusionServerToolConfigReasoning struct { + // Reasoning effort level for panelist and judge inner calls. + Effort *FusionServerToolConfigEffort `json:"effort,omitzero"` + // Maximum number of reasoning tokens each panelist and judge model may use. Helps bound cost when models allocate too much budget to chain-of-thought. + MaxTokens *int64 `json:"max_tokens,omitzero"` +} + +func (f FusionServerToolConfigReasoning) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FusionServerToolConfigReasoning) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { + return err + } + return nil +} + +func (f *FusionServerToolConfigReasoning) GetEffort() *FusionServerToolConfigEffort { + if f == nil { + return nil + } + return f.Effort +} + +func (f *FusionServerToolConfigReasoning) GetMaxTokens() *int64 { + if f == nil { + return nil + } + return f.MaxTokens +} + +type FusionServerToolConfigTool struct { + // Optional configuration forwarded as the tool's `parameters` object. + Parameters map[string]any `json:"parameters,omitzero"` + // Server tool type identifier (e.g. "openrouter:web_search", "openrouter:web_fetch"). + Type string `json:"type"` +} + +func (f FusionServerToolConfigTool) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FusionServerToolConfigTool) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { + return err + } + return nil +} + +func (f *FusionServerToolConfigTool) GetParameters() map[string]any { + if f == nil { + return nil + } + return f.Parameters +} + +func (f *FusionServerToolConfigTool) GetType() string { + if f == nil { + return "" + } + return f.Type +} + +// FusionServerToolConfig - Configuration for the openrouter:fusion server tool. +type FusionServerToolConfig struct { + // Slugs of models to run in parallel as the analysis panel. Each model receives the user prompt with openrouter:web_search and openrouter:web_fetch enabled, then a judge model summarizes the collective output into structured analysis JSON. Capped at 8 models to bound cost amplification. Defaults to the Quality preset from /labs/fusion. + AnalysisModels []string `json:"analysis_models,omitzero"` + // Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, the provider's default applies. + MaxCompletionTokens *int64 `json:"max_completion_tokens,omitzero"` + // Maximum number of tool-calling steps each panelist (analysis model) and the judge model may take during their agentic web-research loop. Models with web_search/web_fetch enabled iterate until they produce a text response or hit this ceiling. Defaults to 8. Capped at 16. + MaxToolCalls *int64 `json:"max_tool_calls,omitzero"` + // Slug of the judge model that produces the structured analysis JSON. Defaults to the model used in the outer API request. + Model *string `json:"model,omitzero"` + // Reasoning configuration forwarded to panelist and judge inner calls. Use this to control reasoning effort and token budget for models that support extended thinking. + Reasoning *FusionServerToolConfigReasoning `json:"reasoning,omitzero"` + // Sampling temperature forwarded to panelist and judge inner calls. When omitted, the provider's default applies. + Temperature *float64 `json:"temperature,omitzero"` + // Server tools available to panelist and judge inner calls. Each entry uses the same `{ type, parameters? }` shorthand as the outer Chat Completions request. When omitted, defaults to `[{ type: "openrouter:web_search" }, { type: "openrouter:web_fetch" }]`. Pass an empty array to disable tools entirely (panelists answer from parametric knowledge only). + Tools []FusionServerToolConfigTool `json:"tools,omitzero"` +} + +func (f FusionServerToolConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FusionServerToolConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { + return err + } + return nil +} + +func (f *FusionServerToolConfig) GetAnalysisModels() []string { + if f == nil { + return nil + } + return f.AnalysisModels +} + +func (f *FusionServerToolConfig) GetMaxCompletionTokens() *int64 { + if f == nil { + return nil + } + return f.MaxCompletionTokens +} + +func (f *FusionServerToolConfig) GetMaxToolCalls() *int64 { + if f == nil { + return nil + } + return f.MaxToolCalls +} + +func (f *FusionServerToolConfig) GetModel() *string { + if f == nil { + return nil + } + return f.Model +} + +func (f *FusionServerToolConfig) GetReasoning() *FusionServerToolConfigReasoning { + if f == nil { + return nil + } + return f.Reasoning +} + +func (f *FusionServerToolConfig) GetTemperature() *float64 { + if f == nil { + return nil + } + return f.Temperature +} + +func (f *FusionServerToolConfig) GetTools() []FusionServerToolConfigTool { + if f == nil { + return nil + } + return f.Tools +} diff --git a/models/components/fusionservertoolopenrouter.go b/models/components/fusionservertoolopenrouter.go new file mode 100644 index 00000000..2b632880 --- /dev/null +++ b/models/components/fusionservertoolopenrouter.go @@ -0,0 +1,64 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type FusionServerToolOpenRouterType string + +const ( + FusionServerToolOpenRouterTypeOpenrouterFusion FusionServerToolOpenRouterType = "openrouter:fusion" +) + +func (e FusionServerToolOpenRouterType) ToPointer() *FusionServerToolOpenRouterType { + return &e +} +func (e *FusionServerToolOpenRouterType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "openrouter:fusion": + *e = FusionServerToolOpenRouterType(v) + return nil + default: + return fmt.Errorf("invalid value for FusionServerToolOpenRouterType: %v", v) + } +} + +// FusionServerToolOpenRouter - OpenRouter built-in server tool: fans out the user prompt to a panel of analysis models, then asks a judge model to summarize their collective output as structured JSON the outer model can synthesize from. +type FusionServerToolOpenRouter struct { + // Configuration for the openrouter:fusion server tool. + Parameters *FusionServerToolConfig `json:"parameters,omitzero"` + Type FusionServerToolOpenRouterType `json:"type"` +} + +func (f FusionServerToolOpenRouter) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FusionServerToolOpenRouter) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { + return err + } + return nil +} + +func (f *FusionServerToolOpenRouter) GetParameters() *FusionServerToolConfig { + if f == nil { + return nil + } + return f.Parameters +} + +func (f *FusionServerToolOpenRouter) GetType() FusionServerToolOpenRouterType { + if f == nil { + return FusionServerToolOpenRouterType("") + } + return f.Type +} diff --git a/models/components/generationresponse.go b/models/components/generationresponse.go index 1669ac4c..0ff64bca 100644 --- a/models/components/generationresponse.go +++ b/models/components/generationresponse.go @@ -14,7 +14,9 @@ const ( APITypeEmbeddings APIType = "embeddings" APITypeRerank APIType = "rerank" APITypeTts APIType = "tts" + APITypeStt APIType = "stt" APITypeVideo APIType = "video" + APITypeImage APIType = "image" ) func (e APIType) ToPointer() *APIType { @@ -25,7 +27,30 @@ func (e APIType) ToPointer() *APIType { func (e *APIType) IsExact() bool { if e != nil { switch *e { - case "completions", "embeddings", "rerank", "tts", "video": + case "completions", "embeddings", "rerank", "tts", "stt", "video", "image": + return true + } + } + return false +} + +// DataRegion - The data region this generation was routed through. 'europe' for EU-routed requests, 'global' otherwise. +type DataRegion string + +const ( + DataRegionGlobal DataRegion = "global" + DataRegionEurope DataRegion = "europe" +) + +func (e DataRegion) ToPointer() *DataRegion { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *DataRegion) IsExact() bool { + if e != nil { + switch *e { + case "global", "europe": return true } } @@ -44,6 +69,8 @@ type GenerationResponseData struct { Cancelled *bool `json:"cancelled"` // ISO 8601 timestamp of when the generation was created CreatedAt string `json:"created_at"` + // The data region this generation was routed through. 'europe' for EU-routed requests, 'global' otherwise. + DataRegion DataRegion `json:"data_region"` // External user identifier ExternalUser *string `json:"external_user"` // Reason the generation finished @@ -74,6 +101,8 @@ type GenerationResponseData struct { NativeTokensPrompt *int64 `json:"native_tokens_prompt"` // Native reasoning tokens as reported by provider NativeTokensReasoning *int64 `json:"native_tokens_reasoning"` + // Number of web fetches performed + NumFetches *int64 `json:"num_fetches"` // Number of audio inputs in the prompt NumInputAudioPrompt *int64 `json:"num_input_audio_prompt"` // Number of media items in the completion @@ -84,14 +113,20 @@ type GenerationResponseData struct { NumSearchResults *int64 `json:"num_search_results"` // Origin URL of the request Origin string `json:"origin"` + // ID of the preset used for this generation, null if no preset was used + PresetID *string `json:"preset_id"` // Name of the provider that served the request ProviderName *string `json:"provider_name"` // List of provider responses for this generation, including fallback attempts ProviderResponses []ProviderResponse `json:"provider_responses"` // Unique identifier grouping all generations from a single API request RequestID optionalnullable.OptionalNullable[string] `json:"request_id,omitzero"` + // If this generation was served from response cache, contains the original generation ID. Null otherwise. + ResponseCacheSourceID optionalnullable.OptionalNullable[string] `json:"response_cache_source_id,omitzero"` // Router used for the request (e.g., openrouter/auto) Router *string `json:"router"` + // Service tier the upstream provider reported running this request on, or null if it did not report one. + ServiceTier *string `json:"service_tier"` // Session identifier grouping multiple generations in the same session SessionID optionalnullable.OptionalNullable[string] `json:"session_id,omitzero"` // Whether the response was streamed @@ -149,6 +184,13 @@ func (g *GenerationResponseData) GetCreatedAt() string { return g.CreatedAt } +func (g *GenerationResponseData) GetDataRegion() DataRegion { + if g == nil { + return DataRegion("") + } + return g.DataRegion +} + func (g *GenerationResponseData) GetExternalUser() *string { if g == nil { return nil @@ -254,6 +296,13 @@ func (g *GenerationResponseData) GetNativeTokensReasoning() *int64 { return g.NativeTokensReasoning } +func (g *GenerationResponseData) GetNumFetches() *int64 { + if g == nil { + return nil + } + return g.NumFetches +} + func (g *GenerationResponseData) GetNumInputAudioPrompt() *int64 { if g == nil { return nil @@ -289,6 +338,13 @@ func (g *GenerationResponseData) GetOrigin() string { return g.Origin } +func (g *GenerationResponseData) GetPresetID() *string { + if g == nil { + return nil + } + return g.PresetID +} + func (g *GenerationResponseData) GetProviderName() *string { if g == nil { return nil @@ -310,6 +366,13 @@ func (g *GenerationResponseData) GetRequestID() optionalnullable.OptionalNullabl return g.RequestID } +func (g *GenerationResponseData) GetResponseCacheSourceID() optionalnullable.OptionalNullable[string] { + if g == nil { + return nil + } + return g.ResponseCacheSourceID +} + func (g *GenerationResponseData) GetRouter() *string { if g == nil { return nil @@ -317,6 +380,13 @@ func (g *GenerationResponseData) GetRouter() *string { return g.Router } +func (g *GenerationResponseData) GetServiceTier() *string { + if g == nil { + return nil + } + return g.ServiceTier +} + func (g *GenerationResponseData) GetSessionID() optionalnullable.OptionalNullable[string] { if g == nil { return nil diff --git a/models/components/getbyokkeyresponse.go b/models/components/getbyokkeyresponse.go new file mode 100644 index 00000000..532a7ff6 --- /dev/null +++ b/models/components/getbyokkeyresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GetBYOKKeyResponse struct { + Data BYOKKey `json:"data"` +} + +func (g *GetBYOKKeyResponse) GetData() BYOKKey { + if g == nil { + return BYOKKey{} + } + return g.Data +} diff --git a/models/components/getobservabilitydestinationresponse.go b/models/components/getobservabilitydestinationresponse.go new file mode 100644 index 00000000..7d738474 --- /dev/null +++ b/models/components/getobservabilitydestinationresponse.go @@ -0,0 +1,82 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type GetObservabilityDestinationResponse struct { + Data ObservabilityDestination `json:"data"` +} + +func (g *GetObservabilityDestinationResponse) GetData() ObservabilityDestination { + if g == nil { + return ObservabilityDestination{} + } + return g.Data +} + +func (g *GetObservabilityDestinationResponse) GetDataArize() *ObservabilityArizeDestination { + return g.GetData().ObservabilityArizeDestination +} + +func (g *GetObservabilityDestinationResponse) GetDataBraintrust() *ObservabilityBraintrustDestination { + return g.GetData().ObservabilityBraintrustDestination +} + +func (g *GetObservabilityDestinationResponse) GetDataClickhouse() *ObservabilityClickhouseDestination { + return g.GetData().ObservabilityClickhouseDestination +} + +func (g *GetObservabilityDestinationResponse) GetDataDatadog() *ObservabilityDatadogDestination { + return g.GetData().ObservabilityDatadogDestination +} + +func (g *GetObservabilityDestinationResponse) GetDataGrafana() *ObservabilityGrafanaDestination { + return g.GetData().ObservabilityGrafanaDestination +} + +func (g *GetObservabilityDestinationResponse) GetDataLangfuse() *ObservabilityLangfuseDestination { + return g.GetData().ObservabilityLangfuseDestination +} + +func (g *GetObservabilityDestinationResponse) GetDataLangsmith() *ObservabilityLangsmithDestination { + return g.GetData().ObservabilityLangsmithDestination +} + +func (g *GetObservabilityDestinationResponse) GetDataNewrelic() *ObservabilityNewrelicDestination { + return g.GetData().ObservabilityNewrelicDestination +} + +func (g *GetObservabilityDestinationResponse) GetDataOpik() *ObservabilityOpikDestination { + return g.GetData().ObservabilityOpikDestination +} + +func (g *GetObservabilityDestinationResponse) GetDataOtelCollector() *ObservabilityOtelCollectorDestination { + return g.GetData().ObservabilityOtelCollectorDestination +} + +func (g *GetObservabilityDestinationResponse) GetDataPosthog() *ObservabilityPosthogDestination { + return g.GetData().ObservabilityPosthogDestination +} + +func (g *GetObservabilityDestinationResponse) GetDataRamp() *ObservabilityRampDestination { + return g.GetData().ObservabilityRampDestination +} + +func (g *GetObservabilityDestinationResponse) GetDataS3() *ObservabilityS3Destination { + return g.GetData().ObservabilityS3Destination +} + +func (g *GetObservabilityDestinationResponse) GetDataSentry() *ObservabilitySentryDestination { + return g.GetData().ObservabilitySentryDestination +} + +func (g *GetObservabilityDestinationResponse) GetDataSnowflake() *ObservabilitySnowflakeDestination { + return g.GetData().ObservabilitySnowflakeDestination +} + +func (g *GetObservabilityDestinationResponse) GetDataWeave() *ObservabilityWeaveDestination { + return g.GetData().ObservabilityWeaveDestination +} + +func (g *GetObservabilityDestinationResponse) GetDataWebhook() *ObservabilityWebhookDestination { + return g.GetData().ObservabilityWebhookDestination +} diff --git a/models/components/getpresetresponse.go b/models/components/getpresetresponse.go new file mode 100644 index 00000000..602a6f79 --- /dev/null +++ b/models/components/getpresetresponse.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// GetPresetResponse - A preset with its currently designated version. +type GetPresetResponse struct { + // A preset with its currently designated version. + Data PresetWithDesignatedVersion `json:"data"` +} + +func (g *GetPresetResponse) GetData() PresetWithDesignatedVersion { + if g == nil { + return PresetWithDesignatedVersion{} + } + return g.Data +} diff --git a/models/components/getpresetversionresponse.go b/models/components/getpresetversionresponse.go new file mode 100644 index 00000000..1d73f3db --- /dev/null +++ b/models/components/getpresetversionresponse.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// GetPresetVersionResponse - A single version of a preset. +type GetPresetVersionResponse struct { + // A specific version of a preset, containing config and optional system prompt. + Data *PresetDesignatedVersion `json:"data"` +} + +func (g *GetPresetVersionResponse) GetData() *PresetDesignatedVersion { + if g == nil { + return nil + } + return g.Data +} diff --git a/models/components/guardrail.go b/models/components/guardrail.go index 94b07807..8831bb58 100644 --- a/models/components/guardrail.go +++ b/models/components/guardrail.go @@ -12,12 +12,26 @@ type Guardrail struct { AllowedModels optionalnullable.OptionalNullable[[]string] `json:"allowed_models,omitzero"` // List of allowed provider IDs AllowedProviders optionalnullable.OptionalNullable[[]string] `json:"allowed_providers,omitzero"` + // Builtin content filters applied to requests. Includes PII detectors and the regex-based prompt injection detector. + ContentFilterBuiltins optionalnullable.OptionalNullable[[]ContentFilterBuiltinEntry] `json:"content_filter_builtins,omitzero"` + // Custom regex content filters applied to request messages + ContentFilters optionalnullable.OptionalNullable[[]ContentFilterEntry] `json:"content_filters,omitzero"` // ISO 8601 timestamp of when the guardrail was created CreatedAt string `json:"created_at"` // Description of the guardrail Description optionalnullable.OptionalNullable[string] `json:"description,omitzero"` - // Whether to enforce zero data retention + // Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. EnforceZdr optionalnullable.OptionalNullable[bool] `json:"enforce_zdr,omitzero"` + // Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. + EnforceZdrAnthropic optionalnullable.OptionalNullable[bool] `json:"enforce_zdr_anthropic,omitzero"` + // Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. + EnforceZdrGoogle optionalnullable.OptionalNullable[bool] `json:"enforce_zdr_google,omitzero"` + // Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. + EnforceZdrOpenai optionalnullable.OptionalNullable[bool] `json:"enforce_zdr_openai,omitzero"` + // Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided. + EnforceZdrOther optionalnullable.OptionalNullable[bool] `json:"enforce_zdr_other,omitzero"` // Unique identifier for the guardrail ID string `json:"id"` // Array of model canonical_slugs to exclude from routing @@ -61,6 +75,20 @@ func (g *Guardrail) GetAllowedProviders() optionalnullable.OptionalNullable[[]st return g.AllowedProviders } +func (g *Guardrail) GetContentFilterBuiltins() optionalnullable.OptionalNullable[[]ContentFilterBuiltinEntry] { + if g == nil { + return nil + } + return g.ContentFilterBuiltins +} + +func (g *Guardrail) GetContentFilters() optionalnullable.OptionalNullable[[]ContentFilterEntry] { + if g == nil { + return nil + } + return g.ContentFilters +} + func (g *Guardrail) GetCreatedAt() string { if g == nil { return "" @@ -82,6 +110,34 @@ func (g *Guardrail) GetEnforceZdr() optionalnullable.OptionalNullable[bool] { return g.EnforceZdr } +func (g *Guardrail) GetEnforceZdrAnthropic() optionalnullable.OptionalNullable[bool] { + if g == nil { + return nil + } + return g.EnforceZdrAnthropic +} + +func (g *Guardrail) GetEnforceZdrGoogle() optionalnullable.OptionalNullable[bool] { + if g == nil { + return nil + } + return g.EnforceZdrGoogle +} + +func (g *Guardrail) GetEnforceZdrOpenai() optionalnullable.OptionalNullable[bool] { + if g == nil { + return nil + } + return g.EnforceZdrOpenai +} + +func (g *Guardrail) GetEnforceZdrOther() optionalnullable.OptionalNullable[bool] { + if g == nil { + return nil + } + return g.EnforceZdrOther +} + func (g *Guardrail) GetID() string { if g == nil { return "" diff --git a/models/components/inputimage.go b/models/components/inputimage.go index 6cf7c22d..dfc6458b 100644 --- a/models/components/inputimage.go +++ b/models/components/inputimage.go @@ -12,9 +12,10 @@ import ( type InputImageDetail string const ( - InputImageDetailAuto InputImageDetail = "auto" - InputImageDetailHigh InputImageDetail = "high" - InputImageDetailLow InputImageDetail = "low" + InputImageDetailAuto InputImageDetail = "auto" + InputImageDetailHigh InputImageDetail = "high" + InputImageDetailLow InputImageDetail = "low" + InputImageDetailOriginal InputImageDetail = "original" ) func (e InputImageDetail) ToPointer() *InputImageDetail { @@ -25,7 +26,7 @@ func (e InputImageDetail) ToPointer() *InputImageDetail { func (e *InputImageDetail) IsExact() bool { if e != nil { switch *e { - case "auto", "high", "low": + case "auto", "high", "low", "original": return true } } diff --git a/models/components/inputmessageitem.go b/models/components/inputmessageitem.go index 5bebc962..41cf0499 100644 --- a/models/components/inputmessageitem.go +++ b/models/components/inputmessageitem.go @@ -13,9 +13,10 @@ import ( type InputMessageItemDetail string const ( - InputMessageItemDetailAuto InputMessageItemDetail = "auto" - InputMessageItemDetailHigh InputMessageItemDetail = "high" - InputMessageItemDetailLow InputMessageItemDetail = "low" + InputMessageItemDetailAuto InputMessageItemDetail = "auto" + InputMessageItemDetailHigh InputMessageItemDetail = "high" + InputMessageItemDetailLow InputMessageItemDetail = "low" + InputMessageItemDetailOriginal InputMessageItemDetail = "original" ) func (e InputMessageItemDetail) ToPointer() *InputMessageItemDetail { @@ -26,33 +27,33 @@ func (e InputMessageItemDetail) ToPointer() *InputMessageItemDetail { func (e *InputMessageItemDetail) IsExact() bool { if e != nil { switch *e { - case "auto", "high", "low": + case "auto", "high", "low", "original": return true } } return false } -type InputMessageItemContentType string +type InputMessageItemTypeInputImage string const ( - InputMessageItemContentTypeInputImage InputMessageItemContentType = "input_image" + InputMessageItemTypeInputImageInputImage InputMessageItemTypeInputImage = "input_image" ) -func (e InputMessageItemContentType) ToPointer() *InputMessageItemContentType { +func (e InputMessageItemTypeInputImage) ToPointer() *InputMessageItemTypeInputImage { return &e } -func (e *InputMessageItemContentType) UnmarshalJSON(data []byte) error { +func (e *InputMessageItemTypeInputImage) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err } switch v { case "input_image": - *e = InputMessageItemContentType(v) + *e = InputMessageItemTypeInputImage(v) return nil default: - return fmt.Errorf("invalid value for InputMessageItemContentType: %v", v) + return fmt.Errorf("invalid value for InputMessageItemTypeInputImage: %v", v) } } @@ -60,7 +61,7 @@ func (e *InputMessageItemContentType) UnmarshalJSON(data []byte) error { type InputMessageItemContentInputImage struct { Detail InputMessageItemDetail `json:"detail"` ImageURL optionalnullable.OptionalNullable[string] `json:"image_url,omitzero"` - Type InputMessageItemContentType `json:"type"` + Type InputMessageItemTypeInputImage `json:"type"` } func (i InputMessageItemContentInputImage) MarshalJSON() ([]byte, error) { @@ -88,9 +89,9 @@ func (i *InputMessageItemContentInputImage) GetImageURL() optionalnullable.Optio return i.ImageURL } -func (i *InputMessageItemContentInputImage) GetType() InputMessageItemContentType { +func (i *InputMessageItemContentInputImage) GetType() InputMessageItemTypeInputImage { if i == nil { - return InputMessageItemContentType("") + return InputMessageItemTypeInputImage("") } return i.Type } @@ -130,7 +131,7 @@ func CreateInputMessageItemContentUnionInputText(inputText InputText) InputMessa func CreateInputMessageItemContentUnionInputImage(inputImage InputMessageItemContentInputImage) InputMessageItemContentUnion { typ := InputMessageItemContentUnionTypeInputImage - typStr := InputMessageItemContentType(typ) + typStr := InputMessageItemTypeInputImage(typ) inputImage.Type = typStr return InputMessageItemContentUnion{ diff --git a/models/components/inputreference.go b/models/components/inputreference.go new file mode 100644 index 00000000..8e385946 --- /dev/null +++ b/models/components/inputreference.go @@ -0,0 +1,123 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "errors" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type InputReferenceType string + +const ( + InputReferenceTypeAudioURL InputReferenceType = "audio_url" + InputReferenceTypeImageURL InputReferenceType = "image_url" + InputReferenceTypeVideoURL InputReferenceType = "video_url" +) + +// InputReference - A reference asset used to guide video generation. Image references are supported by all providers; audio and video references are only honored by providers that support them (currently BytePlus Seedance 2.0). +type InputReference struct { + ContentPartImage *ContentPartImage `queryParam:"inline" union:"member"` + ContentPartAudio *ContentPartAudio `queryParam:"inline" union:"member"` + ContentPartVideo *ContentPartVideo `queryParam:"inline" union:"member"` + + Type InputReferenceType +} + +func CreateInputReferenceAudioURL(audioURL ContentPartAudio) InputReference { + typ := InputReferenceTypeAudioURL + + typStr := ContentPartAudioType(typ) + audioURL.Type = typStr + + return InputReference{ + ContentPartAudio: &audioURL, + Type: typ, + } +} + +func CreateInputReferenceImageURL(imageURL ContentPartImage) InputReference { + typ := InputReferenceTypeImageURL + + typStr := ContentPartImageType(typ) + imageURL.Type = typStr + + return InputReference{ + ContentPartImage: &imageURL, + Type: typ, + } +} + +func CreateInputReferenceVideoURL(videoURL ContentPartVideo) InputReference { + typ := InputReferenceTypeVideoURL + + typStr := ContentPartVideoType(typ) + videoURL.Type = typStr + + return InputReference{ + ContentPartVideo: &videoURL, + Type: typ, + } +} + +func (u *InputReference) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + return fmt.Errorf("could not unmarshal discriminator: %w", err) + } + + switch dis.Type { + case "audio_url": + contentPartAudio := new(ContentPartAudio) + if err := utils.UnmarshalJSON(data, &contentPartAudio, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == audio_url) type ContentPartAudio within InputReference: %w", string(data), err) + } + + u.ContentPartAudio = contentPartAudio + u.Type = InputReferenceTypeAudioURL + return nil + case "image_url": + contentPartImage := new(ContentPartImage) + if err := utils.UnmarshalJSON(data, &contentPartImage, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == image_url) type ContentPartImage within InputReference: %w", string(data), err) + } + + u.ContentPartImage = contentPartImage + u.Type = InputReferenceTypeImageURL + return nil + case "video_url": + contentPartVideo := new(ContentPartVideo) + if err := utils.UnmarshalJSON(data, &contentPartVideo, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == video_url) type ContentPartVideo within InputReference: %w", string(data), err) + } + + u.ContentPartVideo = contentPartVideo + u.Type = InputReferenceTypeVideoURL + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for InputReference", string(data)) +} + +func (u InputReference) MarshalJSON() ([]byte, error) { + if u.ContentPartImage != nil { + return utils.MarshalJSON(u.ContentPartImage, "", true) + } + + if u.ContentPartAudio != nil { + return utils.MarshalJSON(u.ContentPartAudio, "", true) + } + + if u.ContentPartVideo != nil { + return utils.MarshalJSON(u.ContentPartVideo, "", true) + } + + return nil, errors.New("could not marshal union type InputReference: all fields are null") +} diff --git a/models/components/inputsunion.go b/models/components/inputsunion.go index ffabea3d..adf74fb6 100644 --- a/models/components/inputsunion.go +++ b/models/components/inputsunion.go @@ -956,35 +956,97 @@ func (i *InputsMessage) GetType() InputsTypeMessage { type InputsUnion1Type string const ( - InputsUnion1TypeReasoningItem InputsUnion1Type = "ReasoningItem" - InputsUnion1TypeEasyInputMessage InputsUnion1Type = "EasyInputMessage" - InputsUnion1TypeInputMessageItem InputsUnion1Type = "InputMessageItem" - InputsUnion1TypeFunctionCallItem InputsUnion1Type = "FunctionCallItem" - InputsUnion1TypeFunctionCallOutputItem InputsUnion1Type = "FunctionCallOutputItem" - InputsUnion1TypeInputsMessage InputsUnion1Type = "Inputs_Message" - InputsUnion1TypeInputsReasoning InputsUnion1Type = "Inputs_Reasoning" - InputsUnion1TypeOutputFunctionCallItem InputsUnion1Type = "OutputFunctionCallItem" - InputsUnion1TypeOutputWebSearchCallItem InputsUnion1Type = "OutputWebSearchCallItem" - InputsUnion1TypeOutputFileSearchCallItem InputsUnion1Type = "OutputFileSearchCallItem" - InputsUnion1TypeOutputImageGenerationCallItem InputsUnion1Type = "OutputImageGenerationCallItem" - InputsUnion1TypeOutputDatetimeItem InputsUnion1Type = "OutputDatetimeItem" - InputsUnion1TypeOutputWebSearchServerToolItem InputsUnion1Type = "OutputWebSearchServerToolItem" + InputsUnion1TypeReasoningItem InputsUnion1Type = "ReasoningItem" + InputsUnion1TypeEasyInputMessage InputsUnion1Type = "EasyInputMessage" + InputsUnion1TypeInputMessageItem InputsUnion1Type = "InputMessageItem" + InputsUnion1TypeFunctionCallItem InputsUnion1Type = "FunctionCallItem" + InputsUnion1TypeFunctionCallOutputItem InputsUnion1Type = "FunctionCallOutputItem" + InputsUnion1TypeApplyPatchCallItem InputsUnion1Type = "ApplyPatchCallItem" + InputsUnion1TypeApplyPatchCallOutputItem InputsUnion1Type = "ApplyPatchCallOutputItem" + InputsUnion1TypeInputsMessage InputsUnion1Type = "Inputs_Message" + InputsUnion1TypeInputsReasoning InputsUnion1Type = "Inputs_Reasoning" + InputsUnion1TypeOutputFunctionCallItem InputsUnion1Type = "OutputFunctionCallItem" + InputsUnion1TypeOutputCustomToolCallItem InputsUnion1Type = "OutputCustomToolCallItem" + InputsUnion1TypeOutputWebSearchCallItem InputsUnion1Type = "OutputWebSearchCallItem" + InputsUnion1TypeOutputFileSearchCallItem InputsUnion1Type = "OutputFileSearchCallItem" + InputsUnion1TypeOutputImageGenerationCallItem InputsUnion1Type = "OutputImageGenerationCallItem" + InputsUnion1TypeOutputCodeInterpreterCallItem InputsUnion1Type = "OutputCodeInterpreterCallItem" + InputsUnion1TypeOutputComputerCallItem InputsUnion1Type = "OutputComputerCallItem" + InputsUnion1TypeOutputDatetimeItem InputsUnion1Type = "OutputDatetimeItem" + InputsUnion1TypeOutputWebSearchServerToolItem InputsUnion1Type = "OutputWebSearchServerToolItem" + InputsUnion1TypeOutputCodeInterpreterServerToolItem InputsUnion1Type = "OutputCodeInterpreterServerToolItem" + InputsUnion1TypeOutputFileSearchServerToolItem InputsUnion1Type = "OutputFileSearchServerToolItem" + InputsUnion1TypeOutputImageGenerationServerToolItem InputsUnion1Type = "OutputImageGenerationServerToolItem" + InputsUnion1TypeOutputBrowserUseServerToolItem InputsUnion1Type = "OutputBrowserUseServerToolItem" + InputsUnion1TypeOutputBashServerToolItem InputsUnion1Type = "OutputBashServerToolItem" + InputsUnion1TypeOutputTextEditorServerToolItem InputsUnion1Type = "OutputTextEditorServerToolItem" + InputsUnion1TypeOutputApplyPatchServerToolItem InputsUnion1Type = "OutputApplyPatchServerToolItem" + InputsUnion1TypeOutputWebFetchServerToolItem InputsUnion1Type = "OutputWebFetchServerToolItem" + InputsUnion1TypeOutputToolSearchServerToolItem InputsUnion1Type = "OutputToolSearchServerToolItem" + InputsUnion1TypeOutputMemoryServerToolItem InputsUnion1Type = "OutputMemoryServerToolItem" + InputsUnion1TypeOutputMcpServerToolItem InputsUnion1Type = "OutputMcpServerToolItem" + InputsUnion1TypeOutputSearchModelsServerToolItem InputsUnion1Type = "OutputSearchModelsServerToolItem" + InputsUnion1TypeOutputAdvisorServerToolItem InputsUnion1Type = "OutputAdvisorServerToolItem" + InputsUnion1TypeOutputSubagentServerToolItem InputsUnion1Type = "OutputSubagentServerToolItem" + InputsUnion1TypeLocalShellCallItem InputsUnion1Type = "LocalShellCallItem" + InputsUnion1TypeLocalShellCallOutputItem InputsUnion1Type = "LocalShellCallOutputItem" + InputsUnion1TypeShellCallItem InputsUnion1Type = "ShellCallItem" + InputsUnion1TypeShellCallOutputItem InputsUnion1Type = "ShellCallOutputItem" + InputsUnion1TypeMcpListToolsItem InputsUnion1Type = "McpListToolsItem" + InputsUnion1TypeMcpApprovalRequestItem InputsUnion1Type = "McpApprovalRequestItem" + InputsUnion1TypeMcpApprovalResponseItem InputsUnion1Type = "McpApprovalResponseItem" + InputsUnion1TypeMcpCallItem InputsUnion1Type = "McpCallItem" + InputsUnion1TypeCustomToolCallItem InputsUnion1Type = "CustomToolCallItem" + InputsUnion1TypeCustomToolCallOutputItem InputsUnion1Type = "CustomToolCallOutputItem" + InputsUnion1TypeCompactionItem InputsUnion1Type = "CompactionItem" + InputsUnion1TypeItemReferenceItem InputsUnion1Type = "ItemReferenceItem" ) type InputsUnion1 struct { - ReasoningItem *ReasoningItem `queryParam:"inline" union:"member"` - EasyInputMessage *EasyInputMessage `queryParam:"inline" union:"member"` - InputMessageItem *InputMessageItem `queryParam:"inline" union:"member"` - FunctionCallItem *FunctionCallItem `queryParam:"inline" union:"member"` - FunctionCallOutputItem *FunctionCallOutputItem `queryParam:"inline" union:"member"` - InputsMessage *InputsMessage `queryParam:"inline" union:"member"` - InputsReasoning *InputsReasoning `queryParam:"inline" union:"member"` - OutputFunctionCallItem *OutputFunctionCallItem `queryParam:"inline" union:"member"` - OutputWebSearchCallItem *OutputWebSearchCallItem `queryParam:"inline" union:"member"` - OutputFileSearchCallItem *OutputFileSearchCallItem `queryParam:"inline" union:"member"` - OutputImageGenerationCallItem *OutputImageGenerationCallItem `queryParam:"inline" union:"member"` - OutputDatetimeItem *OutputDatetimeItem `queryParam:"inline" union:"member"` - OutputWebSearchServerToolItem *OutputWebSearchServerToolItem `queryParam:"inline" union:"member"` + ReasoningItem *ReasoningItem `queryParam:"inline" union:"member"` + EasyInputMessage *EasyInputMessage `queryParam:"inline" union:"member"` + InputMessageItem *InputMessageItem `queryParam:"inline" union:"member"` + FunctionCallItem *FunctionCallItem `queryParam:"inline" union:"member"` + FunctionCallOutputItem *FunctionCallOutputItem `queryParam:"inline" union:"member"` + ApplyPatchCallItem *ApplyPatchCallItem `queryParam:"inline" union:"member"` + ApplyPatchCallOutputItem *ApplyPatchCallOutputItem `queryParam:"inline" union:"member"` + InputsMessage *InputsMessage `queryParam:"inline" union:"member"` + InputsReasoning *InputsReasoning `queryParam:"inline" union:"member"` + OutputFunctionCallItem *OutputFunctionCallItem `queryParam:"inline" union:"member"` + OutputCustomToolCallItem *OutputCustomToolCallItem `queryParam:"inline" union:"member"` + OutputWebSearchCallItem *OutputWebSearchCallItem `queryParam:"inline" union:"member"` + OutputFileSearchCallItem *OutputFileSearchCallItem `queryParam:"inline" union:"member"` + OutputImageGenerationCallItem *OutputImageGenerationCallItem `queryParam:"inline" union:"member"` + OutputCodeInterpreterCallItem *OutputCodeInterpreterCallItem `queryParam:"inline" union:"member"` + OutputComputerCallItem *OutputComputerCallItem `queryParam:"inline" union:"member"` + OutputDatetimeItem *OutputDatetimeItem `queryParam:"inline" union:"member"` + OutputWebSearchServerToolItem *OutputWebSearchServerToolItem `queryParam:"inline" union:"member"` + OutputCodeInterpreterServerToolItem *OutputCodeInterpreterServerToolItem `queryParam:"inline" union:"member"` + OutputFileSearchServerToolItem *OutputFileSearchServerToolItem `queryParam:"inline" union:"member"` + OutputImageGenerationServerToolItem *OutputImageGenerationServerToolItem `queryParam:"inline" union:"member"` + OutputBrowserUseServerToolItem *OutputBrowserUseServerToolItem `queryParam:"inline" union:"member"` + OutputBashServerToolItem *OutputBashServerToolItem `queryParam:"inline" union:"member"` + OutputTextEditorServerToolItem *OutputTextEditorServerToolItem `queryParam:"inline" union:"member"` + OutputApplyPatchServerToolItem *OutputApplyPatchServerToolItem `queryParam:"inline" union:"member"` + OutputWebFetchServerToolItem *OutputWebFetchServerToolItem `queryParam:"inline" union:"member"` + OutputToolSearchServerToolItem *OutputToolSearchServerToolItem `queryParam:"inline" union:"member"` + OutputMemoryServerToolItem *OutputMemoryServerToolItem `queryParam:"inline" union:"member"` + OutputMcpServerToolItem *OutputMcpServerToolItem `queryParam:"inline" union:"member"` + OutputSearchModelsServerToolItem *OutputSearchModelsServerToolItem `queryParam:"inline" union:"member"` + OutputAdvisorServerToolItem *OutputAdvisorServerToolItem `queryParam:"inline" union:"member"` + OutputSubagentServerToolItem *OutputSubagentServerToolItem `queryParam:"inline" union:"member"` + LocalShellCallItem *LocalShellCallItem `queryParam:"inline" union:"member"` + LocalShellCallOutputItem *LocalShellCallOutputItem `queryParam:"inline" union:"member"` + ShellCallItem *ShellCallItem `queryParam:"inline" union:"member"` + ShellCallOutputItem *ShellCallOutputItem `queryParam:"inline" union:"member"` + McpListToolsItem *McpListToolsItem `queryParam:"inline" union:"member"` + McpApprovalRequestItem *McpApprovalRequestItem `queryParam:"inline" union:"member"` + McpApprovalResponseItem *McpApprovalResponseItem `queryParam:"inline" union:"member"` + McpCallItem *McpCallItem `queryParam:"inline" union:"member"` + CustomToolCallItem *CustomToolCallItem `queryParam:"inline" union:"member"` + CustomToolCallOutputItem *CustomToolCallOutputItem `queryParam:"inline" union:"member"` + CompactionItem *CompactionItem `queryParam:"inline" union:"member"` + ItemReferenceItem *ItemReferenceItem `queryParam:"inline" union:"member"` Type InputsUnion1Type } @@ -1034,6 +1096,24 @@ func CreateInputsUnion1FunctionCallOutputItem(functionCallOutputItem FunctionCal } } +func CreateInputsUnion1ApplyPatchCallItem(applyPatchCallItem ApplyPatchCallItem) InputsUnion1 { + typ := InputsUnion1TypeApplyPatchCallItem + + return InputsUnion1{ + ApplyPatchCallItem: &applyPatchCallItem, + Type: typ, + } +} + +func CreateInputsUnion1ApplyPatchCallOutputItem(applyPatchCallOutputItem ApplyPatchCallOutputItem) InputsUnion1 { + typ := InputsUnion1TypeApplyPatchCallOutputItem + + return InputsUnion1{ + ApplyPatchCallOutputItem: &applyPatchCallOutputItem, + Type: typ, + } +} + func CreateInputsUnion1InputsMessage(inputsMessage InputsMessage) InputsUnion1 { typ := InputsUnion1TypeInputsMessage @@ -1061,6 +1141,15 @@ func CreateInputsUnion1OutputFunctionCallItem(outputFunctionCallItem OutputFunct } } +func CreateInputsUnion1OutputCustomToolCallItem(outputCustomToolCallItem OutputCustomToolCallItem) InputsUnion1 { + typ := InputsUnion1TypeOutputCustomToolCallItem + + return InputsUnion1{ + OutputCustomToolCallItem: &outputCustomToolCallItem, + Type: typ, + } +} + func CreateInputsUnion1OutputWebSearchCallItem(outputWebSearchCallItem OutputWebSearchCallItem) InputsUnion1 { typ := InputsUnion1TypeOutputWebSearchCallItem @@ -1088,6 +1177,24 @@ func CreateInputsUnion1OutputImageGenerationCallItem(outputImageGenerationCallIt } } +func CreateInputsUnion1OutputCodeInterpreterCallItem(outputCodeInterpreterCallItem OutputCodeInterpreterCallItem) InputsUnion1 { + typ := InputsUnion1TypeOutputCodeInterpreterCallItem + + return InputsUnion1{ + OutputCodeInterpreterCallItem: &outputCodeInterpreterCallItem, + Type: typ, + } +} + +func CreateInputsUnion1OutputComputerCallItem(outputComputerCallItem OutputComputerCallItem) InputsUnion1 { + typ := InputsUnion1TypeOutputComputerCallItem + + return InputsUnion1{ + OutputComputerCallItem: &outputComputerCallItem, + Type: typ, + } +} + func CreateInputsUnion1OutputDatetimeItem(outputDatetimeItem OutputDatetimeItem) InputsUnion1 { typ := InputsUnion1TypeOutputDatetimeItem @@ -1106,6 +1213,240 @@ func CreateInputsUnion1OutputWebSearchServerToolItem(outputWebSearchServerToolIt } } +func CreateInputsUnion1OutputCodeInterpreterServerToolItem(outputCodeInterpreterServerToolItem OutputCodeInterpreterServerToolItem) InputsUnion1 { + typ := InputsUnion1TypeOutputCodeInterpreterServerToolItem + + return InputsUnion1{ + OutputCodeInterpreterServerToolItem: &outputCodeInterpreterServerToolItem, + Type: typ, + } +} + +func CreateInputsUnion1OutputFileSearchServerToolItem(outputFileSearchServerToolItem OutputFileSearchServerToolItem) InputsUnion1 { + typ := InputsUnion1TypeOutputFileSearchServerToolItem + + return InputsUnion1{ + OutputFileSearchServerToolItem: &outputFileSearchServerToolItem, + Type: typ, + } +} + +func CreateInputsUnion1OutputImageGenerationServerToolItem(outputImageGenerationServerToolItem OutputImageGenerationServerToolItem) InputsUnion1 { + typ := InputsUnion1TypeOutputImageGenerationServerToolItem + + return InputsUnion1{ + OutputImageGenerationServerToolItem: &outputImageGenerationServerToolItem, + Type: typ, + } +} + +func CreateInputsUnion1OutputBrowserUseServerToolItem(outputBrowserUseServerToolItem OutputBrowserUseServerToolItem) InputsUnion1 { + typ := InputsUnion1TypeOutputBrowserUseServerToolItem + + return InputsUnion1{ + OutputBrowserUseServerToolItem: &outputBrowserUseServerToolItem, + Type: typ, + } +} + +func CreateInputsUnion1OutputBashServerToolItem(outputBashServerToolItem OutputBashServerToolItem) InputsUnion1 { + typ := InputsUnion1TypeOutputBashServerToolItem + + return InputsUnion1{ + OutputBashServerToolItem: &outputBashServerToolItem, + Type: typ, + } +} + +func CreateInputsUnion1OutputTextEditorServerToolItem(outputTextEditorServerToolItem OutputTextEditorServerToolItem) InputsUnion1 { + typ := InputsUnion1TypeOutputTextEditorServerToolItem + + return InputsUnion1{ + OutputTextEditorServerToolItem: &outputTextEditorServerToolItem, + Type: typ, + } +} + +func CreateInputsUnion1OutputApplyPatchServerToolItem(outputApplyPatchServerToolItem OutputApplyPatchServerToolItem) InputsUnion1 { + typ := InputsUnion1TypeOutputApplyPatchServerToolItem + + return InputsUnion1{ + OutputApplyPatchServerToolItem: &outputApplyPatchServerToolItem, + Type: typ, + } +} + +func CreateInputsUnion1OutputWebFetchServerToolItem(outputWebFetchServerToolItem OutputWebFetchServerToolItem) InputsUnion1 { + typ := InputsUnion1TypeOutputWebFetchServerToolItem + + return InputsUnion1{ + OutputWebFetchServerToolItem: &outputWebFetchServerToolItem, + Type: typ, + } +} + +func CreateInputsUnion1OutputToolSearchServerToolItem(outputToolSearchServerToolItem OutputToolSearchServerToolItem) InputsUnion1 { + typ := InputsUnion1TypeOutputToolSearchServerToolItem + + return InputsUnion1{ + OutputToolSearchServerToolItem: &outputToolSearchServerToolItem, + Type: typ, + } +} + +func CreateInputsUnion1OutputMemoryServerToolItem(outputMemoryServerToolItem OutputMemoryServerToolItem) InputsUnion1 { + typ := InputsUnion1TypeOutputMemoryServerToolItem + + return InputsUnion1{ + OutputMemoryServerToolItem: &outputMemoryServerToolItem, + Type: typ, + } +} + +func CreateInputsUnion1OutputMcpServerToolItem(outputMcpServerToolItem OutputMcpServerToolItem) InputsUnion1 { + typ := InputsUnion1TypeOutputMcpServerToolItem + + return InputsUnion1{ + OutputMcpServerToolItem: &outputMcpServerToolItem, + Type: typ, + } +} + +func CreateInputsUnion1OutputSearchModelsServerToolItem(outputSearchModelsServerToolItem OutputSearchModelsServerToolItem) InputsUnion1 { + typ := InputsUnion1TypeOutputSearchModelsServerToolItem + + return InputsUnion1{ + OutputSearchModelsServerToolItem: &outputSearchModelsServerToolItem, + Type: typ, + } +} + +func CreateInputsUnion1OutputAdvisorServerToolItem(outputAdvisorServerToolItem OutputAdvisorServerToolItem) InputsUnion1 { + typ := InputsUnion1TypeOutputAdvisorServerToolItem + + return InputsUnion1{ + OutputAdvisorServerToolItem: &outputAdvisorServerToolItem, + Type: typ, + } +} + +func CreateInputsUnion1OutputSubagentServerToolItem(outputSubagentServerToolItem OutputSubagentServerToolItem) InputsUnion1 { + typ := InputsUnion1TypeOutputSubagentServerToolItem + + return InputsUnion1{ + OutputSubagentServerToolItem: &outputSubagentServerToolItem, + Type: typ, + } +} + +func CreateInputsUnion1LocalShellCallItem(localShellCallItem LocalShellCallItem) InputsUnion1 { + typ := InputsUnion1TypeLocalShellCallItem + + return InputsUnion1{ + LocalShellCallItem: &localShellCallItem, + Type: typ, + } +} + +func CreateInputsUnion1LocalShellCallOutputItem(localShellCallOutputItem LocalShellCallOutputItem) InputsUnion1 { + typ := InputsUnion1TypeLocalShellCallOutputItem + + return InputsUnion1{ + LocalShellCallOutputItem: &localShellCallOutputItem, + Type: typ, + } +} + +func CreateInputsUnion1ShellCallItem(shellCallItem ShellCallItem) InputsUnion1 { + typ := InputsUnion1TypeShellCallItem + + return InputsUnion1{ + ShellCallItem: &shellCallItem, + Type: typ, + } +} + +func CreateInputsUnion1ShellCallOutputItem(shellCallOutputItem ShellCallOutputItem) InputsUnion1 { + typ := InputsUnion1TypeShellCallOutputItem + + return InputsUnion1{ + ShellCallOutputItem: &shellCallOutputItem, + Type: typ, + } +} + +func CreateInputsUnion1McpListToolsItem(mcpListToolsItem McpListToolsItem) InputsUnion1 { + typ := InputsUnion1TypeMcpListToolsItem + + return InputsUnion1{ + McpListToolsItem: &mcpListToolsItem, + Type: typ, + } +} + +func CreateInputsUnion1McpApprovalRequestItem(mcpApprovalRequestItem McpApprovalRequestItem) InputsUnion1 { + typ := InputsUnion1TypeMcpApprovalRequestItem + + return InputsUnion1{ + McpApprovalRequestItem: &mcpApprovalRequestItem, + Type: typ, + } +} + +func CreateInputsUnion1McpApprovalResponseItem(mcpApprovalResponseItem McpApprovalResponseItem) InputsUnion1 { + typ := InputsUnion1TypeMcpApprovalResponseItem + + return InputsUnion1{ + McpApprovalResponseItem: &mcpApprovalResponseItem, + Type: typ, + } +} + +func CreateInputsUnion1McpCallItem(mcpCallItem McpCallItem) InputsUnion1 { + typ := InputsUnion1TypeMcpCallItem + + return InputsUnion1{ + McpCallItem: &mcpCallItem, + Type: typ, + } +} + +func CreateInputsUnion1CustomToolCallItem(customToolCallItem CustomToolCallItem) InputsUnion1 { + typ := InputsUnion1TypeCustomToolCallItem + + return InputsUnion1{ + CustomToolCallItem: &customToolCallItem, + Type: typ, + } +} + +func CreateInputsUnion1CustomToolCallOutputItem(customToolCallOutputItem CustomToolCallOutputItem) InputsUnion1 { + typ := InputsUnion1TypeCustomToolCallOutputItem + + return InputsUnion1{ + CustomToolCallOutputItem: &customToolCallOutputItem, + Type: typ, + } +} + +func CreateInputsUnion1CompactionItem(compactionItem CompactionItem) InputsUnion1 { + typ := InputsUnion1TypeCompactionItem + + return InputsUnion1{ + CompactionItem: &compactionItem, + Type: typ, + } +} + +func CreateInputsUnion1ItemReferenceItem(itemReferenceItem ItemReferenceItem) InputsUnion1 { + typ := InputsUnion1TypeItemReferenceItem + + return InputsUnion1{ + ItemReferenceItem: &itemReferenceItem, + Type: typ, + } +} + func (u *InputsUnion1) UnmarshalJSON(data []byte) error { var candidates []utils.UnionCandidate @@ -1151,6 +1492,22 @@ func (u *InputsUnion1) UnmarshalJSON(data []byte) error { }) } + var applyPatchCallItem ApplyPatchCallItem = ApplyPatchCallItem{} + if err := utils.UnmarshalJSON(data, &applyPatchCallItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeApplyPatchCallItem, + Value: &applyPatchCallItem, + }) + } + + var applyPatchCallOutputItem ApplyPatchCallOutputItem = ApplyPatchCallOutputItem{} + if err := utils.UnmarshalJSON(data, &applyPatchCallOutputItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeApplyPatchCallOutputItem, + Value: &applyPatchCallOutputItem, + }) + } + var inputsMessage InputsMessage = InputsMessage{} if err := utils.UnmarshalJSON(data, &inputsMessage, "", true, nil); err == nil { candidates = append(candidates, utils.UnionCandidate{ @@ -1175,6 +1532,14 @@ func (u *InputsUnion1) UnmarshalJSON(data []byte) error { }) } + var outputCustomToolCallItem OutputCustomToolCallItem = OutputCustomToolCallItem{} + if err := utils.UnmarshalJSON(data, &outputCustomToolCallItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeOutputCustomToolCallItem, + Value: &outputCustomToolCallItem, + }) + } + var outputWebSearchCallItem OutputWebSearchCallItem = OutputWebSearchCallItem{} if err := utils.UnmarshalJSON(data, &outputWebSearchCallItem, "", true, nil); err == nil { candidates = append(candidates, utils.UnionCandidate{ @@ -1199,6 +1564,22 @@ func (u *InputsUnion1) UnmarshalJSON(data []byte) error { }) } + var outputCodeInterpreterCallItem OutputCodeInterpreterCallItem = OutputCodeInterpreterCallItem{} + if err := utils.UnmarshalJSON(data, &outputCodeInterpreterCallItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeOutputCodeInterpreterCallItem, + Value: &outputCodeInterpreterCallItem, + }) + } + + var outputComputerCallItem OutputComputerCallItem = OutputComputerCallItem{} + if err := utils.UnmarshalJSON(data, &outputComputerCallItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeOutputComputerCallItem, + Value: &outputComputerCallItem, + }) + } + var outputDatetimeItem OutputDatetimeItem = OutputDatetimeItem{} if err := utils.UnmarshalJSON(data, &outputDatetimeItem, "", true, nil); err == nil { candidates = append(candidates, utils.UnionCandidate{ @@ -1215,6 +1596,214 @@ func (u *InputsUnion1) UnmarshalJSON(data []byte) error { }) } + var outputCodeInterpreterServerToolItem OutputCodeInterpreterServerToolItem = OutputCodeInterpreterServerToolItem{} + if err := utils.UnmarshalJSON(data, &outputCodeInterpreterServerToolItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeOutputCodeInterpreterServerToolItem, + Value: &outputCodeInterpreterServerToolItem, + }) + } + + var outputFileSearchServerToolItem OutputFileSearchServerToolItem = OutputFileSearchServerToolItem{} + if err := utils.UnmarshalJSON(data, &outputFileSearchServerToolItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeOutputFileSearchServerToolItem, + Value: &outputFileSearchServerToolItem, + }) + } + + var outputImageGenerationServerToolItem OutputImageGenerationServerToolItem = OutputImageGenerationServerToolItem{} + if err := utils.UnmarshalJSON(data, &outputImageGenerationServerToolItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeOutputImageGenerationServerToolItem, + Value: &outputImageGenerationServerToolItem, + }) + } + + var outputBrowserUseServerToolItem OutputBrowserUseServerToolItem = OutputBrowserUseServerToolItem{} + if err := utils.UnmarshalJSON(data, &outputBrowserUseServerToolItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeOutputBrowserUseServerToolItem, + Value: &outputBrowserUseServerToolItem, + }) + } + + var outputBashServerToolItem OutputBashServerToolItem = OutputBashServerToolItem{} + if err := utils.UnmarshalJSON(data, &outputBashServerToolItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeOutputBashServerToolItem, + Value: &outputBashServerToolItem, + }) + } + + var outputTextEditorServerToolItem OutputTextEditorServerToolItem = OutputTextEditorServerToolItem{} + if err := utils.UnmarshalJSON(data, &outputTextEditorServerToolItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeOutputTextEditorServerToolItem, + Value: &outputTextEditorServerToolItem, + }) + } + + var outputApplyPatchServerToolItem OutputApplyPatchServerToolItem = OutputApplyPatchServerToolItem{} + if err := utils.UnmarshalJSON(data, &outputApplyPatchServerToolItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeOutputApplyPatchServerToolItem, + Value: &outputApplyPatchServerToolItem, + }) + } + + var outputWebFetchServerToolItem OutputWebFetchServerToolItem = OutputWebFetchServerToolItem{} + if err := utils.UnmarshalJSON(data, &outputWebFetchServerToolItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeOutputWebFetchServerToolItem, + Value: &outputWebFetchServerToolItem, + }) + } + + var outputToolSearchServerToolItem OutputToolSearchServerToolItem = OutputToolSearchServerToolItem{} + if err := utils.UnmarshalJSON(data, &outputToolSearchServerToolItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeOutputToolSearchServerToolItem, + Value: &outputToolSearchServerToolItem, + }) + } + + var outputMemoryServerToolItem OutputMemoryServerToolItem = OutputMemoryServerToolItem{} + if err := utils.UnmarshalJSON(data, &outputMemoryServerToolItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeOutputMemoryServerToolItem, + Value: &outputMemoryServerToolItem, + }) + } + + var outputMcpServerToolItem OutputMcpServerToolItem = OutputMcpServerToolItem{} + if err := utils.UnmarshalJSON(data, &outputMcpServerToolItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeOutputMcpServerToolItem, + Value: &outputMcpServerToolItem, + }) + } + + var outputSearchModelsServerToolItem OutputSearchModelsServerToolItem = OutputSearchModelsServerToolItem{} + if err := utils.UnmarshalJSON(data, &outputSearchModelsServerToolItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeOutputSearchModelsServerToolItem, + Value: &outputSearchModelsServerToolItem, + }) + } + + var outputAdvisorServerToolItem OutputAdvisorServerToolItem = OutputAdvisorServerToolItem{} + if err := utils.UnmarshalJSON(data, &outputAdvisorServerToolItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeOutputAdvisorServerToolItem, + Value: &outputAdvisorServerToolItem, + }) + } + + var outputSubagentServerToolItem OutputSubagentServerToolItem = OutputSubagentServerToolItem{} + if err := utils.UnmarshalJSON(data, &outputSubagentServerToolItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeOutputSubagentServerToolItem, + Value: &outputSubagentServerToolItem, + }) + } + + var localShellCallItem LocalShellCallItem = LocalShellCallItem{} + if err := utils.UnmarshalJSON(data, &localShellCallItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeLocalShellCallItem, + Value: &localShellCallItem, + }) + } + + var localShellCallOutputItem LocalShellCallOutputItem = LocalShellCallOutputItem{} + if err := utils.UnmarshalJSON(data, &localShellCallOutputItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeLocalShellCallOutputItem, + Value: &localShellCallOutputItem, + }) + } + + var shellCallItem ShellCallItem = ShellCallItem{} + if err := utils.UnmarshalJSON(data, &shellCallItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeShellCallItem, + Value: &shellCallItem, + }) + } + + var shellCallOutputItem ShellCallOutputItem = ShellCallOutputItem{} + if err := utils.UnmarshalJSON(data, &shellCallOutputItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeShellCallOutputItem, + Value: &shellCallOutputItem, + }) + } + + var mcpListToolsItem McpListToolsItem = McpListToolsItem{} + if err := utils.UnmarshalJSON(data, &mcpListToolsItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeMcpListToolsItem, + Value: &mcpListToolsItem, + }) + } + + var mcpApprovalRequestItem McpApprovalRequestItem = McpApprovalRequestItem{} + if err := utils.UnmarshalJSON(data, &mcpApprovalRequestItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeMcpApprovalRequestItem, + Value: &mcpApprovalRequestItem, + }) + } + + var mcpApprovalResponseItem McpApprovalResponseItem = McpApprovalResponseItem{} + if err := utils.UnmarshalJSON(data, &mcpApprovalResponseItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeMcpApprovalResponseItem, + Value: &mcpApprovalResponseItem, + }) + } + + var mcpCallItem McpCallItem = McpCallItem{} + if err := utils.UnmarshalJSON(data, &mcpCallItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeMcpCallItem, + Value: &mcpCallItem, + }) + } + + var customToolCallItem CustomToolCallItem = CustomToolCallItem{} + if err := utils.UnmarshalJSON(data, &customToolCallItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeCustomToolCallItem, + Value: &customToolCallItem, + }) + } + + var customToolCallOutputItem CustomToolCallOutputItem = CustomToolCallOutputItem{} + if err := utils.UnmarshalJSON(data, &customToolCallOutputItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeCustomToolCallOutputItem, + Value: &customToolCallOutputItem, + }) + } + + var compactionItem CompactionItem = CompactionItem{} + if err := utils.UnmarshalJSON(data, &compactionItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeCompactionItem, + Value: &compactionItem, + }) + } + + var itemReferenceItem ItemReferenceItem = ItemReferenceItem{} + if err := utils.UnmarshalJSON(data, &itemReferenceItem, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: InputsUnion1TypeItemReferenceItem, + Value: &itemReferenceItem, + }) + } + if len(candidates) == 0 { return fmt.Errorf("could not unmarshal `%s` into any supported union types for InputsUnion1", string(data)) } @@ -1243,6 +1832,12 @@ func (u *InputsUnion1) UnmarshalJSON(data []byte) error { case InputsUnion1TypeFunctionCallOutputItem: u.FunctionCallOutputItem = best.Value.(*FunctionCallOutputItem) return nil + case InputsUnion1TypeApplyPatchCallItem: + u.ApplyPatchCallItem = best.Value.(*ApplyPatchCallItem) + return nil + case InputsUnion1TypeApplyPatchCallOutputItem: + u.ApplyPatchCallOutputItem = best.Value.(*ApplyPatchCallOutputItem) + return nil case InputsUnion1TypeInputsMessage: u.InputsMessage = best.Value.(*InputsMessage) return nil @@ -1252,6 +1847,9 @@ func (u *InputsUnion1) UnmarshalJSON(data []byte) error { case InputsUnion1TypeOutputFunctionCallItem: u.OutputFunctionCallItem = best.Value.(*OutputFunctionCallItem) return nil + case InputsUnion1TypeOutputCustomToolCallItem: + u.OutputCustomToolCallItem = best.Value.(*OutputCustomToolCallItem) + return nil case InputsUnion1TypeOutputWebSearchCallItem: u.OutputWebSearchCallItem = best.Value.(*OutputWebSearchCallItem) return nil @@ -1261,12 +1859,96 @@ func (u *InputsUnion1) UnmarshalJSON(data []byte) error { case InputsUnion1TypeOutputImageGenerationCallItem: u.OutputImageGenerationCallItem = best.Value.(*OutputImageGenerationCallItem) return nil + case InputsUnion1TypeOutputCodeInterpreterCallItem: + u.OutputCodeInterpreterCallItem = best.Value.(*OutputCodeInterpreterCallItem) + return nil + case InputsUnion1TypeOutputComputerCallItem: + u.OutputComputerCallItem = best.Value.(*OutputComputerCallItem) + return nil case InputsUnion1TypeOutputDatetimeItem: u.OutputDatetimeItem = best.Value.(*OutputDatetimeItem) return nil case InputsUnion1TypeOutputWebSearchServerToolItem: u.OutputWebSearchServerToolItem = best.Value.(*OutputWebSearchServerToolItem) return nil + case InputsUnion1TypeOutputCodeInterpreterServerToolItem: + u.OutputCodeInterpreterServerToolItem = best.Value.(*OutputCodeInterpreterServerToolItem) + return nil + case InputsUnion1TypeOutputFileSearchServerToolItem: + u.OutputFileSearchServerToolItem = best.Value.(*OutputFileSearchServerToolItem) + return nil + case InputsUnion1TypeOutputImageGenerationServerToolItem: + u.OutputImageGenerationServerToolItem = best.Value.(*OutputImageGenerationServerToolItem) + return nil + case InputsUnion1TypeOutputBrowserUseServerToolItem: + u.OutputBrowserUseServerToolItem = best.Value.(*OutputBrowserUseServerToolItem) + return nil + case InputsUnion1TypeOutputBashServerToolItem: + u.OutputBashServerToolItem = best.Value.(*OutputBashServerToolItem) + return nil + case InputsUnion1TypeOutputTextEditorServerToolItem: + u.OutputTextEditorServerToolItem = best.Value.(*OutputTextEditorServerToolItem) + return nil + case InputsUnion1TypeOutputApplyPatchServerToolItem: + u.OutputApplyPatchServerToolItem = best.Value.(*OutputApplyPatchServerToolItem) + return nil + case InputsUnion1TypeOutputWebFetchServerToolItem: + u.OutputWebFetchServerToolItem = best.Value.(*OutputWebFetchServerToolItem) + return nil + case InputsUnion1TypeOutputToolSearchServerToolItem: + u.OutputToolSearchServerToolItem = best.Value.(*OutputToolSearchServerToolItem) + return nil + case InputsUnion1TypeOutputMemoryServerToolItem: + u.OutputMemoryServerToolItem = best.Value.(*OutputMemoryServerToolItem) + return nil + case InputsUnion1TypeOutputMcpServerToolItem: + u.OutputMcpServerToolItem = best.Value.(*OutputMcpServerToolItem) + return nil + case InputsUnion1TypeOutputSearchModelsServerToolItem: + u.OutputSearchModelsServerToolItem = best.Value.(*OutputSearchModelsServerToolItem) + return nil + case InputsUnion1TypeOutputAdvisorServerToolItem: + u.OutputAdvisorServerToolItem = best.Value.(*OutputAdvisorServerToolItem) + return nil + case InputsUnion1TypeOutputSubagentServerToolItem: + u.OutputSubagentServerToolItem = best.Value.(*OutputSubagentServerToolItem) + return nil + case InputsUnion1TypeLocalShellCallItem: + u.LocalShellCallItem = best.Value.(*LocalShellCallItem) + return nil + case InputsUnion1TypeLocalShellCallOutputItem: + u.LocalShellCallOutputItem = best.Value.(*LocalShellCallOutputItem) + return nil + case InputsUnion1TypeShellCallItem: + u.ShellCallItem = best.Value.(*ShellCallItem) + return nil + case InputsUnion1TypeShellCallOutputItem: + u.ShellCallOutputItem = best.Value.(*ShellCallOutputItem) + return nil + case InputsUnion1TypeMcpListToolsItem: + u.McpListToolsItem = best.Value.(*McpListToolsItem) + return nil + case InputsUnion1TypeMcpApprovalRequestItem: + u.McpApprovalRequestItem = best.Value.(*McpApprovalRequestItem) + return nil + case InputsUnion1TypeMcpApprovalResponseItem: + u.McpApprovalResponseItem = best.Value.(*McpApprovalResponseItem) + return nil + case InputsUnion1TypeMcpCallItem: + u.McpCallItem = best.Value.(*McpCallItem) + return nil + case InputsUnion1TypeCustomToolCallItem: + u.CustomToolCallItem = best.Value.(*CustomToolCallItem) + return nil + case InputsUnion1TypeCustomToolCallOutputItem: + u.CustomToolCallOutputItem = best.Value.(*CustomToolCallOutputItem) + return nil + case InputsUnion1TypeCompactionItem: + u.CompactionItem = best.Value.(*CompactionItem) + return nil + case InputsUnion1TypeItemReferenceItem: + u.ItemReferenceItem = best.Value.(*ItemReferenceItem) + return nil } return fmt.Errorf("could not unmarshal `%s` into any supported union types for InputsUnion1", string(data)) @@ -1293,6 +1975,14 @@ func (u InputsUnion1) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.FunctionCallOutputItem, "", true) } + if u.ApplyPatchCallItem != nil { + return utils.MarshalJSON(u.ApplyPatchCallItem, "", true) + } + + if u.ApplyPatchCallOutputItem != nil { + return utils.MarshalJSON(u.ApplyPatchCallOutputItem, "", true) + } + if u.InputsMessage != nil { return utils.MarshalJSON(u.InputsMessage, "", true) } @@ -1305,6 +1995,10 @@ func (u InputsUnion1) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.OutputFunctionCallItem, "", true) } + if u.OutputCustomToolCallItem != nil { + return utils.MarshalJSON(u.OutputCustomToolCallItem, "", true) + } + if u.OutputWebSearchCallItem != nil { return utils.MarshalJSON(u.OutputWebSearchCallItem, "", true) } @@ -1317,6 +2011,14 @@ func (u InputsUnion1) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.OutputImageGenerationCallItem, "", true) } + if u.OutputCodeInterpreterCallItem != nil { + return utils.MarshalJSON(u.OutputCodeInterpreterCallItem, "", true) + } + + if u.OutputComputerCallItem != nil { + return utils.MarshalJSON(u.OutputComputerCallItem, "", true) + } + if u.OutputDatetimeItem != nil { return utils.MarshalJSON(u.OutputDatetimeItem, "", true) } @@ -1325,6 +2027,110 @@ func (u InputsUnion1) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.OutputWebSearchServerToolItem, "", true) } + if u.OutputCodeInterpreterServerToolItem != nil { + return utils.MarshalJSON(u.OutputCodeInterpreterServerToolItem, "", true) + } + + if u.OutputFileSearchServerToolItem != nil { + return utils.MarshalJSON(u.OutputFileSearchServerToolItem, "", true) + } + + if u.OutputImageGenerationServerToolItem != nil { + return utils.MarshalJSON(u.OutputImageGenerationServerToolItem, "", true) + } + + if u.OutputBrowserUseServerToolItem != nil { + return utils.MarshalJSON(u.OutputBrowserUseServerToolItem, "", true) + } + + if u.OutputBashServerToolItem != nil { + return utils.MarshalJSON(u.OutputBashServerToolItem, "", true) + } + + if u.OutputTextEditorServerToolItem != nil { + return utils.MarshalJSON(u.OutputTextEditorServerToolItem, "", true) + } + + if u.OutputApplyPatchServerToolItem != nil { + return utils.MarshalJSON(u.OutputApplyPatchServerToolItem, "", true) + } + + if u.OutputWebFetchServerToolItem != nil { + return utils.MarshalJSON(u.OutputWebFetchServerToolItem, "", true) + } + + if u.OutputToolSearchServerToolItem != nil { + return utils.MarshalJSON(u.OutputToolSearchServerToolItem, "", true) + } + + if u.OutputMemoryServerToolItem != nil { + return utils.MarshalJSON(u.OutputMemoryServerToolItem, "", true) + } + + if u.OutputMcpServerToolItem != nil { + return utils.MarshalJSON(u.OutputMcpServerToolItem, "", true) + } + + if u.OutputSearchModelsServerToolItem != nil { + return utils.MarshalJSON(u.OutputSearchModelsServerToolItem, "", true) + } + + if u.OutputAdvisorServerToolItem != nil { + return utils.MarshalJSON(u.OutputAdvisorServerToolItem, "", true) + } + + if u.OutputSubagentServerToolItem != nil { + return utils.MarshalJSON(u.OutputSubagentServerToolItem, "", true) + } + + if u.LocalShellCallItem != nil { + return utils.MarshalJSON(u.LocalShellCallItem, "", true) + } + + if u.LocalShellCallOutputItem != nil { + return utils.MarshalJSON(u.LocalShellCallOutputItem, "", true) + } + + if u.ShellCallItem != nil { + return utils.MarshalJSON(u.ShellCallItem, "", true) + } + + if u.ShellCallOutputItem != nil { + return utils.MarshalJSON(u.ShellCallOutputItem, "", true) + } + + if u.McpListToolsItem != nil { + return utils.MarshalJSON(u.McpListToolsItem, "", true) + } + + if u.McpApprovalRequestItem != nil { + return utils.MarshalJSON(u.McpApprovalRequestItem, "", true) + } + + if u.McpApprovalResponseItem != nil { + return utils.MarshalJSON(u.McpApprovalResponseItem, "", true) + } + + if u.McpCallItem != nil { + return utils.MarshalJSON(u.McpCallItem, "", true) + } + + if u.CustomToolCallItem != nil { + return utils.MarshalJSON(u.CustomToolCallItem, "", true) + } + + if u.CustomToolCallOutputItem != nil { + return utils.MarshalJSON(u.CustomToolCallOutputItem, "", true) + } + + if u.CompactionItem != nil { + return utils.MarshalJSON(u.CompactionItem, "", true) + } + + if u.ItemReferenceItem != nil { + return utils.MarshalJSON(u.ItemReferenceItem, "", true) + } + return nil, errors.New("could not marshal union type InputsUnion1: all fields are null") } diff --git a/models/components/itemreferenceitem.go b/models/components/itemreferenceitem.go new file mode 100644 index 00000000..86de458c --- /dev/null +++ b/models/components/itemreferenceitem.go @@ -0,0 +1,63 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ItemReferenceItemType string + +const ( + ItemReferenceItemTypeItemReference ItemReferenceItemType = "item_reference" +) + +func (e ItemReferenceItemType) ToPointer() *ItemReferenceItemType { + return &e +} +func (e *ItemReferenceItemType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "item_reference": + *e = ItemReferenceItemType(v) + return nil + default: + return fmt.Errorf("invalid value for ItemReferenceItemType: %v", v) + } +} + +// ItemReferenceItem - A reference to a previous response item by ID +type ItemReferenceItem struct { + ID string `json:"id"` + Type ItemReferenceItemType `json:"type"` +} + +func (i ItemReferenceItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(i, "", false) +} + +func (i *ItemReferenceItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &i, "", false, nil); err != nil { + return err + } + return nil +} + +func (i *ItemReferenceItem) GetID() string { + if i == nil { + return "" + } + return i.ID +} + +func (i *ItemReferenceItem) GetType() ItemReferenceItemType { + if i == nil { + return ItemReferenceItemType("") + } + return i.Type +} diff --git a/models/components/legacywebsearchservertool.go b/models/components/legacywebsearchservertool.go index df521f90..508cd8f2 100644 --- a/models/components/legacywebsearchservertool.go +++ b/models/components/legacywebsearchservertool.go @@ -34,10 +34,10 @@ func (e *LegacyWebSearchServerToolType) UnmarshalJSON(data []byte) error { // LegacyWebSearchServerTool - Web search tool configuration type LegacyWebSearchServerTool struct { - // Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. + // Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). Engine *WebSearchEngineEnum `json:"engine,omitzero"` Filters optionalnullable.OptionalNullable[WebSearchDomainFilter] `json:"filters,omitzero"` - // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and Parallel engines; ignored with native provider search. + // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. MaxResults *int64 `json:"max_results,omitzero"` // Size of the search context for web search tools SearchContextSize *SearchContextSizeEnum `json:"search_context_size,omitzero"` diff --git a/models/components/listbyokkeysresponse.go b/models/components/listbyokkeysresponse.go new file mode 100644 index 00000000..4fcab3d0 --- /dev/null +++ b/models/components/listbyokkeysresponse.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ListBYOKKeysResponse struct { + // List of BYOK credentials. + Data []BYOKKey `json:"data"` + // Total number of BYOK credentials matching the filters. + TotalCount int64 `json:"total_count"` +} + +func (l *ListBYOKKeysResponse) GetData() []BYOKKey { + if l == nil { + return []BYOKKey{} + } + return l.Data +} + +func (l *ListBYOKKeysResponse) GetTotalCount() int64 { + if l == nil { + return 0 + } + return l.TotalCount +} diff --git a/models/components/listobservabilitydestinationsresponse.go b/models/components/listobservabilitydestinationsresponse.go new file mode 100644 index 00000000..05133c9c --- /dev/null +++ b/models/components/listobservabilitydestinationsresponse.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ListObservabilityDestinationsResponse struct { + // List of observability destinations. + Data []ObservabilityDestination `json:"data"` + // Total number of destinations matching the filters. + TotalCount int64 `json:"total_count"` +} + +func (l *ListObservabilityDestinationsResponse) GetData() []ObservabilityDestination { + if l == nil { + return []ObservabilityDestination{} + } + return l.Data +} + +func (l *ListObservabilityDestinationsResponse) GetTotalCount() int64 { + if l == nil { + return 0 + } + return l.TotalCount +} diff --git a/models/components/listpresetsresponse.go b/models/components/listpresetsresponse.go new file mode 100644 index 00000000..6f8d780f --- /dev/null +++ b/models/components/listpresetsresponse.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ListPresetsResponse - A paginated list of presets. +type ListPresetsResponse struct { + Data []Preset `json:"data"` + TotalCount int64 `json:"total_count"` +} + +func (l *ListPresetsResponse) GetData() []Preset { + if l == nil { + return []Preset{} + } + return l.Data +} + +func (l *ListPresetsResponse) GetTotalCount() int64 { + if l == nil { + return 0 + } + return l.TotalCount +} diff --git a/models/components/listpresetversionsresponse.go b/models/components/listpresetversionsresponse.go new file mode 100644 index 00000000..7063932d --- /dev/null +++ b/models/components/listpresetversionsresponse.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ListPresetVersionsResponse - A paginated list of preset versions. +type ListPresetVersionsResponse struct { + Data []*PresetDesignatedVersion `json:"data"` + TotalCount int64 `json:"total_count"` +} + +func (l *ListPresetVersionsResponse) GetData() []*PresetDesignatedVersion { + if l == nil { + return []*PresetDesignatedVersion{} + } + return l.Data +} + +func (l *ListPresetVersionsResponse) GetTotalCount() int64 { + if l == nil { + return 0 + } + return l.TotalCount +} diff --git a/models/components/localshellcallitem.go b/models/components/localshellcallitem.go new file mode 100644 index 00000000..003ba03f --- /dev/null +++ b/models/components/localshellcallitem.go @@ -0,0 +1,173 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type TypeExec string + +const ( + TypeExecExec TypeExec = "exec" +) + +func (e TypeExec) ToPointer() *TypeExec { + return &e +} +func (e *TypeExec) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "exec": + *e = TypeExec(v) + return nil + default: + return fmt.Errorf("invalid value for TypeExec: %v", v) + } +} + +type LocalShellCallItemAction struct { + Command []string `json:"command"` + Env map[string]string `json:"env"` + TimeoutMs optionalnullable.OptionalNullable[int64] `json:"timeout_ms,omitzero"` + Type TypeExec `json:"type"` + User optionalnullable.OptionalNullable[string] `json:"user,omitzero"` + WorkingDirectory optionalnullable.OptionalNullable[string] `json:"working_directory,omitzero"` +} + +func (l LocalShellCallItemAction) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *LocalShellCallItemAction) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, nil); err != nil { + return err + } + return nil +} + +func (l *LocalShellCallItemAction) GetCommand() []string { + if l == nil { + return []string{} + } + return l.Command +} + +func (l *LocalShellCallItemAction) GetEnv() map[string]string { + if l == nil { + return map[string]string{} + } + return l.Env +} + +func (l *LocalShellCallItemAction) GetTimeoutMs() optionalnullable.OptionalNullable[int64] { + if l == nil { + return nil + } + return l.TimeoutMs +} + +func (l *LocalShellCallItemAction) GetType() TypeExec { + if l == nil { + return TypeExec("") + } + return l.Type +} + +func (l *LocalShellCallItemAction) GetUser() optionalnullable.OptionalNullable[string] { + if l == nil { + return nil + } + return l.User +} + +func (l *LocalShellCallItemAction) GetWorkingDirectory() optionalnullable.OptionalNullable[string] { + if l == nil { + return nil + } + return l.WorkingDirectory +} + +type TypeLocalShellCall string + +const ( + TypeLocalShellCallLocalShellCall TypeLocalShellCall = "local_shell_call" +) + +func (e TypeLocalShellCall) ToPointer() *TypeLocalShellCall { + return &e +} +func (e *TypeLocalShellCall) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "local_shell_call": + *e = TypeLocalShellCall(v) + return nil + default: + return fmt.Errorf("invalid value for TypeLocalShellCall: %v", v) + } +} + +// LocalShellCallItem - A local shell command execution call +type LocalShellCallItem struct { + Action LocalShellCallItemAction `json:"action"` + CallID string `json:"call_id"` + ID string `json:"id"` + Status ToolCallStatus `json:"status"` + Type TypeLocalShellCall `json:"type"` +} + +func (l LocalShellCallItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *LocalShellCallItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, nil); err != nil { + return err + } + return nil +} + +func (l *LocalShellCallItem) GetAction() LocalShellCallItemAction { + if l == nil { + return LocalShellCallItemAction{} + } + return l.Action +} + +func (l *LocalShellCallItem) GetCallID() string { + if l == nil { + return "" + } + return l.CallID +} + +func (l *LocalShellCallItem) GetID() string { + if l == nil { + return "" + } + return l.ID +} + +func (l *LocalShellCallItem) GetStatus() ToolCallStatus { + if l == nil { + return ToolCallStatus("") + } + return l.Status +} + +func (l *LocalShellCallItem) GetType() TypeLocalShellCall { + if l == nil { + return TypeLocalShellCall("") + } + return l.Type +} diff --git a/models/components/localshellcalloutputitem.go b/models/components/localshellcalloutputitem.go new file mode 100644 index 00000000..e1a9102e --- /dev/null +++ b/models/components/localshellcalloutputitem.go @@ -0,0 +1,103 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type LocalShellCallOutputItemStatus string + +const ( + LocalShellCallOutputItemStatusInProgress LocalShellCallOutputItemStatus = "in_progress" + LocalShellCallOutputItemStatusCompleted LocalShellCallOutputItemStatus = "completed" + LocalShellCallOutputItemStatusIncomplete LocalShellCallOutputItemStatus = "incomplete" +) + +func (e LocalShellCallOutputItemStatus) ToPointer() *LocalShellCallOutputItemStatus { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *LocalShellCallOutputItemStatus) IsExact() bool { + if e != nil { + switch *e { + case "in_progress", "completed", "incomplete": + return true + } + } + return false +} + +type LocalShellCallOutputItemType string + +const ( + LocalShellCallOutputItemTypeLocalShellCallOutput LocalShellCallOutputItemType = "local_shell_call_output" +) + +func (e LocalShellCallOutputItemType) ToPointer() *LocalShellCallOutputItemType { + return &e +} +func (e *LocalShellCallOutputItemType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "local_shell_call_output": + *e = LocalShellCallOutputItemType(v) + return nil + default: + return fmt.Errorf("invalid value for LocalShellCallOutputItemType: %v", v) + } +} + +// LocalShellCallOutputItem - Output from a local shell command execution +type LocalShellCallOutputItem struct { + ID string `json:"id"` + Output string `json:"output"` + Status optionalnullable.OptionalNullable[LocalShellCallOutputItemStatus] `json:"status,omitzero"` + Type LocalShellCallOutputItemType `json:"type"` +} + +func (l LocalShellCallOutputItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *LocalShellCallOutputItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, nil); err != nil { + return err + } + return nil +} + +func (l *LocalShellCallOutputItem) GetID() string { + if l == nil { + return "" + } + return l.ID +} + +func (l *LocalShellCallOutputItem) GetOutput() string { + if l == nil { + return "" + } + return l.Output +} + +func (l *LocalShellCallOutputItem) GetStatus() optionalnullable.OptionalNullable[LocalShellCallOutputItemStatus] { + if l == nil { + return nil + } + return l.Status +} + +func (l *LocalShellCallOutputItem) GetType() LocalShellCallOutputItemType { + if l == nil { + return LocalShellCallOutputItemType("") + } + return l.Type +} diff --git a/models/components/mcpapprovalrequestitem.go b/models/components/mcpapprovalrequestitem.go new file mode 100644 index 00000000..1e70c225 --- /dev/null +++ b/models/components/mcpapprovalrequestitem.go @@ -0,0 +1,87 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type McpApprovalRequestItemType string + +const ( + McpApprovalRequestItemTypeMcpApprovalRequest McpApprovalRequestItemType = "mcp_approval_request" +) + +func (e McpApprovalRequestItemType) ToPointer() *McpApprovalRequestItemType { + return &e +} +func (e *McpApprovalRequestItemType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "mcp_approval_request": + *e = McpApprovalRequestItemType(v) + return nil + default: + return fmt.Errorf("invalid value for McpApprovalRequestItemType: %v", v) + } +} + +// McpApprovalRequestItem - Request for approval to execute an MCP tool +type McpApprovalRequestItem struct { + Arguments string `json:"arguments"` + ID string `json:"id"` + Name string `json:"name"` + ServerLabel string `json:"server_label"` + Type McpApprovalRequestItemType `json:"type"` +} + +func (m McpApprovalRequestItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *McpApprovalRequestItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *McpApprovalRequestItem) GetArguments() string { + if m == nil { + return "" + } + return m.Arguments +} + +func (m *McpApprovalRequestItem) GetID() string { + if m == nil { + return "" + } + return m.ID +} + +func (m *McpApprovalRequestItem) GetName() string { + if m == nil { + return "" + } + return m.Name +} + +func (m *McpApprovalRequestItem) GetServerLabel() string { + if m == nil { + return "" + } + return m.ServerLabel +} + +func (m *McpApprovalRequestItem) GetType() McpApprovalRequestItemType { + if m == nil { + return McpApprovalRequestItemType("") + } + return m.Type +} diff --git a/models/components/mcpapprovalresponseitem.go b/models/components/mcpapprovalresponseitem.go new file mode 100644 index 00000000..daee2fab --- /dev/null +++ b/models/components/mcpapprovalresponseitem.go @@ -0,0 +1,88 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type McpApprovalResponseItemType string + +const ( + McpApprovalResponseItemTypeMcpApprovalResponse McpApprovalResponseItemType = "mcp_approval_response" +) + +func (e McpApprovalResponseItemType) ToPointer() *McpApprovalResponseItemType { + return &e +} +func (e *McpApprovalResponseItemType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "mcp_approval_response": + *e = McpApprovalResponseItemType(v) + return nil + default: + return fmt.Errorf("invalid value for McpApprovalResponseItemType: %v", v) + } +} + +// McpApprovalResponseItem - User response to an MCP tool approval request +type McpApprovalResponseItem struct { + ApprovalRequestID string `json:"approval_request_id"` + Approve bool `json:"approve"` + ID optionalnullable.OptionalNullable[string] `json:"id,omitzero"` + Reason optionalnullable.OptionalNullable[string] `json:"reason,omitzero"` + Type McpApprovalResponseItemType `json:"type"` +} + +func (m McpApprovalResponseItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *McpApprovalResponseItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *McpApprovalResponseItem) GetApprovalRequestID() string { + if m == nil { + return "" + } + return m.ApprovalRequestID +} + +func (m *McpApprovalResponseItem) GetApprove() bool { + if m == nil { + return false + } + return m.Approve +} + +func (m *McpApprovalResponseItem) GetID() optionalnullable.OptionalNullable[string] { + if m == nil { + return nil + } + return m.ID +} + +func (m *McpApprovalResponseItem) GetReason() optionalnullable.OptionalNullable[string] { + if m == nil { + return nil + } + return m.Reason +} + +func (m *McpApprovalResponseItem) GetType() McpApprovalResponseItemType { + if m == nil { + return McpApprovalResponseItemType("") + } + return m.Type +} diff --git a/models/components/mcpcallitem.go b/models/components/mcpcallitem.go new file mode 100644 index 00000000..1c889c56 --- /dev/null +++ b/models/components/mcpcallitem.go @@ -0,0 +1,104 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type McpCallItemType string + +const ( + McpCallItemTypeMcpCall McpCallItemType = "mcp_call" +) + +func (e McpCallItemType) ToPointer() *McpCallItemType { + return &e +} +func (e *McpCallItemType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "mcp_call": + *e = McpCallItemType(v) + return nil + default: + return fmt.Errorf("invalid value for McpCallItemType: %v", v) + } +} + +// McpCallItem - An MCP tool call with its output or error +type McpCallItem struct { + Arguments string `json:"arguments"` + Error optionalnullable.OptionalNullable[string] `json:"error,omitzero"` + ID string `json:"id"` + Name string `json:"name"` + Output optionalnullable.OptionalNullable[string] `json:"output,omitzero"` + ServerLabel string `json:"server_label"` + Type McpCallItemType `json:"type"` +} + +func (m McpCallItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *McpCallItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *McpCallItem) GetArguments() string { + if m == nil { + return "" + } + return m.Arguments +} + +func (m *McpCallItem) GetError() optionalnullable.OptionalNullable[string] { + if m == nil { + return nil + } + return m.Error +} + +func (m *McpCallItem) GetID() string { + if m == nil { + return "" + } + return m.ID +} + +func (m *McpCallItem) GetName() string { + if m == nil { + return "" + } + return m.Name +} + +func (m *McpCallItem) GetOutput() optionalnullable.OptionalNullable[string] { + if m == nil { + return nil + } + return m.Output +} + +func (m *McpCallItem) GetServerLabel() string { + if m == nil { + return "" + } + return m.ServerLabel +} + +func (m *McpCallItem) GetType() McpCallItemType { + if m == nil { + return McpCallItemType("") + } + return m.Type +} diff --git a/models/components/mcplisttoolsitem.go b/models/components/mcplisttoolsitem.go new file mode 100644 index 00000000..35419036 --- /dev/null +++ b/models/components/mcplisttoolsitem.go @@ -0,0 +1,134 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type McpListToolsItemTool struct { + Annotations optionalnullable.OptionalNullable[any] `json:"annotations,omitzero"` + Description optionalnullable.OptionalNullable[string] `json:"description,omitzero"` + InputSchema map[string]any `json:"input_schema"` + Name string `json:"name"` +} + +func (m McpListToolsItemTool) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *McpListToolsItemTool) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *McpListToolsItemTool) GetAnnotations() optionalnullable.OptionalNullable[any] { + if m == nil { + return nil + } + return m.Annotations +} + +func (m *McpListToolsItemTool) GetDescription() optionalnullable.OptionalNullable[string] { + if m == nil { + return nil + } + return m.Description +} + +func (m *McpListToolsItemTool) GetInputSchema() map[string]any { + if m == nil { + return map[string]any{} + } + return m.InputSchema +} + +func (m *McpListToolsItemTool) GetName() string { + if m == nil { + return "" + } + return m.Name +} + +type McpListToolsItemType string + +const ( + McpListToolsItemTypeMcpListTools McpListToolsItemType = "mcp_list_tools" +) + +func (e McpListToolsItemType) ToPointer() *McpListToolsItemType { + return &e +} +func (e *McpListToolsItemType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "mcp_list_tools": + *e = McpListToolsItemType(v) + return nil + default: + return fmt.Errorf("invalid value for McpListToolsItemType: %v", v) + } +} + +// McpListToolsItem - List of available MCP tools from a server +type McpListToolsItem struct { + Error optionalnullable.OptionalNullable[string] `json:"error,omitzero"` + ID string `json:"id"` + ServerLabel string `json:"server_label"` + Tools []McpListToolsItemTool `json:"tools"` + Type McpListToolsItemType `json:"type"` +} + +func (m McpListToolsItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *McpListToolsItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *McpListToolsItem) GetError() optionalnullable.OptionalNullable[string] { + if m == nil { + return nil + } + return m.Error +} + +func (m *McpListToolsItem) GetID() string { + if m == nil { + return "" + } + return m.ID +} + +func (m *McpListToolsItem) GetServerLabel() string { + if m == nil { + return "" + } + return m.ServerLabel +} + +func (m *McpListToolsItem) GetTools() []McpListToolsItemTool { + if m == nil { + return []McpListToolsItemTool{} + } + return m.Tools +} + +func (m *McpListToolsItem) GetType() McpListToolsItemType { + if m == nil { + return McpListToolsItemType("") + } + return m.Type +} diff --git a/models/components/messagesadvisortoolresultblock.go b/models/components/messagesadvisortoolresultblock.go new file mode 100644 index 00000000..946aa8d7 --- /dev/null +++ b/models/components/messagesadvisortoolresultblock.go @@ -0,0 +1,71 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type MessagesAdvisorToolResultBlockType string + +const ( + MessagesAdvisorToolResultBlockTypeAdvisorToolResult MessagesAdvisorToolResultBlockType = "advisor_tool_result" +) + +func (e MessagesAdvisorToolResultBlockType) ToPointer() *MessagesAdvisorToolResultBlockType { + return &e +} +func (e *MessagesAdvisorToolResultBlockType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "advisor_tool_result": + *e = MessagesAdvisorToolResultBlockType(v) + return nil + default: + return fmt.Errorf("invalid value for MessagesAdvisorToolResultBlockType: %v", v) + } +} + +// MessagesAdvisorToolResultBlock - Advisor tool result from a prior assistant turn, replayed back to the model on the next turn. Mirrors the block Anthropic returns in assistant content when the `advisor_20260301` tool runs. +type MessagesAdvisorToolResultBlock struct { + Content map[string]any `json:"content"` + ToolUseID string `json:"tool_use_id"` + Type MessagesAdvisorToolResultBlockType `json:"type"` +} + +func (m MessagesAdvisorToolResultBlock) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MessagesAdvisorToolResultBlock) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MessagesAdvisorToolResultBlock) GetContent() map[string]any { + if m == nil { + return map[string]any{} + } + return m.Content +} + +func (m *MessagesAdvisorToolResultBlock) GetToolUseID() string { + if m == nil { + return "" + } + return m.ToolUseID +} + +func (m *MessagesAdvisorToolResultBlock) GetType() MessagesAdvisorToolResultBlockType { + if m == nil { + return MessagesAdvisorToolResultBlockType("") + } + return m.Type +} diff --git a/models/components/messagesfallbackparam.go b/models/components/messagesfallbackparam.go new file mode 100644 index 00000000..42269c45 --- /dev/null +++ b/models/components/messagesfallbackparam.go @@ -0,0 +1,38 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// MessagesFallbackParam - Fallback model to try when the primary model fails or refuses. Only the `model` field is supported; per-attempt overrides are rejected. +type MessagesFallbackParam struct { + Model string `json:"model"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (m MessagesFallbackParam) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MessagesFallbackParam) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MessagesFallbackParam) GetModel() string { + if m == nil { + return "" + } + return m.Model +} + +func (m *MessagesFallbackParam) GetAdditionalProperties() map[string]any { + if m == nil { + return nil + } + return m.AdditionalProperties +} diff --git a/models/components/messagesmessageparam.go b/models/components/messagesmessageparam.go new file mode 100644 index 00000000..9de01c70 --- /dev/null +++ b/models/components/messagesmessageparam.go @@ -0,0 +1,1453 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "errors" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type MessagesMessageParamTypeCompaction string + +const ( + MessagesMessageParamTypeCompactionCompaction MessagesMessageParamTypeCompaction = "compaction" +) + +func (e MessagesMessageParamTypeCompaction) ToPointer() *MessagesMessageParamTypeCompaction { + return &e +} +func (e *MessagesMessageParamTypeCompaction) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "compaction": + *e = MessagesMessageParamTypeCompaction(v) + return nil + default: + return fmt.Errorf("invalid value for MessagesMessageParamTypeCompaction: %v", v) + } +} + +type ContentCompaction struct { + // Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + CacheControl *AnthropicCacheControlDirective `json:"cache_control,omitzero"` + Content *string `json:"content"` + Type MessagesMessageParamTypeCompaction `json:"type"` +} + +func (c ContentCompaction) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ContentCompaction) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ContentCompaction) GetCacheControl() *AnthropicCacheControlDirective { + if c == nil { + return nil + } + return c.CacheControl +} + +func (c *ContentCompaction) GetContent() *string { + if c == nil { + return nil + } + return c.Content +} + +func (c *ContentCompaction) GetType() MessagesMessageParamTypeCompaction { + if c == nil { + return MessagesMessageParamTypeCompaction("") + } + return c.Type +} + +type ErrorCode string + +const ( + ErrorCodeInvalidToolInput ErrorCode = "invalid_tool_input" + ErrorCodeUnavailable ErrorCode = "unavailable" + ErrorCodeMaxUsesExceeded ErrorCode = "max_uses_exceeded" + ErrorCodeTooManyRequests ErrorCode = "too_many_requests" + ErrorCodeQueryTooLong ErrorCode = "query_too_long" +) + +func (e ErrorCode) ToPointer() *ErrorCode { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ErrorCode) IsExact() bool { + if e != nil { + switch *e { + case "invalid_tool_input", "unavailable", "max_uses_exceeded", "too_many_requests", "query_too_long": + return true + } + } + return false +} + +type TypeWebSearchToolResultError string + +const ( + TypeWebSearchToolResultErrorWebSearchToolResultError TypeWebSearchToolResultError = "web_search_tool_result_error" +) + +func (e TypeWebSearchToolResultError) ToPointer() *TypeWebSearchToolResultError { + return &e +} +func (e *TypeWebSearchToolResultError) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "web_search_tool_result_error": + *e = TypeWebSearchToolResultError(v) + return nil + default: + return fmt.Errorf("invalid value for TypeWebSearchToolResultError: %v", v) + } +} + +type ContentWebSearchToolResultError struct { + ErrorCode ErrorCode `json:"error_code"` + Type TypeWebSearchToolResultError `json:"type"` +} + +func (c ContentWebSearchToolResultError) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ContentWebSearchToolResultError) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ContentWebSearchToolResultError) GetErrorCode() ErrorCode { + if c == nil { + return ErrorCode("") + } + return c.ErrorCode +} + +func (c *ContentWebSearchToolResultError) GetType() TypeWebSearchToolResultError { + if c == nil { + return TypeWebSearchToolResultError("") + } + return c.Type +} + +type MessagesMessageParamContentUnion3Type string + +const ( + MessagesMessageParamContentUnion3TypeArrayOfAnthropicWebSearchResultBlockParam MessagesMessageParamContentUnion3Type = "arrayOfAnthropicWebSearchResultBlockParam" + MessagesMessageParamContentUnion3TypeContentWebSearchToolResultError MessagesMessageParamContentUnion3Type = "content_WebSearchToolResultError" +) + +type MessagesMessageParamContentUnion3 struct { + ArrayOfAnthropicWebSearchResultBlockParam []AnthropicWebSearchResultBlockParam `queryParam:"inline" union:"member"` + ContentWebSearchToolResultError *ContentWebSearchToolResultError `queryParam:"inline" union:"member"` + + Type MessagesMessageParamContentUnion3Type +} + +func CreateMessagesMessageParamContentUnion3ArrayOfAnthropicWebSearchResultBlockParam(arrayOfAnthropicWebSearchResultBlockParam []AnthropicWebSearchResultBlockParam) MessagesMessageParamContentUnion3 { + typ := MessagesMessageParamContentUnion3TypeArrayOfAnthropicWebSearchResultBlockParam + + return MessagesMessageParamContentUnion3{ + ArrayOfAnthropicWebSearchResultBlockParam: arrayOfAnthropicWebSearchResultBlockParam, + Type: typ, + } +} + +func CreateMessagesMessageParamContentUnion3ContentWebSearchToolResultError(contentWebSearchToolResultError ContentWebSearchToolResultError) MessagesMessageParamContentUnion3 { + typ := MessagesMessageParamContentUnion3TypeContentWebSearchToolResultError + + return MessagesMessageParamContentUnion3{ + ContentWebSearchToolResultError: &contentWebSearchToolResultError, + Type: typ, + } +} + +func (u *MessagesMessageParamContentUnion3) UnmarshalJSON(data []byte) error { + + var candidates []utils.UnionCandidate + + // Collect all valid candidates + var arrayOfAnthropicWebSearchResultBlockParam []AnthropicWebSearchResultBlockParam = []AnthropicWebSearchResultBlockParam{} + if err := utils.UnmarshalJSON(data, &arrayOfAnthropicWebSearchResultBlockParam, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: MessagesMessageParamContentUnion3TypeArrayOfAnthropicWebSearchResultBlockParam, + Value: arrayOfAnthropicWebSearchResultBlockParam, + }) + } + + var contentWebSearchToolResultError ContentWebSearchToolResultError = ContentWebSearchToolResultError{} + if err := utils.UnmarshalJSON(data, &contentWebSearchToolResultError, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: MessagesMessageParamContentUnion3TypeContentWebSearchToolResultError, + Value: &contentWebSearchToolResultError, + }) + } + + if len(candidates) == 0 { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for MessagesMessageParamContentUnion3", string(data)) + } + + // Pick the best candidate using multi-stage filtering + best := utils.PickBestUnionCandidate(candidates, data) + if best == nil { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for MessagesMessageParamContentUnion3", string(data)) + } + + // Set the union type and value based on the best candidate + u.Type = best.Type.(MessagesMessageParamContentUnion3Type) + switch best.Type { + case MessagesMessageParamContentUnion3TypeArrayOfAnthropicWebSearchResultBlockParam: + u.ArrayOfAnthropicWebSearchResultBlockParam = best.Value.([]AnthropicWebSearchResultBlockParam) + return nil + case MessagesMessageParamContentUnion3TypeContentWebSearchToolResultError: + u.ContentWebSearchToolResultError = best.Value.(*ContentWebSearchToolResultError) + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for MessagesMessageParamContentUnion3", string(data)) +} + +func (u MessagesMessageParamContentUnion3) MarshalJSON() ([]byte, error) { + if u.ArrayOfAnthropicWebSearchResultBlockParam != nil { + return utils.MarshalJSON(u.ArrayOfAnthropicWebSearchResultBlockParam, "", true) + } + + if u.ContentWebSearchToolResultError != nil { + return utils.MarshalJSON(u.ContentWebSearchToolResultError, "", true) + } + + return nil, errors.New("could not marshal union type MessagesMessageParamContentUnion3: all fields are null") +} + +type TypeWebSearchToolResult string + +const ( + TypeWebSearchToolResultWebSearchToolResult TypeWebSearchToolResult = "web_search_tool_result" +) + +func (e TypeWebSearchToolResult) ToPointer() *TypeWebSearchToolResult { + return &e +} +func (e *TypeWebSearchToolResult) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "web_search_tool_result": + *e = TypeWebSearchToolResult(v) + return nil + default: + return fmt.Errorf("invalid value for TypeWebSearchToolResult: %v", v) + } +} + +type ContentWebSearchToolResult struct { + // Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + CacheControl *AnthropicCacheControlDirective `json:"cache_control,omitzero"` + Content MessagesMessageParamContentUnion3 `json:"content"` + ToolUseID string `json:"tool_use_id"` + Type TypeWebSearchToolResult `json:"type"` +} + +func (c ContentWebSearchToolResult) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ContentWebSearchToolResult) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ContentWebSearchToolResult) GetCacheControl() *AnthropicCacheControlDirective { + if c == nil { + return nil + } + return c.CacheControl +} + +func (c *ContentWebSearchToolResult) GetContent() MessagesMessageParamContentUnion3 { + if c == nil { + return MessagesMessageParamContentUnion3{} + } + return c.Content +} + +func (c *ContentWebSearchToolResult) GetToolUseID() string { + if c == nil { + return "" + } + return c.ToolUseID +} + +func (c *ContentWebSearchToolResult) GetType() TypeWebSearchToolResult { + if c == nil { + return TypeWebSearchToolResult("") + } + return c.Type +} + +type TypeServerToolUse string + +const ( + TypeServerToolUseServerToolUse TypeServerToolUse = "server_tool_use" +) + +func (e TypeServerToolUse) ToPointer() *TypeServerToolUse { + return &e +} +func (e *TypeServerToolUse) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "server_tool_use": + *e = TypeServerToolUse(v) + return nil + default: + return fmt.Errorf("invalid value for TypeServerToolUse: %v", v) + } +} + +type ContentServerToolUse struct { + // Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + CacheControl *AnthropicCacheControlDirective `json:"cache_control,omitzero"` + ID string `json:"id"` + Input optionalnullable.OptionalNullable[any] `json:"input,omitzero"` + Name string `json:"name"` + Type TypeServerToolUse `json:"type"` +} + +func (c ContentServerToolUse) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ContentServerToolUse) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ContentServerToolUse) GetCacheControl() *AnthropicCacheControlDirective { + if c == nil { + return nil + } + return c.CacheControl +} + +func (c *ContentServerToolUse) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +func (c *ContentServerToolUse) GetInput() optionalnullable.OptionalNullable[any] { + if c == nil { + return nil + } + return c.Input +} + +func (c *ContentServerToolUse) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +func (c *ContentServerToolUse) GetType() TypeServerToolUse { + if c == nil { + return TypeServerToolUse("") + } + return c.Type +} + +type TypeRedactedThinking string + +const ( + TypeRedactedThinkingRedactedThinking TypeRedactedThinking = "redacted_thinking" +) + +func (e TypeRedactedThinking) ToPointer() *TypeRedactedThinking { + return &e +} +func (e *TypeRedactedThinking) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "redacted_thinking": + *e = TypeRedactedThinking(v) + return nil + default: + return fmt.Errorf("invalid value for TypeRedactedThinking: %v", v) + } +} + +type ContentRedactedThinking struct { + Data string `json:"data"` + Type TypeRedactedThinking `json:"type"` +} + +func (c ContentRedactedThinking) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ContentRedactedThinking) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ContentRedactedThinking) GetData() string { + if c == nil { + return "" + } + return c.Data +} + +func (c *ContentRedactedThinking) GetType() TypeRedactedThinking { + if c == nil { + return TypeRedactedThinking("") + } + return c.Type +} + +type TypeThinking string + +const ( + TypeThinkingThinking TypeThinking = "thinking" +) + +func (e TypeThinking) ToPointer() *TypeThinking { + return &e +} +func (e *TypeThinking) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "thinking": + *e = TypeThinking(v) + return nil + default: + return fmt.Errorf("invalid value for TypeThinking: %v", v) + } +} + +type ContentThinking struct { + Signature string `json:"signature"` + Thinking string `json:"thinking"` + Type TypeThinking `json:"type"` +} + +func (c ContentThinking) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ContentThinking) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ContentThinking) GetSignature() string { + if c == nil { + return "" + } + return c.Signature +} + +func (c *ContentThinking) GetThinking() string { + if c == nil { + return "" + } + return c.Thinking +} + +func (c *ContentThinking) GetType() TypeThinking { + if c == nil { + return TypeThinking("") + } + return c.Type +} + +type TypeToolReference string + +const ( + TypeToolReferenceToolReference TypeToolReference = "tool_reference" +) + +func (e TypeToolReference) ToPointer() *TypeToolReference { + return &e +} +func (e *TypeToolReference) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "tool_reference": + *e = TypeToolReference(v) + return nil + default: + return fmt.Errorf("invalid value for TypeToolReference: %v", v) + } +} + +type ContentToolReference struct { + ToolName string `json:"tool_name"` + Type TypeToolReference `json:"type"` +} + +func (c ContentToolReference) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ContentToolReference) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ContentToolReference) GetToolName() string { + if c == nil { + return "" + } + return c.ToolName +} + +func (c *ContentToolReference) GetType() TypeToolReference { + if c == nil { + return TypeToolReference("") + } + return c.Type +} + +type MessagesMessageParamContentUnion1Type string + +const ( + MessagesMessageParamContentUnion1TypeText MessagesMessageParamContentUnion1Type = "text" + MessagesMessageParamContentUnion1TypeImage MessagesMessageParamContentUnion1Type = "image" + MessagesMessageParamContentUnion1TypeToolReference MessagesMessageParamContentUnion1Type = "tool_reference" + MessagesMessageParamContentUnion1TypeSearchResult MessagesMessageParamContentUnion1Type = "search_result" + MessagesMessageParamContentUnion1TypeDocument MessagesMessageParamContentUnion1Type = "document" +) + +type MessagesMessageParamContentUnion1 struct { + AnthropicTextBlockParam *AnthropicTextBlockParam `queryParam:"inline" union:"member"` + AnthropicImageBlockParam *AnthropicImageBlockParam `queryParam:"inline" union:"member"` + ContentToolReference *ContentToolReference `queryParam:"inline" union:"member"` + AnthropicSearchResultBlockParam *AnthropicSearchResultBlockParam `queryParam:"inline" union:"member"` + AnthropicDocumentBlockParam *AnthropicDocumentBlockParam `queryParam:"inline" union:"member"` + + Type MessagesMessageParamContentUnion1Type +} + +func CreateMessagesMessageParamContentUnion1Text(text AnthropicTextBlockParam) MessagesMessageParamContentUnion1 { + typ := MessagesMessageParamContentUnion1TypeText + + typStr := AnthropicTextBlockParamType(typ) + text.Type = typStr + + return MessagesMessageParamContentUnion1{ + AnthropicTextBlockParam: &text, + Type: typ, + } +} + +func CreateMessagesMessageParamContentUnion1Image(image AnthropicImageBlockParam) MessagesMessageParamContentUnion1 { + typ := MessagesMessageParamContentUnion1TypeImage + + typStr := AnthropicImageBlockParamType(typ) + image.Type = typStr + + return MessagesMessageParamContentUnion1{ + AnthropicImageBlockParam: &image, + Type: typ, + } +} + +func CreateMessagesMessageParamContentUnion1ToolReference(toolReference ContentToolReference) MessagesMessageParamContentUnion1 { + typ := MessagesMessageParamContentUnion1TypeToolReference + + typStr := TypeToolReference(typ) + toolReference.Type = typStr + + return MessagesMessageParamContentUnion1{ + ContentToolReference: &toolReference, + Type: typ, + } +} + +func CreateMessagesMessageParamContentUnion1SearchResult(searchResult AnthropicSearchResultBlockParam) MessagesMessageParamContentUnion1 { + typ := MessagesMessageParamContentUnion1TypeSearchResult + + typStr := AnthropicSearchResultBlockParamType(typ) + searchResult.Type = typStr + + return MessagesMessageParamContentUnion1{ + AnthropicSearchResultBlockParam: &searchResult, + Type: typ, + } +} + +func CreateMessagesMessageParamContentUnion1Document(document AnthropicDocumentBlockParam) MessagesMessageParamContentUnion1 { + typ := MessagesMessageParamContentUnion1TypeDocument + + typStr := TypeDocument(typ) + document.Type = typStr + + return MessagesMessageParamContentUnion1{ + AnthropicDocumentBlockParam: &document, + Type: typ, + } +} + +func (u *MessagesMessageParamContentUnion1) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + return fmt.Errorf("could not unmarshal discriminator: %w", err) + } + + switch dis.Type { + case "text": + anthropicTextBlockParam := new(AnthropicTextBlockParam) + if err := utils.UnmarshalJSON(data, &anthropicTextBlockParam, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == text) type AnthropicTextBlockParam within MessagesMessageParamContentUnion1: %w", string(data), err) + } + + u.AnthropicTextBlockParam = anthropicTextBlockParam + u.Type = MessagesMessageParamContentUnion1TypeText + return nil + case "image": + anthropicImageBlockParam := new(AnthropicImageBlockParam) + if err := utils.UnmarshalJSON(data, &anthropicImageBlockParam, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == image) type AnthropicImageBlockParam within MessagesMessageParamContentUnion1: %w", string(data), err) + } + + u.AnthropicImageBlockParam = anthropicImageBlockParam + u.Type = MessagesMessageParamContentUnion1TypeImage + return nil + case "tool_reference": + contentToolReference := new(ContentToolReference) + if err := utils.UnmarshalJSON(data, &contentToolReference, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == tool_reference) type ContentToolReference within MessagesMessageParamContentUnion1: %w", string(data), err) + } + + u.ContentToolReference = contentToolReference + u.Type = MessagesMessageParamContentUnion1TypeToolReference + return nil + case "search_result": + anthropicSearchResultBlockParam := new(AnthropicSearchResultBlockParam) + if err := utils.UnmarshalJSON(data, &anthropicSearchResultBlockParam, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == search_result) type AnthropicSearchResultBlockParam within MessagesMessageParamContentUnion1: %w", string(data), err) + } + + u.AnthropicSearchResultBlockParam = anthropicSearchResultBlockParam + u.Type = MessagesMessageParamContentUnion1TypeSearchResult + return nil + case "document": + anthropicDocumentBlockParam := new(AnthropicDocumentBlockParam) + if err := utils.UnmarshalJSON(data, &anthropicDocumentBlockParam, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == document) type AnthropicDocumentBlockParam within MessagesMessageParamContentUnion1: %w", string(data), err) + } + + u.AnthropicDocumentBlockParam = anthropicDocumentBlockParam + u.Type = MessagesMessageParamContentUnion1TypeDocument + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for MessagesMessageParamContentUnion1", string(data)) +} + +func (u MessagesMessageParamContentUnion1) MarshalJSON() ([]byte, error) { + if u.AnthropicTextBlockParam != nil { + return utils.MarshalJSON(u.AnthropicTextBlockParam, "", true) + } + + if u.AnthropicImageBlockParam != nil { + return utils.MarshalJSON(u.AnthropicImageBlockParam, "", true) + } + + if u.ContentToolReference != nil { + return utils.MarshalJSON(u.ContentToolReference, "", true) + } + + if u.AnthropicSearchResultBlockParam != nil { + return utils.MarshalJSON(u.AnthropicSearchResultBlockParam, "", true) + } + + if u.AnthropicDocumentBlockParam != nil { + return utils.MarshalJSON(u.AnthropicDocumentBlockParam, "", true) + } + + return nil, errors.New("could not marshal union type MessagesMessageParamContentUnion1: all fields are null") +} + +type MessagesMessageParamContentUnion2Type string + +const ( + MessagesMessageParamContentUnion2TypeStr MessagesMessageParamContentUnion2Type = "str" + MessagesMessageParamContentUnion2TypeArrayOfMessagesMessageParamContentUnion1 MessagesMessageParamContentUnion2Type = "arrayOfMessagesMessageParamContentUnion1" +) + +type MessagesMessageParamContentUnion2 struct { + Str *string `queryParam:"inline" union:"member"` + ArrayOfMessagesMessageParamContentUnion1 []MessagesMessageParamContentUnion1 `queryParam:"inline" union:"member"` + + Type MessagesMessageParamContentUnion2Type +} + +func CreateMessagesMessageParamContentUnion2Str(str string) MessagesMessageParamContentUnion2 { + typ := MessagesMessageParamContentUnion2TypeStr + + return MessagesMessageParamContentUnion2{ + Str: &str, + Type: typ, + } +} + +func CreateMessagesMessageParamContentUnion2ArrayOfMessagesMessageParamContentUnion1(arrayOfMessagesMessageParamContentUnion1 []MessagesMessageParamContentUnion1) MessagesMessageParamContentUnion2 { + typ := MessagesMessageParamContentUnion2TypeArrayOfMessagesMessageParamContentUnion1 + + return MessagesMessageParamContentUnion2{ + ArrayOfMessagesMessageParamContentUnion1: arrayOfMessagesMessageParamContentUnion1, + Type: typ, + } +} + +func (u *MessagesMessageParamContentUnion2) UnmarshalJSON(data []byte) error { + + var candidates []utils.UnionCandidate + + // Collect all valid candidates + var str string = "" + if err := utils.UnmarshalJSON(data, &str, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: MessagesMessageParamContentUnion2TypeStr, + Value: &str, + }) + } + + var arrayOfMessagesMessageParamContentUnion1 []MessagesMessageParamContentUnion1 = []MessagesMessageParamContentUnion1{} + if err := utils.UnmarshalJSON(data, &arrayOfMessagesMessageParamContentUnion1, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: MessagesMessageParamContentUnion2TypeArrayOfMessagesMessageParamContentUnion1, + Value: arrayOfMessagesMessageParamContentUnion1, + }) + } + + if len(candidates) == 0 { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for MessagesMessageParamContentUnion2", string(data)) + } + + // Pick the best candidate using multi-stage filtering + best := utils.PickBestUnionCandidate(candidates, data) + if best == nil { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for MessagesMessageParamContentUnion2", string(data)) + } + + // Set the union type and value based on the best candidate + u.Type = best.Type.(MessagesMessageParamContentUnion2Type) + switch best.Type { + case MessagesMessageParamContentUnion2TypeStr: + u.Str = best.Value.(*string) + return nil + case MessagesMessageParamContentUnion2TypeArrayOfMessagesMessageParamContentUnion1: + u.ArrayOfMessagesMessageParamContentUnion1 = best.Value.([]MessagesMessageParamContentUnion1) + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for MessagesMessageParamContentUnion2", string(data)) +} + +func (u MessagesMessageParamContentUnion2) MarshalJSON() ([]byte, error) { + if u.Str != nil { + return utils.MarshalJSON(u.Str, "", true) + } + + if u.ArrayOfMessagesMessageParamContentUnion1 != nil { + return utils.MarshalJSON(u.ArrayOfMessagesMessageParamContentUnion1, "", true) + } + + return nil, errors.New("could not marshal union type MessagesMessageParamContentUnion2: all fields are null") +} + +type TypeToolResult string + +const ( + TypeToolResultToolResult TypeToolResult = "tool_result" +) + +func (e TypeToolResult) ToPointer() *TypeToolResult { + return &e +} +func (e *TypeToolResult) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "tool_result": + *e = TypeToolResult(v) + return nil + default: + return fmt.Errorf("invalid value for TypeToolResult: %v", v) + } +} + +type ContentToolResult struct { + // Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + CacheControl *AnthropicCacheControlDirective `json:"cache_control,omitzero"` + Content *MessagesMessageParamContentUnion2 `json:"content,omitzero"` + IsError *bool `json:"is_error,omitzero"` + ToolUseID string `json:"tool_use_id"` + Type TypeToolResult `json:"type"` +} + +func (c ContentToolResult) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ContentToolResult) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ContentToolResult) GetCacheControl() *AnthropicCacheControlDirective { + if c == nil { + return nil + } + return c.CacheControl +} + +func (c *ContentToolResult) GetContent() *MessagesMessageParamContentUnion2 { + if c == nil { + return nil + } + return c.Content +} + +func (c *ContentToolResult) GetIsError() *bool { + if c == nil { + return nil + } + return c.IsError +} + +func (c *ContentToolResult) GetToolUseID() string { + if c == nil { + return "" + } + return c.ToolUseID +} + +func (c *ContentToolResult) GetType() TypeToolResult { + if c == nil { + return TypeToolResult("") + } + return c.Type +} + +type TypeToolUse string + +const ( + TypeToolUseToolUse TypeToolUse = "tool_use" +) + +func (e TypeToolUse) ToPointer() *TypeToolUse { + return &e +} +func (e *TypeToolUse) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "tool_use": + *e = TypeToolUse(v) + return nil + default: + return fmt.Errorf("invalid value for TypeToolUse: %v", v) + } +} + +type ContentToolUse struct { + // Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + CacheControl *AnthropicCacheControlDirective `json:"cache_control,omitzero"` + ID string `json:"id"` + Input optionalnullable.OptionalNullable[any] `json:"input,omitzero"` + Name string `json:"name"` + Type TypeToolUse `json:"type"` +} + +func (c ContentToolUse) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ContentToolUse) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ContentToolUse) GetCacheControl() *AnthropicCacheControlDirective { + if c == nil { + return nil + } + return c.CacheControl +} + +func (c *ContentToolUse) GetID() string { + if c == nil { + return "" + } + return c.ID +} + +func (c *ContentToolUse) GetInput() optionalnullable.OptionalNullable[any] { + if c == nil { + return nil + } + return c.Input +} + +func (c *ContentToolUse) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +func (c *ContentToolUse) GetType() TypeToolUse { + if c == nil { + return TypeToolUse("") + } + return c.Type +} + +type MessagesMessageParamContentUnion4Type string + +const ( + MessagesMessageParamContentUnion4TypeText MessagesMessageParamContentUnion4Type = "text" + MessagesMessageParamContentUnion4TypeImage MessagesMessageParamContentUnion4Type = "image" + MessagesMessageParamContentUnion4TypeDocument MessagesMessageParamContentUnion4Type = "document" + MessagesMessageParamContentUnion4TypeToolUse MessagesMessageParamContentUnion4Type = "tool_use" + MessagesMessageParamContentUnion4TypeToolResult MessagesMessageParamContentUnion4Type = "tool_result" + MessagesMessageParamContentUnion4TypeThinking MessagesMessageParamContentUnion4Type = "thinking" + MessagesMessageParamContentUnion4TypeRedactedThinking MessagesMessageParamContentUnion4Type = "redacted_thinking" + MessagesMessageParamContentUnion4TypeServerToolUse MessagesMessageParamContentUnion4Type = "server_tool_use" + MessagesMessageParamContentUnion4TypeWebSearchToolResult MessagesMessageParamContentUnion4Type = "web_search_tool_result" + MessagesMessageParamContentUnion4TypeSearchResult MessagesMessageParamContentUnion4Type = "search_result" + MessagesMessageParamContentUnion4TypeCompaction MessagesMessageParamContentUnion4Type = "compaction" + MessagesMessageParamContentUnion4TypeAdvisorToolResult MessagesMessageParamContentUnion4Type = "advisor_tool_result" +) + +type MessagesMessageParamContentUnion4 struct { + AnthropicTextBlockParam *AnthropicTextBlockParam `queryParam:"inline" union:"member"` + AnthropicImageBlockParam *AnthropicImageBlockParam `queryParam:"inline" union:"member"` + AnthropicDocumentBlockParam *AnthropicDocumentBlockParam `queryParam:"inline" union:"member"` + ContentToolUse *ContentToolUse `queryParam:"inline" union:"member"` + ContentToolResult *ContentToolResult `queryParam:"inline" union:"member"` + ContentThinking *ContentThinking `queryParam:"inline" union:"member"` + ContentRedactedThinking *ContentRedactedThinking `queryParam:"inline" union:"member"` + ContentServerToolUse *ContentServerToolUse `queryParam:"inline" union:"member"` + ContentWebSearchToolResult *ContentWebSearchToolResult `queryParam:"inline" union:"member"` + AnthropicSearchResultBlockParam *AnthropicSearchResultBlockParam `queryParam:"inline" union:"member"` + ContentCompaction *ContentCompaction `queryParam:"inline" union:"member"` + MessagesAdvisorToolResultBlock *MessagesAdvisorToolResultBlock `queryParam:"inline" union:"member"` + + Type MessagesMessageParamContentUnion4Type +} + +func CreateMessagesMessageParamContentUnion4Text(text AnthropicTextBlockParam) MessagesMessageParamContentUnion4 { + typ := MessagesMessageParamContentUnion4TypeText + + typStr := AnthropicTextBlockParamType(typ) + text.Type = typStr + + return MessagesMessageParamContentUnion4{ + AnthropicTextBlockParam: &text, + Type: typ, + } +} + +func CreateMessagesMessageParamContentUnion4Image(image AnthropicImageBlockParam) MessagesMessageParamContentUnion4 { + typ := MessagesMessageParamContentUnion4TypeImage + + typStr := AnthropicImageBlockParamType(typ) + image.Type = typStr + + return MessagesMessageParamContentUnion4{ + AnthropicImageBlockParam: &image, + Type: typ, + } +} + +func CreateMessagesMessageParamContentUnion4Document(document AnthropicDocumentBlockParam) MessagesMessageParamContentUnion4 { + typ := MessagesMessageParamContentUnion4TypeDocument + + typStr := TypeDocument(typ) + document.Type = typStr + + return MessagesMessageParamContentUnion4{ + AnthropicDocumentBlockParam: &document, + Type: typ, + } +} + +func CreateMessagesMessageParamContentUnion4ToolUse(toolUse ContentToolUse) MessagesMessageParamContentUnion4 { + typ := MessagesMessageParamContentUnion4TypeToolUse + + typStr := TypeToolUse(typ) + toolUse.Type = typStr + + return MessagesMessageParamContentUnion4{ + ContentToolUse: &toolUse, + Type: typ, + } +} + +func CreateMessagesMessageParamContentUnion4ToolResult(toolResult ContentToolResult) MessagesMessageParamContentUnion4 { + typ := MessagesMessageParamContentUnion4TypeToolResult + + typStr := TypeToolResult(typ) + toolResult.Type = typStr + + return MessagesMessageParamContentUnion4{ + ContentToolResult: &toolResult, + Type: typ, + } +} + +func CreateMessagesMessageParamContentUnion4Thinking(thinking ContentThinking) MessagesMessageParamContentUnion4 { + typ := MessagesMessageParamContentUnion4TypeThinking + + typStr := TypeThinking(typ) + thinking.Type = typStr + + return MessagesMessageParamContentUnion4{ + ContentThinking: &thinking, + Type: typ, + } +} + +func CreateMessagesMessageParamContentUnion4RedactedThinking(redactedThinking ContentRedactedThinking) MessagesMessageParamContentUnion4 { + typ := MessagesMessageParamContentUnion4TypeRedactedThinking + + typStr := TypeRedactedThinking(typ) + redactedThinking.Type = typStr + + return MessagesMessageParamContentUnion4{ + ContentRedactedThinking: &redactedThinking, + Type: typ, + } +} + +func CreateMessagesMessageParamContentUnion4ServerToolUse(serverToolUse ContentServerToolUse) MessagesMessageParamContentUnion4 { + typ := MessagesMessageParamContentUnion4TypeServerToolUse + + typStr := TypeServerToolUse(typ) + serverToolUse.Type = typStr + + return MessagesMessageParamContentUnion4{ + ContentServerToolUse: &serverToolUse, + Type: typ, + } +} + +func CreateMessagesMessageParamContentUnion4WebSearchToolResult(webSearchToolResult ContentWebSearchToolResult) MessagesMessageParamContentUnion4 { + typ := MessagesMessageParamContentUnion4TypeWebSearchToolResult + + typStr := TypeWebSearchToolResult(typ) + webSearchToolResult.Type = typStr + + return MessagesMessageParamContentUnion4{ + ContentWebSearchToolResult: &webSearchToolResult, + Type: typ, + } +} + +func CreateMessagesMessageParamContentUnion4SearchResult(searchResult AnthropicSearchResultBlockParam) MessagesMessageParamContentUnion4 { + typ := MessagesMessageParamContentUnion4TypeSearchResult + + typStr := AnthropicSearchResultBlockParamType(typ) + searchResult.Type = typStr + + return MessagesMessageParamContentUnion4{ + AnthropicSearchResultBlockParam: &searchResult, + Type: typ, + } +} + +func CreateMessagesMessageParamContentUnion4Compaction(compaction ContentCompaction) MessagesMessageParamContentUnion4 { + typ := MessagesMessageParamContentUnion4TypeCompaction + + typStr := MessagesMessageParamTypeCompaction(typ) + compaction.Type = typStr + + return MessagesMessageParamContentUnion4{ + ContentCompaction: &compaction, + Type: typ, + } +} + +func CreateMessagesMessageParamContentUnion4AdvisorToolResult(advisorToolResult MessagesAdvisorToolResultBlock) MessagesMessageParamContentUnion4 { + typ := MessagesMessageParamContentUnion4TypeAdvisorToolResult + + typStr := MessagesAdvisorToolResultBlockType(typ) + advisorToolResult.Type = typStr + + return MessagesMessageParamContentUnion4{ + MessagesAdvisorToolResultBlock: &advisorToolResult, + Type: typ, + } +} + +func (u *MessagesMessageParamContentUnion4) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + return fmt.Errorf("could not unmarshal discriminator: %w", err) + } + + switch dis.Type { + case "text": + anthropicTextBlockParam := new(AnthropicTextBlockParam) + if err := utils.UnmarshalJSON(data, &anthropicTextBlockParam, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == text) type AnthropicTextBlockParam within MessagesMessageParamContentUnion4: %w", string(data), err) + } + + u.AnthropicTextBlockParam = anthropicTextBlockParam + u.Type = MessagesMessageParamContentUnion4TypeText + return nil + case "image": + anthropicImageBlockParam := new(AnthropicImageBlockParam) + if err := utils.UnmarshalJSON(data, &anthropicImageBlockParam, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == image) type AnthropicImageBlockParam within MessagesMessageParamContentUnion4: %w", string(data), err) + } + + u.AnthropicImageBlockParam = anthropicImageBlockParam + u.Type = MessagesMessageParamContentUnion4TypeImage + return nil + case "document": + anthropicDocumentBlockParam := new(AnthropicDocumentBlockParam) + if err := utils.UnmarshalJSON(data, &anthropicDocumentBlockParam, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == document) type AnthropicDocumentBlockParam within MessagesMessageParamContentUnion4: %w", string(data), err) + } + + u.AnthropicDocumentBlockParam = anthropicDocumentBlockParam + u.Type = MessagesMessageParamContentUnion4TypeDocument + return nil + case "tool_use": + contentToolUse := new(ContentToolUse) + if err := utils.UnmarshalJSON(data, &contentToolUse, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == tool_use) type ContentToolUse within MessagesMessageParamContentUnion4: %w", string(data), err) + } + + u.ContentToolUse = contentToolUse + u.Type = MessagesMessageParamContentUnion4TypeToolUse + return nil + case "tool_result": + contentToolResult := new(ContentToolResult) + if err := utils.UnmarshalJSON(data, &contentToolResult, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == tool_result) type ContentToolResult within MessagesMessageParamContentUnion4: %w", string(data), err) + } + + u.ContentToolResult = contentToolResult + u.Type = MessagesMessageParamContentUnion4TypeToolResult + return nil + case "thinking": + contentThinking := new(ContentThinking) + if err := utils.UnmarshalJSON(data, &contentThinking, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == thinking) type ContentThinking within MessagesMessageParamContentUnion4: %w", string(data), err) + } + + u.ContentThinking = contentThinking + u.Type = MessagesMessageParamContentUnion4TypeThinking + return nil + case "redacted_thinking": + contentRedactedThinking := new(ContentRedactedThinking) + if err := utils.UnmarshalJSON(data, &contentRedactedThinking, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == redacted_thinking) type ContentRedactedThinking within MessagesMessageParamContentUnion4: %w", string(data), err) + } + + u.ContentRedactedThinking = contentRedactedThinking + u.Type = MessagesMessageParamContentUnion4TypeRedactedThinking + return nil + case "server_tool_use": + contentServerToolUse := new(ContentServerToolUse) + if err := utils.UnmarshalJSON(data, &contentServerToolUse, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == server_tool_use) type ContentServerToolUse within MessagesMessageParamContentUnion4: %w", string(data), err) + } + + u.ContentServerToolUse = contentServerToolUse + u.Type = MessagesMessageParamContentUnion4TypeServerToolUse + return nil + case "web_search_tool_result": + contentWebSearchToolResult := new(ContentWebSearchToolResult) + if err := utils.UnmarshalJSON(data, &contentWebSearchToolResult, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == web_search_tool_result) type ContentWebSearchToolResult within MessagesMessageParamContentUnion4: %w", string(data), err) + } + + u.ContentWebSearchToolResult = contentWebSearchToolResult + u.Type = MessagesMessageParamContentUnion4TypeWebSearchToolResult + return nil + case "search_result": + anthropicSearchResultBlockParam := new(AnthropicSearchResultBlockParam) + if err := utils.UnmarshalJSON(data, &anthropicSearchResultBlockParam, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == search_result) type AnthropicSearchResultBlockParam within MessagesMessageParamContentUnion4: %w", string(data), err) + } + + u.AnthropicSearchResultBlockParam = anthropicSearchResultBlockParam + u.Type = MessagesMessageParamContentUnion4TypeSearchResult + return nil + case "compaction": + contentCompaction := new(ContentCompaction) + if err := utils.UnmarshalJSON(data, &contentCompaction, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == compaction) type ContentCompaction within MessagesMessageParamContentUnion4: %w", string(data), err) + } + + u.ContentCompaction = contentCompaction + u.Type = MessagesMessageParamContentUnion4TypeCompaction + return nil + case "advisor_tool_result": + messagesAdvisorToolResultBlock := new(MessagesAdvisorToolResultBlock) + if err := utils.UnmarshalJSON(data, &messagesAdvisorToolResultBlock, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == advisor_tool_result) type MessagesAdvisorToolResultBlock within MessagesMessageParamContentUnion4: %w", string(data), err) + } + + u.MessagesAdvisorToolResultBlock = messagesAdvisorToolResultBlock + u.Type = MessagesMessageParamContentUnion4TypeAdvisorToolResult + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for MessagesMessageParamContentUnion4", string(data)) +} + +func (u MessagesMessageParamContentUnion4) MarshalJSON() ([]byte, error) { + if u.AnthropicTextBlockParam != nil { + return utils.MarshalJSON(u.AnthropicTextBlockParam, "", true) + } + + if u.AnthropicImageBlockParam != nil { + return utils.MarshalJSON(u.AnthropicImageBlockParam, "", true) + } + + if u.AnthropicDocumentBlockParam != nil { + return utils.MarshalJSON(u.AnthropicDocumentBlockParam, "", true) + } + + if u.ContentToolUse != nil { + return utils.MarshalJSON(u.ContentToolUse, "", true) + } + + if u.ContentToolResult != nil { + return utils.MarshalJSON(u.ContentToolResult, "", true) + } + + if u.ContentThinking != nil { + return utils.MarshalJSON(u.ContentThinking, "", true) + } + + if u.ContentRedactedThinking != nil { + return utils.MarshalJSON(u.ContentRedactedThinking, "", true) + } + + if u.ContentServerToolUse != nil { + return utils.MarshalJSON(u.ContentServerToolUse, "", true) + } + + if u.ContentWebSearchToolResult != nil { + return utils.MarshalJSON(u.ContentWebSearchToolResult, "", true) + } + + if u.AnthropicSearchResultBlockParam != nil { + return utils.MarshalJSON(u.AnthropicSearchResultBlockParam, "", true) + } + + if u.ContentCompaction != nil { + return utils.MarshalJSON(u.ContentCompaction, "", true) + } + + if u.MessagesAdvisorToolResultBlock != nil { + return utils.MarshalJSON(u.MessagesAdvisorToolResultBlock, "", true) + } + + return nil, errors.New("could not marshal union type MessagesMessageParamContentUnion4: all fields are null") +} + +type MessagesMessageParamContentUnion5Type string + +const ( + MessagesMessageParamContentUnion5TypeStr MessagesMessageParamContentUnion5Type = "str" + MessagesMessageParamContentUnion5TypeArrayOfMessagesMessageParamContentUnion4 MessagesMessageParamContentUnion5Type = "arrayOfMessagesMessageParamContentUnion4" +) + +type MessagesMessageParamContentUnion5 struct { + Str *string `queryParam:"inline" union:"member"` + ArrayOfMessagesMessageParamContentUnion4 []MessagesMessageParamContentUnion4 `queryParam:"inline" union:"member"` + + Type MessagesMessageParamContentUnion5Type +} + +func CreateMessagesMessageParamContentUnion5Str(str string) MessagesMessageParamContentUnion5 { + typ := MessagesMessageParamContentUnion5TypeStr + + return MessagesMessageParamContentUnion5{ + Str: &str, + Type: typ, + } +} + +func CreateMessagesMessageParamContentUnion5ArrayOfMessagesMessageParamContentUnion4(arrayOfMessagesMessageParamContentUnion4 []MessagesMessageParamContentUnion4) MessagesMessageParamContentUnion5 { + typ := MessagesMessageParamContentUnion5TypeArrayOfMessagesMessageParamContentUnion4 + + return MessagesMessageParamContentUnion5{ + ArrayOfMessagesMessageParamContentUnion4: arrayOfMessagesMessageParamContentUnion4, + Type: typ, + } +} + +func (u *MessagesMessageParamContentUnion5) UnmarshalJSON(data []byte) error { + + var candidates []utils.UnionCandidate + + // Collect all valid candidates + var str string = "" + if err := utils.UnmarshalJSON(data, &str, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: MessagesMessageParamContentUnion5TypeStr, + Value: &str, + }) + } + + var arrayOfMessagesMessageParamContentUnion4 []MessagesMessageParamContentUnion4 = []MessagesMessageParamContentUnion4{} + if err := utils.UnmarshalJSON(data, &arrayOfMessagesMessageParamContentUnion4, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: MessagesMessageParamContentUnion5TypeArrayOfMessagesMessageParamContentUnion4, + Value: arrayOfMessagesMessageParamContentUnion4, + }) + } + + if len(candidates) == 0 { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for MessagesMessageParamContentUnion5", string(data)) + } + + // Pick the best candidate using multi-stage filtering + best := utils.PickBestUnionCandidate(candidates, data) + if best == nil { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for MessagesMessageParamContentUnion5", string(data)) + } + + // Set the union type and value based on the best candidate + u.Type = best.Type.(MessagesMessageParamContentUnion5Type) + switch best.Type { + case MessagesMessageParamContentUnion5TypeStr: + u.Str = best.Value.(*string) + return nil + case MessagesMessageParamContentUnion5TypeArrayOfMessagesMessageParamContentUnion4: + u.ArrayOfMessagesMessageParamContentUnion4 = best.Value.([]MessagesMessageParamContentUnion4) + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for MessagesMessageParamContentUnion5", string(data)) +} + +func (u MessagesMessageParamContentUnion5) MarshalJSON() ([]byte, error) { + if u.Str != nil { + return utils.MarshalJSON(u.Str, "", true) + } + + if u.ArrayOfMessagesMessageParamContentUnion4 != nil { + return utils.MarshalJSON(u.ArrayOfMessagesMessageParamContentUnion4, "", true) + } + + return nil, errors.New("could not marshal union type MessagesMessageParamContentUnion5: all fields are null") +} + +type MessagesMessageParamRole string + +const ( + MessagesMessageParamRoleUser MessagesMessageParamRole = "user" + MessagesMessageParamRoleAssistant MessagesMessageParamRole = "assistant" + MessagesMessageParamRoleSystem MessagesMessageParamRole = "system" +) + +func (e MessagesMessageParamRole) ToPointer() *MessagesMessageParamRole { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *MessagesMessageParamRole) IsExact() bool { + if e != nil { + switch *e { + case "user", "assistant", "system": + return true + } + } + return false +} + +// MessagesMessageParam - Anthropic message with OpenRouter extensions +type MessagesMessageParam struct { + Content MessagesMessageParamContentUnion5 `json:"content"` + Role MessagesMessageParamRole `json:"role"` +} + +func (m *MessagesMessageParam) GetContent() MessagesMessageParamContentUnion5 { + if m == nil { + return MessagesMessageParamContentUnion5{} + } + return m.Content +} + +func (m *MessagesMessageParam) GetRole() MessagesMessageParamRole { + if m == nil { + return MessagesMessageParamRole("") + } + return m.Role +} diff --git a/models/components/messagesoutputconfig.go b/models/components/messagesoutputconfig.go new file mode 100644 index 00000000..e06eae5c --- /dev/null +++ b/models/components/messagesoutputconfig.go @@ -0,0 +1,172 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +// MessagesOutputConfigEffort - How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer. Valid values are `low`, `medium`, `high`, `xhigh`, or `max`. +type MessagesOutputConfigEffort string + +const ( + MessagesOutputConfigEffortLow MessagesOutputConfigEffort = "low" + MessagesOutputConfigEffortMedium MessagesOutputConfigEffort = "medium" + MessagesOutputConfigEffortHigh MessagesOutputConfigEffort = "high" + MessagesOutputConfigEffortXhigh MessagesOutputConfigEffort = "xhigh" + MessagesOutputConfigEffortMax MessagesOutputConfigEffort = "max" +) + +func (e MessagesOutputConfigEffort) ToPointer() *MessagesOutputConfigEffort { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *MessagesOutputConfigEffort) IsExact() bool { + if e != nil { + switch *e { + case "low", "medium", "high", "xhigh", "max": + return true + } + } + return false +} + +type MessagesOutputConfigTypeJSONSchema string + +const ( + MessagesOutputConfigTypeJSONSchemaJSONSchema MessagesOutputConfigTypeJSONSchema = "json_schema" +) + +func (e MessagesOutputConfigTypeJSONSchema) ToPointer() *MessagesOutputConfigTypeJSONSchema { + return &e +} +func (e *MessagesOutputConfigTypeJSONSchema) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "json_schema": + *e = MessagesOutputConfigTypeJSONSchema(v) + return nil + default: + return fmt.Errorf("invalid value for MessagesOutputConfigTypeJSONSchema: %v", v) + } +} + +// MessagesOutputConfigFormat - A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs). +type MessagesOutputConfigFormat struct { + Schema map[string]any `json:"schema"` + Type MessagesOutputConfigTypeJSONSchema `json:"type"` +} + +func (m *MessagesOutputConfigFormat) GetSchema() map[string]any { + if m == nil { + return map[string]any{} + } + return m.Schema +} + +func (m *MessagesOutputConfigFormat) GetType() MessagesOutputConfigTypeJSONSchema { + if m == nil { + return MessagesOutputConfigTypeJSONSchema("") + } + return m.Type +} + +type TypeTokens string + +const ( + TypeTokensTokens TypeTokens = "tokens" +) + +func (e TypeTokens) ToPointer() *TypeTokens { + return &e +} +func (e *TypeTokens) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "tokens": + *e = TypeTokens(v) + return nil + default: + return fmt.Errorf("invalid value for TypeTokens: %v", v) + } +} + +// TaskBudget - Task budget for an agentic turn. The model sees a countdown of remaining tokens and uses it to prioritize work and wind down gracefully. Advisory — does not enforce a hard cap. +type TaskBudget struct { + Remaining optionalnullable.OptionalNullable[int64] `json:"remaining,omitzero"` + Total int64 `json:"total"` + Type TypeTokens `json:"type"` +} + +func (t *TaskBudget) GetRemaining() optionalnullable.OptionalNullable[int64] { + if t == nil { + return nil + } + return t.Remaining +} + +func (t *TaskBudget) GetTotal() int64 { + if t == nil { + return 0 + } + return t.Total +} + +func (t *TaskBudget) GetType() TypeTokens { + if t == nil { + return TypeTokens("") + } + return t.Type +} + +// MessagesOutputConfig - Configuration for controlling output behavior. Supports the effort parameter and structured output format. +type MessagesOutputConfig struct { + // How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer. Valid values are `low`, `medium`, `high`, `xhigh`, or `max`. + Effort optionalnullable.OptionalNullable[MessagesOutputConfigEffort] `json:"effort,omitzero"` + // A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs). + Format optionalnullable.OptionalNullable[MessagesOutputConfigFormat] `json:"format,omitzero"` + // Task budget for an agentic turn. The model sees a countdown of remaining tokens and uses it to prioritize work and wind down gracefully. Advisory — does not enforce a hard cap. + TaskBudget optionalnullable.OptionalNullable[TaskBudget] `json:"task_budget,omitzero"` +} + +func (m MessagesOutputConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MessagesOutputConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MessagesOutputConfig) GetEffort() optionalnullable.OptionalNullable[MessagesOutputConfigEffort] { + if m == nil { + return nil + } + return m.Effort +} + +func (m *MessagesOutputConfig) GetFormat() optionalnullable.OptionalNullable[MessagesOutputConfigFormat] { + if m == nil { + return nil + } + return m.Format +} + +func (m *MessagesOutputConfig) GetTaskBudget() optionalnullable.OptionalNullable[TaskBudget] { + if m == nil { + return nil + } + return m.TaskBudget +} diff --git a/models/components/messagesrequest.go b/models/components/messagesrequest.go new file mode 100644 index 00000000..4a25c189 --- /dev/null +++ b/models/components/messagesrequest.go @@ -0,0 +1,3246 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "errors" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type EditTypeInputTokens string + +const ( + EditTypeInputTokensInputTokens EditTypeInputTokens = "input_tokens" +) + +func (e EditTypeInputTokens) ToPointer() *EditTypeInputTokens { + return &e +} +func (e *EditTypeInputTokens) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "input_tokens": + *e = EditTypeInputTokens(v) + return nil + default: + return fmt.Errorf("invalid value for EditTypeInputTokens: %v", v) + } +} + +type TriggerInputTokens struct { + Type EditTypeInputTokens `json:"type"` + Value int64 `json:"value"` +} + +func (t TriggerInputTokens) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TriggerInputTokens) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *TriggerInputTokens) GetType() EditTypeInputTokens { + if t == nil { + return EditTypeInputTokens("") + } + return t.Type +} + +func (t *TriggerInputTokens) GetValue() int64 { + if t == nil { + return 0 + } + return t.Value +} + +type TypeCompact20260112 string + +const ( + TypeCompact20260112Compact20260112 TypeCompact20260112 = "compact_20260112" +) + +func (e TypeCompact20260112) ToPointer() *TypeCompact20260112 { + return &e +} +func (e *TypeCompact20260112) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "compact_20260112": + *e = TypeCompact20260112(v) + return nil + default: + return fmt.Errorf("invalid value for TypeCompact20260112: %v", v) + } +} + +type EditCompact20260112 struct { + Instructions optionalnullable.OptionalNullable[string] `json:"instructions,omitzero"` + PauseAfterCompaction *bool `json:"pause_after_compaction,omitzero"` + Trigger optionalnullable.OptionalNullable[TriggerInputTokens] `json:"trigger,omitzero"` + Type TypeCompact20260112 `json:"type"` +} + +func (e EditCompact20260112) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *EditCompact20260112) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, nil); err != nil { + return err + } + return nil +} + +func (e *EditCompact20260112) GetInstructions() optionalnullable.OptionalNullable[string] { + if e == nil { + return nil + } + return e.Instructions +} + +func (e *EditCompact20260112) GetPauseAfterCompaction() *bool { + if e == nil { + return nil + } + return e.PauseAfterCompaction +} + +func (e *EditCompact20260112) GetTrigger() optionalnullable.OptionalNullable[TriggerInputTokens] { + if e == nil { + return nil + } + return e.Trigger +} + +func (e *EditCompact20260112) GetType() TypeCompact20260112 { + if e == nil { + return TypeCompact20260112("") + } + return e.Type +} + +// #region class-body-editcompact20260112 +// #endregion class-body-editcompact20260112 + +type KeepEnum string + +const ( + KeepEnumAll KeepEnum = "all" +) + +func (e KeepEnum) ToPointer() *KeepEnum { + return &e +} +func (e *KeepEnum) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "all": + *e = KeepEnum(v) + return nil + default: + return fmt.Errorf("invalid value for KeepEnum: %v", v) + } +} + +type KeepType string + +const ( + KeepTypeAll KeepType = "all" +) + +func (e KeepType) ToPointer() *KeepType { + return &e +} +func (e *KeepType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "all": + *e = KeepType(v) + return nil + default: + return fmt.Errorf("invalid value for KeepType: %v", v) + } +} + +type KeepAll struct { + Type KeepType `json:"type"` +} + +func (k KeepAll) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(k, "", false) +} + +func (k *KeepAll) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &k, "", false, nil); err != nil { + return err + } + return nil +} + +func (k *KeepAll) GetType() KeepType { + if k == nil { + return KeepType("") + } + return k.Type +} + +type KeepUnionType string + +const ( + KeepUnionTypeAnthropicThinkingTurns KeepUnionType = "AnthropicThinkingTurns" + KeepUnionTypeKeepAll KeepUnionType = "keep_All" + KeepUnionTypeKeepEnum KeepUnionType = "keep_enum" +) + +type Keep struct { + AnthropicThinkingTurns *AnthropicThinkingTurns `queryParam:"inline" union:"member"` + KeepAll *KeepAll `queryParam:"inline" union:"member"` + KeepEnum *KeepEnum `queryParam:"inline" union:"member"` + + Type KeepUnionType +} + +func CreateKeepAnthropicThinkingTurns(anthropicThinkingTurns AnthropicThinkingTurns) Keep { + typ := KeepUnionTypeAnthropicThinkingTurns + + return Keep{ + AnthropicThinkingTurns: &anthropicThinkingTurns, + Type: typ, + } +} + +func CreateKeepKeepAll(keepAll KeepAll) Keep { + typ := KeepUnionTypeKeepAll + + return Keep{ + KeepAll: &keepAll, + Type: typ, + } +} + +func CreateKeepKeepEnum(keepEnum KeepEnum) Keep { + typ := KeepUnionTypeKeepEnum + + return Keep{ + KeepEnum: &keepEnum, + Type: typ, + } +} + +func (u *Keep) UnmarshalJSON(data []byte) error { + + var candidates []utils.UnionCandidate + + // Collect all valid candidates + var anthropicThinkingTurns AnthropicThinkingTurns = AnthropicThinkingTurns{} + if err := utils.UnmarshalJSON(data, &anthropicThinkingTurns, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: KeepUnionTypeAnthropicThinkingTurns, + Value: &anthropicThinkingTurns, + }) + } + + var keepAll KeepAll = KeepAll{} + if err := utils.UnmarshalJSON(data, &keepAll, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: KeepUnionTypeKeepAll, + Value: &keepAll, + }) + } + + var keepEnum KeepEnum = KeepEnum("") + if err := utils.UnmarshalJSON(data, &keepEnum, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: KeepUnionTypeKeepEnum, + Value: &keepEnum, + }) + } + + if len(candidates) == 0 { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for Keep", string(data)) + } + + // Pick the best candidate using multi-stage filtering + best := utils.PickBestUnionCandidate(candidates, data) + if best == nil { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for Keep", string(data)) + } + + // Set the union type and value based on the best candidate + u.Type = best.Type.(KeepUnionType) + switch best.Type { + case KeepUnionTypeAnthropicThinkingTurns: + u.AnthropicThinkingTurns = best.Value.(*AnthropicThinkingTurns) + return nil + case KeepUnionTypeKeepAll: + u.KeepAll = best.Value.(*KeepAll) + return nil + case KeepUnionTypeKeepEnum: + u.KeepEnum = best.Value.(*KeepEnum) + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for Keep", string(data)) +} + +func (u Keep) MarshalJSON() ([]byte, error) { + if u.AnthropicThinkingTurns != nil { + return utils.MarshalJSON(u.AnthropicThinkingTurns, "", true) + } + + if u.KeepAll != nil { + return utils.MarshalJSON(u.KeepAll, "", true) + } + + if u.KeepEnum != nil { + return utils.MarshalJSON(u.KeepEnum, "", true) + } + + return nil, errors.New("could not marshal union type Keep: all fields are null") +} + +type TypeClearThinking20251015 string + +const ( + TypeClearThinking20251015ClearThinking20251015 TypeClearThinking20251015 = "clear_thinking_20251015" +) + +func (e TypeClearThinking20251015) ToPointer() *TypeClearThinking20251015 { + return &e +} +func (e *TypeClearThinking20251015) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "clear_thinking_20251015": + *e = TypeClearThinking20251015(v) + return nil + default: + return fmt.Errorf("invalid value for TypeClearThinking20251015: %v", v) + } +} + +type EditClearThinking20251015 struct { + Keep *Keep `json:"keep,omitzero"` + Type TypeClearThinking20251015 `json:"type"` +} + +func (e EditClearThinking20251015) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *EditClearThinking20251015) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, nil); err != nil { + return err + } + return nil +} + +func (e *EditClearThinking20251015) GetKeep() *Keep { + if e == nil { + return nil + } + return e.Keep +} + +func (e *EditClearThinking20251015) GetType() TypeClearThinking20251015 { + if e == nil { + return TypeClearThinking20251015("") + } + return e.Type +} + +// #region class-body-editclearthinking20251015 +// #endregion class-body-editclearthinking20251015 + +type ClearToolInputsType string + +const ( + ClearToolInputsTypeBoolean ClearToolInputsType = "boolean" + ClearToolInputsTypeArrayOfStr ClearToolInputsType = "arrayOfStr" + ClearToolInputsTypeAny ClearToolInputsType = "any" +) + +type ClearToolInputs struct { + Boolean *bool `queryParam:"inline" union:"member"` + ArrayOfStr []string `queryParam:"inline" union:"member"` + Any any `queryParam:"inline" union:"member"` + + Type ClearToolInputsType +} + +func CreateClearToolInputsBoolean(boolean bool) ClearToolInputs { + typ := ClearToolInputsTypeBoolean + + return ClearToolInputs{ + Boolean: &boolean, + Type: typ, + } +} + +func CreateClearToolInputsArrayOfStr(arrayOfStr []string) ClearToolInputs { + typ := ClearToolInputsTypeArrayOfStr + + return ClearToolInputs{ + ArrayOfStr: arrayOfStr, + Type: typ, + } +} + +func CreateClearToolInputsAny(anyT any) ClearToolInputs { + typ := ClearToolInputsTypeAny + + return ClearToolInputs{ + Any: anyT, + Type: typ, + } +} + +func (u *ClearToolInputs) UnmarshalJSON(data []byte) error { + + var candidates []utils.UnionCandidate + + // Collect all valid candidates + var boolean bool = false + if err := utils.UnmarshalJSON(data, &boolean, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: ClearToolInputsTypeBoolean, + Value: &boolean, + }) + } + + var arrayOfStr []string = []string{} + if err := utils.UnmarshalJSON(data, &arrayOfStr, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: ClearToolInputsTypeArrayOfStr, + Value: arrayOfStr, + }) + } + + var anyVar any = nil + if err := utils.UnmarshalJSON(data, &anyVar, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: ClearToolInputsTypeAny, + Value: anyVar, + }) + } + + if len(candidates) == 0 { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for ClearToolInputs", string(data)) + } + + // Pick the best candidate using multi-stage filtering + best := utils.PickBestUnionCandidate(candidates, data) + if best == nil { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for ClearToolInputs", string(data)) + } + + // Set the union type and value based on the best candidate + u.Type = best.Type.(ClearToolInputsType) + switch best.Type { + case ClearToolInputsTypeBoolean: + u.Boolean = best.Value.(*bool) + return nil + case ClearToolInputsTypeArrayOfStr: + u.ArrayOfStr = best.Value.([]string) + return nil + case ClearToolInputsTypeAny: + u.Any = best.Value.(any) + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for ClearToolInputs", string(data)) +} + +func (u ClearToolInputs) MarshalJSON() ([]byte, error) { + if u.Boolean != nil { + return utils.MarshalJSON(u.Boolean, "", true) + } + + if u.ArrayOfStr != nil { + return utils.MarshalJSON(u.ArrayOfStr, "", true) + } + + if u.Any != nil { + return utils.MarshalJSON(u.Any, "", true) + } + + return nil, errors.New("could not marshal union type ClearToolInputs: all fields are null") +} + +type TriggerType string + +const ( + TriggerTypeInputTokens TriggerType = "input_tokens" + TriggerTypeToolUses TriggerType = "tool_uses" +) + +type Trigger struct { + AnthropicInputTokensTrigger *AnthropicInputTokensTrigger `queryParam:"inline" union:"member"` + AnthropicToolUsesTrigger *AnthropicToolUsesTrigger `queryParam:"inline" union:"member"` + + Type TriggerType +} + +func CreateTriggerInputTokens(inputTokens AnthropicInputTokensTrigger) Trigger { + typ := TriggerTypeInputTokens + + typStr := AnthropicInputTokensTriggerType(typ) + inputTokens.Type = typStr + + return Trigger{ + AnthropicInputTokensTrigger: &inputTokens, + Type: typ, + } +} + +func CreateTriggerToolUses(toolUses AnthropicToolUsesTrigger) Trigger { + typ := TriggerTypeToolUses + + typStr := AnthropicToolUsesTriggerType(typ) + toolUses.Type = typStr + + return Trigger{ + AnthropicToolUsesTrigger: &toolUses, + Type: typ, + } +} + +func (u *Trigger) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + return fmt.Errorf("could not unmarshal discriminator: %w", err) + } + + switch dis.Type { + case "input_tokens": + anthropicInputTokensTrigger := new(AnthropicInputTokensTrigger) + if err := utils.UnmarshalJSON(data, &anthropicInputTokensTrigger, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == input_tokens) type AnthropicInputTokensTrigger within Trigger: %w", string(data), err) + } + + u.AnthropicInputTokensTrigger = anthropicInputTokensTrigger + u.Type = TriggerTypeInputTokens + return nil + case "tool_uses": + anthropicToolUsesTrigger := new(AnthropicToolUsesTrigger) + if err := utils.UnmarshalJSON(data, &anthropicToolUsesTrigger, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == tool_uses) type AnthropicToolUsesTrigger within Trigger: %w", string(data), err) + } + + u.AnthropicToolUsesTrigger = anthropicToolUsesTrigger + u.Type = TriggerTypeToolUses + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for Trigger", string(data)) +} + +func (u Trigger) MarshalJSON() ([]byte, error) { + if u.AnthropicInputTokensTrigger != nil { + return utils.MarshalJSON(u.AnthropicInputTokensTrigger, "", true) + } + + if u.AnthropicToolUsesTrigger != nil { + return utils.MarshalJSON(u.AnthropicToolUsesTrigger, "", true) + } + + return nil, errors.New("could not marshal union type Trigger: all fields are null") +} + +type TypeClearToolUses20250919 string + +const ( + TypeClearToolUses20250919ClearToolUses20250919 TypeClearToolUses20250919 = "clear_tool_uses_20250919" +) + +func (e TypeClearToolUses20250919) ToPointer() *TypeClearToolUses20250919 { + return &e +} +func (e *TypeClearToolUses20250919) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "clear_tool_uses_20250919": + *e = TypeClearToolUses20250919(v) + return nil + default: + return fmt.Errorf("invalid value for TypeClearToolUses20250919: %v", v) + } +} + +type EditClearToolUses20250919 struct { + ClearAtLeast optionalnullable.OptionalNullable[AnthropicInputTokensClearAtLeast] `json:"clear_at_least,omitzero"` + ClearToolInputs optionalnullable.OptionalNullable[ClearToolInputs] `json:"clear_tool_inputs,omitzero"` + ExcludeTools optionalnullable.OptionalNullable[[]string] `json:"exclude_tools,omitzero"` + Keep *AnthropicToolUsesKeep `json:"keep,omitzero"` + Trigger *Trigger `json:"trigger,omitzero"` + Type TypeClearToolUses20250919 `json:"type"` +} + +func (e EditClearToolUses20250919) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *EditClearToolUses20250919) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &e, "", false, nil); err != nil { + return err + } + return nil +} + +func (e *EditClearToolUses20250919) GetClearAtLeast() optionalnullable.OptionalNullable[AnthropicInputTokensClearAtLeast] { + if e == nil { + return nil + } + return e.ClearAtLeast +} + +func (e *EditClearToolUses20250919) GetClearToolInputs() optionalnullable.OptionalNullable[ClearToolInputs] { + if e == nil { + return nil + } + return e.ClearToolInputs +} + +func (e *EditClearToolUses20250919) GetExcludeTools() optionalnullable.OptionalNullable[[]string] { + if e == nil { + return nil + } + return e.ExcludeTools +} + +func (e *EditClearToolUses20250919) GetKeep() *AnthropicToolUsesKeep { + if e == nil { + return nil + } + return e.Keep +} + +func (e *EditClearToolUses20250919) GetTrigger() *Trigger { + if e == nil { + return nil + } + return e.Trigger +} + +func (e *EditClearToolUses20250919) GetTriggerInputTokens() *AnthropicInputTokensTrigger { + if v := e.GetTrigger(); v != nil { + return v.AnthropicInputTokensTrigger + } + return nil +} + +func (e *EditClearToolUses20250919) GetTriggerToolUses() *AnthropicToolUsesTrigger { + if v := e.GetTrigger(); v != nil { + return v.AnthropicToolUsesTrigger + } + return nil +} + +func (e *EditClearToolUses20250919) GetType() TypeClearToolUses20250919 { + if e == nil { + return TypeClearToolUses20250919("") + } + return e.Type +} + +// #region class-body-editcleartooluses20250919 +// #endregion class-body-editcleartooluses20250919 + +type EditType string + +const ( + EditTypeClearToolUses20250919 EditType = "clear_tool_uses_20250919" + EditTypeClearThinking20251015 EditType = "clear_thinking_20251015" + EditTypeCompact20260112 EditType = "compact_20260112" +) + +type Edit struct { + EditClearToolUses20250919 *EditClearToolUses20250919 `queryParam:"inline" union:"member"` + EditClearThinking20251015 *EditClearThinking20251015 `queryParam:"inline" union:"member"` + EditCompact20260112 *EditCompact20260112 `queryParam:"inline" union:"member"` + + Type EditType +} + +func CreateEditClearToolUses20250919(clearToolUses20250919 EditClearToolUses20250919) Edit { + typ := EditTypeClearToolUses20250919 + + typStr := TypeClearToolUses20250919(typ) + clearToolUses20250919.Type = typStr + + return Edit{ + EditClearToolUses20250919: &clearToolUses20250919, + Type: typ, + } +} + +func CreateEditClearThinking20251015(clearThinking20251015 EditClearThinking20251015) Edit { + typ := EditTypeClearThinking20251015 + + typStr := TypeClearThinking20251015(typ) + clearThinking20251015.Type = typStr + + return Edit{ + EditClearThinking20251015: &clearThinking20251015, + Type: typ, + } +} + +func CreateEditCompact20260112(compact20260112 EditCompact20260112) Edit { + typ := EditTypeCompact20260112 + + typStr := TypeCompact20260112(typ) + compact20260112.Type = typStr + + return Edit{ + EditCompact20260112: &compact20260112, + Type: typ, + } +} + +func (u *Edit) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + return fmt.Errorf("could not unmarshal discriminator: %w", err) + } + + switch dis.Type { + case "clear_tool_uses_20250919": + editClearToolUses20250919 := new(EditClearToolUses20250919) + if err := utils.UnmarshalJSON(data, &editClearToolUses20250919, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == clear_tool_uses_20250919) type EditClearToolUses20250919 within Edit: %w", string(data), err) + } + + u.EditClearToolUses20250919 = editClearToolUses20250919 + u.Type = EditTypeClearToolUses20250919 + return nil + case "clear_thinking_20251015": + editClearThinking20251015 := new(EditClearThinking20251015) + if err := utils.UnmarshalJSON(data, &editClearThinking20251015, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == clear_thinking_20251015) type EditClearThinking20251015 within Edit: %w", string(data), err) + } + + u.EditClearThinking20251015 = editClearThinking20251015 + u.Type = EditTypeClearThinking20251015 + return nil + case "compact_20260112": + editCompact20260112 := new(EditCompact20260112) + if err := utils.UnmarshalJSON(data, &editCompact20260112, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == compact_20260112) type EditCompact20260112 within Edit: %w", string(data), err) + } + + u.EditCompact20260112 = editCompact20260112 + u.Type = EditTypeCompact20260112 + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for Edit", string(data)) +} + +func (u Edit) MarshalJSON() ([]byte, error) { + if u.EditClearToolUses20250919 != nil { + return utils.MarshalJSON(u.EditClearToolUses20250919, "", true) + } + + if u.EditClearThinking20251015 != nil { + return utils.MarshalJSON(u.EditClearThinking20251015, "", true) + } + + if u.EditCompact20260112 != nil { + return utils.MarshalJSON(u.EditCompact20260112, "", true) + } + + return nil, errors.New("could not marshal union type Edit: all fields are null") +} + +type ContextManagement struct { + Edits []Edit `json:"edits,omitzero"` +} + +func (c ContextManagement) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *ContextManagement) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *ContextManagement) GetEdits() []Edit { + if c == nil { + return nil + } + return c.Edits +} + +type Metadata struct { + UserID optionalnullable.OptionalNullable[string] `json:"user_id,omitzero"` +} + +func (m *Metadata) GetUserID() optionalnullable.OptionalNullable[string] { + if m == nil { + return nil + } + return m.UserID +} + +type MessagesRequestPluginType string + +const ( + MessagesRequestPluginTypeAutoRouter MessagesRequestPluginType = "auto-router" + MessagesRequestPluginTypeContextCompression MessagesRequestPluginType = "context-compression" + MessagesRequestPluginTypeFileParser MessagesRequestPluginType = "file-parser" + MessagesRequestPluginTypeFusion MessagesRequestPluginType = "fusion" + MessagesRequestPluginTypeModeration MessagesRequestPluginType = "moderation" + MessagesRequestPluginTypeParetoRouter MessagesRequestPluginType = "pareto-router" + MessagesRequestPluginTypeResponseHealing MessagesRequestPluginType = "response-healing" + MessagesRequestPluginTypeWeb MessagesRequestPluginType = "web" + MessagesRequestPluginTypeWebFetch MessagesRequestPluginType = "web-fetch" +) + +type MessagesRequestPlugin struct { + AutoRouterPlugin *AutoRouterPlugin `queryParam:"inline" union:"member"` + ModerationPlugin *ModerationPlugin `queryParam:"inline" union:"member"` + WebSearchPlugin *WebSearchPlugin `queryParam:"inline" union:"member"` + WebFetchPlugin *WebFetchPlugin `queryParam:"inline" union:"member"` + FileParserPlugin *FileParserPlugin `queryParam:"inline" union:"member"` + ResponseHealingPlugin *ResponseHealingPlugin `queryParam:"inline" union:"member"` + ContextCompressionPlugin *ContextCompressionPlugin `queryParam:"inline" union:"member"` + ParetoRouterPlugin *ParetoRouterPlugin `queryParam:"inline" union:"member"` + FusionPlugin *FusionPlugin `queryParam:"inline" union:"member"` + + Type MessagesRequestPluginType +} + +func CreateMessagesRequestPluginAutoRouter(autoRouter AutoRouterPlugin) MessagesRequestPlugin { + typ := MessagesRequestPluginTypeAutoRouter + + typStr := AutoRouterPluginID(typ) + autoRouter.ID = typStr + + return MessagesRequestPlugin{ + AutoRouterPlugin: &autoRouter, + Type: typ, + } +} + +func CreateMessagesRequestPluginContextCompression(contextCompression ContextCompressionPlugin) MessagesRequestPlugin { + typ := MessagesRequestPluginTypeContextCompression + + typStr := ContextCompressionPluginID(typ) + contextCompression.ID = typStr + + return MessagesRequestPlugin{ + ContextCompressionPlugin: &contextCompression, + Type: typ, + } +} + +func CreateMessagesRequestPluginFileParser(fileParser FileParserPlugin) MessagesRequestPlugin { + typ := MessagesRequestPluginTypeFileParser + + typStr := FileParserPluginID(typ) + fileParser.ID = typStr + + return MessagesRequestPlugin{ + FileParserPlugin: &fileParser, + Type: typ, + } +} + +func CreateMessagesRequestPluginFusion(fusion FusionPlugin) MessagesRequestPlugin { + typ := MessagesRequestPluginTypeFusion + + typStr := FusionPluginID(typ) + fusion.ID = typStr + + return MessagesRequestPlugin{ + FusionPlugin: &fusion, + Type: typ, + } +} + +func CreateMessagesRequestPluginModeration(moderation ModerationPlugin) MessagesRequestPlugin { + typ := MessagesRequestPluginTypeModeration + + typStr := ModerationPluginID(typ) + moderation.ID = typStr + + return MessagesRequestPlugin{ + ModerationPlugin: &moderation, + Type: typ, + } +} + +func CreateMessagesRequestPluginParetoRouter(paretoRouter ParetoRouterPlugin) MessagesRequestPlugin { + typ := MessagesRequestPluginTypeParetoRouter + + typStr := ParetoRouterPluginID(typ) + paretoRouter.ID = typStr + + return MessagesRequestPlugin{ + ParetoRouterPlugin: &paretoRouter, + Type: typ, + } +} + +func CreateMessagesRequestPluginResponseHealing(responseHealing ResponseHealingPlugin) MessagesRequestPlugin { + typ := MessagesRequestPluginTypeResponseHealing + + typStr := ResponseHealingPluginID(typ) + responseHealing.ID = typStr + + return MessagesRequestPlugin{ + ResponseHealingPlugin: &responseHealing, + Type: typ, + } +} + +func CreateMessagesRequestPluginWeb(web WebSearchPlugin) MessagesRequestPlugin { + typ := MessagesRequestPluginTypeWeb + + typStr := WebSearchPluginID(typ) + web.ID = typStr + + return MessagesRequestPlugin{ + WebSearchPlugin: &web, + Type: typ, + } +} + +func CreateMessagesRequestPluginWebFetch(webFetch WebFetchPlugin) MessagesRequestPlugin { + typ := MessagesRequestPluginTypeWebFetch + + typStr := WebFetchPluginID(typ) + webFetch.ID = typStr + + return MessagesRequestPlugin{ + WebFetchPlugin: &webFetch, + Type: typ, + } +} + +func (u *MessagesRequestPlugin) UnmarshalJSON(data []byte) error { + + type discriminator struct { + ID string `json:"id"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + return fmt.Errorf("could not unmarshal discriminator: %w", err) + } + + switch dis.ID { + case "auto-router": + autoRouterPlugin := new(AutoRouterPlugin) + if err := utils.UnmarshalJSON(data, &autoRouterPlugin, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (ID == auto-router) type AutoRouterPlugin within MessagesRequestPlugin: %w", string(data), err) + } + + u.AutoRouterPlugin = autoRouterPlugin + u.Type = MessagesRequestPluginTypeAutoRouter + return nil + case "context-compression": + contextCompressionPlugin := new(ContextCompressionPlugin) + if err := utils.UnmarshalJSON(data, &contextCompressionPlugin, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (ID == context-compression) type ContextCompressionPlugin within MessagesRequestPlugin: %w", string(data), err) + } + + u.ContextCompressionPlugin = contextCompressionPlugin + u.Type = MessagesRequestPluginTypeContextCompression + return nil + case "file-parser": + fileParserPlugin := new(FileParserPlugin) + if err := utils.UnmarshalJSON(data, &fileParserPlugin, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (ID == file-parser) type FileParserPlugin within MessagesRequestPlugin: %w", string(data), err) + } + + u.FileParserPlugin = fileParserPlugin + u.Type = MessagesRequestPluginTypeFileParser + return nil + case "fusion": + fusionPlugin := new(FusionPlugin) + if err := utils.UnmarshalJSON(data, &fusionPlugin, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (ID == fusion) type FusionPlugin within MessagesRequestPlugin: %w", string(data), err) + } + + u.FusionPlugin = fusionPlugin + u.Type = MessagesRequestPluginTypeFusion + return nil + case "moderation": + moderationPlugin := new(ModerationPlugin) + if err := utils.UnmarshalJSON(data, &moderationPlugin, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (ID == moderation) type ModerationPlugin within MessagesRequestPlugin: %w", string(data), err) + } + + u.ModerationPlugin = moderationPlugin + u.Type = MessagesRequestPluginTypeModeration + return nil + case "pareto-router": + paretoRouterPlugin := new(ParetoRouterPlugin) + if err := utils.UnmarshalJSON(data, &paretoRouterPlugin, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (ID == pareto-router) type ParetoRouterPlugin within MessagesRequestPlugin: %w", string(data), err) + } + + u.ParetoRouterPlugin = paretoRouterPlugin + u.Type = MessagesRequestPluginTypeParetoRouter + return nil + case "response-healing": + responseHealingPlugin := new(ResponseHealingPlugin) + if err := utils.UnmarshalJSON(data, &responseHealingPlugin, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (ID == response-healing) type ResponseHealingPlugin within MessagesRequestPlugin: %w", string(data), err) + } + + u.ResponseHealingPlugin = responseHealingPlugin + u.Type = MessagesRequestPluginTypeResponseHealing + return nil + case "web": + webSearchPlugin := new(WebSearchPlugin) + if err := utils.UnmarshalJSON(data, &webSearchPlugin, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (ID == web) type WebSearchPlugin within MessagesRequestPlugin: %w", string(data), err) + } + + u.WebSearchPlugin = webSearchPlugin + u.Type = MessagesRequestPluginTypeWeb + return nil + case "web-fetch": + webFetchPlugin := new(WebFetchPlugin) + if err := utils.UnmarshalJSON(data, &webFetchPlugin, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (ID == web-fetch) type WebFetchPlugin within MessagesRequestPlugin: %w", string(data), err) + } + + u.WebFetchPlugin = webFetchPlugin + u.Type = MessagesRequestPluginTypeWebFetch + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for MessagesRequestPlugin", string(data)) +} + +func (u MessagesRequestPlugin) MarshalJSON() ([]byte, error) { + if u.AutoRouterPlugin != nil { + return utils.MarshalJSON(u.AutoRouterPlugin, "", true) + } + + if u.ModerationPlugin != nil { + return utils.MarshalJSON(u.ModerationPlugin, "", true) + } + + if u.WebSearchPlugin != nil { + return utils.MarshalJSON(u.WebSearchPlugin, "", true) + } + + if u.WebFetchPlugin != nil { + return utils.MarshalJSON(u.WebFetchPlugin, "", true) + } + + if u.FileParserPlugin != nil { + return utils.MarshalJSON(u.FileParserPlugin, "", true) + } + + if u.ResponseHealingPlugin != nil { + return utils.MarshalJSON(u.ResponseHealingPlugin, "", true) + } + + if u.ContextCompressionPlugin != nil { + return utils.MarshalJSON(u.ContextCompressionPlugin, "", true) + } + + if u.ParetoRouterPlugin != nil { + return utils.MarshalJSON(u.ParetoRouterPlugin, "", true) + } + + if u.FusionPlugin != nil { + return utils.MarshalJSON(u.FusionPlugin, "", true) + } + + return nil, errors.New("could not marshal union type MessagesRequestPlugin: all fields are null") +} + +// Speed - Controls output generation speed. When set to `fast`, uses a higher-speed inference configuration at premium pricing. Defaults to `standard` when omitted. +type Speed string + +const ( + SpeedFast Speed = "fast" + SpeedStandard Speed = "standard" +) + +func (e Speed) ToPointer() *Speed { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Speed) IsExact() bool { + if e != nil { + switch *e { + case "fast", "standard": + return true + } + } + return false +} + +type SystemType string + +const ( + SystemTypeStr SystemType = "str" + SystemTypeArrayOfAnthropicTextBlockParam SystemType = "arrayOfAnthropicTextBlockParam" +) + +type System struct { + Str *string `queryParam:"inline" union:"member"` + ArrayOfAnthropicTextBlockParam []AnthropicTextBlockParam `queryParam:"inline" union:"member"` + + Type SystemType +} + +func CreateSystemStr(str string) System { + typ := SystemTypeStr + + return System{ + Str: &str, + Type: typ, + } +} + +func CreateSystemArrayOfAnthropicTextBlockParam(arrayOfAnthropicTextBlockParam []AnthropicTextBlockParam) System { + typ := SystemTypeArrayOfAnthropicTextBlockParam + + return System{ + ArrayOfAnthropicTextBlockParam: arrayOfAnthropicTextBlockParam, + Type: typ, + } +} + +func (u *System) UnmarshalJSON(data []byte) error { + + var candidates []utils.UnionCandidate + + // Collect all valid candidates + var str string = "" + if err := utils.UnmarshalJSON(data, &str, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: SystemTypeStr, + Value: &str, + }) + } + + var arrayOfAnthropicTextBlockParam []AnthropicTextBlockParam = []AnthropicTextBlockParam{} + if err := utils.UnmarshalJSON(data, &arrayOfAnthropicTextBlockParam, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: SystemTypeArrayOfAnthropicTextBlockParam, + Value: arrayOfAnthropicTextBlockParam, + }) + } + + if len(candidates) == 0 { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for System", string(data)) + } + + // Pick the best candidate using multi-stage filtering + best := utils.PickBestUnionCandidate(candidates, data) + if best == nil { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for System", string(data)) + } + + // Set the union type and value based on the best candidate + u.Type = best.Type.(SystemType) + switch best.Type { + case SystemTypeStr: + u.Str = best.Value.(*string) + return nil + case SystemTypeArrayOfAnthropicTextBlockParam: + u.ArrayOfAnthropicTextBlockParam = best.Value.([]AnthropicTextBlockParam) + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for System", string(data)) +} + +func (u System) MarshalJSON() ([]byte, error) { + if u.Str != nil { + return utils.MarshalJSON(u.Str, "", true) + } + + if u.ArrayOfAnthropicTextBlockParam != nil { + return utils.MarshalJSON(u.ArrayOfAnthropicTextBlockParam, "", true) + } + + return nil, errors.New("could not marshal union type System: all fields are null") +} + +type TypeAdaptive string + +const ( + TypeAdaptiveAdaptive TypeAdaptive = "adaptive" +) + +func (e TypeAdaptive) ToPointer() *TypeAdaptive { + return &e +} +func (e *TypeAdaptive) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "adaptive": + *e = TypeAdaptive(v) + return nil + default: + return fmt.Errorf("invalid value for TypeAdaptive: %v", v) + } +} + +type ThinkingAdaptive struct { + Display optionalnullable.OptionalNullable[AnthropicThinkingDisplay] `json:"display,omitzero"` + Type TypeAdaptive `json:"type"` +} + +func (t ThinkingAdaptive) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *ThinkingAdaptive) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *ThinkingAdaptive) GetDisplay() optionalnullable.OptionalNullable[AnthropicThinkingDisplay] { + if t == nil { + return nil + } + return t.Display +} + +func (t *ThinkingAdaptive) GetType() TypeAdaptive { + if t == nil { + return TypeAdaptive("") + } + return t.Type +} + +type TypeDisabled string + +const ( + TypeDisabledDisabled TypeDisabled = "disabled" +) + +func (e TypeDisabled) ToPointer() *TypeDisabled { + return &e +} +func (e *TypeDisabled) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "disabled": + *e = TypeDisabled(v) + return nil + default: + return fmt.Errorf("invalid value for TypeDisabled: %v", v) + } +} + +type ThinkingDisabled struct { + Type TypeDisabled `json:"type"` +} + +func (t ThinkingDisabled) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *ThinkingDisabled) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *ThinkingDisabled) GetType() TypeDisabled { + if t == nil { + return TypeDisabled("") + } + return t.Type +} + +type TypeEnabled string + +const ( + TypeEnabledEnabled TypeEnabled = "enabled" +) + +func (e TypeEnabled) ToPointer() *TypeEnabled { + return &e +} +func (e *TypeEnabled) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "enabled": + *e = TypeEnabled(v) + return nil + default: + return fmt.Errorf("invalid value for TypeEnabled: %v", v) + } +} + +type ThinkingEnabled struct { + BudgetTokens int64 `json:"budget_tokens"` + Display optionalnullable.OptionalNullable[AnthropicThinkingDisplay] `json:"display,omitzero"` + Type TypeEnabled `json:"type"` +} + +func (t ThinkingEnabled) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *ThinkingEnabled) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *ThinkingEnabled) GetBudgetTokens() int64 { + if t == nil { + return 0 + } + return t.BudgetTokens +} + +func (t *ThinkingEnabled) GetDisplay() optionalnullable.OptionalNullable[AnthropicThinkingDisplay] { + if t == nil { + return nil + } + return t.Display +} + +func (t *ThinkingEnabled) GetType() TypeEnabled { + if t == nil { + return TypeEnabled("") + } + return t.Type +} + +type ThinkingType string + +const ( + ThinkingTypeEnabled ThinkingType = "enabled" + ThinkingTypeDisabled ThinkingType = "disabled" + ThinkingTypeAdaptive ThinkingType = "adaptive" +) + +type Thinking struct { + ThinkingEnabled *ThinkingEnabled `queryParam:"inline" union:"member"` + ThinkingDisabled *ThinkingDisabled `queryParam:"inline" union:"member"` + ThinkingAdaptive *ThinkingAdaptive `queryParam:"inline" union:"member"` + + Type ThinkingType +} + +func CreateThinkingEnabled(enabled ThinkingEnabled) Thinking { + typ := ThinkingTypeEnabled + + typStr := TypeEnabled(typ) + enabled.Type = typStr + + return Thinking{ + ThinkingEnabled: &enabled, + Type: typ, + } +} + +func CreateThinkingDisabled(disabled ThinkingDisabled) Thinking { + typ := ThinkingTypeDisabled + + typStr := TypeDisabled(typ) + disabled.Type = typStr + + return Thinking{ + ThinkingDisabled: &disabled, + Type: typ, + } +} + +func CreateThinkingAdaptive(adaptive ThinkingAdaptive) Thinking { + typ := ThinkingTypeAdaptive + + typStr := TypeAdaptive(typ) + adaptive.Type = typStr + + return Thinking{ + ThinkingAdaptive: &adaptive, + Type: typ, + } +} + +func (u *Thinking) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + return fmt.Errorf("could not unmarshal discriminator: %w", err) + } + + switch dis.Type { + case "enabled": + thinkingEnabled := new(ThinkingEnabled) + if err := utils.UnmarshalJSON(data, &thinkingEnabled, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == enabled) type ThinkingEnabled within Thinking: %w", string(data), err) + } + + u.ThinkingEnabled = thinkingEnabled + u.Type = ThinkingTypeEnabled + return nil + case "disabled": + thinkingDisabled := new(ThinkingDisabled) + if err := utils.UnmarshalJSON(data, &thinkingDisabled, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == disabled) type ThinkingDisabled within Thinking: %w", string(data), err) + } + + u.ThinkingDisabled = thinkingDisabled + u.Type = ThinkingTypeDisabled + return nil + case "adaptive": + thinkingAdaptive := new(ThinkingAdaptive) + if err := utils.UnmarshalJSON(data, &thinkingAdaptive, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == adaptive) type ThinkingAdaptive within Thinking: %w", string(data), err) + } + + u.ThinkingAdaptive = thinkingAdaptive + u.Type = ThinkingTypeAdaptive + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for Thinking", string(data)) +} + +func (u Thinking) MarshalJSON() ([]byte, error) { + if u.ThinkingEnabled != nil { + return utils.MarshalJSON(u.ThinkingEnabled, "", true) + } + + if u.ThinkingDisabled != nil { + return utils.MarshalJSON(u.ThinkingDisabled, "", true) + } + + if u.ThinkingAdaptive != nil { + return utils.MarshalJSON(u.ThinkingAdaptive, "", true) + } + + return nil, errors.New("could not marshal union type Thinking: all fields are null") +} + +type TypeTool string + +const ( + TypeToolTool TypeTool = "tool" +) + +func (e TypeTool) ToPointer() *TypeTool { + return &e +} +func (e *TypeTool) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "tool": + *e = TypeTool(v) + return nil + default: + return fmt.Errorf("invalid value for TypeTool: %v", v) + } +} + +type ToolChoiceTool struct { + DisableParallelToolUse *bool `json:"disable_parallel_tool_use,omitzero"` + Name string `json:"name"` + Type TypeTool `json:"type"` +} + +func (t ToolChoiceTool) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *ToolChoiceTool) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *ToolChoiceTool) GetDisableParallelToolUse() *bool { + if t == nil { + return nil + } + return t.DisableParallelToolUse +} + +func (t *ToolChoiceTool) GetName() string { + if t == nil { + return "" + } + return t.Name +} + +func (t *ToolChoiceTool) GetType() TypeTool { + if t == nil { + return TypeTool("") + } + return t.Type +} + +type TypeNone string + +const ( + TypeNoneNone TypeNone = "none" +) + +func (e TypeNone) ToPointer() *TypeNone { + return &e +} +func (e *TypeNone) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "none": + *e = TypeNone(v) + return nil + default: + return fmt.Errorf("invalid value for TypeNone: %v", v) + } +} + +type ToolChoiceNone struct { + Type TypeNone `json:"type"` +} + +func (t ToolChoiceNone) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *ToolChoiceNone) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *ToolChoiceNone) GetType() TypeNone { + if t == nil { + return TypeNone("") + } + return t.Type +} + +type TypeAny string + +const ( + TypeAnyAny TypeAny = "any" +) + +func (e TypeAny) ToPointer() *TypeAny { + return &e +} +func (e *TypeAny) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "any": + *e = TypeAny(v) + return nil + default: + return fmt.Errorf("invalid value for TypeAny: %v", v) + } +} + +type ToolChoiceAny struct { + DisableParallelToolUse *bool `json:"disable_parallel_tool_use,omitzero"` + Type TypeAny `json:"type"` +} + +func (t ToolChoiceAny) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *ToolChoiceAny) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *ToolChoiceAny) GetDisableParallelToolUse() *bool { + if t == nil { + return nil + } + return t.DisableParallelToolUse +} + +func (t *ToolChoiceAny) GetType() TypeAny { + if t == nil { + return TypeAny("") + } + return t.Type +} + +type ToolChoiceTypeAuto string + +const ( + ToolChoiceTypeAutoAuto ToolChoiceTypeAuto = "auto" +) + +func (e ToolChoiceTypeAuto) ToPointer() *ToolChoiceTypeAuto { + return &e +} +func (e *ToolChoiceTypeAuto) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "auto": + *e = ToolChoiceTypeAuto(v) + return nil + default: + return fmt.Errorf("invalid value for ToolChoiceTypeAuto: %v", v) + } +} + +type ToolChoiceAuto struct { + DisableParallelToolUse *bool `json:"disable_parallel_tool_use,omitzero"` + Type ToolChoiceTypeAuto `json:"type"` +} + +func (t ToolChoiceAuto) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *ToolChoiceAuto) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *ToolChoiceAuto) GetDisableParallelToolUse() *bool { + if t == nil { + return nil + } + return t.DisableParallelToolUse +} + +func (t *ToolChoiceAuto) GetType() ToolChoiceTypeAuto { + if t == nil { + return ToolChoiceTypeAuto("") + } + return t.Type +} + +type ToolChoiceType string + +const ( + ToolChoiceTypeAutoValue ToolChoiceType = "auto" + ToolChoiceTypeAny ToolChoiceType = "any" + ToolChoiceTypeNone ToolChoiceType = "none" + ToolChoiceTypeTool ToolChoiceType = "tool" +) + +type ToolChoice struct { + ToolChoiceAuto *ToolChoiceAuto `queryParam:"inline" union:"member"` + ToolChoiceAny *ToolChoiceAny `queryParam:"inline" union:"member"` + ToolChoiceNone *ToolChoiceNone `queryParam:"inline" union:"member"` + ToolChoiceTool *ToolChoiceTool `queryParam:"inline" union:"member"` + + Type ToolChoiceType +} + +func CreateToolChoiceAuto(auto ToolChoiceAuto) ToolChoice { + typ := ToolChoiceTypeAutoValue + + typStr := ToolChoiceTypeAuto(typ) + auto.Type = typStr + + return ToolChoice{ + ToolChoiceAuto: &auto, + Type: typ, + } +} + +func CreateToolChoiceAny(anyT ToolChoiceAny) ToolChoice { + typ := ToolChoiceTypeAny + + typStr := TypeAny(typ) + anyT.Type = typStr + + return ToolChoice{ + ToolChoiceAny: &anyT, + Type: typ, + } +} + +func CreateToolChoiceNone(none ToolChoiceNone) ToolChoice { + typ := ToolChoiceTypeNone + + typStr := TypeNone(typ) + none.Type = typStr + + return ToolChoice{ + ToolChoiceNone: &none, + Type: typ, + } +} + +func CreateToolChoiceTool(tool ToolChoiceTool) ToolChoice { + typ := ToolChoiceTypeTool + + typStr := TypeTool(typ) + tool.Type = typStr + + return ToolChoice{ + ToolChoiceTool: &tool, + Type: typ, + } +} + +func (u *ToolChoice) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + return fmt.Errorf("could not unmarshal discriminator: %w", err) + } + + switch dis.Type { + case "auto": + toolChoiceAuto := new(ToolChoiceAuto) + if err := utils.UnmarshalJSON(data, &toolChoiceAuto, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == auto) type ToolChoiceAuto within ToolChoice: %w", string(data), err) + } + + u.ToolChoiceAuto = toolChoiceAuto + u.Type = ToolChoiceTypeAutoValue + return nil + case "any": + toolChoiceAny := new(ToolChoiceAny) + if err := utils.UnmarshalJSON(data, &toolChoiceAny, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == any) type ToolChoiceAny within ToolChoice: %w", string(data), err) + } + + u.ToolChoiceAny = toolChoiceAny + u.Type = ToolChoiceTypeAny + return nil + case "none": + toolChoiceNone := new(ToolChoiceNone) + if err := utils.UnmarshalJSON(data, &toolChoiceNone, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == none) type ToolChoiceNone within ToolChoice: %w", string(data), err) + } + + u.ToolChoiceNone = toolChoiceNone + u.Type = ToolChoiceTypeNone + return nil + case "tool": + toolChoiceTool := new(ToolChoiceTool) + if err := utils.UnmarshalJSON(data, &toolChoiceTool, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == tool) type ToolChoiceTool within ToolChoice: %w", string(data), err) + } + + u.ToolChoiceTool = toolChoiceTool + u.Type = ToolChoiceTypeTool + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for ToolChoice", string(data)) +} + +func (u ToolChoice) MarshalJSON() ([]byte, error) { + if u.ToolChoiceAuto != nil { + return utils.MarshalJSON(u.ToolChoiceAuto, "", true) + } + + if u.ToolChoiceAny != nil { + return utils.MarshalJSON(u.ToolChoiceAny, "", true) + } + + if u.ToolChoiceNone != nil { + return utils.MarshalJSON(u.ToolChoiceNone, "", true) + } + + if u.ToolChoiceTool != nil { + return utils.MarshalJSON(u.ToolChoiceTool, "", true) + } + + return nil, errors.New("could not marshal union type ToolChoice: all fields are null") +} + +type MessagesRequestTool struct { + Type string `json:"type"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (m MessagesRequestTool) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MessagesRequestTool) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MessagesRequestTool) GetType() string { + if m == nil { + return "" + } + return m.Type +} + +func (m *MessagesRequestTool) GetAdditionalProperties() map[string]any { + if m == nil { + return nil + } + return m.AdditionalProperties +} + +type ToolTypeEphemeral string + +const ( + ToolTypeEphemeralEphemeral ToolTypeEphemeral = "ephemeral" +) + +func (e ToolTypeEphemeral) ToPointer() *ToolTypeEphemeral { + return &e +} +func (e *ToolTypeEphemeral) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ephemeral": + *e = ToolTypeEphemeral(v) + return nil + default: + return fmt.Errorf("invalid value for ToolTypeEphemeral: %v", v) + } +} + +// Caching - Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. +type Caching struct { + TTL *AnthropicCacheControlTTL `json:"ttl,omitzero"` + Type ToolTypeEphemeral `json:"type"` +} + +func (c Caching) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(c, "", false) +} + +func (c *Caching) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { + return err + } + return nil +} + +func (c *Caching) GetTTL() *AnthropicCacheControlTTL { + if c == nil { + return nil + } + return c.TTL +} + +func (c *Caching) GetType() ToolTypeEphemeral { + if c == nil { + return ToolTypeEphemeral("") + } + return c.Type +} + +type NameAdvisor string + +const ( + NameAdvisorAdvisor NameAdvisor = "advisor" +) + +func (e NameAdvisor) ToPointer() *NameAdvisor { + return &e +} +func (e *NameAdvisor) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "advisor": + *e = NameAdvisor(v) + return nil + default: + return fmt.Errorf("invalid value for NameAdvisor: %v", v) + } +} + +type TypeAdvisor20260301 string + +const ( + TypeAdvisor20260301Advisor20260301 TypeAdvisor20260301 = "advisor_20260301" +) + +func (e TypeAdvisor20260301) ToPointer() *TypeAdvisor20260301 { + return &e +} +func (e *TypeAdvisor20260301) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "advisor_20260301": + *e = TypeAdvisor20260301(v) + return nil + default: + return fmt.Errorf("invalid value for TypeAdvisor20260301: %v", v) + } +} + +type ToolAdvisor20260301 struct { + AllowedCallers []AnthropicAllowedCallers `json:"allowed_callers,omitzero"` + // Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + CacheControl *AnthropicCacheControlDirective `json:"cache_control,omitzero"` + Caching optionalnullable.OptionalNullable[Caching] `json:"caching,omitzero"` + DeferLoading *bool `json:"defer_loading,omitzero"` + MaxUses *int64 `json:"max_uses,omitzero"` + Model string `json:"model"` + Name NameAdvisor `json:"name"` + Type TypeAdvisor20260301 `json:"type"` +} + +func (t ToolAdvisor20260301) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *ToolAdvisor20260301) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *ToolAdvisor20260301) GetAllowedCallers() []AnthropicAllowedCallers { + if t == nil { + return nil + } + return t.AllowedCallers +} + +func (t *ToolAdvisor20260301) GetCacheControl() *AnthropicCacheControlDirective { + if t == nil { + return nil + } + return t.CacheControl +} + +func (t *ToolAdvisor20260301) GetCaching() optionalnullable.OptionalNullable[Caching] { + if t == nil { + return nil + } + return t.Caching +} + +func (t *ToolAdvisor20260301) GetDeferLoading() *bool { + if t == nil { + return nil + } + return t.DeferLoading +} + +func (t *ToolAdvisor20260301) GetMaxUses() *int64 { + if t == nil { + return nil + } + return t.MaxUses +} + +func (t *ToolAdvisor20260301) GetModel() string { + if t == nil { + return "" + } + return t.Model +} + +func (t *ToolAdvisor20260301) GetName() NameAdvisor { + if t == nil { + return NameAdvisor("") + } + return t.Name +} + +func (t *ToolAdvisor20260301) GetType() TypeAdvisor20260301 { + if t == nil { + return TypeAdvisor20260301("") + } + return t.Type +} + +// #region class-body-tooladvisor20260301 +// #endregion class-body-tooladvisor20260301 + +type NameWebSearch2 string + +const ( + NameWebSearch2WebSearch NameWebSearch2 = "web_search" +) + +func (e NameWebSearch2) ToPointer() *NameWebSearch2 { + return &e +} +func (e *NameWebSearch2) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "web_search": + *e = NameWebSearch2(v) + return nil + default: + return fmt.Errorf("invalid value for NameWebSearch2: %v", v) + } +} + +type TypeWebSearch20260209 string + +const ( + TypeWebSearch20260209WebSearch20260209 TypeWebSearch20260209 = "web_search_20260209" +) + +func (e TypeWebSearch20260209) ToPointer() *TypeWebSearch20260209 { + return &e +} +func (e *TypeWebSearch20260209) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "web_search_20260209": + *e = TypeWebSearch20260209(v) + return nil + default: + return fmt.Errorf("invalid value for TypeWebSearch20260209: %v", v) + } +} + +type ToolWebSearch20260209 struct { + AllowedCallers []AnthropicAllowedCallers `json:"allowed_callers,omitzero"` + AllowedDomains optionalnullable.OptionalNullable[[]string] `json:"allowed_domains,omitzero"` + BlockedDomains optionalnullable.OptionalNullable[[]string] `json:"blocked_domains,omitzero"` + // Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + CacheControl *AnthropicCacheControlDirective `json:"cache_control,omitzero"` + MaxUses optionalnullable.OptionalNullable[int64] `json:"max_uses,omitzero"` + Name NameWebSearch2 `json:"name"` + Type TypeWebSearch20260209 `json:"type"` + UserLocation optionalnullable.OptionalNullable[AnthropicWebSearchToolUserLocation] `json:"user_location,omitzero"` +} + +func (t ToolWebSearch20260209) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *ToolWebSearch20260209) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *ToolWebSearch20260209) GetAllowedCallers() []AnthropicAllowedCallers { + if t == nil { + return nil + } + return t.AllowedCallers +} + +func (t *ToolWebSearch20260209) GetAllowedDomains() optionalnullable.OptionalNullable[[]string] { + if t == nil { + return nil + } + return t.AllowedDomains +} + +func (t *ToolWebSearch20260209) GetBlockedDomains() optionalnullable.OptionalNullable[[]string] { + if t == nil { + return nil + } + return t.BlockedDomains +} + +func (t *ToolWebSearch20260209) GetCacheControl() *AnthropicCacheControlDirective { + if t == nil { + return nil + } + return t.CacheControl +} + +func (t *ToolWebSearch20260209) GetMaxUses() optionalnullable.OptionalNullable[int64] { + if t == nil { + return nil + } + return t.MaxUses +} + +func (t *ToolWebSearch20260209) GetName() NameWebSearch2 { + if t == nil { + return NameWebSearch2("") + } + return t.Name +} + +func (t *ToolWebSearch20260209) GetType() TypeWebSearch20260209 { + if t == nil { + return TypeWebSearch20260209("") + } + return t.Type +} + +func (t *ToolWebSearch20260209) GetUserLocation() optionalnullable.OptionalNullable[AnthropicWebSearchToolUserLocation] { + if t == nil { + return nil + } + return t.UserLocation +} + +// #region class-body-toolwebsearch20260209 +// #endregion class-body-toolwebsearch20260209 + +type NameWebSearch1 string + +const ( + NameWebSearch1WebSearch NameWebSearch1 = "web_search" +) + +func (e NameWebSearch1) ToPointer() *NameWebSearch1 { + return &e +} +func (e *NameWebSearch1) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "web_search": + *e = NameWebSearch1(v) + return nil + default: + return fmt.Errorf("invalid value for NameWebSearch1: %v", v) + } +} + +type TypeWebSearch20250305 string + +const ( + TypeWebSearch20250305WebSearch20250305 TypeWebSearch20250305 = "web_search_20250305" +) + +func (e TypeWebSearch20250305) ToPointer() *TypeWebSearch20250305 { + return &e +} +func (e *TypeWebSearch20250305) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "web_search_20250305": + *e = TypeWebSearch20250305(v) + return nil + default: + return fmt.Errorf("invalid value for TypeWebSearch20250305: %v", v) + } +} + +type ToolWebSearch20250305 struct { + AllowedDomains optionalnullable.OptionalNullable[[]string] `json:"allowed_domains,omitzero"` + BlockedDomains optionalnullable.OptionalNullable[[]string] `json:"blocked_domains,omitzero"` + // Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + CacheControl *AnthropicCacheControlDirective `json:"cache_control,omitzero"` + MaxUses optionalnullable.OptionalNullable[int64] `json:"max_uses,omitzero"` + Name NameWebSearch1 `json:"name"` + Type TypeWebSearch20250305 `json:"type"` + UserLocation optionalnullable.OptionalNullable[AnthropicWebSearchToolUserLocation] `json:"user_location,omitzero"` +} + +func (t ToolWebSearch20250305) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *ToolWebSearch20250305) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *ToolWebSearch20250305) GetAllowedDomains() optionalnullable.OptionalNullable[[]string] { + if t == nil { + return nil + } + return t.AllowedDomains +} + +func (t *ToolWebSearch20250305) GetBlockedDomains() optionalnullable.OptionalNullable[[]string] { + if t == nil { + return nil + } + return t.BlockedDomains +} + +func (t *ToolWebSearch20250305) GetCacheControl() *AnthropicCacheControlDirective { + if t == nil { + return nil + } + return t.CacheControl +} + +func (t *ToolWebSearch20250305) GetMaxUses() optionalnullable.OptionalNullable[int64] { + if t == nil { + return nil + } + return t.MaxUses +} + +func (t *ToolWebSearch20250305) GetName() NameWebSearch1 { + if t == nil { + return NameWebSearch1("") + } + return t.Name +} + +func (t *ToolWebSearch20250305) GetType() TypeWebSearch20250305 { + if t == nil { + return TypeWebSearch20250305("") + } + return t.Type +} + +func (t *ToolWebSearch20250305) GetUserLocation() optionalnullable.OptionalNullable[AnthropicWebSearchToolUserLocation] { + if t == nil { + return nil + } + return t.UserLocation +} + +// #region class-body-toolwebsearch20250305 +// #endregion class-body-toolwebsearch20250305 + +type NameStrReplaceEditor string + +const ( + NameStrReplaceEditorStrReplaceEditor NameStrReplaceEditor = "str_replace_editor" +) + +func (e NameStrReplaceEditor) ToPointer() *NameStrReplaceEditor { + return &e +} +func (e *NameStrReplaceEditor) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "str_replace_editor": + *e = NameStrReplaceEditor(v) + return nil + default: + return fmt.Errorf("invalid value for NameStrReplaceEditor: %v", v) + } +} + +type TypeTextEditor20250124 string + +const ( + TypeTextEditor20250124TextEditor20250124 TypeTextEditor20250124 = "text_editor_20250124" +) + +func (e TypeTextEditor20250124) ToPointer() *TypeTextEditor20250124 { + return &e +} +func (e *TypeTextEditor20250124) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "text_editor_20250124": + *e = TypeTextEditor20250124(v) + return nil + default: + return fmt.Errorf("invalid value for TypeTextEditor20250124: %v", v) + } +} + +type ToolTextEditor20250124 struct { + // Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + CacheControl *AnthropicCacheControlDirective `json:"cache_control,omitzero"` + Name NameStrReplaceEditor `json:"name"` + Type TypeTextEditor20250124 `json:"type"` +} + +func (t ToolTextEditor20250124) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *ToolTextEditor20250124) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *ToolTextEditor20250124) GetCacheControl() *AnthropicCacheControlDirective { + if t == nil { + return nil + } + return t.CacheControl +} + +func (t *ToolTextEditor20250124) GetName() NameStrReplaceEditor { + if t == nil { + return NameStrReplaceEditor("") + } + return t.Name +} + +func (t *ToolTextEditor20250124) GetType() TypeTextEditor20250124 { + if t == nil { + return TypeTextEditor20250124("") + } + return t.Type +} + +// #region class-body-tooltexteditor20250124 +// #endregion class-body-tooltexteditor20250124 + +type NameBash string + +const ( + NameBashBash NameBash = "bash" +) + +func (e NameBash) ToPointer() *NameBash { + return &e +} +func (e *NameBash) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "bash": + *e = NameBash(v) + return nil + default: + return fmt.Errorf("invalid value for NameBash: %v", v) + } +} + +type TypeBash20250124 string + +const ( + TypeBash20250124Bash20250124 TypeBash20250124 = "bash_20250124" +) + +func (e TypeBash20250124) ToPointer() *TypeBash20250124 { + return &e +} +func (e *TypeBash20250124) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "bash_20250124": + *e = TypeBash20250124(v) + return nil + default: + return fmt.Errorf("invalid value for TypeBash20250124: %v", v) + } +} + +type ToolBash20250124 struct { + // Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + CacheControl *AnthropicCacheControlDirective `json:"cache_control,omitzero"` + Name NameBash `json:"name"` + Type TypeBash20250124 `json:"type"` +} + +func (t ToolBash20250124) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *ToolBash20250124) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *ToolBash20250124) GetCacheControl() *AnthropicCacheControlDirective { + if t == nil { + return nil + } + return t.CacheControl +} + +func (t *ToolBash20250124) GetName() NameBash { + if t == nil { + return NameBash("") + } + return t.Name +} + +func (t *ToolBash20250124) GetType() TypeBash20250124 { + if t == nil { + return TypeBash20250124("") + } + return t.Type +} + +// #region class-body-toolbash20250124 +// #endregion class-body-toolbash20250124 + +type InputSchema struct { + Properties optionalnullable.OptionalNullable[any] `json:"properties,omitzero"` + Required optionalnullable.OptionalNullable[[]string] `json:"required,omitzero"` + Type *string `default:"object" json:"type"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (i InputSchema) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(i, "", false) +} + +func (i *InputSchema) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &i, "", false, nil); err != nil { + return err + } + return nil +} + +func (i *InputSchema) GetProperties() optionalnullable.OptionalNullable[any] { + if i == nil { + return nil + } + return i.Properties +} + +func (i *InputSchema) GetRequired() optionalnullable.OptionalNullable[[]string] { + if i == nil { + return nil + } + return i.Required +} + +func (i *InputSchema) GetType() *string { + if i == nil { + return nil + } + return i.Type +} + +func (i *InputSchema) GetAdditionalProperties() map[string]any { + if i == nil { + return nil + } + return i.AdditionalProperties +} + +type ToolTypeCustom string + +const ( + ToolTypeCustomCustom ToolTypeCustom = "custom" +) + +func (e ToolTypeCustom) ToPointer() *ToolTypeCustom { + return &e +} +func (e *ToolTypeCustom) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "custom": + *e = ToolTypeCustom(v) + return nil + default: + return fmt.Errorf("invalid value for ToolTypeCustom: %v", v) + } +} + +type ToolCustom struct { + // Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + CacheControl *AnthropicCacheControlDirective `json:"cache_control,omitzero"` + Description *string `json:"description,omitzero"` + InputSchema InputSchema `json:"input_schema"` + Name string `json:"name"` + Type *ToolTypeCustom `json:"type,omitzero"` +} + +func (t ToolCustom) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *ToolCustom) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *ToolCustom) GetCacheControl() *AnthropicCacheControlDirective { + if t == nil { + return nil + } + return t.CacheControl +} + +func (t *ToolCustom) GetDescription() *string { + if t == nil { + return nil + } + return t.Description +} + +func (t *ToolCustom) GetInputSchema() InputSchema { + if t == nil { + return InputSchema{} + } + return t.InputSchema +} + +func (t *ToolCustom) GetName() string { + if t == nil { + return "" + } + return t.Name +} + +func (t *ToolCustom) GetType() *ToolTypeCustom { + if t == nil { + return nil + } + return t.Type +} + +type MessagesRequestToolUnionType string + +const ( + MessagesRequestToolUnionTypeToolCustom MessagesRequestToolUnionType = "tool_Custom" + MessagesRequestToolUnionTypeToolBash20250124 MessagesRequestToolUnionType = "tool_Bash20250124" + MessagesRequestToolUnionTypeToolTextEditor20250124 MessagesRequestToolUnionType = "tool_TextEditor20250124" + MessagesRequestToolUnionTypeToolWebSearch20250305 MessagesRequestToolUnionType = "tool_WebSearch20250305" + MessagesRequestToolUnionTypeToolWebSearch20260209 MessagesRequestToolUnionType = "tool_WebSearch20260209" + MessagesRequestToolUnionTypeToolAdvisor20260301 MessagesRequestToolUnionType = "tool_Advisor20260301" + MessagesRequestToolUnionTypeBashServerTool MessagesRequestToolUnionType = "BashServerTool" + MessagesRequestToolUnionTypeDatetimeServerTool MessagesRequestToolUnionType = "DatetimeServerTool" + MessagesRequestToolUnionTypeImageGenerationServerToolOpenRouter MessagesRequestToolUnionType = "ImageGenerationServerTool_OpenRouter" + MessagesRequestToolUnionTypeChatSearchModelsServerTool MessagesRequestToolUnionType = "ChatSearchModelsServerTool" + MessagesRequestToolUnionTypeWebFetchServerTool MessagesRequestToolUnionType = "WebFetchServerTool" + MessagesRequestToolUnionTypeOpenRouterWebSearchServerTool MessagesRequestToolUnionType = "OpenRouterWebSearchServerTool" + MessagesRequestToolUnionTypeMessagesRequestTool MessagesRequestToolUnionType = "MessagesRequest_tool" +) + +type MessagesRequestToolUnion struct { + ToolCustom *ToolCustom `queryParam:"inline" union:"member"` + ToolBash20250124 *ToolBash20250124 `queryParam:"inline" union:"member"` + ToolTextEditor20250124 *ToolTextEditor20250124 `queryParam:"inline" union:"member"` + ToolWebSearch20250305 *ToolWebSearch20250305 `queryParam:"inline" union:"member"` + ToolWebSearch20260209 *ToolWebSearch20260209 `queryParam:"inline" union:"member"` + ToolAdvisor20260301 *ToolAdvisor20260301 `queryParam:"inline" union:"member"` + BashServerTool *BashServerTool `queryParam:"inline" union:"member"` + DatetimeServerTool *DatetimeServerTool `queryParam:"inline" union:"member"` + ImageGenerationServerToolOpenRouter *ImageGenerationServerToolOpenRouter `queryParam:"inline" union:"member"` + ChatSearchModelsServerTool *ChatSearchModelsServerTool `queryParam:"inline" union:"member"` + WebFetchServerTool *WebFetchServerTool `queryParam:"inline" union:"member"` + OpenRouterWebSearchServerTool *OpenRouterWebSearchServerTool `queryParam:"inline" union:"member"` + MessagesRequestTool *MessagesRequestTool `queryParam:"inline" union:"member"` + + Type MessagesRequestToolUnionType +} + +func CreateMessagesRequestToolUnionToolCustom(toolCustom ToolCustom) MessagesRequestToolUnion { + typ := MessagesRequestToolUnionTypeToolCustom + + return MessagesRequestToolUnion{ + ToolCustom: &toolCustom, + Type: typ, + } +} + +func CreateMessagesRequestToolUnionToolBash20250124(toolBash20250124 ToolBash20250124) MessagesRequestToolUnion { + typ := MessagesRequestToolUnionTypeToolBash20250124 + + return MessagesRequestToolUnion{ + ToolBash20250124: &toolBash20250124, + Type: typ, + } +} + +func CreateMessagesRequestToolUnionToolTextEditor20250124(toolTextEditor20250124 ToolTextEditor20250124) MessagesRequestToolUnion { + typ := MessagesRequestToolUnionTypeToolTextEditor20250124 + + return MessagesRequestToolUnion{ + ToolTextEditor20250124: &toolTextEditor20250124, + Type: typ, + } +} + +func CreateMessagesRequestToolUnionToolWebSearch20250305(toolWebSearch20250305 ToolWebSearch20250305) MessagesRequestToolUnion { + typ := MessagesRequestToolUnionTypeToolWebSearch20250305 + + return MessagesRequestToolUnion{ + ToolWebSearch20250305: &toolWebSearch20250305, + Type: typ, + } +} + +func CreateMessagesRequestToolUnionToolWebSearch20260209(toolWebSearch20260209 ToolWebSearch20260209) MessagesRequestToolUnion { + typ := MessagesRequestToolUnionTypeToolWebSearch20260209 + + return MessagesRequestToolUnion{ + ToolWebSearch20260209: &toolWebSearch20260209, + Type: typ, + } +} + +func CreateMessagesRequestToolUnionToolAdvisor20260301(toolAdvisor20260301 ToolAdvisor20260301) MessagesRequestToolUnion { + typ := MessagesRequestToolUnionTypeToolAdvisor20260301 + + return MessagesRequestToolUnion{ + ToolAdvisor20260301: &toolAdvisor20260301, + Type: typ, + } +} + +func CreateMessagesRequestToolUnionBashServerTool(bashServerTool BashServerTool) MessagesRequestToolUnion { + typ := MessagesRequestToolUnionTypeBashServerTool + + return MessagesRequestToolUnion{ + BashServerTool: &bashServerTool, + Type: typ, + } +} + +func CreateMessagesRequestToolUnionDatetimeServerTool(datetimeServerTool DatetimeServerTool) MessagesRequestToolUnion { + typ := MessagesRequestToolUnionTypeDatetimeServerTool + + return MessagesRequestToolUnion{ + DatetimeServerTool: &datetimeServerTool, + Type: typ, + } +} + +func CreateMessagesRequestToolUnionImageGenerationServerToolOpenRouter(imageGenerationServerToolOpenRouter ImageGenerationServerToolOpenRouter) MessagesRequestToolUnion { + typ := MessagesRequestToolUnionTypeImageGenerationServerToolOpenRouter + + return MessagesRequestToolUnion{ + ImageGenerationServerToolOpenRouter: &imageGenerationServerToolOpenRouter, + Type: typ, + } +} + +func CreateMessagesRequestToolUnionChatSearchModelsServerTool(chatSearchModelsServerTool ChatSearchModelsServerTool) MessagesRequestToolUnion { + typ := MessagesRequestToolUnionTypeChatSearchModelsServerTool + + return MessagesRequestToolUnion{ + ChatSearchModelsServerTool: &chatSearchModelsServerTool, + Type: typ, + } +} + +func CreateMessagesRequestToolUnionWebFetchServerTool(webFetchServerTool WebFetchServerTool) MessagesRequestToolUnion { + typ := MessagesRequestToolUnionTypeWebFetchServerTool + + return MessagesRequestToolUnion{ + WebFetchServerTool: &webFetchServerTool, + Type: typ, + } +} + +func CreateMessagesRequestToolUnionOpenRouterWebSearchServerTool(openRouterWebSearchServerTool OpenRouterWebSearchServerTool) MessagesRequestToolUnion { + typ := MessagesRequestToolUnionTypeOpenRouterWebSearchServerTool + + return MessagesRequestToolUnion{ + OpenRouterWebSearchServerTool: &openRouterWebSearchServerTool, + Type: typ, + } +} + +func CreateMessagesRequestToolUnionMessagesRequestTool(messagesRequestTool MessagesRequestTool) MessagesRequestToolUnion { + typ := MessagesRequestToolUnionTypeMessagesRequestTool + + return MessagesRequestToolUnion{ + MessagesRequestTool: &messagesRequestTool, + Type: typ, + } +} + +func (u *MessagesRequestToolUnion) UnmarshalJSON(data []byte) error { + + var candidates []utils.UnionCandidate + + // Collect all valid candidates + var toolCustom ToolCustom = ToolCustom{} + if err := utils.UnmarshalJSON(data, &toolCustom, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: MessagesRequestToolUnionTypeToolCustom, + Value: &toolCustom, + }) + } + + var toolBash20250124 ToolBash20250124 = ToolBash20250124{} + if err := utils.UnmarshalJSON(data, &toolBash20250124, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: MessagesRequestToolUnionTypeToolBash20250124, + Value: &toolBash20250124, + }) + } + + var toolTextEditor20250124 ToolTextEditor20250124 = ToolTextEditor20250124{} + if err := utils.UnmarshalJSON(data, &toolTextEditor20250124, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: MessagesRequestToolUnionTypeToolTextEditor20250124, + Value: &toolTextEditor20250124, + }) + } + + var toolWebSearch20250305 ToolWebSearch20250305 = ToolWebSearch20250305{} + if err := utils.UnmarshalJSON(data, &toolWebSearch20250305, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: MessagesRequestToolUnionTypeToolWebSearch20250305, + Value: &toolWebSearch20250305, + }) + } + + var toolWebSearch20260209 ToolWebSearch20260209 = ToolWebSearch20260209{} + if err := utils.UnmarshalJSON(data, &toolWebSearch20260209, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: MessagesRequestToolUnionTypeToolWebSearch20260209, + Value: &toolWebSearch20260209, + }) + } + + var toolAdvisor20260301 ToolAdvisor20260301 = ToolAdvisor20260301{} + if err := utils.UnmarshalJSON(data, &toolAdvisor20260301, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: MessagesRequestToolUnionTypeToolAdvisor20260301, + Value: &toolAdvisor20260301, + }) + } + + var bashServerTool BashServerTool = BashServerTool{} + if err := utils.UnmarshalJSON(data, &bashServerTool, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: MessagesRequestToolUnionTypeBashServerTool, + Value: &bashServerTool, + }) + } + + var datetimeServerTool DatetimeServerTool = DatetimeServerTool{} + if err := utils.UnmarshalJSON(data, &datetimeServerTool, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: MessagesRequestToolUnionTypeDatetimeServerTool, + Value: &datetimeServerTool, + }) + } + + var imageGenerationServerToolOpenRouter ImageGenerationServerToolOpenRouter = ImageGenerationServerToolOpenRouter{} + if err := utils.UnmarshalJSON(data, &imageGenerationServerToolOpenRouter, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: MessagesRequestToolUnionTypeImageGenerationServerToolOpenRouter, + Value: &imageGenerationServerToolOpenRouter, + }) + } + + var chatSearchModelsServerTool ChatSearchModelsServerTool = ChatSearchModelsServerTool{} + if err := utils.UnmarshalJSON(data, &chatSearchModelsServerTool, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: MessagesRequestToolUnionTypeChatSearchModelsServerTool, + Value: &chatSearchModelsServerTool, + }) + } + + var webFetchServerTool WebFetchServerTool = WebFetchServerTool{} + if err := utils.UnmarshalJSON(data, &webFetchServerTool, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: MessagesRequestToolUnionTypeWebFetchServerTool, + Value: &webFetchServerTool, + }) + } + + var openRouterWebSearchServerTool OpenRouterWebSearchServerTool = OpenRouterWebSearchServerTool{} + if err := utils.UnmarshalJSON(data, &openRouterWebSearchServerTool, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: MessagesRequestToolUnionTypeOpenRouterWebSearchServerTool, + Value: &openRouterWebSearchServerTool, + }) + } + + var messagesRequestTool MessagesRequestTool = MessagesRequestTool{} + if err := utils.UnmarshalJSON(data, &messagesRequestTool, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: MessagesRequestToolUnionTypeMessagesRequestTool, + Value: &messagesRequestTool, + }) + } + + if len(candidates) == 0 { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for MessagesRequestToolUnion", string(data)) + } + + // Pick the best candidate using multi-stage filtering + best := utils.PickBestUnionCandidate(candidates, data) + if best == nil { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for MessagesRequestToolUnion", string(data)) + } + + // Set the union type and value based on the best candidate + u.Type = best.Type.(MessagesRequestToolUnionType) + switch best.Type { + case MessagesRequestToolUnionTypeToolCustom: + u.ToolCustom = best.Value.(*ToolCustom) + return nil + case MessagesRequestToolUnionTypeToolBash20250124: + u.ToolBash20250124 = best.Value.(*ToolBash20250124) + return nil + case MessagesRequestToolUnionTypeToolTextEditor20250124: + u.ToolTextEditor20250124 = best.Value.(*ToolTextEditor20250124) + return nil + case MessagesRequestToolUnionTypeToolWebSearch20250305: + u.ToolWebSearch20250305 = best.Value.(*ToolWebSearch20250305) + return nil + case MessagesRequestToolUnionTypeToolWebSearch20260209: + u.ToolWebSearch20260209 = best.Value.(*ToolWebSearch20260209) + return nil + case MessagesRequestToolUnionTypeToolAdvisor20260301: + u.ToolAdvisor20260301 = best.Value.(*ToolAdvisor20260301) + return nil + case MessagesRequestToolUnionTypeBashServerTool: + u.BashServerTool = best.Value.(*BashServerTool) + return nil + case MessagesRequestToolUnionTypeDatetimeServerTool: + u.DatetimeServerTool = best.Value.(*DatetimeServerTool) + return nil + case MessagesRequestToolUnionTypeImageGenerationServerToolOpenRouter: + u.ImageGenerationServerToolOpenRouter = best.Value.(*ImageGenerationServerToolOpenRouter) + return nil + case MessagesRequestToolUnionTypeChatSearchModelsServerTool: + u.ChatSearchModelsServerTool = best.Value.(*ChatSearchModelsServerTool) + return nil + case MessagesRequestToolUnionTypeWebFetchServerTool: + u.WebFetchServerTool = best.Value.(*WebFetchServerTool) + return nil + case MessagesRequestToolUnionTypeOpenRouterWebSearchServerTool: + u.OpenRouterWebSearchServerTool = best.Value.(*OpenRouterWebSearchServerTool) + return nil + case MessagesRequestToolUnionTypeMessagesRequestTool: + u.MessagesRequestTool = best.Value.(*MessagesRequestTool) + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for MessagesRequestToolUnion", string(data)) +} + +func (u MessagesRequestToolUnion) MarshalJSON() ([]byte, error) { + if u.ToolCustom != nil { + return utils.MarshalJSON(u.ToolCustom, "", true) + } + + if u.ToolBash20250124 != nil { + return utils.MarshalJSON(u.ToolBash20250124, "", true) + } + + if u.ToolTextEditor20250124 != nil { + return utils.MarshalJSON(u.ToolTextEditor20250124, "", true) + } + + if u.ToolWebSearch20250305 != nil { + return utils.MarshalJSON(u.ToolWebSearch20250305, "", true) + } + + if u.ToolWebSearch20260209 != nil { + return utils.MarshalJSON(u.ToolWebSearch20260209, "", true) + } + + if u.ToolAdvisor20260301 != nil { + return utils.MarshalJSON(u.ToolAdvisor20260301, "", true) + } + + if u.BashServerTool != nil { + return utils.MarshalJSON(u.BashServerTool, "", true) + } + + if u.DatetimeServerTool != nil { + return utils.MarshalJSON(u.DatetimeServerTool, "", true) + } + + if u.ImageGenerationServerToolOpenRouter != nil { + return utils.MarshalJSON(u.ImageGenerationServerToolOpenRouter, "", true) + } + + if u.ChatSearchModelsServerTool != nil { + return utils.MarshalJSON(u.ChatSearchModelsServerTool, "", true) + } + + if u.WebFetchServerTool != nil { + return utils.MarshalJSON(u.WebFetchServerTool, "", true) + } + + if u.OpenRouterWebSearchServerTool != nil { + return utils.MarshalJSON(u.OpenRouterWebSearchServerTool, "", true) + } + + if u.MessagesRequestTool != nil { + return utils.MarshalJSON(u.MessagesRequestTool, "", true) + } + + return nil, errors.New("could not marshal union type MessagesRequestToolUnion: all fields are null") +} + +// MessagesRequest - Request schema for Anthropic Messages API endpoint +type MessagesRequest struct { + // Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + CacheControl *AnthropicCacheControlDirective `json:"cache_control,omitzero"` + ContextManagement optionalnullable.OptionalNullable[ContextManagement] `json:"context_management,omitzero"` + // Fallback models to try if the primary model fails or refuses, in order. Handled by OpenRouter multi-model routing rather than Anthropic server-side fallbacks; cannot be combined with `models`. Each entry accepts only `model`. Maximum of 3 entries. + Fallbacks optionalnullable.OptionalNullable[[]MessagesFallbackParam] `json:"fallbacks,omitzero"` + MaxTokens *int64 `json:"max_tokens,omitzero"` + Messages []MessagesMessageParam `json:"messages"` + Metadata *Metadata `json:"metadata,omitzero"` + Model string `json:"model"` + Models []string `json:"models,omitzero"` + // Configuration for controlling output behavior. Supports the effort parameter and structured output format. + OutputConfig *MessagesOutputConfig `json:"output_config,omitzero"` + // Plugins you want to enable for this request, including their settings. + Plugins []MessagesRequestPlugin `json:"plugins,omitzero"` + // When multiple model providers are available, optionally indicate your routing preference. + Provider optionalnullable.OptionalNullable[ProviderPreferences] `json:"provider,omitzero"` + ServiceTier *string `json:"service_tier,omitzero"` + // A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. + SessionID *string `json:"session_id,omitzero"` + Speed optionalnullable.OptionalNullable[Speed] `json:"speed,omitzero"` + StopSequences []string `json:"stop_sequences,omitzero"` + // Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`. + StopServerToolsWhen []StopServerToolsWhenCondition `json:"stop_server_tools_when,omitzero"` + Stream *bool `json:"stream,omitzero"` + System *System `json:"system,omitzero"` + Temperature *float64 `json:"temperature,omitzero"` + Thinking *Thinking `json:"thinking,omitzero"` + ToolChoice *ToolChoice `json:"tool_choice,omitzero"` + Tools []MessagesRequestToolUnion `json:"tools,omitzero"` + TopK *int64 `json:"top_k,omitzero"` + TopP *float64 `json:"top_p,omitzero"` + // Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. + Trace *TraceConfig `json:"trace,omitzero"` + // A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 256 characters. + User *string `json:"user,omitzero"` +} + +func (m MessagesRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MessagesRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MessagesRequest) GetCacheControl() *AnthropicCacheControlDirective { + if m == nil { + return nil + } + return m.CacheControl +} + +func (m *MessagesRequest) GetContextManagement() optionalnullable.OptionalNullable[ContextManagement] { + if m == nil { + return nil + } + return m.ContextManagement +} + +func (m *MessagesRequest) GetFallbacks() optionalnullable.OptionalNullable[[]MessagesFallbackParam] { + if m == nil { + return nil + } + return m.Fallbacks +} + +func (m *MessagesRequest) GetMaxTokens() *int64 { + if m == nil { + return nil + } + return m.MaxTokens +} + +func (m *MessagesRequest) GetMessages() []MessagesMessageParam { + if m == nil { + return nil + } + return m.Messages +} + +func (m *MessagesRequest) GetMetadata() *Metadata { + if m == nil { + return nil + } + return m.Metadata +} + +func (m *MessagesRequest) GetModel() string { + if m == nil { + return "" + } + return m.Model +} + +func (m *MessagesRequest) GetModels() []string { + if m == nil { + return nil + } + return m.Models +} + +func (m *MessagesRequest) GetOutputConfig() *MessagesOutputConfig { + if m == nil { + return nil + } + return m.OutputConfig +} + +func (m *MessagesRequest) GetPlugins() []MessagesRequestPlugin { + if m == nil { + return nil + } + return m.Plugins +} + +func (m *MessagesRequest) GetProvider() optionalnullable.OptionalNullable[ProviderPreferences] { + if m == nil { + return nil + } + return m.Provider +} + +func (m *MessagesRequest) GetServiceTier() *string { + if m == nil { + return nil + } + return m.ServiceTier +} + +func (m *MessagesRequest) GetSessionID() *string { + if m == nil { + return nil + } + return m.SessionID +} + +func (m *MessagesRequest) GetSpeed() optionalnullable.OptionalNullable[Speed] { + if m == nil { + return nil + } + return m.Speed +} + +func (m *MessagesRequest) GetStopSequences() []string { + if m == nil { + return nil + } + return m.StopSequences +} + +func (m *MessagesRequest) GetStopServerToolsWhen() []StopServerToolsWhenCondition { + if m == nil { + return nil + } + return m.StopServerToolsWhen +} + +func (m *MessagesRequest) GetStream() *bool { + if m == nil { + return nil + } + return m.Stream +} + +func (m *MessagesRequest) GetSystem() *System { + if m == nil { + return nil + } + return m.System +} + +func (m *MessagesRequest) GetTemperature() *float64 { + if m == nil { + return nil + } + return m.Temperature +} + +func (m *MessagesRequest) GetThinking() *Thinking { + if m == nil { + return nil + } + return m.Thinking +} + +func (m *MessagesRequest) GetThinkingEnabled() *ThinkingEnabled { + if v := m.GetThinking(); v != nil { + return v.ThinkingEnabled + } + return nil +} + +func (m *MessagesRequest) GetThinkingDisabled() *ThinkingDisabled { + if v := m.GetThinking(); v != nil { + return v.ThinkingDisabled + } + return nil +} + +func (m *MessagesRequest) GetThinkingAdaptive() *ThinkingAdaptive { + if v := m.GetThinking(); v != nil { + return v.ThinkingAdaptive + } + return nil +} + +func (m *MessagesRequest) GetToolChoice() *ToolChoice { + if m == nil { + return nil + } + return m.ToolChoice +} + +func (m *MessagesRequest) GetToolChoiceAuto() *ToolChoiceAuto { + if v := m.GetToolChoice(); v != nil { + return v.ToolChoiceAuto + } + return nil +} + +func (m *MessagesRequest) GetToolChoiceAny() *ToolChoiceAny { + if v := m.GetToolChoice(); v != nil { + return v.ToolChoiceAny + } + return nil +} + +func (m *MessagesRequest) GetToolChoiceNone() *ToolChoiceNone { + if v := m.GetToolChoice(); v != nil { + return v.ToolChoiceNone + } + return nil +} + +func (m *MessagesRequest) GetToolChoiceTool() *ToolChoiceTool { + if v := m.GetToolChoice(); v != nil { + return v.ToolChoiceTool + } + return nil +} + +func (m *MessagesRequest) GetTools() []MessagesRequestToolUnion { + if m == nil { + return nil + } + return m.Tools +} + +func (m *MessagesRequest) GetTopK() *int64 { + if m == nil { + return nil + } + return m.TopK +} + +func (m *MessagesRequest) GetTopP() *float64 { + if m == nil { + return nil + } + return m.TopP +} + +func (m *MessagesRequest) GetTrace() *TraceConfig { + if m == nil { + return nil + } + return m.Trace +} + +func (m *MessagesRequest) GetUser() *string { + if m == nil { + return nil + } + return m.User +} diff --git a/models/components/metadatalevel.go b/models/components/metadatalevel.go new file mode 100644 index 00000000..2f70d517 --- /dev/null +++ b/models/components/metadatalevel.go @@ -0,0 +1,26 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// MetadataLevel - Opt-in level for surfacing routing metadata on the response under `openrouter_metadata`. +type MetadataLevel string + +const ( + MetadataLevelDisabled MetadataLevel = "disabled" + MetadataLevelEnabled MetadataLevel = "enabled" +) + +func (e MetadataLevel) ToPointer() *MetadataLevel { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *MetadataLevel) IsExact() bool { + if e != nil { + switch *e { + case "disabled", "enabled": + return true + } + } + return false +} diff --git a/models/components/model.go b/models/components/model.go index d4aa769b..de775ae8 100644 --- a/models/components/model.go +++ b/models/components/model.go @@ -3,6 +3,7 @@ package components import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" "github.com/OpenRouterTeam/go-sdk/optionalnullable" ) @@ -10,6 +11,8 @@ import ( type Model struct { // Model architecture information Architecture ModelArchitecture `json:"architecture"` + // Third-party benchmark rankings for this model. Omitted when no benchmark data is available. + Benchmarks *ModelBenchmarks `json:"benchmarks,omitzero"` // Canonical slug for the model CanonicalSlug string `json:"canonical_slug"` // Maximum context length in tokens @@ -38,10 +41,23 @@ type Model struct { Pricing PublicPricing `json:"pricing"` // List of supported parameters for this model SupportedParameters []Parameter `json:"supported_parameters"` + // List of supported voice identifiers for TTS models. Null for non-TTS models. + SupportedVoices []string `json:"supported_voices"` // Information about the top provider for this model TopProvider TopProviderInfo `json:"top_provider"` } +func (m Model) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *Model) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + func (m *Model) GetArchitecture() ModelArchitecture { if m == nil { return ModelArchitecture{} @@ -49,6 +65,13 @@ func (m *Model) GetArchitecture() ModelArchitecture { return m.Architecture } +func (m *Model) GetBenchmarks() *ModelBenchmarks { + if m == nil { + return nil + } + return m.Benchmarks +} + func (m *Model) GetCanonicalSlug() string { if m == nil { return "" @@ -147,6 +170,13 @@ func (m *Model) GetSupportedParameters() []Parameter { return m.SupportedParameters } +func (m *Model) GetSupportedVoices() []string { + if m == nil { + return nil + } + return m.SupportedVoices +} + func (m *Model) GetTopProvider() TopProviderInfo { if m == nil { return TopProviderInfo{} diff --git a/models/components/modelbenchmarks.go b/models/components/modelbenchmarks.go new file mode 100644 index 00000000..0f576712 --- /dev/null +++ b/models/components/modelbenchmarks.go @@ -0,0 +1,40 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// ModelBenchmarks - Third-party benchmark rankings for this model. Omitted when no benchmark data is available. +type ModelBenchmarks struct { + // Artificial Analysis benchmark index scores. + ArtificialAnalysis *AABenchmarkEntry `json:"artificial_analysis,omitzero"` + // Design Arena ELO rankings across arena+category pairs. + DesignArena []DABenchmarkEntry `json:"design_arena"` +} + +func (m ModelBenchmarks) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *ModelBenchmarks) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *ModelBenchmarks) GetArtificialAnalysis() *AABenchmarkEntry { + if m == nil { + return nil + } + return m.ArtificialAnalysis +} + +func (m *ModelBenchmarks) GetDesignArena() []DABenchmarkEntry { + if m == nil { + return []DABenchmarkEntry{} + } + return m.DesignArena +} diff --git a/models/components/modelresponse.go b/models/components/modelresponse.go new file mode 100644 index 00000000..647212c7 --- /dev/null +++ b/models/components/modelresponse.go @@ -0,0 +1,16 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ModelResponse - Single model response +type ModelResponse struct { + // Information about an AI model available on OpenRouter + Data Model `json:"data"` +} + +func (m *ModelResponse) GetData() Model { + if m == nil { + return Model{} + } + return m.Data +} diff --git a/models/components/multimodalmedia.go b/models/components/multimodalmedia.go new file mode 100644 index 00000000..8a201d6f --- /dev/null +++ b/models/components/multimodalmedia.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type MultimodalMedia struct { + Data string `json:"data"` + Format *string `json:"format,omitzero"` +} + +func (m MultimodalMedia) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *MultimodalMedia) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, nil); err != nil { + return err + } + return nil +} + +func (m *MultimodalMedia) GetData() string { + if m == nil { + return "" + } + return m.Data +} + +func (m *MultimodalMedia) GetFormat() *string { + if m == nil { + return nil + } + return m.Format +} diff --git a/models/components/observabilityarizedestination.go b/models/components/observabilityarizedestination.go new file mode 100644 index 00000000..8084d123 --- /dev/null +++ b/models/components/observabilityarizedestination.go @@ -0,0 +1,207 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ObservabilityArizeDestinationConfig struct { + APIKey string `json:"apiKey"` + BaseURL *string `default:"https://otlp.arize.com" json:"baseUrl"` + // Custom HTTP headers to include in requests to this destination. + Headers map[string]string `json:"headers,omitzero"` + ModelID string `json:"modelId"` + SpaceKey string `json:"spaceKey"` +} + +func (o ObservabilityArizeDestinationConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityArizeDestinationConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityArizeDestinationConfig) GetAPIKey() string { + if o == nil { + return "" + } + return o.APIKey +} + +func (o *ObservabilityArizeDestinationConfig) GetBaseURL() *string { + if o == nil { + return nil + } + return o.BaseURL +} + +func (o *ObservabilityArizeDestinationConfig) GetHeaders() map[string]string { + if o == nil { + return nil + } + return o.Headers +} + +func (o *ObservabilityArizeDestinationConfig) GetModelID() string { + if o == nil { + return "" + } + return o.ModelID +} + +func (o *ObservabilityArizeDestinationConfig) GetSpaceKey() string { + if o == nil { + return "" + } + return o.SpaceKey +} + +type ObservabilityArizeDestinationType string + +const ( + ObservabilityArizeDestinationTypeArize ObservabilityArizeDestinationType = "arize" +) + +func (e ObservabilityArizeDestinationType) ToPointer() *ObservabilityArizeDestinationType { + return &e +} +func (e *ObservabilityArizeDestinationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "arize": + *e = ObservabilityArizeDestinationType(v) + return nil + default: + return fmt.Errorf("invalid value for ObservabilityArizeDestinationType: %v", v) + } +} + +type ObservabilityArizeDestination struct { + // Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + APIKeyHashes []string `json:"api_key_hashes"` + Config ObservabilityArizeDestinationConfig `json:"config"` + // ISO timestamp of when the destination was created. + CreatedAt string `json:"created_at"` + // Whether this destination is currently enabled. + Enabled bool `json:"enabled"` + // Optional structured filter rules controlling which events are forwarded. + FilterRules *ObservabilityFilterRulesConfig `json:"filter_rules"` + // Stable public identifier for this destination. + ID string `json:"id"` + // Human-readable name for the destination. + Name *string `json:"name"` + // When true, request/response bodies are not forwarded to this destination — only metadata. + PrivacyMode bool `json:"privacy_mode"` + // Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + SamplingRate float64 `json:"sampling_rate"` + Type ObservabilityArizeDestinationType `json:"type"` + // ISO timestamp of when the destination was last updated. + UpdatedAt string `json:"updated_at"` + // ID of the workspace this destination belongs to. + WorkspaceID string `json:"workspace_id"` +} + +func (o ObservabilityArizeDestination) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityArizeDestination) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityArizeDestination) GetAPIKeyHashes() []string { + if o == nil { + return nil + } + return o.APIKeyHashes +} + +func (o *ObservabilityArizeDestination) GetConfig() ObservabilityArizeDestinationConfig { + if o == nil { + return ObservabilityArizeDestinationConfig{} + } + return o.Config +} + +func (o *ObservabilityArizeDestination) GetCreatedAt() string { + if o == nil { + return "" + } + return o.CreatedAt +} + +func (o *ObservabilityArizeDestination) GetEnabled() bool { + if o == nil { + return false + } + return o.Enabled +} + +func (o *ObservabilityArizeDestination) GetFilterRules() *ObservabilityFilterRulesConfig { + if o == nil { + return nil + } + return o.FilterRules +} + +func (o *ObservabilityArizeDestination) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *ObservabilityArizeDestination) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *ObservabilityArizeDestination) GetPrivacyMode() bool { + if o == nil { + return false + } + return o.PrivacyMode +} + +func (o *ObservabilityArizeDestination) GetSamplingRate() float64 { + if o == nil { + return 0.0 + } + return o.SamplingRate +} + +func (o *ObservabilityArizeDestination) GetType() ObservabilityArizeDestinationType { + if o == nil { + return ObservabilityArizeDestinationType("") + } + return o.Type +} + +func (o *ObservabilityArizeDestination) GetUpdatedAt() string { + if o == nil { + return "" + } + return o.UpdatedAt +} + +func (o *ObservabilityArizeDestination) GetWorkspaceID() string { + if o == nil { + return "" + } + return o.WorkspaceID +} diff --git a/models/components/observabilitybraintrustdestination.go b/models/components/observabilitybraintrustdestination.go new file mode 100644 index 00000000..2a4c1739 --- /dev/null +++ b/models/components/observabilitybraintrustdestination.go @@ -0,0 +1,199 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ObservabilityBraintrustDestinationConfig struct { + APIKey string `json:"apiKey"` + BaseURL *string `default:"https://api.braintrust.dev" json:"baseUrl"` + // Custom HTTP headers to include in requests to this destination. + Headers map[string]string `json:"headers,omitzero"` + ProjectID string `json:"projectId"` +} + +func (o ObservabilityBraintrustDestinationConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityBraintrustDestinationConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityBraintrustDestinationConfig) GetAPIKey() string { + if o == nil { + return "" + } + return o.APIKey +} + +func (o *ObservabilityBraintrustDestinationConfig) GetBaseURL() *string { + if o == nil { + return nil + } + return o.BaseURL +} + +func (o *ObservabilityBraintrustDestinationConfig) GetHeaders() map[string]string { + if o == nil { + return nil + } + return o.Headers +} + +func (o *ObservabilityBraintrustDestinationConfig) GetProjectID() string { + if o == nil { + return "" + } + return o.ProjectID +} + +type ObservabilityBraintrustDestinationType string + +const ( + ObservabilityBraintrustDestinationTypeBraintrust ObservabilityBraintrustDestinationType = "braintrust" +) + +func (e ObservabilityBraintrustDestinationType) ToPointer() *ObservabilityBraintrustDestinationType { + return &e +} +func (e *ObservabilityBraintrustDestinationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "braintrust": + *e = ObservabilityBraintrustDestinationType(v) + return nil + default: + return fmt.Errorf("invalid value for ObservabilityBraintrustDestinationType: %v", v) + } +} + +type ObservabilityBraintrustDestination struct { + // Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + APIKeyHashes []string `json:"api_key_hashes"` + Config ObservabilityBraintrustDestinationConfig `json:"config"` + // ISO timestamp of when the destination was created. + CreatedAt string `json:"created_at"` + // Whether this destination is currently enabled. + Enabled bool `json:"enabled"` + // Optional structured filter rules controlling which events are forwarded. + FilterRules *ObservabilityFilterRulesConfig `json:"filter_rules"` + // Stable public identifier for this destination. + ID string `json:"id"` + // Human-readable name for the destination. + Name *string `json:"name"` + // When true, request/response bodies are not forwarded to this destination — only metadata. + PrivacyMode bool `json:"privacy_mode"` + // Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + SamplingRate float64 `json:"sampling_rate"` + Type ObservabilityBraintrustDestinationType `json:"type"` + // ISO timestamp of when the destination was last updated. + UpdatedAt string `json:"updated_at"` + // ID of the workspace this destination belongs to. + WorkspaceID string `json:"workspace_id"` +} + +func (o ObservabilityBraintrustDestination) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityBraintrustDestination) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityBraintrustDestination) GetAPIKeyHashes() []string { + if o == nil { + return nil + } + return o.APIKeyHashes +} + +func (o *ObservabilityBraintrustDestination) GetConfig() ObservabilityBraintrustDestinationConfig { + if o == nil { + return ObservabilityBraintrustDestinationConfig{} + } + return o.Config +} + +func (o *ObservabilityBraintrustDestination) GetCreatedAt() string { + if o == nil { + return "" + } + return o.CreatedAt +} + +func (o *ObservabilityBraintrustDestination) GetEnabled() bool { + if o == nil { + return false + } + return o.Enabled +} + +func (o *ObservabilityBraintrustDestination) GetFilterRules() *ObservabilityFilterRulesConfig { + if o == nil { + return nil + } + return o.FilterRules +} + +func (o *ObservabilityBraintrustDestination) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *ObservabilityBraintrustDestination) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *ObservabilityBraintrustDestination) GetPrivacyMode() bool { + if o == nil { + return false + } + return o.PrivacyMode +} + +func (o *ObservabilityBraintrustDestination) GetSamplingRate() float64 { + if o == nil { + return 0.0 + } + return o.SamplingRate +} + +func (o *ObservabilityBraintrustDestination) GetType() ObservabilityBraintrustDestinationType { + if o == nil { + return ObservabilityBraintrustDestinationType("") + } + return o.Type +} + +func (o *ObservabilityBraintrustDestination) GetUpdatedAt() string { + if o == nil { + return "" + } + return o.UpdatedAt +} + +func (o *ObservabilityBraintrustDestination) GetWorkspaceID() string { + if o == nil { + return "" + } + return o.WorkspaceID +} diff --git a/models/components/observabilityclickhousedestination.go b/models/components/observabilityclickhousedestination.go new file mode 100644 index 00000000..edae0635 --- /dev/null +++ b/models/components/observabilityclickhousedestination.go @@ -0,0 +1,216 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ObservabilityClickhouseDestinationConfig struct { + Database string `json:"database"` + // Custom HTTP headers to include in requests to this destination. + Headers map[string]string `json:"headers,omitzero"` + Host string `json:"host"` + Password string `json:"password"` + Table *string `default:"OPENROUTER_TRACES" json:"table"` + // If you have not set a specific username in ClickHouse, simply type in 'default' below. + Username string `json:"username"` +} + +func (o ObservabilityClickhouseDestinationConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityClickhouseDestinationConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityClickhouseDestinationConfig) GetDatabase() string { + if o == nil { + return "" + } + return o.Database +} + +func (o *ObservabilityClickhouseDestinationConfig) GetHeaders() map[string]string { + if o == nil { + return nil + } + return o.Headers +} + +func (o *ObservabilityClickhouseDestinationConfig) GetHost() string { + if o == nil { + return "" + } + return o.Host +} + +func (o *ObservabilityClickhouseDestinationConfig) GetPassword() string { + if o == nil { + return "" + } + return o.Password +} + +func (o *ObservabilityClickhouseDestinationConfig) GetTable() *string { + if o == nil { + return nil + } + return o.Table +} + +func (o *ObservabilityClickhouseDestinationConfig) GetUsername() string { + if o == nil { + return "" + } + return o.Username +} + +type ObservabilityClickhouseDestinationType string + +const ( + ObservabilityClickhouseDestinationTypeClickhouse ObservabilityClickhouseDestinationType = "clickhouse" +) + +func (e ObservabilityClickhouseDestinationType) ToPointer() *ObservabilityClickhouseDestinationType { + return &e +} +func (e *ObservabilityClickhouseDestinationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "clickhouse": + *e = ObservabilityClickhouseDestinationType(v) + return nil + default: + return fmt.Errorf("invalid value for ObservabilityClickhouseDestinationType: %v", v) + } +} + +type ObservabilityClickhouseDestination struct { + // Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + APIKeyHashes []string `json:"api_key_hashes"` + Config ObservabilityClickhouseDestinationConfig `json:"config"` + // ISO timestamp of when the destination was created. + CreatedAt string `json:"created_at"` + // Whether this destination is currently enabled. + Enabled bool `json:"enabled"` + // Optional structured filter rules controlling which events are forwarded. + FilterRules *ObservabilityFilterRulesConfig `json:"filter_rules"` + // Stable public identifier for this destination. + ID string `json:"id"` + // Human-readable name for the destination. + Name *string `json:"name"` + // When true, request/response bodies are not forwarded to this destination — only metadata. + PrivacyMode bool `json:"privacy_mode"` + // Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + SamplingRate float64 `json:"sampling_rate"` + Type ObservabilityClickhouseDestinationType `json:"type"` + // ISO timestamp of when the destination was last updated. + UpdatedAt string `json:"updated_at"` + // ID of the workspace this destination belongs to. + WorkspaceID string `json:"workspace_id"` +} + +func (o ObservabilityClickhouseDestination) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityClickhouseDestination) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityClickhouseDestination) GetAPIKeyHashes() []string { + if o == nil { + return nil + } + return o.APIKeyHashes +} + +func (o *ObservabilityClickhouseDestination) GetConfig() ObservabilityClickhouseDestinationConfig { + if o == nil { + return ObservabilityClickhouseDestinationConfig{} + } + return o.Config +} + +func (o *ObservabilityClickhouseDestination) GetCreatedAt() string { + if o == nil { + return "" + } + return o.CreatedAt +} + +func (o *ObservabilityClickhouseDestination) GetEnabled() bool { + if o == nil { + return false + } + return o.Enabled +} + +func (o *ObservabilityClickhouseDestination) GetFilterRules() *ObservabilityFilterRulesConfig { + if o == nil { + return nil + } + return o.FilterRules +} + +func (o *ObservabilityClickhouseDestination) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *ObservabilityClickhouseDestination) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *ObservabilityClickhouseDestination) GetPrivacyMode() bool { + if o == nil { + return false + } + return o.PrivacyMode +} + +func (o *ObservabilityClickhouseDestination) GetSamplingRate() float64 { + if o == nil { + return 0.0 + } + return o.SamplingRate +} + +func (o *ObservabilityClickhouseDestination) GetType() ObservabilityClickhouseDestinationType { + if o == nil { + return ObservabilityClickhouseDestinationType("") + } + return o.Type +} + +func (o *ObservabilityClickhouseDestination) GetUpdatedAt() string { + if o == nil { + return "" + } + return o.UpdatedAt +} + +func (o *ObservabilityClickhouseDestination) GetWorkspaceID() string { + if o == nil { + return "" + } + return o.WorkspaceID +} diff --git a/models/components/observabilitydatadogdestination.go b/models/components/observabilitydatadogdestination.go new file mode 100644 index 00000000..c042aa9c --- /dev/null +++ b/models/components/observabilitydatadogdestination.go @@ -0,0 +1,202 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ObservabilityDatadogDestinationConfig struct { + // Datadog API key must have LLM Observability permissions. Create at: + APIKey string `json:"apiKey"` + // Custom HTTP headers to include in requests to this destination. + Headers map[string]string `json:"headers,omitzero"` + // Name to identify your application in Datadog LLM Observability + MlApp string `json:"mlApp"` + // Datadog API URL for your region (e.g., https://api.datadoghq.com, https://api.us3.datadoghq.com, https://api.datadoghq.eu) + URL *string `default:"https://api.us5.datadoghq.com" json:"url"` +} + +func (o ObservabilityDatadogDestinationConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityDatadogDestinationConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityDatadogDestinationConfig) GetAPIKey() string { + if o == nil { + return "" + } + return o.APIKey +} + +func (o *ObservabilityDatadogDestinationConfig) GetHeaders() map[string]string { + if o == nil { + return nil + } + return o.Headers +} + +func (o *ObservabilityDatadogDestinationConfig) GetMlApp() string { + if o == nil { + return "" + } + return o.MlApp +} + +func (o *ObservabilityDatadogDestinationConfig) GetURL() *string { + if o == nil { + return nil + } + return o.URL +} + +type ObservabilityDatadogDestinationType string + +const ( + ObservabilityDatadogDestinationTypeDatadog ObservabilityDatadogDestinationType = "datadog" +) + +func (e ObservabilityDatadogDestinationType) ToPointer() *ObservabilityDatadogDestinationType { + return &e +} +func (e *ObservabilityDatadogDestinationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "datadog": + *e = ObservabilityDatadogDestinationType(v) + return nil + default: + return fmt.Errorf("invalid value for ObservabilityDatadogDestinationType: %v", v) + } +} + +type ObservabilityDatadogDestination struct { + // Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + APIKeyHashes []string `json:"api_key_hashes"` + Config ObservabilityDatadogDestinationConfig `json:"config"` + // ISO timestamp of when the destination was created. + CreatedAt string `json:"created_at"` + // Whether this destination is currently enabled. + Enabled bool `json:"enabled"` + // Optional structured filter rules controlling which events are forwarded. + FilterRules *ObservabilityFilterRulesConfig `json:"filter_rules"` + // Stable public identifier for this destination. + ID string `json:"id"` + // Human-readable name for the destination. + Name *string `json:"name"` + // When true, request/response bodies are not forwarded to this destination — only metadata. + PrivacyMode bool `json:"privacy_mode"` + // Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + SamplingRate float64 `json:"sampling_rate"` + Type ObservabilityDatadogDestinationType `json:"type"` + // ISO timestamp of when the destination was last updated. + UpdatedAt string `json:"updated_at"` + // ID of the workspace this destination belongs to. + WorkspaceID string `json:"workspace_id"` +} + +func (o ObservabilityDatadogDestination) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityDatadogDestination) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityDatadogDestination) GetAPIKeyHashes() []string { + if o == nil { + return nil + } + return o.APIKeyHashes +} + +func (o *ObservabilityDatadogDestination) GetConfig() ObservabilityDatadogDestinationConfig { + if o == nil { + return ObservabilityDatadogDestinationConfig{} + } + return o.Config +} + +func (o *ObservabilityDatadogDestination) GetCreatedAt() string { + if o == nil { + return "" + } + return o.CreatedAt +} + +func (o *ObservabilityDatadogDestination) GetEnabled() bool { + if o == nil { + return false + } + return o.Enabled +} + +func (o *ObservabilityDatadogDestination) GetFilterRules() *ObservabilityFilterRulesConfig { + if o == nil { + return nil + } + return o.FilterRules +} + +func (o *ObservabilityDatadogDestination) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *ObservabilityDatadogDestination) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *ObservabilityDatadogDestination) GetPrivacyMode() bool { + if o == nil { + return false + } + return o.PrivacyMode +} + +func (o *ObservabilityDatadogDestination) GetSamplingRate() float64 { + if o == nil { + return 0.0 + } + return o.SamplingRate +} + +func (o *ObservabilityDatadogDestination) GetType() ObservabilityDatadogDestinationType { + if o == nil { + return ObservabilityDatadogDestinationType("") + } + return o.Type +} + +func (o *ObservabilityDatadogDestination) GetUpdatedAt() string { + if o == nil { + return "" + } + return o.UpdatedAt +} + +func (o *ObservabilityDatadogDestination) GetWorkspaceID() string { + if o == nil { + return "" + } + return o.WorkspaceID +} diff --git a/models/components/observabilitydestination.go b/models/components/observabilitydestination.go new file mode 100644 index 00000000..f3e9e135 --- /dev/null +++ b/models/components/observabilitydestination.go @@ -0,0 +1,530 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "errors" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ObservabilityDestinationType string + +const ( + ObservabilityDestinationTypeArize ObservabilityDestinationType = "arize" + ObservabilityDestinationTypeBraintrust ObservabilityDestinationType = "braintrust" + ObservabilityDestinationTypeClickhouse ObservabilityDestinationType = "clickhouse" + ObservabilityDestinationTypeDatadog ObservabilityDestinationType = "datadog" + ObservabilityDestinationTypeGrafana ObservabilityDestinationType = "grafana" + ObservabilityDestinationTypeLangfuse ObservabilityDestinationType = "langfuse" + ObservabilityDestinationTypeLangsmith ObservabilityDestinationType = "langsmith" + ObservabilityDestinationTypeNewrelic ObservabilityDestinationType = "newrelic" + ObservabilityDestinationTypeOpik ObservabilityDestinationType = "opik" + ObservabilityDestinationTypeOtelCollector ObservabilityDestinationType = "otel-collector" + ObservabilityDestinationTypePosthog ObservabilityDestinationType = "posthog" + ObservabilityDestinationTypeRamp ObservabilityDestinationType = "ramp" + ObservabilityDestinationTypeS3 ObservabilityDestinationType = "s3" + ObservabilityDestinationTypeSentry ObservabilityDestinationType = "sentry" + ObservabilityDestinationTypeSnowflake ObservabilityDestinationType = "snowflake" + ObservabilityDestinationTypeWeave ObservabilityDestinationType = "weave" + ObservabilityDestinationTypeWebhook ObservabilityDestinationType = "webhook" + ObservabilityDestinationTypeUnknown ObservabilityDestinationType = "UNKNOWN" +) + +type ObservabilityDestination struct { + ObservabilityArizeDestination *ObservabilityArizeDestination `queryParam:"inline" union:"member"` + ObservabilityBraintrustDestination *ObservabilityBraintrustDestination `queryParam:"inline" union:"member"` + ObservabilityClickhouseDestination *ObservabilityClickhouseDestination `queryParam:"inline" union:"member"` + ObservabilityDatadogDestination *ObservabilityDatadogDestination `queryParam:"inline" union:"member"` + ObservabilityGrafanaDestination *ObservabilityGrafanaDestination `queryParam:"inline" union:"member"` + ObservabilityLangfuseDestination *ObservabilityLangfuseDestination `queryParam:"inline" union:"member"` + ObservabilityLangsmithDestination *ObservabilityLangsmithDestination `queryParam:"inline" union:"member"` + ObservabilityNewrelicDestination *ObservabilityNewrelicDestination `queryParam:"inline" union:"member"` + ObservabilityOpikDestination *ObservabilityOpikDestination `queryParam:"inline" union:"member"` + ObservabilityOtelCollectorDestination *ObservabilityOtelCollectorDestination `queryParam:"inline" union:"member"` + ObservabilityPosthogDestination *ObservabilityPosthogDestination `queryParam:"inline" union:"member"` + ObservabilityRampDestination *ObservabilityRampDestination `queryParam:"inline" union:"member"` + ObservabilityS3Destination *ObservabilityS3Destination `queryParam:"inline" union:"member"` + ObservabilitySentryDestination *ObservabilitySentryDestination `queryParam:"inline" union:"member"` + ObservabilitySnowflakeDestination *ObservabilitySnowflakeDestination `queryParam:"inline" union:"member"` + ObservabilityWeaveDestination *ObservabilityWeaveDestination `queryParam:"inline" union:"member"` + ObservabilityWebhookDestination *ObservabilityWebhookDestination `queryParam:"inline" union:"member"` + UnknownRaw json.RawMessage `json:"-" union:"unknown"` + + Type ObservabilityDestinationType +} + +func CreateObservabilityDestinationArize(arize ObservabilityArizeDestination) ObservabilityDestination { + typ := ObservabilityDestinationTypeArize + + typStr := ObservabilityArizeDestinationType(typ) + arize.Type = typStr + + return ObservabilityDestination{ + ObservabilityArizeDestination: &arize, + Type: typ, + } +} + +func CreateObservabilityDestinationBraintrust(braintrust ObservabilityBraintrustDestination) ObservabilityDestination { + typ := ObservabilityDestinationTypeBraintrust + + typStr := ObservabilityBraintrustDestinationType(typ) + braintrust.Type = typStr + + return ObservabilityDestination{ + ObservabilityBraintrustDestination: &braintrust, + Type: typ, + } +} + +func CreateObservabilityDestinationClickhouse(clickhouse ObservabilityClickhouseDestination) ObservabilityDestination { + typ := ObservabilityDestinationTypeClickhouse + + typStr := ObservabilityClickhouseDestinationType(typ) + clickhouse.Type = typStr + + return ObservabilityDestination{ + ObservabilityClickhouseDestination: &clickhouse, + Type: typ, + } +} + +func CreateObservabilityDestinationDatadog(datadog ObservabilityDatadogDestination) ObservabilityDestination { + typ := ObservabilityDestinationTypeDatadog + + typStr := ObservabilityDatadogDestinationType(typ) + datadog.Type = typStr + + return ObservabilityDestination{ + ObservabilityDatadogDestination: &datadog, + Type: typ, + } +} + +func CreateObservabilityDestinationGrafana(grafana ObservabilityGrafanaDestination) ObservabilityDestination { + typ := ObservabilityDestinationTypeGrafana + + typStr := ObservabilityGrafanaDestinationType(typ) + grafana.Type = typStr + + return ObservabilityDestination{ + ObservabilityGrafanaDestination: &grafana, + Type: typ, + } +} + +func CreateObservabilityDestinationLangfuse(langfuse ObservabilityLangfuseDestination) ObservabilityDestination { + typ := ObservabilityDestinationTypeLangfuse + + typStr := ObservabilityLangfuseDestinationType(typ) + langfuse.Type = typStr + + return ObservabilityDestination{ + ObservabilityLangfuseDestination: &langfuse, + Type: typ, + } +} + +func CreateObservabilityDestinationLangsmith(langsmith ObservabilityLangsmithDestination) ObservabilityDestination { + typ := ObservabilityDestinationTypeLangsmith + + typStr := ObservabilityLangsmithDestinationType(typ) + langsmith.Type = typStr + + return ObservabilityDestination{ + ObservabilityLangsmithDestination: &langsmith, + Type: typ, + } +} + +func CreateObservabilityDestinationNewrelic(newrelic ObservabilityNewrelicDestination) ObservabilityDestination { + typ := ObservabilityDestinationTypeNewrelic + + typStr := ObservabilityNewrelicDestinationType(typ) + newrelic.Type = typStr + + return ObservabilityDestination{ + ObservabilityNewrelicDestination: &newrelic, + Type: typ, + } +} + +func CreateObservabilityDestinationOpik(opik ObservabilityOpikDestination) ObservabilityDestination { + typ := ObservabilityDestinationTypeOpik + + typStr := ObservabilityOpikDestinationType(typ) + opik.Type = typStr + + return ObservabilityDestination{ + ObservabilityOpikDestination: &opik, + Type: typ, + } +} + +func CreateObservabilityDestinationOtelCollector(otelCollector ObservabilityOtelCollectorDestination) ObservabilityDestination { + typ := ObservabilityDestinationTypeOtelCollector + + typStr := ObservabilityOtelCollectorDestinationType(typ) + otelCollector.Type = typStr + + return ObservabilityDestination{ + ObservabilityOtelCollectorDestination: &otelCollector, + Type: typ, + } +} + +func CreateObservabilityDestinationPosthog(posthog ObservabilityPosthogDestination) ObservabilityDestination { + typ := ObservabilityDestinationTypePosthog + + typStr := ObservabilityPosthogDestinationType(typ) + posthog.Type = typStr + + return ObservabilityDestination{ + ObservabilityPosthogDestination: &posthog, + Type: typ, + } +} + +func CreateObservabilityDestinationRamp(ramp ObservabilityRampDestination) ObservabilityDestination { + typ := ObservabilityDestinationTypeRamp + + typStr := ObservabilityRampDestinationType(typ) + ramp.Type = typStr + + return ObservabilityDestination{ + ObservabilityRampDestination: &ramp, + Type: typ, + } +} + +func CreateObservabilityDestinationS3(s3 ObservabilityS3Destination) ObservabilityDestination { + typ := ObservabilityDestinationTypeS3 + + typStr := ObservabilityS3DestinationType(typ) + s3.Type = typStr + + return ObservabilityDestination{ + ObservabilityS3Destination: &s3, + Type: typ, + } +} + +func CreateObservabilityDestinationSentry(sentry ObservabilitySentryDestination) ObservabilityDestination { + typ := ObservabilityDestinationTypeSentry + + typStr := ObservabilitySentryDestinationType(typ) + sentry.Type = typStr + + return ObservabilityDestination{ + ObservabilitySentryDestination: &sentry, + Type: typ, + } +} + +func CreateObservabilityDestinationSnowflake(snowflake ObservabilitySnowflakeDestination) ObservabilityDestination { + typ := ObservabilityDestinationTypeSnowflake + + typStr := ObservabilitySnowflakeDestinationType(typ) + snowflake.Type = typStr + + return ObservabilityDestination{ + ObservabilitySnowflakeDestination: &snowflake, + Type: typ, + } +} + +func CreateObservabilityDestinationWeave(weave ObservabilityWeaveDestination) ObservabilityDestination { + typ := ObservabilityDestinationTypeWeave + + typStr := ObservabilityWeaveDestinationType(typ) + weave.Type = typStr + + return ObservabilityDestination{ + ObservabilityWeaveDestination: &weave, + Type: typ, + } +} + +func CreateObservabilityDestinationWebhook(webhook ObservabilityWebhookDestination) ObservabilityDestination { + typ := ObservabilityDestinationTypeWebhook + + typStr := ObservabilityWebhookDestinationType(typ) + webhook.Type = typStr + + return ObservabilityDestination{ + ObservabilityWebhookDestination: &webhook, + Type: typ, + } +} + +func CreateObservabilityDestinationUnknown(raw json.RawMessage) ObservabilityDestination { + return ObservabilityDestination{ + UnknownRaw: raw, + Type: ObservabilityDestinationTypeUnknown, + } +} + +func (u ObservabilityDestination) GetUnknownRaw() json.RawMessage { + return u.UnknownRaw +} + +func (u ObservabilityDestination) IsUnknown() bool { + return u.Type == ObservabilityDestinationTypeUnknown +} + +func (u *ObservabilityDestination) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + u.UnknownRaw = json.RawMessage(data) + u.Type = ObservabilityDestinationTypeUnknown + return nil + } + if dis == nil { + u.UnknownRaw = json.RawMessage(data) + u.Type = ObservabilityDestinationTypeUnknown + return nil + } + + switch dis.Type { + case "arize": + observabilityArizeDestination := new(ObservabilityArizeDestination) + if err := utils.UnmarshalJSON(data, &observabilityArizeDestination, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == arize) type ObservabilityArizeDestination within ObservabilityDestination: %w", string(data), err) + } + + u.ObservabilityArizeDestination = observabilityArizeDestination + u.Type = ObservabilityDestinationTypeArize + return nil + case "braintrust": + observabilityBraintrustDestination := new(ObservabilityBraintrustDestination) + if err := utils.UnmarshalJSON(data, &observabilityBraintrustDestination, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == braintrust) type ObservabilityBraintrustDestination within ObservabilityDestination: %w", string(data), err) + } + + u.ObservabilityBraintrustDestination = observabilityBraintrustDestination + u.Type = ObservabilityDestinationTypeBraintrust + return nil + case "clickhouse": + observabilityClickhouseDestination := new(ObservabilityClickhouseDestination) + if err := utils.UnmarshalJSON(data, &observabilityClickhouseDestination, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == clickhouse) type ObservabilityClickhouseDestination within ObservabilityDestination: %w", string(data), err) + } + + u.ObservabilityClickhouseDestination = observabilityClickhouseDestination + u.Type = ObservabilityDestinationTypeClickhouse + return nil + case "datadog": + observabilityDatadogDestination := new(ObservabilityDatadogDestination) + if err := utils.UnmarshalJSON(data, &observabilityDatadogDestination, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == datadog) type ObservabilityDatadogDestination within ObservabilityDestination: %w", string(data), err) + } + + u.ObservabilityDatadogDestination = observabilityDatadogDestination + u.Type = ObservabilityDestinationTypeDatadog + return nil + case "grafana": + observabilityGrafanaDestination := new(ObservabilityGrafanaDestination) + if err := utils.UnmarshalJSON(data, &observabilityGrafanaDestination, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == grafana) type ObservabilityGrafanaDestination within ObservabilityDestination: %w", string(data), err) + } + + u.ObservabilityGrafanaDestination = observabilityGrafanaDestination + u.Type = ObservabilityDestinationTypeGrafana + return nil + case "langfuse": + observabilityLangfuseDestination := new(ObservabilityLangfuseDestination) + if err := utils.UnmarshalJSON(data, &observabilityLangfuseDestination, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == langfuse) type ObservabilityLangfuseDestination within ObservabilityDestination: %w", string(data), err) + } + + u.ObservabilityLangfuseDestination = observabilityLangfuseDestination + u.Type = ObservabilityDestinationTypeLangfuse + return nil + case "langsmith": + observabilityLangsmithDestination := new(ObservabilityLangsmithDestination) + if err := utils.UnmarshalJSON(data, &observabilityLangsmithDestination, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == langsmith) type ObservabilityLangsmithDestination within ObservabilityDestination: %w", string(data), err) + } + + u.ObservabilityLangsmithDestination = observabilityLangsmithDestination + u.Type = ObservabilityDestinationTypeLangsmith + return nil + case "newrelic": + observabilityNewrelicDestination := new(ObservabilityNewrelicDestination) + if err := utils.UnmarshalJSON(data, &observabilityNewrelicDestination, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == newrelic) type ObservabilityNewrelicDestination within ObservabilityDestination: %w", string(data), err) + } + + u.ObservabilityNewrelicDestination = observabilityNewrelicDestination + u.Type = ObservabilityDestinationTypeNewrelic + return nil + case "opik": + observabilityOpikDestination := new(ObservabilityOpikDestination) + if err := utils.UnmarshalJSON(data, &observabilityOpikDestination, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == opik) type ObservabilityOpikDestination within ObservabilityDestination: %w", string(data), err) + } + + u.ObservabilityOpikDestination = observabilityOpikDestination + u.Type = ObservabilityDestinationTypeOpik + return nil + case "otel-collector": + observabilityOtelCollectorDestination := new(ObservabilityOtelCollectorDestination) + if err := utils.UnmarshalJSON(data, &observabilityOtelCollectorDestination, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == otel-collector) type ObservabilityOtelCollectorDestination within ObservabilityDestination: %w", string(data), err) + } + + u.ObservabilityOtelCollectorDestination = observabilityOtelCollectorDestination + u.Type = ObservabilityDestinationTypeOtelCollector + return nil + case "posthog": + observabilityPosthogDestination := new(ObservabilityPosthogDestination) + if err := utils.UnmarshalJSON(data, &observabilityPosthogDestination, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == posthog) type ObservabilityPosthogDestination within ObservabilityDestination: %w", string(data), err) + } + + u.ObservabilityPosthogDestination = observabilityPosthogDestination + u.Type = ObservabilityDestinationTypePosthog + return nil + case "ramp": + observabilityRampDestination := new(ObservabilityRampDestination) + if err := utils.UnmarshalJSON(data, &observabilityRampDestination, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == ramp) type ObservabilityRampDestination within ObservabilityDestination: %w", string(data), err) + } + + u.ObservabilityRampDestination = observabilityRampDestination + u.Type = ObservabilityDestinationTypeRamp + return nil + case "s3": + observabilityS3Destination := new(ObservabilityS3Destination) + if err := utils.UnmarshalJSON(data, &observabilityS3Destination, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == s3) type ObservabilityS3Destination within ObservabilityDestination: %w", string(data), err) + } + + u.ObservabilityS3Destination = observabilityS3Destination + u.Type = ObservabilityDestinationTypeS3 + return nil + case "sentry": + observabilitySentryDestination := new(ObservabilitySentryDestination) + if err := utils.UnmarshalJSON(data, &observabilitySentryDestination, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == sentry) type ObservabilitySentryDestination within ObservabilityDestination: %w", string(data), err) + } + + u.ObservabilitySentryDestination = observabilitySentryDestination + u.Type = ObservabilityDestinationTypeSentry + return nil + case "snowflake": + observabilitySnowflakeDestination := new(ObservabilitySnowflakeDestination) + if err := utils.UnmarshalJSON(data, &observabilitySnowflakeDestination, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == snowflake) type ObservabilitySnowflakeDestination within ObservabilityDestination: %w", string(data), err) + } + + u.ObservabilitySnowflakeDestination = observabilitySnowflakeDestination + u.Type = ObservabilityDestinationTypeSnowflake + return nil + case "weave": + observabilityWeaveDestination := new(ObservabilityWeaveDestination) + if err := utils.UnmarshalJSON(data, &observabilityWeaveDestination, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == weave) type ObservabilityWeaveDestination within ObservabilityDestination: %w", string(data), err) + } + + u.ObservabilityWeaveDestination = observabilityWeaveDestination + u.Type = ObservabilityDestinationTypeWeave + return nil + case "webhook": + observabilityWebhookDestination := new(ObservabilityWebhookDestination) + if err := utils.UnmarshalJSON(data, &observabilityWebhookDestination, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == webhook) type ObservabilityWebhookDestination within ObservabilityDestination: %w", string(data), err) + } + + u.ObservabilityWebhookDestination = observabilityWebhookDestination + u.Type = ObservabilityDestinationTypeWebhook + return nil + default: + u.UnknownRaw = json.RawMessage(data) + u.Type = ObservabilityDestinationTypeUnknown + return nil + } + +} + +func (u ObservabilityDestination) MarshalJSON() ([]byte, error) { + if u.ObservabilityArizeDestination != nil { + return utils.MarshalJSON(u.ObservabilityArizeDestination, "", true) + } + + if u.ObservabilityBraintrustDestination != nil { + return utils.MarshalJSON(u.ObservabilityBraintrustDestination, "", true) + } + + if u.ObservabilityClickhouseDestination != nil { + return utils.MarshalJSON(u.ObservabilityClickhouseDestination, "", true) + } + + if u.ObservabilityDatadogDestination != nil { + return utils.MarshalJSON(u.ObservabilityDatadogDestination, "", true) + } + + if u.ObservabilityGrafanaDestination != nil { + return utils.MarshalJSON(u.ObservabilityGrafanaDestination, "", true) + } + + if u.ObservabilityLangfuseDestination != nil { + return utils.MarshalJSON(u.ObservabilityLangfuseDestination, "", true) + } + + if u.ObservabilityLangsmithDestination != nil { + return utils.MarshalJSON(u.ObservabilityLangsmithDestination, "", true) + } + + if u.ObservabilityNewrelicDestination != nil { + return utils.MarshalJSON(u.ObservabilityNewrelicDestination, "", true) + } + + if u.ObservabilityOpikDestination != nil { + return utils.MarshalJSON(u.ObservabilityOpikDestination, "", true) + } + + if u.ObservabilityOtelCollectorDestination != nil { + return utils.MarshalJSON(u.ObservabilityOtelCollectorDestination, "", true) + } + + if u.ObservabilityPosthogDestination != nil { + return utils.MarshalJSON(u.ObservabilityPosthogDestination, "", true) + } + + if u.ObservabilityRampDestination != nil { + return utils.MarshalJSON(u.ObservabilityRampDestination, "", true) + } + + if u.ObservabilityS3Destination != nil { + return utils.MarshalJSON(u.ObservabilityS3Destination, "", true) + } + + if u.ObservabilitySentryDestination != nil { + return utils.MarshalJSON(u.ObservabilitySentryDestination, "", true) + } + + if u.ObservabilitySnowflakeDestination != nil { + return utils.MarshalJSON(u.ObservabilitySnowflakeDestination, "", true) + } + + if u.ObservabilityWeaveDestination != nil { + return utils.MarshalJSON(u.ObservabilityWeaveDestination, "", true) + } + + if u.ObservabilityWebhookDestination != nil { + return utils.MarshalJSON(u.ObservabilityWebhookDestination, "", true) + } + + if u.UnknownRaw != nil { + return json.RawMessage(u.UnknownRaw), nil + } + return nil, errors.New("could not marshal union type ObservabilityDestination: all fields are null") +} diff --git a/models/components/observabilityfilterrulesconfig.go b/models/components/observabilityfilterrulesconfig.go new file mode 100644 index 00000000..05414294 --- /dev/null +++ b/models/components/observabilityfilterrulesconfig.go @@ -0,0 +1,284 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "errors" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type Logic string + +const ( + LogicAnd Logic = "and" + LogicOr Logic = "or" +) + +func (e Logic) ToPointer() *Logic { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Logic) IsExact() bool { + if e != nil { + switch *e { + case "and", "or": + return true + } + } + return false +} + +type Field string + +const ( + FieldModel Field = "model" + FieldProvider Field = "provider" + FieldSessionID Field = "session_id" + FieldUserID Field = "user_id" + FieldAPIKeyName Field = "api_key_name" + FieldFinishReason Field = "finish_reason" + FieldInput Field = "input" + FieldOutput Field = "output" + FieldTotalCost Field = "total_cost" + FieldTotalTokens Field = "total_tokens" + FieldPromptTokens Field = "prompt_tokens" + FieldCompletionTokens Field = "completion_tokens" +) + +func (e Field) ToPointer() *Field { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Field) IsExact() bool { + if e != nil { + switch *e { + case "model", "provider", "session_id", "user_id", "api_key_name", "finish_reason", "input", "output", "total_cost", "total_tokens", "prompt_tokens", "completion_tokens": + return true + } + } + return false +} + +type Operator string + +const ( + OperatorEquals Operator = "equals" + OperatorNotEquals Operator = "not_equals" + OperatorContains Operator = "contains" + OperatorNotContains Operator = "not_contains" + OperatorRegex Operator = "regex" + OperatorStartsWith Operator = "starts_with" + OperatorEndsWith Operator = "ends_with" + OperatorGt Operator = "gt" + OperatorLt Operator = "lt" + OperatorGte Operator = "gte" + OperatorLte Operator = "lte" + OperatorExists Operator = "exists" + OperatorNotExists Operator = "not_exists" +) + +func (e Operator) ToPointer() *Operator { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Operator) IsExact() bool { + if e != nil { + switch *e { + case "equals", "not_equals", "contains", "not_contains", "regex", "starts_with", "ends_with", "gt", "lt", "gte", "lte", "exists", "not_exists": + return true + } + } + return false +} + +type ObservabilityFilterRulesConfigValueType string + +const ( + ObservabilityFilterRulesConfigValueTypeStr ObservabilityFilterRulesConfigValueType = "str" + ObservabilityFilterRulesConfigValueTypeNumber ObservabilityFilterRulesConfigValueType = "number" +) + +type ObservabilityFilterRulesConfigValue struct { + Str *string `queryParam:"inline" union:"member"` + Number *float64 `queryParam:"inline" union:"member"` + + Type ObservabilityFilterRulesConfigValueType +} + +func CreateObservabilityFilterRulesConfigValueStr(str string) ObservabilityFilterRulesConfigValue { + typ := ObservabilityFilterRulesConfigValueTypeStr + + return ObservabilityFilterRulesConfigValue{ + Str: &str, + Type: typ, + } +} + +func CreateObservabilityFilterRulesConfigValueNumber(number float64) ObservabilityFilterRulesConfigValue { + typ := ObservabilityFilterRulesConfigValueTypeNumber + + return ObservabilityFilterRulesConfigValue{ + Number: &number, + Type: typ, + } +} + +func (u *ObservabilityFilterRulesConfigValue) UnmarshalJSON(data []byte) error { + + var candidates []utils.UnionCandidate + + // Collect all valid candidates + var str string = "" + if err := utils.UnmarshalJSON(data, &str, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: ObservabilityFilterRulesConfigValueTypeStr, + Value: &str, + }) + } + + var number float64 = float64(0) + if err := utils.UnmarshalJSON(data, &number, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: ObservabilityFilterRulesConfigValueTypeNumber, + Value: &number, + }) + } + + if len(candidates) == 0 { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for ObservabilityFilterRulesConfigValue", string(data)) + } + + // Pick the best candidate using multi-stage filtering + best := utils.PickBestUnionCandidate(candidates, data) + if best == nil { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for ObservabilityFilterRulesConfigValue", string(data)) + } + + // Set the union type and value based on the best candidate + u.Type = best.Type.(ObservabilityFilterRulesConfigValueType) + switch best.Type { + case ObservabilityFilterRulesConfigValueTypeStr: + u.Str = best.Value.(*string) + return nil + case ObservabilityFilterRulesConfigValueTypeNumber: + u.Number = best.Value.(*float64) + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for ObservabilityFilterRulesConfigValue", string(data)) +} + +func (u ObservabilityFilterRulesConfigValue) MarshalJSON() ([]byte, error) { + if u.Str != nil { + return utils.MarshalJSON(u.Str, "", true) + } + + if u.Number != nil { + return utils.MarshalJSON(u.Number, "", true) + } + + return nil, errors.New("could not marshal union type ObservabilityFilterRulesConfigValue: all fields are null") +} + +type Rule struct { + Field Field `json:"field"` + Operator Operator `json:"operator"` + Value *ObservabilityFilterRulesConfigValue `json:"value,omitzero"` +} + +func (r Rule) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *Rule) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *Rule) GetField() Field { + if r == nil { + return Field("") + } + return r.Field +} + +func (r *Rule) GetOperator() Operator { + if r == nil { + return Operator("") + } + return r.Operator +} + +func (r *Rule) GetValue() *ObservabilityFilterRulesConfigValue { + if r == nil { + return nil + } + return r.Value +} + +type Group struct { + Logic *Logic `default:"and" json:"logic"` + Rules []Rule `json:"rules"` +} + +func (g Group) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *Group) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *Group) GetLogic() *Logic { + if g == nil { + return nil + } + return g.Logic +} + +func (g *Group) GetRules() []Rule { + if g == nil { + return []Rule{} + } + return g.Rules +} + +// ObservabilityFilterRulesConfig - Optional structured filter rules controlling which events are forwarded. +type ObservabilityFilterRulesConfig struct { + Enabled *bool `default:"true" json:"enabled"` + Groups []Group `json:"groups"` +} + +func (o ObservabilityFilterRulesConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityFilterRulesConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityFilterRulesConfig) GetEnabled() *bool { + if o == nil { + return nil + } + return o.Enabled +} + +func (o *ObservabilityFilterRulesConfig) GetGroups() []Group { + if o == nil { + return []Group{} + } + return o.Groups +} diff --git a/models/components/observabilitygrafanadestination.go b/models/components/observabilitygrafanadestination.go new file mode 100644 index 00000000..27199483 --- /dev/null +++ b/models/components/observabilitygrafanadestination.go @@ -0,0 +1,199 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ObservabilityGrafanaDestinationConfig struct { + APIKey string `json:"apiKey"` + BaseURL *string `default:"https://otlp-gateway-prod-us-west-0.grafana.net" json:"baseUrl"` + // Custom HTTP headers to include in requests to this destination. + Headers map[string]string `json:"headers,omitzero"` + InstanceID string `json:"instanceId"` +} + +func (o ObservabilityGrafanaDestinationConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityGrafanaDestinationConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityGrafanaDestinationConfig) GetAPIKey() string { + if o == nil { + return "" + } + return o.APIKey +} + +func (o *ObservabilityGrafanaDestinationConfig) GetBaseURL() *string { + if o == nil { + return nil + } + return o.BaseURL +} + +func (o *ObservabilityGrafanaDestinationConfig) GetHeaders() map[string]string { + if o == nil { + return nil + } + return o.Headers +} + +func (o *ObservabilityGrafanaDestinationConfig) GetInstanceID() string { + if o == nil { + return "" + } + return o.InstanceID +} + +type ObservabilityGrafanaDestinationType string + +const ( + ObservabilityGrafanaDestinationTypeGrafana ObservabilityGrafanaDestinationType = "grafana" +) + +func (e ObservabilityGrafanaDestinationType) ToPointer() *ObservabilityGrafanaDestinationType { + return &e +} +func (e *ObservabilityGrafanaDestinationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "grafana": + *e = ObservabilityGrafanaDestinationType(v) + return nil + default: + return fmt.Errorf("invalid value for ObservabilityGrafanaDestinationType: %v", v) + } +} + +type ObservabilityGrafanaDestination struct { + // Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + APIKeyHashes []string `json:"api_key_hashes"` + Config ObservabilityGrafanaDestinationConfig `json:"config"` + // ISO timestamp of when the destination was created. + CreatedAt string `json:"created_at"` + // Whether this destination is currently enabled. + Enabled bool `json:"enabled"` + // Optional structured filter rules controlling which events are forwarded. + FilterRules *ObservabilityFilterRulesConfig `json:"filter_rules"` + // Stable public identifier for this destination. + ID string `json:"id"` + // Human-readable name for the destination. + Name *string `json:"name"` + // When true, request/response bodies are not forwarded to this destination — only metadata. + PrivacyMode bool `json:"privacy_mode"` + // Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + SamplingRate float64 `json:"sampling_rate"` + Type ObservabilityGrafanaDestinationType `json:"type"` + // ISO timestamp of when the destination was last updated. + UpdatedAt string `json:"updated_at"` + // ID of the workspace this destination belongs to. + WorkspaceID string `json:"workspace_id"` +} + +func (o ObservabilityGrafanaDestination) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityGrafanaDestination) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityGrafanaDestination) GetAPIKeyHashes() []string { + if o == nil { + return nil + } + return o.APIKeyHashes +} + +func (o *ObservabilityGrafanaDestination) GetConfig() ObservabilityGrafanaDestinationConfig { + if o == nil { + return ObservabilityGrafanaDestinationConfig{} + } + return o.Config +} + +func (o *ObservabilityGrafanaDestination) GetCreatedAt() string { + if o == nil { + return "" + } + return o.CreatedAt +} + +func (o *ObservabilityGrafanaDestination) GetEnabled() bool { + if o == nil { + return false + } + return o.Enabled +} + +func (o *ObservabilityGrafanaDestination) GetFilterRules() *ObservabilityFilterRulesConfig { + if o == nil { + return nil + } + return o.FilterRules +} + +func (o *ObservabilityGrafanaDestination) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *ObservabilityGrafanaDestination) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *ObservabilityGrafanaDestination) GetPrivacyMode() bool { + if o == nil { + return false + } + return o.PrivacyMode +} + +func (o *ObservabilityGrafanaDestination) GetSamplingRate() float64 { + if o == nil { + return 0.0 + } + return o.SamplingRate +} + +func (o *ObservabilityGrafanaDestination) GetType() ObservabilityGrafanaDestinationType { + if o == nil { + return ObservabilityGrafanaDestinationType("") + } + return o.Type +} + +func (o *ObservabilityGrafanaDestination) GetUpdatedAt() string { + if o == nil { + return "" + } + return o.UpdatedAt +} + +func (o *ObservabilityGrafanaDestination) GetWorkspaceID() string { + if o == nil { + return "" + } + return o.WorkspaceID +} diff --git a/models/components/observabilitylangfusedestination.go b/models/components/observabilitylangfusedestination.go new file mode 100644 index 00000000..9cbf91a1 --- /dev/null +++ b/models/components/observabilitylangfusedestination.go @@ -0,0 +1,199 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ObservabilityLangfuseDestinationConfig struct { + BaseURL *string `default:"https://us.cloud.langfuse.com" json:"baseUrl"` + // Custom HTTP headers to include in requests to this destination. + Headers map[string]string `json:"headers,omitzero"` + PublicKey string `json:"publicKey"` + SecretKey string `json:"secretKey"` +} + +func (o ObservabilityLangfuseDestinationConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityLangfuseDestinationConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityLangfuseDestinationConfig) GetBaseURL() *string { + if o == nil { + return nil + } + return o.BaseURL +} + +func (o *ObservabilityLangfuseDestinationConfig) GetHeaders() map[string]string { + if o == nil { + return nil + } + return o.Headers +} + +func (o *ObservabilityLangfuseDestinationConfig) GetPublicKey() string { + if o == nil { + return "" + } + return o.PublicKey +} + +func (o *ObservabilityLangfuseDestinationConfig) GetSecretKey() string { + if o == nil { + return "" + } + return o.SecretKey +} + +type ObservabilityLangfuseDestinationType string + +const ( + ObservabilityLangfuseDestinationTypeLangfuse ObservabilityLangfuseDestinationType = "langfuse" +) + +func (e ObservabilityLangfuseDestinationType) ToPointer() *ObservabilityLangfuseDestinationType { + return &e +} +func (e *ObservabilityLangfuseDestinationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "langfuse": + *e = ObservabilityLangfuseDestinationType(v) + return nil + default: + return fmt.Errorf("invalid value for ObservabilityLangfuseDestinationType: %v", v) + } +} + +type ObservabilityLangfuseDestination struct { + // Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + APIKeyHashes []string `json:"api_key_hashes"` + Config ObservabilityLangfuseDestinationConfig `json:"config"` + // ISO timestamp of when the destination was created. + CreatedAt string `json:"created_at"` + // Whether this destination is currently enabled. + Enabled bool `json:"enabled"` + // Optional structured filter rules controlling which events are forwarded. + FilterRules *ObservabilityFilterRulesConfig `json:"filter_rules"` + // Stable public identifier for this destination. + ID string `json:"id"` + // Human-readable name for the destination. + Name *string `json:"name"` + // When true, request/response bodies are not forwarded to this destination — only metadata. + PrivacyMode bool `json:"privacy_mode"` + // Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + SamplingRate float64 `json:"sampling_rate"` + Type ObservabilityLangfuseDestinationType `json:"type"` + // ISO timestamp of when the destination was last updated. + UpdatedAt string `json:"updated_at"` + // ID of the workspace this destination belongs to. + WorkspaceID string `json:"workspace_id"` +} + +func (o ObservabilityLangfuseDestination) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityLangfuseDestination) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityLangfuseDestination) GetAPIKeyHashes() []string { + if o == nil { + return nil + } + return o.APIKeyHashes +} + +func (o *ObservabilityLangfuseDestination) GetConfig() ObservabilityLangfuseDestinationConfig { + if o == nil { + return ObservabilityLangfuseDestinationConfig{} + } + return o.Config +} + +func (o *ObservabilityLangfuseDestination) GetCreatedAt() string { + if o == nil { + return "" + } + return o.CreatedAt +} + +func (o *ObservabilityLangfuseDestination) GetEnabled() bool { + if o == nil { + return false + } + return o.Enabled +} + +func (o *ObservabilityLangfuseDestination) GetFilterRules() *ObservabilityFilterRulesConfig { + if o == nil { + return nil + } + return o.FilterRules +} + +func (o *ObservabilityLangfuseDestination) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *ObservabilityLangfuseDestination) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *ObservabilityLangfuseDestination) GetPrivacyMode() bool { + if o == nil { + return false + } + return o.PrivacyMode +} + +func (o *ObservabilityLangfuseDestination) GetSamplingRate() float64 { + if o == nil { + return 0.0 + } + return o.SamplingRate +} + +func (o *ObservabilityLangfuseDestination) GetType() ObservabilityLangfuseDestinationType { + if o == nil { + return ObservabilityLangfuseDestinationType("") + } + return o.Type +} + +func (o *ObservabilityLangfuseDestination) GetUpdatedAt() string { + if o == nil { + return "" + } + return o.UpdatedAt +} + +func (o *ObservabilityLangfuseDestination) GetWorkspaceID() string { + if o == nil { + return "" + } + return o.WorkspaceID +} diff --git a/models/components/observabilitylangsmithdestination.go b/models/components/observabilitylangsmithdestination.go new file mode 100644 index 00000000..410fc175 --- /dev/null +++ b/models/components/observabilitylangsmithdestination.go @@ -0,0 +1,209 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ObservabilityLangsmithDestinationConfig struct { + APIKey string `json:"apiKey"` + Endpoint *string `default:"https://api.smith.langchain.com" json:"endpoint"` + // Custom HTTP headers to include in requests to this destination. + Headers map[string]string `json:"headers,omitzero"` + // The name for this project, such as pr-openrouter-demo. Defaults to "main" if not set. + Project *string `default:"main" json:"project"` + // Required for org-scoped API keys. Find this in your LangSmith workspace settings. + WorkspaceID *string `json:"workspaceId,omitzero"` +} + +func (o ObservabilityLangsmithDestinationConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityLangsmithDestinationConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityLangsmithDestinationConfig) GetAPIKey() string { + if o == nil { + return "" + } + return o.APIKey +} + +func (o *ObservabilityLangsmithDestinationConfig) GetEndpoint() *string { + if o == nil { + return nil + } + return o.Endpoint +} + +func (o *ObservabilityLangsmithDestinationConfig) GetHeaders() map[string]string { + if o == nil { + return nil + } + return o.Headers +} + +func (o *ObservabilityLangsmithDestinationConfig) GetProject() *string { + if o == nil { + return nil + } + return o.Project +} + +func (o *ObservabilityLangsmithDestinationConfig) GetWorkspaceID() *string { + if o == nil { + return nil + } + return o.WorkspaceID +} + +type ObservabilityLangsmithDestinationType string + +const ( + ObservabilityLangsmithDestinationTypeLangsmith ObservabilityLangsmithDestinationType = "langsmith" +) + +func (e ObservabilityLangsmithDestinationType) ToPointer() *ObservabilityLangsmithDestinationType { + return &e +} +func (e *ObservabilityLangsmithDestinationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "langsmith": + *e = ObservabilityLangsmithDestinationType(v) + return nil + default: + return fmt.Errorf("invalid value for ObservabilityLangsmithDestinationType: %v", v) + } +} + +type ObservabilityLangsmithDestination struct { + // Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + APIKeyHashes []string `json:"api_key_hashes"` + Config ObservabilityLangsmithDestinationConfig `json:"config"` + // ISO timestamp of when the destination was created. + CreatedAt string `json:"created_at"` + // Whether this destination is currently enabled. + Enabled bool `json:"enabled"` + // Optional structured filter rules controlling which events are forwarded. + FilterRules *ObservabilityFilterRulesConfig `json:"filter_rules"` + // Stable public identifier for this destination. + ID string `json:"id"` + // Human-readable name for the destination. + Name *string `json:"name"` + // When true, request/response bodies are not forwarded to this destination — only metadata. + PrivacyMode bool `json:"privacy_mode"` + // Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + SamplingRate float64 `json:"sampling_rate"` + Type ObservabilityLangsmithDestinationType `json:"type"` + // ISO timestamp of when the destination was last updated. + UpdatedAt string `json:"updated_at"` + // ID of the workspace this destination belongs to. + WorkspaceID string `json:"workspace_id"` +} + +func (o ObservabilityLangsmithDestination) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityLangsmithDestination) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityLangsmithDestination) GetAPIKeyHashes() []string { + if o == nil { + return nil + } + return o.APIKeyHashes +} + +func (o *ObservabilityLangsmithDestination) GetConfig() ObservabilityLangsmithDestinationConfig { + if o == nil { + return ObservabilityLangsmithDestinationConfig{} + } + return o.Config +} + +func (o *ObservabilityLangsmithDestination) GetCreatedAt() string { + if o == nil { + return "" + } + return o.CreatedAt +} + +func (o *ObservabilityLangsmithDestination) GetEnabled() bool { + if o == nil { + return false + } + return o.Enabled +} + +func (o *ObservabilityLangsmithDestination) GetFilterRules() *ObservabilityFilterRulesConfig { + if o == nil { + return nil + } + return o.FilterRules +} + +func (o *ObservabilityLangsmithDestination) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *ObservabilityLangsmithDestination) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *ObservabilityLangsmithDestination) GetPrivacyMode() bool { + if o == nil { + return false + } + return o.PrivacyMode +} + +func (o *ObservabilityLangsmithDestination) GetSamplingRate() float64 { + if o == nil { + return 0.0 + } + return o.SamplingRate +} + +func (o *ObservabilityLangsmithDestination) GetType() ObservabilityLangsmithDestinationType { + if o == nil { + return ObservabilityLangsmithDestinationType("") + } + return o.Type +} + +func (o *ObservabilityLangsmithDestination) GetUpdatedAt() string { + if o == nil { + return "" + } + return o.UpdatedAt +} + +func (o *ObservabilityLangsmithDestination) GetWorkspaceID() string { + if o == nil { + return "" + } + return o.WorkspaceID +} diff --git a/models/components/observabilitynewrelicdestination.go b/models/components/observabilitynewrelicdestination.go new file mode 100644 index 00000000..cea29f60 --- /dev/null +++ b/models/components/observabilitynewrelicdestination.go @@ -0,0 +1,213 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type Region string + +const ( + RegionUs Region = "us" + RegionEu Region = "eu" +) + +func (e Region) ToPointer() *Region { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Region) IsExact() bool { + if e != nil { + switch *e { + case "us", "eu": + return true + } + } + return false +} + +type ObservabilityNewrelicDestinationConfig struct { + // Custom HTTP headers to include in requests to this destination. + Headers map[string]string `json:"headers,omitzero"` + LicenseKey string `json:"licenseKey"` + Region *Region `default:"us" json:"region"` +} + +func (o ObservabilityNewrelicDestinationConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityNewrelicDestinationConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityNewrelicDestinationConfig) GetHeaders() map[string]string { + if o == nil { + return nil + } + return o.Headers +} + +func (o *ObservabilityNewrelicDestinationConfig) GetLicenseKey() string { + if o == nil { + return "" + } + return o.LicenseKey +} + +func (o *ObservabilityNewrelicDestinationConfig) GetRegion() *Region { + if o == nil { + return nil + } + return o.Region +} + +type ObservabilityNewrelicDestinationType string + +const ( + ObservabilityNewrelicDestinationTypeNewrelic ObservabilityNewrelicDestinationType = "newrelic" +) + +func (e ObservabilityNewrelicDestinationType) ToPointer() *ObservabilityNewrelicDestinationType { + return &e +} +func (e *ObservabilityNewrelicDestinationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "newrelic": + *e = ObservabilityNewrelicDestinationType(v) + return nil + default: + return fmt.Errorf("invalid value for ObservabilityNewrelicDestinationType: %v", v) + } +} + +type ObservabilityNewrelicDestination struct { + // Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + APIKeyHashes []string `json:"api_key_hashes"` + Config ObservabilityNewrelicDestinationConfig `json:"config"` + // ISO timestamp of when the destination was created. + CreatedAt string `json:"created_at"` + // Whether this destination is currently enabled. + Enabled bool `json:"enabled"` + // Optional structured filter rules controlling which events are forwarded. + FilterRules *ObservabilityFilterRulesConfig `json:"filter_rules"` + // Stable public identifier for this destination. + ID string `json:"id"` + // Human-readable name for the destination. + Name *string `json:"name"` + // When true, request/response bodies are not forwarded to this destination — only metadata. + PrivacyMode bool `json:"privacy_mode"` + // Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + SamplingRate float64 `json:"sampling_rate"` + Type ObservabilityNewrelicDestinationType `json:"type"` + // ISO timestamp of when the destination was last updated. + UpdatedAt string `json:"updated_at"` + // ID of the workspace this destination belongs to. + WorkspaceID string `json:"workspace_id"` +} + +func (o ObservabilityNewrelicDestination) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityNewrelicDestination) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityNewrelicDestination) GetAPIKeyHashes() []string { + if o == nil { + return nil + } + return o.APIKeyHashes +} + +func (o *ObservabilityNewrelicDestination) GetConfig() ObservabilityNewrelicDestinationConfig { + if o == nil { + return ObservabilityNewrelicDestinationConfig{} + } + return o.Config +} + +func (o *ObservabilityNewrelicDestination) GetCreatedAt() string { + if o == nil { + return "" + } + return o.CreatedAt +} + +func (o *ObservabilityNewrelicDestination) GetEnabled() bool { + if o == nil { + return false + } + return o.Enabled +} + +func (o *ObservabilityNewrelicDestination) GetFilterRules() *ObservabilityFilterRulesConfig { + if o == nil { + return nil + } + return o.FilterRules +} + +func (o *ObservabilityNewrelicDestination) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *ObservabilityNewrelicDestination) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *ObservabilityNewrelicDestination) GetPrivacyMode() bool { + if o == nil { + return false + } + return o.PrivacyMode +} + +func (o *ObservabilityNewrelicDestination) GetSamplingRate() float64 { + if o == nil { + return 0.0 + } + return o.SamplingRate +} + +func (o *ObservabilityNewrelicDestination) GetType() ObservabilityNewrelicDestinationType { + if o == nil { + return ObservabilityNewrelicDestinationType("") + } + return o.Type +} + +func (o *ObservabilityNewrelicDestination) GetUpdatedAt() string { + if o == nil { + return "" + } + return o.UpdatedAt +} + +func (o *ObservabilityNewrelicDestination) GetWorkspaceID() string { + if o == nil { + return "" + } + return o.WorkspaceID +} diff --git a/models/components/observabilityopikdestination.go b/models/components/observabilityopikdestination.go new file mode 100644 index 00000000..58ba3950 --- /dev/null +++ b/models/components/observabilityopikdestination.go @@ -0,0 +1,199 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ObservabilityOpikDestinationConfig struct { + APIKey string `json:"apiKey"` + // Custom HTTP headers to include in requests to this destination. + Headers map[string]string `json:"headers,omitzero"` + ProjectName string `json:"projectName"` + Workspace string `json:"workspace"` +} + +func (o ObservabilityOpikDestinationConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityOpikDestinationConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityOpikDestinationConfig) GetAPIKey() string { + if o == nil { + return "" + } + return o.APIKey +} + +func (o *ObservabilityOpikDestinationConfig) GetHeaders() map[string]string { + if o == nil { + return nil + } + return o.Headers +} + +func (o *ObservabilityOpikDestinationConfig) GetProjectName() string { + if o == nil { + return "" + } + return o.ProjectName +} + +func (o *ObservabilityOpikDestinationConfig) GetWorkspace() string { + if o == nil { + return "" + } + return o.Workspace +} + +type ObservabilityOpikDestinationType string + +const ( + ObservabilityOpikDestinationTypeOpik ObservabilityOpikDestinationType = "opik" +) + +func (e ObservabilityOpikDestinationType) ToPointer() *ObservabilityOpikDestinationType { + return &e +} +func (e *ObservabilityOpikDestinationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "opik": + *e = ObservabilityOpikDestinationType(v) + return nil + default: + return fmt.Errorf("invalid value for ObservabilityOpikDestinationType: %v", v) + } +} + +type ObservabilityOpikDestination struct { + // Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + APIKeyHashes []string `json:"api_key_hashes"` + Config ObservabilityOpikDestinationConfig `json:"config"` + // ISO timestamp of when the destination was created. + CreatedAt string `json:"created_at"` + // Whether this destination is currently enabled. + Enabled bool `json:"enabled"` + // Optional structured filter rules controlling which events are forwarded. + FilterRules *ObservabilityFilterRulesConfig `json:"filter_rules"` + // Stable public identifier for this destination. + ID string `json:"id"` + // Human-readable name for the destination. + Name *string `json:"name"` + // When true, request/response bodies are not forwarded to this destination — only metadata. + PrivacyMode bool `json:"privacy_mode"` + // Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + SamplingRate float64 `json:"sampling_rate"` + Type ObservabilityOpikDestinationType `json:"type"` + // ISO timestamp of when the destination was last updated. + UpdatedAt string `json:"updated_at"` + // ID of the workspace this destination belongs to. + WorkspaceID string `json:"workspace_id"` +} + +func (o ObservabilityOpikDestination) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityOpikDestination) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityOpikDestination) GetAPIKeyHashes() []string { + if o == nil { + return nil + } + return o.APIKeyHashes +} + +func (o *ObservabilityOpikDestination) GetConfig() ObservabilityOpikDestinationConfig { + if o == nil { + return ObservabilityOpikDestinationConfig{} + } + return o.Config +} + +func (o *ObservabilityOpikDestination) GetCreatedAt() string { + if o == nil { + return "" + } + return o.CreatedAt +} + +func (o *ObservabilityOpikDestination) GetEnabled() bool { + if o == nil { + return false + } + return o.Enabled +} + +func (o *ObservabilityOpikDestination) GetFilterRules() *ObservabilityFilterRulesConfig { + if o == nil { + return nil + } + return o.FilterRules +} + +func (o *ObservabilityOpikDestination) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *ObservabilityOpikDestination) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *ObservabilityOpikDestination) GetPrivacyMode() bool { + if o == nil { + return false + } + return o.PrivacyMode +} + +func (o *ObservabilityOpikDestination) GetSamplingRate() float64 { + if o == nil { + return 0.0 + } + return o.SamplingRate +} + +func (o *ObservabilityOpikDestination) GetType() ObservabilityOpikDestinationType { + if o == nil { + return ObservabilityOpikDestinationType("") + } + return o.Type +} + +func (o *ObservabilityOpikDestination) GetUpdatedAt() string { + if o == nil { + return "" + } + return o.UpdatedAt +} + +func (o *ObservabilityOpikDestination) GetWorkspaceID() string { + if o == nil { + return "" + } + return o.WorkspaceID +} diff --git a/models/components/observabilityotelcollectordestination.go b/models/components/observabilityotelcollectordestination.go new file mode 100644 index 00000000..be060809 --- /dev/null +++ b/models/components/observabilityotelcollectordestination.go @@ -0,0 +1,183 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ObservabilityOtelCollectorDestinationConfig struct { + Endpoint string `json:"endpoint"` + // Custom HTTP headers as a JSON object. For Axiom, use {"Authorization": "Bearer xaat-xxx", "X-Axiom-Dataset": "your-dataset"} + Headers map[string]string `json:"headers,omitzero"` +} + +func (o ObservabilityOtelCollectorDestinationConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityOtelCollectorDestinationConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityOtelCollectorDestinationConfig) GetEndpoint() string { + if o == nil { + return "" + } + return o.Endpoint +} + +func (o *ObservabilityOtelCollectorDestinationConfig) GetHeaders() map[string]string { + if o == nil { + return nil + } + return o.Headers +} + +type ObservabilityOtelCollectorDestinationType string + +const ( + ObservabilityOtelCollectorDestinationTypeOtelCollector ObservabilityOtelCollectorDestinationType = "otel-collector" +) + +func (e ObservabilityOtelCollectorDestinationType) ToPointer() *ObservabilityOtelCollectorDestinationType { + return &e +} +func (e *ObservabilityOtelCollectorDestinationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "otel-collector": + *e = ObservabilityOtelCollectorDestinationType(v) + return nil + default: + return fmt.Errorf("invalid value for ObservabilityOtelCollectorDestinationType: %v", v) + } +} + +type ObservabilityOtelCollectorDestination struct { + // Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + APIKeyHashes []string `json:"api_key_hashes"` + Config ObservabilityOtelCollectorDestinationConfig `json:"config"` + // ISO timestamp of when the destination was created. + CreatedAt string `json:"created_at"` + // Whether this destination is currently enabled. + Enabled bool `json:"enabled"` + // Optional structured filter rules controlling which events are forwarded. + FilterRules *ObservabilityFilterRulesConfig `json:"filter_rules"` + // Stable public identifier for this destination. + ID string `json:"id"` + // Human-readable name for the destination. + Name *string `json:"name"` + // When true, request/response bodies are not forwarded to this destination — only metadata. + PrivacyMode bool `json:"privacy_mode"` + // Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + SamplingRate float64 `json:"sampling_rate"` + Type ObservabilityOtelCollectorDestinationType `json:"type"` + // ISO timestamp of when the destination was last updated. + UpdatedAt string `json:"updated_at"` + // ID of the workspace this destination belongs to. + WorkspaceID string `json:"workspace_id"` +} + +func (o ObservabilityOtelCollectorDestination) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityOtelCollectorDestination) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityOtelCollectorDestination) GetAPIKeyHashes() []string { + if o == nil { + return nil + } + return o.APIKeyHashes +} + +func (o *ObservabilityOtelCollectorDestination) GetConfig() ObservabilityOtelCollectorDestinationConfig { + if o == nil { + return ObservabilityOtelCollectorDestinationConfig{} + } + return o.Config +} + +func (o *ObservabilityOtelCollectorDestination) GetCreatedAt() string { + if o == nil { + return "" + } + return o.CreatedAt +} + +func (o *ObservabilityOtelCollectorDestination) GetEnabled() bool { + if o == nil { + return false + } + return o.Enabled +} + +func (o *ObservabilityOtelCollectorDestination) GetFilterRules() *ObservabilityFilterRulesConfig { + if o == nil { + return nil + } + return o.FilterRules +} + +func (o *ObservabilityOtelCollectorDestination) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *ObservabilityOtelCollectorDestination) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *ObservabilityOtelCollectorDestination) GetPrivacyMode() bool { + if o == nil { + return false + } + return o.PrivacyMode +} + +func (o *ObservabilityOtelCollectorDestination) GetSamplingRate() float64 { + if o == nil { + return 0.0 + } + return o.SamplingRate +} + +func (o *ObservabilityOtelCollectorDestination) GetType() ObservabilityOtelCollectorDestinationType { + if o == nil { + return ObservabilityOtelCollectorDestinationType("") + } + return o.Type +} + +func (o *ObservabilityOtelCollectorDestination) GetUpdatedAt() string { + if o == nil { + return "" + } + return o.UpdatedAt +} + +func (o *ObservabilityOtelCollectorDestination) GetWorkspaceID() string { + if o == nil { + return "" + } + return o.WorkspaceID +} diff --git a/models/components/observabilityposthogdestination.go b/models/components/observabilityposthogdestination.go new file mode 100644 index 00000000..05f5b3ff --- /dev/null +++ b/models/components/observabilityposthogdestination.go @@ -0,0 +1,191 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ObservabilityPosthogDestinationConfig struct { + APIKey string `json:"apiKey"` + Endpoint *string `default:"https://us.i.posthog.com" json:"endpoint"` + // Custom HTTP headers to include in requests to this destination. + Headers map[string]string `json:"headers,omitzero"` +} + +func (o ObservabilityPosthogDestinationConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityPosthogDestinationConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityPosthogDestinationConfig) GetAPIKey() string { + if o == nil { + return "" + } + return o.APIKey +} + +func (o *ObservabilityPosthogDestinationConfig) GetEndpoint() *string { + if o == nil { + return nil + } + return o.Endpoint +} + +func (o *ObservabilityPosthogDestinationConfig) GetHeaders() map[string]string { + if o == nil { + return nil + } + return o.Headers +} + +type ObservabilityPosthogDestinationType string + +const ( + ObservabilityPosthogDestinationTypePosthog ObservabilityPosthogDestinationType = "posthog" +) + +func (e ObservabilityPosthogDestinationType) ToPointer() *ObservabilityPosthogDestinationType { + return &e +} +func (e *ObservabilityPosthogDestinationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "posthog": + *e = ObservabilityPosthogDestinationType(v) + return nil + default: + return fmt.Errorf("invalid value for ObservabilityPosthogDestinationType: %v", v) + } +} + +type ObservabilityPosthogDestination struct { + // Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + APIKeyHashes []string `json:"api_key_hashes"` + Config ObservabilityPosthogDestinationConfig `json:"config"` + // ISO timestamp of when the destination was created. + CreatedAt string `json:"created_at"` + // Whether this destination is currently enabled. + Enabled bool `json:"enabled"` + // Optional structured filter rules controlling which events are forwarded. + FilterRules *ObservabilityFilterRulesConfig `json:"filter_rules"` + // Stable public identifier for this destination. + ID string `json:"id"` + // Human-readable name for the destination. + Name *string `json:"name"` + // When true, request/response bodies are not forwarded to this destination — only metadata. + PrivacyMode bool `json:"privacy_mode"` + // Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + SamplingRate float64 `json:"sampling_rate"` + Type ObservabilityPosthogDestinationType `json:"type"` + // ISO timestamp of when the destination was last updated. + UpdatedAt string `json:"updated_at"` + // ID of the workspace this destination belongs to. + WorkspaceID string `json:"workspace_id"` +} + +func (o ObservabilityPosthogDestination) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityPosthogDestination) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityPosthogDestination) GetAPIKeyHashes() []string { + if o == nil { + return nil + } + return o.APIKeyHashes +} + +func (o *ObservabilityPosthogDestination) GetConfig() ObservabilityPosthogDestinationConfig { + if o == nil { + return ObservabilityPosthogDestinationConfig{} + } + return o.Config +} + +func (o *ObservabilityPosthogDestination) GetCreatedAt() string { + if o == nil { + return "" + } + return o.CreatedAt +} + +func (o *ObservabilityPosthogDestination) GetEnabled() bool { + if o == nil { + return false + } + return o.Enabled +} + +func (o *ObservabilityPosthogDestination) GetFilterRules() *ObservabilityFilterRulesConfig { + if o == nil { + return nil + } + return o.FilterRules +} + +func (o *ObservabilityPosthogDestination) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *ObservabilityPosthogDestination) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *ObservabilityPosthogDestination) GetPrivacyMode() bool { + if o == nil { + return false + } + return o.PrivacyMode +} + +func (o *ObservabilityPosthogDestination) GetSamplingRate() float64 { + if o == nil { + return 0.0 + } + return o.SamplingRate +} + +func (o *ObservabilityPosthogDestination) GetType() ObservabilityPosthogDestinationType { + if o == nil { + return ObservabilityPosthogDestinationType("") + } + return o.Type +} + +func (o *ObservabilityPosthogDestination) GetUpdatedAt() string { + if o == nil { + return "" + } + return o.UpdatedAt +} + +func (o *ObservabilityPosthogDestination) GetWorkspaceID() string { + if o == nil { + return "" + } + return o.WorkspaceID +} diff --git a/models/components/observabilityrampdestination.go b/models/components/observabilityrampdestination.go new file mode 100644 index 00000000..155a0261 --- /dev/null +++ b/models/components/observabilityrampdestination.go @@ -0,0 +1,192 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ObservabilityRampDestinationConfig struct { + // Generate this in your Ramp integration settings. + APIKey string `json:"apiKey"` + BaseURL *string `default:"https://api.ramp.com/developer/v1/ai-usage/openrouter" json:"baseUrl"` + // Custom HTTP headers to include in requests to Ramp. + Headers map[string]string `json:"headers,omitzero"` +} + +func (o ObservabilityRampDestinationConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityRampDestinationConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityRampDestinationConfig) GetAPIKey() string { + if o == nil { + return "" + } + return o.APIKey +} + +func (o *ObservabilityRampDestinationConfig) GetBaseURL() *string { + if o == nil { + return nil + } + return o.BaseURL +} + +func (o *ObservabilityRampDestinationConfig) GetHeaders() map[string]string { + if o == nil { + return nil + } + return o.Headers +} + +type ObservabilityRampDestinationType string + +const ( + ObservabilityRampDestinationTypeRamp ObservabilityRampDestinationType = "ramp" +) + +func (e ObservabilityRampDestinationType) ToPointer() *ObservabilityRampDestinationType { + return &e +} +func (e *ObservabilityRampDestinationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "ramp": + *e = ObservabilityRampDestinationType(v) + return nil + default: + return fmt.Errorf("invalid value for ObservabilityRampDestinationType: %v", v) + } +} + +type ObservabilityRampDestination struct { + // Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + APIKeyHashes []string `json:"api_key_hashes"` + Config ObservabilityRampDestinationConfig `json:"config"` + // ISO timestamp of when the destination was created. + CreatedAt string `json:"created_at"` + // Whether this destination is currently enabled. + Enabled bool `json:"enabled"` + // Optional structured filter rules controlling which events are forwarded. + FilterRules *ObservabilityFilterRulesConfig `json:"filter_rules"` + // Stable public identifier for this destination. + ID string `json:"id"` + // Human-readable name for the destination. + Name *string `json:"name"` + // When true, request/response bodies are not forwarded to this destination — only metadata. + PrivacyMode bool `json:"privacy_mode"` + // Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + SamplingRate float64 `json:"sampling_rate"` + Type ObservabilityRampDestinationType `json:"type"` + // ISO timestamp of when the destination was last updated. + UpdatedAt string `json:"updated_at"` + // ID of the workspace this destination belongs to. + WorkspaceID string `json:"workspace_id"` +} + +func (o ObservabilityRampDestination) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityRampDestination) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityRampDestination) GetAPIKeyHashes() []string { + if o == nil { + return nil + } + return o.APIKeyHashes +} + +func (o *ObservabilityRampDestination) GetConfig() ObservabilityRampDestinationConfig { + if o == nil { + return ObservabilityRampDestinationConfig{} + } + return o.Config +} + +func (o *ObservabilityRampDestination) GetCreatedAt() string { + if o == nil { + return "" + } + return o.CreatedAt +} + +func (o *ObservabilityRampDestination) GetEnabled() bool { + if o == nil { + return false + } + return o.Enabled +} + +func (o *ObservabilityRampDestination) GetFilterRules() *ObservabilityFilterRulesConfig { + if o == nil { + return nil + } + return o.FilterRules +} + +func (o *ObservabilityRampDestination) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *ObservabilityRampDestination) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *ObservabilityRampDestination) GetPrivacyMode() bool { + if o == nil { + return false + } + return o.PrivacyMode +} + +func (o *ObservabilityRampDestination) GetSamplingRate() float64 { + if o == nil { + return 0.0 + } + return o.SamplingRate +} + +func (o *ObservabilityRampDestination) GetType() ObservabilityRampDestinationType { + if o == nil { + return ObservabilityRampDestinationType("") + } + return o.Type +} + +func (o *ObservabilityRampDestination) GetUpdatedAt() string { + if o == nil { + return "" + } + return o.UpdatedAt +} + +func (o *ObservabilityRampDestination) GetWorkspaceID() string { + if o == nil { + return "" + } + return o.WorkspaceID +} diff --git a/models/components/observabilitys3destination.go b/models/components/observabilitys3destination.go new file mode 100644 index 00000000..8c67b963 --- /dev/null +++ b/models/components/observabilitys3destination.go @@ -0,0 +1,247 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ObservabilityS3DestinationConfig struct { + AccessKeyID string `json:"accessKeyId"` + BucketName string `json:"bucketName"` + // Only for S3-compatible services like Cloudflare R2 (https://account-id.r2.cloudflarestorage.com) or MinIO. Leave blank for standard AWS S3. + Endpoint *string `json:"endpoint,omitzero"` + // Custom HTTP headers to include in requests to this destination. + Headers map[string]string `json:"headers,omitzero"` + // Template for S3 object path. The filename ({traceId}-{timestamp}.json) is automatically appended. Available variables: {prefix}, {date}, {year}, {month}, {day}, {apiKeyName} + PathTemplate *string `default:"{prefix}/{date}" json:"pathTemplate"` + Prefix *string `default:"openrouter-traces" json:"prefix"` + Region *string `json:"region,omitzero"` + SecretAccessKey string `json:"secretAccessKey"` + SessionToken *string `json:"sessionToken,omitzero"` +} + +func (o ObservabilityS3DestinationConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityS3DestinationConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityS3DestinationConfig) GetAccessKeyID() string { + if o == nil { + return "" + } + return o.AccessKeyID +} + +func (o *ObservabilityS3DestinationConfig) GetBucketName() string { + if o == nil { + return "" + } + return o.BucketName +} + +func (o *ObservabilityS3DestinationConfig) GetEndpoint() *string { + if o == nil { + return nil + } + return o.Endpoint +} + +func (o *ObservabilityS3DestinationConfig) GetHeaders() map[string]string { + if o == nil { + return nil + } + return o.Headers +} + +func (o *ObservabilityS3DestinationConfig) GetPathTemplate() *string { + if o == nil { + return nil + } + return o.PathTemplate +} + +func (o *ObservabilityS3DestinationConfig) GetPrefix() *string { + if o == nil { + return nil + } + return o.Prefix +} + +func (o *ObservabilityS3DestinationConfig) GetRegion() *string { + if o == nil { + return nil + } + return o.Region +} + +func (o *ObservabilityS3DestinationConfig) GetSecretAccessKey() string { + if o == nil { + return "" + } + return o.SecretAccessKey +} + +func (o *ObservabilityS3DestinationConfig) GetSessionToken() *string { + if o == nil { + return nil + } + return o.SessionToken +} + +// #region class-body-observabilitys3destinationconfig +// #endregion class-body-observabilitys3destinationconfig + +type ObservabilityS3DestinationType string + +const ( + ObservabilityS3DestinationTypeS3 ObservabilityS3DestinationType = "s3" +) + +func (e ObservabilityS3DestinationType) ToPointer() *ObservabilityS3DestinationType { + return &e +} +func (e *ObservabilityS3DestinationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "s3": + *e = ObservabilityS3DestinationType(v) + return nil + default: + return fmt.Errorf("invalid value for ObservabilityS3DestinationType: %v", v) + } +} + +type ObservabilityS3Destination struct { + // Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + APIKeyHashes []string `json:"api_key_hashes"` + Config ObservabilityS3DestinationConfig `json:"config"` + // ISO timestamp of when the destination was created. + CreatedAt string `json:"created_at"` + // Whether this destination is currently enabled. + Enabled bool `json:"enabled"` + // Optional structured filter rules controlling which events are forwarded. + FilterRules *ObservabilityFilterRulesConfig `json:"filter_rules"` + // Stable public identifier for this destination. + ID string `json:"id"` + // Human-readable name for the destination. + Name *string `json:"name"` + // When true, request/response bodies are not forwarded to this destination — only metadata. + PrivacyMode bool `json:"privacy_mode"` + // Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + SamplingRate float64 `json:"sampling_rate"` + Type ObservabilityS3DestinationType `json:"type"` + // ISO timestamp of when the destination was last updated. + UpdatedAt string `json:"updated_at"` + // ID of the workspace this destination belongs to. + WorkspaceID string `json:"workspace_id"` +} + +func (o ObservabilityS3Destination) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityS3Destination) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityS3Destination) GetAPIKeyHashes() []string { + if o == nil { + return nil + } + return o.APIKeyHashes +} + +func (o *ObservabilityS3Destination) GetConfig() ObservabilityS3DestinationConfig { + if o == nil { + return ObservabilityS3DestinationConfig{} + } + return o.Config +} + +func (o *ObservabilityS3Destination) GetCreatedAt() string { + if o == nil { + return "" + } + return o.CreatedAt +} + +func (o *ObservabilityS3Destination) GetEnabled() bool { + if o == nil { + return false + } + return o.Enabled +} + +func (o *ObservabilityS3Destination) GetFilterRules() *ObservabilityFilterRulesConfig { + if o == nil { + return nil + } + return o.FilterRules +} + +func (o *ObservabilityS3Destination) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *ObservabilityS3Destination) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *ObservabilityS3Destination) GetPrivacyMode() bool { + if o == nil { + return false + } + return o.PrivacyMode +} + +func (o *ObservabilityS3Destination) GetSamplingRate() float64 { + if o == nil { + return 0.0 + } + return o.SamplingRate +} + +func (o *ObservabilityS3Destination) GetType() ObservabilityS3DestinationType { + if o == nil { + return ObservabilityS3DestinationType("") + } + return o.Type +} + +func (o *ObservabilityS3Destination) GetUpdatedAt() string { + if o == nil { + return "" + } + return o.UpdatedAt +} + +func (o *ObservabilityS3Destination) GetWorkspaceID() string { + if o == nil { + return "" + } + return o.WorkspaceID +} + +// #region class-body-observabilitys3destination +// #endregion class-body-observabilitys3destination diff --git a/models/components/observabilitysentrydestination.go b/models/components/observabilitysentrydestination.go new file mode 100644 index 00000000..6d2df57f --- /dev/null +++ b/models/components/observabilitysentrydestination.go @@ -0,0 +1,191 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ObservabilitySentryDestinationConfig struct { + Dsn string `json:"dsn"` + // Custom HTTP headers to include in requests to this destination. + Headers map[string]string `json:"headers,omitzero"` + OtlpEndpoint string `json:"otlpEndpoint"` +} + +func (o ObservabilitySentryDestinationConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilitySentryDestinationConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilitySentryDestinationConfig) GetDsn() string { + if o == nil { + return "" + } + return o.Dsn +} + +func (o *ObservabilitySentryDestinationConfig) GetHeaders() map[string]string { + if o == nil { + return nil + } + return o.Headers +} + +func (o *ObservabilitySentryDestinationConfig) GetOtlpEndpoint() string { + if o == nil { + return "" + } + return o.OtlpEndpoint +} + +type ObservabilitySentryDestinationType string + +const ( + ObservabilitySentryDestinationTypeSentry ObservabilitySentryDestinationType = "sentry" +) + +func (e ObservabilitySentryDestinationType) ToPointer() *ObservabilitySentryDestinationType { + return &e +} +func (e *ObservabilitySentryDestinationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "sentry": + *e = ObservabilitySentryDestinationType(v) + return nil + default: + return fmt.Errorf("invalid value for ObservabilitySentryDestinationType: %v", v) + } +} + +type ObservabilitySentryDestination struct { + // Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + APIKeyHashes []string `json:"api_key_hashes"` + Config ObservabilitySentryDestinationConfig `json:"config"` + // ISO timestamp of when the destination was created. + CreatedAt string `json:"created_at"` + // Whether this destination is currently enabled. + Enabled bool `json:"enabled"` + // Optional structured filter rules controlling which events are forwarded. + FilterRules *ObservabilityFilterRulesConfig `json:"filter_rules"` + // Stable public identifier for this destination. + ID string `json:"id"` + // Human-readable name for the destination. + Name *string `json:"name"` + // When true, request/response bodies are not forwarded to this destination — only metadata. + PrivacyMode bool `json:"privacy_mode"` + // Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + SamplingRate float64 `json:"sampling_rate"` + Type ObservabilitySentryDestinationType `json:"type"` + // ISO timestamp of when the destination was last updated. + UpdatedAt string `json:"updated_at"` + // ID of the workspace this destination belongs to. + WorkspaceID string `json:"workspace_id"` +} + +func (o ObservabilitySentryDestination) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilitySentryDestination) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilitySentryDestination) GetAPIKeyHashes() []string { + if o == nil { + return nil + } + return o.APIKeyHashes +} + +func (o *ObservabilitySentryDestination) GetConfig() ObservabilitySentryDestinationConfig { + if o == nil { + return ObservabilitySentryDestinationConfig{} + } + return o.Config +} + +func (o *ObservabilitySentryDestination) GetCreatedAt() string { + if o == nil { + return "" + } + return o.CreatedAt +} + +func (o *ObservabilitySentryDestination) GetEnabled() bool { + if o == nil { + return false + } + return o.Enabled +} + +func (o *ObservabilitySentryDestination) GetFilterRules() *ObservabilityFilterRulesConfig { + if o == nil { + return nil + } + return o.FilterRules +} + +func (o *ObservabilitySentryDestination) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *ObservabilitySentryDestination) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *ObservabilitySentryDestination) GetPrivacyMode() bool { + if o == nil { + return false + } + return o.PrivacyMode +} + +func (o *ObservabilitySentryDestination) GetSamplingRate() float64 { + if o == nil { + return 0.0 + } + return o.SamplingRate +} + +func (o *ObservabilitySentryDestination) GetType() ObservabilitySentryDestinationType { + if o == nil { + return ObservabilitySentryDestinationType("") + } + return o.Type +} + +func (o *ObservabilitySentryDestination) GetUpdatedAt() string { + if o == nil { + return "" + } + return o.UpdatedAt +} + +func (o *ObservabilitySentryDestination) GetWorkspaceID() string { + if o == nil { + return "" + } + return o.WorkspaceID +} diff --git a/models/components/observabilitysnowflakedestination.go b/models/components/observabilitysnowflakedestination.go new file mode 100644 index 00000000..c2905a11 --- /dev/null +++ b/models/components/observabilitysnowflakedestination.go @@ -0,0 +1,223 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ObservabilitySnowflakeDestinationConfig struct { + Account string `json:"account"` + Database *string `default:"SNOWFLAKE_LEARNING_DB" json:"database"` + // Custom HTTP headers to include in requests to this destination. + Headers map[string]string `json:"headers,omitzero"` + Schema *string `default:"PUBLIC" json:"schema"` + Table *string `default:"OPENROUTER_TRACES" json:"table"` + Token string `json:"token"` + Warehouse *string `default:"COMPUTE_WH" json:"warehouse"` +} + +func (o ObservabilitySnowflakeDestinationConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilitySnowflakeDestinationConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilitySnowflakeDestinationConfig) GetAccount() string { + if o == nil { + return "" + } + return o.Account +} + +func (o *ObservabilitySnowflakeDestinationConfig) GetDatabase() *string { + if o == nil { + return nil + } + return o.Database +} + +func (o *ObservabilitySnowflakeDestinationConfig) GetHeaders() map[string]string { + if o == nil { + return nil + } + return o.Headers +} + +func (o *ObservabilitySnowflakeDestinationConfig) GetSchema() *string { + if o == nil { + return nil + } + return o.Schema +} + +func (o *ObservabilitySnowflakeDestinationConfig) GetTable() *string { + if o == nil { + return nil + } + return o.Table +} + +func (o *ObservabilitySnowflakeDestinationConfig) GetToken() string { + if o == nil { + return "" + } + return o.Token +} + +func (o *ObservabilitySnowflakeDestinationConfig) GetWarehouse() *string { + if o == nil { + return nil + } + return o.Warehouse +} + +type ObservabilitySnowflakeDestinationType string + +const ( + ObservabilitySnowflakeDestinationTypeSnowflake ObservabilitySnowflakeDestinationType = "snowflake" +) + +func (e ObservabilitySnowflakeDestinationType) ToPointer() *ObservabilitySnowflakeDestinationType { + return &e +} +func (e *ObservabilitySnowflakeDestinationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "snowflake": + *e = ObservabilitySnowflakeDestinationType(v) + return nil + default: + return fmt.Errorf("invalid value for ObservabilitySnowflakeDestinationType: %v", v) + } +} + +type ObservabilitySnowflakeDestination struct { + // Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + APIKeyHashes []string `json:"api_key_hashes"` + Config ObservabilitySnowflakeDestinationConfig `json:"config"` + // ISO timestamp of when the destination was created. + CreatedAt string `json:"created_at"` + // Whether this destination is currently enabled. + Enabled bool `json:"enabled"` + // Optional structured filter rules controlling which events are forwarded. + FilterRules *ObservabilityFilterRulesConfig `json:"filter_rules"` + // Stable public identifier for this destination. + ID string `json:"id"` + // Human-readable name for the destination. + Name *string `json:"name"` + // When true, request/response bodies are not forwarded to this destination — only metadata. + PrivacyMode bool `json:"privacy_mode"` + // Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + SamplingRate float64 `json:"sampling_rate"` + Type ObservabilitySnowflakeDestinationType `json:"type"` + // ISO timestamp of when the destination was last updated. + UpdatedAt string `json:"updated_at"` + // ID of the workspace this destination belongs to. + WorkspaceID string `json:"workspace_id"` +} + +func (o ObservabilitySnowflakeDestination) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilitySnowflakeDestination) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilitySnowflakeDestination) GetAPIKeyHashes() []string { + if o == nil { + return nil + } + return o.APIKeyHashes +} + +func (o *ObservabilitySnowflakeDestination) GetConfig() ObservabilitySnowflakeDestinationConfig { + if o == nil { + return ObservabilitySnowflakeDestinationConfig{} + } + return o.Config +} + +func (o *ObservabilitySnowflakeDestination) GetCreatedAt() string { + if o == nil { + return "" + } + return o.CreatedAt +} + +func (o *ObservabilitySnowflakeDestination) GetEnabled() bool { + if o == nil { + return false + } + return o.Enabled +} + +func (o *ObservabilitySnowflakeDestination) GetFilterRules() *ObservabilityFilterRulesConfig { + if o == nil { + return nil + } + return o.FilterRules +} + +func (o *ObservabilitySnowflakeDestination) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *ObservabilitySnowflakeDestination) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *ObservabilitySnowflakeDestination) GetPrivacyMode() bool { + if o == nil { + return false + } + return o.PrivacyMode +} + +func (o *ObservabilitySnowflakeDestination) GetSamplingRate() float64 { + if o == nil { + return 0.0 + } + return o.SamplingRate +} + +func (o *ObservabilitySnowflakeDestination) GetType() ObservabilitySnowflakeDestinationType { + if o == nil { + return ObservabilitySnowflakeDestinationType("") + } + return o.Type +} + +func (o *ObservabilitySnowflakeDestination) GetUpdatedAt() string { + if o == nil { + return "" + } + return o.UpdatedAt +} + +func (o *ObservabilitySnowflakeDestination) GetWorkspaceID() string { + if o == nil { + return "" + } + return o.WorkspaceID +} diff --git a/models/components/observabilityweavedestination.go b/models/components/observabilityweavedestination.go new file mode 100644 index 00000000..edc60752 --- /dev/null +++ b/models/components/observabilityweavedestination.go @@ -0,0 +1,207 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ObservabilityWeaveDestinationConfig struct { + APIKey string `json:"apiKey"` + BaseURL *string `default:"https://trace.wandb.ai" json:"baseUrl"` + Entity string `json:"entity"` + // Custom HTTP headers to include in requests to this destination. + Headers map[string]string `json:"headers,omitzero"` + Project string `json:"project"` +} + +func (o ObservabilityWeaveDestinationConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityWeaveDestinationConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityWeaveDestinationConfig) GetAPIKey() string { + if o == nil { + return "" + } + return o.APIKey +} + +func (o *ObservabilityWeaveDestinationConfig) GetBaseURL() *string { + if o == nil { + return nil + } + return o.BaseURL +} + +func (o *ObservabilityWeaveDestinationConfig) GetEntity() string { + if o == nil { + return "" + } + return o.Entity +} + +func (o *ObservabilityWeaveDestinationConfig) GetHeaders() map[string]string { + if o == nil { + return nil + } + return o.Headers +} + +func (o *ObservabilityWeaveDestinationConfig) GetProject() string { + if o == nil { + return "" + } + return o.Project +} + +type ObservabilityWeaveDestinationType string + +const ( + ObservabilityWeaveDestinationTypeWeave ObservabilityWeaveDestinationType = "weave" +) + +func (e ObservabilityWeaveDestinationType) ToPointer() *ObservabilityWeaveDestinationType { + return &e +} +func (e *ObservabilityWeaveDestinationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "weave": + *e = ObservabilityWeaveDestinationType(v) + return nil + default: + return fmt.Errorf("invalid value for ObservabilityWeaveDestinationType: %v", v) + } +} + +type ObservabilityWeaveDestination struct { + // Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + APIKeyHashes []string `json:"api_key_hashes"` + Config ObservabilityWeaveDestinationConfig `json:"config"` + // ISO timestamp of when the destination was created. + CreatedAt string `json:"created_at"` + // Whether this destination is currently enabled. + Enabled bool `json:"enabled"` + // Optional structured filter rules controlling which events are forwarded. + FilterRules *ObservabilityFilterRulesConfig `json:"filter_rules"` + // Stable public identifier for this destination. + ID string `json:"id"` + // Human-readable name for the destination. + Name *string `json:"name"` + // When true, request/response bodies are not forwarded to this destination — only metadata. + PrivacyMode bool `json:"privacy_mode"` + // Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + SamplingRate float64 `json:"sampling_rate"` + Type ObservabilityWeaveDestinationType `json:"type"` + // ISO timestamp of when the destination was last updated. + UpdatedAt string `json:"updated_at"` + // ID of the workspace this destination belongs to. + WorkspaceID string `json:"workspace_id"` +} + +func (o ObservabilityWeaveDestination) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityWeaveDestination) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityWeaveDestination) GetAPIKeyHashes() []string { + if o == nil { + return nil + } + return o.APIKeyHashes +} + +func (o *ObservabilityWeaveDestination) GetConfig() ObservabilityWeaveDestinationConfig { + if o == nil { + return ObservabilityWeaveDestinationConfig{} + } + return o.Config +} + +func (o *ObservabilityWeaveDestination) GetCreatedAt() string { + if o == nil { + return "" + } + return o.CreatedAt +} + +func (o *ObservabilityWeaveDestination) GetEnabled() bool { + if o == nil { + return false + } + return o.Enabled +} + +func (o *ObservabilityWeaveDestination) GetFilterRules() *ObservabilityFilterRulesConfig { + if o == nil { + return nil + } + return o.FilterRules +} + +func (o *ObservabilityWeaveDestination) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *ObservabilityWeaveDestination) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *ObservabilityWeaveDestination) GetPrivacyMode() bool { + if o == nil { + return false + } + return o.PrivacyMode +} + +func (o *ObservabilityWeaveDestination) GetSamplingRate() float64 { + if o == nil { + return 0.0 + } + return o.SamplingRate +} + +func (o *ObservabilityWeaveDestination) GetType() ObservabilityWeaveDestinationType { + if o == nil { + return ObservabilityWeaveDestinationType("") + } + return o.Type +} + +func (o *ObservabilityWeaveDestination) GetUpdatedAt() string { + if o == nil { + return "" + } + return o.UpdatedAt +} + +func (o *ObservabilityWeaveDestination) GetWorkspaceID() string { + if o == nil { + return "" + } + return o.WorkspaceID +} diff --git a/models/components/observabilitywebhookdestination.go b/models/components/observabilitywebhookdestination.go new file mode 100644 index 00000000..a461b669 --- /dev/null +++ b/models/components/observabilitywebhookdestination.go @@ -0,0 +1,212 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type Method string + +const ( + MethodPost Method = "POST" + MethodPut Method = "PUT" +) + +func (e Method) ToPointer() *Method { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Method) IsExact() bool { + if e != nil { + switch *e { + case "POST", "PUT": + return true + } + } + return false +} + +type ObservabilityWebhookDestinationConfig struct { + Headers map[string]string `json:"headers,omitzero"` + Method *Method `default:"POST" json:"method"` + URL string `json:"url"` +} + +func (o ObservabilityWebhookDestinationConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityWebhookDestinationConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityWebhookDestinationConfig) GetHeaders() map[string]string { + if o == nil { + return nil + } + return o.Headers +} + +func (o *ObservabilityWebhookDestinationConfig) GetMethod() *Method { + if o == nil { + return nil + } + return o.Method +} + +func (o *ObservabilityWebhookDestinationConfig) GetURL() string { + if o == nil { + return "" + } + return o.URL +} + +type ObservabilityWebhookDestinationType string + +const ( + ObservabilityWebhookDestinationTypeWebhook ObservabilityWebhookDestinationType = "webhook" +) + +func (e ObservabilityWebhookDestinationType) ToPointer() *ObservabilityWebhookDestinationType { + return &e +} +func (e *ObservabilityWebhookDestinationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "webhook": + *e = ObservabilityWebhookDestinationType(v) + return nil + default: + return fmt.Errorf("invalid value for ObservabilityWebhookDestinationType: %v", v) + } +} + +type ObservabilityWebhookDestination struct { + // Optional allowlist of OpenRouter API key hashes (`api_keys.hash`) whose traffic is forwarded to this destination. `null` means all keys. + APIKeyHashes []string `json:"api_key_hashes"` + Config ObservabilityWebhookDestinationConfig `json:"config"` + // ISO timestamp of when the destination was created. + CreatedAt string `json:"created_at"` + // Whether this destination is currently enabled. + Enabled bool `json:"enabled"` + // Optional structured filter rules controlling which events are forwarded. + FilterRules *ObservabilityFilterRulesConfig `json:"filter_rules"` + // Stable public identifier for this destination. + ID string `json:"id"` + // Human-readable name for the destination. + Name *string `json:"name"` + // When true, request/response bodies are not forwarded to this destination — only metadata. + PrivacyMode bool `json:"privacy_mode"` + // Sampling rate for events sent to this destination, between 0.0001 and 1 (1 = 100%). + SamplingRate float64 `json:"sampling_rate"` + Type ObservabilityWebhookDestinationType `json:"type"` + // ISO timestamp of when the destination was last updated. + UpdatedAt string `json:"updated_at"` + // ID of the workspace this destination belongs to. + WorkspaceID string `json:"workspace_id"` +} + +func (o ObservabilityWebhookDestination) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *ObservabilityWebhookDestination) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *ObservabilityWebhookDestination) GetAPIKeyHashes() []string { + if o == nil { + return nil + } + return o.APIKeyHashes +} + +func (o *ObservabilityWebhookDestination) GetConfig() ObservabilityWebhookDestinationConfig { + if o == nil { + return ObservabilityWebhookDestinationConfig{} + } + return o.Config +} + +func (o *ObservabilityWebhookDestination) GetCreatedAt() string { + if o == nil { + return "" + } + return o.CreatedAt +} + +func (o *ObservabilityWebhookDestination) GetEnabled() bool { + if o == nil { + return false + } + return o.Enabled +} + +func (o *ObservabilityWebhookDestination) GetFilterRules() *ObservabilityFilterRulesConfig { + if o == nil { + return nil + } + return o.FilterRules +} + +func (o *ObservabilityWebhookDestination) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *ObservabilityWebhookDestination) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *ObservabilityWebhookDestination) GetPrivacyMode() bool { + if o == nil { + return false + } + return o.PrivacyMode +} + +func (o *ObservabilityWebhookDestination) GetSamplingRate() float64 { + if o == nil { + return 0.0 + } + return o.SamplingRate +} + +func (o *ObservabilityWebhookDestination) GetType() ObservabilityWebhookDestinationType { + if o == nil { + return ObservabilityWebhookDestinationType("") + } + return o.Type +} + +func (o *ObservabilityWebhookDestination) GetUpdatedAt() string { + if o == nil { + return "" + } + return o.UpdatedAt +} + +func (o *ObservabilityWebhookDestination) GetWorkspaceID() string { + if o == nil { + return "" + } + return o.WorkspaceID +} diff --git a/models/components/openairesponsecustomtoolcall.go b/models/components/openairesponsecustomtoolcall.go new file mode 100644 index 00000000..1d0e614b --- /dev/null +++ b/models/components/openairesponsecustomtoolcall.go @@ -0,0 +1,95 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type OpenAIResponseCustomToolCallType string + +const ( + OpenAIResponseCustomToolCallTypeCustomToolCall OpenAIResponseCustomToolCallType = "custom_tool_call" +) + +func (e OpenAIResponseCustomToolCallType) ToPointer() *OpenAIResponseCustomToolCallType { + return &e +} +func (e *OpenAIResponseCustomToolCallType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "custom_tool_call": + *e = OpenAIResponseCustomToolCallType(v) + return nil + default: + return fmt.Errorf("invalid value for OpenAIResponseCustomToolCallType: %v", v) + } +} + +type OpenAIResponseCustomToolCall struct { + CallID string `json:"call_id"` + ID *string `json:"id,omitzero"` + Input string `json:"input"` + Name string `json:"name"` + // Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) + Namespace *string `json:"namespace,omitzero"` + Type OpenAIResponseCustomToolCallType `json:"type"` +} + +func (o OpenAIResponseCustomToolCall) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OpenAIResponseCustomToolCall) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *OpenAIResponseCustomToolCall) GetCallID() string { + if o == nil { + return "" + } + return o.CallID +} + +func (o *OpenAIResponseCustomToolCall) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *OpenAIResponseCustomToolCall) GetInput() string { + if o == nil { + return "" + } + return o.Input +} + +func (o *OpenAIResponseCustomToolCall) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *OpenAIResponseCustomToolCall) GetNamespace() *string { + if o == nil { + return nil + } + return o.Namespace +} + +func (o *OpenAIResponseCustomToolCall) GetType() OpenAIResponseCustomToolCallType { + if o == nil { + return OpenAIResponseCustomToolCallType("") + } + return o.Type +} diff --git a/models/components/openairesponsecustomtoolcalloutput.go b/models/components/openairesponsecustomtoolcalloutput.go new file mode 100644 index 00000000..3fecde96 --- /dev/null +++ b/models/components/openairesponsecustomtoolcalloutput.go @@ -0,0 +1,310 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "errors" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type OpenAIResponseCustomToolCallOutputOutput1Type string + +const ( + OpenAIResponseCustomToolCallOutputOutput1TypeInputFile OpenAIResponseCustomToolCallOutputOutput1Type = "input_file" + OpenAIResponseCustomToolCallOutputOutput1TypeInputImage OpenAIResponseCustomToolCallOutputOutput1Type = "input_image" + OpenAIResponseCustomToolCallOutputOutput1TypeInputText OpenAIResponseCustomToolCallOutputOutput1Type = "input_text" + OpenAIResponseCustomToolCallOutputOutput1TypeUnknown OpenAIResponseCustomToolCallOutputOutput1Type = "UNKNOWN" +) + +type OpenAIResponseCustomToolCallOutputOutput1 struct { + InputText *InputText `queryParam:"inline" union:"member"` + InputImage *InputImage `queryParam:"inline" union:"member"` + InputFile *InputFile `queryParam:"inline" union:"member"` + UnknownRaw json.RawMessage `json:"-" union:"unknown"` + + Type OpenAIResponseCustomToolCallOutputOutput1Type +} + +func CreateOpenAIResponseCustomToolCallOutputOutput1InputFile(inputFile InputFile) OpenAIResponseCustomToolCallOutputOutput1 { + typ := OpenAIResponseCustomToolCallOutputOutput1TypeInputFile + + typStr := InputFileType(typ) + inputFile.Type = typStr + + return OpenAIResponseCustomToolCallOutputOutput1{ + InputFile: &inputFile, + Type: typ, + } +} + +func CreateOpenAIResponseCustomToolCallOutputOutput1InputImage(inputImage InputImage) OpenAIResponseCustomToolCallOutputOutput1 { + typ := OpenAIResponseCustomToolCallOutputOutput1TypeInputImage + + typStr := InputImageType(typ) + inputImage.Type = typStr + + return OpenAIResponseCustomToolCallOutputOutput1{ + InputImage: &inputImage, + Type: typ, + } +} + +func CreateOpenAIResponseCustomToolCallOutputOutput1InputText(inputText InputText) OpenAIResponseCustomToolCallOutputOutput1 { + typ := OpenAIResponseCustomToolCallOutputOutput1TypeInputText + + typStr := InputTextType(typ) + inputText.Type = typStr + + return OpenAIResponseCustomToolCallOutputOutput1{ + InputText: &inputText, + Type: typ, + } +} + +func CreateOpenAIResponseCustomToolCallOutputOutput1Unknown(raw json.RawMessage) OpenAIResponseCustomToolCallOutputOutput1 { + return OpenAIResponseCustomToolCallOutputOutput1{ + UnknownRaw: raw, + Type: OpenAIResponseCustomToolCallOutputOutput1TypeUnknown, + } +} + +func (u OpenAIResponseCustomToolCallOutputOutput1) GetUnknownRaw() json.RawMessage { + return u.UnknownRaw +} + +func (u OpenAIResponseCustomToolCallOutputOutput1) IsUnknown() bool { + return u.Type == OpenAIResponseCustomToolCallOutputOutput1TypeUnknown +} + +func (u *OpenAIResponseCustomToolCallOutputOutput1) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + u.UnknownRaw = json.RawMessage(data) + u.Type = OpenAIResponseCustomToolCallOutputOutput1TypeUnknown + return nil + } + if dis == nil { + u.UnknownRaw = json.RawMessage(data) + u.Type = OpenAIResponseCustomToolCallOutputOutput1TypeUnknown + return nil + } + + switch dis.Type { + case "input_file": + inputFile := new(InputFile) + if err := utils.UnmarshalJSON(data, &inputFile, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == input_file) type InputFile within OpenAIResponseCustomToolCallOutputOutput1: %w", string(data), err) + } + + u.InputFile = inputFile + u.Type = OpenAIResponseCustomToolCallOutputOutput1TypeInputFile + return nil + case "input_image": + inputImage := new(InputImage) + if err := utils.UnmarshalJSON(data, &inputImage, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == input_image) type InputImage within OpenAIResponseCustomToolCallOutputOutput1: %w", string(data), err) + } + + u.InputImage = inputImage + u.Type = OpenAIResponseCustomToolCallOutputOutput1TypeInputImage + return nil + case "input_text": + inputText := new(InputText) + if err := utils.UnmarshalJSON(data, &inputText, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == input_text) type InputText within OpenAIResponseCustomToolCallOutputOutput1: %w", string(data), err) + } + + u.InputText = inputText + u.Type = OpenAIResponseCustomToolCallOutputOutput1TypeInputText + return nil + default: + u.UnknownRaw = json.RawMessage(data) + u.Type = OpenAIResponseCustomToolCallOutputOutput1TypeUnknown + return nil + } + +} + +func (u OpenAIResponseCustomToolCallOutputOutput1) MarshalJSON() ([]byte, error) { + if u.InputText != nil { + return utils.MarshalJSON(u.InputText, "", true) + } + + if u.InputImage != nil { + return utils.MarshalJSON(u.InputImage, "", true) + } + + if u.InputFile != nil { + return utils.MarshalJSON(u.InputFile, "", true) + } + + if u.UnknownRaw != nil { + return json.RawMessage(u.UnknownRaw), nil + } + return nil, errors.New("could not marshal union type OpenAIResponseCustomToolCallOutputOutput1: all fields are null") +} + +type OpenAIResponseCustomToolCallOutputOutput2Type string + +const ( + OpenAIResponseCustomToolCallOutputOutput2TypeStr OpenAIResponseCustomToolCallOutputOutput2Type = "str" + OpenAIResponseCustomToolCallOutputOutput2TypeArrayOfOpenAIResponseCustomToolCallOutputOutput1 OpenAIResponseCustomToolCallOutputOutput2Type = "arrayOfOpenAIResponseCustomToolCallOutputOutput1" +) + +type OpenAIResponseCustomToolCallOutputOutput2 struct { + Str *string `queryParam:"inline" union:"member"` + ArrayOfOpenAIResponseCustomToolCallOutputOutput1 []OpenAIResponseCustomToolCallOutputOutput1 `queryParam:"inline" union:"member"` + + Type OpenAIResponseCustomToolCallOutputOutput2Type +} + +func CreateOpenAIResponseCustomToolCallOutputOutput2Str(str string) OpenAIResponseCustomToolCallOutputOutput2 { + typ := OpenAIResponseCustomToolCallOutputOutput2TypeStr + + return OpenAIResponseCustomToolCallOutputOutput2{ + Str: &str, + Type: typ, + } +} + +func CreateOpenAIResponseCustomToolCallOutputOutput2ArrayOfOpenAIResponseCustomToolCallOutputOutput1(arrayOfOpenAIResponseCustomToolCallOutputOutput1 []OpenAIResponseCustomToolCallOutputOutput1) OpenAIResponseCustomToolCallOutputOutput2 { + typ := OpenAIResponseCustomToolCallOutputOutput2TypeArrayOfOpenAIResponseCustomToolCallOutputOutput1 + + return OpenAIResponseCustomToolCallOutputOutput2{ + ArrayOfOpenAIResponseCustomToolCallOutputOutput1: arrayOfOpenAIResponseCustomToolCallOutputOutput1, + Type: typ, + } +} + +func (u *OpenAIResponseCustomToolCallOutputOutput2) UnmarshalJSON(data []byte) error { + + var candidates []utils.UnionCandidate + + // Collect all valid candidates + var str string = "" + if err := utils.UnmarshalJSON(data, &str, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: OpenAIResponseCustomToolCallOutputOutput2TypeStr, + Value: &str, + }) + } + + var arrayOfOpenAIResponseCustomToolCallOutputOutput1 []OpenAIResponseCustomToolCallOutputOutput1 = []OpenAIResponseCustomToolCallOutputOutput1{} + if err := utils.UnmarshalJSON(data, &arrayOfOpenAIResponseCustomToolCallOutputOutput1, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: OpenAIResponseCustomToolCallOutputOutput2TypeArrayOfOpenAIResponseCustomToolCallOutputOutput1, + Value: arrayOfOpenAIResponseCustomToolCallOutputOutput1, + }) + } + + if len(candidates) == 0 { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for OpenAIResponseCustomToolCallOutputOutput2", string(data)) + } + + // Pick the best candidate using multi-stage filtering + best := utils.PickBestUnionCandidate(candidates, data) + if best == nil { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for OpenAIResponseCustomToolCallOutputOutput2", string(data)) + } + + // Set the union type and value based on the best candidate + u.Type = best.Type.(OpenAIResponseCustomToolCallOutputOutput2Type) + switch best.Type { + case OpenAIResponseCustomToolCallOutputOutput2TypeStr: + u.Str = best.Value.(*string) + return nil + case OpenAIResponseCustomToolCallOutputOutput2TypeArrayOfOpenAIResponseCustomToolCallOutputOutput1: + u.ArrayOfOpenAIResponseCustomToolCallOutputOutput1 = best.Value.([]OpenAIResponseCustomToolCallOutputOutput1) + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for OpenAIResponseCustomToolCallOutputOutput2", string(data)) +} + +func (u OpenAIResponseCustomToolCallOutputOutput2) MarshalJSON() ([]byte, error) { + if u.Str != nil { + return utils.MarshalJSON(u.Str, "", true) + } + + if u.ArrayOfOpenAIResponseCustomToolCallOutputOutput1 != nil { + return utils.MarshalJSON(u.ArrayOfOpenAIResponseCustomToolCallOutputOutput1, "", true) + } + + return nil, errors.New("could not marshal union type OpenAIResponseCustomToolCallOutputOutput2: all fields are null") +} + +type OpenAIResponseCustomToolCallOutputType string + +const ( + OpenAIResponseCustomToolCallOutputTypeCustomToolCallOutput OpenAIResponseCustomToolCallOutputType = "custom_tool_call_output" +) + +func (e OpenAIResponseCustomToolCallOutputType) ToPointer() *OpenAIResponseCustomToolCallOutputType { + return &e +} +func (e *OpenAIResponseCustomToolCallOutputType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "custom_tool_call_output": + *e = OpenAIResponseCustomToolCallOutputType(v) + return nil + default: + return fmt.Errorf("invalid value for OpenAIResponseCustomToolCallOutputType: %v", v) + } +} + +type OpenAIResponseCustomToolCallOutput struct { + CallID string `json:"call_id"` + ID *string `json:"id,omitzero"` + Output OpenAIResponseCustomToolCallOutputOutput2 `json:"output"` + Type OpenAIResponseCustomToolCallOutputType `json:"type"` +} + +func (o OpenAIResponseCustomToolCallOutput) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OpenAIResponseCustomToolCallOutput) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *OpenAIResponseCustomToolCallOutput) GetCallID() string { + if o == nil { + return "" + } + return o.CallID +} + +func (o *OpenAIResponseCustomToolCallOutput) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *OpenAIResponseCustomToolCallOutput) GetOutput() OpenAIResponseCustomToolCallOutputOutput2 { + if o == nil { + return OpenAIResponseCustomToolCallOutputOutput2{} + } + return o.Output +} + +func (o *OpenAIResponseCustomToolCallOutput) GetType() OpenAIResponseCustomToolCallOutputType { + if o == nil { + return OpenAIResponseCustomToolCallOutputType("") + } + return o.Type +} diff --git a/models/components/openairesponsefunctiontoolcall.go b/models/components/openairesponsefunctiontoolcall.go index bf32c61c..7a3f591f 100644 --- a/models/components/openairesponsefunctiontoolcall.go +++ b/models/components/openairesponsefunctiontoolcall.go @@ -32,10 +32,12 @@ func (e *OpenAIResponseFunctionToolCallType) UnmarshalJSON(data []byte) error { } type OpenAIResponseFunctionToolCall struct { - Arguments string `json:"arguments"` - CallID string `json:"call_id"` - ID *string `json:"id,omitzero"` - Name string `json:"name"` + Arguments string `json:"arguments"` + CallID string `json:"call_id"` + ID *string `json:"id,omitzero"` + Name string `json:"name"` + // Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) + Namespace *string `json:"namespace,omitzero"` Status *ToolCallStatus `json:"status,omitzero"` Type OpenAIResponseFunctionToolCallType `json:"type"` } @@ -79,6 +81,13 @@ func (o *OpenAIResponseFunctionToolCall) GetName() string { return o.Name } +func (o *OpenAIResponseFunctionToolCall) GetNamespace() *string { + if o == nil { + return nil + } + return o.Namespace +} + func (o *OpenAIResponseFunctionToolCall) GetStatus() *ToolCallStatus { if o == nil { return nil diff --git a/models/components/openairesponsestoolchoiceunion.go b/models/components/openairesponsestoolchoiceunion.go index 7b59b658..a58c2104 100644 --- a/models/components/openairesponsestoolchoiceunion.go +++ b/models/components/openairesponsestoolchoiceunion.go @@ -9,6 +9,96 @@ import ( "github.com/OpenRouterTeam/go-sdk/internal/utils" ) +type OpenAIResponsesToolChoiceTypeShell string + +const ( + OpenAIResponsesToolChoiceTypeShellShell OpenAIResponsesToolChoiceTypeShell = "shell" +) + +func (e OpenAIResponsesToolChoiceTypeShell) ToPointer() *OpenAIResponsesToolChoiceTypeShell { + return &e +} +func (e *OpenAIResponsesToolChoiceTypeShell) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "shell": + *e = OpenAIResponsesToolChoiceTypeShell(v) + return nil + default: + return fmt.Errorf("invalid value for OpenAIResponsesToolChoiceTypeShell: %v", v) + } +} + +type OpenAIResponsesToolChoiceShell struct { + Type OpenAIResponsesToolChoiceTypeShell `json:"type"` +} + +func (o OpenAIResponsesToolChoiceShell) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OpenAIResponsesToolChoiceShell) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *OpenAIResponsesToolChoiceShell) GetType() OpenAIResponsesToolChoiceTypeShell { + if o == nil { + return OpenAIResponsesToolChoiceTypeShell("") + } + return o.Type +} + +type OpenAIResponsesToolChoiceTypeApplyPatch string + +const ( + OpenAIResponsesToolChoiceTypeApplyPatchApplyPatch OpenAIResponsesToolChoiceTypeApplyPatch = "apply_patch" +) + +func (e OpenAIResponsesToolChoiceTypeApplyPatch) ToPointer() *OpenAIResponsesToolChoiceTypeApplyPatch { + return &e +} +func (e *OpenAIResponsesToolChoiceTypeApplyPatch) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "apply_patch": + *e = OpenAIResponsesToolChoiceTypeApplyPatch(v) + return nil + default: + return fmt.Errorf("invalid value for OpenAIResponsesToolChoiceTypeApplyPatch: %v", v) + } +} + +type OpenAIResponsesToolChoiceApplyPatch struct { + Type OpenAIResponsesToolChoiceTypeApplyPatch `json:"type"` +} + +func (o OpenAIResponsesToolChoiceApplyPatch) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OpenAIResponsesToolChoiceApplyPatch) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *OpenAIResponsesToolChoiceApplyPatch) GetType() OpenAIResponsesToolChoiceTypeApplyPatch { + if o == nil { + return OpenAIResponsesToolChoiceTypeApplyPatch("") + } + return o.Type +} + type OpenAIResponsesToolChoiceTypeWebSearchPreview string const ( @@ -291,21 +381,25 @@ func (e *OpenAIResponsesToolChoiceAuto) UnmarshalJSON(data []byte) error { type OpenAIResponsesToolChoiceUnionType string const ( - OpenAIResponsesToolChoiceUnionTypeOpenAIResponsesToolChoiceAuto OpenAIResponsesToolChoiceUnionType = "OpenAIResponsesToolChoice_Auto" - OpenAIResponsesToolChoiceUnionTypeOpenAIResponsesToolChoiceNone OpenAIResponsesToolChoiceUnionType = "OpenAIResponsesToolChoice_None" - OpenAIResponsesToolChoiceUnionTypeOpenAIResponsesToolChoiceRequired OpenAIResponsesToolChoiceUnionType = "OpenAIResponsesToolChoice_Required" - OpenAIResponsesToolChoiceUnionTypeOpenAIResponsesToolChoiceFunction OpenAIResponsesToolChoiceUnionType = "OpenAIResponsesToolChoice_Function" - OpenAIResponsesToolChoiceUnionTypeOpenAIResponsesToolChoice OpenAIResponsesToolChoiceUnionType = "OpenAIResponsesToolChoice" - OpenAIResponsesToolChoiceUnionTypeToolChoiceAllowed OpenAIResponsesToolChoiceUnionType = "ToolChoiceAllowed" + OpenAIResponsesToolChoiceUnionTypeOpenAIResponsesToolChoiceAuto OpenAIResponsesToolChoiceUnionType = "OpenAIResponsesToolChoice_Auto" + OpenAIResponsesToolChoiceUnionTypeOpenAIResponsesToolChoiceNone OpenAIResponsesToolChoiceUnionType = "OpenAIResponsesToolChoice_None" + OpenAIResponsesToolChoiceUnionTypeOpenAIResponsesToolChoiceRequired OpenAIResponsesToolChoiceUnionType = "OpenAIResponsesToolChoice_Required" + OpenAIResponsesToolChoiceUnionTypeOpenAIResponsesToolChoiceFunction OpenAIResponsesToolChoiceUnionType = "OpenAIResponsesToolChoice_Function" + OpenAIResponsesToolChoiceUnionTypeOpenAIResponsesToolChoice OpenAIResponsesToolChoiceUnionType = "OpenAIResponsesToolChoice" + OpenAIResponsesToolChoiceUnionTypeToolChoiceAllowed OpenAIResponsesToolChoiceUnionType = "ToolChoiceAllowed" + OpenAIResponsesToolChoiceUnionTypeOpenAIResponsesToolChoiceApplyPatch OpenAIResponsesToolChoiceUnionType = "OpenAIResponsesToolChoice_ApplyPatch" + OpenAIResponsesToolChoiceUnionTypeOpenAIResponsesToolChoiceShell OpenAIResponsesToolChoiceUnionType = "OpenAIResponsesToolChoice_Shell" ) type OpenAIResponsesToolChoiceUnion struct { - OpenAIResponsesToolChoiceAuto *OpenAIResponsesToolChoiceAuto `queryParam:"inline" union:"member"` - OpenAIResponsesToolChoiceNone *OpenAIResponsesToolChoiceNone `queryParam:"inline" union:"member"` - OpenAIResponsesToolChoiceRequired *OpenAIResponsesToolChoiceRequired `queryParam:"inline" union:"member"` - OpenAIResponsesToolChoiceFunction *OpenAIResponsesToolChoiceFunction `queryParam:"inline" union:"member"` - OpenAIResponsesToolChoice *OpenAIResponsesToolChoice `queryParam:"inline" union:"member"` - ToolChoiceAllowed *ToolChoiceAllowed `queryParam:"inline" union:"member"` + OpenAIResponsesToolChoiceAuto *OpenAIResponsesToolChoiceAuto `queryParam:"inline" union:"member"` + OpenAIResponsesToolChoiceNone *OpenAIResponsesToolChoiceNone `queryParam:"inline" union:"member"` + OpenAIResponsesToolChoiceRequired *OpenAIResponsesToolChoiceRequired `queryParam:"inline" union:"member"` + OpenAIResponsesToolChoiceFunction *OpenAIResponsesToolChoiceFunction `queryParam:"inline" union:"member"` + OpenAIResponsesToolChoice *OpenAIResponsesToolChoice `queryParam:"inline" union:"member"` + ToolChoiceAllowed *ToolChoiceAllowed `queryParam:"inline" union:"member"` + OpenAIResponsesToolChoiceApplyPatch *OpenAIResponsesToolChoiceApplyPatch `queryParam:"inline" union:"member"` + OpenAIResponsesToolChoiceShell *OpenAIResponsesToolChoiceShell `queryParam:"inline" union:"member"` Type OpenAIResponsesToolChoiceUnionType } @@ -364,6 +458,24 @@ func CreateOpenAIResponsesToolChoiceUnionToolChoiceAllowed(toolChoiceAllowed Too } } +func CreateOpenAIResponsesToolChoiceUnionOpenAIResponsesToolChoiceApplyPatch(openAIResponsesToolChoiceApplyPatch OpenAIResponsesToolChoiceApplyPatch) OpenAIResponsesToolChoiceUnion { + typ := OpenAIResponsesToolChoiceUnionTypeOpenAIResponsesToolChoiceApplyPatch + + return OpenAIResponsesToolChoiceUnion{ + OpenAIResponsesToolChoiceApplyPatch: &openAIResponsesToolChoiceApplyPatch, + Type: typ, + } +} + +func CreateOpenAIResponsesToolChoiceUnionOpenAIResponsesToolChoiceShell(openAIResponsesToolChoiceShell OpenAIResponsesToolChoiceShell) OpenAIResponsesToolChoiceUnion { + typ := OpenAIResponsesToolChoiceUnionTypeOpenAIResponsesToolChoiceShell + + return OpenAIResponsesToolChoiceUnion{ + OpenAIResponsesToolChoiceShell: &openAIResponsesToolChoiceShell, + Type: typ, + } +} + func (u *OpenAIResponsesToolChoiceUnion) UnmarshalJSON(data []byte) error { var candidates []utils.UnionCandidate @@ -417,6 +529,22 @@ func (u *OpenAIResponsesToolChoiceUnion) UnmarshalJSON(data []byte) error { }) } + var openAIResponsesToolChoiceApplyPatch OpenAIResponsesToolChoiceApplyPatch = OpenAIResponsesToolChoiceApplyPatch{} + if err := utils.UnmarshalJSON(data, &openAIResponsesToolChoiceApplyPatch, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: OpenAIResponsesToolChoiceUnionTypeOpenAIResponsesToolChoiceApplyPatch, + Value: &openAIResponsesToolChoiceApplyPatch, + }) + } + + var openAIResponsesToolChoiceShell OpenAIResponsesToolChoiceShell = OpenAIResponsesToolChoiceShell{} + if err := utils.UnmarshalJSON(data, &openAIResponsesToolChoiceShell, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: OpenAIResponsesToolChoiceUnionTypeOpenAIResponsesToolChoiceShell, + Value: &openAIResponsesToolChoiceShell, + }) + } + if len(candidates) == 0 { return fmt.Errorf("could not unmarshal `%s` into any supported union types for OpenAIResponsesToolChoiceUnion", string(data)) } @@ -448,6 +576,12 @@ func (u *OpenAIResponsesToolChoiceUnion) UnmarshalJSON(data []byte) error { case OpenAIResponsesToolChoiceUnionTypeToolChoiceAllowed: u.ToolChoiceAllowed = best.Value.(*ToolChoiceAllowed) return nil + case OpenAIResponsesToolChoiceUnionTypeOpenAIResponsesToolChoiceApplyPatch: + u.OpenAIResponsesToolChoiceApplyPatch = best.Value.(*OpenAIResponsesToolChoiceApplyPatch) + return nil + case OpenAIResponsesToolChoiceUnionTypeOpenAIResponsesToolChoiceShell: + u.OpenAIResponsesToolChoiceShell = best.Value.(*OpenAIResponsesToolChoiceShell) + return nil } return fmt.Errorf("could not unmarshal `%s` into any supported union types for OpenAIResponsesToolChoiceUnion", string(data)) @@ -478,5 +612,13 @@ func (u OpenAIResponsesToolChoiceUnion) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.ToolChoiceAllowed, "", true) } + if u.OpenAIResponsesToolChoiceApplyPatch != nil { + return utils.MarshalJSON(u.OpenAIResponsesToolChoiceApplyPatch, "", true) + } + + if u.OpenAIResponsesToolChoiceShell != nil { + return utils.MarshalJSON(u.OpenAIResponsesToolChoiceShell, "", true) + } + return nil, errors.New("could not marshal union type OpenAIResponsesToolChoiceUnion: all fields are null") } diff --git a/models/components/openresponsesresult.go b/models/components/openresponsesresult.go index 41869efa..f9cef544 100644 --- a/models/components/openresponsesresult.go +++ b/models/components/openresponsesresult.go @@ -310,7 +310,7 @@ func CreateOpenResponsesResultToolUnionApplyPatch(applyPatch ApplyPatchServerToo func CreateOpenResponsesResultToolUnionCustom(custom CustomTool) OpenResponsesResultToolUnion { typ := OpenResponsesResultToolUnionTypeCustom - typStr := TypeCustom(typ) + typStr := CustomToolTypeCustom(typ) custom.Type = typStr return OpenResponsesResultToolUnion{ @@ -588,8 +588,9 @@ type OpenResponsesResult struct { TopP *float64 `json:"top_p"` Truncation optionalnullable.OptionalNullable[Truncation] `json:"truncation,omitzero"` // Token usage information for the response - Usage optionalnullable.OptionalNullable[Usage] `json:"usage,omitzero"` - User optionalnullable.OptionalNullable[string] `json:"user,omitzero"` + Usage optionalnullable.OptionalNullable[Usage] `json:"usage,omitzero"` + User optionalnullable.OptionalNullable[string] `json:"user,omitzero"` + OpenrouterMetadata *OpenRouterMetadata `json:"openrouter_metadata,omitzero"` } func (o OpenResponsesResult) MarshalJSON() ([]byte, error) { @@ -840,3 +841,10 @@ func (o *OpenResponsesResult) GetUser() optionalnullable.OptionalNullable[string } return o.User } + +func (o *OpenResponsesResult) GetOpenrouterMetadata() *OpenRouterMetadata { + if o == nil { + return nil + } + return o.OpenrouterMetadata +} diff --git a/models/components/openroutermetadata.go b/models/components/openroutermetadata.go new file mode 100644 index 00000000..1f9ad357 --- /dev/null +++ b/models/components/openroutermetadata.go @@ -0,0 +1,101 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type OpenRouterMetadata struct { + Attempt int64 `json:"attempt"` + Attempts []RouterAttempt `json:"attempts,omitzero"` + Endpoints EndpointsMetadata `json:"endpoints"` + IsByok bool `json:"is_byok"` + Params *RouterParams `json:"params,omitzero"` + Pipeline []PipelineStage `json:"pipeline,omitzero"` + Region *string `json:"region"` + Requested string `json:"requested"` + Strategy RoutingStrategy `json:"strategy"` + Summary string `json:"summary"` +} + +func (o OpenRouterMetadata) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OpenRouterMetadata) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *OpenRouterMetadata) GetAttempt() int64 { + if o == nil { + return 0 + } + return o.Attempt +} + +func (o *OpenRouterMetadata) GetAttempts() []RouterAttempt { + if o == nil { + return nil + } + return o.Attempts +} + +func (o *OpenRouterMetadata) GetEndpoints() EndpointsMetadata { + if o == nil { + return EndpointsMetadata{} + } + return o.Endpoints +} + +func (o *OpenRouterMetadata) GetIsByok() bool { + if o == nil { + return false + } + return o.IsByok +} + +func (o *OpenRouterMetadata) GetParams() *RouterParams { + if o == nil { + return nil + } + return o.Params +} + +func (o *OpenRouterMetadata) GetPipeline() []PipelineStage { + if o == nil { + return nil + } + return o.Pipeline +} + +func (o *OpenRouterMetadata) GetRegion() *string { + if o == nil { + return nil + } + return o.Region +} + +func (o *OpenRouterMetadata) GetRequested() string { + if o == nil { + return "" + } + return o.Requested +} + +func (o *OpenRouterMetadata) GetStrategy() RoutingStrategy { + if o == nil { + return RoutingStrategy("") + } + return o.Strategy +} + +func (o *OpenRouterMetadata) GetSummary() string { + if o == nil { + return "" + } + return o.Summary +} diff --git a/models/components/outputadvisorservertoolitem.go b/models/components/outputadvisorservertoolitem.go new file mode 100644 index 00000000..74329453 --- /dev/null +++ b/models/components/outputadvisorservertoolitem.go @@ -0,0 +1,116 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type OutputAdvisorServerToolItemType string + +const ( + OutputAdvisorServerToolItemTypeOpenrouterAdvisor OutputAdvisorServerToolItemType = "openrouter:advisor" +) + +func (e OutputAdvisorServerToolItemType) ToPointer() *OutputAdvisorServerToolItemType { + return &e +} +func (e *OutputAdvisorServerToolItemType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "openrouter:advisor": + *e = OutputAdvisorServerToolItemType(v) + return nil + default: + return fmt.Errorf("invalid value for OutputAdvisorServerToolItemType: %v", v) + } +} + +// OutputAdvisorServerToolItem - An openrouter:advisor server tool output item +type OutputAdvisorServerToolItem struct { + // The advisor model's response (the advice text returned to the executor). + Advice *string `json:"advice,omitzero"` + // Error message when the advisor call did not produce advice. + Error *string `json:"error,omitzero"` + ID *string `json:"id,omitzero"` + // Provider-safe function name of the specific advisor instance that produced this item (e.g. `openrouter_advisor__1`). Present only when more than one advisor tool is configured; omitted for the default single advisor. Echo this field back unchanged so the advisor's cross-request memory stays namespaced to the correct instance. This identity is positional: it is derived from the index of the advisor entry in the request `tools` array, so clients must keep the order of advisor tool entries stable across requests in a conversation. Reordering or inserting advisor entries shifts these names and causes each advisor's cross-request memory to be attributed to the wrong instance. + InstanceName *string `json:"instance_name,omitzero"` + // Slug of the advisor model that was consulted. + Model *string `json:"model,omitzero"` + // The prompt the executor sent to the advisor. + Prompt *string `json:"prompt,omitzero"` + Status ToolCallStatus `json:"status"` + Type OutputAdvisorServerToolItemType `json:"type"` +} + +func (o OutputAdvisorServerToolItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OutputAdvisorServerToolItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *OutputAdvisorServerToolItem) GetAdvice() *string { + if o == nil { + return nil + } + return o.Advice +} + +func (o *OutputAdvisorServerToolItem) GetError() *string { + if o == nil { + return nil + } + return o.Error +} + +func (o *OutputAdvisorServerToolItem) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *OutputAdvisorServerToolItem) GetInstanceName() *string { + if o == nil { + return nil + } + return o.InstanceName +} + +func (o *OutputAdvisorServerToolItem) GetModel() *string { + if o == nil { + return nil + } + return o.Model +} + +func (o *OutputAdvisorServerToolItem) GetPrompt() *string { + if o == nil { + return nil + } + return o.Prompt +} + +func (o *OutputAdvisorServerToolItem) GetStatus() ToolCallStatus { + if o == nil { + return ToolCallStatus("") + } + return o.Status +} + +func (o *OutputAdvisorServerToolItem) GetType() OutputAdvisorServerToolItemType { + if o == nil { + return OutputAdvisorServerToolItemType("") + } + return o.Type +} diff --git a/models/components/outputapplypatchcallitem.go b/models/components/outputapplypatchcallitem.go new file mode 100644 index 00000000..d9a8b4bd --- /dev/null +++ b/models/components/outputapplypatchcallitem.go @@ -0,0 +1,101 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type OutputApplyPatchCallItemType string + +const ( + OutputApplyPatchCallItemTypeApplyPatchCall OutputApplyPatchCallItemType = "apply_patch_call" +) + +func (e OutputApplyPatchCallItemType) ToPointer() *OutputApplyPatchCallItemType { + return &e +} +func (e *OutputApplyPatchCallItemType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "apply_patch_call": + *e = OutputApplyPatchCallItemType(v) + return nil + default: + return fmt.Errorf("invalid value for OutputApplyPatchCallItemType: %v", v) + } +} + +// OutputApplyPatchCallItem - A native `apply_patch_call` output item matching OpenAI's Responses API shape. Emitted when the client requested the `apply_patch` shorthand. +type OutputApplyPatchCallItem struct { + CallID string `json:"call_id"` + ID string `json:"id"` + // The patch operation requested by an `apply_patch_call`. `create_file` and `update_file` carry a V4A diff; `delete_file` omits it. + Operation ApplyPatchCallOperation `json:"operation"` + // Lifecycle state of an `apply_patch_call` output item. + Status ApplyPatchCallStatus `json:"status"` + Type OutputApplyPatchCallItemType `json:"type"` +} + +func (o OutputApplyPatchCallItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OutputApplyPatchCallItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *OutputApplyPatchCallItem) GetCallID() string { + if o == nil { + return "" + } + return o.CallID +} + +func (o *OutputApplyPatchCallItem) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *OutputApplyPatchCallItem) GetOperation() ApplyPatchCallOperation { + if o == nil { + return ApplyPatchCallOperation{} + } + return o.Operation +} + +func (o *OutputApplyPatchCallItem) GetOperationCreateFile() *ApplyPatchCreateFileOperation { + return o.GetOperation().ApplyPatchCreateFileOperation +} + +func (o *OutputApplyPatchCallItem) GetOperationDeleteFile() *ApplyPatchDeleteFileOperation { + return o.GetOperation().ApplyPatchDeleteFileOperation +} + +func (o *OutputApplyPatchCallItem) GetOperationUpdateFile() *ApplyPatchUpdateFileOperation { + return o.GetOperation().ApplyPatchUpdateFileOperation +} + +func (o *OutputApplyPatchCallItem) GetStatus() ApplyPatchCallStatus { + if o == nil { + return ApplyPatchCallStatus("") + } + return o.Status +} + +func (o *OutputApplyPatchCallItem) GetType() OutputApplyPatchCallItemType { + if o == nil { + return OutputApplyPatchCallItemType("") + } + return o.Type +} diff --git a/models/components/outputapplypatchservertoolitem.go b/models/components/outputapplypatchservertoolitem.go index f41a5ca1..f9753fae 100644 --- a/models/components/outputapplypatchservertoolitem.go +++ b/models/components/outputapplypatchservertoolitem.go @@ -31,13 +31,14 @@ func (e *OutputApplyPatchServerToolItemType) UnmarshalJSON(data []byte) error { } } -// OutputApplyPatchServerToolItem - An openrouter:apply_patch server tool output item +// OutputApplyPatchServerToolItem - An openrouter:apply_patch server tool output item. The turn halts when validation succeeds so the client can apply the patch and echo an `apply_patch_call_output` on the next turn. type OutputApplyPatchServerToolItem struct { - FilePath *string `json:"filePath,omitzero"` - ID *string `json:"id,omitzero"` - Patch *string `json:"patch,omitzero"` - Status ToolCallStatus `json:"status"` - Type OutputApplyPatchServerToolItemType `json:"type"` + CallID *string `json:"call_id,omitzero"` + ID *string `json:"id,omitzero"` + // The patch operation requested by an `apply_patch_call`. `create_file` and `update_file` carry a V4A diff; `delete_file` omits it. + Operation *ApplyPatchCallOperation `json:"operation,omitzero"` + Status ToolCallStatus `json:"status"` + Type OutputApplyPatchServerToolItemType `json:"type"` } func (o OutputApplyPatchServerToolItem) MarshalJSON() ([]byte, error) { @@ -51,11 +52,11 @@ func (o *OutputApplyPatchServerToolItem) UnmarshalJSON(data []byte) error { return nil } -func (o *OutputApplyPatchServerToolItem) GetFilePath() *string { +func (o *OutputApplyPatchServerToolItem) GetCallID() *string { if o == nil { return nil } - return o.FilePath + return o.CallID } func (o *OutputApplyPatchServerToolItem) GetID() *string { @@ -65,11 +66,32 @@ func (o *OutputApplyPatchServerToolItem) GetID() *string { return o.ID } -func (o *OutputApplyPatchServerToolItem) GetPatch() *string { +func (o *OutputApplyPatchServerToolItem) GetOperation() *ApplyPatchCallOperation { if o == nil { return nil } - return o.Patch + return o.Operation +} + +func (o *OutputApplyPatchServerToolItem) GetOperationCreateFile() *ApplyPatchCreateFileOperation { + if v := o.GetOperation(); v != nil { + return v.ApplyPatchCreateFileOperation + } + return nil +} + +func (o *OutputApplyPatchServerToolItem) GetOperationDeleteFile() *ApplyPatchDeleteFileOperation { + if v := o.GetOperation(); v != nil { + return v.ApplyPatchDeleteFileOperation + } + return nil +} + +func (o *OutputApplyPatchServerToolItem) GetOperationUpdateFile() *ApplyPatchUpdateFileOperation { + if v := o.GetOperation(); v != nil { + return v.ApplyPatchUpdateFileOperation + } + return nil } func (o *OutputApplyPatchServerToolItem) GetStatus() ToolCallStatus { diff --git a/models/components/outputcodeinterpretercallitem.go b/models/components/outputcodeinterpretercallitem.go index 54138d87..b39c9f72 100644 --- a/models/components/outputcodeinterpretercallitem.go +++ b/models/components/outputcodeinterpretercallitem.go @@ -62,32 +62,32 @@ func (o *OutputLogs) GetType() TypeLogs { return o.Type } -type TypeImage string +type OutputCodeInterpreterCallItemTypeImage string const ( - TypeImageImage TypeImage = "image" + OutputCodeInterpreterCallItemTypeImageImage OutputCodeInterpreterCallItemTypeImage = "image" ) -func (e TypeImage) ToPointer() *TypeImage { +func (e OutputCodeInterpreterCallItemTypeImage) ToPointer() *OutputCodeInterpreterCallItemTypeImage { return &e } -func (e *TypeImage) UnmarshalJSON(data []byte) error { +func (e *OutputCodeInterpreterCallItemTypeImage) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err } switch v { case "image": - *e = TypeImage(v) + *e = OutputCodeInterpreterCallItemTypeImage(v) return nil default: - return fmt.Errorf("invalid value for TypeImage: %v", v) + return fmt.Errorf("invalid value for OutputCodeInterpreterCallItemTypeImage: %v", v) } } type OutputImage struct { - Type TypeImage `json:"type"` - URL string `json:"url"` + Type OutputCodeInterpreterCallItemTypeImage `json:"type"` + URL string `json:"url"` } func (o OutputImage) MarshalJSON() ([]byte, error) { @@ -101,9 +101,9 @@ func (o *OutputImage) UnmarshalJSON(data []byte) error { return nil } -func (o *OutputImage) GetType() TypeImage { +func (o *OutputImage) GetType() OutputCodeInterpreterCallItemTypeImage { if o == nil { - return TypeImage("") + return OutputCodeInterpreterCallItemTypeImage("") } return o.Type } @@ -134,7 +134,7 @@ type OutputCodeInterpreterCallItemOutputUnion struct { func CreateOutputCodeInterpreterCallItemOutputUnionImage(image OutputImage) OutputCodeInterpreterCallItemOutputUnion { typ := OutputCodeInterpreterCallItemOutputUnionTypeImage - typStr := TypeImage(typ) + typStr := OutputCodeInterpreterCallItemTypeImage(typ) image.Type = typStr return OutputCodeInterpreterCallItemOutputUnion{ diff --git a/models/components/outputcustomtoolcallitem.go b/models/components/outputcustomtoolcallitem.go new file mode 100644 index 00000000..a21b33c6 --- /dev/null +++ b/models/components/outputcustomtoolcallitem.go @@ -0,0 +1,96 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type OutputCustomToolCallItemType string + +const ( + OutputCustomToolCallItemTypeCustomToolCall OutputCustomToolCallItemType = "custom_tool_call" +) + +func (e OutputCustomToolCallItemType) ToPointer() *OutputCustomToolCallItemType { + return &e +} +func (e *OutputCustomToolCallItemType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "custom_tool_call": + *e = OutputCustomToolCallItemType(v) + return nil + default: + return fmt.Errorf("invalid value for OutputCustomToolCallItemType: %v", v) + } +} + +// OutputCustomToolCallItem - A call to a custom (freeform-grammar) tool created by the model — distinct from `function_call`. Used for tools like Codex CLI's `apply_patch` whose payload is opaque text rather than JSON arguments. +type OutputCustomToolCallItem struct { + CallID string `json:"call_id"` + ID *string `json:"id,omitzero"` + Input string `json:"input"` + Name string `json:"name"` + // Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) + Namespace *string `json:"namespace,omitzero"` + Type OutputCustomToolCallItemType `json:"type"` +} + +func (o OutputCustomToolCallItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OutputCustomToolCallItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *OutputCustomToolCallItem) GetCallID() string { + if o == nil { + return "" + } + return o.CallID +} + +func (o *OutputCustomToolCallItem) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *OutputCustomToolCallItem) GetInput() string { + if o == nil { + return "" + } + return o.Input +} + +func (o *OutputCustomToolCallItem) GetName() string { + if o == nil { + return "" + } + return o.Name +} + +func (o *OutputCustomToolCallItem) GetNamespace() *string { + if o == nil { + return nil + } + return o.Namespace +} + +func (o *OutputCustomToolCallItem) GetType() OutputCustomToolCallItemType { + if o == nil { + return OutputCustomToolCallItemType("") + } + return o.Type +} diff --git a/models/components/outputfunctioncallitem.go b/models/components/outputfunctioncallitem.go index 4bddecc1..95266edf 100644 --- a/models/components/outputfunctioncallitem.go +++ b/models/components/outputfunctioncallitem.go @@ -217,10 +217,12 @@ func (e *OutputFunctionCallItemType) UnmarshalJSON(data []byte) error { } type OutputFunctionCallItem struct { - Arguments string `json:"arguments"` - CallID string `json:"call_id"` - ID *string `json:"id,omitzero"` - Name string `json:"name"` + Arguments string `json:"arguments"` + CallID string `json:"call_id"` + ID *string `json:"id,omitzero"` + Name string `json:"name"` + // Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) + Namespace *string `json:"namespace,omitzero"` Status *OutputFunctionCallItemStatusUnion `json:"status,omitzero"` Type OutputFunctionCallItemType `json:"type"` } @@ -264,6 +266,13 @@ func (o *OutputFunctionCallItem) GetName() string { return o.Name } +func (o *OutputFunctionCallItem) GetNamespace() *string { + if o == nil { + return nil + } + return o.Namespace +} + func (o *OutputFunctionCallItem) GetStatus() *OutputFunctionCallItemStatusUnion { if o == nil { return nil diff --git a/models/components/outputfusionservertoolitem.go b/models/components/outputfusionservertoolitem.go new file mode 100644 index 00000000..daaca2f8 --- /dev/null +++ b/models/components/outputfusionservertoolitem.go @@ -0,0 +1,187 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type FailedModel struct { + // Error message describing why the model failed. + Error string `json:"error"` + // Slug of the analysis model that failed. + Model string `json:"model"` + // HTTP status code from the upstream response, when available (e.g. 402, 429). + StatusCode *int64 `json:"status_code,omitzero"` +} + +func (f FailedModel) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FailedModel) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &f, "", false, nil); err != nil { + return err + } + return nil +} + +func (f *FailedModel) GetError() string { + if f == nil { + return "" + } + return f.Error +} + +func (f *FailedModel) GetModel() string { + if f == nil { + return "" + } + return f.Model +} + +func (f *FailedModel) GetStatusCode() *int64 { + if f == nil { + return nil + } + return f.StatusCode +} + +type Response struct { + Content *string `json:"content,omitzero"` + Model string `json:"model"` +} + +func (r Response) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *Response) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *Response) GetContent() *string { + if r == nil { + return nil + } + return r.Content +} + +func (r *Response) GetModel() string { + if r == nil { + return "" + } + return r.Model +} + +type OutputFusionServerToolItemType string + +const ( + OutputFusionServerToolItemTypeOpenrouterFusion OutputFusionServerToolItemType = "openrouter:fusion" +) + +func (e OutputFusionServerToolItemType) ToPointer() *OutputFusionServerToolItemType { + return &e +} +func (e *OutputFusionServerToolItemType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "openrouter:fusion": + *e = OutputFusionServerToolItemType(v) + return nil + default: + return fmt.Errorf("invalid value for OutputFusionServerToolItemType: %v", v) + } +} + +// OutputFusionServerToolItem - An openrouter:fusion server tool output item +type OutputFusionServerToolItem struct { + // Structured analysis produced by the fusion judge model. + Analysis *FusionAnalysisResult `json:"analysis,omitzero"` + // Error message when the fusion run did not produce an analysis result. + Error *string `json:"error,omitzero"` + // Models that were requested as part of the analysis panel but did not produce a response. Present when at least one requested analysis model failed. The fusion result is still usable but was produced from a degraded panel. + FailedModels []FailedModel `json:"failed_models,omitzero"` + // Typed failure reason when the fusion run failed. Possible values include: all_panels_failed, insufficient_credits, rate_limited, judge_not_valid_json, judge_schema_mismatch, judge_upstream_error, judge_empty_completion. + FailureReason *string `json:"failure_reason,omitzero"` + ID *string `json:"id,omitzero"` + // Analysis models that produced a response in this fusion run, with each model's full panel content. + Responses []Response `json:"responses,omitzero"` + Status ToolCallStatus `json:"status"` + Type OutputFusionServerToolItemType `json:"type"` +} + +func (o OutputFusionServerToolItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OutputFusionServerToolItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *OutputFusionServerToolItem) GetAnalysis() *FusionAnalysisResult { + if o == nil { + return nil + } + return o.Analysis +} + +func (o *OutputFusionServerToolItem) GetError() *string { + if o == nil { + return nil + } + return o.Error +} + +func (o *OutputFusionServerToolItem) GetFailedModels() []FailedModel { + if o == nil { + return nil + } + return o.FailedModels +} + +func (o *OutputFusionServerToolItem) GetFailureReason() *string { + if o == nil { + return nil + } + return o.FailureReason +} + +func (o *OutputFusionServerToolItem) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *OutputFusionServerToolItem) GetResponses() []Response { + if o == nil { + return nil + } + return o.Responses +} + +func (o *OutputFusionServerToolItem) GetStatus() ToolCallStatus { + if o == nil { + return ToolCallStatus("") + } + return o.Status +} + +func (o *OutputFusionServerToolItem) GetType() OutputFusionServerToolItemType { + if o == nil { + return OutputFusionServerToolItemType("") + } + return o.Type +} diff --git a/models/components/outputitems.go b/models/components/outputitems.go index c1479c90..9536c276 100644 --- a/models/components/outputitems.go +++ b/models/components/outputitems.go @@ -12,12 +12,15 @@ import ( type OutputItemsType string const ( + OutputItemsTypeApplyPatchCall OutputItemsType = "apply_patch_call" OutputItemsTypeCodeInterpreterCall OutputItemsType = "code_interpreter_call" OutputItemsTypeComputerCall OutputItemsType = "computer_call" + OutputItemsTypeCustomToolCall OutputItemsType = "custom_tool_call" OutputItemsTypeFileSearchCall OutputItemsType = "file_search_call" OutputItemsTypeFunctionCall OutputItemsType = "function_call" OutputItemsTypeImageGenerationCall OutputItemsType = "image_generation_call" OutputItemsTypeMessage OutputItemsType = "message" + OutputItemsTypeOpenrouterAdvisor OutputItemsType = "openrouter:advisor" OutputItemsTypeOpenrouterApplyPatch OutputItemsType = "openrouter:apply_patch" OutputItemsTypeOpenrouterBash OutputItemsType = "openrouter:bash" OutputItemsTypeOpenrouterBrowserUse OutputItemsType = "openrouter:browser_use" @@ -25,14 +28,18 @@ const ( OutputItemsTypeOpenrouterDatetime OutputItemsType = "openrouter:datetime" OutputItemsTypeOpenrouterExperimentalSearchModels OutputItemsType = "openrouter:experimental__search_models" OutputItemsTypeOpenrouterFileSearch OutputItemsType = "openrouter:file_search" + OutputItemsTypeOpenrouterFusion OutputItemsType = "openrouter:fusion" OutputItemsTypeOpenrouterImageGeneration OutputItemsType = "openrouter:image_generation" OutputItemsTypeOpenrouterMcp OutputItemsType = "openrouter:mcp" OutputItemsTypeOpenrouterMemory OutputItemsType = "openrouter:memory" + OutputItemsTypeOpenrouterSubagent OutputItemsType = "openrouter:subagent" OutputItemsTypeOpenrouterTextEditor OutputItemsType = "openrouter:text_editor" OutputItemsTypeOpenrouterToolSearch OutputItemsType = "openrouter:tool_search" OutputItemsTypeOpenrouterWebFetch OutputItemsType = "openrouter:web_fetch" OutputItemsTypeOpenrouterWebSearch OutputItemsType = "openrouter:web_search" OutputItemsTypeReasoning OutputItemsType = "reasoning" + OutputItemsTypeShellCall OutputItemsType = "shell_call" + OutputItemsTypeShellCallOutput OutputItemsType = "shell_call_output" OutputItemsTypeWebSearchCall OutputItemsType = "web_search_call" OutputItemsTypeUnknown OutputItemsType = "UNKNOWN" ) @@ -56,16 +63,35 @@ type OutputItems struct { OutputBashServerToolItem *OutputBashServerToolItem `queryParam:"inline" union:"member"` OutputTextEditorServerToolItem *OutputTextEditorServerToolItem `queryParam:"inline" union:"member"` OutputApplyPatchServerToolItem *OutputApplyPatchServerToolItem `queryParam:"inline" union:"member"` + OutputApplyPatchCallItem *OutputApplyPatchCallItem `queryParam:"inline" union:"member"` + OutputShellCallItem *OutputShellCallItem `queryParam:"inline" union:"member"` + OutputShellCallOutputItem *OutputShellCallOutputItem `queryParam:"inline" union:"member"` OutputWebFetchServerToolItem *OutputWebFetchServerToolItem `queryParam:"inline" union:"member"` OutputToolSearchServerToolItem *OutputToolSearchServerToolItem `queryParam:"inline" union:"member"` OutputMemoryServerToolItem *OutputMemoryServerToolItem `queryParam:"inline" union:"member"` OutputMcpServerToolItem *OutputMcpServerToolItem `queryParam:"inline" union:"member"` OutputSearchModelsServerToolItem *OutputSearchModelsServerToolItem `queryParam:"inline" union:"member"` + OutputFusionServerToolItem *OutputFusionServerToolItem `queryParam:"inline" union:"member"` + OutputAdvisorServerToolItem *OutputAdvisorServerToolItem `queryParam:"inline" union:"member"` + OutputSubagentServerToolItem *OutputSubagentServerToolItem `queryParam:"inline" union:"member"` + OutputCustomToolCallItem *OutputCustomToolCallItem `queryParam:"inline" union:"member"` UnknownRaw json.RawMessage `json:"-" union:"unknown"` Type OutputItemsType } +func CreateOutputItemsApplyPatchCall(applyPatchCall OutputApplyPatchCallItem) OutputItems { + typ := OutputItemsTypeApplyPatchCall + + typStr := OutputApplyPatchCallItemType(typ) + applyPatchCall.Type = typStr + + return OutputItems{ + OutputApplyPatchCallItem: &applyPatchCall, + Type: typ, + } +} + func CreateOutputItemsCodeInterpreterCall(codeInterpreterCall OutputCodeInterpreterCallItem) OutputItems { typ := OutputItemsTypeCodeInterpreterCall @@ -90,6 +116,18 @@ func CreateOutputItemsComputerCall(computerCall OutputComputerCallItem) OutputIt } } +func CreateOutputItemsCustomToolCall(customToolCall OutputCustomToolCallItem) OutputItems { + typ := OutputItemsTypeCustomToolCall + + typStr := OutputCustomToolCallItemType(typ) + customToolCall.Type = typStr + + return OutputItems{ + OutputCustomToolCallItem: &customToolCall, + Type: typ, + } +} + func CreateOutputItemsFileSearchCall(fileSearchCall OutputFileSearchCallItem) OutputItems { typ := OutputItemsTypeFileSearchCall @@ -138,6 +176,18 @@ func CreateOutputItemsMessage(message OutputMessageItem) OutputItems { } } +func CreateOutputItemsOpenrouterAdvisor(openrouterAdvisor OutputAdvisorServerToolItem) OutputItems { + typ := OutputItemsTypeOpenrouterAdvisor + + typStr := OutputAdvisorServerToolItemType(typ) + openrouterAdvisor.Type = typStr + + return OutputItems{ + OutputAdvisorServerToolItem: &openrouterAdvisor, + Type: typ, + } +} + func CreateOutputItemsOpenrouterApplyPatch(openrouterApplyPatch OutputApplyPatchServerToolItem) OutputItems { typ := OutputItemsTypeOpenrouterApplyPatch @@ -222,6 +272,18 @@ func CreateOutputItemsOpenrouterFileSearch(openrouterFileSearch OutputFileSearch } } +func CreateOutputItemsOpenrouterFusion(openrouterFusion OutputFusionServerToolItem) OutputItems { + typ := OutputItemsTypeOpenrouterFusion + + typStr := OutputFusionServerToolItemType(typ) + openrouterFusion.Type = typStr + + return OutputItems{ + OutputFusionServerToolItem: &openrouterFusion, + Type: typ, + } +} + func CreateOutputItemsOpenrouterImageGeneration(openrouterImageGeneration OutputImageGenerationServerToolItem) OutputItems { typ := OutputItemsTypeOpenrouterImageGeneration @@ -258,6 +320,18 @@ func CreateOutputItemsOpenrouterMemory(openrouterMemory OutputMemoryServerToolIt } } +func CreateOutputItemsOpenrouterSubagent(openrouterSubagent OutputSubagentServerToolItem) OutputItems { + typ := OutputItemsTypeOpenrouterSubagent + + typStr := OutputSubagentServerToolItemType(typ) + openrouterSubagent.Type = typStr + + return OutputItems{ + OutputSubagentServerToolItem: &openrouterSubagent, + Type: typ, + } +} + func CreateOutputItemsOpenrouterTextEditor(openrouterTextEditor OutputTextEditorServerToolItem) OutputItems { typ := OutputItemsTypeOpenrouterTextEditor @@ -297,7 +371,7 @@ func CreateOutputItemsOpenrouterWebFetch(openrouterWebFetch OutputWebFetchServer func CreateOutputItemsOpenrouterWebSearch(openrouterWebSearch OutputWebSearchServerToolItem) OutputItems { typ := OutputItemsTypeOpenrouterWebSearch - typStr := OutputWebSearchServerToolItemType(typ) + typStr := OutputWebSearchServerToolItemTypeOpenrouterWebSearch(typ) openrouterWebSearch.Type = typStr return OutputItems{ @@ -318,6 +392,30 @@ func CreateOutputItemsReasoning(reasoning OutputReasoningItem) OutputItems { } } +func CreateOutputItemsShellCall(shellCall OutputShellCallItem) OutputItems { + typ := OutputItemsTypeShellCall + + typStr := OutputShellCallItemType(typ) + shellCall.Type = typStr + + return OutputItems{ + OutputShellCallItem: &shellCall, + Type: typ, + } +} + +func CreateOutputItemsShellCallOutput(shellCallOutput OutputShellCallOutputItem) OutputItems { + typ := OutputItemsTypeShellCallOutput + + typStr := OutputShellCallOutputItemTypeShellCallOutput(typ) + shellCallOutput.Type = typStr + + return OutputItems{ + OutputShellCallOutputItem: &shellCallOutput, + Type: typ, + } +} + func CreateOutputItemsWebSearchCall(webSearchCall OutputWebSearchCallItem) OutputItems { typ := OutputItemsTypeWebSearchCall @@ -364,6 +462,15 @@ func (u *OutputItems) UnmarshalJSON(data []byte) error { } switch dis.Type { + case "apply_patch_call": + outputApplyPatchCallItem := new(OutputApplyPatchCallItem) + if err := utils.UnmarshalJSON(data, &outputApplyPatchCallItem, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == apply_patch_call) type OutputApplyPatchCallItem within OutputItems: %w", string(data), err) + } + + u.OutputApplyPatchCallItem = outputApplyPatchCallItem + u.Type = OutputItemsTypeApplyPatchCall + return nil case "code_interpreter_call": outputCodeInterpreterCallItem := new(OutputCodeInterpreterCallItem) if err := utils.UnmarshalJSON(data, &outputCodeInterpreterCallItem, "", true, nil); err != nil { @@ -382,6 +489,15 @@ func (u *OutputItems) UnmarshalJSON(data []byte) error { u.OutputComputerCallItem = outputComputerCallItem u.Type = OutputItemsTypeComputerCall return nil + case "custom_tool_call": + outputCustomToolCallItem := new(OutputCustomToolCallItem) + if err := utils.UnmarshalJSON(data, &outputCustomToolCallItem, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == custom_tool_call) type OutputCustomToolCallItem within OutputItems: %w", string(data), err) + } + + u.OutputCustomToolCallItem = outputCustomToolCallItem + u.Type = OutputItemsTypeCustomToolCall + return nil case "file_search_call": outputFileSearchCallItem := new(OutputFileSearchCallItem) if err := utils.UnmarshalJSON(data, &outputFileSearchCallItem, "", true, nil); err != nil { @@ -418,6 +534,15 @@ func (u *OutputItems) UnmarshalJSON(data []byte) error { u.OutputMessageItem = outputMessageItem u.Type = OutputItemsTypeMessage return nil + case "openrouter:advisor": + outputAdvisorServerToolItem := new(OutputAdvisorServerToolItem) + if err := utils.UnmarshalJSON(data, &outputAdvisorServerToolItem, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == openrouter:advisor) type OutputAdvisorServerToolItem within OutputItems: %w", string(data), err) + } + + u.OutputAdvisorServerToolItem = outputAdvisorServerToolItem + u.Type = OutputItemsTypeOpenrouterAdvisor + return nil case "openrouter:apply_patch": outputApplyPatchServerToolItem := new(OutputApplyPatchServerToolItem) if err := utils.UnmarshalJSON(data, &outputApplyPatchServerToolItem, "", true, nil); err != nil { @@ -481,6 +606,15 @@ func (u *OutputItems) UnmarshalJSON(data []byte) error { u.OutputFileSearchServerToolItem = outputFileSearchServerToolItem u.Type = OutputItemsTypeOpenrouterFileSearch return nil + case "openrouter:fusion": + outputFusionServerToolItem := new(OutputFusionServerToolItem) + if err := utils.UnmarshalJSON(data, &outputFusionServerToolItem, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == openrouter:fusion) type OutputFusionServerToolItem within OutputItems: %w", string(data), err) + } + + u.OutputFusionServerToolItem = outputFusionServerToolItem + u.Type = OutputItemsTypeOpenrouterFusion + return nil case "openrouter:image_generation": outputImageGenerationServerToolItem := new(OutputImageGenerationServerToolItem) if err := utils.UnmarshalJSON(data, &outputImageGenerationServerToolItem, "", true, nil); err != nil { @@ -508,6 +642,15 @@ func (u *OutputItems) UnmarshalJSON(data []byte) error { u.OutputMemoryServerToolItem = outputMemoryServerToolItem u.Type = OutputItemsTypeOpenrouterMemory return nil + case "openrouter:subagent": + outputSubagentServerToolItem := new(OutputSubagentServerToolItem) + if err := utils.UnmarshalJSON(data, &outputSubagentServerToolItem, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == openrouter:subagent) type OutputSubagentServerToolItem within OutputItems: %w", string(data), err) + } + + u.OutputSubagentServerToolItem = outputSubagentServerToolItem + u.Type = OutputItemsTypeOpenrouterSubagent + return nil case "openrouter:text_editor": outputTextEditorServerToolItem := new(OutputTextEditorServerToolItem) if err := utils.UnmarshalJSON(data, &outputTextEditorServerToolItem, "", true, nil); err != nil { @@ -553,6 +696,24 @@ func (u *OutputItems) UnmarshalJSON(data []byte) error { u.OutputReasoningItem = outputReasoningItem u.Type = OutputItemsTypeReasoning return nil + case "shell_call": + outputShellCallItem := new(OutputShellCallItem) + if err := utils.UnmarshalJSON(data, &outputShellCallItem, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == shell_call) type OutputShellCallItem within OutputItems: %w", string(data), err) + } + + u.OutputShellCallItem = outputShellCallItem + u.Type = OutputItemsTypeShellCall + return nil + case "shell_call_output": + outputShellCallOutputItem := new(OutputShellCallOutputItem) + if err := utils.UnmarshalJSON(data, &outputShellCallOutputItem, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == shell_call_output) type OutputShellCallOutputItem within OutputItems: %w", string(data), err) + } + + u.OutputShellCallOutputItem = outputShellCallOutputItem + u.Type = OutputItemsTypeShellCallOutput + return nil case "web_search_call": outputWebSearchCallItem := new(OutputWebSearchCallItem) if err := utils.UnmarshalJSON(data, &outputWebSearchCallItem, "", true, nil); err != nil { @@ -639,6 +800,18 @@ func (u OutputItems) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.OutputApplyPatchServerToolItem, "", true) } + if u.OutputApplyPatchCallItem != nil { + return utils.MarshalJSON(u.OutputApplyPatchCallItem, "", true) + } + + if u.OutputShellCallItem != nil { + return utils.MarshalJSON(u.OutputShellCallItem, "", true) + } + + if u.OutputShellCallOutputItem != nil { + return utils.MarshalJSON(u.OutputShellCallOutputItem, "", true) + } + if u.OutputWebFetchServerToolItem != nil { return utils.MarshalJSON(u.OutputWebFetchServerToolItem, "", true) } @@ -659,6 +832,22 @@ func (u OutputItems) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.OutputSearchModelsServerToolItem, "", true) } + if u.OutputFusionServerToolItem != nil { + return utils.MarshalJSON(u.OutputFusionServerToolItem, "", true) + } + + if u.OutputAdvisorServerToolItem != nil { + return utils.MarshalJSON(u.OutputAdvisorServerToolItem, "", true) + } + + if u.OutputSubagentServerToolItem != nil { + return utils.MarshalJSON(u.OutputSubagentServerToolItem, "", true) + } + + if u.OutputCustomToolCallItem != nil { + return utils.MarshalJSON(u.OutputCustomToolCallItem, "", true) + } + if u.UnknownRaw != nil { return json.RawMessage(u.UnknownRaw), nil } diff --git a/models/components/outputmodality.go b/models/components/outputmodality.go index e248871e..3edcbcd7 100644 --- a/models/components/outputmodality.go +++ b/models/components/outputmodality.go @@ -5,13 +5,14 @@ package components type OutputModality string const ( - OutputModalityText OutputModality = "text" - OutputModalityImage OutputModality = "image" - OutputModalityEmbeddings OutputModality = "embeddings" - OutputModalityAudio OutputModality = "audio" - OutputModalityVideo OutputModality = "video" - OutputModalityRerank OutputModality = "rerank" - OutputModalityTts OutputModality = "tts" + OutputModalityText OutputModality = "text" + OutputModalityImage OutputModality = "image" + OutputModalityEmbeddings OutputModality = "embeddings" + OutputModalityAudio OutputModality = "audio" + OutputModalityVideo OutputModality = "video" + OutputModalityRerank OutputModality = "rerank" + OutputModalitySpeech OutputModality = "speech" + OutputModalityTranscription OutputModality = "transcription" ) func (e OutputModality) ToPointer() *OutputModality { @@ -22,7 +23,7 @@ func (e OutputModality) ToPointer() *OutputModality { func (e *OutputModality) IsExact() bool { if e != nil { switch *e { - case "text", "image", "embeddings", "audio", "video", "rerank", "tts": + case "text", "image", "embeddings", "audio", "video", "rerank", "speech", "transcription": return true } } diff --git a/models/components/outputshellcallitem.go b/models/components/outputshellcallitem.go new file mode 100644 index 00000000..873bc989 --- /dev/null +++ b/models/components/outputshellcallitem.go @@ -0,0 +1,126 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type OutputShellCallItemAction struct { + Commands []string `json:"commands"` + MaxOutputLength *int64 `json:"max_output_length"` + TimeoutMs *int64 `json:"timeout_ms"` +} + +func (o OutputShellCallItemAction) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OutputShellCallItemAction) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *OutputShellCallItemAction) GetCommands() []string { + if o == nil { + return []string{} + } + return o.Commands +} + +func (o *OutputShellCallItemAction) GetMaxOutputLength() *int64 { + if o == nil { + return nil + } + return o.MaxOutputLength +} + +func (o *OutputShellCallItemAction) GetTimeoutMs() *int64 { + if o == nil { + return nil + } + return o.TimeoutMs +} + +type OutputShellCallItemType string + +const ( + OutputShellCallItemTypeShellCall OutputShellCallItemType = "shell_call" +) + +func (e OutputShellCallItemType) ToPointer() *OutputShellCallItemType { + return &e +} +func (e *OutputShellCallItemType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "shell_call": + *e = OutputShellCallItemType(v) + return nil + default: + return fmt.Errorf("invalid value for OutputShellCallItemType: %v", v) + } +} + +// OutputShellCallItem - A native `shell_call` output item matching OpenAI's Responses API shape. Emitted for the sandbox-backed `shell` tool. +type OutputShellCallItem struct { + Action *OutputShellCallItemAction `json:"action,omitzero"` + CallID string `json:"call_id"` + ID string `json:"id"` + // Status of a shell call or its output. + Status ShellCallStatus `json:"status"` + Type OutputShellCallItemType `json:"type"` +} + +func (o OutputShellCallItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OutputShellCallItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *OutputShellCallItem) GetAction() *OutputShellCallItemAction { + if o == nil { + return nil + } + return o.Action +} + +func (o *OutputShellCallItem) GetCallID() string { + if o == nil { + return "" + } + return o.CallID +} + +func (o *OutputShellCallItem) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *OutputShellCallItem) GetStatus() ShellCallStatus { + if o == nil { + return ShellCallStatus("") + } + return o.Status +} + +func (o *OutputShellCallItem) GetType() OutputShellCallItemType { + if o == nil { + return OutputShellCallItemType("") + } + return o.Type +} diff --git a/models/components/outputshellcalloutputitem.go b/models/components/outputshellcalloutputitem.go new file mode 100644 index 00000000..ca228a98 --- /dev/null +++ b/models/components/outputshellcalloutputitem.go @@ -0,0 +1,357 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "errors" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type TypeTimeout string + +const ( + TypeTimeoutTimeout TypeTimeout = "timeout" +) + +func (e TypeTimeout) ToPointer() *TypeTimeout { + return &e +} +func (e *TypeTimeout) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "timeout": + *e = TypeTimeout(v) + return nil + default: + return fmt.Errorf("invalid value for TypeTimeout: %v", v) + } +} + +type OutcomeTimeout struct { + Type TypeTimeout `json:"type"` +} + +func (o OutcomeTimeout) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OutcomeTimeout) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *OutcomeTimeout) GetType() TypeTimeout { + if o == nil { + return TypeTimeout("") + } + return o.Type +} + +type TypeExit string + +const ( + TypeExitExit TypeExit = "exit" +) + +func (e TypeExit) ToPointer() *TypeExit { + return &e +} +func (e *TypeExit) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "exit": + *e = TypeExit(v) + return nil + default: + return fmt.Errorf("invalid value for TypeExit: %v", v) + } +} + +type OutcomeExit struct { + ExitCode int64 `json:"exit_code"` + Type TypeExit `json:"type"` +} + +func (o OutcomeExit) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OutcomeExit) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *OutcomeExit) GetExitCode() int64 { + if o == nil { + return 0 + } + return o.ExitCode +} + +func (o *OutcomeExit) GetType() TypeExit { + if o == nil { + return TypeExit("") + } + return o.Type +} + +type OutcomeType string + +const ( + OutcomeTypeExit OutcomeType = "exit" + OutcomeTypeTimeoutObj OutcomeType = "timeout" + OutcomeTypeUnknown OutcomeType = "UNKNOWN" +) + +type Outcome struct { + OutcomeExit *OutcomeExit `queryParam:"inline" union:"member"` + OutcomeTimeout *OutcomeTimeout `queryParam:"inline" union:"member"` + UnknownRaw json.RawMessage `json:"-" union:"unknown"` + + Type OutcomeType +} + +func CreateOutcomeExit(exit OutcomeExit) Outcome { + typ := OutcomeTypeExit + + typStr := TypeExit(typ) + exit.Type = typStr + + return Outcome{ + OutcomeExit: &exit, + Type: typ, + } +} + +func CreateOutcomeTimeoutObj(timeoutT OutcomeTimeout) Outcome { + typ := OutcomeTypeTimeoutObj + + typStr := TypeTimeout(typ) + timeoutT.Type = typStr + + return Outcome{ + OutcomeTimeout: &timeoutT, + Type: typ, + } +} + +func CreateOutcomeUnknown(raw json.RawMessage) Outcome { + return Outcome{ + UnknownRaw: raw, + Type: OutcomeTypeUnknown, + } +} + +func (u Outcome) GetUnknownRaw() json.RawMessage { + return u.UnknownRaw +} + +func (u Outcome) IsUnknown() bool { + return u.Type == OutcomeTypeUnknown +} + +func (u *Outcome) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + u.UnknownRaw = json.RawMessage(data) + u.Type = OutcomeTypeUnknown + return nil + } + if dis == nil { + u.UnknownRaw = json.RawMessage(data) + u.Type = OutcomeTypeUnknown + return nil + } + + switch dis.Type { + case "exit": + outcomeExit := new(OutcomeExit) + if err := utils.UnmarshalJSON(data, &outcomeExit, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == exit) type OutcomeExit within Outcome: %w", string(data), err) + } + + u.OutcomeExit = outcomeExit + u.Type = OutcomeTypeExit + return nil + case "timeout": + outcomeTimeout := new(OutcomeTimeout) + if err := utils.UnmarshalJSON(data, &outcomeTimeout, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == timeout) type OutcomeTimeout within Outcome: %w", string(data), err) + } + + u.OutcomeTimeout = outcomeTimeout + u.Type = OutcomeTypeTimeoutObj + return nil + default: + u.UnknownRaw = json.RawMessage(data) + u.Type = OutcomeTypeUnknown + return nil + } + +} + +func (u Outcome) MarshalJSON() ([]byte, error) { + if u.OutcomeExit != nil { + return utils.MarshalJSON(u.OutcomeExit, "", true) + } + + if u.OutcomeTimeout != nil { + return utils.MarshalJSON(u.OutcomeTimeout, "", true) + } + + if u.UnknownRaw != nil { + return json.RawMessage(u.UnknownRaw), nil + } + return nil, errors.New("could not marshal union type Outcome: all fields are null") +} + +type OutputShellCallOutputItemOutput struct { + Outcome Outcome `json:"outcome"` + Stderr string `json:"stderr"` + Stdout string `json:"stdout"` +} + +func (o OutputShellCallOutputItemOutput) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OutputShellCallOutputItemOutput) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *OutputShellCallOutputItemOutput) GetOutcome() Outcome { + if o == nil { + return Outcome{} + } + return o.Outcome +} + +func (o *OutputShellCallOutputItemOutput) GetOutcomeExit() *OutcomeExit { + return o.GetOutcome().OutcomeExit +} + +func (o *OutputShellCallOutputItemOutput) GetOutcomeTimeoutObj() *OutcomeTimeout { + return o.GetOutcome().OutcomeTimeout +} + +func (o *OutputShellCallOutputItemOutput) GetStderr() string { + if o == nil { + return "" + } + return o.Stderr +} + +func (o *OutputShellCallOutputItemOutput) GetStdout() string { + if o == nil { + return "" + } + return o.Stdout +} + +type OutputShellCallOutputItemTypeShellCallOutput string + +const ( + OutputShellCallOutputItemTypeShellCallOutputShellCallOutput OutputShellCallOutputItemTypeShellCallOutput = "shell_call_output" +) + +func (e OutputShellCallOutputItemTypeShellCallOutput) ToPointer() *OutputShellCallOutputItemTypeShellCallOutput { + return &e +} +func (e *OutputShellCallOutputItemTypeShellCallOutput) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "shell_call_output": + *e = OutputShellCallOutputItemTypeShellCallOutput(v) + return nil + default: + return fmt.Errorf("invalid value for OutputShellCallOutputItemTypeShellCallOutput: %v", v) + } +} + +// OutputShellCallOutputItem - A native `shell_call_output` item matching OpenAI's Responses API shape. Carries per-command stdout, stderr, and the exit/timeout outcome. +type OutputShellCallOutputItem struct { + CallID string `json:"call_id"` + ID string `json:"id"` + MaxOutputLength optionalnullable.OptionalNullable[int64] `json:"max_output_length,omitzero"` + Output []OutputShellCallOutputItemOutput `json:"output"` + // Status of a shell call or its output. + Status ShellCallStatus `json:"status"` + Type OutputShellCallOutputItemTypeShellCallOutput `json:"type"` +} + +func (o OutputShellCallOutputItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OutputShellCallOutputItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *OutputShellCallOutputItem) GetCallID() string { + if o == nil { + return "" + } + return o.CallID +} + +func (o *OutputShellCallOutputItem) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *OutputShellCallOutputItem) GetMaxOutputLength() optionalnullable.OptionalNullable[int64] { + if o == nil { + return nil + } + return o.MaxOutputLength +} + +func (o *OutputShellCallOutputItem) GetOutput() []OutputShellCallOutputItemOutput { + if o == nil { + return []OutputShellCallOutputItemOutput{} + } + return o.Output +} + +func (o *OutputShellCallOutputItem) GetStatus() ShellCallStatus { + if o == nil { + return ShellCallStatus("") + } + return o.Status +} + +func (o *OutputShellCallOutputItem) GetType() OutputShellCallOutputItemTypeShellCallOutput { + if o == nil { + return OutputShellCallOutputItemTypeShellCallOutput("") + } + return o.Type +} diff --git a/models/components/outputsubagentservertoolitem.go b/models/components/outputsubagentservertoolitem.go new file mode 100644 index 00000000..9cf56fec --- /dev/null +++ b/models/components/outputsubagentservertoolitem.go @@ -0,0 +1,116 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type OutputSubagentServerToolItemType string + +const ( + OutputSubagentServerToolItemTypeOpenrouterSubagent OutputSubagentServerToolItemType = "openrouter:subagent" +) + +func (e OutputSubagentServerToolItemType) ToPointer() *OutputSubagentServerToolItemType { + return &e +} +func (e *OutputSubagentServerToolItemType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "openrouter:subagent": + *e = OutputSubagentServerToolItemType(v) + return nil + default: + return fmt.Errorf("invalid value for OutputSubagentServerToolItemType: %v", v) + } +} + +// OutputSubagentServerToolItem - An openrouter:subagent server tool output item +type OutputSubagentServerToolItem struct { + // Error message when the subagent task did not produce an outcome. + Error *string `json:"error,omitzero"` + ID *string `json:"id,omitzero"` + // Slug of the worker model that executed the task. + Model *string `json:"model,omitzero"` + // The worker model's result (the outcome text returned to the delegating model). + Outcome *string `json:"outcome,omitzero"` + Status ToolCallStatus `json:"status"` + // The task description the delegating model sent to the worker. + TaskDescription *string `json:"task_description,omitzero"` + // The short task identifier the delegating model supplied. + TaskName *string `json:"task_name,omitzero"` + Type OutputSubagentServerToolItemType `json:"type"` +} + +func (o OutputSubagentServerToolItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OutputSubagentServerToolItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *OutputSubagentServerToolItem) GetError() *string { + if o == nil { + return nil + } + return o.Error +} + +func (o *OutputSubagentServerToolItem) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *OutputSubagentServerToolItem) GetModel() *string { + if o == nil { + return nil + } + return o.Model +} + +func (o *OutputSubagentServerToolItem) GetOutcome() *string { + if o == nil { + return nil + } + return o.Outcome +} + +func (o *OutputSubagentServerToolItem) GetStatus() ToolCallStatus { + if o == nil { + return ToolCallStatus("") + } + return o.Status +} + +func (o *OutputSubagentServerToolItem) GetTaskDescription() *string { + if o == nil { + return nil + } + return o.TaskDescription +} + +func (o *OutputSubagentServerToolItem) GetTaskName() *string { + if o == nil { + return nil + } + return o.TaskName +} + +func (o *OutputSubagentServerToolItem) GetType() OutputSubagentServerToolItemType { + if o == nil { + return OutputSubagentServerToolItemType("") + } + return o.Type +} diff --git a/models/components/outputwebfetchservertoolitem.go b/models/components/outputwebfetchservertoolitem.go index 9303e873..efd3b549 100644 --- a/models/components/outputwebfetchservertoolitem.go +++ b/models/components/outputwebfetchservertoolitem.go @@ -33,12 +33,16 @@ func (e *OutputWebFetchServerToolItemType) UnmarshalJSON(data []byte) error { // OutputWebFetchServerToolItem - An openrouter:web_fetch server tool output item type OutputWebFetchServerToolItem struct { - Content *string `json:"content,omitzero"` - ID *string `json:"id,omitzero"` - Status ToolCallStatus `json:"status"` - Title *string `json:"title,omitzero"` - Type OutputWebFetchServerToolItemType `json:"type"` - URL *string `json:"url,omitzero"` + Content *string `json:"content,omitzero"` + // The error message if the fetch failed. + Error *string `json:"error,omitzero"` + // The HTTP status code returned by the upstream URL fetch. + HTTPStatus *int64 `json:"httpStatus,omitzero"` + ID *string `json:"id,omitzero"` + Status ToolCallStatus `json:"status"` + Title *string `json:"title,omitzero"` + Type OutputWebFetchServerToolItemType `json:"type"` + URL *string `json:"url,omitzero"` } func (o OutputWebFetchServerToolItem) MarshalJSON() ([]byte, error) { @@ -59,6 +63,20 @@ func (o *OutputWebFetchServerToolItem) GetContent() *string { return o.Content } +func (o *OutputWebFetchServerToolItem) GetError() *string { + if o == nil { + return nil + } + return o.Error +} + +func (o *OutputWebFetchServerToolItem) GetHTTPStatus() *int64 { + if o == nil { + return nil + } + return o.HTTPStatus +} + func (o *OutputWebFetchServerToolItem) GetID() *string { if o == nil { return nil diff --git a/models/components/outputwebsearchcallitem.go b/models/components/outputwebsearchcallitem.go index 071a28a0..881cf83c 100644 --- a/models/components/outputwebsearchcallitem.go +++ b/models/components/outputwebsearchcallitem.go @@ -124,102 +124,102 @@ func (a *ActionOpenPage) GetURL() optionalnullable.OptionalNullable[string] { return a.URL } -type TypeSearch string +type ActionTypeSearch string const ( - TypeSearchSearch TypeSearch = "search" + ActionTypeSearchSearch ActionTypeSearch = "search" ) -func (e TypeSearch) ToPointer() *TypeSearch { +func (e ActionTypeSearch) ToPointer() *ActionTypeSearch { return &e } -func (e *TypeSearch) UnmarshalJSON(data []byte) error { +func (e *ActionTypeSearch) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err } switch v { case "search": - *e = TypeSearch(v) + *e = ActionTypeSearch(v) return nil default: - return fmt.Errorf("invalid value for TypeSearch: %v", v) + return fmt.Errorf("invalid value for ActionTypeSearch: %v", v) } } -type ActionSearch struct { +type OutputWebSearchCallItemActionSearch struct { Queries []string `json:"queries,omitzero"` Query string `json:"query"` Sources []WebSearchSource `json:"sources,omitzero"` - Type TypeSearch `json:"type"` + Type ActionTypeSearch `json:"type"` } -func (a ActionSearch) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) +func (o OutputWebSearchCallItemActionSearch) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) } -func (a *ActionSearch) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, nil); err != nil { +func (o *OutputWebSearchCallItemActionSearch) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { return err } return nil } -func (a *ActionSearch) GetQueries() []string { - if a == nil { +func (o *OutputWebSearchCallItemActionSearch) GetQueries() []string { + if o == nil { return nil } - return a.Queries + return o.Queries } -func (a *ActionSearch) GetQuery() string { - if a == nil { +func (o *OutputWebSearchCallItemActionSearch) GetQuery() string { + if o == nil { return "" } - return a.Query + return o.Query } -func (a *ActionSearch) GetSources() []WebSearchSource { - if a == nil { +func (o *OutputWebSearchCallItemActionSearch) GetSources() []WebSearchSource { + if o == nil { return nil } - return a.Sources + return o.Sources } -func (a *ActionSearch) GetType() TypeSearch { - if a == nil { - return TypeSearch("") +func (o *OutputWebSearchCallItemActionSearch) GetType() ActionTypeSearch { + if o == nil { + return ActionTypeSearch("") } - return a.Type + return o.Type } type ActionType string const ( - ActionTypeSearch ActionType = "search" - ActionTypeOpenPage ActionType = "open_page" - ActionTypeFindInPage ActionType = "find_in_page" - ActionTypeUnknown ActionType = "UNKNOWN" + ActionTypeSearchValue ActionType = "search" + ActionTypeOpenPage ActionType = "open_page" + ActionTypeFindInPage ActionType = "find_in_page" + ActionTypeUnknown ActionType = "UNKNOWN" ) type Action struct { - ActionSearch *ActionSearch `queryParam:"inline" union:"member"` - ActionOpenPage *ActionOpenPage `queryParam:"inline" union:"member"` - ActionFindInPage *ActionFindInPage `queryParam:"inline" union:"member"` - UnknownRaw json.RawMessage `json:"-" union:"unknown"` + OutputWebSearchCallItemActionSearch *OutputWebSearchCallItemActionSearch `queryParam:"inline" union:"member"` + ActionOpenPage *ActionOpenPage `queryParam:"inline" union:"member"` + ActionFindInPage *ActionFindInPage `queryParam:"inline" union:"member"` + UnknownRaw json.RawMessage `json:"-" union:"unknown"` Type ActionType } -func CreateActionSearch(search ActionSearch) Action { - typ := ActionTypeSearch +func CreateActionSearch(search OutputWebSearchCallItemActionSearch) Action { + typ := ActionTypeSearchValue - typStr := TypeSearch(typ) + typStr := ActionTypeSearch(typ) search.Type = typStr return Action{ - ActionSearch: &search, - Type: typ, + OutputWebSearchCallItemActionSearch: &search, + Type: typ, } } @@ -282,13 +282,13 @@ func (u *Action) UnmarshalJSON(data []byte) error { switch dis.Type { case "search": - actionSearch := new(ActionSearch) - if err := utils.UnmarshalJSON(data, &actionSearch, "", true, nil); err != nil { - return fmt.Errorf("could not unmarshal `%s` into expected (Type == search) type ActionSearch within Action: %w", string(data), err) + outputWebSearchCallItemActionSearch := new(OutputWebSearchCallItemActionSearch) + if err := utils.UnmarshalJSON(data, &outputWebSearchCallItemActionSearch, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == search) type OutputWebSearchCallItemActionSearch within Action: %w", string(data), err) } - u.ActionSearch = actionSearch - u.Type = ActionTypeSearch + u.OutputWebSearchCallItemActionSearch = outputWebSearchCallItemActionSearch + u.Type = ActionTypeSearchValue return nil case "open_page": actionOpenPage := new(ActionOpenPage) @@ -317,8 +317,8 @@ func (u *Action) UnmarshalJSON(data []byte) error { } func (u Action) MarshalJSON() ([]byte, error) { - if u.ActionSearch != nil { - return utils.MarshalJSON(u.ActionSearch, "", true) + if u.OutputWebSearchCallItemActionSearch != nil { + return utils.MarshalJSON(u.OutputWebSearchCallItemActionSearch, "", true) } if u.ActionOpenPage != nil { @@ -359,7 +359,7 @@ func (e *TypeWebSearchCall) UnmarshalJSON(data []byte) error { } type OutputWebSearchCallItem struct { - Action Action `json:"action"` + Action *Action `json:"action,omitzero"` ID string `json:"id"` Status WebSearchStatus `json:"status"` Type TypeWebSearchCall `json:"type"` @@ -376,23 +376,32 @@ func (o *OutputWebSearchCallItem) UnmarshalJSON(data []byte) error { return nil } -func (o *OutputWebSearchCallItem) GetAction() Action { +func (o *OutputWebSearchCallItem) GetAction() *Action { if o == nil { - return Action{} + return nil } return o.Action } -func (o *OutputWebSearchCallItem) GetActionSearch() *ActionSearch { - return o.GetAction().ActionSearch +func (o *OutputWebSearchCallItem) GetActionSearch() *OutputWebSearchCallItemActionSearch { + if v := o.GetAction(); v != nil { + return v.OutputWebSearchCallItemActionSearch + } + return nil } func (o *OutputWebSearchCallItem) GetActionOpenPage() *ActionOpenPage { - return o.GetAction().ActionOpenPage + if v := o.GetAction(); v != nil { + return v.ActionOpenPage + } + return nil } func (o *OutputWebSearchCallItem) GetActionFindInPage() *ActionFindInPage { - return o.GetAction().ActionFindInPage + if v := o.GetAction(); v != nil { + return v.ActionFindInPage + } + return nil } func (o *OutputWebSearchCallItem) GetID() string { diff --git a/models/components/outputwebsearchservertoolitem.go b/models/components/outputwebsearchservertoolitem.go index 81ccc88f..0d8d3517 100644 --- a/models/components/outputwebsearchservertoolitem.go +++ b/models/components/outputwebsearchservertoolitem.go @@ -8,34 +8,151 @@ import ( "github.com/OpenRouterTeam/go-sdk/internal/utils" ) -type OutputWebSearchServerToolItemType string +type OutputWebSearchServerToolItemTypeURL string const ( - OutputWebSearchServerToolItemTypeOpenrouterWebSearch OutputWebSearchServerToolItemType = "openrouter:web_search" + OutputWebSearchServerToolItemTypeURLURL OutputWebSearchServerToolItemTypeURL = "url" ) -func (e OutputWebSearchServerToolItemType) ToPointer() *OutputWebSearchServerToolItemType { +func (e OutputWebSearchServerToolItemTypeURL) ToPointer() *OutputWebSearchServerToolItemTypeURL { return &e } -func (e *OutputWebSearchServerToolItemType) UnmarshalJSON(data []byte) error { +func (e *OutputWebSearchServerToolItemTypeURL) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "url": + *e = OutputWebSearchServerToolItemTypeURL(v) + return nil + default: + return fmt.Errorf("invalid value for OutputWebSearchServerToolItemTypeURL: %v", v) + } +} + +type OutputWebSearchServerToolItemSource struct { + Type OutputWebSearchServerToolItemTypeURL `json:"type"` + URL string `json:"url"` +} + +func (o OutputWebSearchServerToolItemSource) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OutputWebSearchServerToolItemSource) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *OutputWebSearchServerToolItemSource) GetType() OutputWebSearchServerToolItemTypeURL { + if o == nil { + return OutputWebSearchServerToolItemTypeURL("") + } + return o.Type +} + +func (o *OutputWebSearchServerToolItemSource) GetURL() string { + if o == nil { + return "" + } + return o.URL +} + +type OutputWebSearchServerToolItemTypeSearch string + +const ( + OutputWebSearchServerToolItemTypeSearchSearch OutputWebSearchServerToolItemTypeSearch = "search" +) + +func (e OutputWebSearchServerToolItemTypeSearch) ToPointer() *OutputWebSearchServerToolItemTypeSearch { + return &e +} +func (e *OutputWebSearchServerToolItemTypeSearch) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "search": + *e = OutputWebSearchServerToolItemTypeSearch(v) + return nil + default: + return fmt.Errorf("invalid value for OutputWebSearchServerToolItemTypeSearch: %v", v) + } +} + +// OutputWebSearchServerToolItemAction - The search action performed, matching OpenAI web_search_call.action shape. Includes the query the model issued and optional source URLs returned by the search provider. +type OutputWebSearchServerToolItemAction struct { + Query string `json:"query"` + Sources []OutputWebSearchServerToolItemSource `json:"sources,omitzero"` + Type OutputWebSearchServerToolItemTypeSearch `json:"type"` +} + +func (o OutputWebSearchServerToolItemAction) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) +} + +func (o *OutputWebSearchServerToolItemAction) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *OutputWebSearchServerToolItemAction) GetQuery() string { + if o == nil { + return "" + } + return o.Query +} + +func (o *OutputWebSearchServerToolItemAction) GetSources() []OutputWebSearchServerToolItemSource { + if o == nil { + return nil + } + return o.Sources +} + +func (o *OutputWebSearchServerToolItemAction) GetType() OutputWebSearchServerToolItemTypeSearch { + if o == nil { + return OutputWebSearchServerToolItemTypeSearch("") + } + return o.Type +} + +type OutputWebSearchServerToolItemTypeOpenrouterWebSearch string + +const ( + OutputWebSearchServerToolItemTypeOpenrouterWebSearchOpenrouterWebSearch OutputWebSearchServerToolItemTypeOpenrouterWebSearch = "openrouter:web_search" +) + +func (e OutputWebSearchServerToolItemTypeOpenrouterWebSearch) ToPointer() *OutputWebSearchServerToolItemTypeOpenrouterWebSearch { + return &e +} +func (e *OutputWebSearchServerToolItemTypeOpenrouterWebSearch) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err } switch v { case "openrouter:web_search": - *e = OutputWebSearchServerToolItemType(v) + *e = OutputWebSearchServerToolItemTypeOpenrouterWebSearch(v) return nil default: - return fmt.Errorf("invalid value for OutputWebSearchServerToolItemType: %v", v) + return fmt.Errorf("invalid value for OutputWebSearchServerToolItemTypeOpenrouterWebSearch: %v", v) } } // OutputWebSearchServerToolItem - An openrouter:web_search server tool output item type OutputWebSearchServerToolItem struct { - ID *string `json:"id,omitzero"` - Status ToolCallStatus `json:"status"` - Type OutputWebSearchServerToolItemType `json:"type"` + // The search action performed, matching OpenAI web_search_call.action shape. Includes the query the model issued and optional source URLs returned by the search provider. + Action *OutputWebSearchServerToolItemAction `json:"action,omitzero"` + ID *string `json:"id,omitzero"` + Status ToolCallStatus `json:"status"` + Type OutputWebSearchServerToolItemTypeOpenrouterWebSearch `json:"type"` } func (o OutputWebSearchServerToolItem) MarshalJSON() ([]byte, error) { @@ -49,6 +166,13 @@ func (o *OutputWebSearchServerToolItem) UnmarshalJSON(data []byte) error { return nil } +func (o *OutputWebSearchServerToolItem) GetAction() *OutputWebSearchServerToolItemAction { + if o == nil { + return nil + } + return o.Action +} + func (o *OutputWebSearchServerToolItem) GetID() *string { if o == nil { return nil @@ -63,9 +187,9 @@ func (o *OutputWebSearchServerToolItem) GetStatus() ToolCallStatus { return o.Status } -func (o *OutputWebSearchServerToolItem) GetType() OutputWebSearchServerToolItemType { +func (o *OutputWebSearchServerToolItem) GetType() OutputWebSearchServerToolItemTypeOpenrouterWebSearch { if o == nil { - return OutputWebSearchServerToolItemType("") + return OutputWebSearchServerToolItemTypeOpenrouterWebSearch("") } return o.Type } diff --git a/models/components/pipelinestage.go b/models/components/pipelinestage.go new file mode 100644 index 00000000..62e16fff --- /dev/null +++ b/models/components/pipelinestage.go @@ -0,0 +1,79 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type PipelineStage struct { + CostUsd optionalnullable.OptionalNullable[float64] `json:"cost_usd,omitzero"` + Data map[string]any `json:"data,omitzero"` + GuardrailID *string `json:"guardrail_id,omitzero"` + GuardrailScope *string `json:"guardrail_scope,omitzero"` + Name string `json:"name"` + Summary *string `json:"summary,omitzero"` + // Categorical kind of a pipeline stage. Multiple plugins can share a type (e.g. all guardrail-level plugins emit `guardrail`); the `name` field disambiguates which plugin emitted it. + Type PipelineStageType `json:"type"` +} + +func (p PipelineStage) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PipelineStage) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil +} + +func (p *PipelineStage) GetCostUsd() optionalnullable.OptionalNullable[float64] { + if p == nil { + return nil + } + return p.CostUsd +} + +func (p *PipelineStage) GetData() map[string]any { + if p == nil { + return nil + } + return p.Data +} + +func (p *PipelineStage) GetGuardrailID() *string { + if p == nil { + return nil + } + return p.GuardrailID +} + +func (p *PipelineStage) GetGuardrailScope() *string { + if p == nil { + return nil + } + return p.GuardrailScope +} + +func (p *PipelineStage) GetName() string { + if p == nil { + return "" + } + return p.Name +} + +func (p *PipelineStage) GetSummary() *string { + if p == nil { + return nil + } + return p.Summary +} + +func (p *PipelineStage) GetType() PipelineStageType { + if p == nil { + return PipelineStageType("") + } + return p.Type +} diff --git a/models/components/pipelinestagetype.go b/models/components/pipelinestagetype.go new file mode 100644 index 00000000..f1c90d5c --- /dev/null +++ b/models/components/pipelinestagetype.go @@ -0,0 +1,29 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// PipelineStageType - Categorical kind of a pipeline stage. Multiple plugins can share a type (e.g. all guardrail-level plugins emit `guardrail`); the `name` field disambiguates which plugin emitted it. +type PipelineStageType string + +const ( + PipelineStageTypeGuardrail PipelineStageType = "guardrail" + PipelineStageTypePlugin PipelineStageType = "plugin" + PipelineStageTypeServerTools PipelineStageType = "server_tools" + PipelineStageTypeResponseHealing PipelineStageType = "response_healing" + PipelineStageTypeContextCompression PipelineStageType = "context_compression" +) + +func (e PipelineStageType) ToPointer() *PipelineStageType { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *PipelineStageType) IsExact() bool { + if e != nil { + switch *e { + case "guardrail", "plugin", "server_tools", "response_healing", "context_compression": + return true + } + } + return false +} diff --git a/models/components/preset.go b/models/components/preset.go new file mode 100644 index 00000000..e4b473e5 --- /dev/null +++ b/models/components/preset.go @@ -0,0 +1,96 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// Preset - A preset without version details. +type Preset struct { + CreatedAt string `json:"created_at"` + CreatorUserID *string `json:"creator_user_id"` + Description *string `json:"description"` + DesignatedVersionID *string `json:"designated_version_id"` + ID string `json:"id"` + Name string `json:"name"` + Slug string `json:"slug"` + // The status of a preset. + Status PresetStatus `json:"status"` + StatusUpdatedAt *string `json:"status_updated_at"` + UpdatedAt string `json:"updated_at"` + WorkspaceID *string `json:"workspace_id"` +} + +func (p *Preset) GetCreatedAt() string { + if p == nil { + return "" + } + return p.CreatedAt +} + +func (p *Preset) GetCreatorUserID() *string { + if p == nil { + return nil + } + return p.CreatorUserID +} + +func (p *Preset) GetDescription() *string { + if p == nil { + return nil + } + return p.Description +} + +func (p *Preset) GetDesignatedVersionID() *string { + if p == nil { + return nil + } + return p.DesignatedVersionID +} + +func (p *Preset) GetID() string { + if p == nil { + return "" + } + return p.ID +} + +func (p *Preset) GetName() string { + if p == nil { + return "" + } + return p.Name +} + +func (p *Preset) GetSlug() string { + if p == nil { + return "" + } + return p.Slug +} + +func (p *Preset) GetStatus() PresetStatus { + if p == nil { + return PresetStatus("") + } + return p.Status +} + +func (p *Preset) GetStatusUpdatedAt() *string { + if p == nil { + return nil + } + return p.StatusUpdatedAt +} + +func (p *Preset) GetUpdatedAt() string { + if p == nil { + return "" + } + return p.UpdatedAt +} + +func (p *Preset) GetWorkspaceID() *string { + if p == nil { + return nil + } + return p.WorkspaceID +} diff --git a/models/components/presetdesignatedversion.go b/models/components/presetdesignatedversion.go new file mode 100644 index 00000000..8264fac6 --- /dev/null +++ b/models/components/presetdesignatedversion.go @@ -0,0 +1,71 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// PresetDesignatedVersion - A specific version of a preset, containing config and optional system prompt. +type PresetDesignatedVersion struct { + Config map[string]any `json:"config"` + CreatedAt string `json:"created_at"` + CreatorID string `json:"creator_id"` + ID string `json:"id"` + PresetID string `json:"preset_id"` + SystemPrompt *string `json:"system_prompt"` + UpdatedAt string `json:"updated_at"` + Version int64 `json:"version"` +} + +func (p *PresetDesignatedVersion) GetConfig() map[string]any { + if p == nil { + return map[string]any{} + } + return p.Config +} + +func (p *PresetDesignatedVersion) GetCreatedAt() string { + if p == nil { + return "" + } + return p.CreatedAt +} + +func (p *PresetDesignatedVersion) GetCreatorID() string { + if p == nil { + return "" + } + return p.CreatorID +} + +func (p *PresetDesignatedVersion) GetID() string { + if p == nil { + return "" + } + return p.ID +} + +func (p *PresetDesignatedVersion) GetPresetID() string { + if p == nil { + return "" + } + return p.PresetID +} + +func (p *PresetDesignatedVersion) GetSystemPrompt() *string { + if p == nil { + return nil + } + return p.SystemPrompt +} + +func (p *PresetDesignatedVersion) GetUpdatedAt() string { + if p == nil { + return "" + } + return p.UpdatedAt +} + +func (p *PresetDesignatedVersion) GetVersion() int64 { + if p == nil { + return 0 + } + return p.Version +} diff --git a/models/components/presetstatus.go b/models/components/presetstatus.go new file mode 100644 index 00000000..3ea7a6e6 --- /dev/null +++ b/models/components/presetstatus.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// PresetStatus - The status of a preset. +type PresetStatus string + +const ( + PresetStatusActive PresetStatus = "active" + PresetStatusDisabled PresetStatus = "disabled" + PresetStatusArchived PresetStatus = "archived" +) + +func (e PresetStatus) ToPointer() *PresetStatus { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *PresetStatus) IsExact() bool { + if e != nil { + switch *e { + case "active", "disabled", "archived": + return true + } + } + return false +} diff --git a/models/components/presetwithdesignatedversion.go b/models/components/presetwithdesignatedversion.go new file mode 100644 index 00000000..d12c240e --- /dev/null +++ b/models/components/presetwithdesignatedversion.go @@ -0,0 +1,105 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// PresetWithDesignatedVersion - A preset with its currently designated version. +type PresetWithDesignatedVersion struct { + CreatedAt string `json:"created_at"` + CreatorUserID *string `json:"creator_user_id"` + Description *string `json:"description"` + DesignatedVersionID *string `json:"designated_version_id"` + ID string `json:"id"` + Name string `json:"name"` + Slug string `json:"slug"` + // The status of a preset. + Status PresetStatus `json:"status"` + StatusUpdatedAt *string `json:"status_updated_at"` + UpdatedAt string `json:"updated_at"` + WorkspaceID *string `json:"workspace_id"` + // A specific version of a preset, containing config and optional system prompt. + DesignatedVersion *PresetDesignatedVersion `json:"designated_version"` +} + +func (p *PresetWithDesignatedVersion) GetCreatedAt() string { + if p == nil { + return "" + } + return p.CreatedAt +} + +func (p *PresetWithDesignatedVersion) GetCreatorUserID() *string { + if p == nil { + return nil + } + return p.CreatorUserID +} + +func (p *PresetWithDesignatedVersion) GetDescription() *string { + if p == nil { + return nil + } + return p.Description +} + +func (p *PresetWithDesignatedVersion) GetDesignatedVersionID() *string { + if p == nil { + return nil + } + return p.DesignatedVersionID +} + +func (p *PresetWithDesignatedVersion) GetID() string { + if p == nil { + return "" + } + return p.ID +} + +func (p *PresetWithDesignatedVersion) GetName() string { + if p == nil { + return "" + } + return p.Name +} + +func (p *PresetWithDesignatedVersion) GetSlug() string { + if p == nil { + return "" + } + return p.Slug +} + +func (p *PresetWithDesignatedVersion) GetStatus() PresetStatus { + if p == nil { + return PresetStatus("") + } + return p.Status +} + +func (p *PresetWithDesignatedVersion) GetStatusUpdatedAt() *string { + if p == nil { + return nil + } + return p.StatusUpdatedAt +} + +func (p *PresetWithDesignatedVersion) GetUpdatedAt() string { + if p == nil { + return "" + } + return p.UpdatedAt +} + +func (p *PresetWithDesignatedVersion) GetWorkspaceID() *string { + if p == nil { + return nil + } + return p.WorkspaceID +} + +func (p *PresetWithDesignatedVersion) GetDesignatedVersion() *PresetDesignatedVersion { + if p == nil { + return nil + } + return p.DesignatedVersion +} diff --git a/models/components/preview20250311websearchservertool.go b/models/components/preview20250311websearchservertool.go index 5551064b..fc6f40e0 100644 --- a/models/components/preview20250311websearchservertool.go +++ b/models/components/preview20250311websearchservertool.go @@ -34,10 +34,10 @@ func (e *Preview20250311WebSearchServerToolType) UnmarshalJSON(data []byte) erro // Preview20250311WebSearchServerTool - Web search preview tool configuration (2025-03-11 version) type Preview20250311WebSearchServerTool struct { - // Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. + // Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). Engine *WebSearchEngineEnum `json:"engine,omitzero"` Filters optionalnullable.OptionalNullable[WebSearchDomainFilter] `json:"filters,omitzero"` - // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and Parallel engines; ignored with native provider search. + // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. MaxResults *int64 `json:"max_results,omitzero"` // Size of the search context for web search tools SearchContextSize *SearchContextSizeEnum `json:"search_context_size,omitzero"` diff --git a/models/components/previewwebsearchservertool.go b/models/components/previewwebsearchservertool.go index d553bf54..f22d7fdf 100644 --- a/models/components/previewwebsearchservertool.go +++ b/models/components/previewwebsearchservertool.go @@ -34,10 +34,10 @@ func (e *PreviewWebSearchServerToolType) UnmarshalJSON(data []byte) error { // PreviewWebSearchServerTool - Web search preview tool configuration type PreviewWebSearchServerTool struct { - // Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. + // Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). Engine *WebSearchEngineEnum `json:"engine,omitzero"` Filters optionalnullable.OptionalNullable[WebSearchDomainFilter] `json:"filters,omitzero"` - // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and Parallel engines; ignored with native provider search. + // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. MaxResults *int64 `json:"max_results,omitzero"` // Size of the search context for web search tools SearchContextSize *SearchContextSizeEnum `json:"search_context_size,omitzero"` diff --git a/models/components/promptinjectionscanscope.go b/models/components/promptinjectionscanscope.go new file mode 100644 index 00000000..c50b74b3 --- /dev/null +++ b/models/components/promptinjectionscanscope.go @@ -0,0 +1,26 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// PromptInjectionScanScope - Which message roles to scan for prompt injection. Only applies to the regex-prompt-injection builtin. Defaults to all_messages. +type PromptInjectionScanScope string + +const ( + PromptInjectionScanScopeUserOnly PromptInjectionScanScope = "user_only" + PromptInjectionScanScopeAllMessages PromptInjectionScanScope = "all_messages" +) + +func (e PromptInjectionScanScope) ToPointer() *PromptInjectionScanScope { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *PromptInjectionScanScope) IsExact() bool { + if e != nil { + switch *e { + case "user_only", "all_messages": + return true + } + } + return false +} diff --git a/models/components/providername.go b/models/components/providername.go index 8af92d73..dd2b81e0 100644 --- a/models/components/providername.go +++ b/models/components/providername.go @@ -27,10 +27,14 @@ const ( ProviderNameClarifai ProviderName = "Clarifai" ProviderNameCloudflare ProviderName = "Cloudflare" ProviderNameCohere ProviderName = "Cohere" + ProviderNameCrucible ProviderName = "Crucible" ProviderNameCrusoe ProviderName = "Crusoe" + ProviderNameDarkbloom ProviderName = "Darkbloom" + ProviderNameDecart ProviderName = "Decart" ProviderNameDeepInfra ProviderName = "DeepInfra" ProviderNameDeepSeek ProviderName = "DeepSeek" ProviderNameDekaLlm ProviderName = "DekaLLM" + ProviderNameDigitalOcean ProviderName = "DigitalOcean" ProviderNameFeatherless ProviderName = "Featherless" ProviderNameFireworks ProviderName = "Fireworks" ProviderNameFriendli ProviderName = "Friendli" @@ -38,7 +42,6 @@ const ( ProviderNameGoogle ProviderName = "Google" ProviderNameGoogleAiStudio ProviderName = "Google AI Studio" ProviderNameGroq ProviderName = "Groq" - ProviderNameHyperbolic ProviderName = "Hyperbolic" ProviderNameInception ProviderName = "Inception" ProviderNameInceptron ProviderName = "Inceptron" ProviderNameInferenceNet ProviderName = "InferenceNet" @@ -57,12 +60,15 @@ const ( ProviderNameMorph ProviderName = "Morph" ProviderNameNCompass ProviderName = "NCompass" ProviderNameNebius ProviderName = "Nebius" + ProviderNameNexAgi ProviderName = "Nex AGI" ProviderNameNextBit ProviderName = "NextBit" ProviderNameNovita ProviderName = "Novita" ProviderNameNvidia ProviderName = "Nvidia" ProviderNameOpenAi ProviderName = "OpenAI" ProviderNameOpenInference ProviderName = "OpenInference" ProviderNameParasail ProviderName = "Parasail" + ProviderNamePoolside ProviderName = "Poolside" + ProviderNamePerceptron ProviderName = "Perceptron" ProviderNamePerplexity ProviderName = "Perplexity" ProviderNamePhala ProviderName = "Phala" ProviderNameRecraft ProviderName = "Recraft" @@ -79,6 +85,7 @@ const ( ProviderNameTogether ProviderName = "Together" ProviderNameUpstage ProviderName = "Upstage" ProviderNameVenice ProviderName = "Venice" + ProviderNameWafer ProviderName = "Wafer" ProviderNameWandB ProviderName = "WandB" ProviderNameXiaomi ProviderName = "Xiaomi" ProviderNameXAi ProviderName = "xAI" @@ -94,7 +101,7 @@ func (e ProviderName) ToPointer() *ProviderName { func (e *ProviderName) IsExact() bool { if e != nil { switch *e { - case "AkashML", "AI21", "AionLabs", "Alibaba", "Ambient", "Baidu", "Amazon Bedrock", "Amazon Nova", "Anthropic", "Arcee AI", "AtlasCloud", "Avian", "Azure", "BaseTen", "BytePlus", "Black Forest Labs", "Cerebras", "Chutes", "Cirrascale", "Clarifai", "Cloudflare", "Cohere", "Crusoe", "DeepInfra", "DeepSeek", "DekaLLM", "Featherless", "Fireworks", "Friendli", "GMICloud", "Google", "Google AI Studio", "Groq", "Hyperbolic", "Inception", "Inceptron", "InferenceNet", "Ionstream", "Infermatic", "Io Net", "Inflection", "Liquid", "Mara", "Mancer 2", "Minimax", "ModelRun", "Mistral", "Modular", "Moonshot AI", "Morph", "NCompass", "Nebius", "NextBit", "Novita", "Nvidia", "OpenAI", "OpenInference", "Parasail", "Perplexity", "Phala", "Recraft", "Reka", "Relace", "SambaNova", "Seed", "SiliconFlow", "Sourceful", "StepFun", "Stealth", "StreamLake", "Switchpoint", "Together", "Upstage", "Venice", "WandB", "Xiaomi", "xAI", "Z.AI", "FakeProvider": + case "AkashML", "AI21", "AionLabs", "Alibaba", "Ambient", "Baidu", "Amazon Bedrock", "Amazon Nova", "Anthropic", "Arcee AI", "AtlasCloud", "Avian", "Azure", "BaseTen", "BytePlus", "Black Forest Labs", "Cerebras", "Chutes", "Cirrascale", "Clarifai", "Cloudflare", "Cohere", "Crucible", "Crusoe", "Darkbloom", "Decart", "DeepInfra", "DeepSeek", "DekaLLM", "DigitalOcean", "Featherless", "Fireworks", "Friendli", "GMICloud", "Google", "Google AI Studio", "Groq", "Inception", "Inceptron", "InferenceNet", "Ionstream", "Infermatic", "Io Net", "Inflection", "Liquid", "Mara", "Mancer 2", "Minimax", "ModelRun", "Mistral", "Modular", "Moonshot AI", "Morph", "NCompass", "Nebius", "Nex AGI", "NextBit", "Novita", "Nvidia", "OpenAI", "OpenInference", "Parasail", "Poolside", "Perceptron", "Perplexity", "Phala", "Recraft", "Reka", "Relace", "SambaNova", "Seed", "SiliconFlow", "Sourceful", "StepFun", "Stealth", "StreamLake", "Switchpoint", "Together", "Upstage", "Venice", "Wafer", "WandB", "Xiaomi", "xAI", "Z.AI", "FakeProvider": return true } } diff --git a/models/components/provideroptions.go b/models/components/provideroptions.go new file mode 100644 index 00000000..f0b3640b --- /dev/null +++ b/models/components/provideroptions.go @@ -0,0 +1,942 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// ProviderOptions - Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. +type ProviderOptions struct { + Oneai map[string]any `json:"01ai,omitzero"` + Ai21 map[string]any `json:"ai21,omitzero"` + AionLabs map[string]any `json:"aion-labs,omitzero"` + Akashml map[string]any `json:"akashml,omitzero"` + Alibaba map[string]any `json:"alibaba,omitzero"` + AmazonBedrock map[string]any `json:"amazon-bedrock,omitzero"` + AmazonNova map[string]any `json:"amazon-nova,omitzero"` + Ambient map[string]any `json:"ambient,omitzero"` + Anthropic map[string]any `json:"anthropic,omitzero"` + Anyscale map[string]any `json:"anyscale,omitzero"` + ArceeAi map[string]any `json:"arcee-ai,omitzero"` + AtlasCloud map[string]any `json:"atlas-cloud,omitzero"` + Atoma map[string]any `json:"atoma,omitzero"` + Avian map[string]any `json:"avian,omitzero"` + Azure map[string]any `json:"azure,omitzero"` + Baidu map[string]any `json:"baidu,omitzero"` + Baseten map[string]any `json:"baseten,omitzero"` + BlackForestLabs map[string]any `json:"black-forest-labs,omitzero"` + Byteplus map[string]any `json:"byteplus,omitzero"` + Centml map[string]any `json:"centml,omitzero"` + Cerebras map[string]any `json:"cerebras,omitzero"` + Chutes map[string]any `json:"chutes,omitzero"` + Cirrascale map[string]any `json:"cirrascale,omitzero"` + Clarifai map[string]any `json:"clarifai,omitzero"` + Cloudflare map[string]any `json:"cloudflare,omitzero"` + Cohere map[string]any `json:"cohere,omitzero"` + Crofai map[string]any `json:"crofai,omitzero"` + Crucible map[string]any `json:"crucible,omitzero"` + Crusoe map[string]any `json:"crusoe,omitzero"` + Darkbloom map[string]any `json:"darkbloom,omitzero"` + Decart map[string]any `json:"decart,omitzero"` + Deepinfra map[string]any `json:"deepinfra,omitzero"` + Deepseek map[string]any `json:"deepseek,omitzero"` + Dekallm map[string]any `json:"dekallm,omitzero"` + Digitalocean map[string]any `json:"digitalocean,omitzero"` + Enfer map[string]any `json:"enfer,omitzero"` + FakeProvider map[string]any `json:"fake-provider,omitzero"` + Featherless map[string]any `json:"featherless,omitzero"` + Fireworks map[string]any `json:"fireworks,omitzero"` + Friendli map[string]any `json:"friendli,omitzero"` + Gmicloud map[string]any `json:"gmicloud,omitzero"` + GoogleAiStudio map[string]any `json:"google-ai-studio,omitzero"` + GoogleVertex map[string]any `json:"google-vertex,omitzero"` + Gopomelo map[string]any `json:"gopomelo,omitzero"` + Groq map[string]any `json:"groq,omitzero"` + Huggingface map[string]any `json:"huggingface,omitzero"` + Hyperbolic map[string]any `json:"hyperbolic,omitzero"` + HyperbolicQuantized map[string]any `json:"hyperbolic-quantized,omitzero"` + Inception map[string]any `json:"inception,omitzero"` + Inceptron map[string]any `json:"inceptron,omitzero"` + InferenceNet map[string]any `json:"inference-net,omitzero"` + Infermatic map[string]any `json:"infermatic,omitzero"` + Inflection map[string]any `json:"inflection,omitzero"` + Inocloud map[string]any `json:"inocloud,omitzero"` + IoNet map[string]any `json:"io-net,omitzero"` + Ionstream map[string]any `json:"ionstream,omitzero"` + Klusterai map[string]any `json:"klusterai,omitzero"` + Lambda map[string]any `json:"lambda,omitzero"` + Lepton map[string]any `json:"lepton,omitzero"` + Liquid map[string]any `json:"liquid,omitzero"` + Lynn map[string]any `json:"lynn,omitzero"` + LynnPrivate map[string]any `json:"lynn-private,omitzero"` + Mancer map[string]any `json:"mancer,omitzero"` + MancerOld map[string]any `json:"mancer-old,omitzero"` + Mara map[string]any `json:"mara,omitzero"` + Meta map[string]any `json:"meta,omitzero"` + Minimax map[string]any `json:"minimax,omitzero"` + Mistral map[string]any `json:"mistral,omitzero"` + Modal map[string]any `json:"modal,omitzero"` + Modelrun map[string]any `json:"modelrun,omitzero"` + Modular map[string]any `json:"modular,omitzero"` + Moonshotai map[string]any `json:"moonshotai,omitzero"` + Morph map[string]any `json:"morph,omitzero"` + Ncompass map[string]any `json:"ncompass,omitzero"` + Nebius map[string]any `json:"nebius,omitzero"` + NexAgi map[string]any `json:"nex-agi,omitzero"` + Nextbit map[string]any `json:"nextbit,omitzero"` + Nineteen map[string]any `json:"nineteen,omitzero"` + Novita map[string]any `json:"novita,omitzero"` + Nvidia map[string]any `json:"nvidia,omitzero"` + Octoai map[string]any `json:"octoai,omitzero"` + OpenInference map[string]any `json:"open-inference,omitzero"` + Openai map[string]any `json:"openai,omitzero"` + Parasail map[string]any `json:"parasail,omitzero"` + Perceptron map[string]any `json:"perceptron,omitzero"` + Perplexity map[string]any `json:"perplexity,omitzero"` + Phala map[string]any `json:"phala,omitzero"` + Poolside map[string]any `json:"poolside,omitzero"` + Recraft map[string]any `json:"recraft,omitzero"` + Recursal map[string]any `json:"recursal,omitzero"` + Reflection map[string]any `json:"reflection,omitzero"` + Reka map[string]any `json:"reka,omitzero"` + Relace map[string]any `json:"relace,omitzero"` + Replicate map[string]any `json:"replicate,omitzero"` + Sambanova map[string]any `json:"sambanova,omitzero"` + SambanovaCloaked map[string]any `json:"sambanova-cloaked,omitzero"` + Seed map[string]any `json:"seed,omitzero"` + SfCompute map[string]any `json:"sf-compute,omitzero"` + Siliconflow map[string]any `json:"siliconflow,omitzero"` + Sourceful map[string]any `json:"sourceful,omitzero"` + Stealth map[string]any `json:"stealth,omitzero"` + Stepfun map[string]any `json:"stepfun,omitzero"` + Streamlake map[string]any `json:"streamlake,omitzero"` + Switchpoint map[string]any `json:"switchpoint,omitzero"` + Targon map[string]any `json:"targon,omitzero"` + Together map[string]any `json:"together,omitzero"` + TogetherLite map[string]any `json:"together-lite,omitzero"` + Ubicloud map[string]any `json:"ubicloud,omitzero"` + Upstage map[string]any `json:"upstage,omitzero"` + Venice map[string]any `json:"venice,omitzero"` + Wafer map[string]any `json:"wafer,omitzero"` + Wandb map[string]any `json:"wandb,omitzero"` + Xai map[string]any `json:"xai,omitzero"` + Xiaomi map[string]any `json:"xiaomi,omitzero"` + ZAi map[string]any `json:"z-ai,omitzero"` +} + +func (p ProviderOptions) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *ProviderOptions) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil +} + +func (p *ProviderOptions) GetOneai() map[string]any { + if p == nil { + return nil + } + return p.Oneai +} + +func (p *ProviderOptions) GetAi21() map[string]any { + if p == nil { + return nil + } + return p.Ai21 +} + +func (p *ProviderOptions) GetAionLabs() map[string]any { + if p == nil { + return nil + } + return p.AionLabs +} + +func (p *ProviderOptions) GetAkashml() map[string]any { + if p == nil { + return nil + } + return p.Akashml +} + +func (p *ProviderOptions) GetAlibaba() map[string]any { + if p == nil { + return nil + } + return p.Alibaba +} + +func (p *ProviderOptions) GetAmazonBedrock() map[string]any { + if p == nil { + return nil + } + return p.AmazonBedrock +} + +func (p *ProviderOptions) GetAmazonNova() map[string]any { + if p == nil { + return nil + } + return p.AmazonNova +} + +func (p *ProviderOptions) GetAmbient() map[string]any { + if p == nil { + return nil + } + return p.Ambient +} + +func (p *ProviderOptions) GetAnthropic() map[string]any { + if p == nil { + return nil + } + return p.Anthropic +} + +func (p *ProviderOptions) GetAnyscale() map[string]any { + if p == nil { + return nil + } + return p.Anyscale +} + +func (p *ProviderOptions) GetArceeAi() map[string]any { + if p == nil { + return nil + } + return p.ArceeAi +} + +func (p *ProviderOptions) GetAtlasCloud() map[string]any { + if p == nil { + return nil + } + return p.AtlasCloud +} + +func (p *ProviderOptions) GetAtoma() map[string]any { + if p == nil { + return nil + } + return p.Atoma +} + +func (p *ProviderOptions) GetAvian() map[string]any { + if p == nil { + return nil + } + return p.Avian +} + +func (p *ProviderOptions) GetAzure() map[string]any { + if p == nil { + return nil + } + return p.Azure +} + +func (p *ProviderOptions) GetBaidu() map[string]any { + if p == nil { + return nil + } + return p.Baidu +} + +func (p *ProviderOptions) GetBaseten() map[string]any { + if p == nil { + return nil + } + return p.Baseten +} + +func (p *ProviderOptions) GetBlackForestLabs() map[string]any { + if p == nil { + return nil + } + return p.BlackForestLabs +} + +func (p *ProviderOptions) GetByteplus() map[string]any { + if p == nil { + return nil + } + return p.Byteplus +} + +func (p *ProviderOptions) GetCentml() map[string]any { + if p == nil { + return nil + } + return p.Centml +} + +func (p *ProviderOptions) GetCerebras() map[string]any { + if p == nil { + return nil + } + return p.Cerebras +} + +func (p *ProviderOptions) GetChutes() map[string]any { + if p == nil { + return nil + } + return p.Chutes +} + +func (p *ProviderOptions) GetCirrascale() map[string]any { + if p == nil { + return nil + } + return p.Cirrascale +} + +func (p *ProviderOptions) GetClarifai() map[string]any { + if p == nil { + return nil + } + return p.Clarifai +} + +func (p *ProviderOptions) GetCloudflare() map[string]any { + if p == nil { + return nil + } + return p.Cloudflare +} + +func (p *ProviderOptions) GetCohere() map[string]any { + if p == nil { + return nil + } + return p.Cohere +} + +func (p *ProviderOptions) GetCrofai() map[string]any { + if p == nil { + return nil + } + return p.Crofai +} + +func (p *ProviderOptions) GetCrucible() map[string]any { + if p == nil { + return nil + } + return p.Crucible +} + +func (p *ProviderOptions) GetCrusoe() map[string]any { + if p == nil { + return nil + } + return p.Crusoe +} + +func (p *ProviderOptions) GetDarkbloom() map[string]any { + if p == nil { + return nil + } + return p.Darkbloom +} + +func (p *ProviderOptions) GetDecart() map[string]any { + if p == nil { + return nil + } + return p.Decart +} + +func (p *ProviderOptions) GetDeepinfra() map[string]any { + if p == nil { + return nil + } + return p.Deepinfra +} + +func (p *ProviderOptions) GetDeepseek() map[string]any { + if p == nil { + return nil + } + return p.Deepseek +} + +func (p *ProviderOptions) GetDekallm() map[string]any { + if p == nil { + return nil + } + return p.Dekallm +} + +func (p *ProviderOptions) GetDigitalocean() map[string]any { + if p == nil { + return nil + } + return p.Digitalocean +} + +func (p *ProviderOptions) GetEnfer() map[string]any { + if p == nil { + return nil + } + return p.Enfer +} + +func (p *ProviderOptions) GetFakeProvider() map[string]any { + if p == nil { + return nil + } + return p.FakeProvider +} + +func (p *ProviderOptions) GetFeatherless() map[string]any { + if p == nil { + return nil + } + return p.Featherless +} + +func (p *ProviderOptions) GetFireworks() map[string]any { + if p == nil { + return nil + } + return p.Fireworks +} + +func (p *ProviderOptions) GetFriendli() map[string]any { + if p == nil { + return nil + } + return p.Friendli +} + +func (p *ProviderOptions) GetGmicloud() map[string]any { + if p == nil { + return nil + } + return p.Gmicloud +} + +func (p *ProviderOptions) GetGoogleAiStudio() map[string]any { + if p == nil { + return nil + } + return p.GoogleAiStudio +} + +func (p *ProviderOptions) GetGoogleVertex() map[string]any { + if p == nil { + return nil + } + return p.GoogleVertex +} + +func (p *ProviderOptions) GetGopomelo() map[string]any { + if p == nil { + return nil + } + return p.Gopomelo +} + +func (p *ProviderOptions) GetGroq() map[string]any { + if p == nil { + return nil + } + return p.Groq +} + +func (p *ProviderOptions) GetHuggingface() map[string]any { + if p == nil { + return nil + } + return p.Huggingface +} + +func (p *ProviderOptions) GetHyperbolic() map[string]any { + if p == nil { + return nil + } + return p.Hyperbolic +} + +func (p *ProviderOptions) GetHyperbolicQuantized() map[string]any { + if p == nil { + return nil + } + return p.HyperbolicQuantized +} + +func (p *ProviderOptions) GetInception() map[string]any { + if p == nil { + return nil + } + return p.Inception +} + +func (p *ProviderOptions) GetInceptron() map[string]any { + if p == nil { + return nil + } + return p.Inceptron +} + +func (p *ProviderOptions) GetInferenceNet() map[string]any { + if p == nil { + return nil + } + return p.InferenceNet +} + +func (p *ProviderOptions) GetInfermatic() map[string]any { + if p == nil { + return nil + } + return p.Infermatic +} + +func (p *ProviderOptions) GetInflection() map[string]any { + if p == nil { + return nil + } + return p.Inflection +} + +func (p *ProviderOptions) GetInocloud() map[string]any { + if p == nil { + return nil + } + return p.Inocloud +} + +func (p *ProviderOptions) GetIoNet() map[string]any { + if p == nil { + return nil + } + return p.IoNet +} + +func (p *ProviderOptions) GetIonstream() map[string]any { + if p == nil { + return nil + } + return p.Ionstream +} + +func (p *ProviderOptions) GetKlusterai() map[string]any { + if p == nil { + return nil + } + return p.Klusterai +} + +func (p *ProviderOptions) GetLambda() map[string]any { + if p == nil { + return nil + } + return p.Lambda +} + +func (p *ProviderOptions) GetLepton() map[string]any { + if p == nil { + return nil + } + return p.Lepton +} + +func (p *ProviderOptions) GetLiquid() map[string]any { + if p == nil { + return nil + } + return p.Liquid +} + +func (p *ProviderOptions) GetLynn() map[string]any { + if p == nil { + return nil + } + return p.Lynn +} + +func (p *ProviderOptions) GetLynnPrivate() map[string]any { + if p == nil { + return nil + } + return p.LynnPrivate +} + +func (p *ProviderOptions) GetMancer() map[string]any { + if p == nil { + return nil + } + return p.Mancer +} + +func (p *ProviderOptions) GetMancerOld() map[string]any { + if p == nil { + return nil + } + return p.MancerOld +} + +func (p *ProviderOptions) GetMara() map[string]any { + if p == nil { + return nil + } + return p.Mara +} + +func (p *ProviderOptions) GetMeta() map[string]any { + if p == nil { + return nil + } + return p.Meta +} + +func (p *ProviderOptions) GetMinimax() map[string]any { + if p == nil { + return nil + } + return p.Minimax +} + +func (p *ProviderOptions) GetMistral() map[string]any { + if p == nil { + return nil + } + return p.Mistral +} + +func (p *ProviderOptions) GetModal() map[string]any { + if p == nil { + return nil + } + return p.Modal +} + +func (p *ProviderOptions) GetModelrun() map[string]any { + if p == nil { + return nil + } + return p.Modelrun +} + +func (p *ProviderOptions) GetModular() map[string]any { + if p == nil { + return nil + } + return p.Modular +} + +func (p *ProviderOptions) GetMoonshotai() map[string]any { + if p == nil { + return nil + } + return p.Moonshotai +} + +func (p *ProviderOptions) GetMorph() map[string]any { + if p == nil { + return nil + } + return p.Morph +} + +func (p *ProviderOptions) GetNcompass() map[string]any { + if p == nil { + return nil + } + return p.Ncompass +} + +func (p *ProviderOptions) GetNebius() map[string]any { + if p == nil { + return nil + } + return p.Nebius +} + +func (p *ProviderOptions) GetNexAgi() map[string]any { + if p == nil { + return nil + } + return p.NexAgi +} + +func (p *ProviderOptions) GetNextbit() map[string]any { + if p == nil { + return nil + } + return p.Nextbit +} + +func (p *ProviderOptions) GetNineteen() map[string]any { + if p == nil { + return nil + } + return p.Nineteen +} + +func (p *ProviderOptions) GetNovita() map[string]any { + if p == nil { + return nil + } + return p.Novita +} + +func (p *ProviderOptions) GetNvidia() map[string]any { + if p == nil { + return nil + } + return p.Nvidia +} + +func (p *ProviderOptions) GetOctoai() map[string]any { + if p == nil { + return nil + } + return p.Octoai +} + +func (p *ProviderOptions) GetOpenInference() map[string]any { + if p == nil { + return nil + } + return p.OpenInference +} + +func (p *ProviderOptions) GetOpenai() map[string]any { + if p == nil { + return nil + } + return p.Openai +} + +func (p *ProviderOptions) GetParasail() map[string]any { + if p == nil { + return nil + } + return p.Parasail +} + +func (p *ProviderOptions) GetPerceptron() map[string]any { + if p == nil { + return nil + } + return p.Perceptron +} + +func (p *ProviderOptions) GetPerplexity() map[string]any { + if p == nil { + return nil + } + return p.Perplexity +} + +func (p *ProviderOptions) GetPhala() map[string]any { + if p == nil { + return nil + } + return p.Phala +} + +func (p *ProviderOptions) GetPoolside() map[string]any { + if p == nil { + return nil + } + return p.Poolside +} + +func (p *ProviderOptions) GetRecraft() map[string]any { + if p == nil { + return nil + } + return p.Recraft +} + +func (p *ProviderOptions) GetRecursal() map[string]any { + if p == nil { + return nil + } + return p.Recursal +} + +func (p *ProviderOptions) GetReflection() map[string]any { + if p == nil { + return nil + } + return p.Reflection +} + +func (p *ProviderOptions) GetReka() map[string]any { + if p == nil { + return nil + } + return p.Reka +} + +func (p *ProviderOptions) GetRelace() map[string]any { + if p == nil { + return nil + } + return p.Relace +} + +func (p *ProviderOptions) GetReplicate() map[string]any { + if p == nil { + return nil + } + return p.Replicate +} + +func (p *ProviderOptions) GetSambanova() map[string]any { + if p == nil { + return nil + } + return p.Sambanova +} + +func (p *ProviderOptions) GetSambanovaCloaked() map[string]any { + if p == nil { + return nil + } + return p.SambanovaCloaked +} + +func (p *ProviderOptions) GetSeed() map[string]any { + if p == nil { + return nil + } + return p.Seed +} + +func (p *ProviderOptions) GetSfCompute() map[string]any { + if p == nil { + return nil + } + return p.SfCompute +} + +func (p *ProviderOptions) GetSiliconflow() map[string]any { + if p == nil { + return nil + } + return p.Siliconflow +} + +func (p *ProviderOptions) GetSourceful() map[string]any { + if p == nil { + return nil + } + return p.Sourceful +} + +func (p *ProviderOptions) GetStealth() map[string]any { + if p == nil { + return nil + } + return p.Stealth +} + +func (p *ProviderOptions) GetStepfun() map[string]any { + if p == nil { + return nil + } + return p.Stepfun +} + +func (p *ProviderOptions) GetStreamlake() map[string]any { + if p == nil { + return nil + } + return p.Streamlake +} + +func (p *ProviderOptions) GetSwitchpoint() map[string]any { + if p == nil { + return nil + } + return p.Switchpoint +} + +func (p *ProviderOptions) GetTargon() map[string]any { + if p == nil { + return nil + } + return p.Targon +} + +func (p *ProviderOptions) GetTogether() map[string]any { + if p == nil { + return nil + } + return p.Together +} + +func (p *ProviderOptions) GetTogetherLite() map[string]any { + if p == nil { + return nil + } + return p.TogetherLite +} + +func (p *ProviderOptions) GetUbicloud() map[string]any { + if p == nil { + return nil + } + return p.Ubicloud +} + +func (p *ProviderOptions) GetUpstage() map[string]any { + if p == nil { + return nil + } + return p.Upstage +} + +func (p *ProviderOptions) GetVenice() map[string]any { + if p == nil { + return nil + } + return p.Venice +} + +func (p *ProviderOptions) GetWafer() map[string]any { + if p == nil { + return nil + } + return p.Wafer +} + +func (p *ProviderOptions) GetWandb() map[string]any { + if p == nil { + return nil + } + return p.Wandb +} + +func (p *ProviderOptions) GetXai() map[string]any { + if p == nil { + return nil + } + return p.Xai +} + +func (p *ProviderOptions) GetXiaomi() map[string]any { + if p == nil { + return nil + } + return p.Xiaomi +} + +func (p *ProviderOptions) GetZAi() map[string]any { + if p == nil { + return nil + } + return p.ZAi +} diff --git a/models/components/providerresponse.go b/models/components/providerresponse.go index 7d98e1a0..78d4b9d2 100644 --- a/models/components/providerresponse.go +++ b/models/components/providerresponse.go @@ -13,6 +13,7 @@ const ( ProviderResponseProviderNameEnfer ProviderResponseProviderName = "Enfer" ProviderResponseProviderNameGoPomelo ProviderResponseProviderName = "GoPomelo" ProviderResponseProviderNameHuggingFace ProviderResponseProviderName = "HuggingFace" + ProviderResponseProviderNameHyperbolic ProviderResponseProviderName = "Hyperbolic" ProviderResponseProviderNameHyperbolic2 ProviderResponseProviderName = "Hyperbolic 2" ProviderResponseProviderNameInoCloud ProviderResponseProviderName = "InoCloud" ProviderResponseProviderNameKluster ProviderResponseProviderName = "Kluster" @@ -56,10 +57,14 @@ const ( ProviderResponseProviderNameClarifai ProviderResponseProviderName = "Clarifai" ProviderResponseProviderNameCloudflare ProviderResponseProviderName = "Cloudflare" ProviderResponseProviderNameCohere ProviderResponseProviderName = "Cohere" + ProviderResponseProviderNameCrucible ProviderResponseProviderName = "Crucible" ProviderResponseProviderNameCrusoe ProviderResponseProviderName = "Crusoe" + ProviderResponseProviderNameDarkbloom ProviderResponseProviderName = "Darkbloom" + ProviderResponseProviderNameDecart ProviderResponseProviderName = "Decart" ProviderResponseProviderNameDeepInfra ProviderResponseProviderName = "DeepInfra" ProviderResponseProviderNameDeepSeek ProviderResponseProviderName = "DeepSeek" ProviderResponseProviderNameDekaLlm ProviderResponseProviderName = "DekaLLM" + ProviderResponseProviderNameDigitalOcean ProviderResponseProviderName = "DigitalOcean" ProviderResponseProviderNameFeatherless ProviderResponseProviderName = "Featherless" ProviderResponseProviderNameFireworks ProviderResponseProviderName = "Fireworks" ProviderResponseProviderNameFriendli ProviderResponseProviderName = "Friendli" @@ -67,7 +72,6 @@ const ( ProviderResponseProviderNameGoogle ProviderResponseProviderName = "Google" ProviderResponseProviderNameGoogleAiStudio ProviderResponseProviderName = "Google AI Studio" ProviderResponseProviderNameGroq ProviderResponseProviderName = "Groq" - ProviderResponseProviderNameHyperbolic ProviderResponseProviderName = "Hyperbolic" ProviderResponseProviderNameInception ProviderResponseProviderName = "Inception" ProviderResponseProviderNameInceptron ProviderResponseProviderName = "Inceptron" ProviderResponseProviderNameInferenceNet ProviderResponseProviderName = "InferenceNet" @@ -86,12 +90,15 @@ const ( ProviderResponseProviderNameMorph ProviderResponseProviderName = "Morph" ProviderResponseProviderNameNCompass ProviderResponseProviderName = "NCompass" ProviderResponseProviderNameNebius ProviderResponseProviderName = "Nebius" + ProviderResponseProviderNameNexAgi ProviderResponseProviderName = "Nex AGI" ProviderResponseProviderNameNextBit ProviderResponseProviderName = "NextBit" ProviderResponseProviderNameNovita ProviderResponseProviderName = "Novita" ProviderResponseProviderNameNvidia ProviderResponseProviderName = "Nvidia" ProviderResponseProviderNameOpenAi ProviderResponseProviderName = "OpenAI" ProviderResponseProviderNameOpenInference ProviderResponseProviderName = "OpenInference" ProviderResponseProviderNameParasail ProviderResponseProviderName = "Parasail" + ProviderResponseProviderNamePoolside ProviderResponseProviderName = "Poolside" + ProviderResponseProviderNamePerceptron ProviderResponseProviderName = "Perceptron" ProviderResponseProviderNamePerplexity ProviderResponseProviderName = "Perplexity" ProviderResponseProviderNamePhala ProviderResponseProviderName = "Phala" ProviderResponseProviderNameRecraft ProviderResponseProviderName = "Recraft" @@ -108,6 +115,7 @@ const ( ProviderResponseProviderNameTogether ProviderResponseProviderName = "Together" ProviderResponseProviderNameUpstage ProviderResponseProviderName = "Upstage" ProviderResponseProviderNameVenice ProviderResponseProviderName = "Venice" + ProviderResponseProviderNameWafer ProviderResponseProviderName = "Wafer" ProviderResponseProviderNameWandB ProviderResponseProviderName = "WandB" ProviderResponseProviderNameXiaomi ProviderResponseProviderName = "Xiaomi" ProviderResponseProviderNameXAi ProviderResponseProviderName = "xAI" @@ -123,7 +131,7 @@ func (e ProviderResponseProviderName) ToPointer() *ProviderResponseProviderName func (e *ProviderResponseProviderName) IsExact() bool { if e != nil { switch *e { - case "AnyScale", "Atoma", "Cent-ML", "CrofAI", "Enfer", "GoPomelo", "HuggingFace", "Hyperbolic 2", "InoCloud", "Kluster", "Lambda", "Lepton", "Lynn 2", "Lynn", "Mancer", "Meta", "Modal", "Nineteen", "OctoAI", "Recursal", "Reflection", "Replicate", "SambaNova 2", "SF Compute", "Targon", "Together 2", "Ubicloud", "01.AI", "AkashML", "AI21", "AionLabs", "Alibaba", "Ambient", "Baidu", "Amazon Bedrock", "Amazon Nova", "Anthropic", "Arcee AI", "AtlasCloud", "Avian", "Azure", "BaseTen", "BytePlus", "Black Forest Labs", "Cerebras", "Chutes", "Cirrascale", "Clarifai", "Cloudflare", "Cohere", "Crusoe", "DeepInfra", "DeepSeek", "DekaLLM", "Featherless", "Fireworks", "Friendli", "GMICloud", "Google", "Google AI Studio", "Groq", "Hyperbolic", "Inception", "Inceptron", "InferenceNet", "Ionstream", "Infermatic", "Io Net", "Inflection", "Liquid", "Mara", "Mancer 2", "Minimax", "ModelRun", "Mistral", "Modular", "Moonshot AI", "Morph", "NCompass", "Nebius", "NextBit", "Novita", "Nvidia", "OpenAI", "OpenInference", "Parasail", "Perplexity", "Phala", "Recraft", "Reka", "Relace", "SambaNova", "Seed", "SiliconFlow", "Sourceful", "StepFun", "Stealth", "StreamLake", "Switchpoint", "Together", "Upstage", "Venice", "WandB", "Xiaomi", "xAI", "Z.AI", "FakeProvider": + case "AnyScale", "Atoma", "Cent-ML", "CrofAI", "Enfer", "GoPomelo", "HuggingFace", "Hyperbolic", "Hyperbolic 2", "InoCloud", "Kluster", "Lambda", "Lepton", "Lynn 2", "Lynn", "Mancer", "Meta", "Modal", "Nineteen", "OctoAI", "Recursal", "Reflection", "Replicate", "SambaNova 2", "SF Compute", "Targon", "Together 2", "Ubicloud", "01.AI", "AkashML", "AI21", "AionLabs", "Alibaba", "Ambient", "Baidu", "Amazon Bedrock", "Amazon Nova", "Anthropic", "Arcee AI", "AtlasCloud", "Avian", "Azure", "BaseTen", "BytePlus", "Black Forest Labs", "Cerebras", "Chutes", "Cirrascale", "Clarifai", "Cloudflare", "Cohere", "Crucible", "Crusoe", "Darkbloom", "Decart", "DeepInfra", "DeepSeek", "DekaLLM", "DigitalOcean", "Featherless", "Fireworks", "Friendli", "GMICloud", "Google", "Google AI Studio", "Groq", "Inception", "Inceptron", "InferenceNet", "Ionstream", "Infermatic", "Io Net", "Inflection", "Liquid", "Mara", "Mancer 2", "Minimax", "ModelRun", "Mistral", "Modular", "Moonshot AI", "Morph", "NCompass", "Nebius", "Nex AGI", "NextBit", "Novita", "Nvidia", "OpenAI", "OpenInference", "Parasail", "Poolside", "Perceptron", "Perplexity", "Phala", "Recraft", "Reka", "Relace", "SambaNova", "Seed", "SiliconFlow", "Sourceful", "StepFun", "Stealth", "StreamLake", "Switchpoint", "Together", "Upstage", "Venice", "Wafer", "WandB", "Xiaomi", "xAI", "Z.AI", "FakeProvider": return true } } @@ -145,7 +153,7 @@ type ProviderResponse struct { // Name of the provider ProviderName *ProviderResponseProviderName `json:"provider_name,omitzero"` // HTTP status code from the provider - Status *float64 `json:"status"` + Status *int64 `json:"status"` } func (p *ProviderResponse) GetEndpointID() *string { @@ -190,7 +198,7 @@ func (p *ProviderResponse) GetProviderName() *ProviderResponseProviderName { return p.ProviderName } -func (p *ProviderResponse) GetStatus() *float64 { +func (p *ProviderResponse) GetStatus() *int64 { if p == nil { return nil } diff --git a/models/components/rankingsdailyitem.go b/models/components/rankingsdailyitem.go new file mode 100644 index 00000000..0a8d025b --- /dev/null +++ b/models/components/rankingsdailyitem.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type RankingsDailyItem struct { + // UTC calendar date the row is aggregated over (YYYY-MM-DD). + Date string `json:"date"` + // Model variant permaslug (e.g. `openai/gpt-4o-2024-05-13`, `openai/gpt-4o-2024-05-13:free`). Non-default variants include a `:variant` suffix and are ranked as their own entry. The reserved value `other` denotes the aggregated row covering every model outside the daily top 50 for that date — always sorted last within its date. + ModelPermaslug string `json:"model_permaslug"` + // Sum of `prompt_tokens + completion_tokens` for the day, returned as a decimal string so 64-bit values are not truncated. + TotalTokens string `json:"total_tokens"` +} + +func (r *RankingsDailyItem) GetDate() string { + if r == nil { + return "" + } + return r.Date +} + +func (r *RankingsDailyItem) GetModelPermaslug() string { + if r == nil { + return "" + } + return r.ModelPermaslug +} + +func (r *RankingsDailyItem) GetTotalTokens() string { + if r == nil { + return "" + } + return r.TotalTokens +} diff --git a/models/components/rankingsdailymeta.go b/models/components/rankingsdailymeta.go new file mode 100644 index 00000000..6e2165f6 --- /dev/null +++ b/models/components/rankingsdailymeta.go @@ -0,0 +1,71 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// RankingsDailyMetaVersion - Dataset version. Field names and grain are stable for the life of `v1`. +type RankingsDailyMetaVersion string + +const ( + RankingsDailyMetaVersionV1 RankingsDailyMetaVersion = "v1" +) + +func (e RankingsDailyMetaVersion) ToPointer() *RankingsDailyMetaVersion { + return &e +} +func (e *RankingsDailyMetaVersion) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "v1": + *e = RankingsDailyMetaVersion(v) + return nil + default: + return fmt.Errorf("invalid value for RankingsDailyMetaVersion: %v", v) + } +} + +type RankingsDailyMeta struct { + // ISO-8601 timestamp of when the response was generated. Reflects data-freshness because the underlying materialized view continuously ingests upstream events. + AsOf string `json:"as_of"` + // Resolved end of the date window (UTC, inclusive). + EndDate string `json:"end_date"` + // Resolved start of the date window (UTC, inclusive). + StartDate string `json:"start_date"` + // Dataset version. Field names and grain are stable for the life of `v1`. + Version RankingsDailyMetaVersion `json:"version"` +} + +func (r *RankingsDailyMeta) GetAsOf() string { + if r == nil { + return "" + } + return r.AsOf +} + +func (r *RankingsDailyMeta) GetEndDate() string { + if r == nil { + return "" + } + return r.EndDate +} + +func (r *RankingsDailyMeta) GetStartDate() string { + if r == nil { + return "" + } + return r.StartDate +} + +func (r *RankingsDailyMeta) GetVersion() RankingsDailyMetaVersion { + if r == nil { + return RankingsDailyMetaVersion("") + } + return r.Version +} diff --git a/models/components/rankingsdailyresponse.go b/models/components/rankingsdailyresponse.go new file mode 100644 index 00000000..b4835e6e --- /dev/null +++ b/models/components/rankingsdailyresponse.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type RankingsDailyResponse struct { + // Up to 51 rows per day — the top 50 public models by `total_tokens` for each UTC calendar date in the window, plus one aggregated `other` row summing every model outside that top 50 (omitted when the long tail is empty). Rows are sorted by `date` ascending, then by `total_tokens` descending, with `other` pinned last within its date. Ties between real models break alphabetically on `model_permaslug` so the order is stable across requests. + Data []RankingsDailyItem `json:"data"` + Meta RankingsDailyMeta `json:"meta"` +} + +func (r *RankingsDailyResponse) GetData() []RankingsDailyItem { + if r == nil { + return []RankingsDailyItem{} + } + return r.Data +} + +func (r *RankingsDailyResponse) GetMeta() RankingsDailyMeta { + if r == nil { + return RankingsDailyMeta{} + } + return r.Meta +} diff --git a/models/components/responsesrequest.go b/models/components/responsesrequest.go index 568695ed..0c731d2c 100644 --- a/models/components/responsesrequest.go +++ b/models/components/responsesrequest.go @@ -17,20 +17,24 @@ const ( ResponsesRequestPluginTypeAutoRouter ResponsesRequestPluginType = "auto-router" ResponsesRequestPluginTypeContextCompression ResponsesRequestPluginType = "context-compression" ResponsesRequestPluginTypeFileParser ResponsesRequestPluginType = "file-parser" + ResponsesRequestPluginTypeFusion ResponsesRequestPluginType = "fusion" ResponsesRequestPluginTypeModeration ResponsesRequestPluginType = "moderation" ResponsesRequestPluginTypeParetoRouter ResponsesRequestPluginType = "pareto-router" ResponsesRequestPluginTypeResponseHealing ResponsesRequestPluginType = "response-healing" ResponsesRequestPluginTypeWeb ResponsesRequestPluginType = "web" + ResponsesRequestPluginTypeWebFetch ResponsesRequestPluginType = "web-fetch" ) type ResponsesRequestPlugin struct { AutoRouterPlugin *AutoRouterPlugin `queryParam:"inline" union:"member"` ModerationPlugin *ModerationPlugin `queryParam:"inline" union:"member"` WebSearchPlugin *WebSearchPlugin `queryParam:"inline" union:"member"` + WebFetchPlugin *WebFetchPlugin `queryParam:"inline" union:"member"` FileParserPlugin *FileParserPlugin `queryParam:"inline" union:"member"` ResponseHealingPlugin *ResponseHealingPlugin `queryParam:"inline" union:"member"` ContextCompressionPlugin *ContextCompressionPlugin `queryParam:"inline" union:"member"` ParetoRouterPlugin *ParetoRouterPlugin `queryParam:"inline" union:"member"` + FusionPlugin *FusionPlugin `queryParam:"inline" union:"member"` Type ResponsesRequestPluginType } @@ -71,6 +75,18 @@ func CreateResponsesRequestPluginFileParser(fileParser FileParserPlugin) Respons } } +func CreateResponsesRequestPluginFusion(fusion FusionPlugin) ResponsesRequestPlugin { + typ := ResponsesRequestPluginTypeFusion + + typStr := FusionPluginID(typ) + fusion.ID = typStr + + return ResponsesRequestPlugin{ + FusionPlugin: &fusion, + Type: typ, + } +} + func CreateResponsesRequestPluginModeration(moderation ModerationPlugin) ResponsesRequestPlugin { typ := ResponsesRequestPluginTypeModeration @@ -119,6 +135,18 @@ func CreateResponsesRequestPluginWeb(web WebSearchPlugin) ResponsesRequestPlugin } } +func CreateResponsesRequestPluginWebFetch(webFetch WebFetchPlugin) ResponsesRequestPlugin { + typ := ResponsesRequestPluginTypeWebFetch + + typStr := WebFetchPluginID(typ) + webFetch.ID = typStr + + return ResponsesRequestPlugin{ + WebFetchPlugin: &webFetch, + Type: typ, + } +} + func (u *ResponsesRequestPlugin) UnmarshalJSON(data []byte) error { type discriminator struct { @@ -158,6 +186,15 @@ func (u *ResponsesRequestPlugin) UnmarshalJSON(data []byte) error { u.FileParserPlugin = fileParserPlugin u.Type = ResponsesRequestPluginTypeFileParser return nil + case "fusion": + fusionPlugin := new(FusionPlugin) + if err := utils.UnmarshalJSON(data, &fusionPlugin, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (ID == fusion) type FusionPlugin within ResponsesRequestPlugin: %w", string(data), err) + } + + u.FusionPlugin = fusionPlugin + u.Type = ResponsesRequestPluginTypeFusion + return nil case "moderation": moderationPlugin := new(ModerationPlugin) if err := utils.UnmarshalJSON(data, &moderationPlugin, "", true, nil); err != nil { @@ -194,6 +231,15 @@ func (u *ResponsesRequestPlugin) UnmarshalJSON(data []byte) error { u.WebSearchPlugin = webSearchPlugin u.Type = ResponsesRequestPluginTypeWeb return nil + case "web-fetch": + webFetchPlugin := new(WebFetchPlugin) + if err := utils.UnmarshalJSON(data, &webFetchPlugin, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (ID == web-fetch) type WebFetchPlugin within ResponsesRequestPlugin: %w", string(data), err) + } + + u.WebFetchPlugin = webFetchPlugin + u.Type = ResponsesRequestPluginTypeWebFetch + return nil } return fmt.Errorf("could not unmarshal `%s` into any supported union types for ResponsesRequestPlugin", string(data)) @@ -212,6 +258,10 @@ func (u ResponsesRequestPlugin) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.WebSearchPlugin, "", true) } + if u.WebFetchPlugin != nil { + return utils.MarshalJSON(u.WebFetchPlugin, "", true) + } + if u.FileParserPlugin != nil { return utils.MarshalJSON(u.FileParserPlugin, "", true) } @@ -228,6 +278,10 @@ func (u ResponsesRequestPlugin) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.ParetoRouterPlugin, "", true) } + if u.FusionPlugin != nil { + return utils.MarshalJSON(u.FusionPlugin, "", true) + } + return nil, errors.New("could not marshal union type ResponsesRequestPlugin: all fields are null") } @@ -351,10 +405,17 @@ const ( ResponsesRequestToolUnionTypeShell ResponsesRequestToolUnionType = "shell" ResponsesRequestToolUnionTypeApplyPatch ResponsesRequestToolUnionType = "apply_patch" ResponsesRequestToolUnionTypeCustom ResponsesRequestToolUnionType = "custom" + ResponsesRequestToolUnionTypeOpenrouterAdvisor ResponsesRequestToolUnionType = "openrouter:advisor" + ResponsesRequestToolUnionTypeOpenrouterSubagent ResponsesRequestToolUnionType = "openrouter:subagent" ResponsesRequestToolUnionTypeOpenrouterDatetime ResponsesRequestToolUnionType = "openrouter:datetime" + ResponsesRequestToolUnionTypeOpenrouterFusion ResponsesRequestToolUnionType = "openrouter:fusion" ResponsesRequestToolUnionTypeOpenrouterImageGeneration ResponsesRequestToolUnionType = "openrouter:image_generation" ResponsesRequestToolUnionTypeOpenrouterExperimentalSearchModels ResponsesRequestToolUnionType = "openrouter:experimental__search_models" + ResponsesRequestToolUnionTypeOpenrouterWebFetch ResponsesRequestToolUnionType = "openrouter:web_fetch" ResponsesRequestToolUnionTypeOpenrouterWebSearch ResponsesRequestToolUnionType = "openrouter:web_search" + ResponsesRequestToolUnionTypeOpenrouterApplyPatch ResponsesRequestToolUnionType = "openrouter:apply_patch" + ResponsesRequestToolUnionTypeOpenrouterBash ResponsesRequestToolUnionType = "openrouter:bash" + ResponsesRequestToolUnionTypeOpenrouterShell ResponsesRequestToolUnionType = "openrouter:shell" ) type ResponsesRequestToolUnion struct { @@ -372,10 +433,17 @@ type ResponsesRequestToolUnion struct { ShellServerTool *ShellServerTool `queryParam:"inline" union:"member"` ApplyPatchServerTool *ApplyPatchServerTool `queryParam:"inline" union:"member"` CustomTool *CustomTool `queryParam:"inline" union:"member"` + AdvisorServerToolOpenRouter *AdvisorServerToolOpenRouter `queryParam:"inline" union:"member"` + SubagentServerToolOpenRouter *SubagentServerToolOpenRouter `queryParam:"inline" union:"member"` DatetimeServerTool *DatetimeServerTool `queryParam:"inline" union:"member"` + FusionServerToolOpenRouter *FusionServerToolOpenRouter `queryParam:"inline" union:"member"` ImageGenerationServerToolOpenRouter *ImageGenerationServerToolOpenRouter `queryParam:"inline" union:"member"` ChatSearchModelsServerTool *ChatSearchModelsServerTool `queryParam:"inline" union:"member"` + WebFetchServerTool *WebFetchServerTool `queryParam:"inline" union:"member"` WebSearchServerToolOpenRouter *WebSearchServerToolOpenRouter `queryParam:"inline" union:"member"` + ApplyPatchServerToolOpenRouter *ApplyPatchServerToolOpenRouter `queryParam:"inline" union:"member"` + BashServerTool *BashServerTool `queryParam:"inline" union:"member"` + ShellServerToolOpenRouter *ShellServerToolOpenRouter `queryParam:"inline" union:"member"` Type ResponsesRequestToolUnionType } @@ -539,7 +607,7 @@ func CreateResponsesRequestToolUnionApplyPatch(applyPatch ApplyPatchServerTool) func CreateResponsesRequestToolUnionCustom(custom CustomTool) ResponsesRequestToolUnion { typ := ResponsesRequestToolUnionTypeCustom - typStr := TypeCustom(typ) + typStr := CustomToolTypeCustom(typ) custom.Type = typStr return ResponsesRequestToolUnion{ @@ -548,6 +616,30 @@ func CreateResponsesRequestToolUnionCustom(custom CustomTool) ResponsesRequestTo } } +func CreateResponsesRequestToolUnionOpenrouterAdvisor(openrouterAdvisor AdvisorServerToolOpenRouter) ResponsesRequestToolUnion { + typ := ResponsesRequestToolUnionTypeOpenrouterAdvisor + + typStr := AdvisorServerToolOpenRouterType(typ) + openrouterAdvisor.Type = typStr + + return ResponsesRequestToolUnion{ + AdvisorServerToolOpenRouter: &openrouterAdvisor, + Type: typ, + } +} + +func CreateResponsesRequestToolUnionOpenrouterSubagent(openrouterSubagent SubagentServerToolOpenRouter) ResponsesRequestToolUnion { + typ := ResponsesRequestToolUnionTypeOpenrouterSubagent + + typStr := SubagentServerToolOpenRouterType(typ) + openrouterSubagent.Type = typStr + + return ResponsesRequestToolUnion{ + SubagentServerToolOpenRouter: &openrouterSubagent, + Type: typ, + } +} + func CreateResponsesRequestToolUnionOpenrouterDatetime(openrouterDatetime DatetimeServerTool) ResponsesRequestToolUnion { typ := ResponsesRequestToolUnionTypeOpenrouterDatetime @@ -560,6 +652,18 @@ func CreateResponsesRequestToolUnionOpenrouterDatetime(openrouterDatetime Dateti } } +func CreateResponsesRequestToolUnionOpenrouterFusion(openrouterFusion FusionServerToolOpenRouter) ResponsesRequestToolUnion { + typ := ResponsesRequestToolUnionTypeOpenrouterFusion + + typStr := FusionServerToolOpenRouterType(typ) + openrouterFusion.Type = typStr + + return ResponsesRequestToolUnion{ + FusionServerToolOpenRouter: &openrouterFusion, + Type: typ, + } +} + func CreateResponsesRequestToolUnionOpenrouterImageGeneration(openrouterImageGeneration ImageGenerationServerToolOpenRouter) ResponsesRequestToolUnion { typ := ResponsesRequestToolUnionTypeOpenrouterImageGeneration @@ -584,6 +688,18 @@ func CreateResponsesRequestToolUnionOpenrouterExperimentalSearchModels(openroute } } +func CreateResponsesRequestToolUnionOpenrouterWebFetch(openrouterWebFetch WebFetchServerTool) ResponsesRequestToolUnion { + typ := ResponsesRequestToolUnionTypeOpenrouterWebFetch + + typStr := WebFetchServerToolType(typ) + openrouterWebFetch.Type = typStr + + return ResponsesRequestToolUnion{ + WebFetchServerTool: &openrouterWebFetch, + Type: typ, + } +} + func CreateResponsesRequestToolUnionOpenrouterWebSearch(openrouterWebSearch WebSearchServerToolOpenRouter) ResponsesRequestToolUnion { typ := ResponsesRequestToolUnionTypeOpenrouterWebSearch @@ -596,6 +712,42 @@ func CreateResponsesRequestToolUnionOpenrouterWebSearch(openrouterWebSearch WebS } } +func CreateResponsesRequestToolUnionOpenrouterApplyPatch(openrouterApplyPatch ApplyPatchServerToolOpenRouter) ResponsesRequestToolUnion { + typ := ResponsesRequestToolUnionTypeOpenrouterApplyPatch + + typStr := ApplyPatchServerToolOpenRouterType(typ) + openrouterApplyPatch.Type = typStr + + return ResponsesRequestToolUnion{ + ApplyPatchServerToolOpenRouter: &openrouterApplyPatch, + Type: typ, + } +} + +func CreateResponsesRequestToolUnionOpenrouterBash(openrouterBash BashServerTool) ResponsesRequestToolUnion { + typ := ResponsesRequestToolUnionTypeOpenrouterBash + + typStr := BashServerToolType(typ) + openrouterBash.Type = typStr + + return ResponsesRequestToolUnion{ + BashServerTool: &openrouterBash, + Type: typ, + } +} + +func CreateResponsesRequestToolUnionOpenrouterShell(openrouterShell ShellServerToolOpenRouter) ResponsesRequestToolUnion { + typ := ResponsesRequestToolUnionTypeOpenrouterShell + + typStr := ShellServerToolOpenRouterType(typ) + openrouterShell.Type = typStr + + return ResponsesRequestToolUnion{ + ShellServerToolOpenRouter: &openrouterShell, + Type: typ, + } +} + func (u *ResponsesRequestToolUnion) UnmarshalJSON(data []byte) error { type discriminator struct { @@ -734,6 +886,24 @@ func (u *ResponsesRequestToolUnion) UnmarshalJSON(data []byte) error { u.CustomTool = customTool u.Type = ResponsesRequestToolUnionTypeCustom return nil + case "openrouter:advisor": + advisorServerToolOpenRouter := new(AdvisorServerToolOpenRouter) + if err := utils.UnmarshalJSON(data, &advisorServerToolOpenRouter, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == openrouter:advisor) type AdvisorServerToolOpenRouter within ResponsesRequestToolUnion: %w", string(data), err) + } + + u.AdvisorServerToolOpenRouter = advisorServerToolOpenRouter + u.Type = ResponsesRequestToolUnionTypeOpenrouterAdvisor + return nil + case "openrouter:subagent": + subagentServerToolOpenRouter := new(SubagentServerToolOpenRouter) + if err := utils.UnmarshalJSON(data, &subagentServerToolOpenRouter, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == openrouter:subagent) type SubagentServerToolOpenRouter within ResponsesRequestToolUnion: %w", string(data), err) + } + + u.SubagentServerToolOpenRouter = subagentServerToolOpenRouter + u.Type = ResponsesRequestToolUnionTypeOpenrouterSubagent + return nil case "openrouter:datetime": datetimeServerTool := new(DatetimeServerTool) if err := utils.UnmarshalJSON(data, &datetimeServerTool, "", true, nil); err != nil { @@ -743,6 +913,15 @@ func (u *ResponsesRequestToolUnion) UnmarshalJSON(data []byte) error { u.DatetimeServerTool = datetimeServerTool u.Type = ResponsesRequestToolUnionTypeOpenrouterDatetime return nil + case "openrouter:fusion": + fusionServerToolOpenRouter := new(FusionServerToolOpenRouter) + if err := utils.UnmarshalJSON(data, &fusionServerToolOpenRouter, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == openrouter:fusion) type FusionServerToolOpenRouter within ResponsesRequestToolUnion: %w", string(data), err) + } + + u.FusionServerToolOpenRouter = fusionServerToolOpenRouter + u.Type = ResponsesRequestToolUnionTypeOpenrouterFusion + return nil case "openrouter:image_generation": imageGenerationServerToolOpenRouter := new(ImageGenerationServerToolOpenRouter) if err := utils.UnmarshalJSON(data, &imageGenerationServerToolOpenRouter, "", true, nil); err != nil { @@ -761,6 +940,15 @@ func (u *ResponsesRequestToolUnion) UnmarshalJSON(data []byte) error { u.ChatSearchModelsServerTool = chatSearchModelsServerTool u.Type = ResponsesRequestToolUnionTypeOpenrouterExperimentalSearchModels return nil + case "openrouter:web_fetch": + webFetchServerTool := new(WebFetchServerTool) + if err := utils.UnmarshalJSON(data, &webFetchServerTool, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == openrouter:web_fetch) type WebFetchServerTool within ResponsesRequestToolUnion: %w", string(data), err) + } + + u.WebFetchServerTool = webFetchServerTool + u.Type = ResponsesRequestToolUnionTypeOpenrouterWebFetch + return nil case "openrouter:web_search": webSearchServerToolOpenRouter := new(WebSearchServerToolOpenRouter) if err := utils.UnmarshalJSON(data, &webSearchServerToolOpenRouter, "", true, nil); err != nil { @@ -770,6 +958,33 @@ func (u *ResponsesRequestToolUnion) UnmarshalJSON(data []byte) error { u.WebSearchServerToolOpenRouter = webSearchServerToolOpenRouter u.Type = ResponsesRequestToolUnionTypeOpenrouterWebSearch return nil + case "openrouter:apply_patch": + applyPatchServerToolOpenRouter := new(ApplyPatchServerToolOpenRouter) + if err := utils.UnmarshalJSON(data, &applyPatchServerToolOpenRouter, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == openrouter:apply_patch) type ApplyPatchServerToolOpenRouter within ResponsesRequestToolUnion: %w", string(data), err) + } + + u.ApplyPatchServerToolOpenRouter = applyPatchServerToolOpenRouter + u.Type = ResponsesRequestToolUnionTypeOpenrouterApplyPatch + return nil + case "openrouter:bash": + bashServerTool := new(BashServerTool) + if err := utils.UnmarshalJSON(data, &bashServerTool, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == openrouter:bash) type BashServerTool within ResponsesRequestToolUnion: %w", string(data), err) + } + + u.BashServerTool = bashServerTool + u.Type = ResponsesRequestToolUnionTypeOpenrouterBash + return nil + case "openrouter:shell": + shellServerToolOpenRouter := new(ShellServerToolOpenRouter) + if err := utils.UnmarshalJSON(data, &shellServerToolOpenRouter, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == openrouter:shell) type ShellServerToolOpenRouter within ResponsesRequestToolUnion: %w", string(data), err) + } + + u.ShellServerToolOpenRouter = shellServerToolOpenRouter + u.Type = ResponsesRequestToolUnionTypeOpenrouterShell + return nil } return fmt.Errorf("could not unmarshal `%s` into any supported union types for ResponsesRequestToolUnion", string(data)) @@ -832,10 +1047,22 @@ func (u ResponsesRequestToolUnion) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.CustomTool, "", true) } + if u.AdvisorServerToolOpenRouter != nil { + return utils.MarshalJSON(u.AdvisorServerToolOpenRouter, "", true) + } + + if u.SubagentServerToolOpenRouter != nil { + return utils.MarshalJSON(u.SubagentServerToolOpenRouter, "", true) + } + if u.DatetimeServerTool != nil { return utils.MarshalJSON(u.DatetimeServerTool, "", true) } + if u.FusionServerToolOpenRouter != nil { + return utils.MarshalJSON(u.FusionServerToolOpenRouter, "", true) + } + if u.ImageGenerationServerToolOpenRouter != nil { return utils.MarshalJSON(u.ImageGenerationServerToolOpenRouter, "", true) } @@ -844,16 +1071,34 @@ func (u ResponsesRequestToolUnion) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.ChatSearchModelsServerTool, "", true) } + if u.WebFetchServerTool != nil { + return utils.MarshalJSON(u.WebFetchServerTool, "", true) + } + if u.WebSearchServerToolOpenRouter != nil { return utils.MarshalJSON(u.WebSearchServerToolOpenRouter, "", true) } + if u.ApplyPatchServerToolOpenRouter != nil { + return utils.MarshalJSON(u.ApplyPatchServerToolOpenRouter, "", true) + } + + if u.BashServerTool != nil { + return utils.MarshalJSON(u.BashServerTool, "", true) + } + + if u.ShellServerToolOpenRouter != nil { + return utils.MarshalJSON(u.ShellServerToolOpenRouter, "", true) + } + return nil, errors.New("could not marshal union type ResponsesRequestToolUnion: all fields are null") } // ResponsesRequest - Request schema for Responses endpoint type ResponsesRequest struct { - Background optionalnullable.OptionalNullable[bool] `json:"background,omitzero"` + Background optionalnullable.OptionalNullable[bool] `json:"background,omitzero"` + // Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + CacheControl *AnthropicCacheControlDirective `json:"cache_control,omitzero"` FrequencyPenalty optionalnullable.OptionalNullable[float64] `json:"frequency_penalty,omitzero"` // Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details. ImageConfig map[string]ImageConfig `json:"image_config,omitzero"` @@ -882,8 +1127,10 @@ type ResponsesRequest struct { Reasoning optionalnullable.OptionalNullable[ReasoningConfig] `json:"reasoning,omitzero"` SafetyIdentifier optionalnullable.OptionalNullable[string] `json:"safety_identifier,omitzero"` ServiceTier optionalnullable.OptionalNullable[ResponsesRequestServiceTier] `default:"auto" json:"service_tier"` - // A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. + // A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. SessionID *string `json:"session_id,omitzero"` + // Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`. + StopServerToolsWhen []StopServerToolsWhenCondition `json:"stop_server_tools_when,omitzero"` //lint:ignore U1000 accessed via reflection for JSON marshaling store *bool `const:"false" json:"store"` Stream *bool `default:"false" json:"stream"` @@ -920,6 +1167,13 @@ func (r *ResponsesRequest) GetBackground() optionalnullable.OptionalNullable[boo return r.Background } +func (r *ResponsesRequest) GetCacheControl() *AnthropicCacheControlDirective { + if r == nil { + return nil + } + return r.CacheControl +} + func (r *ResponsesRequest) GetFrequencyPenalty() optionalnullable.OptionalNullable[float64] { if r == nil { return nil @@ -1074,6 +1328,13 @@ func (r *ResponsesRequest) GetSessionID() *string { return r.SessionID } +func (r *ResponsesRequest) GetStopServerToolsWhen() []StopServerToolsWhenCondition { + if r == nil { + return nil + } + return r.StopServerToolsWhen +} + func (r *ResponsesRequest) GetStore() *bool { return types.Pointer(false) } diff --git a/models/components/responsesstreamingresponse.go b/models/components/responsesstreamingresponse.go new file mode 100644 index 00000000..f0261d23 --- /dev/null +++ b/models/components/responsesstreamingresponse.go @@ -0,0 +1,191 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type ResponsesStreamingResponse struct { + // Union of all possible event types emitted during response streaming + Data StreamEvents `json:"data"` +} + +func (r *ResponsesStreamingResponse) GetData() StreamEvents { + if r == nil { + return StreamEvents{} + } + return r.Data +} + +func (r *ResponsesStreamingResponse) GetDataError() *ErrorEvent { + return r.GetData().ErrorEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseApplyPatchCallOperationDiffDelta() *ApplyPatchCallOperationDiffDeltaEvent { + return r.GetData().ApplyPatchCallOperationDiffDeltaEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseApplyPatchCallOperationDiffDone() *ApplyPatchCallOperationDiffDoneEvent { + return r.GetData().ApplyPatchCallOperationDiffDoneEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseCompleted() *StreamEventsResponseCompleted { + return r.GetData().StreamEventsResponseCompleted +} + +func (r *ResponsesStreamingResponse) GetDataResponseContentPartAdded() *ContentPartAddedEvent { + return r.GetData().ContentPartAddedEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseContentPartDone() *ContentPartDoneEvent { + return r.GetData().ContentPartDoneEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseCreated() *OpenResponsesCreatedEvent { + return r.GetData().OpenResponsesCreatedEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseCustomToolCallInputDelta() *CustomToolCallInputDeltaEvent { + return r.GetData().CustomToolCallInputDeltaEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseCustomToolCallInputDone() *CustomToolCallInputDoneEvent { + return r.GetData().CustomToolCallInputDoneEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseFailed() *StreamEventsResponseFailed { + return r.GetData().StreamEventsResponseFailed +} + +func (r *ResponsesStreamingResponse) GetDataResponseFunctionCallArgumentsDelta() *FunctionCallArgsDeltaEvent { + return r.GetData().FunctionCallArgsDeltaEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseFunctionCallArgumentsDone() *FunctionCallArgsDoneEvent { + return r.GetData().FunctionCallArgsDoneEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseFusionCallAnalysisCompleted() *FusionCallAnalysisCompletedEvent { + return r.GetData().FusionCallAnalysisCompletedEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseFusionCallAnalysisInProgress() *FusionCallAnalysisInProgressEvent { + return r.GetData().FusionCallAnalysisInProgressEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseFusionCallCompleted() *FusionCallCompletedEvent { + return r.GetData().FusionCallCompletedEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseFusionCallInProgress() *FusionCallInProgressEvent { + return r.GetData().FusionCallInProgressEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseFusionCallPanelAdded() *FusionCallPanelAddedEvent { + return r.GetData().FusionCallPanelAddedEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseFusionCallPanelCompleted() *FusionCallPanelCompletedEvent { + return r.GetData().FusionCallPanelCompletedEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseFusionCallPanelDelta() *FusionCallPanelDeltaEvent { + return r.GetData().FusionCallPanelDeltaEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseFusionCallPanelFailed() *FusionCallPanelFailedEvent { + return r.GetData().FusionCallPanelFailedEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseFusionCallPanelReasoningDelta() *FusionCallPanelReasoningDeltaEvent { + return r.GetData().FusionCallPanelReasoningDeltaEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseImageGenerationCallCompleted() *ImageGenCallCompletedEvent { + return r.GetData().ImageGenCallCompletedEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseImageGenerationCallGenerating() *ImageGenCallGeneratingEvent { + return r.GetData().ImageGenCallGeneratingEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseImageGenerationCallInProgress() *ImageGenCallInProgressEvent { + return r.GetData().ImageGenCallInProgressEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseImageGenerationCallPartialImage() *ImageGenCallPartialImageEvent { + return r.GetData().ImageGenCallPartialImageEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseInProgress() *OpenResponsesInProgressEvent { + return r.GetData().OpenResponsesInProgressEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseIncomplete() *StreamEventsResponseIncomplete { + return r.GetData().StreamEventsResponseIncomplete +} + +func (r *ResponsesStreamingResponse) GetDataResponseOutputItemAdded() *StreamEventsResponseOutputItemAdded { + return r.GetData().StreamEventsResponseOutputItemAdded +} + +func (r *ResponsesStreamingResponse) GetDataResponseOutputItemDone() *StreamEventsResponseOutputItemDone { + return r.GetData().StreamEventsResponseOutputItemDone +} + +func (r *ResponsesStreamingResponse) GetDataResponseOutputTextAnnotationAdded() *AnnotationAddedEvent { + return r.GetData().AnnotationAddedEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseOutputTextDelta() *TextDeltaEvent { + return r.GetData().TextDeltaEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseOutputTextDone() *TextDoneEvent { + return r.GetData().TextDoneEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseReasoningSummaryPartAdded() *ReasoningSummaryPartAddedEvent { + return r.GetData().ReasoningSummaryPartAddedEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseReasoningSummaryPartDone() *ReasoningSummaryPartDoneEvent { + return r.GetData().ReasoningSummaryPartDoneEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseReasoningSummaryTextDelta() *ReasoningSummaryTextDeltaEvent { + return r.GetData().ReasoningSummaryTextDeltaEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseReasoningSummaryTextDone() *ReasoningSummaryTextDoneEvent { + return r.GetData().ReasoningSummaryTextDoneEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseReasoningTextDelta() *ReasoningDeltaEvent { + return r.GetData().ReasoningDeltaEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseReasoningTextDone() *ReasoningDoneEvent { + return r.GetData().ReasoningDoneEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseRefusalDelta() *RefusalDeltaEvent { + return r.GetData().RefusalDeltaEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseRefusalDone() *RefusalDoneEvent { + return r.GetData().RefusalDoneEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseWebSearchCallCompleted() *WebSearchCallCompletedEvent { + return r.GetData().WebSearchCallCompletedEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseWebSearchCallInProgress() *WebSearchCallInProgressEvent { + return r.GetData().WebSearchCallInProgressEvent +} + +func (r *ResponsesStreamingResponse) GetDataResponseWebSearchCallSearching() *WebSearchCallSearchingEvent { + return r.GetData().WebSearchCallSearchingEvent +} + +func (r ResponsesStreamingResponse) GetEventEncoding(event string) (string, error) { + return "application/json", nil +} diff --git a/models/components/routerattempt.go b/models/components/routerattempt.go new file mode 100644 index 00000000..8a9b5d2e --- /dev/null +++ b/models/components/routerattempt.go @@ -0,0 +1,45 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type RouterAttempt struct { + Model string `json:"model"` + Provider string `json:"provider"` + Status int64 `json:"status"` +} + +func (r RouterAttempt) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *RouterAttempt) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *RouterAttempt) GetModel() string { + if r == nil { + return "" + } + return r.Model +} + +func (r *RouterAttempt) GetProvider() string { + if r == nil { + return "" + } + return r.Provider +} + +func (r *RouterAttempt) GetStatus() int64 { + if r == nil { + return 0 + } + return r.Status +} diff --git a/models/components/routerparams.go b/models/components/routerparams.go new file mode 100644 index 00000000..d4306ce9 --- /dev/null +++ b/models/components/routerparams.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type RouterParams struct { + QualityFloor *float64 `json:"quality_floor,omitzero"` + ThroughputFloor *float64 `json:"throughput_floor,omitzero"` + VersionGroup *string `json:"version_group,omitzero"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (r RouterParams) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *RouterParams) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &r, "", false, nil); err != nil { + return err + } + return nil +} + +func (r *RouterParams) GetQualityFloor() *float64 { + if r == nil { + return nil + } + return r.QualityFloor +} + +func (r *RouterParams) GetThroughputFloor() *float64 { + if r == nil { + return nil + } + return r.ThroughputFloor +} + +func (r *RouterParams) GetVersionGroup() *string { + if r == nil { + return nil + } + return r.VersionGroup +} + +func (r *RouterParams) GetAdditionalProperties() map[string]any { + if r == nil { + return nil + } + return r.AdditionalProperties +} diff --git a/models/components/routingstrategy.go b/models/components/routingstrategy.go new file mode 100644 index 00000000..beb898df --- /dev/null +++ b/models/components/routingstrategy.go @@ -0,0 +1,32 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type RoutingStrategy string + +const ( + RoutingStrategyDirect RoutingStrategy = "direct" + RoutingStrategyAuto RoutingStrategy = "auto" + RoutingStrategyFree RoutingStrategy = "free" + RoutingStrategyLatest RoutingStrategy = "latest" + RoutingStrategyAlias RoutingStrategy = "alias" + RoutingStrategyFallback RoutingStrategy = "fallback" + RoutingStrategyPareto RoutingStrategy = "pareto" + RoutingStrategyBodybuilder RoutingStrategy = "bodybuilder" + RoutingStrategyFusion RoutingStrategy = "fusion" +) + +func (e RoutingStrategy) ToPointer() *RoutingStrategy { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *RoutingStrategy) IsExact() bool { + if e != nil { + switch *e { + case "direct", "auto", "free", "latest", "alias", "fallback", "pareto", "bodybuilder", "fusion": + return true + } + } + return false +} diff --git a/models/components/searchqualitylevel.go b/models/components/searchqualitylevel.go index 6a823937..26f48323 100644 --- a/models/components/searchqualitylevel.go +++ b/models/components/searchqualitylevel.go @@ -2,7 +2,7 @@ package components -// SearchQualityLevel - How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search. +// SearchQualityLevel - How much context to retrieve per result. Applies to Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, pins a fixed per-result character cap (low=5,000, medium=15,000, high=30,000); when omitted, Exa picks an adaptive size per query and document (typically ~2,000–4,000 characters per result). For Parallel, controls the total characters across all results; when omitted, Parallel uses its own default size. For Perplexity, maps directly to the Search API's native search_context_size parameter. Overridden by `max_characters` when both are set. type SearchQualityLevel string const ( diff --git a/models/components/shellcallitem.go b/models/components/shellcallitem.go new file mode 100644 index 00000000..5f64a9e6 --- /dev/null +++ b/models/components/shellcallitem.go @@ -0,0 +1,157 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type ShellCallItemAction struct { + Commands []string `json:"commands"` + MaxOutputLength optionalnullable.OptionalNullable[int64] `json:"max_output_length,omitzero"` + TimeoutMs optionalnullable.OptionalNullable[int64] `json:"timeout_ms,omitzero"` +} + +func (s ShellCallItemAction) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *ShellCallItemAction) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *ShellCallItemAction) GetCommands() []string { + if s == nil { + return []string{} + } + return s.Commands +} + +func (s *ShellCallItemAction) GetMaxOutputLength() optionalnullable.OptionalNullable[int64] { + if s == nil { + return nil + } + return s.MaxOutputLength +} + +func (s *ShellCallItemAction) GetTimeoutMs() optionalnullable.OptionalNullable[int64] { + if s == nil { + return nil + } + return s.TimeoutMs +} + +type ShellCallItemStatus string + +const ( + ShellCallItemStatusInProgress ShellCallItemStatus = "in_progress" + ShellCallItemStatusCompleted ShellCallItemStatus = "completed" + ShellCallItemStatusIncomplete ShellCallItemStatus = "incomplete" +) + +func (e ShellCallItemStatus) ToPointer() *ShellCallItemStatus { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ShellCallItemStatus) IsExact() bool { + if e != nil { + switch *e { + case "in_progress", "completed", "incomplete": + return true + } + } + return false +} + +type ShellCallItemType string + +const ( + ShellCallItemTypeShellCall ShellCallItemType = "shell_call" +) + +func (e ShellCallItemType) ToPointer() *ShellCallItemType { + return &e +} +func (e *ShellCallItemType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "shell_call": + *e = ShellCallItemType(v) + return nil + default: + return fmt.Errorf("invalid value for ShellCallItemType: %v", v) + } +} + +// ShellCallItem - A shell command execution call (newer variant) +type ShellCallItem struct { + Action ShellCallItemAction `json:"action"` + CallID string `json:"call_id"` + Environment optionalnullable.OptionalNullable[any] `json:"environment,omitzero"` + ID optionalnullable.OptionalNullable[string] `json:"id,omitzero"` + Status optionalnullable.OptionalNullable[ShellCallItemStatus] `json:"status,omitzero"` + Type ShellCallItemType `json:"type"` +} + +func (s ShellCallItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *ShellCallItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *ShellCallItem) GetAction() ShellCallItemAction { + if s == nil { + return ShellCallItemAction{} + } + return s.Action +} + +func (s *ShellCallItem) GetCallID() string { + if s == nil { + return "" + } + return s.CallID +} + +func (s *ShellCallItem) GetEnvironment() optionalnullable.OptionalNullable[any] { + if s == nil { + return nil + } + return s.Environment +} + +func (s *ShellCallItem) GetID() optionalnullable.OptionalNullable[string] { + if s == nil { + return nil + } + return s.ID +} + +func (s *ShellCallItem) GetStatus() optionalnullable.OptionalNullable[ShellCallItemStatus] { + if s == nil { + return nil + } + return s.Status +} + +func (s *ShellCallItem) GetType() ShellCallItemType { + if s == nil { + return ShellCallItemType("") + } + return s.Type +} diff --git a/models/components/shellcalloutputitem.go b/models/components/shellcalloutputitem.go new file mode 100644 index 00000000..6c97c8f1 --- /dev/null +++ b/models/components/shellcalloutputitem.go @@ -0,0 +1,165 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type ShellCallOutputItemOutput struct { + Content optionalnullable.OptionalNullable[string] `json:"content,omitzero"` + ExitCode optionalnullable.OptionalNullable[int64] `json:"exit_code,omitzero"` + Type string `json:"type"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (s ShellCallOutputItemOutput) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *ShellCallOutputItemOutput) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *ShellCallOutputItemOutput) GetContent() optionalnullable.OptionalNullable[string] { + if s == nil { + return nil + } + return s.Content +} + +func (s *ShellCallOutputItemOutput) GetExitCode() optionalnullable.OptionalNullable[int64] { + if s == nil { + return nil + } + return s.ExitCode +} + +func (s *ShellCallOutputItemOutput) GetType() string { + if s == nil { + return "" + } + return s.Type +} + +func (s *ShellCallOutputItemOutput) GetAdditionalProperties() map[string]any { + if s == nil { + return nil + } + return s.AdditionalProperties +} + +type ShellCallOutputItemStatus string + +const ( + ShellCallOutputItemStatusInProgress ShellCallOutputItemStatus = "in_progress" + ShellCallOutputItemStatusCompleted ShellCallOutputItemStatus = "completed" + ShellCallOutputItemStatusIncomplete ShellCallOutputItemStatus = "incomplete" +) + +func (e ShellCallOutputItemStatus) ToPointer() *ShellCallOutputItemStatus { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ShellCallOutputItemStatus) IsExact() bool { + if e != nil { + switch *e { + case "in_progress", "completed", "incomplete": + return true + } + } + return false +} + +type ShellCallOutputItemType string + +const ( + ShellCallOutputItemTypeShellCallOutput ShellCallOutputItemType = "shell_call_output" +) + +func (e ShellCallOutputItemType) ToPointer() *ShellCallOutputItemType { + return &e +} +func (e *ShellCallOutputItemType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "shell_call_output": + *e = ShellCallOutputItemType(v) + return nil + default: + return fmt.Errorf("invalid value for ShellCallOutputItemType: %v", v) + } +} + +// ShellCallOutputItem - Output from a shell command execution (newer variant) +type ShellCallOutputItem struct { + CallID string `json:"call_id"` + ID optionalnullable.OptionalNullable[string] `json:"id,omitzero"` + MaxOutputLength optionalnullable.OptionalNullable[int64] `json:"max_output_length,omitzero"` + Output []ShellCallOutputItemOutput `json:"output"` + Status optionalnullable.OptionalNullable[ShellCallOutputItemStatus] `json:"status,omitzero"` + Type ShellCallOutputItemType `json:"type"` +} + +func (s ShellCallOutputItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *ShellCallOutputItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *ShellCallOutputItem) GetCallID() string { + if s == nil { + return "" + } + return s.CallID +} + +func (s *ShellCallOutputItem) GetID() optionalnullable.OptionalNullable[string] { + if s == nil { + return nil + } + return s.ID +} + +func (s *ShellCallOutputItem) GetMaxOutputLength() optionalnullable.OptionalNullable[int64] { + if s == nil { + return nil + } + return s.MaxOutputLength +} + +func (s *ShellCallOutputItem) GetOutput() []ShellCallOutputItemOutput { + if s == nil { + return []ShellCallOutputItemOutput{} + } + return s.Output +} + +func (s *ShellCallOutputItem) GetStatus() optionalnullable.OptionalNullable[ShellCallOutputItemStatus] { + if s == nil { + return nil + } + return s.Status +} + +func (s *ShellCallOutputItem) GetType() ShellCallOutputItemType { + if s == nil { + return ShellCallOutputItemType("") + } + return s.Type +} diff --git a/models/components/shellcallstatus.go b/models/components/shellcallstatus.go new file mode 100644 index 00000000..99e7ee4c --- /dev/null +++ b/models/components/shellcallstatus.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ShellCallStatus - Status of a shell call or its output. +type ShellCallStatus string + +const ( + ShellCallStatusInProgress ShellCallStatus = "in_progress" + ShellCallStatusCompleted ShellCallStatus = "completed" + ShellCallStatusIncomplete ShellCallStatus = "incomplete" +) + +func (e ShellCallStatus) ToPointer() *ShellCallStatus { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ShellCallStatus) IsExact() bool { + if e != nil { + switch *e { + case "in_progress", "completed", "incomplete": + return true + } + } + return false +} diff --git a/models/components/shellservertoolconfig.go b/models/components/shellservertoolconfig.go new file mode 100644 index 00000000..ca3afac5 --- /dev/null +++ b/models/components/shellservertoolconfig.go @@ -0,0 +1,63 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// ShellServerToolConfig - Configuration for the openrouter:shell server tool +type ShellServerToolConfig struct { + // Which shell engine to use. "openrouter" runs commands server-side in the OpenRouter sandbox. "auto" (default) keeps the provider's native hosted shell when available (OpenAI); on other providers the call is routed to the OpenRouter sandbox. + Engine *ShellServerToolEngine `json:"engine,omitzero"` + // Server-side execution environment for the shell tool. Only container-backed environments are supported; "local" shells are not. + Environment *ShellServerToolEnvironment `json:"environment,omitzero"` + // How long (in seconds) the container stays warm after its last command before sleeping, freeing its capacity slot. Idle-based: each command renews the timer. Defaults to 900 (15 minutes); capped at 2592000 (30 days). + SleepAfterSeconds *int64 `json:"sleep_after_seconds,omitzero"` +} + +func (s ShellServerToolConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *ShellServerToolConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *ShellServerToolConfig) GetEngine() *ShellServerToolEngine { + if s == nil { + return nil + } + return s.Engine +} + +func (s *ShellServerToolConfig) GetEnvironment() *ShellServerToolEnvironment { + if s == nil { + return nil + } + return s.Environment +} + +func (s *ShellServerToolConfig) GetEnvironmentContainerAuto() *ContainerAutoEnvironment { + if v := s.GetEnvironment(); v != nil { + return v.ContainerAutoEnvironment + } + return nil +} + +func (s *ShellServerToolConfig) GetEnvironmentContainerReference() *ContainerReferenceEnvironment { + if v := s.GetEnvironment(); v != nil { + return v.ContainerReferenceEnvironment + } + return nil +} + +func (s *ShellServerToolConfig) GetSleepAfterSeconds() *int64 { + if s == nil { + return nil + } + return s.SleepAfterSeconds +} diff --git a/models/components/shellservertoolengine.go b/models/components/shellservertoolengine.go new file mode 100644 index 00000000..b00e191b --- /dev/null +++ b/models/components/shellservertoolengine.go @@ -0,0 +1,26 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// ShellServerToolEngine - Which shell engine to use. "openrouter" runs commands server-side in the OpenRouter sandbox. "auto" (default) keeps the provider's native hosted shell when available (OpenAI); on other providers the call is routed to the OpenRouter sandbox. +type ShellServerToolEngine string + +const ( + ShellServerToolEngineAuto ShellServerToolEngine = "auto" + ShellServerToolEngineOpenrouter ShellServerToolEngine = "openrouter" +) + +func (e ShellServerToolEngine) ToPointer() *ShellServerToolEngine { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ShellServerToolEngine) IsExact() bool { + if e != nil { + switch *e { + case "auto", "openrouter": + return true + } + } + return false +} diff --git a/models/components/shellservertoolenvironment.go b/models/components/shellservertoolenvironment.go new file mode 100644 index 00000000..6a3715e4 --- /dev/null +++ b/models/components/shellservertoolenvironment.go @@ -0,0 +1,96 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "errors" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ShellServerToolEnvironmentType string + +const ( + ShellServerToolEnvironmentTypeContainerAuto ShellServerToolEnvironmentType = "container_auto" + ShellServerToolEnvironmentTypeContainerReference ShellServerToolEnvironmentType = "container_reference" +) + +// ShellServerToolEnvironment - Server-side execution environment for the shell tool. Only container-backed environments are supported; "local" shells are not. +type ShellServerToolEnvironment struct { + ContainerAutoEnvironment *ContainerAutoEnvironment `queryParam:"inline" union:"member"` + ContainerReferenceEnvironment *ContainerReferenceEnvironment `queryParam:"inline" union:"member"` + + Type ShellServerToolEnvironmentType +} + +func CreateShellServerToolEnvironmentContainerAuto(containerAuto ContainerAutoEnvironment) ShellServerToolEnvironment { + typ := ShellServerToolEnvironmentTypeContainerAuto + + typStr := ContainerAutoEnvironmentType(typ) + containerAuto.Type = typStr + + return ShellServerToolEnvironment{ + ContainerAutoEnvironment: &containerAuto, + Type: typ, + } +} + +func CreateShellServerToolEnvironmentContainerReference(containerReference ContainerReferenceEnvironment) ShellServerToolEnvironment { + typ := ShellServerToolEnvironmentTypeContainerReference + + typStr := ContainerReferenceEnvironmentType(typ) + containerReference.Type = typStr + + return ShellServerToolEnvironment{ + ContainerReferenceEnvironment: &containerReference, + Type: typ, + } +} + +func (u *ShellServerToolEnvironment) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + return fmt.Errorf("could not unmarshal discriminator: %w", err) + } + + switch dis.Type { + case "container_auto": + containerAutoEnvironment := new(ContainerAutoEnvironment) + if err := utils.UnmarshalJSON(data, &containerAutoEnvironment, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == container_auto) type ContainerAutoEnvironment within ShellServerToolEnvironment: %w", string(data), err) + } + + u.ContainerAutoEnvironment = containerAutoEnvironment + u.Type = ShellServerToolEnvironmentTypeContainerAuto + return nil + case "container_reference": + containerReferenceEnvironment := new(ContainerReferenceEnvironment) + if err := utils.UnmarshalJSON(data, &containerReferenceEnvironment, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == container_reference) type ContainerReferenceEnvironment within ShellServerToolEnvironment: %w", string(data), err) + } + + u.ContainerReferenceEnvironment = containerReferenceEnvironment + u.Type = ShellServerToolEnvironmentTypeContainerReference + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for ShellServerToolEnvironment", string(data)) +} + +func (u ShellServerToolEnvironment) MarshalJSON() ([]byte, error) { + if u.ContainerAutoEnvironment != nil { + return utils.MarshalJSON(u.ContainerAutoEnvironment, "", true) + } + + if u.ContainerReferenceEnvironment != nil { + return utils.MarshalJSON(u.ContainerReferenceEnvironment, "", true) + } + + return nil, errors.New("could not marshal union type ShellServerToolEnvironment: all fields are null") +} diff --git a/models/components/shellservertoolopenrouter.go b/models/components/shellservertoolopenrouter.go new file mode 100644 index 00000000..696bbae9 --- /dev/null +++ b/models/components/shellservertoolopenrouter.go @@ -0,0 +1,64 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type ShellServerToolOpenRouterType string + +const ( + ShellServerToolOpenRouterTypeOpenrouterShell ShellServerToolOpenRouterType = "openrouter:shell" +) + +func (e ShellServerToolOpenRouterType) ToPointer() *ShellServerToolOpenRouterType { + return &e +} +func (e *ShellServerToolOpenRouterType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "openrouter:shell": + *e = ShellServerToolOpenRouterType(v) + return nil + default: + return fmt.Errorf("invalid value for ShellServerToolOpenRouterType: %v", v) + } +} + +// ShellServerToolOpenRouter - OpenRouter built-in server tool: runs shell commands server-side in a sandboxed container (a sandbox-backed clone of OpenAI's hosted shell tool) +type ShellServerToolOpenRouter struct { + // Configuration for the openrouter:shell server tool + Parameters *ShellServerToolConfig `json:"parameters,omitzero"` + Type ShellServerToolOpenRouterType `json:"type"` +} + +func (s ShellServerToolOpenRouter) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *ShellServerToolOpenRouter) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *ShellServerToolOpenRouter) GetParameters() *ShellServerToolConfig { + if s == nil { + return nil + } + return s.Parameters +} + +func (s *ShellServerToolOpenRouter) GetType() ShellServerToolOpenRouterType { + if s == nil { + return ShellServerToolOpenRouterType("") + } + return s.Type +} diff --git a/models/components/speechrequest.go b/models/components/speechrequest.go index 059cde13..45925c3e 100644 --- a/models/components/speechrequest.go +++ b/models/components/speechrequest.go @@ -6,881 +6,10 @@ import ( "github.com/OpenRouterTeam/go-sdk/internal/utils" ) -// SpeechRequestOptions - Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. -type SpeechRequestOptions struct { - Oneai map[string]any `json:"01ai,omitzero"` - Ai21 map[string]any `json:"ai21,omitzero"` - AionLabs map[string]any `json:"aion-labs,omitzero"` - Akashml map[string]any `json:"akashml,omitzero"` - Alibaba map[string]any `json:"alibaba,omitzero"` - AmazonBedrock map[string]any `json:"amazon-bedrock,omitzero"` - AmazonNova map[string]any `json:"amazon-nova,omitzero"` - Ambient map[string]any `json:"ambient,omitzero"` - Anthropic map[string]any `json:"anthropic,omitzero"` - Anyscale map[string]any `json:"anyscale,omitzero"` - ArceeAi map[string]any `json:"arcee-ai,omitzero"` - AtlasCloud map[string]any `json:"atlas-cloud,omitzero"` - Atoma map[string]any `json:"atoma,omitzero"` - Avian map[string]any `json:"avian,omitzero"` - Azure map[string]any `json:"azure,omitzero"` - Baidu map[string]any `json:"baidu,omitzero"` - Baseten map[string]any `json:"baseten,omitzero"` - BlackForestLabs map[string]any `json:"black-forest-labs,omitzero"` - Byteplus map[string]any `json:"byteplus,omitzero"` - Centml map[string]any `json:"centml,omitzero"` - Cerebras map[string]any `json:"cerebras,omitzero"` - Chutes map[string]any `json:"chutes,omitzero"` - Cirrascale map[string]any `json:"cirrascale,omitzero"` - Clarifai map[string]any `json:"clarifai,omitzero"` - Cloudflare map[string]any `json:"cloudflare,omitzero"` - Cohere map[string]any `json:"cohere,omitzero"` - Crofai map[string]any `json:"crofai,omitzero"` - Crusoe map[string]any `json:"crusoe,omitzero"` - Deepinfra map[string]any `json:"deepinfra,omitzero"` - Deepseek map[string]any `json:"deepseek,omitzero"` - Dekallm map[string]any `json:"dekallm,omitzero"` - Enfer map[string]any `json:"enfer,omitzero"` - FakeProvider map[string]any `json:"fake-provider,omitzero"` - Featherless map[string]any `json:"featherless,omitzero"` - Fireworks map[string]any `json:"fireworks,omitzero"` - Friendli map[string]any `json:"friendli,omitzero"` - Gmicloud map[string]any `json:"gmicloud,omitzero"` - GoogleAiStudio map[string]any `json:"google-ai-studio,omitzero"` - GoogleVertex map[string]any `json:"google-vertex,omitzero"` - Gopomelo map[string]any `json:"gopomelo,omitzero"` - Groq map[string]any `json:"groq,omitzero"` - Huggingface map[string]any `json:"huggingface,omitzero"` - Hyperbolic map[string]any `json:"hyperbolic,omitzero"` - HyperbolicQuantized map[string]any `json:"hyperbolic-quantized,omitzero"` - Inception map[string]any `json:"inception,omitzero"` - Inceptron map[string]any `json:"inceptron,omitzero"` - InferenceNet map[string]any `json:"inference-net,omitzero"` - Infermatic map[string]any `json:"infermatic,omitzero"` - Inflection map[string]any `json:"inflection,omitzero"` - Inocloud map[string]any `json:"inocloud,omitzero"` - IoNet map[string]any `json:"io-net,omitzero"` - Ionstream map[string]any `json:"ionstream,omitzero"` - Klusterai map[string]any `json:"klusterai,omitzero"` - Lambda map[string]any `json:"lambda,omitzero"` - Lepton map[string]any `json:"lepton,omitzero"` - Liquid map[string]any `json:"liquid,omitzero"` - Lynn map[string]any `json:"lynn,omitzero"` - LynnPrivate map[string]any `json:"lynn-private,omitzero"` - Mancer map[string]any `json:"mancer,omitzero"` - MancerOld map[string]any `json:"mancer-old,omitzero"` - Mara map[string]any `json:"mara,omitzero"` - Meta map[string]any `json:"meta,omitzero"` - Minimax map[string]any `json:"minimax,omitzero"` - Mistral map[string]any `json:"mistral,omitzero"` - Modal map[string]any `json:"modal,omitzero"` - Modelrun map[string]any `json:"modelrun,omitzero"` - Modular map[string]any `json:"modular,omitzero"` - Moonshotai map[string]any `json:"moonshotai,omitzero"` - Morph map[string]any `json:"morph,omitzero"` - Ncompass map[string]any `json:"ncompass,omitzero"` - Nebius map[string]any `json:"nebius,omitzero"` - Nextbit map[string]any `json:"nextbit,omitzero"` - Nineteen map[string]any `json:"nineteen,omitzero"` - Novita map[string]any `json:"novita,omitzero"` - Nvidia map[string]any `json:"nvidia,omitzero"` - Octoai map[string]any `json:"octoai,omitzero"` - OpenInference map[string]any `json:"open-inference,omitzero"` - Openai map[string]any `json:"openai,omitzero"` - Parasail map[string]any `json:"parasail,omitzero"` - Perplexity map[string]any `json:"perplexity,omitzero"` - Phala map[string]any `json:"phala,omitzero"` - Recraft map[string]any `json:"recraft,omitzero"` - Recursal map[string]any `json:"recursal,omitzero"` - Reflection map[string]any `json:"reflection,omitzero"` - Reka map[string]any `json:"reka,omitzero"` - Relace map[string]any `json:"relace,omitzero"` - Replicate map[string]any `json:"replicate,omitzero"` - Sambanova map[string]any `json:"sambanova,omitzero"` - SambanovaCloaked map[string]any `json:"sambanova-cloaked,omitzero"` - Seed map[string]any `json:"seed,omitzero"` - SfCompute map[string]any `json:"sf-compute,omitzero"` - Siliconflow map[string]any `json:"siliconflow,omitzero"` - Sourceful map[string]any `json:"sourceful,omitzero"` - Stealth map[string]any `json:"stealth,omitzero"` - Stepfun map[string]any `json:"stepfun,omitzero"` - Streamlake map[string]any `json:"streamlake,omitzero"` - Switchpoint map[string]any `json:"switchpoint,omitzero"` - Targon map[string]any `json:"targon,omitzero"` - Together map[string]any `json:"together,omitzero"` - TogetherLite map[string]any `json:"together-lite,omitzero"` - Ubicloud map[string]any `json:"ubicloud,omitzero"` - Upstage map[string]any `json:"upstage,omitzero"` - Venice map[string]any `json:"venice,omitzero"` - Wandb map[string]any `json:"wandb,omitzero"` - Xai map[string]any `json:"xai,omitzero"` - Xiaomi map[string]any `json:"xiaomi,omitzero"` - ZAi map[string]any `json:"z-ai,omitzero"` -} - -func (s SpeechRequestOptions) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(s, "", false) -} - -func (s *SpeechRequestOptions) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { - return err - } - return nil -} - -func (s *SpeechRequestOptions) GetOneai() map[string]any { - if s == nil { - return nil - } - return s.Oneai -} - -func (s *SpeechRequestOptions) GetAi21() map[string]any { - if s == nil { - return nil - } - return s.Ai21 -} - -func (s *SpeechRequestOptions) GetAionLabs() map[string]any { - if s == nil { - return nil - } - return s.AionLabs -} - -func (s *SpeechRequestOptions) GetAkashml() map[string]any { - if s == nil { - return nil - } - return s.Akashml -} - -func (s *SpeechRequestOptions) GetAlibaba() map[string]any { - if s == nil { - return nil - } - return s.Alibaba -} - -func (s *SpeechRequestOptions) GetAmazonBedrock() map[string]any { - if s == nil { - return nil - } - return s.AmazonBedrock -} - -func (s *SpeechRequestOptions) GetAmazonNova() map[string]any { - if s == nil { - return nil - } - return s.AmazonNova -} - -func (s *SpeechRequestOptions) GetAmbient() map[string]any { - if s == nil { - return nil - } - return s.Ambient -} - -func (s *SpeechRequestOptions) GetAnthropic() map[string]any { - if s == nil { - return nil - } - return s.Anthropic -} - -func (s *SpeechRequestOptions) GetAnyscale() map[string]any { - if s == nil { - return nil - } - return s.Anyscale -} - -func (s *SpeechRequestOptions) GetArceeAi() map[string]any { - if s == nil { - return nil - } - return s.ArceeAi -} - -func (s *SpeechRequestOptions) GetAtlasCloud() map[string]any { - if s == nil { - return nil - } - return s.AtlasCloud -} - -func (s *SpeechRequestOptions) GetAtoma() map[string]any { - if s == nil { - return nil - } - return s.Atoma -} - -func (s *SpeechRequestOptions) GetAvian() map[string]any { - if s == nil { - return nil - } - return s.Avian -} - -func (s *SpeechRequestOptions) GetAzure() map[string]any { - if s == nil { - return nil - } - return s.Azure -} - -func (s *SpeechRequestOptions) GetBaidu() map[string]any { - if s == nil { - return nil - } - return s.Baidu -} - -func (s *SpeechRequestOptions) GetBaseten() map[string]any { - if s == nil { - return nil - } - return s.Baseten -} - -func (s *SpeechRequestOptions) GetBlackForestLabs() map[string]any { - if s == nil { - return nil - } - return s.BlackForestLabs -} - -func (s *SpeechRequestOptions) GetByteplus() map[string]any { - if s == nil { - return nil - } - return s.Byteplus -} - -func (s *SpeechRequestOptions) GetCentml() map[string]any { - if s == nil { - return nil - } - return s.Centml -} - -func (s *SpeechRequestOptions) GetCerebras() map[string]any { - if s == nil { - return nil - } - return s.Cerebras -} - -func (s *SpeechRequestOptions) GetChutes() map[string]any { - if s == nil { - return nil - } - return s.Chutes -} - -func (s *SpeechRequestOptions) GetCirrascale() map[string]any { - if s == nil { - return nil - } - return s.Cirrascale -} - -func (s *SpeechRequestOptions) GetClarifai() map[string]any { - if s == nil { - return nil - } - return s.Clarifai -} - -func (s *SpeechRequestOptions) GetCloudflare() map[string]any { - if s == nil { - return nil - } - return s.Cloudflare -} - -func (s *SpeechRequestOptions) GetCohere() map[string]any { - if s == nil { - return nil - } - return s.Cohere -} - -func (s *SpeechRequestOptions) GetCrofai() map[string]any { - if s == nil { - return nil - } - return s.Crofai -} - -func (s *SpeechRequestOptions) GetCrusoe() map[string]any { - if s == nil { - return nil - } - return s.Crusoe -} - -func (s *SpeechRequestOptions) GetDeepinfra() map[string]any { - if s == nil { - return nil - } - return s.Deepinfra -} - -func (s *SpeechRequestOptions) GetDeepseek() map[string]any { - if s == nil { - return nil - } - return s.Deepseek -} - -func (s *SpeechRequestOptions) GetDekallm() map[string]any { - if s == nil { - return nil - } - return s.Dekallm -} - -func (s *SpeechRequestOptions) GetEnfer() map[string]any { - if s == nil { - return nil - } - return s.Enfer -} - -func (s *SpeechRequestOptions) GetFakeProvider() map[string]any { - if s == nil { - return nil - } - return s.FakeProvider -} - -func (s *SpeechRequestOptions) GetFeatherless() map[string]any { - if s == nil { - return nil - } - return s.Featherless -} - -func (s *SpeechRequestOptions) GetFireworks() map[string]any { - if s == nil { - return nil - } - return s.Fireworks -} - -func (s *SpeechRequestOptions) GetFriendli() map[string]any { - if s == nil { - return nil - } - return s.Friendli -} - -func (s *SpeechRequestOptions) GetGmicloud() map[string]any { - if s == nil { - return nil - } - return s.Gmicloud -} - -func (s *SpeechRequestOptions) GetGoogleAiStudio() map[string]any { - if s == nil { - return nil - } - return s.GoogleAiStudio -} - -func (s *SpeechRequestOptions) GetGoogleVertex() map[string]any { - if s == nil { - return nil - } - return s.GoogleVertex -} - -func (s *SpeechRequestOptions) GetGopomelo() map[string]any { - if s == nil { - return nil - } - return s.Gopomelo -} - -func (s *SpeechRequestOptions) GetGroq() map[string]any { - if s == nil { - return nil - } - return s.Groq -} - -func (s *SpeechRequestOptions) GetHuggingface() map[string]any { - if s == nil { - return nil - } - return s.Huggingface -} - -func (s *SpeechRequestOptions) GetHyperbolic() map[string]any { - if s == nil { - return nil - } - return s.Hyperbolic -} - -func (s *SpeechRequestOptions) GetHyperbolicQuantized() map[string]any { - if s == nil { - return nil - } - return s.HyperbolicQuantized -} - -func (s *SpeechRequestOptions) GetInception() map[string]any { - if s == nil { - return nil - } - return s.Inception -} - -func (s *SpeechRequestOptions) GetInceptron() map[string]any { - if s == nil { - return nil - } - return s.Inceptron -} - -func (s *SpeechRequestOptions) GetInferenceNet() map[string]any { - if s == nil { - return nil - } - return s.InferenceNet -} - -func (s *SpeechRequestOptions) GetInfermatic() map[string]any { - if s == nil { - return nil - } - return s.Infermatic -} - -func (s *SpeechRequestOptions) GetInflection() map[string]any { - if s == nil { - return nil - } - return s.Inflection -} - -func (s *SpeechRequestOptions) GetInocloud() map[string]any { - if s == nil { - return nil - } - return s.Inocloud -} - -func (s *SpeechRequestOptions) GetIoNet() map[string]any { - if s == nil { - return nil - } - return s.IoNet -} - -func (s *SpeechRequestOptions) GetIonstream() map[string]any { - if s == nil { - return nil - } - return s.Ionstream -} - -func (s *SpeechRequestOptions) GetKlusterai() map[string]any { - if s == nil { - return nil - } - return s.Klusterai -} - -func (s *SpeechRequestOptions) GetLambda() map[string]any { - if s == nil { - return nil - } - return s.Lambda -} - -func (s *SpeechRequestOptions) GetLepton() map[string]any { - if s == nil { - return nil - } - return s.Lepton -} - -func (s *SpeechRequestOptions) GetLiquid() map[string]any { - if s == nil { - return nil - } - return s.Liquid -} - -func (s *SpeechRequestOptions) GetLynn() map[string]any { - if s == nil { - return nil - } - return s.Lynn -} - -func (s *SpeechRequestOptions) GetLynnPrivate() map[string]any { - if s == nil { - return nil - } - return s.LynnPrivate -} - -func (s *SpeechRequestOptions) GetMancer() map[string]any { - if s == nil { - return nil - } - return s.Mancer -} - -func (s *SpeechRequestOptions) GetMancerOld() map[string]any { - if s == nil { - return nil - } - return s.MancerOld -} - -func (s *SpeechRequestOptions) GetMara() map[string]any { - if s == nil { - return nil - } - return s.Mara -} - -func (s *SpeechRequestOptions) GetMeta() map[string]any { - if s == nil { - return nil - } - return s.Meta -} - -func (s *SpeechRequestOptions) GetMinimax() map[string]any { - if s == nil { - return nil - } - return s.Minimax -} - -func (s *SpeechRequestOptions) GetMistral() map[string]any { - if s == nil { - return nil - } - return s.Mistral -} - -func (s *SpeechRequestOptions) GetModal() map[string]any { - if s == nil { - return nil - } - return s.Modal -} - -func (s *SpeechRequestOptions) GetModelrun() map[string]any { - if s == nil { - return nil - } - return s.Modelrun -} - -func (s *SpeechRequestOptions) GetModular() map[string]any { - if s == nil { - return nil - } - return s.Modular -} - -func (s *SpeechRequestOptions) GetMoonshotai() map[string]any { - if s == nil { - return nil - } - return s.Moonshotai -} - -func (s *SpeechRequestOptions) GetMorph() map[string]any { - if s == nil { - return nil - } - return s.Morph -} - -func (s *SpeechRequestOptions) GetNcompass() map[string]any { - if s == nil { - return nil - } - return s.Ncompass -} - -func (s *SpeechRequestOptions) GetNebius() map[string]any { - if s == nil { - return nil - } - return s.Nebius -} - -func (s *SpeechRequestOptions) GetNextbit() map[string]any { - if s == nil { - return nil - } - return s.Nextbit -} - -func (s *SpeechRequestOptions) GetNineteen() map[string]any { - if s == nil { - return nil - } - return s.Nineteen -} - -func (s *SpeechRequestOptions) GetNovita() map[string]any { - if s == nil { - return nil - } - return s.Novita -} - -func (s *SpeechRequestOptions) GetNvidia() map[string]any { - if s == nil { - return nil - } - return s.Nvidia -} - -func (s *SpeechRequestOptions) GetOctoai() map[string]any { - if s == nil { - return nil - } - return s.Octoai -} - -func (s *SpeechRequestOptions) GetOpenInference() map[string]any { - if s == nil { - return nil - } - return s.OpenInference -} - -func (s *SpeechRequestOptions) GetOpenai() map[string]any { - if s == nil { - return nil - } - return s.Openai -} - -func (s *SpeechRequestOptions) GetParasail() map[string]any { - if s == nil { - return nil - } - return s.Parasail -} - -func (s *SpeechRequestOptions) GetPerplexity() map[string]any { - if s == nil { - return nil - } - return s.Perplexity -} - -func (s *SpeechRequestOptions) GetPhala() map[string]any { - if s == nil { - return nil - } - return s.Phala -} - -func (s *SpeechRequestOptions) GetRecraft() map[string]any { - if s == nil { - return nil - } - return s.Recraft -} - -func (s *SpeechRequestOptions) GetRecursal() map[string]any { - if s == nil { - return nil - } - return s.Recursal -} - -func (s *SpeechRequestOptions) GetReflection() map[string]any { - if s == nil { - return nil - } - return s.Reflection -} - -func (s *SpeechRequestOptions) GetReka() map[string]any { - if s == nil { - return nil - } - return s.Reka -} - -func (s *SpeechRequestOptions) GetRelace() map[string]any { - if s == nil { - return nil - } - return s.Relace -} - -func (s *SpeechRequestOptions) GetReplicate() map[string]any { - if s == nil { - return nil - } - return s.Replicate -} - -func (s *SpeechRequestOptions) GetSambanova() map[string]any { - if s == nil { - return nil - } - return s.Sambanova -} - -func (s *SpeechRequestOptions) GetSambanovaCloaked() map[string]any { - if s == nil { - return nil - } - return s.SambanovaCloaked -} - -func (s *SpeechRequestOptions) GetSeed() map[string]any { - if s == nil { - return nil - } - return s.Seed -} - -func (s *SpeechRequestOptions) GetSfCompute() map[string]any { - if s == nil { - return nil - } - return s.SfCompute -} - -func (s *SpeechRequestOptions) GetSiliconflow() map[string]any { - if s == nil { - return nil - } - return s.Siliconflow -} - -func (s *SpeechRequestOptions) GetSourceful() map[string]any { - if s == nil { - return nil - } - return s.Sourceful -} - -func (s *SpeechRequestOptions) GetStealth() map[string]any { - if s == nil { - return nil - } - return s.Stealth -} - -func (s *SpeechRequestOptions) GetStepfun() map[string]any { - if s == nil { - return nil - } - return s.Stepfun -} - -func (s *SpeechRequestOptions) GetStreamlake() map[string]any { - if s == nil { - return nil - } - return s.Streamlake -} - -func (s *SpeechRequestOptions) GetSwitchpoint() map[string]any { - if s == nil { - return nil - } - return s.Switchpoint -} - -func (s *SpeechRequestOptions) GetTargon() map[string]any { - if s == nil { - return nil - } - return s.Targon -} - -func (s *SpeechRequestOptions) GetTogether() map[string]any { - if s == nil { - return nil - } - return s.Together -} - -func (s *SpeechRequestOptions) GetTogetherLite() map[string]any { - if s == nil { - return nil - } - return s.TogetherLite -} - -func (s *SpeechRequestOptions) GetUbicloud() map[string]any { - if s == nil { - return nil - } - return s.Ubicloud -} - -func (s *SpeechRequestOptions) GetUpstage() map[string]any { - if s == nil { - return nil - } - return s.Upstage -} - -func (s *SpeechRequestOptions) GetVenice() map[string]any { - if s == nil { - return nil - } - return s.Venice -} - -func (s *SpeechRequestOptions) GetWandb() map[string]any { - if s == nil { - return nil - } - return s.Wandb -} - -func (s *SpeechRequestOptions) GetXai() map[string]any { - if s == nil { - return nil - } - return s.Xai -} - -func (s *SpeechRequestOptions) GetXiaomi() map[string]any { - if s == nil { - return nil - } - return s.Xiaomi -} - -func (s *SpeechRequestOptions) GetZAi() map[string]any { - if s == nil { - return nil - } - return s.ZAi -} - // SpeechRequestProvider - Provider-specific passthrough configuration type SpeechRequestProvider struct { // Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. - Options *SpeechRequestOptions `json:"options,omitzero"` + Options *ProviderOptions `json:"options,omitzero"` } func (s SpeechRequestProvider) MarshalJSON() ([]byte, error) { @@ -894,7 +23,7 @@ func (s *SpeechRequestProvider) UnmarshalJSON(data []byte) error { return nil } -func (s *SpeechRequestProvider) GetOptions() *SpeechRequestOptions { +func (s *SpeechRequestProvider) GetOptions() *ProviderOptions { if s == nil { return nil } diff --git a/models/components/stopservertoolswhencondition.go b/models/components/stopservertoolswhencondition.go new file mode 100644 index 00000000..612a6e5e --- /dev/null +++ b/models/components/stopservertoolswhencondition.go @@ -0,0 +1,177 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "errors" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type StopServerToolsWhenConditionType string + +const ( + StopServerToolsWhenConditionTypeFinishReasonIs StopServerToolsWhenConditionType = "finish_reason_is" + StopServerToolsWhenConditionTypeHasToolCall StopServerToolsWhenConditionType = "has_tool_call" + StopServerToolsWhenConditionTypeMaxCost StopServerToolsWhenConditionType = "max_cost" + StopServerToolsWhenConditionTypeMaxTokensUsed StopServerToolsWhenConditionType = "max_tokens_used" + StopServerToolsWhenConditionTypeStepCountIs StopServerToolsWhenConditionType = "step_count_is" +) + +// StopServerToolsWhenCondition - A single condition that, when met, halts the server-tool agent loop. +type StopServerToolsWhenCondition struct { + StopServerToolsWhenStepCountIs *StopServerToolsWhenStepCountIs `queryParam:"inline" union:"member"` + StopServerToolsWhenHasToolCall *StopServerToolsWhenHasToolCall `queryParam:"inline" union:"member"` + StopServerToolsWhenMaxTokensUsed *StopServerToolsWhenMaxTokensUsed `queryParam:"inline" union:"member"` + StopServerToolsWhenMaxCost *StopServerToolsWhenMaxCost `queryParam:"inline" union:"member"` + StopServerToolsWhenFinishReasonIs *StopServerToolsWhenFinishReasonIs `queryParam:"inline" union:"member"` + + Type StopServerToolsWhenConditionType +} + +func CreateStopServerToolsWhenConditionFinishReasonIs(finishReasonIs StopServerToolsWhenFinishReasonIs) StopServerToolsWhenCondition { + typ := StopServerToolsWhenConditionTypeFinishReasonIs + + typStr := StopServerToolsWhenFinishReasonIsType(typ) + finishReasonIs.Type = typStr + + return StopServerToolsWhenCondition{ + StopServerToolsWhenFinishReasonIs: &finishReasonIs, + Type: typ, + } +} + +func CreateStopServerToolsWhenConditionHasToolCall(hasToolCall StopServerToolsWhenHasToolCall) StopServerToolsWhenCondition { + typ := StopServerToolsWhenConditionTypeHasToolCall + + typStr := StopServerToolsWhenHasToolCallType(typ) + hasToolCall.Type = typStr + + return StopServerToolsWhenCondition{ + StopServerToolsWhenHasToolCall: &hasToolCall, + Type: typ, + } +} + +func CreateStopServerToolsWhenConditionMaxCost(maxCost StopServerToolsWhenMaxCost) StopServerToolsWhenCondition { + typ := StopServerToolsWhenConditionTypeMaxCost + + typStr := StopServerToolsWhenMaxCostType(typ) + maxCost.Type = typStr + + return StopServerToolsWhenCondition{ + StopServerToolsWhenMaxCost: &maxCost, + Type: typ, + } +} + +func CreateStopServerToolsWhenConditionMaxTokensUsed(maxTokensUsed StopServerToolsWhenMaxTokensUsed) StopServerToolsWhenCondition { + typ := StopServerToolsWhenConditionTypeMaxTokensUsed + + typStr := StopServerToolsWhenMaxTokensUsedType(typ) + maxTokensUsed.Type = typStr + + return StopServerToolsWhenCondition{ + StopServerToolsWhenMaxTokensUsed: &maxTokensUsed, + Type: typ, + } +} + +func CreateStopServerToolsWhenConditionStepCountIs(stepCountIs StopServerToolsWhenStepCountIs) StopServerToolsWhenCondition { + typ := StopServerToolsWhenConditionTypeStepCountIs + + typStr := StopServerToolsWhenStepCountIsType(typ) + stepCountIs.Type = typStr + + return StopServerToolsWhenCondition{ + StopServerToolsWhenStepCountIs: &stepCountIs, + Type: typ, + } +} + +func (u *StopServerToolsWhenCondition) UnmarshalJSON(data []byte) error { + + type discriminator struct { + Type string `json:"type"` + } + + dis := new(discriminator) + if err := json.Unmarshal(data, &dis); err != nil { + return fmt.Errorf("could not unmarshal discriminator: %w", err) + } + + switch dis.Type { + case "finish_reason_is": + stopServerToolsWhenFinishReasonIs := new(StopServerToolsWhenFinishReasonIs) + if err := utils.UnmarshalJSON(data, &stopServerToolsWhenFinishReasonIs, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == finish_reason_is) type StopServerToolsWhenFinishReasonIs within StopServerToolsWhenCondition: %w", string(data), err) + } + + u.StopServerToolsWhenFinishReasonIs = stopServerToolsWhenFinishReasonIs + u.Type = StopServerToolsWhenConditionTypeFinishReasonIs + return nil + case "has_tool_call": + stopServerToolsWhenHasToolCall := new(StopServerToolsWhenHasToolCall) + if err := utils.UnmarshalJSON(data, &stopServerToolsWhenHasToolCall, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == has_tool_call) type StopServerToolsWhenHasToolCall within StopServerToolsWhenCondition: %w", string(data), err) + } + + u.StopServerToolsWhenHasToolCall = stopServerToolsWhenHasToolCall + u.Type = StopServerToolsWhenConditionTypeHasToolCall + return nil + case "max_cost": + stopServerToolsWhenMaxCost := new(StopServerToolsWhenMaxCost) + if err := utils.UnmarshalJSON(data, &stopServerToolsWhenMaxCost, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == max_cost) type StopServerToolsWhenMaxCost within StopServerToolsWhenCondition: %w", string(data), err) + } + + u.StopServerToolsWhenMaxCost = stopServerToolsWhenMaxCost + u.Type = StopServerToolsWhenConditionTypeMaxCost + return nil + case "max_tokens_used": + stopServerToolsWhenMaxTokensUsed := new(StopServerToolsWhenMaxTokensUsed) + if err := utils.UnmarshalJSON(data, &stopServerToolsWhenMaxTokensUsed, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == max_tokens_used) type StopServerToolsWhenMaxTokensUsed within StopServerToolsWhenCondition: %w", string(data), err) + } + + u.StopServerToolsWhenMaxTokensUsed = stopServerToolsWhenMaxTokensUsed + u.Type = StopServerToolsWhenConditionTypeMaxTokensUsed + return nil + case "step_count_is": + stopServerToolsWhenStepCountIs := new(StopServerToolsWhenStepCountIs) + if err := utils.UnmarshalJSON(data, &stopServerToolsWhenStepCountIs, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == step_count_is) type StopServerToolsWhenStepCountIs within StopServerToolsWhenCondition: %w", string(data), err) + } + + u.StopServerToolsWhenStepCountIs = stopServerToolsWhenStepCountIs + u.Type = StopServerToolsWhenConditionTypeStepCountIs + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for StopServerToolsWhenCondition", string(data)) +} + +func (u StopServerToolsWhenCondition) MarshalJSON() ([]byte, error) { + if u.StopServerToolsWhenStepCountIs != nil { + return utils.MarshalJSON(u.StopServerToolsWhenStepCountIs, "", true) + } + + if u.StopServerToolsWhenHasToolCall != nil { + return utils.MarshalJSON(u.StopServerToolsWhenHasToolCall, "", true) + } + + if u.StopServerToolsWhenMaxTokensUsed != nil { + return utils.MarshalJSON(u.StopServerToolsWhenMaxTokensUsed, "", true) + } + + if u.StopServerToolsWhenMaxCost != nil { + return utils.MarshalJSON(u.StopServerToolsWhenMaxCost, "", true) + } + + if u.StopServerToolsWhenFinishReasonIs != nil { + return utils.MarshalJSON(u.StopServerToolsWhenFinishReasonIs, "", true) + } + + return nil, errors.New("could not marshal union type StopServerToolsWhenCondition: all fields are null") +} diff --git a/models/components/stopservertoolswhenfinishreasonis.go b/models/components/stopservertoolswhenfinishreasonis.go new file mode 100644 index 00000000..a6d7fd06 --- /dev/null +++ b/models/components/stopservertoolswhenfinishreasonis.go @@ -0,0 +1,63 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type StopServerToolsWhenFinishReasonIsType string + +const ( + StopServerToolsWhenFinishReasonIsTypeFinishReasonIs StopServerToolsWhenFinishReasonIsType = "finish_reason_is" +) + +func (e StopServerToolsWhenFinishReasonIsType) ToPointer() *StopServerToolsWhenFinishReasonIsType { + return &e +} +func (e *StopServerToolsWhenFinishReasonIsType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "finish_reason_is": + *e = StopServerToolsWhenFinishReasonIsType(v) + return nil + default: + return fmt.Errorf("invalid value for StopServerToolsWhenFinishReasonIsType: %v", v) + } +} + +// StopServerToolsWhenFinishReasonIs - Stop when the upstream model emits this finish reason (e.g. `length`). +type StopServerToolsWhenFinishReasonIs struct { + Reason string `json:"reason"` + Type StopServerToolsWhenFinishReasonIsType `json:"type"` +} + +func (s StopServerToolsWhenFinishReasonIs) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StopServerToolsWhenFinishReasonIs) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *StopServerToolsWhenFinishReasonIs) GetReason() string { + if s == nil { + return "" + } + return s.Reason +} + +func (s *StopServerToolsWhenFinishReasonIs) GetType() StopServerToolsWhenFinishReasonIsType { + if s == nil { + return StopServerToolsWhenFinishReasonIsType("") + } + return s.Type +} diff --git a/models/components/stopservertoolswhenhastoolcall.go b/models/components/stopservertoolswhenhastoolcall.go new file mode 100644 index 00000000..c2521ffa --- /dev/null +++ b/models/components/stopservertoolswhenhastoolcall.go @@ -0,0 +1,63 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type StopServerToolsWhenHasToolCallType string + +const ( + StopServerToolsWhenHasToolCallTypeHasToolCall StopServerToolsWhenHasToolCallType = "has_tool_call" +) + +func (e StopServerToolsWhenHasToolCallType) ToPointer() *StopServerToolsWhenHasToolCallType { + return &e +} +func (e *StopServerToolsWhenHasToolCallType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "has_tool_call": + *e = StopServerToolsWhenHasToolCallType(v) + return nil + default: + return fmt.Errorf("invalid value for StopServerToolsWhenHasToolCallType: %v", v) + } +} + +// StopServerToolsWhenHasToolCall - Stop after a tool with this name has been called. +type StopServerToolsWhenHasToolCall struct { + ToolName string `json:"tool_name"` + Type StopServerToolsWhenHasToolCallType `json:"type"` +} + +func (s StopServerToolsWhenHasToolCall) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StopServerToolsWhenHasToolCall) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *StopServerToolsWhenHasToolCall) GetToolName() string { + if s == nil { + return "" + } + return s.ToolName +} + +func (s *StopServerToolsWhenHasToolCall) GetType() StopServerToolsWhenHasToolCallType { + if s == nil { + return StopServerToolsWhenHasToolCallType("") + } + return s.Type +} diff --git a/models/components/stopservertoolswhenmaxcost.go b/models/components/stopservertoolswhenmaxcost.go new file mode 100644 index 00000000..42550572 --- /dev/null +++ b/models/components/stopservertoolswhenmaxcost.go @@ -0,0 +1,63 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type StopServerToolsWhenMaxCostType string + +const ( + StopServerToolsWhenMaxCostTypeMaxCost StopServerToolsWhenMaxCostType = "max_cost" +) + +func (e StopServerToolsWhenMaxCostType) ToPointer() *StopServerToolsWhenMaxCostType { + return &e +} +func (e *StopServerToolsWhenMaxCostType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "max_cost": + *e = StopServerToolsWhenMaxCostType(v) + return nil + default: + return fmt.Errorf("invalid value for StopServerToolsWhenMaxCostType: %v", v) + } +} + +// StopServerToolsWhenMaxCost - Stop once cumulative cost across the loop exceeds this dollar threshold. +type StopServerToolsWhenMaxCost struct { + MaxCostInDollars float64 `json:"max_cost_in_dollars"` + Type StopServerToolsWhenMaxCostType `json:"type"` +} + +func (s StopServerToolsWhenMaxCost) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StopServerToolsWhenMaxCost) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *StopServerToolsWhenMaxCost) GetMaxCostInDollars() float64 { + if s == nil { + return 0.0 + } + return s.MaxCostInDollars +} + +func (s *StopServerToolsWhenMaxCost) GetType() StopServerToolsWhenMaxCostType { + if s == nil { + return StopServerToolsWhenMaxCostType("") + } + return s.Type +} diff --git a/models/components/stopservertoolswhenmaxtokensused.go b/models/components/stopservertoolswhenmaxtokensused.go new file mode 100644 index 00000000..ff512d8c --- /dev/null +++ b/models/components/stopservertoolswhenmaxtokensused.go @@ -0,0 +1,63 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type StopServerToolsWhenMaxTokensUsedType string + +const ( + StopServerToolsWhenMaxTokensUsedTypeMaxTokensUsed StopServerToolsWhenMaxTokensUsedType = "max_tokens_used" +) + +func (e StopServerToolsWhenMaxTokensUsedType) ToPointer() *StopServerToolsWhenMaxTokensUsedType { + return &e +} +func (e *StopServerToolsWhenMaxTokensUsedType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "max_tokens_used": + *e = StopServerToolsWhenMaxTokensUsedType(v) + return nil + default: + return fmt.Errorf("invalid value for StopServerToolsWhenMaxTokensUsedType: %v", v) + } +} + +// StopServerToolsWhenMaxTokensUsed - Stop once cumulative token usage across the loop exceeds this threshold. +type StopServerToolsWhenMaxTokensUsed struct { + MaxTokens int64 `json:"max_tokens"` + Type StopServerToolsWhenMaxTokensUsedType `json:"type"` +} + +func (s StopServerToolsWhenMaxTokensUsed) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StopServerToolsWhenMaxTokensUsed) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *StopServerToolsWhenMaxTokensUsed) GetMaxTokens() int64 { + if s == nil { + return 0 + } + return s.MaxTokens +} + +func (s *StopServerToolsWhenMaxTokensUsed) GetType() StopServerToolsWhenMaxTokensUsedType { + if s == nil { + return StopServerToolsWhenMaxTokensUsedType("") + } + return s.Type +} diff --git a/models/components/stopservertoolswhenstepcountis.go b/models/components/stopservertoolswhenstepcountis.go new file mode 100644 index 00000000..522d4b3d --- /dev/null +++ b/models/components/stopservertoolswhenstepcountis.go @@ -0,0 +1,63 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type StopServerToolsWhenStepCountIsType string + +const ( + StopServerToolsWhenStepCountIsTypeStepCountIs StopServerToolsWhenStepCountIsType = "step_count_is" +) + +func (e StopServerToolsWhenStepCountIsType) ToPointer() *StopServerToolsWhenStepCountIsType { + return &e +} +func (e *StopServerToolsWhenStepCountIsType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "step_count_is": + *e = StopServerToolsWhenStepCountIsType(v) + return nil + default: + return fmt.Errorf("invalid value for StopServerToolsWhenStepCountIsType: %v", v) + } +} + +// StopServerToolsWhenStepCountIs - Stop after the agent loop has executed this many steps. +type StopServerToolsWhenStepCountIs struct { + StepCount int64 `json:"step_count"` + Type StopServerToolsWhenStepCountIsType `json:"type"` +} + +func (s StopServerToolsWhenStepCountIs) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *StopServerToolsWhenStepCountIs) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *StopServerToolsWhenStepCountIs) GetStepCount() int64 { + if s == nil { + return 0 + } + return s.StepCount +} + +func (s *StopServerToolsWhenStepCountIs) GetType() StopServerToolsWhenStepCountIsType { + if s == nil { + return StopServerToolsWhenStepCountIsType("") + } + return s.Type +} diff --git a/models/components/streamevents.go b/models/components/streamevents.go index c6da724d..4bf54407 100644 --- a/models/components/streamevents.go +++ b/models/components/streamevents.go @@ -12,72 +12,98 @@ import ( type StreamEventsType string const ( - StreamEventsTypeError StreamEventsType = "error" - StreamEventsTypeResponseCompleted StreamEventsType = "response.completed" - StreamEventsTypeResponseContentPartAdded StreamEventsType = "response.content_part.added" - StreamEventsTypeResponseContentPartDone StreamEventsType = "response.content_part.done" - StreamEventsTypeResponseCreated StreamEventsType = "response.created" - StreamEventsTypeResponseFailed StreamEventsType = "response.failed" - StreamEventsTypeResponseFunctionCallArgumentsDelta StreamEventsType = "response.function_call_arguments.delta" - StreamEventsTypeResponseFunctionCallArgumentsDone StreamEventsType = "response.function_call_arguments.done" - StreamEventsTypeResponseImageGenerationCallCompleted StreamEventsType = "response.image_generation_call.completed" - StreamEventsTypeResponseImageGenerationCallGenerating StreamEventsType = "response.image_generation_call.generating" - StreamEventsTypeResponseImageGenerationCallInProgress StreamEventsType = "response.image_generation_call.in_progress" - StreamEventsTypeResponseImageGenerationCallPartialImage StreamEventsType = "response.image_generation_call.partial_image" - StreamEventsTypeResponseInProgress StreamEventsType = "response.in_progress" - StreamEventsTypeResponseIncomplete StreamEventsType = "response.incomplete" - StreamEventsTypeResponseOutputItemAdded StreamEventsType = "response.output_item.added" - StreamEventsTypeResponseOutputItemDone StreamEventsType = "response.output_item.done" - StreamEventsTypeResponseOutputTextAnnotationAdded StreamEventsType = "response.output_text.annotation.added" - StreamEventsTypeResponseOutputTextDelta StreamEventsType = "response.output_text.delta" - StreamEventsTypeResponseOutputTextDone StreamEventsType = "response.output_text.done" - StreamEventsTypeResponseReasoningSummaryPartAdded StreamEventsType = "response.reasoning_summary_part.added" - StreamEventsTypeResponseReasoningSummaryPartDone StreamEventsType = "response.reasoning_summary_part.done" - StreamEventsTypeResponseReasoningSummaryTextDelta StreamEventsType = "response.reasoning_summary_text.delta" - StreamEventsTypeResponseReasoningSummaryTextDone StreamEventsType = "response.reasoning_summary_text.done" - StreamEventsTypeResponseReasoningTextDelta StreamEventsType = "response.reasoning_text.delta" - StreamEventsTypeResponseReasoningTextDone StreamEventsType = "response.reasoning_text.done" - StreamEventsTypeResponseRefusalDelta StreamEventsType = "response.refusal.delta" - StreamEventsTypeResponseRefusalDone StreamEventsType = "response.refusal.done" - StreamEventsTypeResponseWebSearchCallCompleted StreamEventsType = "response.web_search_call.completed" - StreamEventsTypeResponseWebSearchCallInProgress StreamEventsType = "response.web_search_call.in_progress" - StreamEventsTypeResponseWebSearchCallSearching StreamEventsType = "response.web_search_call.searching" - StreamEventsTypeUnknown StreamEventsType = "UNKNOWN" + StreamEventsTypeError StreamEventsType = "error" + StreamEventsTypeResponseApplyPatchCallOperationDiffDelta StreamEventsType = "response.apply_patch_call_operation_diff.delta" + StreamEventsTypeResponseApplyPatchCallOperationDiffDone StreamEventsType = "response.apply_patch_call_operation_diff.done" + StreamEventsTypeResponseCompleted StreamEventsType = "response.completed" + StreamEventsTypeResponseContentPartAdded StreamEventsType = "response.content_part.added" + StreamEventsTypeResponseContentPartDone StreamEventsType = "response.content_part.done" + StreamEventsTypeResponseCreated StreamEventsType = "response.created" + StreamEventsTypeResponseCustomToolCallInputDelta StreamEventsType = "response.custom_tool_call_input.delta" + StreamEventsTypeResponseCustomToolCallInputDone StreamEventsType = "response.custom_tool_call_input.done" + StreamEventsTypeResponseFailed StreamEventsType = "response.failed" + StreamEventsTypeResponseFunctionCallArgumentsDelta StreamEventsType = "response.function_call_arguments.delta" + StreamEventsTypeResponseFunctionCallArgumentsDone StreamEventsType = "response.function_call_arguments.done" + StreamEventsTypeResponseFusionCallAnalysisCompleted StreamEventsType = "response.fusion_call.analysis.completed" + StreamEventsTypeResponseFusionCallAnalysisInProgress StreamEventsType = "response.fusion_call.analysis.in_progress" + StreamEventsTypeResponseFusionCallCompleted StreamEventsType = "response.fusion_call.completed" + StreamEventsTypeResponseFusionCallInProgress StreamEventsType = "response.fusion_call.in_progress" + StreamEventsTypeResponseFusionCallPanelAdded StreamEventsType = "response.fusion_call.panel.added" + StreamEventsTypeResponseFusionCallPanelCompleted StreamEventsType = "response.fusion_call.panel.completed" + StreamEventsTypeResponseFusionCallPanelDelta StreamEventsType = "response.fusion_call.panel.delta" + StreamEventsTypeResponseFusionCallPanelFailed StreamEventsType = "response.fusion_call.panel.failed" + StreamEventsTypeResponseFusionCallPanelReasoningDelta StreamEventsType = "response.fusion_call.panel.reasoning.delta" + StreamEventsTypeResponseImageGenerationCallCompleted StreamEventsType = "response.image_generation_call.completed" + StreamEventsTypeResponseImageGenerationCallGenerating StreamEventsType = "response.image_generation_call.generating" + StreamEventsTypeResponseImageGenerationCallInProgress StreamEventsType = "response.image_generation_call.in_progress" + StreamEventsTypeResponseImageGenerationCallPartialImage StreamEventsType = "response.image_generation_call.partial_image" + StreamEventsTypeResponseInProgress StreamEventsType = "response.in_progress" + StreamEventsTypeResponseIncomplete StreamEventsType = "response.incomplete" + StreamEventsTypeResponseOutputItemAdded StreamEventsType = "response.output_item.added" + StreamEventsTypeResponseOutputItemDone StreamEventsType = "response.output_item.done" + StreamEventsTypeResponseOutputTextAnnotationAdded StreamEventsType = "response.output_text.annotation.added" + StreamEventsTypeResponseOutputTextDelta StreamEventsType = "response.output_text.delta" + StreamEventsTypeResponseOutputTextDone StreamEventsType = "response.output_text.done" + StreamEventsTypeResponseReasoningSummaryPartAdded StreamEventsType = "response.reasoning_summary_part.added" + StreamEventsTypeResponseReasoningSummaryPartDone StreamEventsType = "response.reasoning_summary_part.done" + StreamEventsTypeResponseReasoningSummaryTextDelta StreamEventsType = "response.reasoning_summary_text.delta" + StreamEventsTypeResponseReasoningSummaryTextDone StreamEventsType = "response.reasoning_summary_text.done" + StreamEventsTypeResponseReasoningTextDelta StreamEventsType = "response.reasoning_text.delta" + StreamEventsTypeResponseReasoningTextDone StreamEventsType = "response.reasoning_text.done" + StreamEventsTypeResponseRefusalDelta StreamEventsType = "response.refusal.delta" + StreamEventsTypeResponseRefusalDone StreamEventsType = "response.refusal.done" + StreamEventsTypeResponseWebSearchCallCompleted StreamEventsType = "response.web_search_call.completed" + StreamEventsTypeResponseWebSearchCallInProgress StreamEventsType = "response.web_search_call.in_progress" + StreamEventsTypeResponseWebSearchCallSearching StreamEventsType = "response.web_search_call.searching" + StreamEventsTypeUnknown StreamEventsType = "UNKNOWN" ) // StreamEvents - Union of all possible event types emitted during response streaming type StreamEvents struct { - OpenResponsesCreatedEvent *OpenResponsesCreatedEvent `queryParam:"inline" union:"member"` - OpenResponsesInProgressEvent *OpenResponsesInProgressEvent `queryParam:"inline" union:"member"` - StreamEventsResponseCompleted *StreamEventsResponseCompleted `queryParam:"inline" union:"member"` - StreamEventsResponseIncomplete *StreamEventsResponseIncomplete `queryParam:"inline" union:"member"` - StreamEventsResponseFailed *StreamEventsResponseFailed `queryParam:"inline" union:"member"` - ErrorEvent *ErrorEvent `queryParam:"inline" union:"member"` - StreamEventsResponseOutputItemAdded *StreamEventsResponseOutputItemAdded `queryParam:"inline" union:"member"` - StreamEventsResponseOutputItemDone *StreamEventsResponseOutputItemDone `queryParam:"inline" union:"member"` - ContentPartAddedEvent *ContentPartAddedEvent `queryParam:"inline" union:"member"` - ContentPartDoneEvent *ContentPartDoneEvent `queryParam:"inline" union:"member"` - TextDeltaEvent *TextDeltaEvent `queryParam:"inline" union:"member"` - TextDoneEvent *TextDoneEvent `queryParam:"inline" union:"member"` - RefusalDeltaEvent *RefusalDeltaEvent `queryParam:"inline" union:"member"` - RefusalDoneEvent *RefusalDoneEvent `queryParam:"inline" union:"member"` - AnnotationAddedEvent *AnnotationAddedEvent `queryParam:"inline" union:"member"` - FunctionCallArgsDeltaEvent *FunctionCallArgsDeltaEvent `queryParam:"inline" union:"member"` - FunctionCallArgsDoneEvent *FunctionCallArgsDoneEvent `queryParam:"inline" union:"member"` - ReasoningDeltaEvent *ReasoningDeltaEvent `queryParam:"inline" union:"member"` - ReasoningDoneEvent *ReasoningDoneEvent `queryParam:"inline" union:"member"` - ReasoningSummaryPartAddedEvent *ReasoningSummaryPartAddedEvent `queryParam:"inline" union:"member"` - ReasoningSummaryPartDoneEvent *ReasoningSummaryPartDoneEvent `queryParam:"inline" union:"member"` - ReasoningSummaryTextDeltaEvent *ReasoningSummaryTextDeltaEvent `queryParam:"inline" union:"member"` - ReasoningSummaryTextDoneEvent *ReasoningSummaryTextDoneEvent `queryParam:"inline" union:"member"` - ImageGenCallInProgressEvent *ImageGenCallInProgressEvent `queryParam:"inline" union:"member"` - ImageGenCallGeneratingEvent *ImageGenCallGeneratingEvent `queryParam:"inline" union:"member"` - ImageGenCallPartialImageEvent *ImageGenCallPartialImageEvent `queryParam:"inline" union:"member"` - ImageGenCallCompletedEvent *ImageGenCallCompletedEvent `queryParam:"inline" union:"member"` - WebSearchCallInProgressEvent *WebSearchCallInProgressEvent `queryParam:"inline" union:"member"` - WebSearchCallSearchingEvent *WebSearchCallSearchingEvent `queryParam:"inline" union:"member"` - WebSearchCallCompletedEvent *WebSearchCallCompletedEvent `queryParam:"inline" union:"member"` - UnknownRaw json.RawMessage `json:"-" union:"unknown"` + OpenResponsesCreatedEvent *OpenResponsesCreatedEvent `queryParam:"inline" union:"member"` + OpenResponsesInProgressEvent *OpenResponsesInProgressEvent `queryParam:"inline" union:"member"` + StreamEventsResponseCompleted *StreamEventsResponseCompleted `queryParam:"inline" union:"member"` + StreamEventsResponseIncomplete *StreamEventsResponseIncomplete `queryParam:"inline" union:"member"` + StreamEventsResponseFailed *StreamEventsResponseFailed `queryParam:"inline" union:"member"` + ErrorEvent *ErrorEvent `queryParam:"inline" union:"member"` + StreamEventsResponseOutputItemAdded *StreamEventsResponseOutputItemAdded `queryParam:"inline" union:"member"` + StreamEventsResponseOutputItemDone *StreamEventsResponseOutputItemDone `queryParam:"inline" union:"member"` + ContentPartAddedEvent *ContentPartAddedEvent `queryParam:"inline" union:"member"` + ContentPartDoneEvent *ContentPartDoneEvent `queryParam:"inline" union:"member"` + TextDeltaEvent *TextDeltaEvent `queryParam:"inline" union:"member"` + TextDoneEvent *TextDoneEvent `queryParam:"inline" union:"member"` + RefusalDeltaEvent *RefusalDeltaEvent `queryParam:"inline" union:"member"` + RefusalDoneEvent *RefusalDoneEvent `queryParam:"inline" union:"member"` + AnnotationAddedEvent *AnnotationAddedEvent `queryParam:"inline" union:"member"` + FunctionCallArgsDeltaEvent *FunctionCallArgsDeltaEvent `queryParam:"inline" union:"member"` + FunctionCallArgsDoneEvent *FunctionCallArgsDoneEvent `queryParam:"inline" union:"member"` + ReasoningDeltaEvent *ReasoningDeltaEvent `queryParam:"inline" union:"member"` + ReasoningDoneEvent *ReasoningDoneEvent `queryParam:"inline" union:"member"` + ReasoningSummaryPartAddedEvent *ReasoningSummaryPartAddedEvent `queryParam:"inline" union:"member"` + ReasoningSummaryPartDoneEvent *ReasoningSummaryPartDoneEvent `queryParam:"inline" union:"member"` + ReasoningSummaryTextDeltaEvent *ReasoningSummaryTextDeltaEvent `queryParam:"inline" union:"member"` + ReasoningSummaryTextDoneEvent *ReasoningSummaryTextDoneEvent `queryParam:"inline" union:"member"` + ImageGenCallInProgressEvent *ImageGenCallInProgressEvent `queryParam:"inline" union:"member"` + ImageGenCallGeneratingEvent *ImageGenCallGeneratingEvent `queryParam:"inline" union:"member"` + ImageGenCallPartialImageEvent *ImageGenCallPartialImageEvent `queryParam:"inline" union:"member"` + ImageGenCallCompletedEvent *ImageGenCallCompletedEvent `queryParam:"inline" union:"member"` + WebSearchCallInProgressEvent *WebSearchCallInProgressEvent `queryParam:"inline" union:"member"` + WebSearchCallSearchingEvent *WebSearchCallSearchingEvent `queryParam:"inline" union:"member"` + WebSearchCallCompletedEvent *WebSearchCallCompletedEvent `queryParam:"inline" union:"member"` + CustomToolCallInputDeltaEvent *CustomToolCallInputDeltaEvent `queryParam:"inline" union:"member"` + CustomToolCallInputDoneEvent *CustomToolCallInputDoneEvent `queryParam:"inline" union:"member"` + ApplyPatchCallOperationDiffDeltaEvent *ApplyPatchCallOperationDiffDeltaEvent `queryParam:"inline" union:"member"` + ApplyPatchCallOperationDiffDoneEvent *ApplyPatchCallOperationDiffDoneEvent `queryParam:"inline" union:"member"` + FusionCallInProgressEvent *FusionCallInProgressEvent `queryParam:"inline" union:"member"` + FusionCallPanelAddedEvent *FusionCallPanelAddedEvent `queryParam:"inline" union:"member"` + FusionCallPanelDeltaEvent *FusionCallPanelDeltaEvent `queryParam:"inline" union:"member"` + FusionCallPanelReasoningDeltaEvent *FusionCallPanelReasoningDeltaEvent `queryParam:"inline" union:"member"` + FusionCallPanelCompletedEvent *FusionCallPanelCompletedEvent `queryParam:"inline" union:"member"` + FusionCallPanelFailedEvent *FusionCallPanelFailedEvent `queryParam:"inline" union:"member"` + FusionCallAnalysisInProgressEvent *FusionCallAnalysisInProgressEvent `queryParam:"inline" union:"member"` + FusionCallAnalysisCompletedEvent *FusionCallAnalysisCompletedEvent `queryParam:"inline" union:"member"` + FusionCallCompletedEvent *FusionCallCompletedEvent `queryParam:"inline" union:"member"` + UnknownRaw json.RawMessage `json:"-" union:"unknown"` Type StreamEventsType } @@ -94,6 +120,30 @@ func CreateStreamEventsError(errorT ErrorEvent) StreamEvents { } } +func CreateStreamEventsResponseApplyPatchCallOperationDiffDelta(responseApplyPatchCallOperationDiffDelta ApplyPatchCallOperationDiffDeltaEvent) StreamEvents { + typ := StreamEventsTypeResponseApplyPatchCallOperationDiffDelta + + typStr := ApplyPatchCallOperationDiffDeltaEventType(typ) + responseApplyPatchCallOperationDiffDelta.Type = typStr + + return StreamEvents{ + ApplyPatchCallOperationDiffDeltaEvent: &responseApplyPatchCallOperationDiffDelta, + Type: typ, + } +} + +func CreateStreamEventsResponseApplyPatchCallOperationDiffDone(responseApplyPatchCallOperationDiffDone ApplyPatchCallOperationDiffDoneEvent) StreamEvents { + typ := StreamEventsTypeResponseApplyPatchCallOperationDiffDone + + typStr := ApplyPatchCallOperationDiffDoneEventType(typ) + responseApplyPatchCallOperationDiffDone.Type = typStr + + return StreamEvents{ + ApplyPatchCallOperationDiffDoneEvent: &responseApplyPatchCallOperationDiffDone, + Type: typ, + } +} + func CreateStreamEventsResponseCompleted(responseCompleted StreamEventsResponseCompleted) StreamEvents { typ := StreamEventsTypeResponseCompleted @@ -142,6 +192,30 @@ func CreateStreamEventsResponseCreated(responseCreated OpenResponsesCreatedEvent } } +func CreateStreamEventsResponseCustomToolCallInputDelta(responseCustomToolCallInputDelta CustomToolCallInputDeltaEvent) StreamEvents { + typ := StreamEventsTypeResponseCustomToolCallInputDelta + + typStr := CustomToolCallInputDeltaEventType(typ) + responseCustomToolCallInputDelta.Type = typStr + + return StreamEvents{ + CustomToolCallInputDeltaEvent: &responseCustomToolCallInputDelta, + Type: typ, + } +} + +func CreateStreamEventsResponseCustomToolCallInputDone(responseCustomToolCallInputDone CustomToolCallInputDoneEvent) StreamEvents { + typ := StreamEventsTypeResponseCustomToolCallInputDone + + typStr := CustomToolCallInputDoneEventType(typ) + responseCustomToolCallInputDone.Type = typStr + + return StreamEvents{ + CustomToolCallInputDoneEvent: &responseCustomToolCallInputDone, + Type: typ, + } +} + func CreateStreamEventsResponseFailed(responseFailed StreamEventsResponseFailed) StreamEvents { typ := StreamEventsTypeResponseFailed @@ -178,6 +252,114 @@ func CreateStreamEventsResponseFunctionCallArgumentsDone(responseFunctionCallArg } } +func CreateStreamEventsResponseFusionCallAnalysisCompleted(responseFusionCallAnalysisCompleted FusionCallAnalysisCompletedEvent) StreamEvents { + typ := StreamEventsTypeResponseFusionCallAnalysisCompleted + + typStr := FusionCallAnalysisCompletedEventType(typ) + responseFusionCallAnalysisCompleted.Type = typStr + + return StreamEvents{ + FusionCallAnalysisCompletedEvent: &responseFusionCallAnalysisCompleted, + Type: typ, + } +} + +func CreateStreamEventsResponseFusionCallAnalysisInProgress(responseFusionCallAnalysisInProgress FusionCallAnalysisInProgressEvent) StreamEvents { + typ := StreamEventsTypeResponseFusionCallAnalysisInProgress + + typStr := FusionCallAnalysisInProgressEventType(typ) + responseFusionCallAnalysisInProgress.Type = typStr + + return StreamEvents{ + FusionCallAnalysisInProgressEvent: &responseFusionCallAnalysisInProgress, + Type: typ, + } +} + +func CreateStreamEventsResponseFusionCallCompleted(responseFusionCallCompleted FusionCallCompletedEvent) StreamEvents { + typ := StreamEventsTypeResponseFusionCallCompleted + + typStr := FusionCallCompletedEventType(typ) + responseFusionCallCompleted.Type = typStr + + return StreamEvents{ + FusionCallCompletedEvent: &responseFusionCallCompleted, + Type: typ, + } +} + +func CreateStreamEventsResponseFusionCallInProgress(responseFusionCallInProgress FusionCallInProgressEvent) StreamEvents { + typ := StreamEventsTypeResponseFusionCallInProgress + + typStr := FusionCallInProgressEventType(typ) + responseFusionCallInProgress.Type = typStr + + return StreamEvents{ + FusionCallInProgressEvent: &responseFusionCallInProgress, + Type: typ, + } +} + +func CreateStreamEventsResponseFusionCallPanelAdded(responseFusionCallPanelAdded FusionCallPanelAddedEvent) StreamEvents { + typ := StreamEventsTypeResponseFusionCallPanelAdded + + typStr := FusionCallPanelAddedEventType(typ) + responseFusionCallPanelAdded.Type = typStr + + return StreamEvents{ + FusionCallPanelAddedEvent: &responseFusionCallPanelAdded, + Type: typ, + } +} + +func CreateStreamEventsResponseFusionCallPanelCompleted(responseFusionCallPanelCompleted FusionCallPanelCompletedEvent) StreamEvents { + typ := StreamEventsTypeResponseFusionCallPanelCompleted + + typStr := FusionCallPanelCompletedEventType(typ) + responseFusionCallPanelCompleted.Type = typStr + + return StreamEvents{ + FusionCallPanelCompletedEvent: &responseFusionCallPanelCompleted, + Type: typ, + } +} + +func CreateStreamEventsResponseFusionCallPanelDelta(responseFusionCallPanelDelta FusionCallPanelDeltaEvent) StreamEvents { + typ := StreamEventsTypeResponseFusionCallPanelDelta + + typStr := FusionCallPanelDeltaEventType(typ) + responseFusionCallPanelDelta.Type = typStr + + return StreamEvents{ + FusionCallPanelDeltaEvent: &responseFusionCallPanelDelta, + Type: typ, + } +} + +func CreateStreamEventsResponseFusionCallPanelFailed(responseFusionCallPanelFailed FusionCallPanelFailedEvent) StreamEvents { + typ := StreamEventsTypeResponseFusionCallPanelFailed + + typStr := FusionCallPanelFailedEventType(typ) + responseFusionCallPanelFailed.Type = typStr + + return StreamEvents{ + FusionCallPanelFailedEvent: &responseFusionCallPanelFailed, + Type: typ, + } +} + +func CreateStreamEventsResponseFusionCallPanelReasoningDelta(responseFusionCallPanelReasoningDelta FusionCallPanelReasoningDeltaEvent) StreamEvents { + typ := StreamEventsTypeResponseFusionCallPanelReasoningDelta + + typStr := FusionCallPanelReasoningDeltaEventType(typ) + responseFusionCallPanelReasoningDelta.Type = typStr + + return StreamEvents{ + FusionCallPanelReasoningDeltaEvent: &responseFusionCallPanelReasoningDelta, + Type: typ, + } +} + func CreateStreamEventsResponseImageGenerationCallCompleted(responseImageGenerationCallCompleted ImageGenCallCompletedEvent) StreamEvents { typ := StreamEventsTypeResponseImageGenerationCallCompleted @@ -485,6 +667,24 @@ func (u *StreamEvents) UnmarshalJSON(data []byte) error { u.ErrorEvent = errorEvent u.Type = StreamEventsTypeError return nil + case "response.apply_patch_call_operation_diff.delta": + applyPatchCallOperationDiffDeltaEvent := new(ApplyPatchCallOperationDiffDeltaEvent) + if err := utils.UnmarshalJSON(data, &applyPatchCallOperationDiffDeltaEvent, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == response.apply_patch_call_operation_diff.delta) type ApplyPatchCallOperationDiffDeltaEvent within StreamEvents: %w", string(data), err) + } + + u.ApplyPatchCallOperationDiffDeltaEvent = applyPatchCallOperationDiffDeltaEvent + u.Type = StreamEventsTypeResponseApplyPatchCallOperationDiffDelta + return nil + case "response.apply_patch_call_operation_diff.done": + applyPatchCallOperationDiffDoneEvent := new(ApplyPatchCallOperationDiffDoneEvent) + if err := utils.UnmarshalJSON(data, &applyPatchCallOperationDiffDoneEvent, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == response.apply_patch_call_operation_diff.done) type ApplyPatchCallOperationDiffDoneEvent within StreamEvents: %w", string(data), err) + } + + u.ApplyPatchCallOperationDiffDoneEvent = applyPatchCallOperationDiffDoneEvent + u.Type = StreamEventsTypeResponseApplyPatchCallOperationDiffDone + return nil case "response.completed": streamEventsResponseCompleted := new(StreamEventsResponseCompleted) if err := utils.UnmarshalJSON(data, &streamEventsResponseCompleted, "", true, nil); err != nil { @@ -521,6 +721,24 @@ func (u *StreamEvents) UnmarshalJSON(data []byte) error { u.OpenResponsesCreatedEvent = openResponsesCreatedEvent u.Type = StreamEventsTypeResponseCreated return nil + case "response.custom_tool_call_input.delta": + customToolCallInputDeltaEvent := new(CustomToolCallInputDeltaEvent) + if err := utils.UnmarshalJSON(data, &customToolCallInputDeltaEvent, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == response.custom_tool_call_input.delta) type CustomToolCallInputDeltaEvent within StreamEvents: %w", string(data), err) + } + + u.CustomToolCallInputDeltaEvent = customToolCallInputDeltaEvent + u.Type = StreamEventsTypeResponseCustomToolCallInputDelta + return nil + case "response.custom_tool_call_input.done": + customToolCallInputDoneEvent := new(CustomToolCallInputDoneEvent) + if err := utils.UnmarshalJSON(data, &customToolCallInputDoneEvent, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == response.custom_tool_call_input.done) type CustomToolCallInputDoneEvent within StreamEvents: %w", string(data), err) + } + + u.CustomToolCallInputDoneEvent = customToolCallInputDoneEvent + u.Type = StreamEventsTypeResponseCustomToolCallInputDone + return nil case "response.failed": streamEventsResponseFailed := new(StreamEventsResponseFailed) if err := utils.UnmarshalJSON(data, &streamEventsResponseFailed, "", true, nil); err != nil { @@ -548,6 +766,87 @@ func (u *StreamEvents) UnmarshalJSON(data []byte) error { u.FunctionCallArgsDoneEvent = functionCallArgsDoneEvent u.Type = StreamEventsTypeResponseFunctionCallArgumentsDone return nil + case "response.fusion_call.analysis.completed": + fusionCallAnalysisCompletedEvent := new(FusionCallAnalysisCompletedEvent) + if err := utils.UnmarshalJSON(data, &fusionCallAnalysisCompletedEvent, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == response.fusion_call.analysis.completed) type FusionCallAnalysisCompletedEvent within StreamEvents: %w", string(data), err) + } + + u.FusionCallAnalysisCompletedEvent = fusionCallAnalysisCompletedEvent + u.Type = StreamEventsTypeResponseFusionCallAnalysisCompleted + return nil + case "response.fusion_call.analysis.in_progress": + fusionCallAnalysisInProgressEvent := new(FusionCallAnalysisInProgressEvent) + if err := utils.UnmarshalJSON(data, &fusionCallAnalysisInProgressEvent, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == response.fusion_call.analysis.in_progress) type FusionCallAnalysisInProgressEvent within StreamEvents: %w", string(data), err) + } + + u.FusionCallAnalysisInProgressEvent = fusionCallAnalysisInProgressEvent + u.Type = StreamEventsTypeResponseFusionCallAnalysisInProgress + return nil + case "response.fusion_call.completed": + fusionCallCompletedEvent := new(FusionCallCompletedEvent) + if err := utils.UnmarshalJSON(data, &fusionCallCompletedEvent, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == response.fusion_call.completed) type FusionCallCompletedEvent within StreamEvents: %w", string(data), err) + } + + u.FusionCallCompletedEvent = fusionCallCompletedEvent + u.Type = StreamEventsTypeResponseFusionCallCompleted + return nil + case "response.fusion_call.in_progress": + fusionCallInProgressEvent := new(FusionCallInProgressEvent) + if err := utils.UnmarshalJSON(data, &fusionCallInProgressEvent, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == response.fusion_call.in_progress) type FusionCallInProgressEvent within StreamEvents: %w", string(data), err) + } + + u.FusionCallInProgressEvent = fusionCallInProgressEvent + u.Type = StreamEventsTypeResponseFusionCallInProgress + return nil + case "response.fusion_call.panel.added": + fusionCallPanelAddedEvent := new(FusionCallPanelAddedEvent) + if err := utils.UnmarshalJSON(data, &fusionCallPanelAddedEvent, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == response.fusion_call.panel.added) type FusionCallPanelAddedEvent within StreamEvents: %w", string(data), err) + } + + u.FusionCallPanelAddedEvent = fusionCallPanelAddedEvent + u.Type = StreamEventsTypeResponseFusionCallPanelAdded + return nil + case "response.fusion_call.panel.completed": + fusionCallPanelCompletedEvent := new(FusionCallPanelCompletedEvent) + if err := utils.UnmarshalJSON(data, &fusionCallPanelCompletedEvent, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == response.fusion_call.panel.completed) type FusionCallPanelCompletedEvent within StreamEvents: %w", string(data), err) + } + + u.FusionCallPanelCompletedEvent = fusionCallPanelCompletedEvent + u.Type = StreamEventsTypeResponseFusionCallPanelCompleted + return nil + case "response.fusion_call.panel.delta": + fusionCallPanelDeltaEvent := new(FusionCallPanelDeltaEvent) + if err := utils.UnmarshalJSON(data, &fusionCallPanelDeltaEvent, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == response.fusion_call.panel.delta) type FusionCallPanelDeltaEvent within StreamEvents: %w", string(data), err) + } + + u.FusionCallPanelDeltaEvent = fusionCallPanelDeltaEvent + u.Type = StreamEventsTypeResponseFusionCallPanelDelta + return nil + case "response.fusion_call.panel.failed": + fusionCallPanelFailedEvent := new(FusionCallPanelFailedEvent) + if err := utils.UnmarshalJSON(data, &fusionCallPanelFailedEvent, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == response.fusion_call.panel.failed) type FusionCallPanelFailedEvent within StreamEvents: %w", string(data), err) + } + + u.FusionCallPanelFailedEvent = fusionCallPanelFailedEvent + u.Type = StreamEventsTypeResponseFusionCallPanelFailed + return nil + case "response.fusion_call.panel.reasoning.delta": + fusionCallPanelReasoningDeltaEvent := new(FusionCallPanelReasoningDeltaEvent) + if err := utils.UnmarshalJSON(data, &fusionCallPanelReasoningDeltaEvent, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == response.fusion_call.panel.reasoning.delta) type FusionCallPanelReasoningDeltaEvent within StreamEvents: %w", string(data), err) + } + + u.FusionCallPanelReasoningDeltaEvent = fusionCallPanelReasoningDeltaEvent + u.Type = StreamEventsTypeResponseFusionCallPanelReasoningDelta + return nil case "response.image_generation_call.completed": imageGenCallCompletedEvent := new(ImageGenCallCompletedEvent) if err := utils.UnmarshalJSON(data, &imageGenCallCompletedEvent, "", true, nil); err != nil { @@ -875,6 +1174,58 @@ func (u StreamEvents) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.WebSearchCallCompletedEvent, "", true) } + if u.CustomToolCallInputDeltaEvent != nil { + return utils.MarshalJSON(u.CustomToolCallInputDeltaEvent, "", true) + } + + if u.CustomToolCallInputDoneEvent != nil { + return utils.MarshalJSON(u.CustomToolCallInputDoneEvent, "", true) + } + + if u.ApplyPatchCallOperationDiffDeltaEvent != nil { + return utils.MarshalJSON(u.ApplyPatchCallOperationDiffDeltaEvent, "", true) + } + + if u.ApplyPatchCallOperationDiffDoneEvent != nil { + return utils.MarshalJSON(u.ApplyPatchCallOperationDiffDoneEvent, "", true) + } + + if u.FusionCallInProgressEvent != nil { + return utils.MarshalJSON(u.FusionCallInProgressEvent, "", true) + } + + if u.FusionCallPanelAddedEvent != nil { + return utils.MarshalJSON(u.FusionCallPanelAddedEvent, "", true) + } + + if u.FusionCallPanelDeltaEvent != nil { + return utils.MarshalJSON(u.FusionCallPanelDeltaEvent, "", true) + } + + if u.FusionCallPanelReasoningDeltaEvent != nil { + return utils.MarshalJSON(u.FusionCallPanelReasoningDeltaEvent, "", true) + } + + if u.FusionCallPanelCompletedEvent != nil { + return utils.MarshalJSON(u.FusionCallPanelCompletedEvent, "", true) + } + + if u.FusionCallPanelFailedEvent != nil { + return utils.MarshalJSON(u.FusionCallPanelFailedEvent, "", true) + } + + if u.FusionCallAnalysisInProgressEvent != nil { + return utils.MarshalJSON(u.FusionCallAnalysisInProgressEvent, "", true) + } + + if u.FusionCallAnalysisCompletedEvent != nil { + return utils.MarshalJSON(u.FusionCallAnalysisCompletedEvent, "", true) + } + + if u.FusionCallCompletedEvent != nil { + return utils.MarshalJSON(u.FusionCallCompletedEvent, "", true) + } + if u.UnknownRaw != nil { return json.RawMessage(u.UnknownRaw), nil } diff --git a/models/components/streameventsresponseoutputitemadded.go b/models/components/streameventsresponseoutputitemadded.go index 1f6ef081..46ed9fd8 100644 --- a/models/components/streameventsresponseoutputitemadded.go +++ b/models/components/streameventsresponseoutputitemadded.go @@ -58,6 +58,10 @@ func (s *StreamEventsResponseOutputItemAdded) GetItem() OutputItems { return s.Item } +func (s *StreamEventsResponseOutputItemAdded) GetItemApplyPatchCall() *OutputApplyPatchCallItem { + return s.GetItem().OutputApplyPatchCallItem +} + func (s *StreamEventsResponseOutputItemAdded) GetItemCodeInterpreterCall() *OutputCodeInterpreterCallItem { return s.GetItem().OutputCodeInterpreterCallItem } @@ -66,6 +70,10 @@ func (s *StreamEventsResponseOutputItemAdded) GetItemComputerCall() *OutputCompu return s.GetItem().OutputComputerCallItem } +func (s *StreamEventsResponseOutputItemAdded) GetItemCustomToolCall() *OutputCustomToolCallItem { + return s.GetItem().OutputCustomToolCallItem +} + func (s *StreamEventsResponseOutputItemAdded) GetItemFileSearchCall() *OutputFileSearchCallItem { return s.GetItem().OutputFileSearchCallItem } @@ -82,6 +90,10 @@ func (s *StreamEventsResponseOutputItemAdded) GetItemMessage() *OutputMessageIte return s.GetItem().OutputMessageItem } +func (s *StreamEventsResponseOutputItemAdded) GetItemOpenrouterAdvisor() *OutputAdvisorServerToolItem { + return s.GetItem().OutputAdvisorServerToolItem +} + func (s *StreamEventsResponseOutputItemAdded) GetItemOpenrouterApplyPatch() *OutputApplyPatchServerToolItem { return s.GetItem().OutputApplyPatchServerToolItem } @@ -110,6 +122,10 @@ func (s *StreamEventsResponseOutputItemAdded) GetItemOpenrouterFileSearch() *Out return s.GetItem().OutputFileSearchServerToolItem } +func (s *StreamEventsResponseOutputItemAdded) GetItemOpenrouterFusion() *OutputFusionServerToolItem { + return s.GetItem().OutputFusionServerToolItem +} + func (s *StreamEventsResponseOutputItemAdded) GetItemOpenrouterImageGeneration() *OutputImageGenerationServerToolItem { return s.GetItem().OutputImageGenerationServerToolItem } @@ -122,6 +138,10 @@ func (s *StreamEventsResponseOutputItemAdded) GetItemOpenrouterMemory() *OutputM return s.GetItem().OutputMemoryServerToolItem } +func (s *StreamEventsResponseOutputItemAdded) GetItemOpenrouterSubagent() *OutputSubagentServerToolItem { + return s.GetItem().OutputSubagentServerToolItem +} + func (s *StreamEventsResponseOutputItemAdded) GetItemOpenrouterTextEditor() *OutputTextEditorServerToolItem { return s.GetItem().OutputTextEditorServerToolItem } @@ -142,6 +162,14 @@ func (s *StreamEventsResponseOutputItemAdded) GetItemReasoning() *OutputReasonin return s.GetItem().OutputReasoningItem } +func (s *StreamEventsResponseOutputItemAdded) GetItemShellCall() *OutputShellCallItem { + return s.GetItem().OutputShellCallItem +} + +func (s *StreamEventsResponseOutputItemAdded) GetItemShellCallOutput() *OutputShellCallOutputItem { + return s.GetItem().OutputShellCallOutputItem +} + func (s *StreamEventsResponseOutputItemAdded) GetItemWebSearchCall() *OutputWebSearchCallItem { return s.GetItem().OutputWebSearchCallItem } diff --git a/models/components/streameventsresponseoutputitemdone.go b/models/components/streameventsresponseoutputitemdone.go index 694b4feb..0b0cade7 100644 --- a/models/components/streameventsresponseoutputitemdone.go +++ b/models/components/streameventsresponseoutputitemdone.go @@ -58,6 +58,10 @@ func (s *StreamEventsResponseOutputItemDone) GetItem() OutputItems { return s.Item } +func (s *StreamEventsResponseOutputItemDone) GetItemApplyPatchCall() *OutputApplyPatchCallItem { + return s.GetItem().OutputApplyPatchCallItem +} + func (s *StreamEventsResponseOutputItemDone) GetItemCodeInterpreterCall() *OutputCodeInterpreterCallItem { return s.GetItem().OutputCodeInterpreterCallItem } @@ -66,6 +70,10 @@ func (s *StreamEventsResponseOutputItemDone) GetItemComputerCall() *OutputComput return s.GetItem().OutputComputerCallItem } +func (s *StreamEventsResponseOutputItemDone) GetItemCustomToolCall() *OutputCustomToolCallItem { + return s.GetItem().OutputCustomToolCallItem +} + func (s *StreamEventsResponseOutputItemDone) GetItemFileSearchCall() *OutputFileSearchCallItem { return s.GetItem().OutputFileSearchCallItem } @@ -82,6 +90,10 @@ func (s *StreamEventsResponseOutputItemDone) GetItemMessage() *OutputMessageItem return s.GetItem().OutputMessageItem } +func (s *StreamEventsResponseOutputItemDone) GetItemOpenrouterAdvisor() *OutputAdvisorServerToolItem { + return s.GetItem().OutputAdvisorServerToolItem +} + func (s *StreamEventsResponseOutputItemDone) GetItemOpenrouterApplyPatch() *OutputApplyPatchServerToolItem { return s.GetItem().OutputApplyPatchServerToolItem } @@ -110,6 +122,10 @@ func (s *StreamEventsResponseOutputItemDone) GetItemOpenrouterFileSearch() *Outp return s.GetItem().OutputFileSearchServerToolItem } +func (s *StreamEventsResponseOutputItemDone) GetItemOpenrouterFusion() *OutputFusionServerToolItem { + return s.GetItem().OutputFusionServerToolItem +} + func (s *StreamEventsResponseOutputItemDone) GetItemOpenrouterImageGeneration() *OutputImageGenerationServerToolItem { return s.GetItem().OutputImageGenerationServerToolItem } @@ -122,6 +138,10 @@ func (s *StreamEventsResponseOutputItemDone) GetItemOpenrouterMemory() *OutputMe return s.GetItem().OutputMemoryServerToolItem } +func (s *StreamEventsResponseOutputItemDone) GetItemOpenrouterSubagent() *OutputSubagentServerToolItem { + return s.GetItem().OutputSubagentServerToolItem +} + func (s *StreamEventsResponseOutputItemDone) GetItemOpenrouterTextEditor() *OutputTextEditorServerToolItem { return s.GetItem().OutputTextEditorServerToolItem } @@ -142,6 +162,14 @@ func (s *StreamEventsResponseOutputItemDone) GetItemReasoning() *OutputReasoning return s.GetItem().OutputReasoningItem } +func (s *StreamEventsResponseOutputItemDone) GetItemShellCall() *OutputShellCallItem { + return s.GetItem().OutputShellCallItem +} + +func (s *StreamEventsResponseOutputItemDone) GetItemShellCallOutput() *OutputShellCallOutputItem { + return s.GetItem().OutputShellCallOutputItem +} + func (s *StreamEventsResponseOutputItemDone) GetItemWebSearchCall() *OutputWebSearchCallItem { return s.GetItem().OutputWebSearchCallItem } diff --git a/models/components/sttinputaudio.go b/models/components/sttinputaudio.go new file mode 100644 index 00000000..a9a3a6b0 --- /dev/null +++ b/models/components/sttinputaudio.go @@ -0,0 +1,25 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// STTInputAudio - Base64-encoded audio to transcribe +type STTInputAudio struct { + // Base64-encoded audio data (raw bytes, not a data URI) + Data string `json:"data"` + // Audio format (e.g., wav, mp3, flac, m4a, ogg, webm, aac). Supported formats vary by provider. + Format string `json:"format"` +} + +func (s *STTInputAudio) GetData() string { + if s == nil { + return "" + } + return s.Data +} + +func (s *STTInputAudio) GetFormat() string { + if s == nil { + return "" + } + return s.Format +} diff --git a/models/components/sttrequest.go b/models/components/sttrequest.go new file mode 100644 index 00000000..d54ad247 --- /dev/null +++ b/models/components/sttrequest.go @@ -0,0 +1,91 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// STTRequestProvider - Provider-specific passthrough configuration +type STTRequestProvider struct { + // Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. + Options *ProviderOptions `json:"options,omitzero"` +} + +func (s STTRequestProvider) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *STTRequestProvider) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *STTRequestProvider) GetOptions() *ProviderOptions { + if s == nil { + return nil + } + return s.Options +} + +// STTRequest - Speech-to-text request input. Accepts a JSON body with input_audio containing base64-encoded audio. +type STTRequest struct { + // Base64-encoded audio to transcribe + InputAudio STTInputAudio `json:"input_audio"` + // ISO-639-1 language code (e.g., "en", "ja"). Auto-detected if omitted. + Language *string `json:"language,omitzero"` + // STT model identifier + Model string `json:"model"` + // Provider-specific passthrough configuration + Provider *STTRequestProvider `json:"provider,omitzero"` + // Sampling temperature for transcription + Temperature *float64 `json:"temperature,omitzero"` +} + +func (s STTRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *STTRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *STTRequest) GetInputAudio() STTInputAudio { + if s == nil { + return STTInputAudio{} + } + return s.InputAudio +} + +func (s *STTRequest) GetLanguage() *string { + if s == nil { + return nil + } + return s.Language +} + +func (s *STTRequest) GetModel() string { + if s == nil { + return "" + } + return s.Model +} + +func (s *STTRequest) GetProvider() *STTRequestProvider { + if s == nil { + return nil + } + return s.Provider +} + +func (s *STTRequest) GetTemperature() *float64 { + if s == nil { + return nil + } + return s.Temperature +} diff --git a/models/components/sttresponse.go b/models/components/sttresponse.go new file mode 100644 index 00000000..d3ba1739 --- /dev/null +++ b/models/components/sttresponse.go @@ -0,0 +1,40 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// STTResponse - STT response containing transcribed text and optional usage statistics +type STTResponse struct { + // The transcribed text + Text string `json:"text"` + // Aggregated usage statistics for the request + Usage *STTUsage `json:"usage,omitzero"` +} + +func (s STTResponse) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *STTResponse) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *STTResponse) GetText() string { + if s == nil { + return "" + } + return s.Text +} + +func (s *STTResponse) GetUsage() *STTUsage { + if s == nil { + return nil + } + return s.Usage +} diff --git a/models/components/sttusage.go b/models/components/sttusage.go new file mode 100644 index 00000000..c2794e7a --- /dev/null +++ b/models/components/sttusage.go @@ -0,0 +1,52 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// STTUsage - Aggregated usage statistics for the request +type STTUsage struct { + // Total cost of the request in USD + Cost *float64 `json:"cost,omitzero"` + // Number of input tokens billed for this request + InputTokens *int64 `json:"input_tokens,omitzero"` + // Number of output tokens generated + OutputTokens *int64 `json:"output_tokens,omitzero"` + // Duration of the input audio in seconds + Seconds *float64 `json:"seconds,omitzero"` + // Total number of tokens used (input + output) + TotalTokens *int64 `json:"total_tokens,omitzero"` +} + +func (s *STTUsage) GetCost() *float64 { + if s == nil { + return nil + } + return s.Cost +} + +func (s *STTUsage) GetInputTokens() *int64 { + if s == nil { + return nil + } + return s.InputTokens +} + +func (s *STTUsage) GetOutputTokens() *int64 { + if s == nil { + return nil + } + return s.OutputTokens +} + +func (s *STTUsage) GetSeconds() *float64 { + if s == nil { + return nil + } + return s.Seconds +} + +func (s *STTUsage) GetTotalTokens() *int64 { + if s == nil { + return nil + } + return s.TotalTokens +} diff --git a/models/components/subagentnestedtool.go b/models/components/subagentnestedtool.go new file mode 100644 index 00000000..5149eb70 --- /dev/null +++ b/models/components/subagentnestedtool.go @@ -0,0 +1,46 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// SubagentNestedTool - A tool made available to the subagent. Only OpenRouter server tools (e.g. openrouter:web_search) are supported; function tools are rejected because the worker has no way to execute them. The subagent tool may not list itself. +type SubagentNestedTool struct { + Parameters map[string]any `json:"parameters,omitzero"` + Type string `json:"type"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (s SubagentNestedTool) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SubagentNestedTool) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *SubagentNestedTool) GetParameters() map[string]any { + if s == nil { + return nil + } + return s.Parameters +} + +func (s *SubagentNestedTool) GetType() string { + if s == nil { + return "" + } + return s.Type +} + +func (s *SubagentNestedTool) GetAdditionalProperties() map[string]any { + if s == nil { + return nil + } + return s.AdditionalProperties +} diff --git a/models/components/subagentreasoning.go b/models/components/subagentreasoning.go new file mode 100644 index 00000000..dd468439 --- /dev/null +++ b/models/components/subagentreasoning.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// SubagentReasoningEffort - Reasoning effort level for the subagent call. +type SubagentReasoningEffort string + +const ( + SubagentReasoningEffortXhigh SubagentReasoningEffort = "xhigh" + SubagentReasoningEffortHigh SubagentReasoningEffort = "high" + SubagentReasoningEffortMedium SubagentReasoningEffort = "medium" + SubagentReasoningEffortLow SubagentReasoningEffort = "low" + SubagentReasoningEffortMinimal SubagentReasoningEffort = "minimal" + SubagentReasoningEffortNone SubagentReasoningEffort = "none" +) + +func (e SubagentReasoningEffort) ToPointer() *SubagentReasoningEffort { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *SubagentReasoningEffort) IsExact() bool { + if e != nil { + switch *e { + case "xhigh", "high", "medium", "low", "minimal", "none": + return true + } + } + return false +} + +// SubagentReasoning - Reasoning configuration forwarded to the subagent call. Use this to control reasoning effort and token budget for models that support extended thinking. +type SubagentReasoning struct { + // Reasoning effort level for the subagent call. + Effort *SubagentReasoningEffort `json:"effort,omitzero"` + // Maximum number of reasoning tokens the subagent may use. Accepted and validated but not yet forwarded to the subagent call. + MaxTokens *int64 `json:"max_tokens,omitzero"` +} + +func (s SubagentReasoning) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SubagentReasoning) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *SubagentReasoning) GetEffort() *SubagentReasoningEffort { + if s == nil { + return nil + } + return s.Effort +} + +func (s *SubagentReasoning) GetMaxTokens() *int64 { + if s == nil { + return nil + } + return s.MaxTokens +} diff --git a/models/components/subagentservertoolconfig.go b/models/components/subagentservertoolconfig.go new file mode 100644 index 00000000..7fe309d4 --- /dev/null +++ b/models/components/subagentservertoolconfig.go @@ -0,0 +1,85 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// SubagentServerToolConfig - Configuration for the openrouter:subagent server tool. +type SubagentServerToolConfig struct { + // System instructions for the subagent. When omitted, the subagent responds with no system prompt of its own. + Instructions *string `json:"instructions,omitzero"` + // Maximum number of output tokens (including reasoning) the subagent may produce. When omitted, the provider's default applies. + MaxCompletionTokens *int64 `json:"max_completion_tokens,omitzero"` + // Maximum number of tool-calling steps the subagent may take during its agentic loop. Capped at 25. Only relevant when the subagent is given tools. Accepted and validated but not yet enforced on the subagent call. + MaxToolCalls *int64 `json:"max_tool_calls,omitzero"` + // Slug of the model that executes delegated tasks (any OpenRouter model). Typically a smaller, cheaper, faster model than the one delegating. When omitted, the model from the outer API request is used. The subagent tool itself cannot be the subagent model. + Model *string `json:"model,omitzero"` + // Reasoning configuration forwarded to the subagent call. Use this to control reasoning effort and token budget for models that support extended thinking. + Reasoning *SubagentReasoning `json:"reasoning,omitzero"` + // Sampling temperature forwarded to the subagent call. When omitted, the provider's default applies. + Temperature *float64 `json:"temperature,omitzero"` + // Tools the subagent may use while executing a delegated task. The subagent runs as an agentic sub-agent over these tools, then returns its outcome. Only OpenRouter server tools are supported — function tools are rejected — and the list must not include the subagent tool itself. + Tools []SubagentNestedTool `json:"tools,omitzero"` +} + +func (s SubagentServerToolConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SubagentServerToolConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *SubagentServerToolConfig) GetInstructions() *string { + if s == nil { + return nil + } + return s.Instructions +} + +func (s *SubagentServerToolConfig) GetMaxCompletionTokens() *int64 { + if s == nil { + return nil + } + return s.MaxCompletionTokens +} + +func (s *SubagentServerToolConfig) GetMaxToolCalls() *int64 { + if s == nil { + return nil + } + return s.MaxToolCalls +} + +func (s *SubagentServerToolConfig) GetModel() *string { + if s == nil { + return nil + } + return s.Model +} + +func (s *SubagentServerToolConfig) GetReasoning() *SubagentReasoning { + if s == nil { + return nil + } + return s.Reasoning +} + +func (s *SubagentServerToolConfig) GetTemperature() *float64 { + if s == nil { + return nil + } + return s.Temperature +} + +func (s *SubagentServerToolConfig) GetTools() []SubagentNestedTool { + if s == nil { + return nil + } + return s.Tools +} diff --git a/models/components/subagentservertoolopenrouter.go b/models/components/subagentservertoolopenrouter.go new file mode 100644 index 00000000..b3e5b747 --- /dev/null +++ b/models/components/subagentservertoolopenrouter.go @@ -0,0 +1,64 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type SubagentServerToolOpenRouterType string + +const ( + SubagentServerToolOpenRouterTypeOpenrouterSubagent SubagentServerToolOpenRouterType = "openrouter:subagent" +) + +func (e SubagentServerToolOpenRouterType) ToPointer() *SubagentServerToolOpenRouterType { + return &e +} +func (e *SubagentServerToolOpenRouterType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "openrouter:subagent": + *e = SubagentServerToolOpenRouterType(v) + return nil + default: + return fmt.Errorf("invalid value for SubagentServerToolOpenRouterType: %v", v) + } +} + +// SubagentServerToolOpenRouter - OpenRouter built-in server tool: delegates self-contained tasks to a smaller, cheaper, faster worker model (any OpenRouter model) mid-generation and returns its outcome. The worker may run as a sub-agent with its own tools. +type SubagentServerToolOpenRouter struct { + // Configuration for the openrouter:subagent server tool. + Parameters *SubagentServerToolConfig `json:"parameters,omitzero"` + Type SubagentServerToolOpenRouterType `json:"type"` +} + +func (s SubagentServerToolOpenRouter) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SubagentServerToolOpenRouter) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { + return err + } + return nil +} + +func (s *SubagentServerToolOpenRouter) GetParameters() *SubagentServerToolConfig { + if s == nil { + return nil + } + return s.Parameters +} + +func (s *SubagentServerToolOpenRouter) GetType() SubagentServerToolOpenRouterType { + if s == nil { + return SubagentServerToolOpenRouterType("") + } + return s.Type +} diff --git a/models/components/updatebyokkeyrequest.go b/models/components/updatebyokkeyrequest.go new file mode 100644 index 00000000..7f59ea38 --- /dev/null +++ b/models/components/updatebyokkeyrequest.go @@ -0,0 +1,76 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type UpdateBYOKKeyRequest struct { + // Optional allowlist of model slugs this credential may be used for. `null` means no restriction. + AllowedModels optionalnullable.OptionalNullable[[]string] `json:"allowed_models,omitzero"` + // Optional allowlist of user IDs that may use this credential. `null` means no restriction. + AllowedUserIds optionalnullable.OptionalNullable[[]string] `json:"allowed_user_ids,omitzero"` + // Whether this credential is disabled. + Disabled *bool `json:"disabled,omitzero"` + // Whether this credential is treated as a fallback — used only after non-fallback keys for the same provider have been tried. + IsFallback *bool `json:"is_fallback,omitzero"` + // A new raw provider API key to rotate the credential in-place. The previous key material is overwritten and the masked label is regenerated. Encrypted at rest and never returned in API responses. + Key *string `json:"key,omitzero"` + // Optional human-readable name for the credential. + Name optionalnullable.OptionalNullable[string] `json:"name,omitzero"` +} + +func (u UpdateBYOKKeyRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UpdateBYOKKeyRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, nil); err != nil { + return err + } + return nil +} + +func (u *UpdateBYOKKeyRequest) GetAllowedModels() optionalnullable.OptionalNullable[[]string] { + if u == nil { + return nil + } + return u.AllowedModels +} + +func (u *UpdateBYOKKeyRequest) GetAllowedUserIds() optionalnullable.OptionalNullable[[]string] { + if u == nil { + return nil + } + return u.AllowedUserIds +} + +func (u *UpdateBYOKKeyRequest) GetDisabled() *bool { + if u == nil { + return nil + } + return u.Disabled +} + +func (u *UpdateBYOKKeyRequest) GetIsFallback() *bool { + if u == nil { + return nil + } + return u.IsFallback +} + +func (u *UpdateBYOKKeyRequest) GetKey() *string { + if u == nil { + return nil + } + return u.Key +} + +func (u *UpdateBYOKKeyRequest) GetName() optionalnullable.OptionalNullable[string] { + if u == nil { + return nil + } + return u.Name +} diff --git a/models/components/updatebyokkeyresponse.go b/models/components/updatebyokkeyresponse.go new file mode 100644 index 00000000..4184d457 --- /dev/null +++ b/models/components/updatebyokkeyresponse.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type UpdateBYOKKeyResponse struct { + Data BYOKKey `json:"data"` +} + +func (u *UpdateBYOKKeyResponse) GetData() BYOKKey { + if u == nil { + return BYOKKey{} + } + return u.Data +} diff --git a/models/components/updateguardrailrequest.go b/models/components/updateguardrailrequest.go index 3fe7b879..89b3796e 100644 --- a/models/components/updateguardrailrequest.go +++ b/models/components/updateguardrailrequest.go @@ -12,10 +12,24 @@ type UpdateGuardrailRequest struct { AllowedModels optionalnullable.OptionalNullable[[]string] `json:"allowed_models,omitzero"` // New list of allowed provider IDs AllowedProviders optionalnullable.OptionalNullable[[]string] `json:"allowed_providers,omitzero"` + // Builtin content filters to apply. Set to null to remove. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only. + ContentFilterBuiltins optionalnullable.OptionalNullable[[]ContentFilterBuiltinEntryInput] `json:"content_filter_builtins,omitzero"` + // Custom regex content filters to apply. Set to null to remove. + ContentFilters optionalnullable.OptionalNullable[[]ContentFilterEntry] `json:"content_filters,omitzero"` // New description for the guardrail Description optionalnullable.OptionalNullable[string] `json:"description,omitzero"` - // Whether to enforce zero data retention + // Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. + // + // Deprecated: This will be removed in a future release, please migrate away from it as soon as possible. EnforceZdr optionalnullable.OptionalNullable[bool] `json:"enforce_zdr,omitzero"` + // Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. + EnforceZdrAnthropic optionalnullable.OptionalNullable[bool] `json:"enforce_zdr_anthropic,omitzero"` + // Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. + EnforceZdrGoogle optionalnullable.OptionalNullable[bool] `json:"enforce_zdr_google,omitzero"` + // Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. + EnforceZdrOpenai optionalnullable.OptionalNullable[bool] `json:"enforce_zdr_openai,omitzero"` + // Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce_zdr when not provided. + EnforceZdrOther optionalnullable.OptionalNullable[bool] `json:"enforce_zdr_other,omitzero"` // Array of model identifiers to exclude from routing (slug or canonical_slug accepted) IgnoredModels optionalnullable.OptionalNullable[[]string] `json:"ignored_models,omitzero"` // List of provider IDs to exclude from routing @@ -53,6 +67,20 @@ func (u *UpdateGuardrailRequest) GetAllowedProviders() optionalnullable.Optional return u.AllowedProviders } +func (u *UpdateGuardrailRequest) GetContentFilterBuiltins() optionalnullable.OptionalNullable[[]ContentFilterBuiltinEntryInput] { + if u == nil { + return nil + } + return u.ContentFilterBuiltins +} + +func (u *UpdateGuardrailRequest) GetContentFilters() optionalnullable.OptionalNullable[[]ContentFilterEntry] { + if u == nil { + return nil + } + return u.ContentFilters +} + func (u *UpdateGuardrailRequest) GetDescription() optionalnullable.OptionalNullable[string] { if u == nil { return nil @@ -67,6 +95,34 @@ func (u *UpdateGuardrailRequest) GetEnforceZdr() optionalnullable.OptionalNullab return u.EnforceZdr } +func (u *UpdateGuardrailRequest) GetEnforceZdrAnthropic() optionalnullable.OptionalNullable[bool] { + if u == nil { + return nil + } + return u.EnforceZdrAnthropic +} + +func (u *UpdateGuardrailRequest) GetEnforceZdrGoogle() optionalnullable.OptionalNullable[bool] { + if u == nil { + return nil + } + return u.EnforceZdrGoogle +} + +func (u *UpdateGuardrailRequest) GetEnforceZdrOpenai() optionalnullable.OptionalNullable[bool] { + if u == nil { + return nil + } + return u.EnforceZdrOpenai +} + +func (u *UpdateGuardrailRequest) GetEnforceZdrOther() optionalnullable.OptionalNullable[bool] { + if u == nil { + return nil + } + return u.EnforceZdrOther +} + func (u *UpdateGuardrailRequest) GetIgnoredModels() optionalnullable.OptionalNullable[[]string] { if u == nil { return nil diff --git a/models/components/updateobservabilitydestinationrequest.go b/models/components/updateobservabilitydestinationrequest.go new file mode 100644 index 00000000..43b5dd3a --- /dev/null +++ b/models/components/updateobservabilitydestinationrequest.go @@ -0,0 +1,84 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type UpdateObservabilityDestinationRequest struct { + // Optional allowlist of OpenRouter API key hashes. `null` clears the filter (all keys). Omitting leaves the current value. Must contain at least one hash if provided. + APIKeyHashes optionalnullable.OptionalNullable[[]string] `json:"api_key_hashes,omitzero"` + // Provider-specific configuration fields to update. Masked values are ignored; unset fields keep their current value. + Config map[string]any `json:"config,omitzero"` + // Whether the destination is enabled. + Enabled *bool `json:"enabled,omitzero"` + FilterRules optionalnullable.OptionalNullable[ObservabilityFilterRulesConfig] `json:"filter_rules,omitzero"` + // Human-readable name for the destination. + Name *string `json:"name,omitzero"` + // When true, request/response bodies are not forwarded — only metadata. + PrivacyMode *bool `json:"privacy_mode,omitzero"` + // Sampling rate between 0.0001 and 1 (1 = 100%). + SamplingRate *float64 `json:"sampling_rate,omitzero"` +} + +func (u UpdateObservabilityDestinationRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UpdateObservabilityDestinationRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, nil); err != nil { + return err + } + return nil +} + +func (u *UpdateObservabilityDestinationRequest) GetAPIKeyHashes() optionalnullable.OptionalNullable[[]string] { + if u == nil { + return nil + } + return u.APIKeyHashes +} + +func (u *UpdateObservabilityDestinationRequest) GetConfig() map[string]any { + if u == nil { + return nil + } + return u.Config +} + +func (u *UpdateObservabilityDestinationRequest) GetEnabled() *bool { + if u == nil { + return nil + } + return u.Enabled +} + +func (u *UpdateObservabilityDestinationRequest) GetFilterRules() optionalnullable.OptionalNullable[ObservabilityFilterRulesConfig] { + if u == nil { + return nil + } + return u.FilterRules +} + +func (u *UpdateObservabilityDestinationRequest) GetName() *string { + if u == nil { + return nil + } + return u.Name +} + +func (u *UpdateObservabilityDestinationRequest) GetPrivacyMode() *bool { + if u == nil { + return nil + } + return u.PrivacyMode +} + +func (u *UpdateObservabilityDestinationRequest) GetSamplingRate() *float64 { + if u == nil { + return nil + } + return u.SamplingRate +} diff --git a/models/components/updateobservabilitydestinationresponse.go b/models/components/updateobservabilitydestinationresponse.go new file mode 100644 index 00000000..32b614e8 --- /dev/null +++ b/models/components/updateobservabilitydestinationresponse.go @@ -0,0 +1,82 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type UpdateObservabilityDestinationResponse struct { + Data ObservabilityDestination `json:"data"` +} + +func (u *UpdateObservabilityDestinationResponse) GetData() ObservabilityDestination { + if u == nil { + return ObservabilityDestination{} + } + return u.Data +} + +func (u *UpdateObservabilityDestinationResponse) GetDataArize() *ObservabilityArizeDestination { + return u.GetData().ObservabilityArizeDestination +} + +func (u *UpdateObservabilityDestinationResponse) GetDataBraintrust() *ObservabilityBraintrustDestination { + return u.GetData().ObservabilityBraintrustDestination +} + +func (u *UpdateObservabilityDestinationResponse) GetDataClickhouse() *ObservabilityClickhouseDestination { + return u.GetData().ObservabilityClickhouseDestination +} + +func (u *UpdateObservabilityDestinationResponse) GetDataDatadog() *ObservabilityDatadogDestination { + return u.GetData().ObservabilityDatadogDestination +} + +func (u *UpdateObservabilityDestinationResponse) GetDataGrafana() *ObservabilityGrafanaDestination { + return u.GetData().ObservabilityGrafanaDestination +} + +func (u *UpdateObservabilityDestinationResponse) GetDataLangfuse() *ObservabilityLangfuseDestination { + return u.GetData().ObservabilityLangfuseDestination +} + +func (u *UpdateObservabilityDestinationResponse) GetDataLangsmith() *ObservabilityLangsmithDestination { + return u.GetData().ObservabilityLangsmithDestination +} + +func (u *UpdateObservabilityDestinationResponse) GetDataNewrelic() *ObservabilityNewrelicDestination { + return u.GetData().ObservabilityNewrelicDestination +} + +func (u *UpdateObservabilityDestinationResponse) GetDataOpik() *ObservabilityOpikDestination { + return u.GetData().ObservabilityOpikDestination +} + +func (u *UpdateObservabilityDestinationResponse) GetDataOtelCollector() *ObservabilityOtelCollectorDestination { + return u.GetData().ObservabilityOtelCollectorDestination +} + +func (u *UpdateObservabilityDestinationResponse) GetDataPosthog() *ObservabilityPosthogDestination { + return u.GetData().ObservabilityPosthogDestination +} + +func (u *UpdateObservabilityDestinationResponse) GetDataRamp() *ObservabilityRampDestination { + return u.GetData().ObservabilityRampDestination +} + +func (u *UpdateObservabilityDestinationResponse) GetDataS3() *ObservabilityS3Destination { + return u.GetData().ObservabilityS3Destination +} + +func (u *UpdateObservabilityDestinationResponse) GetDataSentry() *ObservabilitySentryDestination { + return u.GetData().ObservabilitySentryDestination +} + +func (u *UpdateObservabilityDestinationResponse) GetDataSnowflake() *ObservabilitySnowflakeDestination { + return u.GetData().ObservabilitySnowflakeDestination +} + +func (u *UpdateObservabilityDestinationResponse) GetDataWeave() *ObservabilityWeaveDestination { + return u.GetData().ObservabilityWeaveDestination +} + +func (u *UpdateObservabilityDestinationResponse) GetDataWebhook() *ObservabilityWebhookDestination { + return u.GetData().ObservabilityWebhookDestination +} diff --git a/models/components/updateworkspacerequest.go b/models/components/updateworkspacerequest.go index e7b0d50d..d43f9f28 100644 --- a/models/components/updateworkspacerequest.go +++ b/models/components/updateworkspacerequest.go @@ -3,6 +3,7 @@ package components import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" "github.com/OpenRouterTeam/go-sdk/optionalnullable" ) @@ -15,6 +16,10 @@ type UpdateWorkspaceRequest struct { DefaultTextModel optionalnullable.OptionalNullable[string] `json:"default_text_model,omitzero"` // New description for the workspace Description optionalnullable.OptionalNullable[string] `json:"description,omitzero"` + // Optional array of API key IDs to filter I/O logging + IoLoggingAPIKeyIds optionalnullable.OptionalNullable[[]int64] `json:"io_logging_api_key_ids,omitzero"` + // Sampling rate for I/O logging (0.0001-1) + IoLoggingSamplingRate *float64 `json:"io_logging_sampling_rate,omitzero"` // Whether data discount logging is enabled IsDataDiscountLoggingEnabled *bool `json:"is_data_discount_logging_enabled,omitzero"` // Whether broadcast is enabled @@ -23,10 +28,21 @@ type UpdateWorkspaceRequest struct { IsObservabilityIoLoggingEnabled *bool `json:"is_observability_io_logging_enabled,omitzero"` // New name for the workspace Name *string `json:"name,omitzero"` - // New URL-friendly slug + // New URL-friendly slug (lowercase alphanumeric segments separated by single hyphens, no leading/trailing hyphens) Slug *string `json:"slug,omitzero"` } +func (u UpdateWorkspaceRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UpdateWorkspaceRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, nil); err != nil { + return err + } + return nil +} + func (u *UpdateWorkspaceRequest) GetDefaultImageModel() optionalnullable.OptionalNullable[string] { if u == nil { return nil @@ -55,6 +71,20 @@ func (u *UpdateWorkspaceRequest) GetDescription() optionalnullable.OptionalNulla return u.Description } +func (u *UpdateWorkspaceRequest) GetIoLoggingAPIKeyIds() optionalnullable.OptionalNullable[[]int64] { + if u == nil { + return nil + } + return u.IoLoggingAPIKeyIds +} + +func (u *UpdateWorkspaceRequest) GetIoLoggingSamplingRate() *float64 { + if u == nil { + return nil + } + return u.IoLoggingSamplingRate +} + func (u *UpdateWorkspaceRequest) GetIsDataDiscountLoggingEnabled() *bool { if u == nil { return nil diff --git a/models/components/urlcitation.go b/models/components/urlcitation.go index 15b197f1..f4b99416 100644 --- a/models/components/urlcitation.go +++ b/models/components/urlcitation.go @@ -32,6 +32,7 @@ func (e *URLCitationType) UnmarshalJSON(data []byte) error { } type URLCitation struct { + Content *string `json:"content,omitzero"` EndIndex int64 `json:"end_index"` StartIndex int64 `json:"start_index"` Title string `json:"title"` @@ -50,6 +51,13 @@ func (u *URLCitation) UnmarshalJSON(data []byte) error { return nil } +func (u *URLCitation) GetContent() *string { + if u == nil { + return nil + } + return u.Content +} + func (u *URLCitation) GetEndIndex() int64 { if u == nil { return 0 diff --git a/models/components/usage.go b/models/components/usage.go index aee04f5f..e97f0f8d 100644 --- a/models/components/usage.go +++ b/models/components/usage.go @@ -51,42 +51,42 @@ func (o *OutputTokensDetails) GetReasoningTokens() int64 { return o.ReasoningTokens } -type CostDetails struct { +type UsageCostDetails struct { UpstreamInferenceCost optionalnullable.OptionalNullable[float64] `json:"upstream_inference_cost,omitzero"` UpstreamInferenceInputCost float64 `json:"upstream_inference_input_cost"` UpstreamInferenceOutputCost float64 `json:"upstream_inference_output_cost"` } -func (c CostDetails) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) +func (u UsageCostDetails) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) } -func (c *CostDetails) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, nil); err != nil { +func (u *UsageCostDetails) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, nil); err != nil { return err } return nil } -func (c *CostDetails) GetUpstreamInferenceCost() optionalnullable.OptionalNullable[float64] { - if c == nil { +func (u *UsageCostDetails) GetUpstreamInferenceCost() optionalnullable.OptionalNullable[float64] { + if u == nil { return nil } - return c.UpstreamInferenceCost + return u.UpstreamInferenceCost } -func (c *CostDetails) GetUpstreamInferenceInputCost() float64 { - if c == nil { +func (u *UsageCostDetails) GetUpstreamInferenceInputCost() float64 { + if u == nil { return 0.0 } - return c.UpstreamInferenceInputCost + return u.UpstreamInferenceInputCost } -func (c *CostDetails) GetUpstreamInferenceOutputCost() float64 { - if c == nil { +func (u *UsageCostDetails) GetUpstreamInferenceOutputCost() float64 { + if u == nil { return 0.0 } - return c.UpstreamInferenceOutputCost + return u.UpstreamInferenceOutputCost } // Usage - Token usage information for the response @@ -98,7 +98,7 @@ type Usage struct { TotalTokens int64 `json:"total_tokens"` // Cost of the completion Cost optionalnullable.OptionalNullable[float64] `json:"cost,omitzero"` - CostDetails *CostDetails `json:"cost_details,omitzero"` + CostDetails *UsageCostDetails `json:"cost_details,omitzero"` // Whether a request was made using a Bring Your Own Key configuration IsByok *bool `json:"is_byok,omitzero"` } @@ -156,7 +156,7 @@ func (u *Usage) GetCost() optionalnullable.OptionalNullable[float64] { return u.Cost } -func (u *Usage) GetCostDetails() *CostDetails { +func (u *Usage) GetCostDetails() *UsageCostDetails { if u == nil { return nil } diff --git a/models/components/videogenerationrequest.go b/models/components/videogenerationrequest.go index ac89d6dc..a4e976c6 100644 --- a/models/components/videogenerationrequest.go +++ b/models/components/videogenerationrequest.go @@ -15,6 +15,8 @@ const ( AspectRatioEleven AspectRatio = "1:1" AspectRatioFortyThree AspectRatio = "4:3" AspectRatioThirtyFour AspectRatio = "3:4" + AspectRatioThirtyTwo AspectRatio = "3:2" + AspectRatioTwentyThree AspectRatio = "2:3" AspectRatioTwoHundredAndNineteen AspectRatio = "21:9" AspectRatioNineHundredAndTwentyOne AspectRatio = "9:21" ) @@ -27,15 +29,15 @@ func (e AspectRatio) ToPointer() *AspectRatio { func (e *AspectRatio) IsExact() bool { if e != nil { switch *e { - case "16:9", "9:16", "1:1", "4:3", "3:4", "21:9", "9:21": + case "16:9", "9:16", "1:1", "4:3", "3:4", "3:2", "2:3", "21:9", "9:21": return true } } return false } -// VideoGenerationRequestOptions - Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. -type VideoGenerationRequestOptions struct { +// OptionsObj - Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. +type OptionsObj struct { Oneai map[string]any `json:"01ai,omitzero"` Ai21 map[string]any `json:"ai21,omitzero"` AionLabs map[string]any `json:"aion-labs,omitzero"` @@ -63,10 +65,14 @@ type VideoGenerationRequestOptions struct { Cloudflare map[string]any `json:"cloudflare,omitzero"` Cohere map[string]any `json:"cohere,omitzero"` Crofai map[string]any `json:"crofai,omitzero"` + Crucible map[string]any `json:"crucible,omitzero"` Crusoe map[string]any `json:"crusoe,omitzero"` + Darkbloom map[string]any `json:"darkbloom,omitzero"` + Decart map[string]any `json:"decart,omitzero"` Deepinfra map[string]any `json:"deepinfra,omitzero"` Deepseek map[string]any `json:"deepseek,omitzero"` Dekallm map[string]any `json:"dekallm,omitzero"` + Digitalocean map[string]any `json:"digitalocean,omitzero"` Enfer map[string]any `json:"enfer,omitzero"` FakeProvider map[string]any `json:"fake-provider,omitzero"` Featherless map[string]any `json:"featherless,omitzero"` @@ -107,6 +113,7 @@ type VideoGenerationRequestOptions struct { Morph map[string]any `json:"morph,omitzero"` Ncompass map[string]any `json:"ncompass,omitzero"` Nebius map[string]any `json:"nebius,omitzero"` + NexAgi map[string]any `json:"nex-agi,omitzero"` Nextbit map[string]any `json:"nextbit,omitzero"` Nineteen map[string]any `json:"nineteen,omitzero"` Novita map[string]any `json:"novita,omitzero"` @@ -115,8 +122,10 @@ type VideoGenerationRequestOptions struct { OpenInference map[string]any `json:"open-inference,omitzero"` Openai map[string]any `json:"openai,omitzero"` Parasail map[string]any `json:"parasail,omitzero"` + Perceptron map[string]any `json:"perceptron,omitzero"` Perplexity map[string]any `json:"perplexity,omitzero"` Phala map[string]any `json:"phala,omitzero"` + Poolside map[string]any `json:"poolside,omitzero"` Recraft map[string]any `json:"recraft,omitzero"` Recursal map[string]any `json:"recursal,omitzero"` Reflection map[string]any `json:"reflection,omitzero"` @@ -139,776 +148,832 @@ type VideoGenerationRequestOptions struct { Ubicloud map[string]any `json:"ubicloud,omitzero"` Upstage map[string]any `json:"upstage,omitzero"` Venice map[string]any `json:"venice,omitzero"` + Wafer map[string]any `json:"wafer,omitzero"` Wandb map[string]any `json:"wandb,omitzero"` Xai map[string]any `json:"xai,omitzero"` Xiaomi map[string]any `json:"xiaomi,omitzero"` ZAi map[string]any `json:"z-ai,omitzero"` } -func (v VideoGenerationRequestOptions) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(v, "", false) +func (o OptionsObj) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(o, "", false) } -func (v *VideoGenerationRequestOptions) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &v, "", false, nil); err != nil { +func (o *OptionsObj) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &o, "", false, nil); err != nil { return err } return nil } -func (v *VideoGenerationRequestOptions) GetOneai() map[string]any { - if v == nil { +func (o *OptionsObj) GetOneai() map[string]any { + if o == nil { return nil } - return v.Oneai + return o.Oneai } -func (v *VideoGenerationRequestOptions) GetAi21() map[string]any { - if v == nil { +func (o *OptionsObj) GetAi21() map[string]any { + if o == nil { return nil } - return v.Ai21 + return o.Ai21 } -func (v *VideoGenerationRequestOptions) GetAionLabs() map[string]any { - if v == nil { +func (o *OptionsObj) GetAionLabs() map[string]any { + if o == nil { return nil } - return v.AionLabs + return o.AionLabs } -func (v *VideoGenerationRequestOptions) GetAkashml() map[string]any { - if v == nil { +func (o *OptionsObj) GetAkashml() map[string]any { + if o == nil { return nil } - return v.Akashml + return o.Akashml } -func (v *VideoGenerationRequestOptions) GetAlibaba() map[string]any { - if v == nil { +func (o *OptionsObj) GetAlibaba() map[string]any { + if o == nil { return nil } - return v.Alibaba + return o.Alibaba } -func (v *VideoGenerationRequestOptions) GetAmazonBedrock() map[string]any { - if v == nil { +func (o *OptionsObj) GetAmazonBedrock() map[string]any { + if o == nil { return nil } - return v.AmazonBedrock + return o.AmazonBedrock } -func (v *VideoGenerationRequestOptions) GetAmazonNova() map[string]any { - if v == nil { +func (o *OptionsObj) GetAmazonNova() map[string]any { + if o == nil { return nil } - return v.AmazonNova + return o.AmazonNova } -func (v *VideoGenerationRequestOptions) GetAmbient() map[string]any { - if v == nil { +func (o *OptionsObj) GetAmbient() map[string]any { + if o == nil { return nil } - return v.Ambient + return o.Ambient } -func (v *VideoGenerationRequestOptions) GetAnthropic() map[string]any { - if v == nil { +func (o *OptionsObj) GetAnthropic() map[string]any { + if o == nil { return nil } - return v.Anthropic + return o.Anthropic } -func (v *VideoGenerationRequestOptions) GetAnyscale() map[string]any { - if v == nil { +func (o *OptionsObj) GetAnyscale() map[string]any { + if o == nil { return nil } - return v.Anyscale + return o.Anyscale } -func (v *VideoGenerationRequestOptions) GetArceeAi() map[string]any { - if v == nil { +func (o *OptionsObj) GetArceeAi() map[string]any { + if o == nil { return nil } - return v.ArceeAi + return o.ArceeAi } -func (v *VideoGenerationRequestOptions) GetAtlasCloud() map[string]any { - if v == nil { +func (o *OptionsObj) GetAtlasCloud() map[string]any { + if o == nil { return nil } - return v.AtlasCloud + return o.AtlasCloud } -func (v *VideoGenerationRequestOptions) GetAtoma() map[string]any { - if v == nil { +func (o *OptionsObj) GetAtoma() map[string]any { + if o == nil { return nil } - return v.Atoma + return o.Atoma } -func (v *VideoGenerationRequestOptions) GetAvian() map[string]any { - if v == nil { +func (o *OptionsObj) GetAvian() map[string]any { + if o == nil { return nil } - return v.Avian + return o.Avian } -func (v *VideoGenerationRequestOptions) GetAzure() map[string]any { - if v == nil { +func (o *OptionsObj) GetAzure() map[string]any { + if o == nil { return nil } - return v.Azure + return o.Azure } -func (v *VideoGenerationRequestOptions) GetBaidu() map[string]any { - if v == nil { +func (o *OptionsObj) GetBaidu() map[string]any { + if o == nil { return nil } - return v.Baidu + return o.Baidu } -func (v *VideoGenerationRequestOptions) GetBaseten() map[string]any { - if v == nil { +func (o *OptionsObj) GetBaseten() map[string]any { + if o == nil { return nil } - return v.Baseten + return o.Baseten } -func (v *VideoGenerationRequestOptions) GetBlackForestLabs() map[string]any { - if v == nil { +func (o *OptionsObj) GetBlackForestLabs() map[string]any { + if o == nil { return nil } - return v.BlackForestLabs + return o.BlackForestLabs } -func (v *VideoGenerationRequestOptions) GetByteplus() map[string]any { - if v == nil { +func (o *OptionsObj) GetByteplus() map[string]any { + if o == nil { return nil } - return v.Byteplus + return o.Byteplus } -func (v *VideoGenerationRequestOptions) GetCentml() map[string]any { - if v == nil { +func (o *OptionsObj) GetCentml() map[string]any { + if o == nil { return nil } - return v.Centml + return o.Centml } -func (v *VideoGenerationRequestOptions) GetCerebras() map[string]any { - if v == nil { +func (o *OptionsObj) GetCerebras() map[string]any { + if o == nil { return nil } - return v.Cerebras + return o.Cerebras } -func (v *VideoGenerationRequestOptions) GetChutes() map[string]any { - if v == nil { +func (o *OptionsObj) GetChutes() map[string]any { + if o == nil { return nil } - return v.Chutes + return o.Chutes } -func (v *VideoGenerationRequestOptions) GetCirrascale() map[string]any { - if v == nil { +func (o *OptionsObj) GetCirrascale() map[string]any { + if o == nil { return nil } - return v.Cirrascale + return o.Cirrascale } -func (v *VideoGenerationRequestOptions) GetClarifai() map[string]any { - if v == nil { +func (o *OptionsObj) GetClarifai() map[string]any { + if o == nil { return nil } - return v.Clarifai + return o.Clarifai } -func (v *VideoGenerationRequestOptions) GetCloudflare() map[string]any { - if v == nil { +func (o *OptionsObj) GetCloudflare() map[string]any { + if o == nil { return nil } - return v.Cloudflare + return o.Cloudflare } -func (v *VideoGenerationRequestOptions) GetCohere() map[string]any { - if v == nil { +func (o *OptionsObj) GetCohere() map[string]any { + if o == nil { return nil } - return v.Cohere + return o.Cohere } -func (v *VideoGenerationRequestOptions) GetCrofai() map[string]any { - if v == nil { +func (o *OptionsObj) GetCrofai() map[string]any { + if o == nil { return nil } - return v.Crofai + return o.Crofai } -func (v *VideoGenerationRequestOptions) GetCrusoe() map[string]any { - if v == nil { +func (o *OptionsObj) GetCrucible() map[string]any { + if o == nil { return nil } - return v.Crusoe + return o.Crucible } -func (v *VideoGenerationRequestOptions) GetDeepinfra() map[string]any { - if v == nil { +func (o *OptionsObj) GetCrusoe() map[string]any { + if o == nil { return nil } - return v.Deepinfra + return o.Crusoe } -func (v *VideoGenerationRequestOptions) GetDeepseek() map[string]any { - if v == nil { +func (o *OptionsObj) GetDarkbloom() map[string]any { + if o == nil { return nil } - return v.Deepseek + return o.Darkbloom } -func (v *VideoGenerationRequestOptions) GetDekallm() map[string]any { - if v == nil { +func (o *OptionsObj) GetDecart() map[string]any { + if o == nil { return nil } - return v.Dekallm + return o.Decart } -func (v *VideoGenerationRequestOptions) GetEnfer() map[string]any { - if v == nil { +func (o *OptionsObj) GetDeepinfra() map[string]any { + if o == nil { return nil } - return v.Enfer + return o.Deepinfra } -func (v *VideoGenerationRequestOptions) GetFakeProvider() map[string]any { - if v == nil { +func (o *OptionsObj) GetDeepseek() map[string]any { + if o == nil { return nil } - return v.FakeProvider + return o.Deepseek } -func (v *VideoGenerationRequestOptions) GetFeatherless() map[string]any { - if v == nil { +func (o *OptionsObj) GetDekallm() map[string]any { + if o == nil { return nil } - return v.Featherless + return o.Dekallm } -func (v *VideoGenerationRequestOptions) GetFireworks() map[string]any { - if v == nil { +func (o *OptionsObj) GetDigitalocean() map[string]any { + if o == nil { return nil } - return v.Fireworks + return o.Digitalocean } -func (v *VideoGenerationRequestOptions) GetFriendli() map[string]any { - if v == nil { +func (o *OptionsObj) GetEnfer() map[string]any { + if o == nil { return nil } - return v.Friendli + return o.Enfer } -func (v *VideoGenerationRequestOptions) GetGmicloud() map[string]any { - if v == nil { +func (o *OptionsObj) GetFakeProvider() map[string]any { + if o == nil { return nil } - return v.Gmicloud + return o.FakeProvider } -func (v *VideoGenerationRequestOptions) GetGoogleAiStudio() map[string]any { - if v == nil { +func (o *OptionsObj) GetFeatherless() map[string]any { + if o == nil { return nil } - return v.GoogleAiStudio + return o.Featherless } -func (v *VideoGenerationRequestOptions) GetGoogleVertex() map[string]any { - if v == nil { +func (o *OptionsObj) GetFireworks() map[string]any { + if o == nil { return nil } - return v.GoogleVertex + return o.Fireworks } -func (v *VideoGenerationRequestOptions) GetGopomelo() map[string]any { - if v == nil { +func (o *OptionsObj) GetFriendli() map[string]any { + if o == nil { return nil } - return v.Gopomelo + return o.Friendli } -func (v *VideoGenerationRequestOptions) GetGroq() map[string]any { - if v == nil { +func (o *OptionsObj) GetGmicloud() map[string]any { + if o == nil { return nil } - return v.Groq + return o.Gmicloud } -func (v *VideoGenerationRequestOptions) GetHuggingface() map[string]any { - if v == nil { +func (o *OptionsObj) GetGoogleAiStudio() map[string]any { + if o == nil { return nil } - return v.Huggingface + return o.GoogleAiStudio } -func (v *VideoGenerationRequestOptions) GetHyperbolic() map[string]any { - if v == nil { +func (o *OptionsObj) GetGoogleVertex() map[string]any { + if o == nil { return nil } - return v.Hyperbolic + return o.GoogleVertex } -func (v *VideoGenerationRequestOptions) GetHyperbolicQuantized() map[string]any { - if v == nil { +func (o *OptionsObj) GetGopomelo() map[string]any { + if o == nil { return nil } - return v.HyperbolicQuantized + return o.Gopomelo } -func (v *VideoGenerationRequestOptions) GetInception() map[string]any { - if v == nil { +func (o *OptionsObj) GetGroq() map[string]any { + if o == nil { return nil } - return v.Inception + return o.Groq } -func (v *VideoGenerationRequestOptions) GetInceptron() map[string]any { - if v == nil { +func (o *OptionsObj) GetHuggingface() map[string]any { + if o == nil { return nil } - return v.Inceptron + return o.Huggingface } -func (v *VideoGenerationRequestOptions) GetInferenceNet() map[string]any { - if v == nil { +func (o *OptionsObj) GetHyperbolic() map[string]any { + if o == nil { return nil } - return v.InferenceNet + return o.Hyperbolic } -func (v *VideoGenerationRequestOptions) GetInfermatic() map[string]any { - if v == nil { +func (o *OptionsObj) GetHyperbolicQuantized() map[string]any { + if o == nil { return nil } - return v.Infermatic + return o.HyperbolicQuantized } -func (v *VideoGenerationRequestOptions) GetInflection() map[string]any { - if v == nil { +func (o *OptionsObj) GetInception() map[string]any { + if o == nil { return nil } - return v.Inflection + return o.Inception } -func (v *VideoGenerationRequestOptions) GetInocloud() map[string]any { - if v == nil { +func (o *OptionsObj) GetInceptron() map[string]any { + if o == nil { return nil } - return v.Inocloud + return o.Inceptron } -func (v *VideoGenerationRequestOptions) GetIoNet() map[string]any { - if v == nil { +func (o *OptionsObj) GetInferenceNet() map[string]any { + if o == nil { return nil } - return v.IoNet + return o.InferenceNet } -func (v *VideoGenerationRequestOptions) GetIonstream() map[string]any { - if v == nil { +func (o *OptionsObj) GetInfermatic() map[string]any { + if o == nil { return nil } - return v.Ionstream + return o.Infermatic } -func (v *VideoGenerationRequestOptions) GetKlusterai() map[string]any { - if v == nil { +func (o *OptionsObj) GetInflection() map[string]any { + if o == nil { return nil } - return v.Klusterai + return o.Inflection } -func (v *VideoGenerationRequestOptions) GetLambda() map[string]any { - if v == nil { +func (o *OptionsObj) GetInocloud() map[string]any { + if o == nil { return nil } - return v.Lambda + return o.Inocloud } -func (v *VideoGenerationRequestOptions) GetLepton() map[string]any { - if v == nil { +func (o *OptionsObj) GetIoNet() map[string]any { + if o == nil { return nil } - return v.Lepton + return o.IoNet } -func (v *VideoGenerationRequestOptions) GetLiquid() map[string]any { - if v == nil { +func (o *OptionsObj) GetIonstream() map[string]any { + if o == nil { return nil } - return v.Liquid + return o.Ionstream } -func (v *VideoGenerationRequestOptions) GetLynn() map[string]any { - if v == nil { +func (o *OptionsObj) GetKlusterai() map[string]any { + if o == nil { return nil } - return v.Lynn + return o.Klusterai } -func (v *VideoGenerationRequestOptions) GetLynnPrivate() map[string]any { - if v == nil { +func (o *OptionsObj) GetLambda() map[string]any { + if o == nil { return nil } - return v.LynnPrivate + return o.Lambda } -func (v *VideoGenerationRequestOptions) GetMancer() map[string]any { - if v == nil { +func (o *OptionsObj) GetLepton() map[string]any { + if o == nil { return nil } - return v.Mancer + return o.Lepton } -func (v *VideoGenerationRequestOptions) GetMancerOld() map[string]any { - if v == nil { +func (o *OptionsObj) GetLiquid() map[string]any { + if o == nil { return nil } - return v.MancerOld + return o.Liquid } -func (v *VideoGenerationRequestOptions) GetMara() map[string]any { - if v == nil { +func (o *OptionsObj) GetLynn() map[string]any { + if o == nil { return nil } - return v.Mara + return o.Lynn } -func (v *VideoGenerationRequestOptions) GetMeta() map[string]any { - if v == nil { +func (o *OptionsObj) GetLynnPrivate() map[string]any { + if o == nil { return nil } - return v.Meta + return o.LynnPrivate } -func (v *VideoGenerationRequestOptions) GetMinimax() map[string]any { - if v == nil { +func (o *OptionsObj) GetMancer() map[string]any { + if o == nil { return nil } - return v.Minimax + return o.Mancer } -func (v *VideoGenerationRequestOptions) GetMistral() map[string]any { - if v == nil { +func (o *OptionsObj) GetMancerOld() map[string]any { + if o == nil { return nil } - return v.Mistral + return o.MancerOld } -func (v *VideoGenerationRequestOptions) GetModal() map[string]any { - if v == nil { +func (o *OptionsObj) GetMara() map[string]any { + if o == nil { return nil } - return v.Modal + return o.Mara } -func (v *VideoGenerationRequestOptions) GetModelrun() map[string]any { - if v == nil { +func (o *OptionsObj) GetMeta() map[string]any { + if o == nil { return nil } - return v.Modelrun + return o.Meta } -func (v *VideoGenerationRequestOptions) GetModular() map[string]any { - if v == nil { +func (o *OptionsObj) GetMinimax() map[string]any { + if o == nil { return nil } - return v.Modular + return o.Minimax } -func (v *VideoGenerationRequestOptions) GetMoonshotai() map[string]any { - if v == nil { +func (o *OptionsObj) GetMistral() map[string]any { + if o == nil { return nil } - return v.Moonshotai + return o.Mistral } -func (v *VideoGenerationRequestOptions) GetMorph() map[string]any { - if v == nil { +func (o *OptionsObj) GetModal() map[string]any { + if o == nil { return nil } - return v.Morph + return o.Modal } -func (v *VideoGenerationRequestOptions) GetNcompass() map[string]any { - if v == nil { +func (o *OptionsObj) GetModelrun() map[string]any { + if o == nil { return nil } - return v.Ncompass + return o.Modelrun } -func (v *VideoGenerationRequestOptions) GetNebius() map[string]any { - if v == nil { +func (o *OptionsObj) GetModular() map[string]any { + if o == nil { return nil } - return v.Nebius + return o.Modular } -func (v *VideoGenerationRequestOptions) GetNextbit() map[string]any { - if v == nil { +func (o *OptionsObj) GetMoonshotai() map[string]any { + if o == nil { return nil } - return v.Nextbit + return o.Moonshotai } -func (v *VideoGenerationRequestOptions) GetNineteen() map[string]any { - if v == nil { +func (o *OptionsObj) GetMorph() map[string]any { + if o == nil { return nil } - return v.Nineteen + return o.Morph } -func (v *VideoGenerationRequestOptions) GetNovita() map[string]any { - if v == nil { +func (o *OptionsObj) GetNcompass() map[string]any { + if o == nil { return nil } - return v.Novita + return o.Ncompass } -func (v *VideoGenerationRequestOptions) GetNvidia() map[string]any { - if v == nil { +func (o *OptionsObj) GetNebius() map[string]any { + if o == nil { return nil } - return v.Nvidia + return o.Nebius } -func (v *VideoGenerationRequestOptions) GetOctoai() map[string]any { - if v == nil { +func (o *OptionsObj) GetNexAgi() map[string]any { + if o == nil { return nil } - return v.Octoai + return o.NexAgi } -func (v *VideoGenerationRequestOptions) GetOpenInference() map[string]any { - if v == nil { +func (o *OptionsObj) GetNextbit() map[string]any { + if o == nil { return nil } - return v.OpenInference + return o.Nextbit } -func (v *VideoGenerationRequestOptions) GetOpenai() map[string]any { - if v == nil { +func (o *OptionsObj) GetNineteen() map[string]any { + if o == nil { return nil } - return v.Openai + return o.Nineteen } -func (v *VideoGenerationRequestOptions) GetParasail() map[string]any { - if v == nil { +func (o *OptionsObj) GetNovita() map[string]any { + if o == nil { return nil } - return v.Parasail + return o.Novita } -func (v *VideoGenerationRequestOptions) GetPerplexity() map[string]any { - if v == nil { +func (o *OptionsObj) GetNvidia() map[string]any { + if o == nil { return nil } - return v.Perplexity + return o.Nvidia } -func (v *VideoGenerationRequestOptions) GetPhala() map[string]any { - if v == nil { +func (o *OptionsObj) GetOctoai() map[string]any { + if o == nil { return nil } - return v.Phala + return o.Octoai } -func (v *VideoGenerationRequestOptions) GetRecraft() map[string]any { - if v == nil { +func (o *OptionsObj) GetOpenInference() map[string]any { + if o == nil { return nil } - return v.Recraft + return o.OpenInference } -func (v *VideoGenerationRequestOptions) GetRecursal() map[string]any { - if v == nil { +func (o *OptionsObj) GetOpenai() map[string]any { + if o == nil { return nil } - return v.Recursal + return o.Openai } -func (v *VideoGenerationRequestOptions) GetReflection() map[string]any { - if v == nil { +func (o *OptionsObj) GetParasail() map[string]any { + if o == nil { return nil } - return v.Reflection + return o.Parasail } -func (v *VideoGenerationRequestOptions) GetReka() map[string]any { - if v == nil { +func (o *OptionsObj) GetPerceptron() map[string]any { + if o == nil { return nil } - return v.Reka + return o.Perceptron } -func (v *VideoGenerationRequestOptions) GetRelace() map[string]any { - if v == nil { +func (o *OptionsObj) GetPerplexity() map[string]any { + if o == nil { return nil } - return v.Relace + return o.Perplexity } -func (v *VideoGenerationRequestOptions) GetReplicate() map[string]any { - if v == nil { +func (o *OptionsObj) GetPhala() map[string]any { + if o == nil { return nil } - return v.Replicate + return o.Phala } -func (v *VideoGenerationRequestOptions) GetSambanova() map[string]any { - if v == nil { +func (o *OptionsObj) GetPoolside() map[string]any { + if o == nil { return nil } - return v.Sambanova + return o.Poolside } -func (v *VideoGenerationRequestOptions) GetSambanovaCloaked() map[string]any { - if v == nil { +func (o *OptionsObj) GetRecraft() map[string]any { + if o == nil { return nil } - return v.SambanovaCloaked + return o.Recraft } -func (v *VideoGenerationRequestOptions) GetSeed() map[string]any { - if v == nil { +func (o *OptionsObj) GetRecursal() map[string]any { + if o == nil { return nil } - return v.Seed + return o.Recursal } -func (v *VideoGenerationRequestOptions) GetSfCompute() map[string]any { - if v == nil { +func (o *OptionsObj) GetReflection() map[string]any { + if o == nil { return nil } - return v.SfCompute + return o.Reflection } -func (v *VideoGenerationRequestOptions) GetSiliconflow() map[string]any { - if v == nil { +func (o *OptionsObj) GetReka() map[string]any { + if o == nil { return nil } - return v.Siliconflow + return o.Reka } -func (v *VideoGenerationRequestOptions) GetSourceful() map[string]any { - if v == nil { +func (o *OptionsObj) GetRelace() map[string]any { + if o == nil { return nil } - return v.Sourceful + return o.Relace } -func (v *VideoGenerationRequestOptions) GetStealth() map[string]any { - if v == nil { +func (o *OptionsObj) GetReplicate() map[string]any { + if o == nil { return nil } - return v.Stealth + return o.Replicate } -func (v *VideoGenerationRequestOptions) GetStepfun() map[string]any { - if v == nil { +func (o *OptionsObj) GetSambanova() map[string]any { + if o == nil { return nil } - return v.Stepfun + return o.Sambanova } -func (v *VideoGenerationRequestOptions) GetStreamlake() map[string]any { - if v == nil { +func (o *OptionsObj) GetSambanovaCloaked() map[string]any { + if o == nil { return nil } - return v.Streamlake + return o.SambanovaCloaked } -func (v *VideoGenerationRequestOptions) GetSwitchpoint() map[string]any { - if v == nil { +func (o *OptionsObj) GetSeed() map[string]any { + if o == nil { return nil } - return v.Switchpoint + return o.Seed } -func (v *VideoGenerationRequestOptions) GetTargon() map[string]any { - if v == nil { +func (o *OptionsObj) GetSfCompute() map[string]any { + if o == nil { return nil } - return v.Targon + return o.SfCompute } -func (v *VideoGenerationRequestOptions) GetTogether() map[string]any { - if v == nil { +func (o *OptionsObj) GetSiliconflow() map[string]any { + if o == nil { return nil } - return v.Together + return o.Siliconflow } -func (v *VideoGenerationRequestOptions) GetTogetherLite() map[string]any { - if v == nil { +func (o *OptionsObj) GetSourceful() map[string]any { + if o == nil { return nil } - return v.TogetherLite + return o.Sourceful } -func (v *VideoGenerationRequestOptions) GetUbicloud() map[string]any { - if v == nil { +func (o *OptionsObj) GetStealth() map[string]any { + if o == nil { return nil } - return v.Ubicloud + return o.Stealth } -func (v *VideoGenerationRequestOptions) GetUpstage() map[string]any { - if v == nil { +func (o *OptionsObj) GetStepfun() map[string]any { + if o == nil { return nil } - return v.Upstage + return o.Stepfun } -func (v *VideoGenerationRequestOptions) GetVenice() map[string]any { - if v == nil { +func (o *OptionsObj) GetStreamlake() map[string]any { + if o == nil { return nil } - return v.Venice + return o.Streamlake } -func (v *VideoGenerationRequestOptions) GetWandb() map[string]any { - if v == nil { +func (o *OptionsObj) GetSwitchpoint() map[string]any { + if o == nil { return nil } - return v.Wandb + return o.Switchpoint } -func (v *VideoGenerationRequestOptions) GetXai() map[string]any { - if v == nil { +func (o *OptionsObj) GetTargon() map[string]any { + if o == nil { return nil } - return v.Xai + return o.Targon } -func (v *VideoGenerationRequestOptions) GetXiaomi() map[string]any { - if v == nil { +func (o *OptionsObj) GetTogether() map[string]any { + if o == nil { return nil } - return v.Xiaomi + return o.Together } -func (v *VideoGenerationRequestOptions) GetZAi() map[string]any { - if v == nil { +func (o *OptionsObj) GetTogetherLite() map[string]any { + if o == nil { return nil } - return v.ZAi + return o.TogetherLite +} + +func (o *OptionsObj) GetUbicloud() map[string]any { + if o == nil { + return nil + } + return o.Ubicloud +} + +func (o *OptionsObj) GetUpstage() map[string]any { + if o == nil { + return nil + } + return o.Upstage +} + +func (o *OptionsObj) GetVenice() map[string]any { + if o == nil { + return nil + } + return o.Venice +} + +func (o *OptionsObj) GetWafer() map[string]any { + if o == nil { + return nil + } + return o.Wafer +} + +func (o *OptionsObj) GetWandb() map[string]any { + if o == nil { + return nil + } + return o.Wandb +} + +func (o *OptionsObj) GetXai() map[string]any { + if o == nil { + return nil + } + return o.Xai +} + +func (o *OptionsObj) GetXiaomi() map[string]any { + if o == nil { + return nil + } + return o.Xiaomi +} + +func (o *OptionsObj) GetZAi() map[string]any { + if o == nil { + return nil + } + return o.ZAi } // VideoGenerationRequestProvider - Provider-specific passthrough configuration type VideoGenerationRequestProvider struct { - // Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body. - Options *VideoGenerationRequestOptions `json:"options,omitzero"` + Options *OptionsObj `json:"options,omitzero"` } func (v VideoGenerationRequestProvider) MarshalJSON() ([]byte, error) { @@ -922,7 +987,7 @@ func (v *VideoGenerationRequestProvider) UnmarshalJSON(data []byte) error { return nil } -func (v *VideoGenerationRequestProvider) GetOptions() *VideoGenerationRequestOptions { +func (v *VideoGenerationRequestProvider) GetOptions() *OptionsObj { if v == nil { return nil } @@ -959,16 +1024,18 @@ func (e *Resolution) IsExact() bool { type VideoGenerationRequest struct { // Aspect ratio of the generated video AspectRatio *AspectRatio `json:"aspect_ratio,omitzero"` + // URL to receive a webhook notification when the video generation job completes. Overrides the workspace-level default callback URL if set. Must be HTTPS. + CallbackURL *string `json:"callback_url,omitzero"` // Duration of the generated video in seconds Duration *int64 `json:"duration,omitzero"` // Images to use as the first and/or last frame of the generated video. Each image must specify a frame_type of first_frame or last_frame. FrameImages []FrameImage `json:"frame_images,omitzero"` // Whether to generate audio alongside the video. Defaults to the endpoint's generate_audio capability flag, false if not set. GenerateAudio *bool `json:"generate_audio,omitzero"` - // Reference images to guide video generation - InputReferences []ContentPartImage `json:"input_references,omitzero"` - Model string `json:"model"` - Prompt string `json:"prompt"` + // Reference assets to guide video generation. Accepts image, audio, and video references. Audio and video references are only honored by providers that support them (currently BytePlus Seedance 2.0); other providers use image references and ignore the rest. + InputReferences []InputReference `json:"input_references,omitzero"` + Model string `json:"model"` + Prompt string `json:"prompt"` // Provider-specific passthrough configuration Provider *VideoGenerationRequestProvider `json:"provider,omitzero"` // Resolution of the generated video @@ -997,6 +1064,13 @@ func (v *VideoGenerationRequest) GetAspectRatio() *AspectRatio { return v.AspectRatio } +func (v *VideoGenerationRequest) GetCallbackURL() *string { + if v == nil { + return nil + } + return v.CallbackURL +} + func (v *VideoGenerationRequest) GetDuration() *int64 { if v == nil { return nil @@ -1018,7 +1092,7 @@ func (v *VideoGenerationRequest) GetGenerateAudio() *bool { return v.GenerateAudio } -func (v *VideoGenerationRequest) GetInputReferences() []ContentPartImage { +func (v *VideoGenerationRequest) GetInputReferences() []InputReference { if v == nil { return nil } diff --git a/models/components/videomodel.go b/models/components/videomodel.go index 6e419072..56467fcb 100644 --- a/models/components/videomodel.go +++ b/models/components/videomodel.go @@ -15,6 +15,8 @@ const ( SupportedAspectRatioEleven SupportedAspectRatio = "1:1" SupportedAspectRatioFortyThree SupportedAspectRatio = "4:3" SupportedAspectRatioThirtyFour SupportedAspectRatio = "3:4" + SupportedAspectRatioThirtyTwo SupportedAspectRatio = "3:2" + SupportedAspectRatioTwentyThree SupportedAspectRatio = "2:3" SupportedAspectRatioTwoHundredAndNineteen SupportedAspectRatio = "21:9" SupportedAspectRatioNineHundredAndTwentyOne SupportedAspectRatio = "9:21" ) @@ -27,7 +29,7 @@ func (e SupportedAspectRatio) ToPointer() *SupportedAspectRatio { func (e *SupportedAspectRatio) IsExact() bool { if e != nil { switch *e { - case "16:9", "9:16", "1:1", "4:3", "3:4", "21:9", "9:21": + case "16:9", "9:16", "1:1", "4:3", "3:4", "3:2", "2:3", "21:9", "9:21": return true } } @@ -87,30 +89,38 @@ type SupportedSize string const ( SupportedSizeFourHundredAndEightyx480 SupportedSize = "480x480" SupportedSizeFourHundredAndEightyx640 SupportedSize = "480x640" + SupportedSizeFourHundredAndEightyx720 SupportedSize = "480x720" SupportedSizeFourHundredAndEightyx854 SupportedSize = "480x854" SupportedSizeFourHundredAndEightyx1120 SupportedSize = "480x1120" SupportedSizeSixHundredAndFortyx480 SupportedSize = "640x480" + SupportedSizeSevenHundredAndTwentyx480 SupportedSize = "720x480" SupportedSizeSevenHundredAndTwentyx720 SupportedSize = "720x720" SupportedSizeSevenHundredAndTwentyx960 SupportedSize = "720x960" + SupportedSizeSevenHundredAndTwentyx1080 SupportedSize = "720x1080" SupportedSizeSevenHundredAndTwentyx1280 SupportedSize = "720x1280" SupportedSizeSevenHundredAndTwentyx1680 SupportedSize = "720x1680" SupportedSizeEightHundredAndFiftyFourx480 SupportedSize = "854x480" SupportedSizeNineHundredAndSixtyx720 SupportedSize = "960x720" + SupportedSizeOneThousandAndEightyx720 SupportedSize = "1080x720" SupportedSizeOneThousandAndEightyx1080 SupportedSize = "1080x1080" SupportedSizeOneThousandAndEightyx1440 SupportedSize = "1080x1440" + SupportedSizeOneThousandAndEightyx1620 SupportedSize = "1080x1620" SupportedSizeOneThousandAndEightyx1920 SupportedSize = "1080x1920" SupportedSizeOneThousandAndEightyx2520 SupportedSize = "1080x2520" SupportedSizeOneThousandOneHundredAndTwentyx480 SupportedSize = "1120x480" SupportedSizeOneThousandTwoHundredAndEightyx720 SupportedSize = "1280x720" SupportedSizeOneThousandFourHundredAndFortyx1080 SupportedSize = "1440x1080" + SupportedSizeOneThousandSixHundredAndTwentyx1080 SupportedSize = "1620x1080" SupportedSizeOneThousandSixHundredAndEightyx720 SupportedSize = "1680x720" SupportedSizeOneThousandNineHundredAndTwentyx1080 SupportedSize = "1920x1080" SupportedSizeTwoThousandOneHundredAndSixtyx2160 SupportedSize = "2160x2160" SupportedSizeTwoThousandOneHundredAndSixtyx2880 SupportedSize = "2160x2880" + SupportedSizeTwoThousandOneHundredAndSixtyx3240 SupportedSize = "2160x3240" SupportedSizeTwoThousandOneHundredAndSixtyx3840 SupportedSize = "2160x3840" SupportedSizeTwoThousandOneHundredAndSixtyx5040 SupportedSize = "2160x5040" SupportedSizeTwoThousandFiveHundredAndTwentyx1080 SupportedSize = "2520x1080" SupportedSizeTwoThousandEightHundredAndEightyx2160 SupportedSize = "2880x2160" + SupportedSizeThreeThousandTwoHundredAndFortyx2160 SupportedSize = "3240x2160" SupportedSizeThreeThousandEightHundredAndFortyx2160 SupportedSize = "3840x2160" SupportedSizeFiveThousandAndFortyx2160 SupportedSize = "5040x2160" ) @@ -123,7 +133,7 @@ func (e SupportedSize) ToPointer() *SupportedSize { func (e *SupportedSize) IsExact() bool { if e != nil { switch *e { - case "480x480", "480x640", "480x854", "480x1120", "640x480", "720x720", "720x960", "720x1280", "720x1680", "854x480", "960x720", "1080x1080", "1080x1440", "1080x1920", "1080x2520", "1120x480", "1280x720", "1440x1080", "1680x720", "1920x1080", "2160x2160", "2160x2880", "2160x3840", "2160x5040", "2520x1080", "2880x2160", "3840x2160", "5040x2160": + case "480x480", "480x640", "480x720", "480x854", "480x1120", "640x480", "720x480", "720x720", "720x960", "720x1080", "720x1280", "720x1680", "854x480", "960x720", "1080x720", "1080x1080", "1080x1440", "1080x1620", "1080x1920", "1080x2520", "1120x480", "1280x720", "1440x1080", "1620x1080", "1680x720", "1920x1080", "2160x2160", "2160x2880", "2160x3240", "2160x3840", "2160x5040", "2520x1080", "2880x2160", "3240x2160", "3840x2160", "5040x2160": return true } } diff --git a/models/components/webfetchengineenum.go b/models/components/webfetchengineenum.go new file mode 100644 index 00000000..3250fe52 --- /dev/null +++ b/models/components/webfetchengineenum.go @@ -0,0 +1,30 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// WebFetchEngineEnum - Which fetch engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in fetch. "exa" uses Exa Contents API. "openrouter" uses direct HTTP fetch. "firecrawl" uses Firecrawl scrape (requires BYOK). "parallel" uses the Parallel extract API. +type WebFetchEngineEnum string + +const ( + WebFetchEngineEnumAuto WebFetchEngineEnum = "auto" + WebFetchEngineEnumNative WebFetchEngineEnum = "native" + WebFetchEngineEnumOpenrouter WebFetchEngineEnum = "openrouter" + WebFetchEngineEnumExa WebFetchEngineEnum = "exa" + WebFetchEngineEnumParallel WebFetchEngineEnum = "parallel" + WebFetchEngineEnumFirecrawl WebFetchEngineEnum = "firecrawl" +) + +func (e WebFetchEngineEnum) ToPointer() *WebFetchEngineEnum { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *WebFetchEngineEnum) IsExact() bool { + if e != nil { + switch *e { + case "auto", "native", "openrouter", "exa", "parallel", "firecrawl": + return true + } + } + return false +} diff --git a/models/components/webfetchplugin.go b/models/components/webfetchplugin.go new file mode 100644 index 00000000..3050eb7d --- /dev/null +++ b/models/components/webfetchplugin.go @@ -0,0 +1,90 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type WebFetchPluginID string + +const ( + WebFetchPluginIDWebFetch WebFetchPluginID = "web-fetch" +) + +func (e WebFetchPluginID) ToPointer() *WebFetchPluginID { + return &e +} +func (e *WebFetchPluginID) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "web-fetch": + *e = WebFetchPluginID(v) + return nil + default: + return fmt.Errorf("invalid value for WebFetchPluginID: %v", v) + } +} + +type WebFetchPlugin struct { + // Only fetch from these domains. + AllowedDomains []string `json:"allowed_domains,omitzero"` + // Never fetch from these domains. + BlockedDomains []string `json:"blocked_domains,omitzero"` + ID WebFetchPluginID `json:"id"` + // Maximum content length in approximate tokens. Content exceeding this limit is truncated. + MaxContentTokens *int64 `json:"max_content_tokens,omitzero"` + // Maximum number of web fetches per request. Once exceeded, the tool returns an error. + MaxUses *int64 `json:"max_uses,omitzero"` +} + +func (w WebFetchPlugin) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(w, "", false) +} + +func (w *WebFetchPlugin) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &w, "", false, nil); err != nil { + return err + } + return nil +} + +func (w *WebFetchPlugin) GetAllowedDomains() []string { + if w == nil { + return nil + } + return w.AllowedDomains +} + +func (w *WebFetchPlugin) GetBlockedDomains() []string { + if w == nil { + return nil + } + return w.BlockedDomains +} + +func (w *WebFetchPlugin) GetID() WebFetchPluginID { + if w == nil { + return WebFetchPluginID("") + } + return w.ID +} + +func (w *WebFetchPlugin) GetMaxContentTokens() *int64 { + if w == nil { + return nil + } + return w.MaxContentTokens +} + +func (w *WebFetchPlugin) GetMaxUses() *int64 { + if w == nil { + return nil + } + return w.MaxUses +} diff --git a/models/components/webfetchservertool.go b/models/components/webfetchservertool.go new file mode 100644 index 00000000..cf522f41 --- /dev/null +++ b/models/components/webfetchservertool.go @@ -0,0 +1,64 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type WebFetchServerToolType string + +const ( + WebFetchServerToolTypeOpenrouterWebFetch WebFetchServerToolType = "openrouter:web_fetch" +) + +func (e WebFetchServerToolType) ToPointer() *WebFetchServerToolType { + return &e +} +func (e *WebFetchServerToolType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "openrouter:web_fetch": + *e = WebFetchServerToolType(v) + return nil + default: + return fmt.Errorf("invalid value for WebFetchServerToolType: %v", v) + } +} + +// WebFetchServerTool - OpenRouter built-in server tool: fetches full content from a URL (web page or PDF) +type WebFetchServerTool struct { + // Configuration for the openrouter:web_fetch server tool + Parameters *WebFetchServerToolConfig `json:"parameters,omitzero"` + Type WebFetchServerToolType `json:"type"` +} + +func (w WebFetchServerTool) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(w, "", false) +} + +func (w *WebFetchServerTool) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &w, "", false, nil); err != nil { + return err + } + return nil +} + +func (w *WebFetchServerTool) GetParameters() *WebFetchServerToolConfig { + if w == nil { + return nil + } + return w.Parameters +} + +func (w *WebFetchServerTool) GetType() WebFetchServerToolType { + if w == nil { + return WebFetchServerToolType("") + } + return w.Type +} diff --git a/models/components/webfetchservertoolconfig.go b/models/components/webfetchservertoolconfig.go new file mode 100644 index 00000000..cedce543 --- /dev/null +++ b/models/components/webfetchservertoolconfig.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// WebFetchServerToolConfig - Configuration for the openrouter:web_fetch server tool +type WebFetchServerToolConfig struct { + // Only fetch from these domains. + AllowedDomains []string `json:"allowed_domains,omitzero"` + // Never fetch from these domains. + BlockedDomains []string `json:"blocked_domains,omitzero"` + // Which fetch engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in fetch. "exa" uses Exa Contents API. "openrouter" uses direct HTTP fetch. "firecrawl" uses Firecrawl scrape (requires BYOK). "parallel" uses the Parallel extract API. + Engine *WebFetchEngineEnum `json:"engine,omitzero"` + // Maximum content length in approximate tokens. Content exceeding this limit is truncated. + MaxContentTokens *int64 `json:"max_content_tokens,omitzero"` + // Maximum number of web fetches per request. Once exceeded, the tool returns an error. + MaxUses *int64 `json:"max_uses,omitzero"` +} + +func (w WebFetchServerToolConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(w, "", false) +} + +func (w *WebFetchServerToolConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &w, "", false, nil); err != nil { + return err + } + return nil +} + +func (w *WebFetchServerToolConfig) GetAllowedDomains() []string { + if w == nil { + return nil + } + return w.AllowedDomains +} + +func (w *WebFetchServerToolConfig) GetBlockedDomains() []string { + if w == nil { + return nil + } + return w.BlockedDomains +} + +func (w *WebFetchServerToolConfig) GetEngine() *WebFetchEngineEnum { + if w == nil { + return nil + } + return w.Engine +} + +func (w *WebFetchServerToolConfig) GetMaxContentTokens() *int64 { + if w == nil { + return nil + } + return w.MaxContentTokens +} + +func (w *WebFetchServerToolConfig) GetMaxUses() *int64 { + if w == nil { + return nil + } + return w.MaxUses +} diff --git a/models/components/websearchconfig.go b/models/components/websearchconfig.go index 590b815e..333e61f1 100644 --- a/models/components/websearchconfig.go +++ b/models/components/websearchconfig.go @@ -7,17 +7,19 @@ import ( ) type WebSearchConfig struct { - // Limit search results to these domains. Supported by Exa, Parallel, and most native providers (Anthropic, OpenAI, xAI). Not supported with Firecrawl or Perplexity. + // Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI, xAI). Cannot be used with excluded_domains. AllowedDomains []string `json:"allowed_domains,omitzero"` - // Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. + // Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). Engine *WebSearchEngineEnum `json:"engine,omitzero"` - // Exclude search results from these domains. Supported by Exa, Parallel, Anthropic, and xAI. Not supported with Firecrawl, OpenAI (silently ignored), or Perplexity. + // Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, and xAI. Not supported with OpenAI (silently ignored). Cannot be used with allowed_domains. ExcludedDomains []string `json:"excluded_domains,omitzero"` - // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and Parallel engines; ignored with native provider search. + // Exact maximum number of characters of content per search result. Applies to the Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, caps highlight content per result. For Parallel, caps excerpt content per result (default 1,500 when omitted). For Perplexity, maps to the native `max_tokens_per_page` parameter (converted from characters to tokens) and trims the response to the exact character cap. When both `max_characters` and `search_context_size` are set, `max_characters` takes precedence. When omitted, falls back to `search_context_size` mapping (Exa) or engine defaults (Parallel, Perplexity). + MaxCharacters *int64 `json:"max_characters,omitzero"` + // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. MaxResults *int64 `json:"max_results,omitzero"` - // Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. + // Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. Defaults to 50 when not specified. MaxTotalResults *int64 `json:"max_total_results,omitzero"` - // How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search. + // How much context to retrieve per result. Applies to Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, pins a fixed per-result character cap (low=5,000, medium=15,000, high=30,000); when omitted, Exa picks an adaptive size per query and document (typically ~2,000–4,000 characters per result). For Parallel, controls the total characters across all results; when omitted, Parallel uses its own default size. For Perplexity, maps directly to the Search API's native search_context_size parameter. Overridden by `max_characters` when both are set. SearchContextSize *SearchQualityLevel `json:"search_context_size,omitzero"` // Approximate user location for location-biased results. UserLocation *WebSearchUserLocationServerTool `json:"user_location,omitzero"` @@ -55,6 +57,13 @@ func (w *WebSearchConfig) GetExcludedDomains() []string { return w.ExcludedDomains } +func (w *WebSearchConfig) GetMaxCharacters() *int64 { + if w == nil { + return nil + } + return w.MaxCharacters +} + func (w *WebSearchConfig) GetMaxResults() *int64 { if w == nil { return nil diff --git a/models/components/websearchengine.go b/models/components/websearchengine.go index 06c08605..0ab31cd5 100644 --- a/models/components/websearchengine.go +++ b/models/components/websearchengine.go @@ -6,10 +6,11 @@ package components type WebSearchEngine string const ( - WebSearchEngineNative WebSearchEngine = "native" - WebSearchEngineExa WebSearchEngine = "exa" - WebSearchEngineFirecrawl WebSearchEngine = "firecrawl" - WebSearchEngineParallel WebSearchEngine = "parallel" + WebSearchEngineNative WebSearchEngine = "native" + WebSearchEngineExa WebSearchEngine = "exa" + WebSearchEngineFirecrawl WebSearchEngine = "firecrawl" + WebSearchEngineParallel WebSearchEngine = "parallel" + WebSearchEnginePerplexity WebSearchEngine = "perplexity" ) func (e WebSearchEngine) ToPointer() *WebSearchEngine { @@ -20,7 +21,7 @@ func (e WebSearchEngine) ToPointer() *WebSearchEngine { func (e *WebSearchEngine) IsExact() bool { if e != nil { switch *e { - case "native", "exa", "firecrawl", "parallel": + case "native", "exa", "firecrawl", "parallel", "perplexity": return true } } diff --git a/models/components/websearchengineenum.go b/models/components/websearchengineenum.go index 70ed40d2..3e1a8790 100644 --- a/models/components/websearchengineenum.go +++ b/models/components/websearchengineenum.go @@ -2,15 +2,16 @@ package components -// WebSearchEngineEnum - Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. +// WebSearchEngineEnum - Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). type WebSearchEngineEnum string const ( - WebSearchEngineEnumAuto WebSearchEngineEnum = "auto" - WebSearchEngineEnumNative WebSearchEngineEnum = "native" - WebSearchEngineEnumExa WebSearchEngineEnum = "exa" - WebSearchEngineEnumFirecrawl WebSearchEngineEnum = "firecrawl" - WebSearchEngineEnumParallel WebSearchEngineEnum = "parallel" + WebSearchEngineEnumNative WebSearchEngineEnum = "native" + WebSearchEngineEnumExa WebSearchEngineEnum = "exa" + WebSearchEngineEnumParallel WebSearchEngineEnum = "parallel" + WebSearchEngineEnumFirecrawl WebSearchEngineEnum = "firecrawl" + WebSearchEngineEnumPerplexity WebSearchEngineEnum = "perplexity" + WebSearchEngineEnumAuto WebSearchEngineEnum = "auto" ) func (e WebSearchEngineEnum) ToPointer() *WebSearchEngineEnum { @@ -21,7 +22,7 @@ func (e WebSearchEngineEnum) ToPointer() *WebSearchEngineEnum { func (e *WebSearchEngineEnum) IsExact() bool { if e != nil { switch *e { - case "auto", "native", "exa", "firecrawl", "parallel": + case "native", "exa", "parallel", "firecrawl", "perplexity", "auto": return true } } diff --git a/models/components/websearchplugin.go b/models/components/websearchplugin.go index ccf8a5db..57d22b29 100644 --- a/models/components/websearchplugin.go +++ b/models/components/websearchplugin.go @@ -6,6 +6,7 @@ import ( "encoding/json" "fmt" "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" ) type WebSearchPluginID string @@ -31,6 +32,84 @@ func (e *WebSearchPluginID) UnmarshalJSON(data []byte) error { } } +type WebSearchPluginType string + +const ( + WebSearchPluginTypeApproximate WebSearchPluginType = "approximate" +) + +func (e WebSearchPluginType) ToPointer() *WebSearchPluginType { + return &e +} +func (e *WebSearchPluginType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "approximate": + *e = WebSearchPluginType(v) + return nil + default: + return fmt.Errorf("invalid value for WebSearchPluginType: %v", v) + } +} + +// UserLocation - Approximate user location for location-biased search results. Passed through to native providers that support it (e.g. Anthropic). +type UserLocation struct { + City optionalnullable.OptionalNullable[string] `json:"city,omitzero"` + Country optionalnullable.OptionalNullable[string] `json:"country,omitzero"` + Region optionalnullable.OptionalNullable[string] `json:"region,omitzero"` + Timezone optionalnullable.OptionalNullable[string] `json:"timezone,omitzero"` + Type WebSearchPluginType `json:"type"` +} + +func (u UserLocation) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *UserLocation) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, nil); err != nil { + return err + } + return nil +} + +func (u *UserLocation) GetCity() optionalnullable.OptionalNullable[string] { + if u == nil { + return nil + } + return u.City +} + +func (u *UserLocation) GetCountry() optionalnullable.OptionalNullable[string] { + if u == nil { + return nil + } + return u.Country +} + +func (u *UserLocation) GetRegion() optionalnullable.OptionalNullable[string] { + if u == nil { + return nil + } + return u.Region +} + +func (u *UserLocation) GetTimezone() optionalnullable.OptionalNullable[string] { + if u == nil { + return nil + } + return u.Timezone +} + +func (u *UserLocation) GetType() WebSearchPluginType { + if u == nil { + return WebSearchPluginType("") + } + return u.Type +} + type WebSearchPlugin struct { // Set to false to disable the web-search plugin for this request. Defaults to true. Enabled *bool `json:"enabled,omitzero"` @@ -42,7 +121,10 @@ type WebSearchPlugin struct { // A list of domains to restrict web search results to. Supports wildcards (e.g. "*.substack.com") and path filtering (e.g. "openai.com/blog"). IncludeDomains []string `json:"include_domains,omitzero"` MaxResults *int64 `json:"max_results,omitzero"` - SearchPrompt *string `json:"search_prompt,omitzero"` + // Maximum number of times the model can invoke web search in a single turn. Passed through to native providers that support it (e.g. Anthropic). + MaxUses *int64 `json:"max_uses,omitzero"` + SearchPrompt *string `json:"search_prompt,omitzero"` + UserLocation optionalnullable.OptionalNullable[UserLocation] `json:"user_location,omitzero"` } func (w WebSearchPlugin) MarshalJSON() ([]byte, error) { @@ -98,9 +180,23 @@ func (w *WebSearchPlugin) GetMaxResults() *int64 { return w.MaxResults } +func (w *WebSearchPlugin) GetMaxUses() *int64 { + if w == nil { + return nil + } + return w.MaxUses +} + func (w *WebSearchPlugin) GetSearchPrompt() *string { if w == nil { return nil } return w.SearchPrompt } + +func (w *WebSearchPlugin) GetUserLocation() optionalnullable.OptionalNullable[UserLocation] { + if w == nil { + return nil + } + return w.UserLocation +} diff --git a/models/components/websearchservertool.go b/models/components/websearchservertool.go index 6867e3ac..566ec60c 100644 --- a/models/components/websearchservertool.go +++ b/models/components/websearchservertool.go @@ -34,10 +34,10 @@ func (e *WebSearchServerToolType) UnmarshalJSON(data []byte) error { // WebSearchServerTool - Web search tool configuration (2025-08-26 version) type WebSearchServerTool struct { - // Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. + // Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). Engine *WebSearchEngineEnum `json:"engine,omitzero"` Filters optionalnullable.OptionalNullable[WebSearchDomainFilter] `json:"filters,omitzero"` - // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and Parallel engines; ignored with native provider search. + // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. MaxResults *int64 `json:"max_results,omitzero"` // Size of the search context for web search tools SearchContextSize *SearchContextSizeEnum `json:"search_context_size,omitzero"` diff --git a/models/components/websearchservertoolconfig.go b/models/components/websearchservertoolconfig.go new file mode 100644 index 00000000..95cb53ce --- /dev/null +++ b/models/components/websearchservertoolconfig.go @@ -0,0 +1,94 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// WebSearchServerToolConfig - Configuration for the openrouter:web_search server tool +type WebSearchServerToolConfig struct { + // Limit search results to these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, and most native providers (Anthropic, OpenAI, xAI). Cannot be used with excluded_domains. + AllowedDomains []string `json:"allowed_domains,omitzero"` + // Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires BYOK). "parallel" uses the Parallel search API. "perplexity" uses the Perplexity Search API (raw ranked results). + Engine *WebSearchEngineEnum `json:"engine,omitzero"` + // Exclude search results from these domains. Supported by Exa, Firecrawl, Parallel, Perplexity, Anthropic, and xAI. Not supported with OpenAI (silently ignored). Cannot be used with allowed_domains. + ExcludedDomains []string `json:"excluded_domains,omitzero"` + // Exact maximum number of characters of content per search result. Applies to the Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, caps highlight content per result. For Parallel, caps excerpt content per result (default 1,500 when omitted). For Perplexity, maps to the native `max_tokens_per_page` parameter (converted from characters to tokens) and trims the response to the exact character cap. When both `max_characters` and `search_context_size` are set, `max_characters` takes precedence. When omitted, falls back to `search_context_size` mapping (Exa) or engine defaults (Parallel, Perplexity). + MaxCharacters *int64 `json:"max_characters,omitzero"` + // Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. + MaxResults *int64 `json:"max_results,omitzero"` + // Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. Defaults to 50 when not specified. + MaxTotalResults *int64 `json:"max_total_results,omitzero"` + // How much context to retrieve per result. Applies to Exa, Parallel, and Perplexity engines; ignored with native provider search and Firecrawl. For Exa, pins a fixed per-result character cap (low=5,000, medium=15,000, high=30,000); when omitted, Exa picks an adaptive size per query and document (typically ~2,000–4,000 characters per result). For Parallel, controls the total characters across all results; when omitted, Parallel uses its own default size. For Perplexity, maps directly to the Search API's native search_context_size parameter. Overridden by `max_characters` when both are set. + SearchContextSize *SearchQualityLevel `json:"search_context_size,omitzero"` + // Approximate user location for location-biased results. + UserLocation *WebSearchUserLocationServerTool `json:"user_location,omitzero"` +} + +func (w WebSearchServerToolConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(w, "", false) +} + +func (w *WebSearchServerToolConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &w, "", false, nil); err != nil { + return err + } + return nil +} + +func (w *WebSearchServerToolConfig) GetAllowedDomains() []string { + if w == nil { + return nil + } + return w.AllowedDomains +} + +func (w *WebSearchServerToolConfig) GetEngine() *WebSearchEngineEnum { + if w == nil { + return nil + } + return w.Engine +} + +func (w *WebSearchServerToolConfig) GetExcludedDomains() []string { + if w == nil { + return nil + } + return w.ExcludedDomains +} + +func (w *WebSearchServerToolConfig) GetMaxCharacters() *int64 { + if w == nil { + return nil + } + return w.MaxCharacters +} + +func (w *WebSearchServerToolConfig) GetMaxResults() *int64 { + if w == nil { + return nil + } + return w.MaxResults +} + +func (w *WebSearchServerToolConfig) GetMaxTotalResults() *int64 { + if w == nil { + return nil + } + return w.MaxTotalResults +} + +func (w *WebSearchServerToolConfig) GetSearchContextSize() *SearchQualityLevel { + if w == nil { + return nil + } + return w.SearchContextSize +} + +func (w *WebSearchServerToolConfig) GetUserLocation() *WebSearchUserLocationServerTool { + if w == nil { + return nil + } + return w.UserLocation +} diff --git a/models/components/websearchservertoolopenrouter.go b/models/components/websearchservertoolopenrouter.go index 6563f525..399930db 100644 --- a/models/components/websearchservertoolopenrouter.go +++ b/models/components/websearchservertoolopenrouter.go @@ -8,38 +8,6 @@ import ( "github.com/OpenRouterTeam/go-sdk/internal/utils" ) -type Parameters struct { - // Maximum number of search results to return per search call. Defaults to 5. - MaxResults *int64 `json:"max_results,omitzero"` - // Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. - MaxTotalResults *int64 `json:"max_total_results,omitzero"` -} - -func (p Parameters) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *Parameters) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { - return err - } - return nil -} - -func (p *Parameters) GetMaxResults() *int64 { - if p == nil { - return nil - } - return p.MaxResults -} - -func (p *Parameters) GetMaxTotalResults() *int64 { - if p == nil { - return nil - } - return p.MaxTotalResults -} - type WebSearchServerToolOpenRouterType string const ( @@ -65,7 +33,8 @@ func (e *WebSearchServerToolOpenRouterType) UnmarshalJSON(data []byte) error { // WebSearchServerToolOpenRouter - OpenRouter built-in server tool: searches the web for current information type WebSearchServerToolOpenRouter struct { - Parameters *Parameters `json:"parameters,omitzero"` + // Configuration for the openrouter:web_search server tool + Parameters *WebSearchServerToolConfig `json:"parameters,omitzero"` Type WebSearchServerToolOpenRouterType `json:"type"` } @@ -80,7 +49,7 @@ func (w *WebSearchServerToolOpenRouter) UnmarshalJSON(data []byte) error { return nil } -func (w *WebSearchServerToolOpenRouter) GetParameters() *Parameters { +func (w *WebSearchServerToolOpenRouter) GetParameters() *WebSearchServerToolConfig { if w == nil { return nil } diff --git a/models/components/websearchuserlocationservertool.go b/models/components/websearchuserlocationservertool.go index 6417cc48..21c0dbc5 100644 --- a/models/components/websearchuserlocationservertool.go +++ b/models/components/websearchuserlocationservertool.go @@ -6,6 +6,7 @@ import ( "encoding/json" "fmt" "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" ) type WebSearchUserLocationServerToolType string @@ -33,11 +34,11 @@ func (e *WebSearchUserLocationServerToolType) UnmarshalJSON(data []byte) error { // WebSearchUserLocationServerTool - Approximate user location for location-biased results. type WebSearchUserLocationServerTool struct { - City *string `json:"city,omitzero"` - Country *string `json:"country,omitzero"` - Region *string `json:"region,omitzero"` - Timezone *string `json:"timezone,omitzero"` - Type *WebSearchUserLocationServerToolType `json:"type,omitzero"` + City optionalnullable.OptionalNullable[string] `json:"city,omitzero"` + Country optionalnullable.OptionalNullable[string] `json:"country,omitzero"` + Region optionalnullable.OptionalNullable[string] `json:"region,omitzero"` + Timezone optionalnullable.OptionalNullable[string] `json:"timezone,omitzero"` + Type *WebSearchUserLocationServerToolType `json:"type,omitzero"` } func (w WebSearchUserLocationServerTool) MarshalJSON() ([]byte, error) { @@ -51,28 +52,28 @@ func (w *WebSearchUserLocationServerTool) UnmarshalJSON(data []byte) error { return nil } -func (w *WebSearchUserLocationServerTool) GetCity() *string { +func (w *WebSearchUserLocationServerTool) GetCity() optionalnullable.OptionalNullable[string] { if w == nil { return nil } return w.City } -func (w *WebSearchUserLocationServerTool) GetCountry() *string { +func (w *WebSearchUserLocationServerTool) GetCountry() optionalnullable.OptionalNullable[string] { if w == nil { return nil } return w.Country } -func (w *WebSearchUserLocationServerTool) GetRegion() *string { +func (w *WebSearchUserLocationServerTool) GetRegion() optionalnullable.OptionalNullable[string] { if w == nil { return nil } return w.Region } -func (w *WebSearchUserLocationServerTool) GetTimezone() *string { +func (w *WebSearchUserLocationServerTool) GetTimezone() optionalnullable.OptionalNullable[string] { if w == nil { return nil } diff --git a/models/components/workspace.go b/models/components/workspace.go index 1eefa80d..8044ae44 100644 --- a/models/components/workspace.go +++ b/models/components/workspace.go @@ -17,6 +17,10 @@ type Workspace struct { Description *string `json:"description"` // Unique identifier for the workspace ID string `json:"id"` + // Optional array of API key IDs to filter I/O logging. Null means all keys are logged. + IoLoggingAPIKeyIds []int64 `json:"io_logging_api_key_ids"` + // Sampling rate for I/O logging (0.0001-1). 1 means 100% of requests are logged. + IoLoggingSamplingRate float64 `json:"io_logging_sampling_rate"` // Whether data discount logging is enabled for this workspace IsDataDiscountLoggingEnabled bool `json:"is_data_discount_logging_enabled"` // Whether broadcast is enabled for this workspace @@ -80,6 +84,20 @@ func (w *Workspace) GetID() string { return w.ID } +func (w *Workspace) GetIoLoggingAPIKeyIds() []int64 { + if w == nil { + return nil + } + return w.IoLoggingAPIKeyIds +} + +func (w *Workspace) GetIoLoggingSamplingRate() float64 { + if w == nil { + return 0.0 + } + return w.IoLoggingSamplingRate +} + func (w *Workspace) GetIsDataDiscountLoggingEnabled() bool { if w == nil { return false diff --git a/models/operations/createauthkeyscode.go b/models/operations/createauthkeyscode.go index 9db75bea..cac06619 100644 --- a/models/operations/createauthkeyscode.go +++ b/models/operations/createauthkeyscode.go @@ -56,7 +56,7 @@ func (e *UsageLimitType) IsExact() bool { } type CreateAuthKeysCodeRequest struct { - // The callback URL to redirect to after authorization. Note, only https URLs on ports 443 and 3000 are allowed. + // The callback URL to redirect to after authorization. Supports https URLs and localhost/127.0.0.1 URLs on any port for local CLI tools. CallbackURL string `json:"callback_url"` // PKCE code challenge for enhanced security CodeChallenge *string `json:"code_challenge,omitzero"` @@ -70,6 +70,8 @@ type CreateAuthKeysCodeRequest struct { Limit *float64 `json:"limit,omitzero"` // Optional credit limit reset interval. When set, the credit limit resets on this interval. UsageLimitType *UsageLimitType `json:"usage_limit_type,omitzero"` + // Optional workspace ID to associate the API key with + WorkspaceID *string `json:"workspace_id,omitzero"` } func (c CreateAuthKeysCodeRequest) MarshalJSON() ([]byte, error) { @@ -132,6 +134,13 @@ func (c *CreateAuthKeysCodeRequest) GetUsageLimitType() *UsageLimitType { return c.UsageLimitType } +func (c *CreateAuthKeysCodeRequest) GetWorkspaceID() *string { + if c == nil { + return nil + } + return c.WorkspaceID +} + // CreateAuthKeysCodeData - Auth code data type CreateAuthKeysCodeData struct { // The application ID associated with this auth code diff --git a/models/operations/createembeddings.go b/models/operations/createembeddings.go index e211e6e6..b652c506 100644 --- a/models/operations/createembeddings.go +++ b/models/operations/createembeddings.go @@ -165,13 +165,19 @@ func (c *ContentText) GetType() TypeText { type ContentType string const ( - ContentTypeText ContentType = "text" - ContentTypeImageURL ContentType = "image_url" + ContentTypeText ContentType = "text" + ContentTypeImageURL ContentType = "image_url" + ContentTypeInputAudio ContentType = "input_audio" + ContentTypeInputVideo ContentType = "input_video" + ContentTypeInputFile ContentType = "input_file" ) type Content struct { - ContentText *ContentText `queryParam:"inline" union:"member"` - ContentImageURL *ContentImageURL `queryParam:"inline" union:"member"` + ContentText *ContentText `queryParam:"inline" union:"member"` + ContentImageURL *ContentImageURL `queryParam:"inline" union:"member"` + ContentPartInputAudio *components.ContentPartInputAudio `queryParam:"inline" union:"member"` + ContentPartInputVideo *components.ContentPartInputVideo `queryParam:"inline" union:"member"` + ContentPartInputFile *components.ContentPartInputFile `queryParam:"inline" union:"member"` Type ContentType } @@ -200,6 +206,42 @@ func CreateContentImageURL(imageURL ContentImageURL) Content { } } +func CreateContentInputAudio(inputAudio components.ContentPartInputAudio) Content { + typ := ContentTypeInputAudio + + typStr := components.ContentPartInputAudioType(typ) + inputAudio.Type = typStr + + return Content{ + ContentPartInputAudio: &inputAudio, + Type: typ, + } +} + +func CreateContentInputVideo(inputVideo components.ContentPartInputVideo) Content { + typ := ContentTypeInputVideo + + typStr := components.ContentPartInputVideoType(typ) + inputVideo.Type = typStr + + return Content{ + ContentPartInputVideo: &inputVideo, + Type: typ, + } +} + +func CreateContentInputFile(inputFile components.ContentPartInputFile) Content { + typ := ContentTypeInputFile + + typStr := components.ContentPartInputFileType(typ) + inputFile.Type = typStr + + return Content{ + ContentPartInputFile: &inputFile, + Type: typ, + } +} + func (u *Content) UnmarshalJSON(data []byte) error { type discriminator struct { @@ -230,6 +272,33 @@ func (u *Content) UnmarshalJSON(data []byte) error { u.ContentImageURL = contentImageURL u.Type = ContentTypeImageURL return nil + case "input_audio": + contentPartInputAudio := new(components.ContentPartInputAudio) + if err := utils.UnmarshalJSON(data, &contentPartInputAudio, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == input_audio) type components.ContentPartInputAudio within Content: %w", string(data), err) + } + + u.ContentPartInputAudio = contentPartInputAudio + u.Type = ContentTypeInputAudio + return nil + case "input_video": + contentPartInputVideo := new(components.ContentPartInputVideo) + if err := utils.UnmarshalJSON(data, &contentPartInputVideo, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == input_video) type components.ContentPartInputVideo within Content: %w", string(data), err) + } + + u.ContentPartInputVideo = contentPartInputVideo + u.Type = ContentTypeInputVideo + return nil + case "input_file": + contentPartInputFile := new(components.ContentPartInputFile) + if err := utils.UnmarshalJSON(data, &contentPartInputFile, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == input_file) type components.ContentPartInputFile within Content: %w", string(data), err) + } + + u.ContentPartInputFile = contentPartInputFile + u.Type = ContentTypeInputFile + return nil } return fmt.Errorf("could not unmarshal `%s` into any supported union types for Content", string(data)) @@ -244,6 +313,18 @@ func (u Content) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.ContentImageURL, "", true) } + if u.ContentPartInputAudio != nil { + return utils.MarshalJSON(u.ContentPartInputAudio, "", true) + } + + if u.ContentPartInputVideo != nil { + return utils.MarshalJSON(u.ContentPartInputVideo, "", true) + } + + if u.ContentPartInputFile != nil { + return utils.MarshalJSON(u.ContentPartInputFile, "", true) + } + return nil, errors.New("could not marshal union type Content: all fields are null") } @@ -684,6 +765,8 @@ func (e *Object) UnmarshalJSON(data []byte) error { type PromptTokensDetails struct { // Number of audio tokens in the input AudioTokens *int64 `json:"audio_tokens,omitzero"` + // Number of file/document tokens in the input + FileTokens *int64 `json:"file_tokens,omitzero"` // Number of image tokens in the input ImageTokens *int64 `json:"image_tokens,omitzero"` // Number of text tokens in the input @@ -699,6 +782,13 @@ func (p *PromptTokensDetails) GetAudioTokens() *int64 { return p.AudioTokens } +func (p *PromptTokensDetails) GetFileTokens() *int64 { + if p == nil { + return nil + } + return p.FileTokens +} + func (p *PromptTokensDetails) GetImageTokens() *int64 { if p == nil { return nil diff --git a/models/operations/createpresetschatcompletions.go b/models/operations/createpresetschatcompletions.go new file mode 100644 index 00000000..213022a8 --- /dev/null +++ b/models/operations/createpresetschatcompletions.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +type CreatePresetsChatCompletionsRequest struct { + // URL-safe slug identifying the preset. Created if it does not exist. + Slug string `pathParam:"style=simple,explode=false,name=slug"` + ChatRequest components.ChatRequest `request:"mediaType=application/json"` +} + +func (c *CreatePresetsChatCompletionsRequest) GetSlug() string { + if c == nil { + return "" + } + return c.Slug +} + +func (c *CreatePresetsChatCompletionsRequest) GetChatRequest() components.ChatRequest { + if c == nil { + return components.ChatRequest{} + } + return c.ChatRequest +} diff --git a/models/operations/createpresetsmessages.go b/models/operations/createpresetsmessages.go new file mode 100644 index 00000000..d243032f --- /dev/null +++ b/models/operations/createpresetsmessages.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +type CreatePresetsMessagesRequest struct { + // URL-safe slug identifying the preset. Created if it does not exist. + Slug string `pathParam:"style=simple,explode=false,name=slug"` + MessagesRequest components.MessagesRequest `request:"mediaType=application/json"` +} + +func (c *CreatePresetsMessagesRequest) GetSlug() string { + if c == nil { + return "" + } + return c.Slug +} + +func (c *CreatePresetsMessagesRequest) GetMessagesRequest() components.MessagesRequest { + if c == nil { + return components.MessagesRequest{} + } + return c.MessagesRequest +} diff --git a/models/operations/createpresetsresponses.go b/models/operations/createpresetsresponses.go new file mode 100644 index 00000000..1c31733f --- /dev/null +++ b/models/operations/createpresetsresponses.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +type CreatePresetsResponsesRequest struct { + // URL-safe slug identifying the preset. Created if it does not exist. + Slug string `pathParam:"style=simple,explode=false,name=slug"` + ResponsesRequest components.ResponsesRequest `request:"mediaType=application/json"` +} + +func (c *CreatePresetsResponsesRequest) GetSlug() string { + if c == nil { + return "" + } + return c.Slug +} + +func (c *CreatePresetsResponsesRequest) GetResponsesRequest() components.ResponsesRequest { + if c == nil { + return components.ResponsesRequest{} + } + return c.ResponsesRequest +} diff --git a/models/operations/creatererank.go b/models/operations/creatererank.go index ae60dca1..fdd9b9bb 100644 --- a/models/operations/creatererank.go +++ b/models/operations/creatererank.go @@ -10,10 +10,133 @@ import ( "github.com/OpenRouterTeam/go-sdk/optionalnullable" ) +// DocumentRequest - A structured document with optional text and/or image content. At least one of `text` or `image` must be provided. +type DocumentRequest struct { + // An image associated with the document, as a remote URL (http/https) or a base64-encoded data URI (data:image/...). + Image *string `json:"image,omitzero"` + // The document text + Text *string `json:"text,omitzero"` +} + +func (d DocumentRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DocumentRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DocumentRequest) GetImage() *string { + if d == nil { + return nil + } + return d.Image +} + +func (d *DocumentRequest) GetText() *string { + if d == nil { + return nil + } + return d.Text +} + +type DocumentType string + +const ( + DocumentTypeStr DocumentType = "str" + DocumentTypeDocumentRequest DocumentType = "document_request" +) + +// Document - A document to rerank. Either a plain string, or a structured object with optional `text` and/or `image`. +type Document struct { + Str *string `queryParam:"inline" union:"member"` + DocumentRequest *DocumentRequest `queryParam:"inline" union:"member"` + + Type DocumentType +} + +func CreateDocumentStr(str string) Document { + typ := DocumentTypeStr + + return Document{ + Str: &str, + Type: typ, + } +} + +func CreateDocumentDocumentRequest(documentRequest DocumentRequest) Document { + typ := DocumentTypeDocumentRequest + + return Document{ + DocumentRequest: &documentRequest, + Type: typ, + } +} + +func (u *Document) UnmarshalJSON(data []byte) error { + + var candidates []utils.UnionCandidate + + // Collect all valid candidates + var str string = "" + if err := utils.UnmarshalJSON(data, &str, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: DocumentTypeStr, + Value: &str, + }) + } + + var documentRequest DocumentRequest = DocumentRequest{} + if err := utils.UnmarshalJSON(data, &documentRequest, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: DocumentTypeDocumentRequest, + Value: &documentRequest, + }) + } + + if len(candidates) == 0 { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for Document", string(data)) + } + + // Pick the best candidate using multi-stage filtering + best := utils.PickBestUnionCandidate(candidates, data) + if best == nil { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for Document", string(data)) + } + + // Set the union type and value based on the best candidate + u.Type = best.Type.(DocumentType) + switch best.Type { + case DocumentTypeStr: + u.Str = best.Value.(*string) + return nil + case DocumentTypeDocumentRequest: + u.DocumentRequest = best.Value.(*DocumentRequest) + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for Document", string(data)) +} + +func (u Document) MarshalJSON() ([]byte, error) { + if u.Str != nil { + return utils.MarshalJSON(u.Str, "", true) + } + + if u.DocumentRequest != nil { + return utils.MarshalJSON(u.DocumentRequest, "", true) + } + + return nil, errors.New("could not marshal union type Document: all fields are null") +} + // CreateRerankRequest - Rerank request input type CreateRerankRequest struct { - // The list of documents to rerank - Documents []string `json:"documents"` + // The list of documents to rerank. Documents may be plain strings, or structured objects with `text` and/or `image` for multimodal models. + Documents []Document `json:"documents"` // The rerank model to use Model string `json:"model"` Provider optionalnullable.OptionalNullable[components.ProviderPreferences] `json:"provider,omitzero"` @@ -34,9 +157,9 @@ func (c *CreateRerankRequest) UnmarshalJSON(data []byte) error { return nil } -func (c *CreateRerankRequest) GetDocuments() []string { +func (c *CreateRerankRequest) GetDocuments() []Document { if c == nil { - return []string{} + return []Document{} } return c.Documents } @@ -69,32 +192,41 @@ func (c *CreateRerankRequest) GetTopN() *int64 { return c.TopN } -// Document - The document object containing the original text -type Document struct { +// DocumentResponse - The document object echoing the original input (text and/or image) +type DocumentResponse struct { + // The image (URL or data URI) from the original document + Image *string `json:"image,omitzero"` // The document text - Text string `json:"text"` + Text *string `json:"text,omitzero"` } -func (d *Document) GetText() string { +func (d *DocumentResponse) GetImage() *string { if d == nil { - return "" + return nil + } + return d.Image +} + +func (d *DocumentResponse) GetText() *string { + if d == nil { + return nil } return d.Text } // Result - A single rerank result type Result struct { - // The document object containing the original text - Document Document `json:"document"` + // The document object echoing the original input (text and/or image) + Document DocumentResponse `json:"document"` // Index of the document in the original input list Index int64 `json:"index"` // Relevance score of the document to the query RelevanceScore float64 `json:"relevance_score"` } -func (r *Result) GetDocument() Document { +func (r *Result) GetDocument() DocumentResponse { if r == nil { - return Document{} + return DocumentResponse{} } return r.Document } diff --git a/models/operations/createresponses.go b/models/operations/createresponses.go index 10270c55..6d5628d5 100644 --- a/models/operations/createresponses.go +++ b/models/operations/createresponses.go @@ -10,141 +10,24 @@ import ( "github.com/OpenRouterTeam/go-sdk/types/stream" ) -// CreateResponsesResponseBody - Successful response -type CreateResponsesResponseBody struct { - // Union of all possible event types emitted during response streaming - Data components.StreamEvents `json:"data"` +type CreateResponsesRequest struct { + // Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. + XOpenRouterMetadata *components.MetadataLevel `header:"style=simple,explode=false,name=X-OpenRouter-Metadata"` + ResponsesRequest components.ResponsesRequest `request:"mediaType=application/json"` } -func (c *CreateResponsesResponseBody) GetData() components.StreamEvents { +func (c *CreateResponsesRequest) GetXOpenRouterMetadata() *components.MetadataLevel { if c == nil { - return components.StreamEvents{} + return nil } - return c.Data -} - -func (c *CreateResponsesResponseBody) GetDataError() *components.ErrorEvent { - return c.GetData().ErrorEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseCompleted() *components.StreamEventsResponseCompleted { - return c.GetData().StreamEventsResponseCompleted -} - -func (c *CreateResponsesResponseBody) GetDataResponseContentPartAdded() *components.ContentPartAddedEvent { - return c.GetData().ContentPartAddedEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseContentPartDone() *components.ContentPartDoneEvent { - return c.GetData().ContentPartDoneEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseCreated() *components.OpenResponsesCreatedEvent { - return c.GetData().OpenResponsesCreatedEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseFailed() *components.StreamEventsResponseFailed { - return c.GetData().StreamEventsResponseFailed -} - -func (c *CreateResponsesResponseBody) GetDataResponseFunctionCallArgumentsDelta() *components.FunctionCallArgsDeltaEvent { - return c.GetData().FunctionCallArgsDeltaEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseFunctionCallArgumentsDone() *components.FunctionCallArgsDoneEvent { - return c.GetData().FunctionCallArgsDoneEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseImageGenerationCallCompleted() *components.ImageGenCallCompletedEvent { - return c.GetData().ImageGenCallCompletedEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseImageGenerationCallGenerating() *components.ImageGenCallGeneratingEvent { - return c.GetData().ImageGenCallGeneratingEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseImageGenerationCallInProgress() *components.ImageGenCallInProgressEvent { - return c.GetData().ImageGenCallInProgressEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseImageGenerationCallPartialImage() *components.ImageGenCallPartialImageEvent { - return c.GetData().ImageGenCallPartialImageEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseInProgress() *components.OpenResponsesInProgressEvent { - return c.GetData().OpenResponsesInProgressEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseIncomplete() *components.StreamEventsResponseIncomplete { - return c.GetData().StreamEventsResponseIncomplete -} - -func (c *CreateResponsesResponseBody) GetDataResponseOutputItemAdded() *components.StreamEventsResponseOutputItemAdded { - return c.GetData().StreamEventsResponseOutputItemAdded + return c.XOpenRouterMetadata } -func (c *CreateResponsesResponseBody) GetDataResponseOutputItemDone() *components.StreamEventsResponseOutputItemDone { - return c.GetData().StreamEventsResponseOutputItemDone -} - -func (c *CreateResponsesResponseBody) GetDataResponseOutputTextAnnotationAdded() *components.AnnotationAddedEvent { - return c.GetData().AnnotationAddedEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseOutputTextDelta() *components.TextDeltaEvent { - return c.GetData().TextDeltaEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseOutputTextDone() *components.TextDoneEvent { - return c.GetData().TextDoneEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseReasoningSummaryPartAdded() *components.ReasoningSummaryPartAddedEvent { - return c.GetData().ReasoningSummaryPartAddedEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseReasoningSummaryPartDone() *components.ReasoningSummaryPartDoneEvent { - return c.GetData().ReasoningSummaryPartDoneEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseReasoningSummaryTextDelta() *components.ReasoningSummaryTextDeltaEvent { - return c.GetData().ReasoningSummaryTextDeltaEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseReasoningSummaryTextDone() *components.ReasoningSummaryTextDoneEvent { - return c.GetData().ReasoningSummaryTextDoneEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseReasoningTextDelta() *components.ReasoningDeltaEvent { - return c.GetData().ReasoningDeltaEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseReasoningTextDone() *components.ReasoningDoneEvent { - return c.GetData().ReasoningDoneEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseRefusalDelta() *components.RefusalDeltaEvent { - return c.GetData().RefusalDeltaEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseRefusalDone() *components.RefusalDoneEvent { - return c.GetData().RefusalDoneEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseWebSearchCallCompleted() *components.WebSearchCallCompletedEvent { - return c.GetData().WebSearchCallCompletedEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseWebSearchCallInProgress() *components.WebSearchCallInProgressEvent { - return c.GetData().WebSearchCallInProgressEvent -} - -func (c *CreateResponsesResponseBody) GetDataResponseWebSearchCallSearching() *components.WebSearchCallSearchingEvent { - return c.GetData().WebSearchCallSearchingEvent -} - -func (c CreateResponsesResponseBody) GetEventEncoding(event string) (string, error) { - return "application/json", nil +func (c *CreateResponsesRequest) GetResponsesRequest() components.ResponsesRequest { + if c == nil { + return components.ResponsesRequest{} + } + return c.ResponsesRequest } type CreateResponsesResponseType string @@ -155,8 +38,8 @@ const ( ) type CreateResponsesResponse struct { - OpenResponsesResult *components.OpenResponsesResult `queryParam:"inline" union:"member"` - EventStream *stream.EventStream[CreateResponsesResponseBody] `queryParam:"inline" union:"member"` + OpenResponsesResult *components.OpenResponsesResult `queryParam:"inline" union:"member"` + EventStream *stream.EventStream[components.ResponsesStreamingResponse] `queryParam:"inline" union:"member"` Type CreateResponsesResponseType } @@ -170,7 +53,7 @@ func CreateCreateResponsesResponseOpenResponsesResult(openResponsesResult compon } } -func CreateCreateResponsesResponseEventStream(eventStream *stream.EventStream[CreateResponsesResponseBody]) CreateResponsesResponse { +func CreateCreateResponsesResponseEventStream(eventStream *stream.EventStream[components.ResponsesStreamingResponse]) CreateResponsesResponse { typ := CreateResponsesResponseTypeEventStream return CreateResponsesResponse{ @@ -192,7 +75,7 @@ func (u *CreateResponsesResponse) UnmarshalJSON(data []byte) error { }) } - var eventStream *stream.EventStream[CreateResponsesResponseBody] = &stream.EventStream[CreateResponsesResponseBody]{} + var eventStream *stream.EventStream[components.ResponsesStreamingResponse] = &stream.EventStream[components.ResponsesStreamingResponse]{} if err := utils.UnmarshalJSON(data, &eventStream, "", true, nil); err == nil { candidates = append(candidates, utils.UnionCandidate{ Type: CreateResponsesResponseTypeEventStream, @@ -217,7 +100,7 @@ func (u *CreateResponsesResponse) UnmarshalJSON(data []byte) error { u.OpenResponsesResult = best.Value.(*components.OpenResponsesResult) return nil case CreateResponsesResponseTypeEventStream: - u.EventStream = best.Value.(*stream.EventStream[CreateResponsesResponseBody]) + u.EventStream = best.Value.(*stream.EventStream[components.ResponsesStreamingResponse]) return nil } diff --git a/models/operations/deletebyokkey.go b/models/operations/deletebyokkey.go new file mode 100644 index 00000000..b8d0012e --- /dev/null +++ b/models/operations/deletebyokkey.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +type DeleteBYOKKeyRequest struct { + // The BYOK credential ID (UUID). + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (d *DeleteBYOKKeyRequest) GetID() string { + if d == nil { + return "" + } + return d.ID +} diff --git a/models/operations/deletefile.go b/models/operations/deletefile.go new file mode 100644 index 00000000..fc043c11 --- /dev/null +++ b/models/operations/deletefile.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +type DeleteFileRequest struct { + FileID string `pathParam:"style=simple,explode=false,name=file_id"` + // Workspace to scope the request to. Defaults to the caller’s default workspace. + WorkspaceID *string `queryParam:"style=form,explode=true,name=workspace_id"` +} + +func (d *DeleteFileRequest) GetFileID() string { + if d == nil { + return "" + } + return d.FileID +} + +func (d *DeleteFileRequest) GetWorkspaceID() *string { + if d == nil { + return nil + } + return d.WorkspaceID +} diff --git a/models/operations/deleteobservabilitydestination.go b/models/operations/deleteobservabilitydestination.go new file mode 100644 index 00000000..86343c9e --- /dev/null +++ b/models/operations/deleteobservabilitydestination.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +type DeleteObservabilityDestinationRequest struct { + // The destination ID (UUID). + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (d *DeleteObservabilityDestinationRequest) GetID() string { + if d == nil { + return "" + } + return d.ID +} diff --git a/models/operations/downloadfilecontent.go b/models/operations/downloadfilecontent.go new file mode 100644 index 00000000..8b43da5a --- /dev/null +++ b/models/operations/downloadfilecontent.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +type DownloadFileContentRequest struct { + FileID string `pathParam:"style=simple,explode=false,name=file_id"` + // Workspace to scope the request to. Defaults to the caller’s default workspace. + WorkspaceID *string `queryParam:"style=form,explode=true,name=workspace_id"` +} + +func (d *DownloadFileContentRequest) GetFileID() string { + if d == nil { + return "" + } + return d.FileID +} + +func (d *DownloadFileContentRequest) GetWorkspaceID() *string { + if d == nil { + return nil + } + return d.WorkspaceID +} diff --git a/models/operations/getanalyticsmeta.go b/models/operations/getanalyticsmeta.go new file mode 100644 index 00000000..0e98c37a --- /dev/null +++ b/models/operations/getanalyticsmeta.go @@ -0,0 +1,256 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +type Dimension struct { + // Human-readable label + DisplayLabel string `json:"display_label"` + // Dimension identifier used in query requests + Name string `json:"name"` +} + +func (d *Dimension) GetDisplayLabel() string { + if d == nil { + return "" + } + return d.DisplayLabel +} + +func (d *Dimension) GetName() string { + if d == nil { + return "" + } + return d.Name +} + +// GranularityName - Granularity identifier +type GranularityName string + +const ( + GranularityNameMinute GranularityName = "minute" + GranularityNameHour GranularityName = "hour" + GranularityNameDay GranularityName = "day" + GranularityNameWeek GranularityName = "week" + GranularityNameMonth GranularityName = "month" +) + +func (e GranularityName) ToPointer() *GranularityName { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *GranularityName) IsExact() bool { + if e != nil { + switch *e { + case "minute", "hour", "day", "week", "month": + return true + } + } + return false +} + +type Granularity struct { + // Human-readable label + DisplayLabel string `json:"display_label"` + // Granularity identifier + Name GranularityName `json:"name"` +} + +func (g *Granularity) GetDisplayLabel() string { + if g == nil { + return "" + } + return g.DisplayLabel +} + +func (g *Granularity) GetName() GranularityName { + if g == nil { + return GranularityName("") + } + return g.Name +} + +// DisplayFormat - How this metric value should be formatted for display (e.g. percent → multiply by 100 and append %, currency → prefix with $) +type DisplayFormat string + +const ( + DisplayFormatNumber DisplayFormat = "number" + DisplayFormatCurrency DisplayFormat = "currency" + DisplayFormatPercent DisplayFormat = "percent" + DisplayFormatLatency DisplayFormat = "latency" + DisplayFormatThroughput DisplayFormat = "throughput" +) + +func (e DisplayFormat) ToPointer() *DisplayFormat { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *DisplayFormat) IsExact() bool { + if e != nil { + switch *e { + case "number", "currency", "percent", "latency", "throughput": + return true + } + } + return false +} + +type Metric struct { + // How this metric value should be formatted for display (e.g. percent → multiply by 100 and append %, currency → prefix with $) + DisplayFormat DisplayFormat `json:"display_format"` + // Human-readable label + DisplayLabel string `json:"display_label"` + // Whether this metric is a rate/ratio (averaged, not summed) + IsRate bool `json:"is_rate"` + // Metric identifier used in query requests + Name string `json:"name"` +} + +func (m *Metric) GetDisplayFormat() DisplayFormat { + if m == nil { + return DisplayFormat("") + } + return m.DisplayFormat +} + +func (m *Metric) GetDisplayLabel() string { + if m == nil { + return "" + } + return m.DisplayLabel +} + +func (m *Metric) GetIsRate() bool { + if m == nil { + return false + } + return m.IsRate +} + +func (m *Metric) GetName() string { + if m == nil { + return "" + } + return m.Name +} + +// OperatorName - Operator identifier used in filter definitions +type OperatorName string + +const ( + OperatorNameEq OperatorName = "eq" + OperatorNameNeq OperatorName = "neq" + OperatorNameIn OperatorName = "in" + OperatorNameNotIn OperatorName = "not_in" + OperatorNameGt OperatorName = "gt" + OperatorNameGte OperatorName = "gte" + OperatorNameLt OperatorName = "lt" + OperatorNameLte OperatorName = "lte" +) + +func (e OperatorName) ToPointer() *OperatorName { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *OperatorName) IsExact() bool { + if e != nil { + switch *e { + case "eq", "neq", "in", "not_in", "gt", "gte", "lt", "lte": + return true + } + } + return false +} + +// ValueType - Whether the operator expects a single value or an array +type ValueType string + +const ( + ValueTypeScalar ValueType = "scalar" + ValueTypeArray ValueType = "array" +) + +func (e ValueType) ToPointer() *ValueType { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *ValueType) IsExact() bool { + if e != nil { + switch *e { + case "scalar", "array": + return true + } + } + return false +} + +type Operator struct { + // Operator identifier used in filter definitions + Name OperatorName `json:"name"` + // Whether the operator expects a single value or an array + ValueType ValueType `json:"value_type"` +} + +func (o *Operator) GetName() OperatorName { + if o == nil { + return OperatorName("") + } + return o.Name +} + +func (o *Operator) GetValueType() ValueType { + if o == nil { + return ValueType("") + } + return o.ValueType +} + +type GetAnalyticsMetaData struct { + Dimensions []Dimension `json:"dimensions"` + Granularities []Granularity `json:"granularities"` + Metrics []Metric `json:"metrics"` + Operators []Operator `json:"operators"` +} + +func (g *GetAnalyticsMetaData) GetDimensions() []Dimension { + if g == nil { + return []Dimension{} + } + return g.Dimensions +} + +func (g *GetAnalyticsMetaData) GetGranularities() []Granularity { + if g == nil { + return []Granularity{} + } + return g.Granularities +} + +func (g *GetAnalyticsMetaData) GetMetrics() []Metric { + if g == nil { + return []Metric{} + } + return g.Metrics +} + +func (g *GetAnalyticsMetaData) GetOperators() []Operator { + if g == nil { + return []Operator{} + } + return g.Operators +} + +// GetAnalyticsMetaResponse - Returns analytics query metadata +type GetAnalyticsMetaResponse struct { + Data GetAnalyticsMetaData `json:"data"` +} + +func (g *GetAnalyticsMetaResponse) GetData() GetAnalyticsMetaData { + if g == nil { + return GetAnalyticsMetaData{} + } + return g.Data +} diff --git a/models/operations/getapprankings.go b/models/operations/getapprankings.go new file mode 100644 index 00000000..8c787ec0 --- /dev/null +++ b/models/operations/getapprankings.go @@ -0,0 +1,183 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/models/components" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +// GetAppRankingsCategory - Marketplace category group to filter by (e.g. `coding`). Only apps tagged with a subcategory inside this group are returned. Mutually combinable with `subcategory` — when both are supplied the `subcategory` must belong to the `category` group. +type GetAppRankingsCategory string + +const ( + GetAppRankingsCategoryCoding GetAppRankingsCategory = "coding" + GetAppRankingsCategoryCreative GetAppRankingsCategory = "creative" + GetAppRankingsCategoryProductivity GetAppRankingsCategory = "productivity" + GetAppRankingsCategoryEntertainment GetAppRankingsCategory = "entertainment" +) + +func (e GetAppRankingsCategory) ToPointer() *GetAppRankingsCategory { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *GetAppRankingsCategory) IsExact() bool { + if e != nil { + switch *e { + case "coding", "creative", "productivity", "entertainment": + return true + } + } + return false +} + +// Subcategory - Marketplace subcategory to filter by (e.g. `cli-agent`). Takes precedence over `category` for the actual filter; when `category` is also supplied the pair must be consistent. +type Subcategory string + +const ( + SubcategoryCliAgent Subcategory = "cli-agent" + SubcategoryIdeExtension Subcategory = "ide-extension" + SubcategoryCloudAgent Subcategory = "cloud-agent" + SubcategoryProgrammingApp Subcategory = "programming-app" + SubcategoryNativeAppBuilder Subcategory = "native-app-builder" + SubcategoryCreativeWriting Subcategory = "creative-writing" + SubcategoryVideoGen Subcategory = "video-gen" + SubcategoryImageGen Subcategory = "image-gen" + SubcategoryAudioGen Subcategory = "audio-gen" + SubcategoryRoleplay Subcategory = "roleplay" + SubcategoryGame Subcategory = "game" + SubcategoryWritingAssistant Subcategory = "writing-assistant" + SubcategoryGeneralChat Subcategory = "general-chat" + SubcategoryPersonalAgent Subcategory = "personal-agent" + SubcategoryLegal Subcategory = "legal" +) + +func (e Subcategory) ToPointer() *Subcategory { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Subcategory) IsExact() bool { + if e != nil { + switch *e { + case "cli-agent", "ide-extension", "cloud-agent", "programming-app", "native-app-builder", "creative-writing", "video-gen", "image-gen", "audio-gen", "roleplay", "game", "writing-assistant", "general-chat", "personal-agent", "legal": + return true + } + } + return false +} + +// GetAppRankingsSort - `popular` ranks apps by total token volume inside the date window. `trending` ranks apps by absolute excess token growth: window volume minus the average volume of the three equal-length periods immediately preceding the window. Apps with no excess growth are omitted from `trending` results. +type GetAppRankingsSort string + +const ( + GetAppRankingsSortPopular GetAppRankingsSort = "popular" + GetAppRankingsSortTrending GetAppRankingsSort = "trending" +) + +func (e GetAppRankingsSort) ToPointer() *GetAppRankingsSort { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *GetAppRankingsSort) IsExact() bool { + if e != nil { + switch *e { + case "popular", "trending": + return true + } + } + return false +} + +type GetAppRankingsRequest struct { + // Marketplace category group to filter by (e.g. `coding`). Only apps tagged with a subcategory inside this group are returned. Mutually combinable with `subcategory` — when both are supplied the `subcategory` must belong to the `category` group. + Category *GetAppRankingsCategory `queryParam:"style=form,explode=true,name=category"` + // Marketplace subcategory to filter by (e.g. `cli-agent`). Takes precedence over `category` for the actual filter; when `category` is also supplied the pair must be consistent. + Subcategory *Subcategory `queryParam:"style=form,explode=true,name=subcategory"` + // `popular` ranks apps by total token volume inside the date window. `trending` ranks apps by absolute excess token growth: window volume minus the average volume of the three equal-length periods immediately preceding the window. Apps with no excess growth are omitted from `trending` results. + Sort *GetAppRankingsSort `default:"popular" queryParam:"style=form,explode=true,name=sort"` + // Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`. + StartDate *string `queryParam:"style=form,explode=true,name=start_date"` + // End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400. + EndDate *string `queryParam:"style=form,explode=true,name=end_date"` + // Maximum number of apps to return (1-100). Defaults to 50. + Limit *int64 `default:"50" queryParam:"style=form,explode=true,name=limit"` + // Number of ranked apps to skip before the first returned row (0-100). Defaults to 0. `rank` stays absolute, so the first row of `offset=50` is `rank: 51`. + Offset optionalnullable.OptionalNullable[int64] `default:"0" queryParam:"style=form,explode=true,name=offset"` +} + +func (g GetAppRankingsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetAppRankingsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetAppRankingsRequest) GetCategory() *GetAppRankingsCategory { + if g == nil { + return nil + } + return g.Category +} + +func (g *GetAppRankingsRequest) GetSubcategory() *Subcategory { + if g == nil { + return nil + } + return g.Subcategory +} + +func (g *GetAppRankingsRequest) GetSort() *GetAppRankingsSort { + if g == nil { + return nil + } + return g.Sort +} + +func (g *GetAppRankingsRequest) GetStartDate() *string { + if g == nil { + return nil + } + return g.StartDate +} + +func (g *GetAppRankingsRequest) GetEndDate() *string { + if g == nil { + return nil + } + return g.EndDate +} + +func (g *GetAppRankingsRequest) GetLimit() *int64 { + if g == nil { + return nil + } + return g.Limit +} + +func (g *GetAppRankingsRequest) GetOffset() optionalnullable.OptionalNullable[int64] { + if g == nil { + return nil + } + return g.Offset +} + +type GetAppRankingsResponse struct { + Result components.AppRankingsResponse + + Next func() (*GetAppRankingsResponse, error) +} + +func (g *GetAppRankingsResponse) GetResult() components.AppRankingsResponse { + if g == nil { + return components.AppRankingsResponse{} + } + return g.Result +} diff --git a/models/operations/getbenchmarksartificialanalysis.go b/models/operations/getbenchmarksartificialanalysis.go new file mode 100644 index 00000000..89ace9fc --- /dev/null +++ b/models/operations/getbenchmarksartificialanalysis.go @@ -0,0 +1,30 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +type GetBenchmarksArtificialAnalysisRequest struct { + // Max results to return (1–100, default 50). + MaxResults *int64 `default:"50" queryParam:"style=form,explode=true,name=max_results"` +} + +func (g GetBenchmarksArtificialAnalysisRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetBenchmarksArtificialAnalysisRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetBenchmarksArtificialAnalysisRequest) GetMaxResults() *int64 { + if g == nil { + return nil + } + return g.MaxResults +} diff --git a/models/operations/getbenchmarksdesignarena.go b/models/operations/getbenchmarksdesignarena.go new file mode 100644 index 00000000..1034b8ae --- /dev/null +++ b/models/operations/getbenchmarksdesignarena.go @@ -0,0 +1,72 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/OpenRouterTeam/go-sdk/internal/utils" +) + +// Arena to query. Defaults to `models`. +type Arena string + +const ( + ArenaModels Arena = "models" + ArenaBuilders Arena = "builders" + ArenaAgents Arena = "agents" +) + +func (e Arena) ToPointer() *Arena { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Arena) IsExact() bool { + if e != nil { + switch *e { + case "models", "builders", "agents": + return true + } + } + return false +} + +type GetBenchmarksDesignArenaRequest struct { + // Arena to query. Defaults to `models`. + Arena *Arena `default:"models" queryParam:"style=form,explode=true,name=arena"` + // Category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories. + Category *string `queryParam:"style=form,explode=true,name=category"` + // Max results to return: per category when no category filter is applied (1–100, default 50). + MaxResults *int64 `default:"50" queryParam:"style=form,explode=true,name=max_results"` +} + +func (g GetBenchmarksDesignArenaRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetBenchmarksDesignArenaRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, nil); err != nil { + return err + } + return nil +} + +func (g *GetBenchmarksDesignArenaRequest) GetArena() *Arena { + if g == nil { + return nil + } + return g.Arena +} + +func (g *GetBenchmarksDesignArenaRequest) GetCategory() *string { + if g == nil { + return nil + } + return g.Category +} + +func (g *GetBenchmarksDesignArenaRequest) GetMaxResults() *int64 { + if g == nil { + return nil + } + return g.MaxResults +} diff --git a/models/operations/getbyokkey.go b/models/operations/getbyokkey.go new file mode 100644 index 00000000..bc7defc6 --- /dev/null +++ b/models/operations/getbyokkey.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +type GetBYOKKeyRequest struct { + // The BYOK credential ID (UUID). + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (g *GetBYOKKeyRequest) GetID() string { + if g == nil { + return "" + } + return g.ID +} diff --git a/models/operations/getfilemetadata.go b/models/operations/getfilemetadata.go new file mode 100644 index 00000000..73ebb9d9 --- /dev/null +++ b/models/operations/getfilemetadata.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +type GetFileMetadataRequest struct { + FileID string `pathParam:"style=simple,explode=false,name=file_id"` + // Workspace to scope the request to. Defaults to the caller’s default workspace. + WorkspaceID *string `queryParam:"style=form,explode=true,name=workspace_id"` +} + +func (g *GetFileMetadataRequest) GetFileID() string { + if g == nil { + return "" + } + return g.FileID +} + +func (g *GetFileMetadataRequest) GetWorkspaceID() *string { + if g == nil { + return nil + } + return g.WorkspaceID +} diff --git a/models/operations/getmodel.go b/models/operations/getmodel.go new file mode 100644 index 00000000..421d8808 --- /dev/null +++ b/models/operations/getmodel.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +type GetModelRequest struct { + // The author/organization of the model + Author string `pathParam:"style=simple,explode=false,name=author"` + // The model slug, optionally including a variant suffix (e.g. gpt-4 or gpt-4:free) + Slug string `pathParam:"style=simple,explode=false,name=slug"` +} + +func (g *GetModelRequest) GetAuthor() string { + if g == nil { + return "" + } + return g.Author +} + +func (g *GetModelRequest) GetSlug() string { + if g == nil { + return "" + } + return g.Slug +} diff --git a/models/operations/getmodels.go b/models/operations/getmodels.go index 01d6368e..e837fd37 100644 --- a/models/operations/getmodels.go +++ b/models/operations/getmodels.go @@ -2,30 +2,36 @@ package operations -// Category - Filter models by use case category -type Category string +import ( + "encoding/json" + "fmt" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +// GetModelsCategory - Filter models by use case category +type GetModelsCategory string const ( - CategoryProgramming Category = "programming" - CategoryRoleplay Category = "roleplay" - CategoryMarketing Category = "marketing" - CategoryMarketingSeo Category = "marketing/seo" - CategoryTechnology Category = "technology" - CategoryScience Category = "science" - CategoryTranslation Category = "translation" - CategoryLegal Category = "legal" - CategoryFinance Category = "finance" - CategoryHealth Category = "health" - CategoryTrivia Category = "trivia" - CategoryAcademia Category = "academia" + GetModelsCategoryProgramming GetModelsCategory = "programming" + GetModelsCategoryRoleplay GetModelsCategory = "roleplay" + GetModelsCategoryMarketing GetModelsCategory = "marketing" + GetModelsCategoryMarketingSeo GetModelsCategory = "marketing/seo" + GetModelsCategoryTechnology GetModelsCategory = "technology" + GetModelsCategoryScience GetModelsCategory = "science" + GetModelsCategoryTranslation GetModelsCategory = "translation" + GetModelsCategoryLegal GetModelsCategory = "legal" + GetModelsCategoryFinance GetModelsCategory = "finance" + GetModelsCategoryHealth GetModelsCategory = "health" + GetModelsCategoryTrivia GetModelsCategory = "trivia" + GetModelsCategoryAcademia GetModelsCategory = "academia" ) -func (e Category) ToPointer() *Category { +func (e GetModelsCategory) ToPointer() *GetModelsCategory { return &e } // IsExact returns true if the value matches a known enum value, false otherwise. -func (e *Category) IsExact() bool { +func (e *GetModelsCategory) IsExact() bool { if e != nil { switch *e { case "programming", "roleplay", "marketing", "marketing/seo", "technology", "science", "translation", "legal", "finance", "health", "trivia", "academia": @@ -35,16 +41,140 @@ func (e *Category) IsExact() bool { return false } +// GetModelsSort - Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date). When omitted, the existing default ordering is preserved. +type GetModelsSort string + +const ( + GetModelsSortMostPopular GetModelsSort = "most-popular" + GetModelsSortNewest GetModelsSort = "newest" + GetModelsSortTopWeekly GetModelsSort = "top-weekly" + GetModelsSortPricingLowToHigh GetModelsSort = "pricing-low-to-high" + GetModelsSortPricingHighToLow GetModelsSort = "pricing-high-to-low" + GetModelsSortContextHighToLow GetModelsSort = "context-high-to-low" + GetModelsSortThroughputHighToLow GetModelsSort = "throughput-high-to-low" + GetModelsSortLatencyLowToHigh GetModelsSort = "latency-low-to-high" +) + +func (e GetModelsSort) ToPointer() *GetModelsSort { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *GetModelsSort) IsExact() bool { + if e != nil { + switch *e { + case "most-popular", "newest", "top-weekly", "pricing-low-to-high", "pricing-high-to-low", "context-high-to-low", "throughput-high-to-low", "latency-low-to-high": + return true + } + } + return false +} + +// Distillable - Filter by distillation capability. "true" returns only distillable models, "false" excludes them. +type Distillable string + +const ( + DistillableTrue Distillable = "true" + DistillableFalse Distillable = "false" +) + +func (e Distillable) ToPointer() *Distillable { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Distillable) IsExact() bool { + if e != nil { + switch *e { + case "true", "false": + return true + } + } + return false +} + +// Zdr - When set to "true", return only models with zero data retention endpoints. +type Zdr string + +const ( + ZdrTrue Zdr = "true" +) + +func (e Zdr) ToPointer() *Zdr { + return &e +} +func (e *Zdr) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "true": + *e = Zdr(v) + return nil + default: + return fmt.Errorf("invalid value for Zdr: %v", v) + } +} + +// Region - Filter to models with endpoints in the given data region. Currently only "eu" is supported. +type Region string + +const ( + RegionEu Region = "eu" +) + +func (e Region) ToPointer() *Region { + return &e +} +func (e *Region) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "eu": + *e = Region(v) + return nil + default: + return fmt.Errorf("invalid value for Region: %v", v) + } +} + type GetModelsRequest struct { // Filter models by use case category - Category *Category `queryParam:"style=form,explode=true,name=category"` + Category *GetModelsCategory `queryParam:"style=form,explode=true,name=category"` // Filter models by supported parameter (comma-separated) SupportedParameters *string `queryParam:"style=form,explode=true,name=supported_parameters"` // Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". OutputModalities *string `queryParam:"style=form,explode=true,name=output_modalities"` + // Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date). When omitted, the existing default ordering is preserved. + Sort *GetModelsSort `queryParam:"style=form,explode=true,name=sort"` + // Free-text search by model name or slug. + Q *string `queryParam:"style=form,explode=true,name=q"` + // Filter models by input modality. Comma-separated list of: text, image, audio, file. + InputModalities *string `queryParam:"style=form,explode=true,name=input_modalities"` + // Minimum context length (tokens). Models with smaller context are excluded. + Context *int64 `queryParam:"style=form,explode=true,name=context"` + // Minimum prompt price in $/M tokens. + MinPrice optionalnullable.OptionalNullable[float64] `queryParam:"style=form,explode=true,name=min_price"` + // Maximum prompt price in $/M tokens. + MaxPrice optionalnullable.OptionalNullable[float64] `queryParam:"style=form,explode=true,name=max_price"` + // Filter models by architecture/model family (e.g. GPT, Claude, Gemini, Llama). + Arch *string `queryParam:"style=form,explode=true,name=arch"` + // Filter models by the organization that created the model. Comma-separated list of author slugs. + ModelAuthors *string `queryParam:"style=form,explode=true,name=model_authors"` + // Filter models by hosting provider. Comma-separated list of provider names. + Providers *string `queryParam:"style=form,explode=true,name=providers"` + // Filter by distillation capability. "true" returns only distillable models, "false" excludes them. + Distillable *Distillable `queryParam:"style=form,explode=true,name=distillable"` + // When set to "true", return only models with zero data retention endpoints. + Zdr *Zdr `queryParam:"style=form,explode=true,name=zdr"` + // Filter to models with endpoints in the given data region. Currently only "eu" is supported. + Region *Region `queryParam:"style=form,explode=true,name=region"` } -func (g *GetModelsRequest) GetCategory() *Category { +func (g *GetModelsRequest) GetCategory() *GetModelsCategory { if g == nil { return nil } @@ -64,3 +194,87 @@ func (g *GetModelsRequest) GetOutputModalities() *string { } return g.OutputModalities } + +func (g *GetModelsRequest) GetSort() *GetModelsSort { + if g == nil { + return nil + } + return g.Sort +} + +func (g *GetModelsRequest) GetQ() *string { + if g == nil { + return nil + } + return g.Q +} + +func (g *GetModelsRequest) GetInputModalities() *string { + if g == nil { + return nil + } + return g.InputModalities +} + +func (g *GetModelsRequest) GetContext() *int64 { + if g == nil { + return nil + } + return g.Context +} + +func (g *GetModelsRequest) GetMinPrice() optionalnullable.OptionalNullable[float64] { + if g == nil { + return nil + } + return g.MinPrice +} + +func (g *GetModelsRequest) GetMaxPrice() optionalnullable.OptionalNullable[float64] { + if g == nil { + return nil + } + return g.MaxPrice +} + +func (g *GetModelsRequest) GetArch() *string { + if g == nil { + return nil + } + return g.Arch +} + +func (g *GetModelsRequest) GetModelAuthors() *string { + if g == nil { + return nil + } + return g.ModelAuthors +} + +func (g *GetModelsRequest) GetProviders() *string { + if g == nil { + return nil + } + return g.Providers +} + +func (g *GetModelsRequest) GetDistillable() *Distillable { + if g == nil { + return nil + } + return g.Distillable +} + +func (g *GetModelsRequest) GetZdr() *Zdr { + if g == nil { + return nil + } + return g.Zdr +} + +func (g *GetModelsRequest) GetRegion() *Region { + if g == nil { + return nil + } + return g.Region +} diff --git a/models/operations/getobservabilitydestination.go b/models/operations/getobservabilitydestination.go new file mode 100644 index 00000000..01da04e0 --- /dev/null +++ b/models/operations/getobservabilitydestination.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +type GetObservabilityDestinationRequest struct { + // The destination ID (UUID). + ID string `pathParam:"style=simple,explode=false,name=id"` +} + +func (g *GetObservabilityDestinationRequest) GetID() string { + if g == nil { + return "" + } + return g.ID +} diff --git a/models/operations/getpreset.go b/models/operations/getpreset.go new file mode 100644 index 00000000..66edeb31 --- /dev/null +++ b/models/operations/getpreset.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +type GetPresetRequest struct { + // URL-safe slug identifying the preset. + Slug string `pathParam:"style=simple,explode=false,name=slug"` +} + +func (g *GetPresetRequest) GetSlug() string { + if g == nil { + return "" + } + return g.Slug +} diff --git a/models/operations/getpresetversion.go b/models/operations/getpresetversion.go new file mode 100644 index 00000000..f3f2f28f --- /dev/null +++ b/models/operations/getpresetversion.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +type GetPresetVersionRequest struct { + // URL-safe slug identifying the preset. + Slug string `pathParam:"style=simple,explode=false,name=slug"` + // Version number of the preset. + Version string `pathParam:"style=simple,explode=false,name=version"` +} + +func (g *GetPresetVersionRequest) GetSlug() string { + if g == nil { + return "" + } + return g.Slug +} + +func (g *GetPresetVersionRequest) GetVersion() string { + if g == nil { + return "" + } + return g.Version +} diff --git a/models/operations/getrankingsdaily.go b/models/operations/getrankingsdaily.go new file mode 100644 index 00000000..9b635c46 --- /dev/null +++ b/models/operations/getrankingsdaily.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +type GetRankingsDailyRequest struct { + // Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`. + StartDate *string `queryParam:"style=form,explode=true,name=start_date"` + // End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400. + EndDate *string `queryParam:"style=form,explode=true,name=end_date"` +} + +func (g *GetRankingsDailyRequest) GetStartDate() *string { + if g == nil { + return nil + } + return g.StartDate +} + +func (g *GetRankingsDailyRequest) GetEndDate() *string { + if g == nil { + return nil + } + return g.EndDate +} diff --git a/models/operations/listbyokkeys.go b/models/operations/listbyokkeys.go new file mode 100644 index 00000000..ce8aef28 --- /dev/null +++ b/models/operations/listbyokkeys.go @@ -0,0 +1,164 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +// Provider - Optional provider slug to filter by (e.g. `openai`, `anthropic`, `amazon-bedrock`). +type Provider string + +const ( + ProviderAi21 Provider = "ai21" + ProviderAionLabs Provider = "aion-labs" + ProviderAkashml Provider = "akashml" + ProviderAlibaba Provider = "alibaba" + ProviderAmazonBedrock Provider = "amazon-bedrock" + ProviderAmazonNova Provider = "amazon-nova" + ProviderAmbient Provider = "ambient" + ProviderAnthropic Provider = "anthropic" + ProviderArceeAi Provider = "arcee-ai" + ProviderAtlasCloud Provider = "atlas-cloud" + ProviderAvian Provider = "avian" + ProviderAzure Provider = "azure" + ProviderBaidu Provider = "baidu" + ProviderBaseten Provider = "baseten" + ProviderBlackForestLabs Provider = "black-forest-labs" + ProviderByteplus Provider = "byteplus" + ProviderCerebras Provider = "cerebras" + ProviderChutes Provider = "chutes" + ProviderCirrascale Provider = "cirrascale" + ProviderClarifai Provider = "clarifai" + ProviderCloudflare Provider = "cloudflare" + ProviderCohere Provider = "cohere" + ProviderCrusoe Provider = "crusoe" + ProviderDarkbloom Provider = "darkbloom" + ProviderDecart Provider = "decart" + ProviderDeepinfra Provider = "deepinfra" + ProviderDeepseek Provider = "deepseek" + ProviderDekallm Provider = "dekallm" + ProviderDigitalocean Provider = "digitalocean" + ProviderFeatherless Provider = "featherless" + ProviderFireworks Provider = "fireworks" + ProviderFriendli Provider = "friendli" + ProviderGmicloud Provider = "gmicloud" + ProviderGoogleAiStudio Provider = "google-ai-studio" + ProviderGoogleVertex Provider = "google-vertex" + ProviderGroq Provider = "groq" + ProviderInception Provider = "inception" + ProviderInceptron Provider = "inceptron" + ProviderInferenceNet Provider = "inference-net" + ProviderInfermatic Provider = "infermatic" + ProviderInflection Provider = "inflection" + ProviderIoNet Provider = "io-net" + ProviderIonstream Provider = "ionstream" + ProviderLiquid Provider = "liquid" + ProviderMancer Provider = "mancer" + ProviderMara Provider = "mara" + ProviderMinimax Provider = "minimax" + ProviderMistral Provider = "mistral" + ProviderModelrun Provider = "modelrun" + ProviderModular Provider = "modular" + ProviderMoonshotai Provider = "moonshotai" + ProviderMorph Provider = "morph" + ProviderNcompass Provider = "ncompass" + ProviderNebius Provider = "nebius" + ProviderNexAgi Provider = "nex-agi" + ProviderNextbit Provider = "nextbit" + ProviderNovita Provider = "novita" + ProviderNvidia Provider = "nvidia" + ProviderOpenInference Provider = "open-inference" + ProviderOpenai Provider = "openai" + ProviderParasail Provider = "parasail" + ProviderPerceptron Provider = "perceptron" + ProviderPerplexity Provider = "perplexity" + ProviderPhala Provider = "phala" + ProviderPoolside Provider = "poolside" + ProviderRecraft Provider = "recraft" + ProviderReka Provider = "reka" + ProviderRelace Provider = "relace" + ProviderSambanova Provider = "sambanova" + ProviderSeed Provider = "seed" + ProviderSiliconflow Provider = "siliconflow" + ProviderSourceful Provider = "sourceful" + ProviderStepfun Provider = "stepfun" + ProviderStreamlake Provider = "streamlake" + ProviderSwitchpoint Provider = "switchpoint" + ProviderTogether Provider = "together" + ProviderUpstage Provider = "upstage" + ProviderVenice Provider = "venice" + ProviderWafer Provider = "wafer" + ProviderWandb Provider = "wandb" + ProviderXai Provider = "xai" + ProviderXiaomi Provider = "xiaomi" + ProviderZAi Provider = "z-ai" +) + +func (e Provider) ToPointer() *Provider { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Provider) IsExact() bool { + if e != nil { + switch *e { + case "ai21", "aion-labs", "akashml", "alibaba", "amazon-bedrock", "amazon-nova", "ambient", "anthropic", "arcee-ai", "atlas-cloud", "avian", "azure", "baidu", "baseten", "black-forest-labs", "byteplus", "cerebras", "chutes", "cirrascale", "clarifai", "cloudflare", "cohere", "crusoe", "darkbloom", "decart", "deepinfra", "deepseek", "dekallm", "digitalocean", "featherless", "fireworks", "friendli", "gmicloud", "google-ai-studio", "google-vertex", "groq", "inception", "inceptron", "inference-net", "infermatic", "inflection", "io-net", "ionstream", "liquid", "mancer", "mara", "minimax", "mistral", "modelrun", "modular", "moonshotai", "morph", "ncompass", "nebius", "nex-agi", "nextbit", "novita", "nvidia", "open-inference", "openai", "parasail", "perceptron", "perplexity", "phala", "poolside", "recraft", "reka", "relace", "sambanova", "seed", "siliconflow", "sourceful", "stepfun", "streamlake", "switchpoint", "together", "upstage", "venice", "wafer", "wandb", "xai", "xiaomi", "z-ai": + return true + } + } + return false +} + +type ListBYOKKeysRequest struct { + // Number of records to skip for pagination + Offset optionalnullable.OptionalNullable[int64] `queryParam:"style=form,explode=true,name=offset"` + // Maximum number of records to return (max 100) + Limit *int64 `queryParam:"style=form,explode=true,name=limit"` + // Optional workspace ID to filter by. Defaults to the authenticated entity's default workspace. + WorkspaceID *string `queryParam:"style=form,explode=true,name=workspace_id"` + // Optional provider slug to filter by (e.g. `openai`, `anthropic`, `amazon-bedrock`). + Provider *Provider `queryParam:"style=form,explode=true,name=provider"` +} + +func (l *ListBYOKKeysRequest) GetOffset() optionalnullable.OptionalNullable[int64] { + if l == nil { + return nil + } + return l.Offset +} + +func (l *ListBYOKKeysRequest) GetLimit() *int64 { + if l == nil { + return nil + } + return l.Limit +} + +func (l *ListBYOKKeysRequest) GetWorkspaceID() *string { + if l == nil { + return nil + } + return l.WorkspaceID +} + +func (l *ListBYOKKeysRequest) GetProvider() *Provider { + if l == nil { + return nil + } + return l.Provider +} + +type ListBYOKKeysResponse struct { + Result components.ListBYOKKeysResponse + + Next func() (*ListBYOKKeysResponse, error) +} + +func (l *ListBYOKKeysResponse) GetResult() components.ListBYOKKeysResponse { + if l == nil { + return components.ListBYOKKeysResponse{} + } + return l.Result +} diff --git a/models/operations/listfiles.go b/models/operations/listfiles.go new file mode 100644 index 00000000..cf44caff --- /dev/null +++ b/models/operations/listfiles.go @@ -0,0 +1,50 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +type ListFilesRequest struct { + // Maximum number of files to return (1–1000). + Limit *int64 `queryParam:"style=form,explode=true,name=limit"` + // Opaque pagination cursor from a previous response. + Cursor *string `queryParam:"style=form,explode=true,name=cursor"` + // Workspace to scope the request to. Defaults to the caller’s default workspace. + WorkspaceID *string `queryParam:"style=form,explode=true,name=workspace_id"` +} + +func (l *ListFilesRequest) GetLimit() *int64 { + if l == nil { + return nil + } + return l.Limit +} + +func (l *ListFilesRequest) GetCursor() *string { + if l == nil { + return nil + } + return l.Cursor +} + +func (l *ListFilesRequest) GetWorkspaceID() *string { + if l == nil { + return nil + } + return l.WorkspaceID +} + +type ListFilesResponse struct { + Result components.FileListResponse + + Next func() (*ListFilesResponse, error) +} + +func (l *ListFilesResponse) GetResult() components.FileListResponse { + if l == nil { + return components.FileListResponse{} + } + return l.Result +} diff --git a/models/operations/listobservabilitydestinations.go b/models/operations/listobservabilitydestinations.go new file mode 100644 index 00000000..521bdf2a --- /dev/null +++ b/models/operations/listobservabilitydestinations.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type ListObservabilityDestinationsRequest struct { + // Number of records to skip for pagination + Offset optionalnullable.OptionalNullable[int64] `queryParam:"style=form,explode=true,name=offset"` + // Maximum number of records to return (max 100) + Limit *int64 `queryParam:"style=form,explode=true,name=limit"` + // Optional workspace ID to filter by. Defaults to the authenticated entity's default workspace. + WorkspaceID *string `queryParam:"style=form,explode=true,name=workspace_id"` +} + +func (l *ListObservabilityDestinationsRequest) GetOffset() optionalnullable.OptionalNullable[int64] { + if l == nil { + return nil + } + return l.Offset +} + +func (l *ListObservabilityDestinationsRequest) GetLimit() *int64 { + if l == nil { + return nil + } + return l.Limit +} + +func (l *ListObservabilityDestinationsRequest) GetWorkspaceID() *string { + if l == nil { + return nil + } + return l.WorkspaceID +} + +type ListObservabilityDestinationsResponse struct { + Result components.ListObservabilityDestinationsResponse + + Next func() (*ListObservabilityDestinationsResponse, error) +} + +func (l *ListObservabilityDestinationsResponse) GetResult() components.ListObservabilityDestinationsResponse { + if l == nil { + return components.ListObservabilityDestinationsResponse{} + } + return l.Result +} diff --git a/models/operations/listpresets.go b/models/operations/listpresets.go new file mode 100644 index 00000000..ddfc1c46 --- /dev/null +++ b/models/operations/listpresets.go @@ -0,0 +1,42 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type ListPresetsRequest struct { + // Number of records to skip for pagination + Offset optionalnullable.OptionalNullable[int64] `queryParam:"style=form,explode=true,name=offset"` + // Maximum number of records to return (max 100) + Limit *int64 `queryParam:"style=form,explode=true,name=limit"` +} + +func (l *ListPresetsRequest) GetOffset() optionalnullable.OptionalNullable[int64] { + if l == nil { + return nil + } + return l.Offset +} + +func (l *ListPresetsRequest) GetLimit() *int64 { + if l == nil { + return nil + } + return l.Limit +} + +type ListPresetsResponse struct { + Result components.ListPresetsResponse + + Next func() (*ListPresetsResponse, error) +} + +func (l *ListPresetsResponse) GetResult() components.ListPresetsResponse { + if l == nil { + return components.ListPresetsResponse{} + } + return l.Result +} diff --git a/models/operations/listpresetversions.go b/models/operations/listpresetversions.go new file mode 100644 index 00000000..85b3599c --- /dev/null +++ b/models/operations/listpresetversions.go @@ -0,0 +1,51 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" +) + +type ListPresetVersionsRequest struct { + // URL-safe slug identifying the preset. + Slug string `pathParam:"style=simple,explode=false,name=slug"` + // Number of records to skip for pagination + Offset optionalnullable.OptionalNullable[int64] `queryParam:"style=form,explode=true,name=offset"` + // Maximum number of records to return (max 100) + Limit *int64 `queryParam:"style=form,explode=true,name=limit"` +} + +func (l *ListPresetVersionsRequest) GetSlug() string { + if l == nil { + return "" + } + return l.Slug +} + +func (l *ListPresetVersionsRequest) GetOffset() optionalnullable.OptionalNullable[int64] { + if l == nil { + return nil + } + return l.Offset +} + +func (l *ListPresetVersionsRequest) GetLimit() *int64 { + if l == nil { + return nil + } + return l.Limit +} + +type ListPresetVersionsResponse struct { + Result components.ListPresetVersionsResponse + + Next func() (*ListPresetVersionsResponse, error) +} + +func (l *ListPresetVersionsResponse) GetResult() components.ListPresetVersionsResponse { + if l == nil { + return components.ListPresetVersionsResponse{} + } + return l.Result +} diff --git a/models/operations/options.go b/models/operations/options.go index 40355c9b..f95b33b0 100644 --- a/models/operations/options.go +++ b/models/operations/options.go @@ -22,8 +22,8 @@ type AcceptHeaderEnum string const ( AcceptHeaderEnumApplicationJson AcceptHeaderEnum = "application/json" - AcceptHeaderEnumAudioWildcard AcceptHeaderEnum = "audio/*" AcceptHeaderEnumTextEventStream AcceptHeaderEnum = "text/event-stream" + AcceptHeaderEnumAudioWildcard AcceptHeaderEnum = "audio/*" AcceptHeaderEnumApplicationOctetStream AcceptHeaderEnum = "application/octet-stream" ) diff --git a/models/operations/queryanalytics.go b/models/operations/queryanalytics.go new file mode 100644 index 00000000..98e489c1 --- /dev/null +++ b/models/operations/queryanalytics.go @@ -0,0 +1,474 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "errors" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "time" +) + +type Value2Type string + +const ( + Value2TypeStr Value2Type = "str" + Value2TypeNumber Value2Type = "number" +) + +type Value2 struct { + Str *string `queryParam:"inline" union:"member"` + Number *float64 `queryParam:"inline" union:"member"` + + Type Value2Type +} + +func CreateValue2Str(str string) Value2 { + typ := Value2TypeStr + + return Value2{ + Str: &str, + Type: typ, + } +} + +func CreateValue2Number(number float64) Value2 { + typ := Value2TypeNumber + + return Value2{ + Number: &number, + Type: typ, + } +} + +func (u *Value2) UnmarshalJSON(data []byte) error { + + var candidates []utils.UnionCandidate + + // Collect all valid candidates + var str string = "" + if err := utils.UnmarshalJSON(data, &str, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: Value2TypeStr, + Value: &str, + }) + } + + var number float64 = float64(0) + if err := utils.UnmarshalJSON(data, &number, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: Value2TypeNumber, + Value: &number, + }) + } + + if len(candidates) == 0 { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for Value2", string(data)) + } + + // Pick the best candidate using multi-stage filtering + best := utils.PickBestUnionCandidate(candidates, data) + if best == nil { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for Value2", string(data)) + } + + // Set the union type and value based on the best candidate + u.Type = best.Type.(Value2Type) + switch best.Type { + case Value2TypeStr: + u.Str = best.Value.(*string) + return nil + case Value2TypeNumber: + u.Number = best.Value.(*float64) + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for Value2", string(data)) +} + +func (u Value2) MarshalJSON() ([]byte, error) { + if u.Str != nil { + return utils.MarshalJSON(u.Str, "", true) + } + + if u.Number != nil { + return utils.MarshalJSON(u.Number, "", true) + } + + return nil, errors.New("could not marshal union type Value2: all fields are null") +} + +type Value1Type string + +const ( + Value1TypeStr Value1Type = "str" + Value1TypeNumber Value1Type = "number" + Value1TypeArrayOfValue2 Value1Type = "arrayOfValue2" +) + +// Value1 - Filter value (scalar or array depending on operator) +type Value1 struct { + Str *string `queryParam:"inline" union:"member"` + Number *float64 `queryParam:"inline" union:"member"` + ArrayOfValue2 []Value2 `queryParam:"inline" union:"member"` + + Type Value1Type +} + +func CreateValue1Str(str string) Value1 { + typ := Value1TypeStr + + return Value1{ + Str: &str, + Type: typ, + } +} + +func CreateValue1Number(number float64) Value1 { + typ := Value1TypeNumber + + return Value1{ + Number: &number, + Type: typ, + } +} + +func CreateValue1ArrayOfValue2(arrayOfValue2 []Value2) Value1 { + typ := Value1TypeArrayOfValue2 + + return Value1{ + ArrayOfValue2: arrayOfValue2, + Type: typ, + } +} + +func (u *Value1) UnmarshalJSON(data []byte) error { + + var candidates []utils.UnionCandidate + + // Collect all valid candidates + var str string = "" + if err := utils.UnmarshalJSON(data, &str, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: Value1TypeStr, + Value: &str, + }) + } + + var number float64 = float64(0) + if err := utils.UnmarshalJSON(data, &number, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: Value1TypeNumber, + Value: &number, + }) + } + + var arrayOfValue2 []Value2 = []Value2{} + if err := utils.UnmarshalJSON(data, &arrayOfValue2, "", true, nil); err == nil { + candidates = append(candidates, utils.UnionCandidate{ + Type: Value1TypeArrayOfValue2, + Value: arrayOfValue2, + }) + } + + if len(candidates) == 0 { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for Value1", string(data)) + } + + // Pick the best candidate using multi-stage filtering + best := utils.PickBestUnionCandidate(candidates, data) + if best == nil { + return fmt.Errorf("could not unmarshal `%s` into any supported union types for Value1", string(data)) + } + + // Set the union type and value based on the best candidate + u.Type = best.Type.(Value1Type) + switch best.Type { + case Value1TypeStr: + u.Str = best.Value.(*string) + return nil + case Value1TypeNumber: + u.Number = best.Value.(*float64) + return nil + case Value1TypeArrayOfValue2: + u.ArrayOfValue2 = best.Value.([]Value2) + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for Value1", string(data)) +} + +func (u Value1) MarshalJSON() ([]byte, error) { + if u.Str != nil { + return utils.MarshalJSON(u.Str, "", true) + } + + if u.Number != nil { + return utils.MarshalJSON(u.Number, "", true) + } + + if u.ArrayOfValue2 != nil { + return utils.MarshalJSON(u.ArrayOfValue2, "", true) + } + + return nil, errors.New("could not marshal union type Value1: all fields are null") +} + +type Filter struct { + // Dimension to filter on + Field string `json:"field"` + // Filter operator + Operator string `json:"operator"` + // Filter value (scalar or array depending on operator) + Value Value1 `json:"value"` +} + +func (f *Filter) GetField() string { + if f == nil { + return "" + } + return f.Field +} + +func (f *Filter) GetOperator() string { + if f == nil { + return "" + } + return f.Operator +} + +func (f *Filter) GetValue() Value1 { + if f == nil { + return Value1{} + } + return f.Value +} + +type Direction string + +const ( + DirectionAsc Direction = "asc" + DirectionDesc Direction = "desc" +) + +func (e Direction) ToPointer() *Direction { + return &e +} + +// IsExact returns true if the value matches a known enum value, false otherwise. +func (e *Direction) IsExact() bool { + if e != nil { + switch *e { + case "asc", "desc": + return true + } + } + return false +} + +type OrderBy struct { + Direction Direction `json:"direction"` + // Field to order by + Field string `json:"field"` +} + +func (o *OrderBy) GetDirection() Direction { + if o == nil { + return Direction("") + } + return o.Direction +} + +func (o *OrderBy) GetField() string { + if o == nil { + return "" + } + return o.Field +} + +type TimeRange struct { + End time.Time `json:"end"` + Start time.Time `json:"start"` +} + +func (t TimeRange) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TimeRange) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *TimeRange) GetEnd() time.Time { + if t == nil { + return time.Time{} + } + return t.End +} + +func (t *TimeRange) GetStart() time.Time { + if t == nil { + return time.Time{} + } + return t.Start +} + +type QueryAnalyticsRequest struct { + Dimensions []string `json:"dimensions,omitzero"` + Filters []Filter `json:"filters,omitzero"` + // Time granularity + Granularity *string `json:"granularity,omitzero"` + // Maximum rows per distinct combination of dimensions. When omitted on time-series queries (granularity + dimensions), auto-computed to avoid truncating time windows. Explicit values override the default and may truncate time buckets if set lower than the number of buckets in the range. Ignored when no dimensions are specified. + GroupLimit *int64 `json:"group_limit,omitzero"` + // Maximum total rows returned. Defaults to 1000. On time-series queries with dimensions and no explicit group_limit, the server may raise this to accommodate the expected number of unique time-bucket/dimension combinations. + Limit *int64 `json:"limit,omitzero"` + Metrics []string `json:"metrics"` + OrderBy *OrderBy `json:"order_by,omitzero"` + TimeRange *TimeRange `json:"time_range,omitzero"` +} + +func (q QueryAnalyticsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(q, "", false) +} + +func (q *QueryAnalyticsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &q, "", false, nil); err != nil { + return err + } + return nil +} + +func (q *QueryAnalyticsRequest) GetDimensions() []string { + if q == nil { + return nil + } + return q.Dimensions +} + +func (q *QueryAnalyticsRequest) GetFilters() []Filter { + if q == nil { + return nil + } + return q.Filters +} + +func (q *QueryAnalyticsRequest) GetGranularity() *string { + if q == nil { + return nil + } + return q.Granularity +} + +func (q *QueryAnalyticsRequest) GetGroupLimit() *int64 { + if q == nil { + return nil + } + return q.GroupLimit +} + +func (q *QueryAnalyticsRequest) GetLimit() *int64 { + if q == nil { + return nil + } + return q.Limit +} + +func (q *QueryAnalyticsRequest) GetMetrics() []string { + if q == nil { + return []string{} + } + return q.Metrics +} + +func (q *QueryAnalyticsRequest) GetOrderBy() *OrderBy { + if q == nil { + return nil + } + return q.OrderBy +} + +func (q *QueryAnalyticsRequest) GetTimeRange() *TimeRange { + if q == nil { + return nil + } + return q.TimeRange +} + +// QueryAnalyticsData1 - A row of analytics data with metric/dimension values +type QueryAnalyticsData1 struct { +} + +// #region class-body-queryanalyticsdata1 +// #endregion class-body-queryanalyticsdata1 + +type Metadata struct { + QueryTimeMs float64 `json:"query_time_ms"` + RowCount int64 `json:"row_count"` + Truncated bool `json:"truncated"` +} + +func (m *Metadata) GetQueryTimeMs() float64 { + if m == nil { + return 0.0 + } + return m.QueryTimeMs +} + +func (m *Metadata) GetRowCount() int64 { + if m == nil { + return 0 + } + return m.RowCount +} + +func (m *Metadata) GetTruncated() bool { + if m == nil { + return false + } + return m.Truncated +} + +type QueryAnalyticsData2 struct { + CachedAt *float64 `json:"cachedAt,omitzero"` + Data []QueryAnalyticsData1 `json:"data"` + Metadata Metadata `json:"metadata"` +} + +func (q *QueryAnalyticsData2) GetCachedAt() *float64 { + if q == nil { + return nil + } + return q.CachedAt +} + +func (q *QueryAnalyticsData2) GetData() []QueryAnalyticsData1 { + if q == nil { + return []QueryAnalyticsData1{} + } + return q.Data +} + +func (q *QueryAnalyticsData2) GetMetadata() Metadata { + if q == nil { + return Metadata{} + } + return q.Metadata +} + +// #region class-body-queryanalyticsdata2 +// #endregion class-body-queryanalyticsdata2 + +// QueryAnalyticsResponse - Analytics query results +type QueryAnalyticsResponse struct { + Data QueryAnalyticsData2 `json:"data"` +} + +func (q *QueryAnalyticsResponse) GetData() QueryAnalyticsData2 { + if q == nil { + return QueryAnalyticsData2{} + } + return q.Data +} diff --git a/models/operations/sendchatcompletionrequest.go b/models/operations/sendchatcompletionrequest.go index c53221d0..33f53b6f 100644 --- a/models/operations/sendchatcompletionrequest.go +++ b/models/operations/sendchatcompletionrequest.go @@ -10,21 +10,24 @@ import ( "github.com/OpenRouterTeam/go-sdk/types/stream" ) -// SendChatCompletionRequestResponseBody - Successful chat completion response -type SendChatCompletionRequestResponseBody struct { - // Streaming chat completion chunk - Data components.ChatStreamChunk `json:"data"` +type SendChatCompletionRequestRequest struct { + // Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility. + XOpenRouterMetadata *components.MetadataLevel `header:"style=simple,explode=false,name=X-OpenRouter-Metadata"` + ChatRequest components.ChatRequest `request:"mediaType=application/json"` } -func (s *SendChatCompletionRequestResponseBody) GetData() components.ChatStreamChunk { +func (s *SendChatCompletionRequestRequest) GetXOpenRouterMetadata() *components.MetadataLevel { if s == nil { - return components.ChatStreamChunk{} + return nil } - return s.Data + return s.XOpenRouterMetadata } -func (s SendChatCompletionRequestResponseBody) GetEventEncoding(event string) (string, error) { - return "application/json", nil +func (s *SendChatCompletionRequestRequest) GetChatRequest() components.ChatRequest { + if s == nil { + return components.ChatRequest{} + } + return s.ChatRequest } type SendChatCompletionRequestResponseType string @@ -35,8 +38,8 @@ const ( ) type SendChatCompletionRequestResponse struct { - ChatResult *components.ChatResult `queryParam:"inline" union:"member"` - EventStream *stream.EventStream[SendChatCompletionRequestResponseBody] `queryParam:"inline" union:"member"` + ChatResult *components.ChatResult `queryParam:"inline" union:"member"` + EventStream *stream.EventStream[components.ChatStreamingResponse] `queryParam:"inline" union:"member"` Type SendChatCompletionRequestResponseType } @@ -50,7 +53,7 @@ func CreateSendChatCompletionRequestResponseChatResult(chatResult components.Cha } } -func CreateSendChatCompletionRequestResponseEventStream(eventStream *stream.EventStream[SendChatCompletionRequestResponseBody]) SendChatCompletionRequestResponse { +func CreateSendChatCompletionRequestResponseEventStream(eventStream *stream.EventStream[components.ChatStreamingResponse]) SendChatCompletionRequestResponse { typ := SendChatCompletionRequestResponseTypeEventStream return SendChatCompletionRequestResponse{ @@ -72,7 +75,7 @@ func (u *SendChatCompletionRequestResponse) UnmarshalJSON(data []byte) error { }) } - var eventStream *stream.EventStream[SendChatCompletionRequestResponseBody] = &stream.EventStream[SendChatCompletionRequestResponseBody]{} + var eventStream *stream.EventStream[components.ChatStreamingResponse] = &stream.EventStream[components.ChatStreamingResponse]{} if err := utils.UnmarshalJSON(data, &eventStream, "", true, nil); err == nil { candidates = append(candidates, utils.UnionCandidate{ Type: SendChatCompletionRequestResponseTypeEventStream, @@ -97,7 +100,7 @@ func (u *SendChatCompletionRequestResponse) UnmarshalJSON(data []byte) error { u.ChatResult = best.Value.(*components.ChatResult) return nil case SendChatCompletionRequestResponseTypeEventStream: - u.EventStream = best.Value.(*stream.EventStream[SendChatCompletionRequestResponseBody]) + u.EventStream = best.Value.(*stream.EventStream[components.ChatStreamingResponse]) return nil } diff --git a/models/operations/updatebyokkey.go b/models/operations/updatebyokkey.go new file mode 100644 index 00000000..f5af8797 --- /dev/null +++ b/models/operations/updatebyokkey.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +type UpdateBYOKKeyRequest struct { + // The BYOK credential ID (UUID). + ID string `pathParam:"style=simple,explode=false,name=id"` + UpdateBYOKKeyRequest components.UpdateBYOKKeyRequest `request:"mediaType=application/json"` +} + +func (u *UpdateBYOKKeyRequest) GetID() string { + if u == nil { + return "" + } + return u.ID +} + +func (u *UpdateBYOKKeyRequest) GetUpdateBYOKKeyRequest() components.UpdateBYOKKeyRequest { + if u == nil { + return components.UpdateBYOKKeyRequest{} + } + return u.UpdateBYOKKeyRequest +} diff --git a/models/operations/updateobservabilitydestination.go b/models/operations/updateobservabilitydestination.go new file mode 100644 index 00000000..c8d3a3b1 --- /dev/null +++ b/models/operations/updateobservabilitydestination.go @@ -0,0 +1,27 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/OpenRouterTeam/go-sdk/models/components" +) + +type UpdateObservabilityDestinationRequest struct { + // The destination ID (UUID). + ID string `pathParam:"style=simple,explode=false,name=id"` + UpdateObservabilityDestinationRequest components.UpdateObservabilityDestinationRequest `request:"mediaType=application/json"` +} + +func (u *UpdateObservabilityDestinationRequest) GetID() string { + if u == nil { + return "" + } + return u.ID +} + +func (u *UpdateObservabilityDestinationRequest) GetUpdateObservabilityDestinationRequest() components.UpdateObservabilityDestinationRequest { + if u == nil { + return components.UpdateObservabilityDestinationRequest{} + } + return u.UpdateObservabilityDestinationRequest +} diff --git a/models/operations/uploadfile.go b/models/operations/uploadfile.go new file mode 100644 index 00000000..58ef1a96 --- /dev/null +++ b/models/operations/uploadfile.go @@ -0,0 +1,54 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +type File struct { + FileName string `multipartForm:"name=fileName"` + // This field accepts []byte data or io.Reader implementations, such as *os.File. + Content any `multipartForm:"content"` +} + +func (f *File) GetFileName() string { + if f == nil { + return "" + } + return f.FileName +} + +func (f *File) GetContent() any { + if f == nil { + return nil + } + return f.Content +} + +type UploadFileRequestBody struct { + File File `multipartForm:"file,name=file"` +} + +func (u *UploadFileRequestBody) GetFile() File { + if u == nil { + return File{} + } + return u.File +} + +type UploadFileRequest struct { + // Workspace to scope the request to. Defaults to the caller’s default workspace. + WorkspaceID *string `queryParam:"style=form,explode=true,name=workspace_id"` + RequestBody UploadFileRequestBody `request:"mediaType=multipart/form-data"` +} + +func (u *UploadFileRequest) GetWorkspaceID() *string { + if u == nil { + return nil + } + return u.WorkspaceID +} + +func (u *UploadFileRequest) GetRequestBody() UploadFileRequestBody { + if u == nil { + return UploadFileRequestBody{} + } + return u.RequestBody +} diff --git a/models/sdkerrors/badgatewayresponseerror.go b/models/sdkerrors/badgatewayresponseerror.go index 4e1b6c20..45efaed7 100644 --- a/models/sdkerrors/badgatewayresponseerror.go +++ b/models/sdkerrors/badgatewayresponseerror.go @@ -10,8 +10,9 @@ import ( // BadGatewayResponseError - Bad Gateway - Provider/upstream API failure type BadGatewayResponseError struct { // Error data for BadGatewayResponse - Error_ components.BadGatewayResponseErrorData `json:"error"` - UserID *string `json:"user_id,omitzero"` + Error_ components.BadGatewayResponseErrorData `json:"error"` + OpenrouterMetadata map[string]any `json:"openrouter_metadata,omitzero"` + UserID *string `json:"user_id,omitzero"` } var _ error = &BadGatewayResponseError{} diff --git a/models/sdkerrors/badrequestresponseerror.go b/models/sdkerrors/badrequestresponseerror.go index 116963d8..b35c26f8 100644 --- a/models/sdkerrors/badrequestresponseerror.go +++ b/models/sdkerrors/badrequestresponseerror.go @@ -10,8 +10,9 @@ import ( // BadRequestResponseError - Bad Request - Invalid request parameters or malformed input type BadRequestResponseError struct { // Error data for BadRequestResponse - Error_ components.BadRequestResponseErrorData `json:"error"` - UserID *string `json:"user_id,omitzero"` + Error_ components.BadRequestResponseErrorData `json:"error"` + OpenrouterMetadata map[string]any `json:"openrouter_metadata,omitzero"` + UserID *string `json:"user_id,omitzero"` } var _ error = &BadRequestResponseError{} diff --git a/models/sdkerrors/conflictresponseerror.go b/models/sdkerrors/conflictresponseerror.go index 20e498e5..266bec80 100644 --- a/models/sdkerrors/conflictresponseerror.go +++ b/models/sdkerrors/conflictresponseerror.go @@ -10,8 +10,9 @@ import ( // ConflictResponseError - Conflict - Resource conflict or concurrent modification type ConflictResponseError struct { // Error data for ConflictResponse - Error_ components.ConflictResponseErrorData `json:"error"` - UserID *string `json:"user_id,omitzero"` + Error_ components.ConflictResponseErrorData `json:"error"` + OpenrouterMetadata map[string]any `json:"openrouter_metadata,omitzero"` + UserID *string `json:"user_id,omitzero"` } var _ error = &ConflictResponseError{} diff --git a/models/sdkerrors/edgenetworktimeoutresponseerror.go b/models/sdkerrors/edgenetworktimeoutresponseerror.go index 69e96cc9..dc2639bb 100644 --- a/models/sdkerrors/edgenetworktimeoutresponseerror.go +++ b/models/sdkerrors/edgenetworktimeoutresponseerror.go @@ -10,8 +10,9 @@ import ( // EdgeNetworkTimeoutResponseError - Infrastructure Timeout - Provider request timed out at edge network type EdgeNetworkTimeoutResponseError struct { // Error data for EdgeNetworkTimeoutResponse - Error_ components.EdgeNetworkTimeoutResponseErrorData `json:"error"` - UserID *string `json:"user_id,omitzero"` + Error_ components.EdgeNetworkTimeoutResponseErrorData `json:"error"` + OpenrouterMetadata map[string]any `json:"openrouter_metadata,omitzero"` + UserID *string `json:"user_id,omitzero"` } var _ error = &EdgeNetworkTimeoutResponseError{} diff --git a/models/sdkerrors/forbiddenresponseerror.go b/models/sdkerrors/forbiddenresponseerror.go index fc8bdef4..aab19773 100644 --- a/models/sdkerrors/forbiddenresponseerror.go +++ b/models/sdkerrors/forbiddenresponseerror.go @@ -10,8 +10,9 @@ import ( // ForbiddenResponseError - Forbidden - Authentication successful but insufficient permissions type ForbiddenResponseError struct { // Error data for ForbiddenResponse - Error_ components.ForbiddenResponseErrorData `json:"error"` - UserID *string `json:"user_id,omitzero"` + Error_ components.ForbiddenResponseErrorData `json:"error"` + OpenrouterMetadata map[string]any `json:"openrouter_metadata,omitzero"` + UserID *string `json:"user_id,omitzero"` } var _ error = &ForbiddenResponseError{} diff --git a/models/sdkerrors/internalserverresponseerror.go b/models/sdkerrors/internalserverresponseerror.go index b1ba8bea..8c9ead45 100644 --- a/models/sdkerrors/internalserverresponseerror.go +++ b/models/sdkerrors/internalserverresponseerror.go @@ -10,8 +10,9 @@ import ( // InternalServerResponseError - Internal Server Error - Unexpected server error type InternalServerResponseError struct { // Error data for InternalServerResponse - Error_ components.InternalServerResponseErrorData `json:"error"` - UserID *string `json:"user_id,omitzero"` + Error_ components.InternalServerResponseErrorData `json:"error"` + OpenrouterMetadata map[string]any `json:"openrouter_metadata,omitzero"` + UserID *string `json:"user_id,omitzero"` } var _ error = &InternalServerResponseError{} diff --git a/models/sdkerrors/notfoundresponseerror.go b/models/sdkerrors/notfoundresponseerror.go index b672d12b..44e219b9 100644 --- a/models/sdkerrors/notfoundresponseerror.go +++ b/models/sdkerrors/notfoundresponseerror.go @@ -10,8 +10,9 @@ import ( // NotFoundResponseError - Not Found - Resource does not exist type NotFoundResponseError struct { // Error data for NotFoundResponse - Error_ components.NotFoundResponseErrorData `json:"error"` - UserID *string `json:"user_id,omitzero"` + Error_ components.NotFoundResponseErrorData `json:"error"` + OpenrouterMetadata map[string]any `json:"openrouter_metadata,omitzero"` + UserID *string `json:"user_id,omitzero"` } var _ error = &NotFoundResponseError{} diff --git a/models/sdkerrors/payloadtoolargeresponseerror.go b/models/sdkerrors/payloadtoolargeresponseerror.go index ecf8abbd..6bc7699e 100644 --- a/models/sdkerrors/payloadtoolargeresponseerror.go +++ b/models/sdkerrors/payloadtoolargeresponseerror.go @@ -10,8 +10,9 @@ import ( // PayloadTooLargeResponseError - Payload Too Large - Request payload exceeds size limits type PayloadTooLargeResponseError struct { // Error data for PayloadTooLargeResponse - Error_ components.PayloadTooLargeResponseErrorData `json:"error"` - UserID *string `json:"user_id,omitzero"` + Error_ components.PayloadTooLargeResponseErrorData `json:"error"` + OpenrouterMetadata map[string]any `json:"openrouter_metadata,omitzero"` + UserID *string `json:"user_id,omitzero"` } var _ error = &PayloadTooLargeResponseError{} diff --git a/models/sdkerrors/paymentrequiredresponseerror.go b/models/sdkerrors/paymentrequiredresponseerror.go index e9ed0fb7..d9b70485 100644 --- a/models/sdkerrors/paymentrequiredresponseerror.go +++ b/models/sdkerrors/paymentrequiredresponseerror.go @@ -10,8 +10,9 @@ import ( // PaymentRequiredResponseError - Payment Required - Insufficient credits or quota to complete request type PaymentRequiredResponseError struct { // Error data for PaymentRequiredResponse - Error_ components.PaymentRequiredResponseErrorData `json:"error"` - UserID *string `json:"user_id,omitzero"` + Error_ components.PaymentRequiredResponseErrorData `json:"error"` + OpenrouterMetadata map[string]any `json:"openrouter_metadata,omitzero"` + UserID *string `json:"user_id,omitzero"` } var _ error = &PaymentRequiredResponseError{} diff --git a/models/sdkerrors/provideroverloadedresponseerror.go b/models/sdkerrors/provideroverloadedresponseerror.go index d94d5fcb..29d399fa 100644 --- a/models/sdkerrors/provideroverloadedresponseerror.go +++ b/models/sdkerrors/provideroverloadedresponseerror.go @@ -10,8 +10,9 @@ import ( // ProviderOverloadedResponseError - Provider Overloaded - Provider is temporarily overloaded type ProviderOverloadedResponseError struct { // Error data for ProviderOverloadedResponse - Error_ components.ProviderOverloadedResponseErrorData `json:"error"` - UserID *string `json:"user_id,omitzero"` + Error_ components.ProviderOverloadedResponseErrorData `json:"error"` + OpenrouterMetadata map[string]any `json:"openrouter_metadata,omitzero"` + UserID *string `json:"user_id,omitzero"` } var _ error = &ProviderOverloadedResponseError{} diff --git a/models/sdkerrors/requesttimeoutresponseerror.go b/models/sdkerrors/requesttimeoutresponseerror.go index d302c2ea..ecab326f 100644 --- a/models/sdkerrors/requesttimeoutresponseerror.go +++ b/models/sdkerrors/requesttimeoutresponseerror.go @@ -10,8 +10,9 @@ import ( // RequestTimeoutResponseError - Request Timeout - Operation exceeded time limit type RequestTimeoutResponseError struct { // Error data for RequestTimeoutResponse - Error_ components.RequestTimeoutResponseErrorData `json:"error"` - UserID *string `json:"user_id,omitzero"` + Error_ components.RequestTimeoutResponseErrorData `json:"error"` + OpenrouterMetadata map[string]any `json:"openrouter_metadata,omitzero"` + UserID *string `json:"user_id,omitzero"` } var _ error = &RequestTimeoutResponseError{} diff --git a/models/sdkerrors/serviceunavailableresponseerror.go b/models/sdkerrors/serviceunavailableresponseerror.go index 76602b82..3a52ac7f 100644 --- a/models/sdkerrors/serviceunavailableresponseerror.go +++ b/models/sdkerrors/serviceunavailableresponseerror.go @@ -10,8 +10,9 @@ import ( // ServiceUnavailableResponseError - Service Unavailable - Service temporarily unavailable type ServiceUnavailableResponseError struct { // Error data for ServiceUnavailableResponse - Error_ components.ServiceUnavailableResponseErrorData `json:"error"` - UserID *string `json:"user_id,omitzero"` + Error_ components.ServiceUnavailableResponseErrorData `json:"error"` + OpenrouterMetadata map[string]any `json:"openrouter_metadata,omitzero"` + UserID *string `json:"user_id,omitzero"` } var _ error = &ServiceUnavailableResponseError{} diff --git a/models/sdkerrors/toomanyrequestsresponseerror.go b/models/sdkerrors/toomanyrequestsresponseerror.go index 2264435c..492a5c0d 100644 --- a/models/sdkerrors/toomanyrequestsresponseerror.go +++ b/models/sdkerrors/toomanyrequestsresponseerror.go @@ -10,8 +10,9 @@ import ( // TooManyRequestsResponseError - Too Many Requests - Rate limit exceeded type TooManyRequestsResponseError struct { // Error data for TooManyRequestsResponse - Error_ components.TooManyRequestsResponseErrorData `json:"error"` - UserID *string `json:"user_id,omitzero"` + Error_ components.TooManyRequestsResponseErrorData `json:"error"` + OpenrouterMetadata map[string]any `json:"openrouter_metadata,omitzero"` + UserID *string `json:"user_id,omitzero"` } var _ error = &TooManyRequestsResponseError{} diff --git a/models/sdkerrors/unauthorizedresponseerror.go b/models/sdkerrors/unauthorizedresponseerror.go index 4abeb4a3..b3a4b821 100644 --- a/models/sdkerrors/unauthorizedresponseerror.go +++ b/models/sdkerrors/unauthorizedresponseerror.go @@ -10,8 +10,9 @@ import ( // UnauthorizedResponseError - Unauthorized - Authentication required or invalid credentials type UnauthorizedResponseError struct { // Error data for UnauthorizedResponse - Error_ components.UnauthorizedResponseErrorData `json:"error"` - UserID *string `json:"user_id,omitzero"` + Error_ components.UnauthorizedResponseErrorData `json:"error"` + OpenrouterMetadata map[string]any `json:"openrouter_metadata,omitzero"` + UserID *string `json:"user_id,omitzero"` } var _ error = &UnauthorizedResponseError{} diff --git a/models/sdkerrors/unprocessableentityresponseerror.go b/models/sdkerrors/unprocessableentityresponseerror.go index 22440c00..dc9953e2 100644 --- a/models/sdkerrors/unprocessableentityresponseerror.go +++ b/models/sdkerrors/unprocessableentityresponseerror.go @@ -10,8 +10,9 @@ import ( // UnprocessableEntityResponseError - Unprocessable Entity - Semantic validation failure type UnprocessableEntityResponseError struct { // Error data for UnprocessableEntityResponse - Error_ components.UnprocessableEntityResponseErrorData `json:"error"` - UserID *string `json:"user_id,omitzero"` + Error_ components.UnprocessableEntityResponseErrorData `json:"error"` + OpenrouterMetadata map[string]any `json:"openrouter_metadata,omitzero"` + UserID *string `json:"user_id,omitzero"` } var _ error = &UnprocessableEntityResponseError{} diff --git a/oauth.go b/oauth.go index 3199c027..2fe4b5d8 100644 --- a/oauth.go +++ b/oauth.go @@ -182,7 +182,7 @@ func (s *OAuth) ExchangeAuthCodeForAPIKey(ctx context.Context, request operation _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "403", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -457,7 +457,7 @@ func (s *OAuth) CreateAuthCode(ctx context.Context, request operations.CreateAut _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "409", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -528,6 +528,27 @@ func (s *OAuth) CreateAuthCode(ctx context.Context, request operations.CreateAut return nil, err } + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 403: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.ForbiddenResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + return nil, &out default: rawBody, err := utils.ConsumeRawBody(httpRes) diff --git a/observability.go b/observability.go new file mode 100644 index 00000000..3dc1d1bf --- /dev/null +++ b/observability.go @@ -0,0 +1,1524 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package openrouter + +import ( + "bytes" + "context" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/config" + "github.com/OpenRouterTeam/go-sdk/internal/hooks" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/models/components" + "github.com/OpenRouterTeam/go-sdk/models/operations" + "github.com/OpenRouterTeam/go-sdk/models/sdkerrors" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" + "github.com/OpenRouterTeam/go-sdk/retry" + "github.com/spyzhov/ajson" + "net/http" + "net/url" +) + +// Observability endpoints +type Observability struct { + rootSDK *OpenRouter + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newObservability(rootSDK *OpenRouter, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Observability { + return &Observability{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// List observability destinations +// List the observability destinations configured for the authenticated entity's default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace. Only destinations with stable release status are surfaced — destinations of other types are excluded. [Management key](/docs/guides/overview/auth/management-api-keys) required. +func (s *Observability) List(ctx context.Context, offset optionalnullable.OptionalNullable[int64], limit *int64, workspaceID *string, opts ...operations.Option) (*operations.ListObservabilityDestinationsResponse, error) { + request := operations.ListObservabilityDestinationsRequest{ + Offset: offset, + Limit: limit, + WorkspaceID: workspaceID, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/observability/destinations") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "listObservabilityDestinations", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListObservabilityDestinationsResponse{} + res.Next = func() (*operations.ListObservabilityDestinationsResponse, error) { + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + b, err := ajson.Unmarshal(rawBody) + if err != nil { + return nil, err + } + + oS := 0 + if offsetVal, ok := offset.Get(); ok && offsetVal != nil { + oS = int(*offsetVal) + } + r, err := ajson.Eval(b, "$.data") + if err != nil { + return nil, err + } + if !r.IsArray() { + return nil, nil + } + arr, err := r.GetArray() + if err != nil { + return nil, err + } + if len(arr) == 0 { + return nil, nil + } + + l := 0 + if limit != nil { + l = int(*limit) + } + if len(arr) < l { + return nil, nil + } + nOS := int64(oS + len(arr)) + + return s.List( + ctx, + optionalnullable.From(&nOS), + limit, + workspaceID, + opts..., + ) + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.ListObservabilityDestinationsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Result = out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Create an observability destination +// Create a new observability destination. A maximum of 5 destinations per type is allowed. Defaults to the authenticated entity's default workspace; use the `workspace_id` body field to scope to a different workspace. [Management key](/docs/guides/overview/auth/management-api-keys) required. +func (s *Observability) Create(ctx context.Context, request components.CreateObservabilityDestinationRequest, opts ...operations.Option) (*components.CreateObservabilityDestinationResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/observability/destinations") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "createObservabilityDestination", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 201: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.CreateObservabilityDestinationResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.BadRequestResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 403: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.ForbiddenResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 409: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.ConflictResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} + +// Delete an observability destination +// Delete an existing observability destination. This performs a soft delete. [Management key](/docs/guides/overview/auth/management-api-keys) required. +func (s *Observability) Delete(ctx context.Context, id string, opts ...operations.Option) (*components.DeleteObservabilityDestinationResponse, error) { + request := operations.DeleteObservabilityDestinationRequest{ + ID: id, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/observability/destinations/{id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "deleteObservabilityDestination", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.DeleteObservabilityDestinationResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.NotFoundResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} + +// Get an observability destination +// Fetch a single observability destination by its UUID. [Management key](/docs/guides/overview/auth/management-api-keys) required. +func (s *Observability) Get(ctx context.Context, id string, opts ...operations.Option) (*components.GetObservabilityDestinationResponse, error) { + request := operations.GetObservabilityDestinationRequest{ + ID: id, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/observability/destinations/{id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getObservabilityDestination", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.GetObservabilityDestinationResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.NotFoundResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} + +// Update an observability destination +// Update an existing observability destination. Only the fields provided in the request body are updated. [Management key](/docs/guides/overview/auth/management-api-keys) required. +func (s *Observability) Update(ctx context.Context, id string, updateObservabilityDestinationRequest components.UpdateObservabilityDestinationRequest, opts ...operations.Option) (*components.UpdateObservabilityDestinationResponse, error) { + request := operations.UpdateObservabilityDestinationRequest{ + ID: id, + UpdateObservabilityDestinationRequest: updateObservabilityDestinationRequest, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/observability/destinations/{id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "updateObservabilityDestination", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "UpdateObservabilityDestinationRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PATCH", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.UpdateObservabilityDestinationResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.BadRequestResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.NotFoundResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 409: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.ConflictResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} diff --git a/openrouter.go b/openrouter.go index b955a99c..8a4e3724 100644 --- a/openrouter.go +++ b/openrouter.go @@ -2,7 +2,7 @@ package openrouter -// Generated from OpenAPI doc version 1.0.0 and generator version 2.879.6 +// Generated from OpenAPI doc version 1.0.0 and generator version 2.904.2 import ( "context" @@ -60,17 +60,26 @@ type OpenRouter struct { SDKVersion string // Analytics and usage endpoints Analytics *Analytics + Beta *Beta // Text-to-speech endpoints Tts *Tts + // Speech-to-text endpoints + Stt *Stt // OAuth authentication endpoints OAuth *OAuth - Chat *Chat + // BYOK endpoints + Byok *Byok + Chat *Chat // Credit management endpoints Credits *Credits + // Datasets endpoints + Datasets *Datasets // Text embedding endpoints Embeddings *Embeddings // Endpoint information Endpoints *Endpoints + // Files endpoints + Files *Files // Generation history endpoints Generations *Generations // Guardrails endpoints @@ -79,13 +88,16 @@ type OpenRouter struct { APIKeys *APIKeys // Model information endpoints Models *Models + // Observability endpoints + Observability *Observability // Organization endpoints Organization *Organization + // Presets endpoints + Presets *Presets // Provider information endpoints Providers *Providers // Rerank endpoints Rerank *Rerank - Beta *Beta // Video Generation endpoints VideoGeneration *VideoGeneration // Workspaces endpoints @@ -181,9 +193,9 @@ func WithTimeout(timeout time.Duration) SDKOption { // New creates a new instance of the SDK with the provided options func New(opts ...SDKOption) *OpenRouter { sdk := &OpenRouter{ - SDKVersion: "0.4.1", + SDKVersion: "0.5.0", sdkConfiguration: config.SDKConfiguration{ - UserAgent: "speakeasy-sdk/go 0.4.1 2.879.6 1.0.0 github.com/OpenRouterTeam/go-sdk", + UserAgent: "speakeasy-sdk/go 0.5.0 2.904.2 1.0.0 github.com/OpenRouterTeam/go-sdk", Globals: globals.Globals{}, ServerList: ServerList, }, @@ -210,20 +222,26 @@ func New(opts ...SDKOption) *OpenRouter { sdk.sdkConfiguration = sdk.hooks.SDKInit(sdk.sdkConfiguration) sdk.Analytics = newAnalytics(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Beta = newBeta(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Tts = newTts(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Stt = newStt(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.OAuth = newOAuth(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Byok = newByok(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Chat = newChat(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Credits = newCredits(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Datasets = newDatasets(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Embeddings = newEmbeddings(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Endpoints = newEndpoints(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Files = newFiles(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Generations = newGenerations(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Guardrails = newGuardrails(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.APIKeys = newAPIKeys(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Models = newModels(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Observability = newObservability(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Organization = newOrganization(sdk, sdk.sdkConfiguration, sdk.hooks) + sdk.Presets = newPresets(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Providers = newProviders(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Rerank = newRerank(sdk, sdk.sdkConfiguration, sdk.hooks) - sdk.Beta = newBeta(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.VideoGeneration = newVideoGeneration(sdk, sdk.sdkConfiguration, sdk.hooks) sdk.Workspaces = newWorkspaces(sdk, sdk.sdkConfiguration, sdk.hooks) diff --git a/organization.go b/organization.go index 6f6fcf1e..ffd0ec32 100644 --- a/organization.go +++ b/organization.go @@ -186,7 +186,7 @@ func (s *Organization) ListMembers(ctx context.Context, offset optionalnullable. _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/presets.go b/presets.go new file mode 100644 index 00000000..dfd0ed5c --- /dev/null +++ b/presets.go @@ -0,0 +1,2338 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package openrouter + +import ( + "bytes" + "context" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/config" + "github.com/OpenRouterTeam/go-sdk/internal/hooks" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/models/components" + "github.com/OpenRouterTeam/go-sdk/models/operations" + "github.com/OpenRouterTeam/go-sdk/models/sdkerrors" + "github.com/OpenRouterTeam/go-sdk/optionalnullable" + "github.com/OpenRouterTeam/go-sdk/retry" + "github.com/spyzhov/ajson" + "net/http" + "net/url" +) + +// Presets endpoints +type Presets struct { + rootSDK *OpenRouter + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newPresets(rootSDK *OpenRouter, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Presets { + return &Presets{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// List presets +// Lists all presets for the authenticated user, ordered by most recently updated first. +// +// If set, this operation will use [Security.APIKey] from the global security. +func (s *Presets) List(ctx context.Context, offset optionalnullable.OptionalNullable[int64], limit *int64, opts ...operations.Option) (*operations.ListPresetsResponse, error) { + request := operations.ListPresetsRequest{ + Offset: offset, + Limit: limit, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/presets") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "listPresets", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security, "APIKey"); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListPresetsResponse{} + res.Next = func() (*operations.ListPresetsResponse, error) { + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + b, err := ajson.Unmarshal(rawBody) + if err != nil { + return nil, err + } + + oS := 0 + if offsetVal, ok := offset.Get(); ok && offsetVal != nil { + oS = int(*offsetVal) + } + r, err := ajson.Eval(b, "$.data") + if err != nil { + return nil, err + } + if !r.IsArray() { + return nil, nil + } + arr, err := r.GetArray() + if err != nil { + return nil, err + } + if len(arr) == 0 { + return nil, nil + } + + l := 0 + if limit != nil { + l = int(*limit) + } + if len(arr) < l { + return nil, nil + } + nOS := int64(oS + len(arr)) + + return s.List( + ctx, + optionalnullable.From(&nOS), + limit, + opts..., + ) + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.ListPresetsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Result = out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.BadRequestResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// Get a preset +// Retrieves a preset by its slug with its currently designated version inline. +// +// If set, this operation will use [Security.APIKey] from the global security. +func (s *Presets) Get(ctx context.Context, slug string, opts ...operations.Option) (*components.GetPresetResponse, error) { + request := operations.GetPresetRequest{ + Slug: slug, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/presets/{slug}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getPreset", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security, "APIKey"); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.GetPresetResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.BadRequestResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.NotFoundResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} + +// CreatePresetsChatCompletions - Create a preset from a chat-completions request body +// Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. `messages`, `stream`, `prompt`) are silently ignored. +// +// If set, this operation will use [Security.APIKey] from the global security. +func (s *Presets) CreatePresetsChatCompletions(ctx context.Context, slug string, chatRequest components.ChatRequest, opts ...operations.Option) (*components.CreatePresetFromInferenceResponse, error) { + request := operations.CreatePresetsChatCompletionsRequest{ + Slug: slug, + ChatRequest: chatRequest, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/presets/{slug}/chat/completions", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "createPresetsChatCompletions", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "ChatRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security, "APIKey"); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.CreatePresetFromInferenceResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.BadRequestResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 403: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.ForbiddenResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.NotFoundResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 409: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.ConflictResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} + +// CreatePresetsMessages - Create a preset from a messages request body +// Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. `messages`, `stream`, `prompt`) are silently ignored. +// +// If set, this operation will use [Security.APIKey] from the global security. +func (s *Presets) CreatePresetsMessages(ctx context.Context, slug string, messagesRequest components.MessagesRequest, opts ...operations.Option) (*components.CreatePresetFromInferenceResponse, error) { + request := operations.CreatePresetsMessagesRequest{ + Slug: slug, + MessagesRequest: messagesRequest, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/presets/{slug}/messages", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "createPresetsMessages", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "MessagesRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security, "APIKey"); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.CreatePresetFromInferenceResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.BadRequestResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 403: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.ForbiddenResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.NotFoundResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 409: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.ConflictResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} + +// CreatePresetsResponses - Create a preset from a responses request body +// Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. `messages`, `stream`, `prompt`) are silently ignored. +// +// If set, this operation will use [Security.APIKey] from the global security. +func (s *Presets) CreatePresetsResponses(ctx context.Context, slug string, responsesRequest components.ResponsesRequest, opts ...operations.Option) (*components.CreatePresetFromInferenceResponse, error) { + request := operations.CreatePresetsResponsesRequest{ + Slug: slug, + ResponsesRequest: responsesRequest, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/presets/{slug}/responses", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "createPresetsResponses", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "ResponsesRequest", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security, "APIKey"); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.CreatePresetFromInferenceResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.BadRequestResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 403: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.ForbiddenResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.NotFoundResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 409: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.ConflictResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} + +// ListVersions - List versions of a preset +// Lists all versions of a preset, ordered by version number ascending (oldest first). +// +// If set, this operation will use [Security.APIKey] from the global security. +func (s *Presets) ListVersions(ctx context.Context, slug string, offset optionalnullable.OptionalNullable[int64], limit *int64, opts ...operations.Option) (*operations.ListPresetVersionsResponse, error) { + request := operations.ListPresetVersionsRequest{ + Slug: slug, + Offset: offset, + Limit: limit, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/presets/{slug}/versions", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "listPresetVersions", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security, "APIKey"); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListPresetVersionsResponse{} + res.Next = func() (*operations.ListPresetVersionsResponse, error) { + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + b, err := ajson.Unmarshal(rawBody) + if err != nil { + return nil, err + } + + oS := 0 + if offsetVal, ok := offset.Get(); ok && offsetVal != nil { + oS = int(*offsetVal) + } + r, err := ajson.Eval(b, "$.data") + if err != nil { + return nil, err + } + if !r.IsArray() { + return nil, nil + } + arr, err := r.GetArray() + if err != nil { + return nil, err + } + if len(arr) == 0 { + return nil, nil + } + + l := 0 + if limit != nil { + l = int(*limit) + } + if len(arr) < l { + return nil, nil + } + nOS := int64(oS + len(arr)) + + return s.ListVersions( + ctx, + slug, + optionalnullable.From(&nOS), + limit, + opts..., + ) + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.ListPresetVersionsResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Result = out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.BadRequestResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.NotFoundResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetVersion - Get a specific version of a preset +// Retrieves a specific version of a preset by its slug and version number. +// +// If set, this operation will use [Security.APIKey] from the global security. +func (s *Presets) GetVersion(ctx context.Context, slug string, version string, opts ...operations.Option) (*components.GetPresetVersionResponse, error) { + request := operations.GetPresetVersionRequest{ + Slug: slug, + Version: version, + } + + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/presets/{slug}/versions/{version}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getPresetVersion", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security, "APIKey"); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.GetPresetVersionResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.BadRequestResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.NotFoundResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} diff --git a/providers.go b/providers.go index 2af1cb36..1faa9d7a 100644 --- a/providers.go +++ b/providers.go @@ -174,7 +174,7 @@ func (s *Providers) List(ctx context.Context, opts ...operations.Option) (*opera _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/rerank.go b/rerank.go index d052db0a..8a8bfc2f 100644 --- a/rerank.go +++ b/rerank.go @@ -188,7 +188,7 @@ func (s *Rerank) Rerank(ctx context.Context, request operations.CreateRerankRequ _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "402", "404", "429", "4XX", "500", "502", "503", "524", "529", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/responses.go b/responses.go index c001ecf0..02ef24cc 100644 --- a/responses.go +++ b/responses.go @@ -35,7 +35,12 @@ func newResponses(rootSDK *OpenRouter, sdkConfig config.SDKConfiguration, hooks // Send - Create a response // Creates a streaming or non-streaming response using OpenResponses API format -func (s *Responses) Send(ctx context.Context, request components.ResponsesRequest, opts ...operations.Option) (*operations.CreateResponsesResponse, error) { +func (s *Responses) Send(ctx context.Context, responsesRequest components.ResponsesRequest, xOpenRouterMetadata *components.MetadataLevel, opts ...operations.Option) (*operations.CreateResponsesResponse, error) { + request := operations.CreateResponsesRequest{ + ResponsesRequest: responsesRequest, + XOpenRouterMetadata: xOpenRouterMetadata, + } + o := operations.Options{} supportedOptions := []string{ operations.SupportedOptionRetries, @@ -69,7 +74,7 @@ func (s *Responses) Send(ctx context.Context, request components.ResponsesReques OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "ResponsesRequest", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err } @@ -100,6 +105,8 @@ func (s *Responses) Send(ctx context.Context, request components.ResponsesReques req.Header.Set("Content-Type", reqContentType) } + utils.PopulateHeaders(ctx, req, request, nil) + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err } @@ -190,7 +197,7 @@ func (s *Responses) Send(ctx context.Context, request components.ResponsesReques _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "402", "404", "408", "413", "422", "429", "4XX", "500", "502", "503", "524", "529", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -222,10 +229,10 @@ func (s *Responses) Send(ctx context.Context, request components.ResponsesReques result := operations.CreateCreateResponsesResponseOpenResponsesResult(out) return &result, nil case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `text/event-stream`): - out := stream.NewEventStream(ctx, httpRes.Body, func(se []byte) (operations.CreateResponsesResponseBody, error) { - var e operations.CreateResponsesResponseBody + out := stream.NewEventStream(ctx, httpRes.Body, func(se []byte) (components.ResponsesStreamingResponse, error) { + var e components.ResponsesStreamingResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(se), &e, ""); err != nil { - return operations.CreateResponsesResponseBody{}, err + return components.ResponsesStreamingResponse{}, err } return e, nil }, "[DONE]") @@ -293,6 +300,27 @@ func (s *Responses) Send(ctx context.Context, request components.ResponsesReques return nil, err } + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 403: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.ForbiddenResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + return nil, &out default: rawBody, err := utils.ConsumeRawBody(httpRes) diff --git a/stt.go b/stt.go new file mode 100644 index 00000000..fbedf08e --- /dev/null +++ b/stt.go @@ -0,0 +1,455 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package openrouter + +import ( + "bytes" + "context" + "fmt" + "github.com/OpenRouterTeam/go-sdk/internal/config" + "github.com/OpenRouterTeam/go-sdk/internal/hooks" + "github.com/OpenRouterTeam/go-sdk/internal/utils" + "github.com/OpenRouterTeam/go-sdk/models/components" + "github.com/OpenRouterTeam/go-sdk/models/operations" + "github.com/OpenRouterTeam/go-sdk/models/sdkerrors" + "github.com/OpenRouterTeam/go-sdk/retry" + "net/http" + "net/url" +) + +// Stt - Speech-to-text endpoints +type Stt struct { + rootSDK *OpenRouter + sdkConfiguration config.SDKConfiguration + hooks *hooks.Hooks +} + +func newStt(rootSDK *OpenRouter, sdkConfig config.SDKConfiguration, hooks *hooks.Hooks) *Stt { + return &Stt{ + rootSDK: rootSDK, + sdkConfiguration: sdkConfig, + hooks: hooks, + } +} + +// CreateTranscription - Create transcription +// Transcribes audio into text. Accepts base64-encoded audio input and returns the transcribed text. +func (s *Stt) CreateTranscription(ctx context.Context, request components.STTRequest, opts ...operations.Option) (*components.STTResponse, error) { + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } + + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) + } + } + + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := url.JoinPath(baseURL, "/audio/transcriptions") + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "createAudioTranscriptions", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig + } else { + retryConfig = &retry.Config{ + Strategy: "backoff", Backoff: &retry.BackoffStrategy{ + InitialInterval: 500, + MaxInterval: 60000, + Exponent: 1.5, + MaxElapsedTime: 3600000, + }, + RetryConnectionErrors: true, + } + } + } + + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "5XX", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() + + if err != nil { + return nil, err + } + + req.Body = copyBody + } + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) + } + + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out components.STTResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return &out, nil + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.BadRequestResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.UnauthorizedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 402: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.PaymentRequiredResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 404: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.NotFoundResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 429: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.TooManyRequestsResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 500: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.InternalServerResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 502: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.BadGatewayResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 503: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.ServiceUnavailableResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 524: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.EdgeNetworkTimeoutResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 529: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.ProviderOverloadedResponseError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return nil, nil + +} diff --git a/tts.go b/tts.go index 4610dbf0..03d77d79 100644 --- a/tts.go +++ b/tts.go @@ -34,7 +34,7 @@ func newTts(rootSDK *OpenRouter, sdkConfig config.SDKConfiguration, hooks *hooks } // CreateSpeech - Create speech -// Synthesizes audio from the input text +// Synthesizes audio from the input text. Returns a raw audio bytestream in the requested format (e.g. mp3, pcm, wav). func (s *Tts) CreateSpeech(ctx context.Context, request components.SpeechRequest, opts ...operations.Option) (io.ReadCloser, error) { o := operations.Options{} supportedOptions := []string{ @@ -184,7 +184,7 @@ func (s *Tts) CreateSpeech(ctx context.Context, request components.SpeechRequest _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "402", "404", "429", "4XX", "500", "502", "503", "524", "529", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/types/stream/stream.go b/types/stream/stream.go index dcc0d374..f590f265 100644 --- a/types/stream/stream.go +++ b/types/stream/stream.go @@ -26,21 +26,41 @@ var ( bom = "\uFEFF" ) -func scanServerEvents(data []byte, atEOF bool) (advance int, token []byte, err error) { - if atEOF && len(data) == 0 { - return 0, nil, nil - } +// maxBoundaryLen is the length of the longest message boundary (\r\n\r\n). +const maxBoundaryLen = 4 + +// maxEventSize bounds a single server-sent event. The scanner buffer grows on +// demand, so this caps pathological streams without reserving memory up front. +const maxEventSize = 1 << 30 + +// newServerEventSplitter returns a stateful bufio.SplitFunc that only re-scans +// the trailing maxBoundaryLen-1 bytes across reads. That keeps large events +// linear to parse while still finding boundaries split across two chunks. +func newServerEventSplitter() bufio.SplitFunc { + scanned := 0 + return func(data []byte, atEOF bool) (advance int, token []byte, err error) { + if atEOF && len(data) == 0 { + return 0, nil, nil + } - result := boundary.FindIndex(data) - if result != nil { - return result[1], data[:result[0]], nil - } + start := scanned - (maxBoundaryLen - 1) + if start < 0 { + start = 0 + } - if atEOF { - return len(data), bytes.TrimRight(data, "\r\n"), nil - } + if result := boundary.FindIndex(data[start:]); result != nil { + scanned = 0 + return start + result[1], data[:start+result[0]], nil + } + + if atEOF { + scanned = 0 + return len(data), bytes.TrimRight(data, "\r\n"), nil + } - return 0, nil, nil + scanned = len(data) + return 0, nil, nil + } } type EventType interface { @@ -70,7 +90,8 @@ func NewEventStream[T any]( opts ...func(*EventStream[T]), ) *EventStream[T] { scanner := bufio.NewScanner(source) - scanner.Split(scanServerEvents) + scanner.Buffer(nil, maxEventSize) + scanner.Split(newServerEventSplitter()) var src io.ReadCloser if s, ok := source.(io.ReadCloser); ok { diff --git a/videogeneration.go b/videogeneration.go index aec763c4..f0a742ea 100644 --- a/videogeneration.go +++ b/videogeneration.go @@ -185,7 +185,7 @@ func (s *VideoGeneration) Generate(ctx context.Context, request components.Video _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "402", "404", "429", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -520,7 +520,7 @@ func (s *VideoGeneration) GetGeneration(ctx context.Context, jobID string, opts _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -797,7 +797,7 @@ func (s *VideoGeneration) GetVideoContent(ctx context.Context, jobID string, ind _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "404", "4XX", "500", "502", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1097,7 +1097,7 @@ func (s *VideoGeneration) ListVideosModels(ctx context.Context, opts ...operatio _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err diff --git a/workspaces.go b/workspaces.go index 09021a19..1a1aa836 100644 --- a/workspaces.go +++ b/workspaces.go @@ -187,7 +187,7 @@ func (s *Workspaces) List(ctx context.Context, offset optionalnullable.OptionalN _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"401", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -489,7 +489,7 @@ func (s *Workspaces) Create(ctx context.Context, request components.CreateWorksp _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -782,7 +782,7 @@ func (s *Workspaces) Delete(ctx context.Context, id string, opts ...operations.O _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1096,7 +1096,7 @@ func (s *Workspaces) Get(ctx context.Context, id string, opts ...operations.Opti _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"401", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1376,7 +1376,7 @@ func (s *Workspaces) Update(ctx context.Context, id string, updateWorkspaceReque _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1698,7 +1698,7 @@ func (s *Workspaces) BulkAddMembers(ctx context.Context, id string, bulkAddWorks _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -2020,7 +2020,7 @@ func (s *Workspaces) BulkRemoveMembers(ctx context.Context, id string, bulkRemov _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "4XX", "500", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err