From 13d706e27496a338a23d5ff5bcc9e7c9bd058d41 Mon Sep 17 00:00:00 2001 From: OpenRouter Team Date: Tue, 17 Mar 2026 02:59:01 +0000 Subject: [PATCH] Commits included in this export: - 35d4e3137846cf3e0a5800e012692818f0dfe309 - b2f10545419cea6b8a12c509f41ec4bd3937af0c - 2dbb7d9612a6e699caa91f334ad105dbde6442ee - 50539a3577b5a7e925b756f6bb87744052701215 - 2cdbe64441ce4435ea0a1ff9127472e815fdaccf - f35bb49a8b788937fa61c0cf4591b14f2bc8b217 - 08a37babde9ad8df5e24e0cd865d3292b1627464 - 7ddc8e1ed230ca489bc11a5e14696c209ea76349 - ad31290f38f3f02627f3e1953f1d7cf3e06159a5 - fb7f764b500618e322f56d49997fbcfaebba7e39 - 4306c032b9b4f3cfefeacdd3d243b0336f3b2f15 GitOrigin-RevId: 35d4e3137846cf3e0a5800e012692818f0dfe309 --- .speakeasy/gen.lock | 214 +- .speakeasy/gen.yaml | 2 +- .speakeasy/in.openapi.yaml | 5710 ++++++++++++++--- .speakeasy/out.openapi.yaml | 5620 ++++++++++++++-- .speakeasy/overlays/add-headers.overlay.yaml | 15 +- .speakeasy/workflow.lock | 10 +- README-PYPI.md | 6 +- README.md | 6 +- USAGE.md | 6 +- docs/components/action.md | 23 + docs/components/actionfindinpage.md | 10 + docs/components/actionopenpage.md | 9 + docs/components/actionsearch.md | 11 + docs/components/allowedtools.md | 9 + docs/components/always.md | 8 + docs/components/assistantmessage.md | 21 +- docs/components/background.md | 10 + docs/components/by.md | 3 +- docs/components/cachecontrol.md | 11 + docs/components/chatcompletionaudiooutput.md | 13 + docs/components/chatgenerationparams.md | 5 +- docs/components/chatgenerationparamsby.md | 3 +- ...hatgenerationparamsidcontextcompression.md | 8 + ...enerationparamsplugincontextcompression.md | 10 + .../chatgenerationparamspluginunion.md | 6 + .../chatgenerationparamspluginweb.md | 16 +- .../chatgenerationparamsprovidersort.md | 3 +- ...tgenerationparamsprovidersortconfigenum.md | 3 +- .../chatgenerationparamssortenum.md | 3 +- .../{ttl.md => chatgenerationparamsttl.md} | 2 +- docs/components/chatgenerationparamstype.md | 8 + docs/components/chatmessagecontentitem.md | 6 + .../chatmessagecontentitemcachecontrol.md | 8 +- .../chatmessagecontentitemcachecontrolttl.md | 9 + docs/components/chatmessagecontentitemfile.md | 11 + .../chatmessagecontentitemfiletype.md | 8 + docs/components/chatmessagetokenlogprobs.md | 2 +- docs/components/chatresponse.md | 2 +- docs/components/chatstreamingmessagechunk.md | 17 +- docs/components/chatstreamingresponsechunk.md | 2 +- docs/components/compoundfilter.md | 11 + docs/components/compoundfiltertype.md | 9 + docs/components/conflictresponseerrordata.md | 12 + docs/components/connectorid.md | 15 + docs/components/container.md | 17 + docs/components/containerauto.md | 10 + docs/components/containertype.md | 8 + docs/components/contextcompressionengine.md | 10 + docs/components/datetimeservertool.md | 11 + .../datetimeservertoolparameters.md | 8 + docs/components/datetimeservertooltype.md | 8 + docs/components/defaultparameters.md | 5 +- docs/components/environment.md | 12 + docs/components/file.md | 10 + docs/components/filters.md | 23 + docs/components/filterstype.md | 13 + docs/components/format_.md | 17 + docs/components/formatgrammar.md | 10 + docs/components/formattext.md | 8 + docs/components/formattypegrammar.md | 8 + docs/components/formattypetext.md | 8 + docs/components/inputfidelity.md | 9 + docs/components/inputimagemask.md | 9 + docs/components/memorylimit.md | 11 + docs/components/modality.md | 3 +- docs/components/model.md | 2 +- docs/components/modelenum.md | 9 + docs/components/moderation.md | 9 + docs/components/never.md | 8 + .../openairesponsesinputfunctioncalloutput.md | 2 +- .../openairesponsesinputmessage1.md | 11 +- .../components/openairesponsesinputoutput1.md | 23 + .../components/openairesponsesinputoutput2.md | 17 + .../openairesponsesinputphasecommentary.md | 8 + .../openairesponsesinputphasefinalanswer.md | 8 + .../openairesponsesinputphaseunion.md | 23 + .../components/openresponsesapplypatchtool.md | 10 + .../openresponsesapplypatchtooltype.md | 8 + .../openresponsescodeinterpretertool.md | 11 + docs/components/openresponsescomputertool.md | 13 + .../openresponsescomputertooltype.md | 8 + docs/components/openresponsescustomtool.md | 13 + .../openresponseseasyinputmessage.md | 11 +- ...nresponseseasyinputmessagecontentunion2.md | 6 + ...esponseseasyinputmessagephasecommentary.md | 8 + ...sponseseasyinputmessagephasefinalanswer.md | 8 + ...openresponseseasyinputmessagephaseunion.md | 25 + .../components/openresponsesfilesearchtool.md | 14 + .../openresponsesfilesearchtoolfilters.md | 10 + .../openresponsesfunctioncalloutput.md | 14 +- .../openresponsesfunctioncalloutputdetail.md | 10 + ...responsesfunctioncalloutputoutputunion1.md | 23 + ...responsesfunctioncalloutputoutputunion2.md | 17 + ...nctioncalloutputtypefunctioncalloutput.md} | 2 +- .../openresponsesfunctionshelltool.md | 10 + .../openresponsesfunctionshelltooltype.md | 8 + .../openresponsesimagegenerationtool.md | 20 + .../openresponsesimagegenerationtooltype.md | 8 + docs/components/openresponsesinputcontent1.md | 17 + docs/components/openresponsesinputcontent2.md | 23 + docs/components/openresponsesinputformat.md | 15 + docs/components/openresponsesinputmessage.md | 15 + .../openresponsesinputmessageitem.md | 2 +- .../openresponsesinputphasecommentary.md | 8 + .../openresponsesinputphasefinalanswer.md | 8 + .../openresponsesinputphaseunion.md | 25 + .../components/openresponsesinputreasoning.md | 17 + docs/components/openresponsesinputrole.md | 8 + .../openresponsesinputstatuscompleted1.md | 8 + .../openresponsesinputstatuscompleted2.md | 8 + .../openresponsesinputstatusincomplete1.md | 8 + .../openresponsesinputstatusincomplete2.md | 8 + .../openresponsesinputstatusinprogress1.md | 8 + .../openresponsesinputstatusinprogress2.md | 8 + .../openresponsesinputstatusunion1.md | 23 + .../openresponsesinputstatusunion2.md | 23 + .../openresponsesinputtypemessage.md | 8 + .../openresponsesinputtypereasoning.md | 8 + ...sesinput.md => openresponsesinputunion.md} | 6 +- ...sinput1.md => openresponsesinputunion1.md} | 16 +- .../components/openresponseslocalshelltool.md | 10 + .../openresponseslocalshelltooltype.md | 8 + docs/components/openresponseslogprobs.md | 12 - docs/components/openresponsesmcptool.md | 18 + docs/components/openresponsesmcptooltype.md | 8 + ...nresponsesnonstreamingresponsetoolunion.md | 54 + docs/components/openresponsesrequest.md | 2 +- ...penresponsesrequestidcontextcompression.md | 8 + ...esponsesrequestplugincontextcompression.md | 10 + .../openresponsesrequestpluginunion.md | 6 + .../openresponsesrequestpluginweb.md | 16 +- .../openresponsesrequesttoolunion.md | 66 + docs/components/openresponsesstreamevent.md | 18 + .../openresponsesstreameventlogprob1.md | 13 + .../openresponsesstreameventlogprob2.md | 13 + ...onsesstreameventresponseoutputtextdelta.md | 18 +- ...ponsesstreameventresponseoutputtextdone.md | 18 +- ...=> openresponsesstreameventtoplogprob1.md} | 5 +- .../openresponsesstreameventtoplogprob2.md | 12 + .../openresponseswebsearch20250826tool.md | 14 +- ...penresponseswebsearch20250826toolengine.md | 12 + ...enresponseswebsearch20250826toolfilters.md | 3 +- .../openresponseswebsearchcallcompleted.md | 13 + ...openresponseswebsearchcallcompletedtype.md | 8 + .../openresponseswebsearchcallinprogress.md | 13 + ...penresponseswebsearchcallinprogresstype.md | 8 + .../openresponseswebsearchcallsearching.md | 13 + ...openresponseswebsearchcallsearchingtype.md | 8 + ...enresponseswebsearchpreview20250311tool.md | 13 +- ...onseswebsearchpreview20250311toolengine.md | 12 + ...nseswebsearchpreview20250311toolfilters.md | 9 + .../openresponseswebsearchpreviewtool.md | 13 +- ...openresponseswebsearchpreviewtoolengine.md | 12 + ...penresponseswebsearchpreviewtoolfilters.md | 9 + docs/components/openresponseswebsearchtool.md | 14 +- .../openresponseswebsearchtoolengine.md | 12 + .../openresponseswebsearchtoolfilters.md | 3 +- docs/components/outputformat.md | 10 + docs/components/outputinputimage.md | 12 + docs/components/outputmessage.md | 15 +- .../outputmessagephasecommentary.md | 8 + .../outputmessagephasefinalanswer.md | 8 + docs/components/outputmessagephaseunion.md | 25 + docs/components/outputmodality.md | 3 +- docs/components/outputtype.md | 8 + docs/components/providername.md | 1 + docs/components/providerpreferencesby.md | 3 +- .../providerpreferencesprovidersort.md | 3 +- ...oviderpreferencesprovidersortconfigenum.md | 3 +- .../components/providerpreferencessortenum.md | 3 +- docs/components/providersort.md | 3 +- docs/components/quality.md | 11 + docs/components/ranker.md | 9 + docs/components/rankingoptions.md | 9 + docs/components/requireapproval.md | 9 + docs/components/requireapprovalalways.md | 8 + docs/components/requireapprovalnever.md | 8 + docs/components/responseoutputtext.md | 2 +- ...ogprob.md => responseoutputtextlogprob.md} | 2 +- docs/components/responsesoutputitem.md | 6 + docs/components/responsesoutputmessage.md | 15 +- .../responsesoutputmessagephasecommentary.md | 8 + .../responsesoutputmessagephasefinalanswer.md | 8 + .../responsesoutputmessagephaseunion.md | 25 + docs/components/responsesservertooloutput.md | 13 + .../responsesservertooloutputstatus.md | 10 + .../responseswebsearchcalloutput.md | 11 +- .../responseswebsearchservertool.md | 11 + .../responseswebsearchservertoolparameters.md | 9 + .../responseswebsearchservertooltype.md | 8 + docs/components/size.md | 11 + docs/components/source.md | 9 + docs/components/syntax.md | 9 + docs/components/tooldefinitionjson.md | 51 +- docs/components/tooldefinitionjsonfunction.md | 13 +- .../tooldefinitionjsonfunctionfunction.md | 13 + docs/components/typecodeinterpreter.md | 8 + docs/components/typecustom.md | 8 + docs/components/typefilesearch.md | 8 + docs/components/typefindinpage.md | 8 + docs/components/typeopenpage.md | 8 + docs/components/typesearch.md | 8 + docs/components/typeurl.md | 8 + ...calloutputtype.md => typewebsearchcall.md} | 2 +- docs/components/value1.md | 17 + docs/components/value2.md | 29 + docs/components/websearchengine.md | 10 +- docs/components/websearchservertool.md | 11 + docs/components/websearchservertoolengine.md | 12 + .../websearchservertoolparameters.md | 14 + .../websearchservertoolparameterstype.md | 8 + .../websearchservertoolsearchcontextsize.md | 12 + ...searchservertooltypeopenrouterwebsearch.md | 8 + .../websearchservertooluserlocation.md | 14 + docs/components/websearchshorthand.md | 18 + docs/components/websearchshorthandengine.md | 12 + .../websearchshorthandparameters.md | 14 + .../websearchshorthandparametersengine.md | 12 + ...rchshorthandparameterssearchcontextsize.md | 12 + .../websearchshorthandparameterstype.md | 8 + ...ebsearchshorthandparametersuserlocation.md | 14 + .../websearchshorthandsearchcontextsize.md | 12 + docs/components/websearchshorthandtype.md | 11 + .../websearchshorthandtypeapproximate.md | 8 + .../websearchshorthanduserlocation.md | 14 + docs/errors/conflictresponseerror.md | 11 + docs/models/internal/globals.md | 3 +- .../bulkassignkeystoguardrailglobals.md | 3 +- .../bulkassignkeystoguardrailrequest.md | 3 +- .../bulkassignmemberstoguardrailglobals.md | 3 +- .../bulkassignmemberstoguardrailrequest.md | 3 +- .../bulkunassignkeysfromguardrailglobals.md | 3 +- .../bulkunassignkeysfromguardrailrequest.md | 3 +- ...bulkunassignmembersfromguardrailglobals.md | 3 +- ...bulkunassignmembersfromguardrailrequest.md | 3 +- docs/operations/createauthkeyscodeglobals.md | 3 +- docs/operations/createauthkeyscoderequest.md | 3 +- .../operations/createcoinbasechargeglobals.md | 3 +- .../operations/createcoinbasechargerequest.md | 3 +- docs/operations/createembeddingsglobals.md | 3 +- docs/operations/createembeddingsrequest.md | 3 +- docs/operations/createguardraildata.md | 1 + docs/operations/createguardrailglobals.md | 3 +- docs/operations/createguardrailrequest.md | 11 +- docs/operations/createguardrailrequestbody.md | 1 + docs/operations/createguardrailresponse.md | 6 +- docs/operations/createkeysglobals.md | 3 +- docs/operations/createkeysrequest.md | 3 +- docs/operations/createresponsesglobals.md | 3 +- docs/operations/createresponsesrequest.md | 3 +- docs/operations/deleteguardrailglobals.md | 3 +- docs/operations/deleteguardrailrequest.md | 3 +- docs/operations/deletekeysglobals.md | 3 +- docs/operations/deletekeysrequest.md | 3 +- .../exchangeauthcodeforapikeyglobals.md | 3 +- .../exchangeauthcodeforapikeyrequest.md | 3 +- docs/operations/getcreditsglobals.md | 3 +- docs/operations/getcreditsrequest.md | 3 +- docs/operations/getcurrentkeyglobals.md | 3 +- docs/operations/getcurrentkeyrequest.md | 3 +- docs/operations/getgenerationdata.md | 4 +- docs/operations/getgenerationglobals.md | 3 +- docs/operations/getgenerationrequest.md | 3 +- docs/operations/getguardraildata.md | 1 + docs/operations/getguardrailglobals.md | 3 +- docs/operations/getguardrailrequest.md | 3 +- docs/operations/getguardrailresponse.md | 6 +- docs/operations/getkeyglobals.md | 3 +- docs/operations/getkeyrequest.md | 3 +- docs/operations/getmodelsglobals.md | 3 +- docs/operations/getmodelsrequest.md | 14 +- docs/operations/getuseractivityglobals.md | 3 +- docs/operations/getuseractivityrequest.md | 3 +- .../operations/listembeddingsmodelsglobals.md | 3 +- .../operations/listembeddingsmodelsrequest.md | 3 +- docs/operations/listendpointsglobals.md | 3 +- docs/operations/listendpointsrequest.md | 3 +- docs/operations/listendpointszdrglobals.md | 3 +- docs/operations/listendpointszdrrequest.md | 3 +- docs/operations/listglobals.md | 3 +- .../listguardrailkeyassignmentsglobals.md | 3 +- .../listguardrailkeyassignmentsrequest.md | 3 +- .../listguardrailmemberassignmentsglobals.md | 3 +- .../listguardrailmemberassignmentsrequest.md | 3 +- docs/operations/listguardrailsdata.md | 1 + docs/operations/listguardrailsglobals.md | 3 +- docs/operations/listguardrailsrequest.md | 3 +- docs/operations/listkeyassignmentsglobals.md | 3 +- docs/operations/listkeyassignmentsrequest.md | 3 +- .../listmemberassignmentsglobals.md | 3 +- .../listmemberassignmentsrequest.md | 3 +- docs/operations/listmodelscountglobals.md | 3 +- docs/operations/listmodelscountrequest.md | 10 +- docs/operations/listmodelsuserglobals.md | 3 +- docs/operations/listmodelsuserrequest.md | 3 +- docs/operations/listprovidersglobals.md | 3 +- docs/operations/listprovidersrequest.md | 3 +- docs/operations/listrequest.md | 3 +- docs/operations/providername.md | 1 + .../sendchatcompletionrequestglobals.md | 3 +- .../sendchatcompletionrequestrequest.md | 3 +- docs/operations/updateguardraildata.md | 1 + docs/operations/updateguardrailglobals.md | 3 +- docs/operations/updateguardrailrequest.md | 3 +- docs/operations/updateguardrailrequestbody.md | 1 + docs/operations/updateguardrailresponse.md | 6 +- docs/operations/updatekeysglobals.md | 3 +- docs/operations/updatekeysrequest.md | 3 +- docs/sdks/analytics/README.md | 6 +- docs/sdks/apikeys/README.md | 36 +- docs/sdks/chat/README.md | 11 +- docs/sdks/credits/README.md | 12 +- docs/sdks/embeddings/README.md | 12 +- docs/sdks/endpoints/README.md | 12 +- docs/sdks/generations/README.md | 6 +- docs/sdks/guardrails/README.md | 80 +- docs/sdks/models/README.md | 41 +- docs/sdks/oauth/README.md | 13 +- docs/sdks/providers/README.md | 6 +- docs/sdks/responses/README.md | 8 +- pyproject.toml | 2 +- src/openrouter/_version.py | 4 +- src/openrouter/analytics.py | 26 +- src/openrouter/api_keys.py | 156 +- src/openrouter/chat.py | 108 +- src/openrouter/components/__init__.py | 805 ++- src/openrouter/components/assistantmessage.py | 10 + .../components/chatcompletionaudiooutput.py | 35 + .../components/chatgenerationparams.py | 84 +- .../components/chatmessagecontentitem.py | 6 + .../chatmessagecontentitemcachecontrol.py | 9 +- .../components/chatmessagecontentitemfile.py | 44 + .../components/chatmessagetokenlogprobs.py | 16 +- src/openrouter/components/chatresponse.py | 14 +- .../components/chatstreamingmessagechunk.py | 8 + .../components/chatstreamingresponsechunk.py | 43 +- src/openrouter/components/compoundfilter.py | 32 + .../components/conflictresponseerrordata.py | 61 + .../components/contextcompressionengine.py | 8 + .../components/datetimeservertool.py | 34 + .../components/defaultparameters.py | 27 +- .../components/openairesponsesinput_union.py | 94 +- .../components/openresponsesapplypatchtool.py | 21 + .../openresponsescodeinterpretertool.py | 102 + .../components/openresponsescomputertool.py | 44 + .../components/openresponsescustomtool.py | 82 + .../openresponseseasyinputmessage.py | 75 +- .../components/openresponsesfilesearchtool.py | 148 + .../openresponsesfunctioncalloutput.py | 116 +- .../openresponsesfunctionshelltool.py | 21 + .../openresponsesimagegenerationtool.py | 194 + .../components/openresponsesinput.py | 97 - .../components/openresponsesinput_union.py | 386 ++ .../openresponsesinputmessageitem.py | 38 +- .../components/openresponseslocalshelltool.py | 21 + .../components/openresponseslogprobs.py | 28 - .../components/openresponsesmcptool.py | 154 + .../openresponsesnonstreamingresponse.py | 57 +- .../components/openresponsesrequest.py | 113 +- .../components/openresponsesstreamevent.py | 135 +- .../components/openresponsestoplogprobs.py | 21 - .../openresponseswebsearch20250826tool.py | 42 +- .../openresponseswebsearchcallcompleted.py | 30 + .../openresponseswebsearchcallinprogress.py | 32 + .../openresponseswebsearchcallsearching.py | 30 + ...enresponseswebsearchpreview20250311tool.py | 83 +- .../openresponseswebsearchpreviewtool.py | 81 +- .../components/openresponseswebsearchtool.py | 42 +- src/openrouter/components/outputmessage.py | 67 +- src/openrouter/components/outputmodality.py | 1 + src/openrouter/components/providername.py | 1 + .../components/providerpreferences.py | 4 + src/openrouter/components/providersort.py | 1 + .../components/providersortconfig.py | 1 + .../components/responseoutputtext.py | 8 +- .../components/responsesoutputitem.py | 28 +- .../components/responsesoutputmessage.py | 75 +- .../components/responsesservertooloutput.py | 55 + .../responseswebsearchcalloutput.py | 135 +- .../responseswebsearchservertool.py | 39 + .../components/tooldefinitionjson.py | 53 +- src/openrouter/components/websearchengine.py | 2 + .../components/websearchservertool.py | 120 + .../components/websearchshorthand.py | 218 + src/openrouter/credits.py | 52 +- src/openrouter/embeddings.py | 52 +- src/openrouter/endpoints.py | 52 +- src/openrouter/errors/__init__.py | 5 + .../errors/conflictresponse_error.py | 36 + src/openrouter/generations.py | 26 +- src/openrouter/guardrails.py | 350 +- src/openrouter/models/internal/globals.py | 19 +- src/openrouter/models_.py | 104 +- src/openrouter/oauth.py | 66 +- .../operations/bulkassignkeystoguardrail.py | 38 +- .../bulkassignmemberstoguardrail.py | 38 +- .../bulkunassignkeysfromguardrail.py | 38 +- .../bulkunassignmembersfromguardrail.py | 38 +- .../operations/createauthkeyscode.py | 38 +- .../operations/createcoinbasecharge.py | 38 +- src/openrouter/operations/createembeddings.py | 38 +- src/openrouter/operations/createguardrail.py | 52 +- src/openrouter/operations/createkeys.py | 38 +- src/openrouter/operations/createresponses.py | 38 +- src/openrouter/operations/deleteguardrail.py | 38 +- src/openrouter/operations/deletekeys.py | 38 +- .../operations/exchangeauthcodeforapikey.py | 38 +- src/openrouter/operations/getcredits.py | 38 +- src/openrouter/operations/getcurrentkey.py | 38 +- src/openrouter/operations/getgeneration.py | 51 +- src/openrouter/operations/getguardrail.py | 45 +- src/openrouter/operations/getkey.py | 38 +- src/openrouter/operations/getmodels.py | 46 +- src/openrouter/operations/getuseractivity.py | 38 +- src/openrouter/operations/list.py | 38 +- .../operations/listembeddingsmodels.py | 38 +- src/openrouter/operations/listendpoints.py | 38 +- src/openrouter/operations/listendpointszdr.py | 38 +- .../operations/listguardrailkeyassignments.py | 38 +- .../listguardrailmemberassignments.py | 38 +- src/openrouter/operations/listguardrails.py | 45 +- .../operations/listkeyassignments.py | 38 +- .../operations/listmemberassignments.py | 38 +- src/openrouter/operations/listmodelscount.py | 48 +- src/openrouter/operations/listmodelsuser.py | 38 +- src/openrouter/operations/listproviders.py | 38 +- .../operations/sendchatcompletionrequest.py | 38 +- src/openrouter/operations/updateguardrail.py | 52 +- src/openrouter/operations/updatekeys.py | 38 +- src/openrouter/providers.py | 26 +- src/openrouter/responses.py | 88 +- src/openrouter/sdk.py | 13 +- uv.lock | 2 +- 433 files changed, 18727 insertions(+), 2702 deletions(-) create mode 100644 docs/components/action.md create mode 100644 docs/components/actionfindinpage.md create mode 100644 docs/components/actionopenpage.md create mode 100644 docs/components/actionsearch.md create mode 100644 docs/components/allowedtools.md create mode 100644 docs/components/always.md create mode 100644 docs/components/background.md create mode 100644 docs/components/cachecontrol.md create mode 100644 docs/components/chatcompletionaudiooutput.md create mode 100644 docs/components/chatgenerationparamsidcontextcompression.md create mode 100644 docs/components/chatgenerationparamsplugincontextcompression.md rename docs/components/{ttl.md => chatgenerationparamsttl.md} (79%) create mode 100644 docs/components/chatgenerationparamstype.md create mode 100644 docs/components/chatmessagecontentitemcachecontrolttl.md create mode 100644 docs/components/chatmessagecontentitemfile.md create mode 100644 docs/components/chatmessagecontentitemfiletype.md create mode 100644 docs/components/compoundfilter.md create mode 100644 docs/components/compoundfiltertype.md create mode 100644 docs/components/conflictresponseerrordata.md create mode 100644 docs/components/connectorid.md create mode 100644 docs/components/container.md create mode 100644 docs/components/containerauto.md create mode 100644 docs/components/containertype.md create mode 100644 docs/components/contextcompressionengine.md create mode 100644 docs/components/datetimeservertool.md create mode 100644 docs/components/datetimeservertoolparameters.md create mode 100644 docs/components/datetimeservertooltype.md create mode 100644 docs/components/environment.md create mode 100644 docs/components/file.md create mode 100644 docs/components/filters.md create mode 100644 docs/components/filterstype.md create mode 100644 docs/components/format_.md create mode 100644 docs/components/formatgrammar.md create mode 100644 docs/components/formattext.md create mode 100644 docs/components/formattypegrammar.md create mode 100644 docs/components/formattypetext.md create mode 100644 docs/components/inputfidelity.md create mode 100644 docs/components/inputimagemask.md create mode 100644 docs/components/memorylimit.md create mode 100644 docs/components/modelenum.md create mode 100644 docs/components/moderation.md create mode 100644 docs/components/never.md create mode 100644 docs/components/openairesponsesinputoutput1.md create mode 100644 docs/components/openairesponsesinputoutput2.md create mode 100644 docs/components/openairesponsesinputphasecommentary.md create mode 100644 docs/components/openairesponsesinputphasefinalanswer.md create mode 100644 docs/components/openairesponsesinputphaseunion.md create mode 100644 docs/components/openresponsesapplypatchtool.md create mode 100644 docs/components/openresponsesapplypatchtooltype.md create mode 100644 docs/components/openresponsescodeinterpretertool.md create mode 100644 docs/components/openresponsescomputertool.md create mode 100644 docs/components/openresponsescomputertooltype.md create mode 100644 docs/components/openresponsescustomtool.md create mode 100644 docs/components/openresponseseasyinputmessagephasecommentary.md create mode 100644 docs/components/openresponseseasyinputmessagephasefinalanswer.md create mode 100644 docs/components/openresponseseasyinputmessagephaseunion.md create mode 100644 docs/components/openresponsesfilesearchtool.md create mode 100644 docs/components/openresponsesfilesearchtoolfilters.md create mode 100644 docs/components/openresponsesfunctioncalloutputdetail.md create mode 100644 docs/components/openresponsesfunctioncalloutputoutputunion1.md create mode 100644 docs/components/openresponsesfunctioncalloutputoutputunion2.md rename docs/components/{openresponsesfunctioncalloutputtype.md => openresponsesfunctioncalloutputtypefunctioncalloutput.md} (75%) create mode 100644 docs/components/openresponsesfunctionshelltool.md create mode 100644 docs/components/openresponsesfunctionshelltooltype.md create mode 100644 docs/components/openresponsesimagegenerationtool.md create mode 100644 docs/components/openresponsesimagegenerationtooltype.md create mode 100644 docs/components/openresponsesinputcontent1.md create mode 100644 docs/components/openresponsesinputcontent2.md create mode 100644 docs/components/openresponsesinputformat.md create mode 100644 docs/components/openresponsesinputmessage.md create mode 100644 docs/components/openresponsesinputphasecommentary.md create mode 100644 docs/components/openresponsesinputphasefinalanswer.md create mode 100644 docs/components/openresponsesinputphaseunion.md create mode 100644 docs/components/openresponsesinputreasoning.md create mode 100644 docs/components/openresponsesinputrole.md create mode 100644 docs/components/openresponsesinputstatuscompleted1.md create mode 100644 docs/components/openresponsesinputstatuscompleted2.md create mode 100644 docs/components/openresponsesinputstatusincomplete1.md create mode 100644 docs/components/openresponsesinputstatusincomplete2.md create mode 100644 docs/components/openresponsesinputstatusinprogress1.md create mode 100644 docs/components/openresponsesinputstatusinprogress2.md create mode 100644 docs/components/openresponsesinputstatusunion1.md create mode 100644 docs/components/openresponsesinputstatusunion2.md create mode 100644 docs/components/openresponsesinputtypemessage.md create mode 100644 docs/components/openresponsesinputtypereasoning.md rename docs/components/{openresponsesinput.md => openresponsesinputunion.md} (52%) rename docs/components/{openresponsesinput1.md => openresponsesinputunion1.md} (76%) create mode 100644 docs/components/openresponseslocalshelltool.md create mode 100644 docs/components/openresponseslocalshelltooltype.md delete mode 100644 docs/components/openresponseslogprobs.md create mode 100644 docs/components/openresponsesmcptool.md create mode 100644 docs/components/openresponsesmcptooltype.md create mode 100644 docs/components/openresponsesrequestidcontextcompression.md create mode 100644 docs/components/openresponsesrequestplugincontextcompression.md create mode 100644 docs/components/openresponsesstreameventlogprob1.md create mode 100644 docs/components/openresponsesstreameventlogprob2.md rename docs/components/{openresponsestoplogprobs.md => openresponsesstreameventtoplogprob1.md} (76%) create mode 100644 docs/components/openresponsesstreameventtoplogprob2.md create mode 100644 docs/components/openresponseswebsearch20250826toolengine.md create mode 100644 docs/components/openresponseswebsearchcallcompleted.md create mode 100644 docs/components/openresponseswebsearchcallcompletedtype.md create mode 100644 docs/components/openresponseswebsearchcallinprogress.md create mode 100644 docs/components/openresponseswebsearchcallinprogresstype.md create mode 100644 docs/components/openresponseswebsearchcallsearching.md create mode 100644 docs/components/openresponseswebsearchcallsearchingtype.md create mode 100644 docs/components/openresponseswebsearchpreview20250311toolengine.md create mode 100644 docs/components/openresponseswebsearchpreview20250311toolfilters.md create mode 100644 docs/components/openresponseswebsearchpreviewtoolengine.md create mode 100644 docs/components/openresponseswebsearchpreviewtoolfilters.md create mode 100644 docs/components/openresponseswebsearchtoolengine.md create mode 100644 docs/components/outputformat.md create mode 100644 docs/components/outputinputimage.md create mode 100644 docs/components/outputmessagephasecommentary.md create mode 100644 docs/components/outputmessagephasefinalanswer.md create mode 100644 docs/components/outputmessagephaseunion.md create mode 100644 docs/components/outputtype.md create mode 100644 docs/components/quality.md create mode 100644 docs/components/ranker.md create mode 100644 docs/components/rankingoptions.md create mode 100644 docs/components/requireapproval.md create mode 100644 docs/components/requireapprovalalways.md create mode 100644 docs/components/requireapprovalnever.md rename docs/components/{logprob.md => responseoutputtextlogprob.md} (98%) create mode 100644 docs/components/responsesoutputmessagephasecommentary.md create mode 100644 docs/components/responsesoutputmessagephasefinalanswer.md create mode 100644 docs/components/responsesoutputmessagephaseunion.md create mode 100644 docs/components/responsesservertooloutput.md create mode 100644 docs/components/responsesservertooloutputstatus.md create mode 100644 docs/components/responseswebsearchservertool.md create mode 100644 docs/components/responseswebsearchservertoolparameters.md create mode 100644 docs/components/responseswebsearchservertooltype.md create mode 100644 docs/components/size.md create mode 100644 docs/components/source.md create mode 100644 docs/components/syntax.md create mode 100644 docs/components/tooldefinitionjsonfunctionfunction.md create mode 100644 docs/components/typecodeinterpreter.md create mode 100644 docs/components/typecustom.md create mode 100644 docs/components/typefilesearch.md create mode 100644 docs/components/typefindinpage.md create mode 100644 docs/components/typeopenpage.md create mode 100644 docs/components/typesearch.md create mode 100644 docs/components/typeurl.md rename docs/components/{responseswebsearchcalloutputtype.md => typewebsearchcall.md} (79%) create mode 100644 docs/components/value1.md create mode 100644 docs/components/value2.md create mode 100644 docs/components/websearchservertool.md create mode 100644 docs/components/websearchservertoolengine.md create mode 100644 docs/components/websearchservertoolparameters.md create mode 100644 docs/components/websearchservertoolparameterstype.md create mode 100644 docs/components/websearchservertoolsearchcontextsize.md create mode 100644 docs/components/websearchservertooltypeopenrouterwebsearch.md create mode 100644 docs/components/websearchservertooluserlocation.md create mode 100644 docs/components/websearchshorthand.md create mode 100644 docs/components/websearchshorthandengine.md create mode 100644 docs/components/websearchshorthandparameters.md create mode 100644 docs/components/websearchshorthandparametersengine.md create mode 100644 docs/components/websearchshorthandparameterssearchcontextsize.md create mode 100644 docs/components/websearchshorthandparameterstype.md create mode 100644 docs/components/websearchshorthandparametersuserlocation.md create mode 100644 docs/components/websearchshorthandsearchcontextsize.md create mode 100644 docs/components/websearchshorthandtype.md create mode 100644 docs/components/websearchshorthandtypeapproximate.md create mode 100644 docs/components/websearchshorthanduserlocation.md create mode 100644 docs/errors/conflictresponseerror.md create mode 100644 src/openrouter/components/chatcompletionaudiooutput.py create mode 100644 src/openrouter/components/chatmessagecontentitemfile.py create mode 100644 src/openrouter/components/compoundfilter.py create mode 100644 src/openrouter/components/conflictresponseerrordata.py create mode 100644 src/openrouter/components/contextcompressionengine.py create mode 100644 src/openrouter/components/datetimeservertool.py create mode 100644 src/openrouter/components/openresponsesapplypatchtool.py create mode 100644 src/openrouter/components/openresponsescodeinterpretertool.py create mode 100644 src/openrouter/components/openresponsescomputertool.py create mode 100644 src/openrouter/components/openresponsescustomtool.py create mode 100644 src/openrouter/components/openresponsesfilesearchtool.py create mode 100644 src/openrouter/components/openresponsesfunctionshelltool.py create mode 100644 src/openrouter/components/openresponsesimagegenerationtool.py delete mode 100644 src/openrouter/components/openresponsesinput.py create mode 100644 src/openrouter/components/openresponsesinput_union.py create mode 100644 src/openrouter/components/openresponseslocalshelltool.py delete mode 100644 src/openrouter/components/openresponseslogprobs.py create mode 100644 src/openrouter/components/openresponsesmcptool.py delete mode 100644 src/openrouter/components/openresponsestoplogprobs.py create mode 100644 src/openrouter/components/openresponseswebsearchcallcompleted.py create mode 100644 src/openrouter/components/openresponseswebsearchcallinprogress.py create mode 100644 src/openrouter/components/openresponseswebsearchcallsearching.py create mode 100644 src/openrouter/components/responsesservertooloutput.py create mode 100644 src/openrouter/components/responseswebsearchservertool.py create mode 100644 src/openrouter/components/websearchservertool.py create mode 100644 src/openrouter/components/websearchshorthand.py create mode 100644 src/openrouter/errors/conflictresponse_error.py diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index ef05950..22ff2cb 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d management: - docChecksum: ba9a1c22e9c7d5926d71b1e78e16b482 + docChecksum: fff8b3c28663df858db3a222b1f62d40 docVersion: 1.0.0 speakeasyVersion: 1.666.0 generationVersion: 2.768.0 - releaseVersion: 0.7.11 - configChecksum: c2013e97e44ae07d6749ebe461b47299 + releaseVersion: 0.9.0 + configChecksum: e6f61aeb6e1587fb2f6f67ef3b5217c5 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true @@ -50,21 +50,31 @@ generatedFiles: - .gitattributes - .vscode/settings.json - USAGE.md + - docs/components/action.md + - docs/components/actionfindinpage.md + - docs/components/actionopenpage.md + - docs/components/actionsearch.md - docs/components/activityitem.md + - docs/components/allowedtools.md + - docs/components/always.md - docs/components/architecture.md - docs/components/assistantmessage.md - docs/components/assistantmessagecontent.md - docs/components/assistantmessageimages.md - docs/components/assistantmessageimagesimageurl.md - docs/components/assistantmessagerole.md + - docs/components/background.md - docs/components/badgatewayresponseerrordata.md - docs/components/badrequestresponseerrordata.md - docs/components/by.md + - docs/components/cachecontrol.md - docs/components/chainid.md + - docs/components/chatcompletionaudiooutput.md - docs/components/chatcompletionfinishreason.md - docs/components/chatgenerationparams.md - docs/components/chatgenerationparamsby.md - docs/components/chatgenerationparamsidautorouter.md + - docs/components/chatgenerationparamsidcontextcompression.md - docs/components/chatgenerationparamsidfileparser.md - docs/components/chatgenerationparamsidmoderation.md - docs/components/chatgenerationparamsidresponsehealing.md @@ -76,6 +86,7 @@ generatedFiles: - docs/components/chatgenerationparamsorder.md - docs/components/chatgenerationparamspartition.md - docs/components/chatgenerationparamspluginautorouter.md + - docs/components/chatgenerationparamsplugincontextcompression.md - docs/components/chatgenerationparamspluginfileparser.md - docs/components/chatgenerationparamspluginmoderation.md - docs/components/chatgenerationparamspluginresponsehealing.md @@ -89,6 +100,8 @@ generatedFiles: - docs/components/chatgenerationparamssortenum.md - docs/components/chatgenerationparamssortunion.md - docs/components/chatgenerationparamstrace.md + - docs/components/chatgenerationparamsttl.md + - docs/components/chatgenerationparamstype.md - docs/components/chatgenerationtokenusage.md - docs/components/chatmessagecontentitem.md - docs/components/chatmessagecontentitem1.md @@ -96,7 +109,10 @@ generatedFiles: - docs/components/chatmessagecontentitemaudioinputaudio.md - docs/components/chatmessagecontentitemaudiotype.md - docs/components/chatmessagecontentitemcachecontrol.md + - docs/components/chatmessagecontentitemcachecontrolttl.md - docs/components/chatmessagecontentitemcachecontroltype.md + - docs/components/chatmessagecontentitemfile.md + - docs/components/chatmessagecontentitemfiletype.md - docs/components/chatmessagecontentitemimage.md - docs/components/chatmessagecontentitemimagedetail.md - docs/components/chatmessagecontentitemimageimageurl.md @@ -127,10 +143,21 @@ generatedFiles: - docs/components/chatstreamoptions.md - docs/components/code.md - docs/components/completiontokensdetails.md + - docs/components/compoundfilter.md + - docs/components/compoundfiltertype.md + - docs/components/conflictresponseerrordata.md + - docs/components/connectorid.md + - docs/components/container.md + - docs/components/containerauto.md + - docs/components/containertype.md + - docs/components/contextcompressionengine.md - docs/components/costdetails.md - docs/components/createchargerequest.md - docs/components/data.md - docs/components/datacollection.md + - docs/components/datetimeservertool.md + - docs/components/datetimeservertoolparameters.md + - docs/components/datetimeservertooltype.md - docs/components/debugoptions.md - docs/components/defaultparameters.md - docs/components/developermessage.md @@ -139,31 +166,45 @@ generatedFiles: - docs/components/edgenetworktimeoutresponseerrordata.md - docs/components/effort.md - docs/components/endpointstatus.md + - docs/components/environment.md - docs/components/error.md + - docs/components/file.md - docs/components/filecitation.md - docs/components/filecitationtype.md - docs/components/filepath.md - docs/components/filepathtype.md + - docs/components/filters.md + - docs/components/filterstype.md - docs/components/forbiddenresponseerrordata.md + - docs/components/format_.md + - docs/components/formatgrammar.md + - docs/components/formattext.md + - docs/components/formattypegrammar.md + - docs/components/formattypetext.md - docs/components/imagegenerationstatus.md + - docs/components/inputfidelity.md + - docs/components/inputimagemask.md - docs/components/inputmodality.md - docs/components/inputtokensdetails.md - docs/components/instructtype.md - docs/components/internalserverresponseerrordata.md - docs/components/jsonschemaconfig.md - docs/components/listendpointsresponse.md - - docs/components/logprob.md + - docs/components/memorylimit.md - docs/components/message.md - docs/components/modality.md - docs/components/model.md - docs/components/modelarchitecture.md - docs/components/modelarchitectureinstructtype.md + - docs/components/modelenum.md - docs/components/modelgroup.md - docs/components/modelscountresponse.md - docs/components/modelslistresponse.md + - docs/components/moderation.md - docs/components/namedtoolchoice.md - docs/components/namedtoolchoicefunction.md - docs/components/namedtoolchoicetype.md + - docs/components/never.md - docs/components/notfoundresponseerrordata.md - docs/components/openairesponsesannotation.md - docs/components/openairesponsesincludable.md @@ -175,6 +216,11 @@ generatedFiles: - docs/components/openairesponsesinputfunctioncalloutput.md - docs/components/openairesponsesinputmessage1.md - docs/components/openairesponsesinputmessage2.md + - docs/components/openairesponsesinputoutput1.md + - docs/components/openairesponsesinputoutput2.md + - docs/components/openairesponsesinputphasecommentary.md + - docs/components/openairesponsesinputphasefinalanswer.md + - docs/components/openairesponsesinputphaseunion.md - docs/components/openairesponsesinputroleassistant.md - docs/components/openairesponsesinputroledeveloper1.md - docs/components/openairesponsesinputroledeveloper2.md @@ -207,12 +253,21 @@ generatedFiles: - docs/components/openairesponsestoolchoicetypewebsearchpreview20250311.md - docs/components/openairesponsestoolchoiceunion.md - docs/components/openairesponsestruncation.md + - docs/components/openresponsesapplypatchtool.md + - docs/components/openresponsesapplypatchtooltype.md + - docs/components/openresponsescodeinterpretertool.md + - docs/components/openresponsescomputertool.md + - docs/components/openresponsescomputertooltype.md + - docs/components/openresponsescustomtool.md - docs/components/openresponseseasyinputmessage.md - docs/components/openresponseseasyinputmessagecontentinputimage.md - docs/components/openresponseseasyinputmessagecontenttype.md - docs/components/openresponseseasyinputmessagecontentunion1.md - docs/components/openresponseseasyinputmessagecontentunion2.md - docs/components/openresponseseasyinputmessagedetail.md + - docs/components/openresponseseasyinputmessagephasecommentary.md + - docs/components/openresponseseasyinputmessagephasefinalanswer.md + - docs/components/openresponseseasyinputmessagephaseunion.md - docs/components/openresponseseasyinputmessageroleassistant.md - docs/components/openresponseseasyinputmessageroledeveloper.md - docs/components/openresponseseasyinputmessagerolesystem.md @@ -221,8 +276,15 @@ generatedFiles: - docs/components/openresponseseasyinputmessagetypemessage.md - docs/components/openresponseserrorevent.md - docs/components/openresponseserroreventtype.md + - docs/components/openresponsesfilesearchtool.md + - docs/components/openresponsesfilesearchtoolfilters.md - docs/components/openresponsesfunctioncalloutput.md - - docs/components/openresponsesfunctioncalloutputtype.md + - docs/components/openresponsesfunctioncalloutputdetail.md + - docs/components/openresponsesfunctioncalloutputoutputunion1.md + - docs/components/openresponsesfunctioncalloutputoutputunion2.md + - docs/components/openresponsesfunctioncalloutputtypefunctioncalloutput.md + - docs/components/openresponsesfunctionshelltool.md + - docs/components/openresponsesfunctionshelltooltype.md - docs/components/openresponsesfunctiontoolcall.md - docs/components/openresponsesfunctiontoolcalltype.md - docs/components/openresponsesimagegencallcompleted.md @@ -233,8 +295,12 @@ generatedFiles: - docs/components/openresponsesimagegencallinprogresstype.md - docs/components/openresponsesimagegencallpartialimage.md - docs/components/openresponsesimagegencallpartialimagetype.md - - docs/components/openresponsesinput.md - - docs/components/openresponsesinput1.md + - docs/components/openresponsesimagegenerationtool.md + - docs/components/openresponsesimagegenerationtooltype.md + - docs/components/openresponsesinputcontent1.md + - docs/components/openresponsesinputcontent2.md + - docs/components/openresponsesinputformat.md + - docs/components/openresponsesinputmessage.md - docs/components/openresponsesinputmessageitem.md - docs/components/openresponsesinputmessageitemcontentinputimage.md - docs/components/openresponsesinputmessageitemcontenttype.md @@ -245,7 +311,27 @@ generatedFiles: - docs/components/openresponsesinputmessageitemroleunion.md - docs/components/openresponsesinputmessageitemroleuser.md - docs/components/openresponsesinputmessageitemtypemessage.md - - docs/components/openresponseslogprobs.md + - docs/components/openresponsesinputphasecommentary.md + - docs/components/openresponsesinputphasefinalanswer.md + - docs/components/openresponsesinputphaseunion.md + - docs/components/openresponsesinputreasoning.md + - docs/components/openresponsesinputrole.md + - docs/components/openresponsesinputstatuscompleted1.md + - docs/components/openresponsesinputstatuscompleted2.md + - docs/components/openresponsesinputstatusincomplete1.md + - docs/components/openresponsesinputstatusincomplete2.md + - docs/components/openresponsesinputstatusinprogress1.md + - docs/components/openresponsesinputstatusinprogress2.md + - docs/components/openresponsesinputstatusunion1.md + - docs/components/openresponsesinputstatusunion2.md + - docs/components/openresponsesinputtypemessage.md + - docs/components/openresponsesinputtypereasoning.md + - docs/components/openresponsesinputunion.md + - docs/components/openresponsesinputunion1.md + - docs/components/openresponseslocalshelltool.md + - docs/components/openresponseslocalshelltooltype.md + - docs/components/openresponsesmcptool.md + - docs/components/openresponsesmcptooltype.md - docs/components/openresponsesnonstreamingresponse.md - docs/components/openresponsesnonstreamingresponseobject.md - docs/components/openresponsesnonstreamingresponsetoolfunction.md @@ -271,6 +357,7 @@ generatedFiles: - docs/components/openresponsesreasoningtype.md - docs/components/openresponsesrequest.md - docs/components/openresponsesrequestidautorouter.md + - docs/components/openresponsesrequestidcontextcompression.md - docs/components/openresponsesrequestidfileparser.md - docs/components/openresponsesrequestidmoderation.md - docs/components/openresponsesrequestidresponsehealing.md @@ -281,6 +368,7 @@ generatedFiles: - docs/components/openresponsesrequestonly.md - docs/components/openresponsesrequestorder.md - docs/components/openresponsesrequestpluginautorouter.md + - docs/components/openresponsesrequestplugincontextcompression.md - docs/components/openresponsesrequestpluginfileparser.md - docs/components/openresponsesrequestpluginmoderation.md - docs/components/openresponsesrequestpluginresponsehealing.md @@ -295,6 +383,8 @@ generatedFiles: - docs/components/openresponsesresponsetext.md - docs/components/openresponsesresponsetextverbosity.md - docs/components/openresponsesstreamevent.md + - docs/components/openresponsesstreameventlogprob1.md + - docs/components/openresponsesstreameventlogprob2.md - docs/components/openresponsesstreameventresponsecompleted.md - docs/components/openresponsesstreameventresponsecontentpartadded.md - docs/components/openresponsesstreameventresponsecontentpartdone.md @@ -312,22 +402,40 @@ generatedFiles: - docs/components/openresponsesstreameventresponsereasoningsummarypartdone.md - docs/components/openresponsesstreameventresponserefusaldelta.md - docs/components/openresponsesstreameventresponserefusaldone.md - - docs/components/openresponsestoplogprobs.md + - docs/components/openresponsesstreameventtoplogprob1.md + - docs/components/openresponsesstreameventtoplogprob2.md - docs/components/openresponsesusage.md - docs/components/openresponseswebsearch20250826tool.md + - docs/components/openresponseswebsearch20250826toolengine.md - docs/components/openresponseswebsearch20250826toolfilters.md - docs/components/openresponseswebsearch20250826tooltype.md + - docs/components/openresponseswebsearchcallcompleted.md + - docs/components/openresponseswebsearchcallcompletedtype.md + - docs/components/openresponseswebsearchcallinprogress.md + - docs/components/openresponseswebsearchcallinprogresstype.md + - docs/components/openresponseswebsearchcallsearching.md + - docs/components/openresponseswebsearchcallsearchingtype.md - docs/components/openresponseswebsearchpreview20250311tool.md + - docs/components/openresponseswebsearchpreview20250311toolengine.md + - docs/components/openresponseswebsearchpreview20250311toolfilters.md - docs/components/openresponseswebsearchpreview20250311tooltype.md - docs/components/openresponseswebsearchpreviewtool.md + - docs/components/openresponseswebsearchpreviewtoolengine.md + - docs/components/openresponseswebsearchpreviewtoolfilters.md - docs/components/openresponseswebsearchpreviewtooltype.md - docs/components/openresponseswebsearchtool.md + - docs/components/openresponseswebsearchtoolengine.md - docs/components/openresponseswebsearchtoolfilters.md - docs/components/openresponseswebsearchtooltype.md + - docs/components/outputformat.md + - docs/components/outputinputimage.md - docs/components/outputitemimagegenerationcall.md - docs/components/outputitemimagegenerationcalltype.md - docs/components/outputmessage.md - docs/components/outputmessagecontent.md + - docs/components/outputmessagephasecommentary.md + - docs/components/outputmessagephasefinalanswer.md + - docs/components/outputmessagephaseunion.md - docs/components/outputmessagerole.md - docs/components/outputmessagestatuscompleted.md - docs/components/outputmessagestatusincomplete.md @@ -336,6 +444,7 @@ generatedFiles: - docs/components/outputmessagetype.md - docs/components/outputmodality.md - docs/components/outputtokensdetails.md + - docs/components/outputtype.md - docs/components/parameter.md - docs/components/part1.md - docs/components/part2.md @@ -372,7 +481,10 @@ generatedFiles: - docs/components/publicendpoint.md - docs/components/publicendpointquantization.md - docs/components/publicpricing.md + - docs/components/quality.md - docs/components/quantization.md + - docs/components/ranker.md + - docs/components/rankingoptions.md - docs/components/reason.md - docs/components/reasoning.md - docs/components/reasoningdetailencrypted.md @@ -391,6 +503,9 @@ generatedFiles: - docs/components/reasoningtextcontent.md - docs/components/reasoningtextcontenttype.md - docs/components/requesttimeoutresponseerrordata.md + - docs/components/requireapproval.md + - docs/components/requireapprovalalways.md + - docs/components/requireapprovalnever.md - docs/components/responseformat.md - docs/components/responseformatjsonobject.md - docs/components/responseformatjsonobjecttype.md @@ -417,6 +532,7 @@ generatedFiles: - docs/components/responseinputvideo.md - docs/components/responseinputvideotype.md - docs/components/responseoutputtext.md + - docs/components/responseoutputtextlogprob.md - docs/components/responseoutputtexttoplogprob.md - docs/components/responseoutputtexttype.md - docs/components/responseserrorfield.md @@ -444,6 +560,9 @@ generatedFiles: - docs/components/responsesoutputitemreasoningtype.md - docs/components/responsesoutputmessage.md - docs/components/responsesoutputmessagecontent.md + - docs/components/responsesoutputmessagephasecommentary.md + - docs/components/responsesoutputmessagephasefinalanswer.md + - docs/components/responsesoutputmessagephaseunion.md - docs/components/responsesoutputmessagerole.md - docs/components/responsesoutputmessagestatuscompleted.md - docs/components/responsesoutputmessagestatusincomplete.md @@ -452,8 +571,12 @@ generatedFiles: - docs/components/responsesoutputmessagetype.md - docs/components/responsesoutputmodality.md - docs/components/responsessearchcontextsize.md + - docs/components/responsesservertooloutput.md + - docs/components/responsesservertooloutputstatus.md - docs/components/responseswebsearchcalloutput.md - - docs/components/responseswebsearchcalloutputtype.md + - docs/components/responseswebsearchservertool.md + - docs/components/responseswebsearchservertoolparameters.md + - docs/components/responseswebsearchservertooltype.md - docs/components/responseswebsearchuserlocation.md - docs/components/responseswebsearchuserlocationtype.md - docs/components/responsetextconfig.md @@ -461,7 +584,10 @@ generatedFiles: - docs/components/security.md - docs/components/servicetier.md - docs/components/serviceunavailableresponseerrordata.md + - docs/components/size.md + - docs/components/source.md - docs/components/stop.md + - docs/components/syntax.md - docs/components/systemmessage.md - docs/components/systemmessagecontent.md - docs/components/systemmessagerole.md @@ -473,6 +599,7 @@ generatedFiles: - docs/components/toolchoiceoptionrequired.md - docs/components/tooldefinitionjson.md - docs/components/tooldefinitionjsonfunction.md + - docs/components/tooldefinitionjsonfunctionfunction.md - docs/components/tooldefinitionjsontype.md - docs/components/toolresponsemessage.md - docs/components/toolresponsemessagecontent.md @@ -480,8 +607,12 @@ generatedFiles: - docs/components/toomanyrequestsresponseerrordata.md - docs/components/topproviderinfo.md - docs/components/truncation.md - - docs/components/ttl.md - docs/components/type.md + - docs/components/typecodeinterpreter.md + - docs/components/typecustom.md + - docs/components/typefilesearch.md + - docs/components/typefindinpage.md + - docs/components/typeopenpage.md - docs/components/typeresponsecompleted.md - docs/components/typeresponsecontentpartadded.md - docs/components/typeresponsecontentpartdone.md @@ -499,6 +630,9 @@ generatedFiles: - docs/components/typeresponsereasoningsummarypartdone.md - docs/components/typeresponserefusaldelta.md - docs/components/typeresponserefusaldone.md + - docs/components/typesearch.md + - docs/components/typeurl.md + - docs/components/typewebsearchcall.md - docs/components/unauthorizedresponseerrordata.md - docs/components/unprocessableentityresponseerrordata.md - docs/components/urlcitation.md @@ -506,14 +640,35 @@ generatedFiles: - docs/components/usermessage.md - docs/components/usermessagecontent.md - docs/components/usermessagerole.md + - docs/components/value1.md + - docs/components/value2.md - docs/components/variables.md - docs/components/videoinput.md - docs/components/websearchengine.md - docs/components/websearchpreviewtooluserlocation.md - docs/components/websearchpreviewtooluserlocationtype.md + - docs/components/websearchservertool.md + - docs/components/websearchservertoolengine.md + - docs/components/websearchservertoolparameters.md + - docs/components/websearchservertoolparameterstype.md + - docs/components/websearchservertoolsearchcontextsize.md + - docs/components/websearchservertooltypeopenrouterwebsearch.md + - docs/components/websearchservertooluserlocation.md + - docs/components/websearchshorthand.md + - docs/components/websearchshorthandengine.md + - docs/components/websearchshorthandparameters.md + - docs/components/websearchshorthandparametersengine.md + - docs/components/websearchshorthandparameterssearchcontextsize.md + - docs/components/websearchshorthandparameterstype.md + - docs/components/websearchshorthandparametersuserlocation.md + - docs/components/websearchshorthandsearchcontextsize.md + - docs/components/websearchshorthandtype.md + - docs/components/websearchshorthandtypeapproximate.md + - docs/components/websearchshorthanduserlocation.md - docs/components/websearchstatus.md - docs/errors/badgatewayresponseerror.md - docs/errors/badrequestresponseerror.md + - docs/errors/conflictresponseerror.md - docs/errors/edgenetworktimeoutresponseerror.md - docs/errors/forbiddenresponseerror.md - docs/errors/internalserverresponseerror.md @@ -729,12 +884,14 @@ generatedFiles: - src/openrouter/components/assistantmessageimages.py - src/openrouter/components/badgatewayresponseerrordata.py - src/openrouter/components/badrequestresponseerrordata.py + - src/openrouter/components/chatcompletionaudiooutput.py - src/openrouter/components/chatcompletionfinishreason.py - src/openrouter/components/chatgenerationparams.py - src/openrouter/components/chatgenerationtokenusage.py - src/openrouter/components/chatmessagecontentitem.py - src/openrouter/components/chatmessagecontentitemaudio.py - src/openrouter/components/chatmessagecontentitemcachecontrol.py + - src/openrouter/components/chatmessagecontentitemfile.py - src/openrouter/components/chatmessagecontentitemimage.py - src/openrouter/components/chatmessagecontentitemtext.py - src/openrouter/components/chatmessagecontentitemvideo.py @@ -749,8 +906,12 @@ generatedFiles: - src/openrouter/components/chatstreamingmessagetoolcall.py - src/openrouter/components/chatstreamingresponsechunk.py - src/openrouter/components/chatstreamoptions.py + - src/openrouter/components/compoundfilter.py + - src/openrouter/components/conflictresponseerrordata.py + - src/openrouter/components/contextcompressionengine.py - src/openrouter/components/createchargerequest.py - src/openrouter/components/datacollection.py + - src/openrouter/components/datetimeservertool.py - src/openrouter/components/debugoptions.py - src/openrouter/components/defaultparameters.py - src/openrouter/components/developermessage.py @@ -785,17 +946,25 @@ generatedFiles: - src/openrouter/components/openairesponsesservicetier.py - src/openrouter/components/openairesponsestoolchoice_union.py - src/openrouter/components/openairesponsestruncation.py + - src/openrouter/components/openresponsesapplypatchtool.py + - src/openrouter/components/openresponsescodeinterpretertool.py + - src/openrouter/components/openresponsescomputertool.py + - src/openrouter/components/openresponsescustomtool.py - src/openrouter/components/openresponseseasyinputmessage.py - src/openrouter/components/openresponseserrorevent.py + - src/openrouter/components/openresponsesfilesearchtool.py - src/openrouter/components/openresponsesfunctioncalloutput.py + - src/openrouter/components/openresponsesfunctionshelltool.py - src/openrouter/components/openresponsesfunctiontoolcall.py - src/openrouter/components/openresponsesimagegencallcompleted.py - src/openrouter/components/openresponsesimagegencallgenerating.py - src/openrouter/components/openresponsesimagegencallinprogress.py - src/openrouter/components/openresponsesimagegencallpartialimage.py - - src/openrouter/components/openresponsesinput.py + - src/openrouter/components/openresponsesimagegenerationtool.py + - src/openrouter/components/openresponsesinput_union.py - src/openrouter/components/openresponsesinputmessageitem.py - - src/openrouter/components/openresponseslogprobs.py + - src/openrouter/components/openresponseslocalshelltool.py + - src/openrouter/components/openresponsesmcptool.py - src/openrouter/components/openresponsesnonstreamingresponse.py - src/openrouter/components/openresponsesreasoning.py - src/openrouter/components/openresponsesreasoningconfig.py @@ -807,9 +976,11 @@ generatedFiles: - src/openrouter/components/openresponsesrequest.py - src/openrouter/components/openresponsesresponsetext.py - src/openrouter/components/openresponsesstreamevent.py - - src/openrouter/components/openresponsestoplogprobs.py - src/openrouter/components/openresponsesusage.py - src/openrouter/components/openresponseswebsearch20250826tool.py + - src/openrouter/components/openresponseswebsearchcallcompleted.py + - src/openrouter/components/openresponseswebsearchcallinprogress.py + - src/openrouter/components/openresponseswebsearchcallsearching.py - src/openrouter/components/openresponseswebsearchpreview20250311tool.py - src/openrouter/components/openresponseswebsearchpreviewtool.py - src/openrouter/components/openresponseswebsearchtool.py @@ -866,7 +1037,9 @@ generatedFiles: - src/openrouter/components/responsesoutputmessage.py - src/openrouter/components/responsesoutputmodality.py - src/openrouter/components/responsessearchcontextsize.py + - src/openrouter/components/responsesservertooloutput.py - src/openrouter/components/responseswebsearchcalloutput.py + - src/openrouter/components/responseswebsearchservertool.py - src/openrouter/components/responseswebsearchuserlocation.py - src/openrouter/components/responsetextconfig.py - src/openrouter/components/security.py @@ -885,6 +1058,8 @@ generatedFiles: - src/openrouter/components/videoinput.py - src/openrouter/components/websearchengine.py - src/openrouter/components/websearchpreviewtooluserlocation.py + - src/openrouter/components/websearchservertool.py + - src/openrouter/components/websearchshorthand.py - src/openrouter/components/websearchstatus.py - src/openrouter/credits.py - src/openrouter/embeddings.py @@ -892,6 +1067,7 @@ generatedFiles: - src/openrouter/errors/__init__.py - src/openrouter/errors/badgatewayresponse_error.py - src/openrouter/errors/badrequestresponse_error.py + - src/openrouter/errors/conflictresponse_error.py - src/openrouter/errors/edgenetworktimeoutresponse_error.py - src/openrouter/errors/forbiddenresponse_error.py - src/openrouter/errors/internalserverresponse_error.py @@ -983,7 +1159,7 @@ examples: application/json: {"store": false, "service_tier": "auto", "stream": false} responses: "200": - application/json: {"id": "resp-abc123", "object": "response", "created_at": 1704067200, "model": "gpt-4", "status": "completed", "completed_at": 2510.63, "output": [{"id": "msg-abc123", "role": "assistant", "type": "message", "content": [{"type": "output_text", "text": "Hello! How can I help you today?"}]}], "error": null, "incomplete_details": null, "temperature": null, "top_p": null, "presence_penalty": 7468.94, "frequency_penalty": 3967.09, "instructions": null, "metadata": null, "tools": [], "tool_choice": "auto", "parallel_tool_calls": true} + application/json: {"id": "resp-abc123", "object": "response", "created_at": 1704067200, "model": "gpt-4", "status": "completed", "completed_at": 2510.63, "output": [{"type": "message", "status": "completed"}], "error": null, "incomplete_details": null, "temperature": null, "top_p": null, "presence_penalty": 7468.94, "frequency_penalty": 3967.09, "instructions": null, "metadata": null, "tools": [], "tool_choice": "auto", "parallel_tool_calls": true} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "401": @@ -1096,7 +1272,7 @@ examples: id: "" responses: "200": - application/json: {"data": {"id": "gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG", "upstream_id": "chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946", "total_cost": 0.0015, "cache_discount": 0.0002, "upstream_inference_cost": 0.0012, "created_at": "2024-07-15T23:33:19.433273+00:00", "model": "sao10k/l3-stheno-8b", "app_id": 12345, "streamed": true, "cancelled": false, "provider_name": "Infermatic", "latency": 1250, "moderation_latency": 50, "generation_time": 1200, "finish_reason": "stop", "tokens_prompt": 10, "tokens_completion": 25, "native_tokens_prompt": 10, "native_tokens_completion": 25, "native_tokens_completion_images": 0, "native_tokens_reasoning": 5, "native_tokens_cached": 3, "num_media_prompt": 1, "num_input_audio_prompt": 0, "num_media_completion": 0, "num_search_results": 5, "origin": "https://openrouter.ai/", "usage": 0.0015, "is_byok": false, "native_finish_reason": "stop", "external_user": "user-123", "api_type": "completions", "router": "openrouter/auto", "provider_responses": []}} + application/json: {"data": {"id": "gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG", "upstream_id": "chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946", "total_cost": 0.0015, "cache_discount": 0.0002, "upstream_inference_cost": 0.0012, "created_at": "2024-07-15T23:33:19.433273+00:00", "model": "sao10k/l3-stheno-8b", "app_id": 12345, "streamed": true, "cancelled": false, "provider_name": "Infermatic", "latency": 1250, "moderation_latency": 50, "generation_time": 1200, "finish_reason": "stop", "tokens_prompt": 10, "tokens_completion": 25, "native_tokens_prompt": 10, "native_tokens_completion": 25, "native_tokens_completion_images": 0, "native_tokens_reasoning": 5, "native_tokens_cached": 3, "num_media_prompt": 1, "num_input_audio_prompt": 0, "num_media_completion": 0, "num_search_results": 5, "origin": "https://openrouter.ai/", "usage": 0.0015, "is_byok": false, "native_finish_reason": "stop", "external_user": "user-123", "api_type": "completions", "router": "openrouter/auto", "provider_responses": [], "user_agent": "", "http_referer": null}} "401": application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} "402": @@ -1120,6 +1296,8 @@ examples: application/json: {"data": {"count": 150}} "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} getModels: speakeasy-default-get-models: responses: @@ -1299,13 +1477,15 @@ examples: application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + "409": + application/json: {"error": {"code": 409, "message": "Resource conflict. Please try again later."}} sendChatCompletionRequest: speakeasy-default-send-chat-completion-request: requestBody: application/json: {"messages": [{"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "What is the capital of France?"}], "stream": false, "temperature": 0.7, "top_p": 1} responses: "200": - application/json: {"id": "chatcmpl-123", "choices": [{"finish_reason": "stop", "index": 0, "message": {"role": "assistant"}}], "created": 1677652288, "model": "openai/gpt-4", "object": "chat.completion"} + application/json: {"id": "chatcmpl-123", "choices": [{"finish_reason": "stop", "index": 0, "message": {"role": "assistant"}}], "created": 1677652288, "model": "openai/gpt-4", "object": "chat.completion", "system_fingerprint": "fp_44709d6fcb"} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "500": diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index de660ae..1b065b9 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -31,7 +31,7 @@ generation: skipResponseBodyAssertions: false preApplyUnionDiscriminators: true python: - version: 0.7.11 + version: 0.9.0 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml index 58e595c..b249217 100644 --- a/.speakeasy/in.openapi.yaml +++ b/.speakeasy/in.openapi.yaml @@ -209,6 +209,19 @@ components: anyOf: - $ref: '#/components/schemas/ResponseOutputText' - $ref: '#/components/schemas/OpenAIResponsesRefusalContent' + phase: + anyOf: + - type: string + enum: + - commentary + - type: string + enum: + - final_answer + - 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. required: - id - role @@ -413,15 +426,75 @@ components: - web_search_call id: type: string + action: + oneOf: + - type: object + properties: + type: + type: string + enum: + - search + query: + type: string + queries: + type: array + items: + type: string + sources: + type: array + items: + type: object + properties: + type: + type: string + enum: + - url + url: + type: string + required: + - type + - url + required: + - type + - query + - type: object + properties: + type: + type: string + enum: + - open_page + url: + type: string + nullable: true + required: + - type + - type: object + properties: + type: + type: string + enum: + - find_in_page + pattern: + type: string + url: + type: string + required: + - type + - pattern + - url status: $ref: '#/components/schemas/WebSearchStatus' required: - type - id + - action - status example: type: web_search_call id: search-abc123 + action: + type: search + query: OpenAI API status: completed ResponsesWebSearchCallOutput: allOf: @@ -431,6 +504,9 @@ components: example: type: web_search_call id: search-abc123 + action: + type: search + query: OpenAI API status: completed OutputItemFileSearchCall: type: object @@ -513,6 +589,31 @@ components: id: imagegen-abc123 result: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== status: completed + ResponsesServerToolOutput: + type: object + properties: + type: + type: string + pattern: '^openrouter:' + description: Server tool type (e.g. openrouter:datetime, openrouter:web_search) + id: + type: string + status: + type: string + enum: + - completed + - in_progress + - incomplete + required: + - type + - status + additionalProperties: + nullable: true + description: A generic OpenRouter server tool output item + example: + type: openrouter:web_search + id: ws_tmp_abc123 + status: completed ResponsesOutputItem: anyOf: - $ref: '#/components/schemas/ResponsesOutputMessage' @@ -521,6 +622,7 @@ components: - $ref: '#/components/schemas/ResponsesWebSearchCallOutput' - $ref: '#/components/schemas/ResponsesOutputItemFileSearchCall' - $ref: '#/components/schemas/ResponsesImageGenerationCall' + - $ref: '#/components/schemas/ResponsesServerToolOutput' description: An output item from the response example: id: msg-abc123 @@ -785,6 +887,15 @@ components: input_file: '#/components/schemas/ResponseInputFile' input_audio: '#/components/schemas/ResponseInputAudio' - type: string + phase: + anyOf: + - type: string + enum: + - commentary + - type: string + enum: + - final_answer + - nullable: true required: - role - content @@ -838,7 +949,20 @@ components: call_id: type: string output: - type: string + anyOf: + - type: string + - type: array + items: + oneOf: + - $ref: '#/components/schemas/ResponseInputText' + - $ref: '#/components/schemas/ResponseInputImage' + - $ref: '#/components/schemas/ResponseInputFile' + discriminator: + propertyName: type + mapping: + input_text: '#/components/schemas/ResponseInputText' + input_image: '#/components/schemas/ResponseInputImage' + input_file: '#/components/schemas/ResponseInputFile' status: $ref: '#/components/schemas/ToolCallStatus' required: @@ -964,6 +1088,39 @@ components: $ref: '#/components/schemas/ResponsesSearchContextSize' user_location: $ref: '#/components/schemas/WebSearchPreviewToolUserLocation' + engine: + type: string + enum: + - auto + - native + - exa + 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 (parameters like max_results, search_context_size, and domain + filters are not forwarded to the provider). "exa" forces the Exa search API. + example: auto + max_results: + type: number + minimum: 1 + maximum: 25 + description: >- + Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa + engine; ignored with native provider search. + example: 5 + filters: + type: object + nullable: true + properties: + allowed_domains: + type: array + nullable: true + items: + type: string + excluded_domains: + type: array + nullable: true + items: + type: string required: - type description: Web search preview tool configuration @@ -980,6 +1137,39 @@ components: $ref: '#/components/schemas/ResponsesSearchContextSize' user_location: $ref: '#/components/schemas/WebSearchPreviewToolUserLocation' + engine: + type: string + enum: + - auto + - native + - exa + 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 (parameters like max_results, search_context_size, and domain + filters are not forwarded to the provider). "exa" forces the Exa search API. + example: auto + max_results: + type: number + minimum: 1 + maximum: 25 + description: >- + Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa + engine; ignored with native provider search. + example: 5 + filters: + type: object + nullable: true + properties: + allowed_domains: + type: array + nullable: true + items: + type: string + excluded_domains: + type: array + nullable: true + items: + type: string required: - type description: Web search preview tool configuration (2025-03-11 version) @@ -1028,15 +1218,40 @@ components: nullable: true items: type: string + excluded_domains: + type: array + nullable: true + items: + type: string search_context_size: $ref: '#/components/schemas/ResponsesSearchContextSize' user_location: $ref: '#/components/schemas/ResponsesWebSearchUserLocation' + engine: + type: string + enum: + - auto + - native + - exa + 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 (parameters like max_results, search_context_size, and domain + filters are not forwarded to the provider). "exa" forces the Exa search API. + example: auto + max_results: + type: number + minimum: 1 + maximum: 25 + description: >- + Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa + engine; ignored with native provider search. + example: 5 required: - type description: Web search tool configuration example: type: web_search + engine: auto filters: allowed_domains: - example.com @@ -1056,245 +1271,646 @@ components: nullable: true items: type: string + excluded_domains: + type: array + nullable: true + items: + type: string search_context_size: $ref: '#/components/schemas/ResponsesSearchContextSize' user_location: $ref: '#/components/schemas/ResponsesWebSearchUserLocation' + engine: + type: string + enum: + - auto + - native + - exa + 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 (parameters like max_results, search_context_size, and domain + filters are not forwarded to the provider). "exa" forces the Exa search API. + example: auto + max_results: + type: number + minimum: 1 + maximum: 25 + description: >- + Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa + engine; ignored with native provider search. + example: 5 required: - type description: Web search tool configuration (2025-08-26 version) example: type: web_search_2025_08_26 + engine: auto filters: allowed_domains: - example.com - OpenAIResponsesToolChoice: - anyOf: - - type: string - enum: - - auto - - type: string - enum: - - none - - type: string - enum: - - required - - type: object - properties: - type: - type: string - enum: - - function - name: - type: string - required: - - type - - name - - type: object - properties: - type: - anyOf: - - type: string - enum: - - web_search_preview_2025_03_11 - - type: string - enum: - - web_search_preview - required: - - type - OpenAIResponsesPrompt: - type: object - nullable: true - properties: - id: - type: string - variables: - type: object - nullable: true - additionalProperties: - anyOf: - - type: string - - $ref: '#/components/schemas/ResponseInputText' - - $ref: '#/components/schemas/ResponseInputImage' - - $ref: '#/components/schemas/ResponseInputFile' - required: - - id - OpenAIResponsesReasoningEffort: - type: string - nullable: true - enum: - - xhigh - - high - - medium - - low - - minimal - - none - ReasoningSummaryVerbosity: - type: string - nullable: true - enum: - - auto - - concise - - detailed - example: auto - OpenAIResponsesReasoningConfig: - type: object - nullable: true - properties: - effort: - $ref: '#/components/schemas/OpenAIResponsesReasoningEffort' - summary: - $ref: '#/components/schemas/ReasoningSummaryVerbosity' - OpenAIResponsesServiceTier: - type: string - nullable: true - enum: - - auto - - default - - flex - - priority - - scale - OpenAIResponsesTruncation: - type: string - nullable: true - enum: - - auto - - disabled - ResponsesFormatText: + CompoundFilter: type: object properties: type: type: string enum: - - text + - and + - or + filters: + type: array + items: + type: object + additionalProperties: + nullable: true required: - type - description: Plain text response format - example: - type: text - ResponsesFormatTextJSONSchemaConfig: + - filters + description: A compound filter that combines multiple comparison or compound filters + OpenResponsesFileSearchTool: type: object properties: type: type: string enum: - - json_schema - name: + - file_search + vector_store_ids: + type: array + items: + type: string + filters: + anyOf: + - type: object + properties: + key: + type: string + type: + type: string + enum: + - eq + - ne + - gt + - gte + - lt + - lte + value: + anyOf: + - type: string + - type: number + - type: boolean + - type: array + items: + anyOf: + - type: string + - type: number + required: + - key + - type + - value + - $ref: '#/components/schemas/CompoundFilter' + - nullable: true + max_num_results: + type: integer + minimum: 1 + maximum: 50 + ranking_options: + type: object + properties: + ranker: + type: string + enum: + - auto + - default-2024-11-15 + score_threshold: + type: number + required: + - type + - vector_store_ids + description: File search tool configuration + example: + type: file_search + vector_store_ids: + - vs_abc123 + OpenResponsesComputerTool: + type: object + properties: + type: type: string - description: + enum: + - computer_use_preview + display_height: + type: number + display_width: + type: number + environment: type: string - strict: - type: boolean - nullable: true - schema: - type: object - additionalProperties: - nullable: true + enum: + - windows + - mac + - linux + - ubuntu + - browser required: - type - - name - - schema - description: JSON schema constrained response format + - display_height + - display_width + - environment + description: Computer use preview tool configuration example: - type: json_schema - name: user_info - description: User information schema - schema: + type: computer_use_preview + display_height: 768 + display_width: 1024 + environment: linux + OpenResponsesCodeInterpreterTool: + type: object + properties: + type: + type: string + enum: + - code_interpreter + container: + anyOf: + - type: string + - type: object + properties: + type: + type: string + enum: + - auto + file_ids: + type: array + items: + type: string + memory_limit: + type: string + nullable: true + enum: + - 1g + - 4g + - 16g + - 64g + required: + - type + required: + - type + - container + description: Code interpreter tool configuration + example: + type: code_interpreter + container: auto + OpenResponsesMcpTool: + type: object + properties: + type: + type: string + enum: + - mcp + server_label: + type: string + allowed_tools: + anyOf: + - type: array + items: + type: string + - type: object + properties: + tool_names: + type: array + items: + type: string + read_only: + type: boolean + - nullable: true + - nullable: true + authorization: + type: string + connector_id: + type: string + enum: + - connector_dropbox + - connector_gmail + - connector_googlecalendar + - connector_googledrive + - connector_microsoftteams + - connector_outlookcalendar + - connector_outlookemail + - connector_sharepoint + headers: type: object - properties: - name: - type: string - age: - type: number - required: - - name - ResponseFormatTextConfig: - anyOf: - - $ref: '#/components/schemas/ResponsesFormatText' - - $ref: '#/components/schemas/ResponseFormatJSONObject' - - $ref: '#/components/schemas/ResponsesFormatTextJSONSchemaConfig' - description: Text response format configuration + nullable: true + additionalProperties: + type: string + require_approval: + anyOf: + - type: object + properties: + never: + type: object + properties: + tool_names: + type: array + items: + type: string + always: + type: object + properties: + tool_names: + type: array + items: + type: string + - type: string + enum: + - always + - type: string + enum: + - never + - nullable: true + - nullable: true + server_description: + type: string + server_url: + type: string + required: + - type + - server_label + description: MCP (Model Context Protocol) tool configuration example: - type: text - ResponseTextConfig: + type: mcp + server_label: my-server + server_url: https://example.com/mcp + OpenResponsesImageGenerationTool: type: object properties: - format: - $ref: '#/components/schemas/ResponseFormatTextConfig' - verbosity: + type: + type: string + enum: + - image_generation + background: + type: string + enum: + - transparent + - opaque + - auto + input_fidelity: type: string nullable: true enum: - high - low + input_image_mask: + type: object + properties: + image_url: + type: string + file_id: + type: string + model: + type: string + enum: + - gpt-image-1 + - gpt-image-1-mini + moderation: + type: string + enum: + - auto + - low + output_compression: + type: number + output_format: + type: string + enum: + - png + - webp + - jpeg + partial_images: + type: number + quality: + type: string + enum: + - low - medium - description: Text output configuration including format and verbosity + - high + - auto + size: + type: string + enum: + - 1024x1024 + - 1024x1536 + - 1536x1024 + - auto + required: + - type + description: Image generation tool configuration example: - format: - type: text - verbosity: medium - OpenAIResponsesNonStreamingResponse: + type: image_generation + quality: high + OpenResponsesLocalShellTool: type: object properties: - id: - type: string - object: + type: type: string enum: - - response - created_at: - type: number - model: + - local_shell + required: + - type + description: Local shell tool configuration + example: + type: local_shell + OpenResponsesFunctionShellTool: + type: object + properties: + type: type: string - status: - $ref: '#/components/schemas/OpenAIResponsesResponseStatus' - completed_at: - type: number - nullable: true - output: - type: array - items: - 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' - discriminator: - propertyName: type - mapping: - message: '#/components/schemas/OutputMessage' - reasoning: '#/components/schemas/OutputItemReasoning' - function_call: '#/components/schemas/OutputItemFunctionCall' - web_search_call: '#/components/schemas/OutputItemWebSearchCall' - file_search_call: '#/components/schemas/OutputItemFileSearchCall' - image_generation_call: '#/components/schemas/OutputItemImageGenerationCall' - user: + enum: + - shell + required: + - type + description: Shell tool configuration + example: + type: shell + OpenResponsesApplyPatchTool: + type: object + properties: + type: type: string - nullable: true - output_text: + enum: + - apply_patch + required: + - type + description: Apply patch tool configuration + example: + type: apply_patch + OpenResponsesCustomTool: + type: object + properties: + type: type: string - prompt_cache_key: + enum: + - custom + name: type: string - nullable: true - safety_identifier: + description: type: string - nullable: true - error: - $ref: '#/components/schemas/ResponsesErrorField' - incomplete_details: - $ref: '#/components/schemas/OpenAIResponsesIncompleteDetails' - usage: - $ref: '#/components/schemas/OpenAIResponsesUsage' - max_tool_calls: - type: number - nullable: true - top_logprobs: - type: number - max_output_tokens: - type: number - nullable: true + format: + anyOf: + - type: object + properties: + type: + type: string + enum: + - text + required: + - type + - type: object + properties: + type: + type: string + enum: + - grammar + definition: + type: string + syntax: + type: string + enum: + - lark + - regex + required: + - type + - definition + - syntax + required: + - type + - name + description: Custom tool configuration + example: + type: custom + name: my_tool + OpenAIResponsesToolChoice: + anyOf: + - type: string + enum: + - auto + - type: string + enum: + - none + - type: string + enum: + - required + - type: object + properties: + type: + type: string + enum: + - function + name: + type: string + required: + - type + - name + - type: object + properties: + type: + anyOf: + - type: string + enum: + - web_search_preview_2025_03_11 + - type: string + enum: + - web_search_preview + required: + - type + OpenAIResponsesPrompt: + type: object + nullable: true + properties: + id: + type: string + variables: + type: object + nullable: true + additionalProperties: + anyOf: + - type: string + - $ref: '#/components/schemas/ResponseInputText' + - $ref: '#/components/schemas/ResponseInputImage' + - $ref: '#/components/schemas/ResponseInputFile' + required: + - id + OpenAIResponsesReasoningEffort: + type: string + nullable: true + enum: + - xhigh + - high + - medium + - low + - minimal + - none + ReasoningSummaryVerbosity: + type: string + nullable: true + enum: + - auto + - concise + - detailed + example: auto + OpenAIResponsesReasoningConfig: + type: object + nullable: true + properties: + effort: + $ref: '#/components/schemas/OpenAIResponsesReasoningEffort' + summary: + $ref: '#/components/schemas/ReasoningSummaryVerbosity' + OpenAIResponsesServiceTier: + type: string + nullable: true + enum: + - auto + - default + - flex + - priority + - scale + OpenAIResponsesTruncation: + type: string + nullable: true + enum: + - auto + - disabled + ResponsesFormatText: + type: object + properties: + type: + type: string + enum: + - text + required: + - type + description: Plain text response format + example: + type: text + ResponsesFormatTextJSONSchemaConfig: + type: object + properties: + type: + type: string + enum: + - json_schema + name: + type: string + description: + type: string + strict: + type: boolean + nullable: true + schema: + type: object + additionalProperties: + nullable: true + required: + - type + - name + - schema + description: JSON schema constrained response format + example: + type: json_schema + name: user_info + description: User information schema + schema: + type: object + properties: + name: + type: string + age: + type: number + required: + - name + ResponseFormatTextConfig: + anyOf: + - $ref: '#/components/schemas/ResponsesFormatText' + - $ref: '#/components/schemas/ResponseFormatJSONObject' + - $ref: '#/components/schemas/ResponsesFormatTextJSONSchemaConfig' + description: Text response format configuration + example: + type: text + ResponseTextConfig: + type: object + properties: + format: + $ref: '#/components/schemas/ResponseFormatTextConfig' + verbosity: + type: string + nullable: true + enum: + - high + - low + - medium + description: Text output configuration including format and verbosity + example: + format: + type: text + verbosity: medium + OpenAIResponsesNonStreamingResponse: + type: object + properties: + id: + type: string + object: + type: string + enum: + - response + created_at: + type: number + model: + type: string + status: + $ref: '#/components/schemas/OpenAIResponsesResponseStatus' + completed_at: + type: number + nullable: true + output: + type: array + items: + 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' + discriminator: + propertyName: type + mapping: + message: '#/components/schemas/OutputMessage' + reasoning: '#/components/schemas/OutputItemReasoning' + function_call: '#/components/schemas/OutputItemFunctionCall' + web_search_call: '#/components/schemas/OutputItemWebSearchCall' + file_search_call: '#/components/schemas/OutputItemFileSearchCall' + image_generation_call: '#/components/schemas/OutputItemImageGenerationCall' + user: + type: string + nullable: true + output_text: + type: string + prompt_cache_key: + type: string + nullable: true + safety_identifier: + type: string + nullable: true + error: + $ref: '#/components/schemas/ResponsesErrorField' + incomplete_details: + $ref: '#/components/schemas/OpenAIResponsesIncompleteDetails' + usage: + $ref: '#/components/schemas/OpenAIResponsesUsage' + max_tool_calls: + type: number + nullable: true + top_logprobs: + type: number + max_output_tokens: + type: number + nullable: true temperature: type: number nullable: true @@ -1341,6 +1957,15 @@ components: - $ref: '#/components/schemas/OpenResponsesWebSearchPreview20250311Tool' - $ref: '#/components/schemas/OpenResponsesWebSearchTool' - $ref: '#/components/schemas/OpenResponsesWebSearch20250826Tool' + - $ref: '#/components/schemas/OpenResponsesFileSearchTool' + - $ref: '#/components/schemas/OpenResponsesComputerTool' + - $ref: '#/components/schemas/OpenResponsesCodeInterpreterTool' + - $ref: '#/components/schemas/OpenResponsesMcpTool' + - $ref: '#/components/schemas/OpenResponsesImageGenerationTool' + - $ref: '#/components/schemas/OpenResponsesLocalShellTool' + - $ref: '#/components/schemas/OpenResponsesFunctionShellTool' + - $ref: '#/components/schemas/OpenResponsesApplyPatchTool' + - $ref: '#/components/schemas/OpenResponsesCustomTool' tool_choice: $ref: '#/components/schemas/OpenAIResponsesToolChoice' parallel_tool_calls: @@ -1829,6 +2454,10 @@ components: type: string logprob: type: number + bytes: + type: array + items: + type: number description: Alternative token with its log probability example: token: hello @@ -1844,7 +2473,11 @@ components: type: array items: $ref: '#/components/schemas/OpenResponsesTopLogprobs' - required: + bytes: + type: array + items: + type: number + required: - logprob - token description: Log probability information for a token @@ -2482,6 +3115,93 @@ components: output_index: 0 sequence_number: 4 item_id: call-123 + OpenAIResponsesWebSearchCallInProgress: + type: object + properties: + type: + type: string + enum: + - response.web_search_call.in_progress + item_id: + type: string + output_index: + type: number + sequence_number: + type: number + required: + - type + - item_id + - output_index + - sequence_number + OpenResponsesWebSearchCallInProgress: + allOf: + - $ref: '#/components/schemas/OpenAIResponsesWebSearchCallInProgress' + - type: object + properties: {} + description: Web search call in progress + example: + type: response.web_search_call.in_progress + output_index: 0 + sequence_number: 1 + item_id: ws-123 + OpenAIResponsesWebSearchCallSearching: + type: object + properties: + type: + type: string + enum: + - response.web_search_call.searching + item_id: + type: string + output_index: + type: number + sequence_number: + type: number + required: + - type + - item_id + - output_index + - sequence_number + OpenResponsesWebSearchCallSearching: + allOf: + - $ref: '#/components/schemas/OpenAIResponsesWebSearchCallSearching' + - type: object + properties: {} + description: Web search call is searching + example: + type: response.web_search_call.searching + output_index: 0 + sequence_number: 2 + item_id: ws-123 + OpenAIResponsesSearchCompleted: + type: object + properties: + type: + type: string + enum: + - response.web_search_call.completed + item_id: + type: string + output_index: + type: number + sequence_number: + type: number + required: + - type + - item_id + - output_index + - sequence_number + OpenResponsesWebSearchCallCompleted: + allOf: + - $ref: '#/components/schemas/OpenAIResponsesSearchCompleted' + - type: object + properties: {} + description: Web search call completed + example: + type: response.web_search_call.completed + output_index: 0 + sequence_number: 3 + item_id: ws-123 OpenResponsesStreamEvent: oneOf: - allOf: @@ -2708,7 +3428,32 @@ components: - allOf: - $ref: '#/components/schemas/OpenResponsesTextDeltaEvent' - type: object - properties: {} + properties: + logprobs: + type: array + items: + allOf: + - $ref: '#/components/schemas/OpenResponsesLogProbs' + - type: object + properties: + top_logprobs: + type: array + items: + allOf: + - $ref: '#/components/schemas/OpenResponsesTopLogprobs' + - type: object + properties: {} + description: Alternative token with its log probability + example: + token: hello + logprob: -0.5 + description: Log probability information for a token + example: + logprob: -0.1 + token: world + top_logprobs: + - token: hello + logprob: -0.5 description: Event emitted when a text delta is streamed example: type: response.output_text.delta @@ -2721,7 +3466,32 @@ components: - allOf: - $ref: '#/components/schemas/OpenResponsesTextDoneEvent' - type: object - properties: {} + properties: + logprobs: + type: array + items: + allOf: + - $ref: '#/components/schemas/OpenResponsesLogProbs' + - type: object + properties: + top_logprobs: + type: array + items: + allOf: + - $ref: '#/components/schemas/OpenResponsesTopLogprobs' + - type: object + properties: {} + description: Alternative token with its log probability + example: + token: hello + logprob: -0.5 + description: Log probability information for a token + example: + logprob: -0.1 + token: world + top_logprobs: + - token: hello + logprob: -0.5 description: Event emitted when text streaming is complete example: type: response.output_text.done @@ -2819,6 +3589,9 @@ components: - $ref: '#/components/schemas/OpenResponsesImageGenCallGenerating' - $ref: '#/components/schemas/OpenResponsesImageGenCallPartialImage' - $ref: '#/components/schemas/OpenResponsesImageGenCallCompleted' + - $ref: '#/components/schemas/OpenResponsesWebSearchCallInProgress' + - $ref: '#/components/schemas/OpenResponsesWebSearchCallSearching' + - $ref: '#/components/schemas/OpenResponsesWebSearchCallCompleted' description: Union of all possible event types emitted during response streaming example: type: response.created @@ -3369,9 +4142,23 @@ components: - $ref: '#/components/schemas/ResponseInputAudio' - $ref: '#/components/schemas/ResponseInputVideo' - type: string + - nullable: true + phase: + anyOf: + - type: string + enum: + - commentary + - type: string + enum: + - final_answer + - 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. + example: final_answer required: - role - - content OpenResponsesInputMessageItem: type: object properties: @@ -3394,6 +4181,7 @@ components: - developer content: type: array + nullable: true items: oneOf: - $ref: '#/components/schemas/ResponseInputText' @@ -3411,7 +4199,6 @@ components: - $ref: '#/components/schemas/ResponseInputVideo' required: - role - - content OpenResponsesFunctionToolCall: type: object properties: @@ -3456,7 +4243,22 @@ components: call_id: type: string output: - type: string + anyOf: + - type: string + - type: array + items: + oneOf: + - $ref: '#/components/schemas/ResponseInputText' + - allOf: + - $ref: '#/components/schemas/ResponseInputImage' + - type: object + properties: {} + description: Image input content item + example: + type: input_image + detail: auto + image_url: https://example.com/image.jpg + - $ref: '#/components/schemas/ResponseInputFile' status: $ref: '#/components/schemas/ToolCallStatus' required: @@ -3481,16 +4283,90 @@ components: - $ref: '#/components/schemas/OpenResponsesInputMessageItem' - $ref: '#/components/schemas/OpenResponsesFunctionToolCall' - $ref: '#/components/schemas/OpenResponsesFunctionCallOutput' - - $ref: '#/components/schemas/ResponsesOutputMessage' - - $ref: '#/components/schemas/ResponsesOutputItemReasoning' + - allOf: + - $ref: '#/components/schemas/ResponsesOutputMessage' + - type: object + properties: + content: + anyOf: + - type: array + items: + anyOf: + - $ref: '#/components/schemas/ResponseOutputText' + - $ref: '#/components/schemas/OpenAIResponsesRefusalContent' + - type: string + - nullable: true + example: + id: msg-123 + type: message + role: assistant + status: completed + content: + - type: output_text + text: Hello! How can I help you? + annotations: [] + description: An output message item + - allOf: + - $ref: '#/components/schemas/ResponsesOutputItemReasoning' + - type: object + properties: + summary: + type: array + nullable: true + items: + $ref: '#/components/schemas/ReasoningSummaryText' + example: + id: reasoning-123 + type: reasoning + status: completed + summary: + - type: summary_text + text: Analyzed the problem and found the optimal solution. + content: + - type: reasoning_text + text: First, we analyze the problem... + signature: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj... + format: anthropic-claude-v1 + description: An output item containing reasoning - $ref: '#/components/schemas/ResponsesOutputItemFunctionCall' - $ref: '#/components/schemas/ResponsesWebSearchCallOutput' - $ref: '#/components/schemas/ResponsesOutputItemFileSearchCall' - $ref: '#/components/schemas/ResponsesImageGenerationCall' + - $ref: '#/components/schemas/ResponsesServerToolOutput' description: Input for a response request - can be a string or array of items example: - role: user content: What is the weather today? + ResponsesWebSearchServerTool: + type: object + properties: + type: + type: string + enum: + - openrouter:web_search + parameters: + type: object + properties: + max_results: + type: number + minimum: 1 + maximum: 25 + description: Maximum number of search results to return per search call. Defaults to 5. + example: 5 + max_total_results: + type: number + minimum: 1 + 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 + required: + - type + description: 'OpenRouter built-in server tool: searches the web for current information' + example: + type: openrouter:web_search + parameters: + max_results: 5 OpenResponsesResponseText: allOf: - $ref: '#/components/schemas/ResponseTextConfig' @@ -3548,6 +4424,7 @@ components: ProviderName: type: string enum: + - AkashML - AI21 - AionLabs - Alibaba @@ -3642,6 +4519,7 @@ components: - price - throughput - latency + - exacto description: The provider sorting strategy (price, throughput, latency) example: price ProviderSortConfig: @@ -3654,6 +4532,7 @@ components: - price - throughput - latency + - exacto description: The provider sorting strategy (price, throughput, latency) example: price partition: @@ -3747,6 +4626,8 @@ components: enum: - native - exa + - firecrawl + - parallel description: The search engine to use for web search. PDFParserEngine: type: string @@ -3761,6 +4642,11 @@ components: engine: $ref: '#/components/schemas/PDFParserEngine' description: Options for PDF parsing. + ContextCompressionEngine: + type: string + enum: + - middle-out + description: The compression engine to use. Defaults to "middle-out". OpenResponsesRequest: type: object properties: @@ -3774,7 +4660,7 @@ components: tools: type: array items: - oneOf: + anyOf: - allOf: - $ref: '#/components/schemas/OpenResponsesFunctionTool' - type: object @@ -3801,6 +4687,17 @@ components: - $ref: '#/components/schemas/OpenResponsesWebSearchPreview20250311Tool' - $ref: '#/components/schemas/OpenResponsesWebSearchTool' - $ref: '#/components/schemas/OpenResponsesWebSearch20250826Tool' + - $ref: '#/components/schemas/OpenResponsesFileSearchTool' + - $ref: '#/components/schemas/OpenResponsesComputerTool' + - $ref: '#/components/schemas/OpenResponsesCodeInterpreterTool' + - $ref: '#/components/schemas/OpenResponsesMcpTool' + - $ref: '#/components/schemas/OpenResponsesImageGenerationTool' + - $ref: '#/components/schemas/OpenResponsesLocalShellTool' + - $ref: '#/components/schemas/OpenResponsesFunctionShellTool' + - $ref: '#/components/schemas/OpenResponsesApplyPatchTool' + - $ref: '#/components/schemas/OpenResponsesCustomTool' + - $ref: '#/components/schemas/DatetimeServerTool' + - $ref: '#/components/schemas/ResponsesWebSearchServerTool' tool_choice: $ref: '#/components/schemas/OpenAIResponsesToolChoice' parallel_tool_calls: @@ -4065,6 +4962,28 @@ components: type: string engine: $ref: '#/components/schemas/WebSearchEngine' + include_domains: + type: array + items: + type: string + description: >- + 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: + - example.com + - '*.substack.com' + - openai.com/blog + exclude_domains: + type: array + items: + type: string + description: >- + 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: + - example.com + - '*.substack.com' + - openai.com/blog required: - id - type: object @@ -4091,6 +5010,19 @@ components: description: Set to false to disable the response-healing plugin for this request. Defaults to true. required: - id + - type: object + properties: + id: + type: string + enum: + - context-compression + enabled: + type: boolean + description: Set to false to disable the context-compression plugin for this request. Defaults to true. + engine: + $ref: '#/components/schemas/ContextCompressionEngine' + required: + - id description: Plugins you want to enable for this request, including their settings. route: type: string @@ -4169,6 +5101,17 @@ components: type: string enum: - assistant + container: + type: object + nullable: true + properties: + id: + type: string + expires_at: + type: string + required: + - id + - expires_at content: type: array items: @@ -4330,6 +5273,38 @@ components: - tool_use id: type: string + caller: + oneOf: + - type: object + properties: + type: + type: string + enum: + - direct + required: + - type + - type: object + properties: + type: + type: string + enum: + - code_execution_20250825 + tool_id: + type: string + required: + - type + - tool_id + - type: object + properties: + type: + type: string + enum: + - code_execution_20260120 + tool_id: + type: string + required: + - type + - tool_id name: type: string input: @@ -4337,6 +5312,7 @@ components: required: - type - id + - caller - name - type: object properties: @@ -4371,15 +5347,54 @@ components: - server_tool_use id: type: string + caller: + oneOf: + - type: object + properties: + type: + type: string + enum: + - direct + required: + - type + - type: object + properties: + type: + type: string + enum: + - code_execution_20250825 + tool_id: + type: string + required: + - type + - tool_id + - type: object + properties: + type: + type: string + enum: + - code_execution_20260120 + tool_id: + type: string + required: + - type + - tool_id name: type: string enum: - web_search + - web_fetch + - code_execution + - bash_code_execution + - text_editor_code_execution + - tool_search_tool_regex + - tool_search_tool_bm25 input: nullable: true required: - type - id + - caller - name - type: object properties: @@ -4387,24 +5402,56 @@ components: type: string enum: - web_search_tool_result - tool_use_id: - type: string - content: - anyOf: - - type: array - items: - type: object - properties: - type: - type: string - enum: - - web_search_result - encrypted_content: - type: string - page_age: - type: string - nullable: true - title: + caller: + oneOf: + - type: object + properties: + type: + type: string + enum: + - direct + required: + - type + - type: object + properties: + type: + type: string + enum: + - code_execution_20250825 + tool_id: + type: string + required: + - type + - tool_id + - type: object + properties: + type: + type: string + enum: + - code_execution_20260120 + tool_id: + type: string + required: + - type + - tool_id + tool_use_id: + type: string + content: + anyOf: + - type: array + items: + type: object + properties: + type: + type: string + enum: + - web_search_result + encrypted_content: + type: string + page_age: + type: string + nullable: true + title: type: string url: type: string @@ -4428,470 +5475,1755 @@ components: - max_uses_exceeded - too_many_requests - query_too_long + - request_too_large required: - type - error_code required: - type + - caller - tool_use_id - content - model: - type: string - stop_reason: - type: string - nullable: true - enum: - - end_turn - - max_tokens - - stop_sequence - - tool_use - - pause_turn - - refusal - stop_sequence: - type: string - nullable: true - usage: - type: object - properties: - input_tokens: - type: number - output_tokens: - type: number - cache_creation_input_tokens: - type: number - nullable: true - cache_read_input_tokens: - type: number - nullable: true - cache_creation: - type: object - nullable: true - properties: - ephemeral_5m_input_tokens: - type: number - ephemeral_1h_input_tokens: - type: number - required: - - ephemeral_5m_input_tokens - - ephemeral_1h_input_tokens - inference_geo: - type: string - nullable: true - server_tool_use: - type: object - nullable: true - properties: - web_search_requests: - type: number - required: - - web_search_requests - service_tier: - type: string - nullable: true - enum: - - standard - - priority - - batch - required: - - input_tokens - - output_tokens - - cache_creation_input_tokens - - cache_read_input_tokens - - cache_creation - - inference_geo - - server_tool_use - - service_tier - required: - - id - - type - - role - - content - - model - - stop_reason - - stop_sequence - - usage - AnthropicMessagesResponse: - allOf: - - $ref: '#/components/schemas/BaseAnthropicMessagesResponse' - - type: object - properties: {} - description: Non-streaming response from the Anthropic Messages API with OpenRouter extensions - example: - id: msg_01XFDUDYJgAACzvnptvVoYEL - type: message - role: assistant - content: - - type: text - text: Hello! I'm doing well, thank you for asking. - citations: null - model: claude-sonnet-4-5-20250929 - stop_reason: end_turn - stop_sequence: null - usage: - input_tokens: 12 - output_tokens: 15 - cache_creation_input_tokens: null - cache_read_input_tokens: null - cache_creation: null - inference_geo: null - server_tool_use: null - service_tier: standard - AnthropicMessagesStreamEvent: - oneOf: - - type: object - properties: - type: - type: string - enum: - - message_start - message: - type: object - properties: - id: - type: string - type: - type: string - enum: - - message - role: - type: string - enum: - - assistant - content: - type: array - items: + - type: object + properties: + type: + type: string + enum: + - web_fetch_tool_result + caller: oneOf: - type: object properties: type: type: string enum: - - text - text: - type: string - citations: - type: array - nullable: true - items: - oneOf: - - type: object - properties: - type: - type: string - enum: - - char_location - cited_text: - type: string - document_index: - type: number - document_title: - type: string - nullable: true - start_char_index: - type: number - end_char_index: - type: number - file_id: - type: string - nullable: true - required: - - type - - cited_text - - document_index - - document_title - - start_char_index - - end_char_index - - file_id - - type: object - properties: - type: - type: string - enum: - - page_location - cited_text: - type: string - document_index: - type: number - document_title: - type: string - nullable: true - start_page_number: - type: number - end_page_number: - type: number - file_id: - type: string - nullable: true - required: - - type - - cited_text - - document_index - - document_title - - start_page_number - - end_page_number - - file_id - - type: object - properties: - type: - type: string - enum: - - content_block_location - cited_text: - type: string - document_index: - type: number - document_title: - type: string - nullable: true - start_block_index: - type: number - end_block_index: - type: number - file_id: - type: string - nullable: true - required: - - type - - cited_text - - document_index - - document_title - - start_block_index - - end_block_index - - file_id - - type: object - properties: - type: - type: string - enum: - - web_search_result_location - cited_text: - type: string - encrypted_index: - type: string - title: - type: string - nullable: true - url: - type: string - required: - - type - - cited_text - - encrypted_index - - title - - url - - type: object - properties: - type: - type: string - enum: - - search_result_location - cited_text: - type: string - search_result_index: - type: number - source: - type: string - title: - type: string - nullable: true - start_block_index: - type: number - end_block_index: - type: number - required: - - type - - cited_text - - search_result_index - - source - - title - - start_block_index - - end_block_index + - direct required: - type - - text - - citations - type: object properties: type: type: string enum: - - tool_use - id: - type: string - name: + - code_execution_20250825 + tool_id: type: string - input: - nullable: true required: - type - - id - - name + - tool_id - type: object properties: type: type: string enum: - - thinking - thinking: - type: string - signature: + - code_execution_20260120 + tool_id: type: string required: - type - - thinking - - signature + - tool_id + content: + oneOf: - type: object properties: type: type: string enum: - - redacted_thinking - data: + - web_fetch_tool_result_error + error_code: + type: string + enum: + - invalid_tool_input + - url_too_long + - url_not_allowed + - url_not_accessible + - unsupported_content_type + - too_many_requests + - max_uses_exceeded + - unavailable + required: + - type + - error_code + - type: object + properties: + content: + type: object + properties: + citations: + type: object + nullable: true + properties: + enabled: + type: boolean + required: + - enabled + source: + anyOf: + - type: object + properties: + data: + type: string + media_type: + type: string + enum: + - application/pdf + type: + type: string + enum: + - base64 + required: + - data + - media_type + - type + - type: object + properties: + data: + type: string + media_type: + type: string + enum: + - text/plain + type: + type: string + enum: + - text + required: + - data + - media_type + - type + title: + type: string + nullable: true + type: + type: string + enum: + - document + required: + - citations + - source + - title + - type + retrieved_at: + type: string + nullable: true + type: + type: string + enum: + - web_fetch_result + url: + type: string + required: + - content + - retrieved_at + - type + - url + tool_use_id: + type: string + required: + - type + - caller + - content + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - code_execution_tool_result + content: + oneOf: + - type: object + properties: + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - too_many_requests + - execution_time_exceeded + type: + type: string + enum: + - code_execution_tool_result_error + required: + - error_code + - type + - type: object + properties: + content: + type: array + items: + type: object + properties: + file_id: + type: string + type: + type: string + enum: + - code_execution_output + required: + - file_id + - type + return_code: + type: number + stderr: + type: string + stdout: type: string - required: - - type - - data - - type: object - properties: type: type: string enum: - - server_tool_use - id: + - code_execution_result + required: + - content + - return_code + - stderr + - stdout + - type + - type: object + properties: + content: + type: array + items: + type: object + properties: + file_id: + type: string + type: + type: string + enum: + - code_execution_output + required: + - file_id + - type + encrypted_stdout: + type: string + return_code: + type: number + stderr: type: string - name: + type: type: string enum: - - web_search - input: - nullable: true + - encrypted_code_execution_result + required: + - content + - encrypted_stdout + - return_code + - stderr + - type + tool_use_id: + type: string + required: + - type + - content + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - bash_code_execution_tool_result + content: + oneOf: + - type: object + properties: + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - too_many_requests + - execution_time_exceeded + - output_file_too_large + type: + type: string + enum: + - bash_code_execution_tool_result_error required: + - error_code - type - - id - - name - type: object properties: + content: + type: array + items: + type: object + properties: + file_id: + type: string + type: + type: string + enum: + - bash_code_execution_output + required: + - file_id + - type + return_code: + type: number + stderr: + type: string + stdout: + type: string type: type: string enum: - - web_search_tool_result - tool_use_id: + - bash_code_execution_result + required: + - content + - return_code + - stderr + - stdout + - type + tool_use_id: + type: string + required: + - type + - content + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - text_editor_code_execution_tool_result + content: + oneOf: + - type: object + properties: + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - too_many_requests + - execution_time_exceeded + - file_not_found + error_message: + type: string + nullable: true + type: type: string + enum: + - text_editor_code_execution_tool_result_error + required: + - error_code + - error_message + - type + - type: object + properties: content: - anyOf: - - type: array + type: string + file_type: + type: string + enum: + - text + - image + - pdf + num_lines: + type: number + nullable: true + start_line: + type: number + nullable: true + total_lines: + type: number + nullable: true + type: + type: string + enum: + - text_editor_code_execution_view_result + required: + - content + - file_type + - num_lines + - start_line + - total_lines + - type + - type: object + properties: + is_file_update: + type: boolean + type: + type: string + enum: + - text_editor_code_execution_create_result + required: + - is_file_update + - type + - type: object + properties: + lines: + type: array + nullable: true + items: + type: string + new_lines: + type: number + nullable: true + new_start: + type: number + nullable: true + old_lines: + type: number + nullable: true + old_start: + type: number + nullable: true + type: + type: string + enum: + - text_editor_code_execution_str_replace_result + required: + - lines + - new_lines + - new_start + - old_lines + - old_start + - type + tool_use_id: + type: string + required: + - type + - content + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - tool_search_tool_result + content: + oneOf: + - type: object + properties: + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - too_many_requests + - execution_time_exceeded + error_message: + type: string + nullable: true + type: + type: string + enum: + - tool_search_tool_result_error + required: + - error_code + - error_message + - type + - type: object + properties: + tool_references: + type: array + items: + type: object + properties: + tool_name: + type: string + type: + type: string + enum: + - tool_reference + required: + - tool_name + - type + type: + type: string + enum: + - tool_search_tool_search_result + required: + - tool_references + - type + tool_use_id: + type: string + required: + - type + - content + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - container_upload + file_id: + type: string + required: + - type + - file_id + model: + type: string + stop_reason: + type: string + nullable: true + enum: + - end_turn + - max_tokens + - stop_sequence + - tool_use + - pause_turn + - refusal + stop_sequence: + type: string + nullable: true + usage: + type: object + properties: + input_tokens: + type: number + output_tokens: + type: number + cache_creation_input_tokens: + type: number + nullable: true + cache_read_input_tokens: + type: number + nullable: true + cache_creation: + type: object + nullable: true + properties: + ephemeral_5m_input_tokens: + type: number + ephemeral_1h_input_tokens: + type: number + required: + - ephemeral_5m_input_tokens + - ephemeral_1h_input_tokens + inference_geo: + type: string + nullable: true + server_tool_use: + type: object + nullable: true + properties: + web_search_requests: + type: number + web_fetch_requests: + type: number + required: + - web_search_requests + - web_fetch_requests + service_tier: + type: string + nullable: true + enum: + - standard + - priority + - batch + required: + - input_tokens + - output_tokens + - cache_creation_input_tokens + - cache_read_input_tokens + - cache_creation + - inference_geo + - server_tool_use + - service_tier + required: + - id + - type + - role + - container + - content + - model + - stop_reason + - stop_sequence + - usage + AnthropicMessagesResponse: + allOf: + - $ref: '#/components/schemas/BaseAnthropicMessagesResponse' + - type: object + properties: + provider: + type: string + 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 + - Amazon Bedrock + - Amazon Nova + - Anthropic + - Arcee AI + - AtlasCloud + - Avian + - Azure + - BaseTen + - BytePlus + - Black Forest Labs + - Cerebras + - Chutes + - Cirrascale + - Clarifai + - Cloudflare + - Cohere + - Crusoe + - DeepInfra + - DeepSeek + - 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 + - Relace + - SambaNova + - Seed + - SiliconFlow + - Sourceful + - StepFun + - Stealth + - StreamLake + - Switchpoint + - Together + - Upstage + - Venice + - WandB + - Xiaomi + - xAI + - Z.AI + - FakeProvider + description: Non-streaming response from the Anthropic Messages API with OpenRouter extensions + example: + id: msg_01XFDUDYJgAACzvnptvVoYEL + type: message + role: assistant + container: null + content: + - type: text + text: Hello! I'm doing well, thank you for asking. + citations: null + model: claude-sonnet-4-5-20250929 + stop_reason: end_turn + stop_sequence: null + usage: + input_tokens: 12 + output_tokens: 15 + cache_creation_input_tokens: null + cache_read_input_tokens: null + cache_creation: null + inference_geo: null + server_tool_use: null + service_tier: standard + AnthropicMessagesMessageStartEvent: + type: object + properties: + type: + type: string + enum: + - message_start + message: + type: object + properties: + id: + type: string + type: + type: string + enum: + - message + role: + type: string + enum: + - assistant + container: + type: object + nullable: true + properties: + id: + type: string + expires_at: + type: string + required: + - id + - expires_at + content: + type: array + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - text + text: + type: string + citations: + type: array + nullable: true + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - file_id + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - file_id + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - file_id + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + required: + - type + - text + - citations + - type: object + properties: + type: + type: string + enum: + - tool_use + id: + type: string + caller: + oneOf: + - type: object + properties: + type: + type: string + enum: + - direct + required: + - type + - type: object + properties: + type: + type: string + enum: + - code_execution_20250825 + tool_id: + type: string + required: + - type + - tool_id + - type: object + properties: + type: + type: string + enum: + - code_execution_20260120 + tool_id: + type: string + required: + - type + - tool_id + name: + type: string + input: + nullable: true + required: + - type + - id + - caller + - name + - type: object + properties: + type: + type: string + enum: + - thinking + thinking: + type: string + signature: + type: string + required: + - type + - thinking + - signature + - type: object + properties: + type: + type: string + enum: + - redacted_thinking + data: + type: string + required: + - type + - data + - type: object + properties: + type: + type: string + enum: + - server_tool_use + id: + type: string + caller: + oneOf: + - type: object + properties: + type: + type: string + enum: + - direct + required: + - type + - type: object + properties: + type: + type: string + enum: + - code_execution_20250825 + tool_id: + type: string + required: + - type + - tool_id + - type: object + properties: + type: + type: string + enum: + - code_execution_20260120 + tool_id: + type: string + required: + - type + - tool_id + name: + type: string + enum: + - web_search + - web_fetch + - code_execution + - bash_code_execution + - text_editor_code_execution + - tool_search_tool_regex + - tool_search_tool_bm25 + input: + nullable: true + required: + - type + - id + - caller + - name + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result + caller: + oneOf: + - type: object + properties: + type: + type: string + enum: + - direct + required: + - type + - type: object + properties: + type: + type: string + enum: + - code_execution_20250825 + tool_id: + type: string + required: + - type + - tool_id + - type: object + properties: + type: + type: string + enum: + - code_execution_20260120 + tool_id: + type: string + required: + - type + - tool_id + tool_use_id: + type: string + content: + anyOf: + - type: array + items: + type: object + properties: + type: + type: string + enum: + - web_search_result + encrypted_content: + type: string + page_age: + type: string + nullable: true + title: + type: string + url: + type: string + required: + - type + - encrypted_content + - page_age + - title + - url + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result_error + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - max_uses_exceeded + - too_many_requests + - query_too_long + - request_too_large + required: + - type + - error_code + required: + - type + - caller + - tool_use_id + - content + - type: object + properties: + type: + type: string + enum: + - web_fetch_tool_result + caller: + oneOf: + - type: object + properties: + type: + type: string + enum: + - direct + required: + - type + - type: object + properties: + type: + type: string + enum: + - code_execution_20250825 + tool_id: + type: string + required: + - type + - tool_id + - type: object + properties: + type: + type: string + enum: + - code_execution_20260120 + tool_id: + type: string + required: + - type + - tool_id + content: + oneOf: + - type: object + properties: + type: + type: string + enum: + - web_fetch_tool_result_error + error_code: + type: string + enum: + - invalid_tool_input + - url_too_long + - url_not_allowed + - url_not_accessible + - unsupported_content_type + - too_many_requests + - max_uses_exceeded + - unavailable + required: + - type + - error_code + - type: object + properties: + content: + type: object + properties: + citations: + type: object + nullable: true + properties: + enabled: + type: boolean + required: + - enabled + source: + anyOf: + - type: object + properties: + data: + type: string + media_type: + type: string + enum: + - application/pdf + type: + type: string + enum: + - base64 + required: + - data + - media_type + - type + - type: object + properties: + data: + type: string + media_type: + type: string + enum: + - text/plain + type: + type: string + enum: + - text + required: + - data + - media_type + - type + title: + type: string + nullable: true + type: + type: string + enum: + - document + required: + - citations + - source + - title + - type + retrieved_at: + type: string + nullable: true + type: + type: string + enum: + - web_fetch_result + url: + type: string + required: + - content + - retrieved_at + - type + - url + tool_use_id: + type: string + required: + - type + - caller + - content + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - code_execution_tool_result + content: + oneOf: + - type: object + properties: + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - too_many_requests + - execution_time_exceeded + type: + type: string + enum: + - code_execution_tool_result_error + required: + - error_code + - type + - type: object + properties: + content: + type: array + items: + type: object + properties: + file_id: + type: string + type: + type: string + enum: + - code_execution_output + required: + - file_id + - type + return_code: + type: number + stderr: + type: string + stdout: + type: string + type: + type: string + enum: + - code_execution_result + required: + - content + - return_code + - stderr + - stdout + - type + - type: object + properties: + content: + type: array + items: + type: object + properties: + file_id: + type: string + type: + type: string + enum: + - code_execution_output + required: + - file_id + - type + encrypted_stdout: + type: string + return_code: + type: number + stderr: + type: string + type: + type: string + enum: + - encrypted_code_execution_result + required: + - content + - encrypted_stdout + - return_code + - stderr + - type + tool_use_id: + type: string + required: + - type + - content + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - bash_code_execution_tool_result + content: + oneOf: + - type: object + properties: + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - too_many_requests + - execution_time_exceeded + - output_file_too_large + type: + type: string + enum: + - bash_code_execution_tool_result_error + required: + - error_code + - type + - type: object + properties: + content: + type: array items: type: object properties: + file_id: + type: string type: type: string enum: - - web_search_result - encrypted_content: - type: string - page_age: - type: string - nullable: true - title: + - bash_code_execution_output + required: + - file_id + - type + return_code: + type: number + stderr: + type: string + stdout: + type: string + type: + type: string + enum: + - bash_code_execution_result + required: + - content + - return_code + - stderr + - stdout + - type + tool_use_id: + type: string + required: + - type + - content + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - text_editor_code_execution_tool_result + content: + oneOf: + - type: object + properties: + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - too_many_requests + - execution_time_exceeded + - file_not_found + error_message: + type: string + nullable: true + type: + type: string + enum: + - text_editor_code_execution_tool_result_error + required: + - error_code + - error_message + - type + - type: object + properties: + content: + type: string + file_type: + type: string + enum: + - text + - image + - pdf + num_lines: + type: number + nullable: true + start_line: + type: number + nullable: true + total_lines: + type: number + nullable: true + type: + type: string + enum: + - text_editor_code_execution_view_result + required: + - content + - file_type + - num_lines + - start_line + - total_lines + - type + - type: object + properties: + is_file_update: + type: boolean + type: + type: string + enum: + - text_editor_code_execution_create_result + required: + - is_file_update + - type + - type: object + properties: + lines: + type: array + nullable: true + items: + type: string + new_lines: + type: number + nullable: true + new_start: + type: number + nullable: true + old_lines: + type: number + nullable: true + old_start: + type: number + nullable: true + type: + type: string + enum: + - text_editor_code_execution_str_replace_result + required: + - lines + - new_lines + - new_start + - old_lines + - old_start + - type + tool_use_id: + type: string + required: + - type + - content + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - tool_search_tool_result + content: + oneOf: + - type: object + properties: + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - too_many_requests + - execution_time_exceeded + error_message: + type: string + nullable: true + type: + type: string + enum: + - tool_search_tool_result_error + required: + - error_code + - error_message + - type + - type: object + properties: + tool_references: + type: array + items: + type: object + properties: + tool_name: type: string - url: + type: type: string + enum: + - tool_reference required: + - tool_name - type - - encrypted_content - - page_age - - title - - url - - type: object - properties: - type: - type: string - enum: - - web_search_tool_result_error - error_code: - type: string - enum: - - invalid_tool_input - - unavailable - - max_uses_exceeded - - too_many_requests - - query_too_long - required: - - type - - error_code - required: - - type - - tool_use_id - - content - model: - type: string - stop_reason: + type: + type: string + enum: + - tool_search_tool_search_result + required: + - tool_references + - type + tool_use_id: + type: string + required: + - type + - content + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - container_upload + file_id: + type: string + required: + - type + - file_id + model: + type: string + stop_reason: + nullable: true + stop_sequence: + nullable: true + usage: + type: object + properties: + input_tokens: + type: number + output_tokens: + type: number + cache_creation_input_tokens: + type: number nullable: true - stop_sequence: + cache_read_input_tokens: + type: number nullable: true - usage: + cache_creation: type: object + nullable: true properties: - input_tokens: + ephemeral_5m_input_tokens: type: number - output_tokens: + ephemeral_1h_input_tokens: type: number - cache_creation_input_tokens: + required: + - ephemeral_5m_input_tokens + - ephemeral_1h_input_tokens + inference_geo: + type: string + nullable: true + server_tool_use: + type: object + nullable: true + properties: + web_search_requests: type: number - nullable: true - cache_read_input_tokens: + web_fetch_requests: type: number - nullable: true - cache_creation: - type: object - nullable: true - properties: - ephemeral_5m_input_tokens: - type: number - ephemeral_1h_input_tokens: - type: number - required: - - ephemeral_5m_input_tokens - - ephemeral_1h_input_tokens - inference_geo: - type: string - nullable: true - server_tool_use: - type: object - nullable: true - properties: - web_search_requests: - type: number - required: - - web_search_requests - service_tier: - type: string - nullable: true - enum: - - standard - - priority - - batch required: - - input_tokens - - output_tokens - - cache_creation_input_tokens - - cache_read_input_tokens - - cache_creation - - inference_geo - - server_tool_use - - service_tier + - web_search_requests + - web_fetch_requests + service_tier: + type: string + nullable: true + enum: + - standard + - priority + - batch required: - - id - - type - - role - - content - - model - - stop_reason - - stop_sequence - - usage + - input_tokens + - output_tokens + - cache_creation_input_tokens + - cache_read_input_tokens + - cache_creation + - inference_geo + - server_tool_use + - service_tier + provider: + type: string + 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 + - Amazon Bedrock + - Amazon Nova + - Anthropic + - Arcee AI + - AtlasCloud + - Avian + - Azure + - BaseTen + - BytePlus + - Black Forest Labs + - Cerebras + - Chutes + - Cirrascale + - Clarifai + - Cloudflare + - Cohere + - Crusoe + - DeepInfra + - DeepSeek + - 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 + - Relace + - SambaNova + - Seed + - SiliconFlow + - Sourceful + - StepFun + - Stealth + - StreamLake + - Switchpoint + - Together + - Upstage + - Venice + - WandB + - Xiaomi + - xAI + - Z.AI + - FakeProvider required: + - id - type - - message + - role + - container + - content + - model + - stop_reason + - stop_sequence + - usage + required: + - type + - message + description: Event sent at the start of a streaming message + AnthropicMessagesStreamEvent: + oneOf: + - $ref: '#/components/schemas/AnthropicMessagesMessageStartEvent' - type: object properties: type: @@ -4901,6 +7233,17 @@ components: delta: type: object properties: + container: + type: object + nullable: true + properties: + id: + type: string + expires_at: + type: string + required: + - id + - expires_at stop_reason: type: string nullable: true @@ -4915,6 +7258,7 @@ components: type: string nullable: true required: + - container - stop_reason - stop_sequence usage: @@ -4937,8 +7281,11 @@ components: properties: web_search_requests: type: number + web_fetch_requests: + type: number required: - web_search_requests + - web_fetch_requests required: - input_tokens - output_tokens @@ -5124,111 +7471,688 @@ components: - tool_use id: type: string + caller: + oneOf: + - type: object + properties: + type: + type: string + enum: + - direct + required: + - type + - type: object + properties: + type: + type: string + enum: + - code_execution_20250825 + tool_id: + type: string + required: + - type + - tool_id + - type: object + properties: + type: + type: string + enum: + - code_execution_20260120 + tool_id: + type: string + required: + - type + - tool_id + name: + type: string + input: + nullable: true + required: + - type + - id + - caller + - name + - type: object + properties: + type: + type: string + enum: + - thinking + thinking: + type: string + signature: + type: string + required: + - type + - thinking + - signature + - type: object + properties: + type: + type: string + enum: + - redacted_thinking + data: + type: string + required: + - type + - data + - type: object + properties: + type: + type: string + enum: + - server_tool_use + id: + type: string + caller: + oneOf: + - type: object + properties: + type: + type: string + enum: + - direct + required: + - type + - type: object + properties: + type: + type: string + enum: + - code_execution_20250825 + tool_id: + type: string + required: + - type + - tool_id + - type: object + properties: + type: + type: string + enum: + - code_execution_20260120 + tool_id: + type: string + required: + - type + - tool_id name: type: string - input: - nullable: true + enum: + - web_search + - web_fetch + - code_execution + - bash_code_execution + - text_editor_code_execution + - tool_search_tool_regex + - tool_search_tool_bm25 + input: + nullable: true + required: + - type + - id + - caller + - name + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result + caller: + oneOf: + - type: object + properties: + type: + type: string + enum: + - direct + required: + - type + - type: object + properties: + type: + type: string + enum: + - code_execution_20250825 + tool_id: + type: string + required: + - type + - tool_id + - type: object + properties: + type: + type: string + enum: + - code_execution_20260120 + tool_id: + type: string + required: + - type + - tool_id + tool_use_id: + type: string + content: + anyOf: + - type: array + items: + type: object + properties: + type: + type: string + enum: + - web_search_result + encrypted_content: + type: string + page_age: + type: string + nullable: true + title: + type: string + url: + type: string + required: + - type + - encrypted_content + - page_age + - title + - url + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result_error + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - max_uses_exceeded + - too_many_requests + - query_too_long + - request_too_large + required: + - type + - error_code + required: + - type + - caller + - tool_use_id + - content + - type: object + properties: + type: + type: string + enum: + - web_fetch_tool_result + caller: + oneOf: + - type: object + properties: + type: + type: string + enum: + - direct + required: + - type + - type: object + properties: + type: + type: string + enum: + - code_execution_20250825 + tool_id: + type: string + required: + - type + - tool_id + - type: object + properties: + type: + type: string + enum: + - code_execution_20260120 + tool_id: + type: string + required: + - type + - tool_id + content: + oneOf: + - type: object + properties: + type: + type: string + enum: + - web_fetch_tool_result_error + error_code: + type: string + enum: + - invalid_tool_input + - url_too_long + - url_not_allowed + - url_not_accessible + - unsupported_content_type + - too_many_requests + - max_uses_exceeded + - unavailable + required: + - type + - error_code + - type: object + properties: + content: + type: object + properties: + citations: + type: object + nullable: true + properties: + enabled: + type: boolean + required: + - enabled + source: + anyOf: + - type: object + properties: + data: + type: string + media_type: + type: string + enum: + - application/pdf + type: + type: string + enum: + - base64 + required: + - data + - media_type + - type + - type: object + properties: + data: + type: string + media_type: + type: string + enum: + - text/plain + type: + type: string + enum: + - text + required: + - data + - media_type + - type + title: + type: string + nullable: true + type: + type: string + enum: + - document + required: + - citations + - source + - title + - type + retrieved_at: + type: string + nullable: true + type: + type: string + enum: + - web_fetch_result + url: + type: string + required: + - content + - retrieved_at + - type + - url + tool_use_id: + type: string required: - type - - id - - name + - caller + - content + - tool_use_id - type: object properties: type: type: string enum: - - thinking - thinking: - type: string - signature: + - code_execution_tool_result + content: + oneOf: + - type: object + properties: + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - too_many_requests + - execution_time_exceeded + type: + type: string + enum: + - code_execution_tool_result_error + required: + - error_code + - type + - type: object + properties: + content: + type: array + items: + type: object + properties: + file_id: + type: string + type: + type: string + enum: + - code_execution_output + required: + - file_id + - type + return_code: + type: number + stderr: + type: string + stdout: + type: string + type: + type: string + enum: + - code_execution_result + required: + - content + - return_code + - stderr + - stdout + - type + - type: object + properties: + content: + type: array + items: + type: object + properties: + file_id: + type: string + type: + type: string + enum: + - code_execution_output + required: + - file_id + - type + encrypted_stdout: + type: string + return_code: + type: number + stderr: + type: string + type: + type: string + enum: + - encrypted_code_execution_result + required: + - content + - encrypted_stdout + - return_code + - stderr + - type + tool_use_id: type: string required: - type - - thinking - - signature + - content + - tool_use_id - type: object properties: type: type: string enum: - - redacted_thinking - data: + - bash_code_execution_tool_result + content: + oneOf: + - type: object + properties: + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - too_many_requests + - execution_time_exceeded + - output_file_too_large + type: + type: string + enum: + - bash_code_execution_tool_result_error + required: + - error_code + - type + - type: object + properties: + content: + type: array + items: + type: object + properties: + file_id: + type: string + type: + type: string + enum: + - bash_code_execution_output + required: + - file_id + - type + return_code: + type: number + stderr: + type: string + stdout: + type: string + type: + type: string + enum: + - bash_code_execution_result + required: + - content + - return_code + - stderr + - stdout + - type + tool_use_id: type: string required: - type - - data + - content + - tool_use_id - type: object properties: type: type: string enum: - - server_tool_use - id: - type: string - name: + - text_editor_code_execution_tool_result + content: + oneOf: + - type: object + properties: + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - too_many_requests + - execution_time_exceeded + - file_not_found + error_message: + type: string + nullable: true + type: + type: string + enum: + - text_editor_code_execution_tool_result_error + required: + - error_code + - error_message + - type + - type: object + properties: + content: + type: string + file_type: + type: string + enum: + - text + - image + - pdf + num_lines: + type: number + nullable: true + start_line: + type: number + nullable: true + total_lines: + type: number + nullable: true + type: + type: string + enum: + - text_editor_code_execution_view_result + required: + - content + - file_type + - num_lines + - start_line + - total_lines + - type + - type: object + properties: + is_file_update: + type: boolean + type: + type: string + enum: + - text_editor_code_execution_create_result + required: + - is_file_update + - type + - type: object + properties: + lines: + type: array + nullable: true + items: + type: string + new_lines: + type: number + nullable: true + new_start: + type: number + nullable: true + old_lines: + type: number + nullable: true + old_start: + type: number + nullable: true + type: + type: string + enum: + - text_editor_code_execution_str_replace_result + required: + - lines + - new_lines + - new_start + - old_lines + - old_start + - type + tool_use_id: type: string - enum: - - web_search - input: - nullable: true required: - type - - id - - name + - content + - tool_use_id - type: object properties: type: type: string enum: - - web_search_tool_result - tool_use_id: - type: string + - tool_search_tool_result content: - anyOf: - - type: array - items: - type: object - properties: - type: - type: string - enum: - - web_search_result - encrypted_content: - type: string - page_age: - type: string - nullable: true - title: - type: string - url: - type: string - required: - - type - - encrypted_content - - page_age - - title - - url + oneOf: + - type: object + properties: + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - too_many_requests + - execution_time_exceeded + error_message: + type: string + nullable: true + type: + type: string + enum: + - tool_search_tool_result_error + required: + - error_code + - error_message + - type - type: object properties: + tool_references: + type: array + items: + type: object + properties: + tool_name: + type: string + type: + type: string + enum: + - tool_reference + required: + - tool_name + - type type: type: string enum: - - web_search_tool_result_error - error_code: - type: string - enum: - - invalid_tool_input - - unavailable - - max_uses_exceeded - - too_many_requests - - query_too_long + - tool_search_tool_search_result required: + - tool_references - type - - error_code + tool_use_id: + type: string required: - type - - tool_use_id - content + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - container_upload + file_id: + type: string + required: + - type + - file_id required: - type - index @@ -6241,6 +9165,504 @@ components: required: - type - source + - type: object + properties: + type: + type: string + enum: + - tool_reference + tool_name: + type: string + required: + - type + - tool_name + - type: object + properties: + type: + type: string + enum: + - search_result + source: + type: string + title: + type: string + content: + type: array + items: + type: object + properties: + type: + type: string + enum: + - text + text: + type: string + citations: + type: array + nullable: true + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + required: + - type + - text + citations: + type: object + properties: + enabled: + type: boolean + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + required: + - type + - source + - title + - content + - type: object + properties: + type: + type: string + enum: + - document + source: + oneOf: + - type: object + properties: + type: + type: string + enum: + - base64 + media_type: + type: string + enum: + - application/pdf + data: + type: string + required: + - type + - media_type + - data + - type: object + properties: + type: + type: string + enum: + - text + media_type: + type: string + enum: + - text/plain + data: + type: string + required: + - type + - media_type + - data + - type: object + properties: + type: + type: string + enum: + - content + content: + anyOf: + - type: string + - type: array + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - text + text: + type: string + citations: + type: array + nullable: true + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + required: + - type + - text + - type: object + properties: + type: + type: string + enum: + - image + source: + oneOf: + - type: object + properties: + type: + type: string + enum: + - base64 + media_type: + type: string + enum: + - image/jpeg + - image/png + - image/gif + - image/webp + data: + type: string + required: + - type + - media_type + - data + - type: object + properties: + type: + type: string + enum: + - url + url: + type: string + required: + - type + - url + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + required: + - type + - source + required: + - type + - content + - type: object + properties: + type: + type: string + enum: + - url + url: + type: string + required: + - type + - url + citations: + type: object + nullable: true + properties: + enabled: + type: boolean + context: + type: string + nullable: true + title: + type: string + nullable: true + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + required: + - type + - source is_error: type: boolean cache_control: @@ -6297,6 +9719,12 @@ components: type: string enum: - web_search + - web_fetch + - code_execution + - bash_code_execution + - text_editor_code_execution + - tool_search_tool_regex + - tool_search_tool_bm25 input: nullable: true cache_control: @@ -6575,6 +10003,89 @@ components: - role - content description: Anthropic message with OpenRouter extensions + AnthropicWebSearchServerTool: + type: object + properties: + type: + type: string + enum: + - openrouter:web_search + parameters: + type: object + properties: + engine: + type: string + enum: + - auto + - native + - exa + 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 (parameters like max_results, search_context_size, and + domain filters are not forwarded to the provider). "exa" forces the Exa search API. + example: auto + max_results: + type: number + minimum: 1 + maximum: 25 + description: >- + Maximum number of search results to return per search call. Defaults to 5. Only applies when using the + Exa engine; ignored with native provider search. + example: 5 + max_total_results: + type: number + minimum: 1 + 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 + search_context_size: + type: string + enum: + - low + - medium + - high + 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. + user_location: + type: object + properties: + type: + type: string + enum: + - approximate + city: + type: string + region: + type: string + country: + type: string + timezone: + type: string + description: Approximate user location for location-biased results. + allowed_domains: + type: array + items: + type: string + description: >- + Limit search results to these domains. Only applies when using the Exa engine; ignored with native + provider search. + excluded_domains: + type: array + items: + type: string + description: >- + Exclude search results from these domains. Only applies when using the Exa engine; ignored with native + provider search. + required: + - type + description: 'OpenRouter built-in server tool: searches the web for current information' + example: + type: openrouter:web_search + parameters: + max_results: 5 AnthropicOutputConfig: type: object properties: @@ -6587,10 +10098,28 @@ components: - high - max 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`, or `max`. - example: medium - description: Configuration for controlling output behavior. Currently supports the effort parameter for Claude Opus 4.5. + 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`, or `max`. + example: medium + format: + type: object + nullable: true + properties: + type: + type: string + enum: + - json_schema + schema: + type: object + additionalProperties: + nullable: true + required: + - type + - schema + 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). + description: Configuration for controlling output behavior. Supports the effort parameter and structured output format. AnthropicMessagesRequest: type: object properties: @@ -6600,6 +10129,7 @@ components: type: number messages: type: array + nullable: true items: $ref: '#/components/schemas/OpenRouterAnthropicMessageParam' system: @@ -6767,8 +10297,6 @@ components: type: array items: type: string - stream: - type: boolean temperature: type: number top_p: @@ -6778,7 +10306,7 @@ components: tools: type: array items: - oneOf: + anyOf: - type: object properties: name: @@ -6790,8 +10318,7 @@ components: properties: type: type: string - enum: - - object + default: object properties: nullable: true required: @@ -6799,8 +10326,6 @@ components: nullable: true items: type: string - required: - - type additionalProperties: nullable: true type: @@ -6940,6 +10465,8 @@ components: required: - type - name + - $ref: '#/components/schemas/DatetimeServerTool' + - $ref: '#/components/schemas/AnthropicWebSearchServerTool' tool_choice: oneOf: - type: object @@ -7017,6 +10544,159 @@ components: enum: - auto - standard_only + output_config: + $ref: '#/components/schemas/AnthropicOutputConfig' + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + stream: + type: boolean + context_management: + type: object + nullable: true + properties: + edits: + type: array + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - clear_tool_uses_20250919 + clear_at_least: + type: object + nullable: true + properties: + type: + type: string + enum: + - input_tokens + value: + type: number + required: + - type + - value + clear_tool_inputs: + anyOf: + - type: boolean + - type: array + items: + type: string + - nullable: true + exclude_tools: + type: array + nullable: true + items: + type: string + keep: + type: object + properties: + type: + type: string + enum: + - tool_uses + value: + type: number + required: + - type + - value + trigger: + oneOf: + - type: object + properties: + type: + type: string + enum: + - input_tokens + value: + type: number + required: + - type + - value + - type: object + properties: + type: + type: string + enum: + - tool_uses + value: + type: number + required: + - type + - value + required: + - type + - type: object + properties: + type: + type: string + enum: + - clear_thinking_20251015 + keep: + anyOf: + - type: object + properties: + type: + type: string + enum: + - thinking_turns + value: + type: number + required: + - type + - value + - type: object + properties: + type: + type: string + enum: + - all + required: + - type + - type: string + enum: + - all + required: + - type + - type: object + properties: + type: + type: string + enum: + - compact_20260112 + instructions: + type: string + nullable: true + pause_after_compaction: + type: boolean + trigger: + type: object + nullable: true + properties: + type: + type: string + enum: + - input_tokens + value: + type: number + required: + - type + - value + required: + - type provider: type: object nullable: true @@ -7181,6 +10861,28 @@ components: type: string engine: $ref: '#/components/schemas/WebSearchEngine' + include_domains: + type: array + items: + type: string + description: >- + 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: + - example.com + - '*.substack.com' + - openai.com/blog + exclude_domains: + type: array + items: + type: string + description: >- + 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: + - example.com + - '*.substack.com' + - openai.com/blog required: - id - type: object @@ -7207,6 +10909,19 @@ components: description: Set to false to disable the response-healing plugin for this request. Defaults to true. required: - id + - type: object + properties: + id: + type: string + enum: + - context-compression + enabled: + type: boolean + description: Set to false to disable the context-compression plugin for this request. Defaults to true. + engine: + $ref: '#/components/schemas/ContextCompressionEngine' + required: + - id description: Plugins you want to enable for this request, including their settings. route: type: string @@ -7258,11 +10973,8 @@ components: type: array items: type: string - output_config: - $ref: '#/components/schemas/AnthropicOutputConfig' required: - model - - max_tokens - messages description: Request schema for Anthropic Messages API endpoint example: @@ -7527,6 +11239,34 @@ components: type: video_url video_url: url: https://example.com/video.mp4 + ChatMessageContentItemFile: + type: object + properties: + type: + type: string + enum: + - file + file: + type: object + properties: + file_data: + type: string + description: File content as base64 data URL or URL + file_id: + type: string + description: File ID for previously uploaded files + filename: + type: string + description: Original filename + required: + - type + - file + description: File content part for document processing + example: + type: file + file: + file_data: https://example.com/document.pdf + filename: document.pdf ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/ChatMessageContentItemText' @@ -7540,6 +11280,7 @@ components: mapping: input_video: '#/components/schemas/ChatMessageContentItemVideoLegacy' video_url: '#/components/schemas/ChatMessageContentItemVideo' + - $ref: '#/components/schemas/ChatMessageContentItemFile' discriminator: propertyName: type description: Content part for chat completion messages @@ -7715,6 +11456,27 @@ components: example: - image_url: url: data:image/png;base64,iVBORw0KGgo... + ChatCompletionAudioOutput: + type: object + properties: + id: + type: string + description: Audio output identifier + expires_at: + type: number + description: Audio expiration timestamp + data: + type: string + description: Base64 encoded audio data + transcript: + type: string + description: Audio transcript + description: Audio output data or reference + example: + id: audio_abc123 + expires_at: 1677652400 + data: UklGRnoGAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQoGAACBhYqFbF1f + transcript: Hello! How can I help you today? AssistantMessage: type: object properties: @@ -7750,6 +11512,8 @@ components: $ref: '#/components/schemas/AssistantMessageReasoningDetails' images: $ref: '#/components/schemas/AssistantMessageImages' + audio: + $ref: '#/components/schemas/ChatCompletionAudioOutput' required: - role description: Assistant message for requests and responses @@ -7822,7 +11586,6 @@ components: description: Log probabilities for refusal tokens required: - content - - refusal description: Log probabilities for the completion example: content: @@ -7959,6 +11722,7 @@ components: - created - model - object + - system_fingerprint description: Chat completion response example: id: chatcmpl-123 @@ -8045,6 +11809,10 @@ components: description: Tool calls delta reasoning_details: $ref: '#/components/schemas/AssistantMessageReasoningDetails' + audio: + allOf: + - $ref: '#/components/schemas/ChatCompletionAudioOutput' + - description: Audio output data description: Delta changes in streaming response example: role: assistant @@ -8102,7 +11870,6 @@ components: - chat.completion.chunk system_fingerprint: type: string - nullable: true description: System fingerprint example: fp_44709d6fcb error: @@ -8445,67 +12212,324 @@ components: - auto - type: string enum: - - required - - $ref: '#/components/schemas/NamedToolChoice' - description: Tool choice configuration - example: auto - ToolDefinitionJson: - type: object - properties: - type: + - required + - $ref: '#/components/schemas/NamedToolChoice' + description: Tool choice configuration + example: auto + DatetimeServerTool: + type: object + properties: + type: + type: string + enum: + - openrouter:datetime + parameters: + type: object + properties: + timezone: + type: string + description: IANA timezone name (e.g. "America/New_York"). Defaults to UTC. + example: America/New_York + required: + - type + description: 'OpenRouter built-in server tool: returns the current date and time' + example: + type: openrouter:datetime + parameters: + timezone: America/New_York + WebSearchServerTool: + type: object + properties: + type: + type: string + enum: + - openrouter:web_search + parameters: + type: object + properties: + engine: + type: string + enum: + - auto + - native + - exa + 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 (parameters like max_results, search_context_size, and + domain filters are not forwarded to the provider). "exa" forces the Exa search API. + example: auto + max_results: + type: number + minimum: 1 + maximum: 25 + description: >- + Maximum number of search results to return per search call. Defaults to 5. Only applies when using the + Exa engine; ignored with native provider search. + example: 5 + max_total_results: + type: number + minimum: 1 + 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 + search_context_size: + type: string + enum: + - low + - medium + - high + 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. + user_location: + type: object + properties: + type: + type: string + enum: + - approximate + city: + type: string + region: + type: string + country: + type: string + timezone: + type: string + description: Approximate user location for location-biased results. + allowed_domains: + type: array + items: + type: string + description: >- + Limit search results to these domains. Only applies when using the Exa engine; ignored with native + provider search. + excluded_domains: + type: array + items: + type: string + description: >- + Exclude search results from these domains. Only applies when using the Exa engine; ignored with native + provider search. + required: + - type + description: 'OpenRouter built-in server tool: searches the web for current information' + example: + type: openrouter:web_search + parameters: + engine: auto + max_results: 5 + WebSearchShorthand: + type: object + properties: + type: + type: string + enum: + - web_search + - web_search_preview + - web_search_preview_2025_03_11 + - web_search_2025_08_26 + engine: + type: string + enum: + - auto + - native + - exa + 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 (parameters like max_results, search_context_size, and domain + filters are not forwarded to the provider). "exa" forces the Exa search API. + example: auto + max_results: + type: number + minimum: 1 + maximum: 25 + description: >- + Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa + engine; ignored with native provider search. + example: 5 + max_total_results: + type: number + minimum: 1 + 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 + search_context_size: type: string enum: - - function - function: + - low + - medium + - high + 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. + user_location: type: object properties: - name: + type: type: string - maxLength: 64 - description: Function name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars) - example: get_weather - description: + enum: + - approximate + city: type: string - description: Function description for the model - example: Get the current weather for a location - parameters: - type: object - additionalProperties: - nullable: true - description: Function parameters as JSON Schema object - example: - type: object - properties: - location: - type: string - description: City name - required: - - location - strict: - type: boolean - nullable: true - description: Enable strict schema adherence - example: false - required: - - name - description: Function definition for tool calling - example: - name: get_weather - description: Get the current weather for a location - parameters: + region: + type: string + country: + type: string + timezone: + type: string + description: Approximate user location for location-biased results. + allowed_domains: + type: array + items: + type: string + description: >- + Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider + search. + excluded_domains: + type: array + items: + type: string + description: >- + Exclude search results from these domains. Only applies when using the Exa engine; ignored with native + provider search. + parameters: + type: object + properties: + engine: + type: string + enum: + - auto + - native + - exa + 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 (parameters like max_results, search_context_size, and + domain filters are not forwarded to the provider). "exa" forces the Exa search API. + example: auto + max_results: + type: number + minimum: 1 + maximum: 25 + description: >- + Maximum number of search results to return per search call. Defaults to 5. Only applies when using the + Exa engine; ignored with native provider search. + example: 5 + max_total_results: + type: number + minimum: 1 + 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 + search_context_size: + type: string + enum: + - low + - medium + - high + 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. + user_location: type: object properties: - location: + type: type: string - description: City name - required: - - location - cache_control: - $ref: '#/components/schemas/ChatMessageContentItemCacheControl' + enum: + - approximate + city: + type: string + region: + type: string + country: + type: string + timezone: + type: string + description: Approximate user location for location-biased results. + allowed_domains: + type: array + items: + type: string + description: >- + Limit search results to these domains. Only applies when using the Exa engine; ignored with native + provider search. + excluded_domains: + type: array + items: + type: string + description: >- + Exclude search results from these domains. Only applies when using the Exa engine; ignored with native + provider search. required: - type - - function - description: Tool definition for function calling + description: Web search tool using OpenAI Responses API syntax. Automatically converted to openrouter:web_search. + ToolDefinitionJson: + anyOf: + - type: object + properties: + type: + type: string + enum: + - function + function: + type: object + properties: + name: + type: string + maxLength: 64 + description: Function name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars) + example: get_weather + description: + type: string + description: Function description for the model + example: Get the current weather for a location + parameters: + type: object + additionalProperties: + nullable: true + description: Function parameters as JSON Schema object + example: + type: object + properties: + location: + type: string + description: City name + required: + - location + strict: + type: boolean + nullable: true + description: Enable strict schema adherence + example: false + required: + - name + description: Function definition for tool calling + example: + name: get_weather + description: Get the current weather for a location + parameters: + type: object + properties: + location: + type: string + description: City name + required: + - location + cache_control: + $ref: '#/components/schemas/ChatMessageContentItemCacheControl' + required: + - type + - function + - $ref: '#/components/schemas/DatetimeServerTool' + - $ref: '#/components/schemas/WebSearchServerTool' + - $ref: '#/components/schemas/WebSearchShorthand' + description: Tool definition for function calling (regular function or OpenRouter built-in server tool) example: type: function function: @@ -8703,6 +12727,28 @@ components: type: string engine: $ref: '#/components/schemas/WebSearchEngine' + include_domains: + type: array + items: + type: string + description: >- + 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: + - example.com + - '*.substack.com' + - openai.com/blog + exclude_domains: + type: array + items: + type: string + description: >- + 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: + - example.com + - '*.substack.com' + - openai.com/blog required: - id - type: object @@ -8729,6 +12775,19 @@ components: description: Set to false to disable the response-healing plugin for this request. Defaults to true. required: - id + - type: object + properties: + id: + type: string + enum: + - context-compression + enabled: + type: boolean + description: Set to false to disable the context-compression plugin for this request. Defaults to true. + engine: + $ref: '#/components/schemas/ContextCompressionEngine' + required: + - id description: Plugins you want to enable for this request, including their settings. route: type: string @@ -8823,7 +12882,7 @@ components: type: number nullable: true minimum: 1 - description: Maximum tokens (deprecated, use max_completion_tokens) + description: 'Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16.' example: 100 metadata: type: object @@ -8954,10 +13013,28 @@ components: enum: - text - image - description: Output modalities for the response. Supported values are "text" and "image". + - audio + description: Output modalities for the response. Supported values are "text", "image", and "audio". example: - text - image + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + 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. required: - messages description: Chat completion request parameters @@ -9209,6 +13286,7 @@ components: - image - embeddings - audio + - video example: text ModelArchitecture: type: object @@ -9356,17 +13434,34 @@ components: nullable: true minimum: 0 maximum: 1 + top_k: + type: integer + nullable: true + minimum: 0 frequency_penalty: type: number nullable: true minimum: -2 maximum: 2 + presence_penalty: + type: number + nullable: true + minimum: -2 + maximum: 2 + repetition_penalty: + type: number + nullable: true + minimum: 0 + maximum: 2 additionalProperties: false description: Default parameters for this model example: temperature: 0.7 top_p: 0.9 + top_k: 0 frequency_penalty: 0 + presence_penalty: 0 + repetition_penalty: 1 Model: type: object properties: @@ -9866,6 +13961,40 @@ components: p75: 38.5 p90: 28.3 p99: 15.1 + ConflictResponseErrorData: + type: object + properties: + code: + type: integer + message: + type: string + metadata: + type: object + nullable: true + additionalProperties: + nullable: true + required: + - code + - message + description: Error data for ConflictResponse + example: + code: 409 + message: Resource conflict. Please try again later. + ConflictResponse: + type: object + properties: + error: + $ref: '#/components/schemas/ConflictResponseErrorData' + user_id: + type: string + nullable: true + required: + - error + description: Conflict - Resource conflict or concurrent modification + example: + error: + code: 409 + message: Resource conflict. Please try again later. parameters: {} securitySchemes: apiKey: @@ -11035,6 +15164,7 @@ paths: - Together 2 - Ubicloud - 01.AI + - AkashML - AI21 - AionLabs - Alibaba @@ -11119,6 +15249,14 @@ paths: required: - status description: List of provider responses for this generation, including fallback attempts + user_agent: + type: string + nullable: true + description: User-Agent header from the request + http_referer: + type: string + nullable: true + description: Referer header from the request required: - id - upstream_id @@ -11154,6 +15292,8 @@ paths: - api_type - router - provider_responses + - user_agent + - http_referer description: Generation data required: - data @@ -11213,6 +15353,19 @@ paths: - Models x-speakeasy-name-override: count summary: Get total count of available models + parameters: + - schema: + 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". + example: text + required: false + 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". + name: output_modalities + in: query responses: '200': description: Returns the total count of available models @@ -11220,6 +15373,12 @@ paths: application/json: schema: $ref: '#/components/schemas/ModelsCountResponse' + '400': + description: Bad Request - Invalid output_modalities value + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' '500': description: Internal Server Error content: @@ -11260,6 +15419,18 @@ paths: required: false name: supported_parameters in: query + - schema: + 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". + example: text + required: false + 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". + name: output_modalities + in: query - schema: type: string required: false @@ -12486,6 +16657,14 @@ paths: - openai - anthropic - google + ignored_providers: + type: array + nullable: true + items: + type: string + description: List of provider IDs to exclude from routing + example: + - azure allowed_models: type: array nullable: true @@ -12524,6 +16703,7 @@ paths: - openai - anthropic - google + ignored_providers: null allowed_models: null enforce_zdr: false created_at: '2025-08-24T10:30:00Z' @@ -12547,6 +16727,7 @@ paths: - openai - anthropic - google + ignored_providers: null allowed_models: null enforce_zdr: false created_at: '2025-08-24T10:30:00Z' @@ -12618,6 +16799,15 @@ paths: - openai - anthropic - deepseek + ignored_providers: + type: array + nullable: true + items: + type: string + minItems: 1 + description: List of provider IDs to exclude from routing + example: + - azure allowed_models: type: array nullable: true @@ -12645,6 +16835,7 @@ paths: - openai - anthropic - deepseek + ignored_providers: null allowed_models: null enforce_zdr: false required: true @@ -12699,6 +16890,14 @@ paths: - openai - anthropic - google + ignored_providers: + type: array + nullable: true + items: + type: string + description: List of provider IDs to exclude from routing + example: + - azure allowed_models: type: array nullable: true @@ -12737,6 +16936,7 @@ paths: - openai - anthropic - google + ignored_providers: null allowed_models: null enforce_zdr: false created_at: '2025-08-24T10:30:00Z' @@ -12755,6 +16955,7 @@ paths: - openai - anthropic - google + ignored_providers: null allowed_models: null enforce_zdr: false created_at: '2025-08-24T10:30:00Z' @@ -12846,6 +17047,14 @@ paths: - openai - anthropic - google + ignored_providers: + type: array + nullable: true + items: + type: string + description: List of provider IDs to exclude from routing + example: + - azure allowed_models: type: array nullable: true @@ -12884,6 +17093,7 @@ paths: - openai - anthropic - google + ignored_providers: null allowed_models: null enforce_zdr: false created_at: '2025-08-24T10:30:00Z' @@ -12902,6 +17112,7 @@ paths: - openai - anthropic - google + ignored_providers: null allowed_models: null enforce_zdr: false created_at: '2025-08-24T10:30:00Z' @@ -12986,6 +17197,15 @@ paths: - openai - anthropic - deepseek + ignored_providers: + type: array + nullable: true + items: + type: string + minItems: 1 + description: List of provider IDs to exclude from routing + example: + - azure allowed_models: type: array nullable: true @@ -13057,6 +17277,14 @@ paths: - openai - anthropic - google + ignored_providers: + type: array + nullable: true + items: + type: string + description: List of provider IDs to exclude from routing + example: + - azure allowed_models: type: array nullable: true @@ -13095,6 +17323,7 @@ paths: - openai - anthropic - google + ignored_providers: null allowed_models: null enforce_zdr: false created_at: '2025-08-24T10:30:00Z' @@ -13111,6 +17340,7 @@ paths: reset_interval: weekly allowed_providers: - openai + ignored_providers: null allowed_models: null enforce_zdr: true created_at: '2025-08-24T10:30:00Z' @@ -14301,6 +18531,12 @@ paths: application/json: schema: $ref: '#/components/schemas/UnauthorizedResponse' + '409': + description: Conflict - App upsert conflict during auth code creation + content: + application/json: + schema: + $ref: '#/components/schemas/ConflictResponse' '500': description: Internal Server Error - Unexpected server error content: diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 23a2512..fbb7b5f 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -210,6 +210,17 @@ components: anyOf: - $ref: '#/components/schemas/ResponseOutputText' - $ref: '#/components/schemas/OpenAIResponsesRefusalContent' + phase: + anyOf: + - type: string + enum: + - commentary + - type: string + enum: + - final_answer + - 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. required: - id - role @@ -416,15 +427,75 @@ components: - web_search_call id: type: string + action: + oneOf: + - type: object + properties: + type: + type: string + enum: + - search + query: + type: string + queries: + type: array + items: + type: string + sources: + type: array + items: + type: object + properties: + type: + type: string + enum: + - url + url: + type: string + required: + - type + - url + required: + - type + - query + - type: object + properties: + type: + type: string + enum: + - open_page + url: + type: string + nullable: true + required: + - type + - type: object + properties: + type: + type: string + enum: + - find_in_page + pattern: + type: string + url: + type: string + required: + - type + - pattern + - url status: $ref: '#/components/schemas/WebSearchStatus' required: - type - id + - action - status example: type: web_search_call id: search-abc123 + action: + type: search + query: OpenAI API status: completed ResponsesWebSearchCallOutput: allOf: @@ -434,6 +505,9 @@ components: example: type: web_search_call id: search-abc123 + action: + type: search + query: OpenAI API status: completed OutputItemFileSearchCall: type: object @@ -517,6 +591,32 @@ components: id: imagegen-abc123 result: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== status: completed + ResponsesServerToolOutput: + type: object + properties: + type: + type: string + pattern: '^openrouter:' + description: Server tool type (e.g. openrouter:datetime, openrouter:web_search) + id: + type: string + status: + type: string + enum: + - completed + - in_progress + - incomplete + x-speakeasy-unknown-values: allow + required: + - type + - status + additionalProperties: + nullable: true + description: A generic OpenRouter server tool output item + example: + type: openrouter:web_search + id: ws_tmp_abc123 + status: completed ResponsesOutputItem: anyOf: - $ref: '#/components/schemas/ResponsesOutputMessage' @@ -525,6 +625,7 @@ components: - $ref: '#/components/schemas/ResponsesWebSearchCallOutput' - $ref: '#/components/schemas/ResponsesOutputItemFileSearchCall' - $ref: '#/components/schemas/ResponsesImageGenerationCall' + - $ref: '#/components/schemas/ResponsesServerToolOutput' description: An output item from the response example: id: msg-abc123 @@ -794,6 +895,15 @@ components: input_file: '#/components/schemas/ResponseInputFile' input_audio: '#/components/schemas/ResponseInputAudio' - type: string + phase: + anyOf: + - type: string + enum: + - commentary + - type: string + enum: + - final_answer + - nullable: true required: - role - content @@ -847,7 +957,20 @@ components: call_id: type: string output: - type: string + anyOf: + - type: string + - type: array + items: + oneOf: + - $ref: '#/components/schemas/ResponseInputText' + - $ref: '#/components/schemas/ResponseInputImage' + - $ref: '#/components/schemas/ResponseInputFile' + discriminator: + propertyName: type + mapping: + input_text: '#/components/schemas/ResponseInputText' + input_image: '#/components/schemas/ResponseInputImage' + input_file: '#/components/schemas/ResponseInputFile' status: $ref: '#/components/schemas/ToolCallStatus' required: @@ -974,6 +1097,37 @@ components: $ref: '#/components/schemas/ResponsesSearchContextSize' user_location: $ref: '#/components/schemas/WebSearchPreviewToolUserLocation' + engine: + type: string + enum: + - auto + - native + - exa + 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 (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. + example: auto + x-speakeasy-unknown-values: allow + max_results: + type: number + minimum: 1 + maximum: 25 + description: >- + Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. + example: 5 + filters: + type: object + nullable: true + properties: + allowed_domains: + type: array + nullable: true + items: + type: string + excluded_domains: + type: array + nullable: true + items: + type: string required: - type description: Web search preview tool configuration @@ -990,6 +1144,37 @@ components: $ref: '#/components/schemas/ResponsesSearchContextSize' user_location: $ref: '#/components/schemas/WebSearchPreviewToolUserLocation' + engine: + type: string + enum: + - auto + - native + - exa + 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 (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. + example: auto + x-speakeasy-unknown-values: allow + max_results: + type: number + minimum: 1 + maximum: 25 + description: >- + Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. + example: 5 + filters: + type: object + nullable: true + properties: + allowed_domains: + type: array + nullable: true + items: + type: string + excluded_domains: + type: array + nullable: true + items: + type: string required: - type description: Web search preview tool configuration (2025-03-11 version) @@ -1038,15 +1223,38 @@ components: nullable: true items: type: string + excluded_domains: + type: array + nullable: true + items: + type: string search_context_size: $ref: '#/components/schemas/ResponsesSearchContextSize' user_location: $ref: '#/components/schemas/ResponsesWebSearchUserLocation' + engine: + type: string + enum: + - auto + - native + - exa + 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 (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. + example: auto + x-speakeasy-unknown-values: allow + max_results: + type: number + minimum: 1 + maximum: 25 + description: >- + Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. + example: 5 required: - type description: Web search tool configuration example: type: web_search + engine: auto filters: allowed_domains: - example.com @@ -1066,73 +1274,486 @@ components: nullable: true items: type: string + excluded_domains: + type: array + nullable: true + items: + type: string search_context_size: $ref: '#/components/schemas/ResponsesSearchContextSize' user_location: $ref: '#/components/schemas/ResponsesWebSearchUserLocation' + engine: + type: string + enum: + - auto + - native + - exa + 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 (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. + example: auto + x-speakeasy-unknown-values: allow + max_results: + type: number + minimum: 1 + maximum: 25 + description: >- + Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. + example: 5 required: - type description: Web search tool configuration (2025-08-26 version) example: type: web_search_2025_08_26 + engine: auto filters: allowed_domains: - example.com - OpenAIResponsesToolChoice: - anyOf: - - type: string - enum: - - auto - - type: string + CompoundFilter: + type: object + properties: + type: + type: string enum: - - none - - type: string + - and + - or + x-speakeasy-unknown-values: allow + filters: + type: array + items: + type: object + additionalProperties: + nullable: true + required: + - type + - filters + description: A compound filter that combines multiple comparison or compound filters + OpenResponsesFileSearchTool: + type: object + properties: + type: + type: string enum: - - required - - type: object + - file_search + vector_store_ids: + type: array + items: + type: string + filters: + anyOf: + - type: object + properties: + key: + type: string + type: + type: string + enum: + - eq + - ne + - gt + - gte + - lt + - lte + x-speakeasy-unknown-values: allow + value: + anyOf: + - type: string + - type: number + - type: boolean + - type: array + items: + anyOf: + - type: string + - type: number + required: + - key + - type + - value + - $ref: '#/components/schemas/CompoundFilter' + - nullable: true + max_num_results: + type: integer + minimum: 1 + maximum: 50 + ranking_options: + type: object properties: - type: + ranker: type: string enum: - - function - name: - type: string - required: - - type - - name - - type: object - properties: - type: - anyOf: - - type: string - enum: - - web_search_preview_2025_03_11 - - type: string - enum: - - web_search_preview - required: - - type - OpenAIResponsesPrompt: + - auto + - default-2024-11-15 + x-speakeasy-unknown-values: allow + score_threshold: + type: number + required: + - type + - vector_store_ids + description: File search tool configuration + example: + type: file_search + vector_store_ids: + - vs_abc123 + OpenResponsesComputerTool: type: object - nullable: true properties: - id: + type: type: string - variables: - type: object - nullable: true - additionalProperties: - anyOf: - - type: string - - $ref: '#/components/schemas/ResponseInputText' - - $ref: '#/components/schemas/ResponseInputImage' - - $ref: '#/components/schemas/ResponseInputFile' + enum: + - computer_use_preview + display_height: + type: number + display_width: + type: number + environment: + type: string + enum: + - windows + - mac + - linux + - ubuntu + - browser + x-speakeasy-unknown-values: allow required: - - id - OpenAIResponsesReasoningEffort: - type: string - nullable: true - enum: + - type + - display_height + - display_width + - environment + description: Computer use preview tool configuration + example: + type: computer_use_preview + display_height: 768 + display_width: 1024 + environment: linux + OpenResponsesCodeInterpreterTool: + type: object + properties: + type: + type: string + enum: + - code_interpreter + container: + anyOf: + - type: string + - type: object + properties: + type: + type: string + enum: + - auto + file_ids: + type: array + items: + type: string + memory_limit: + type: string + nullable: true + enum: + - 1g + - 4g + - 16g + - 64g + x-speakeasy-unknown-values: allow + required: + - type + required: + - type + - container + description: Code interpreter tool configuration + example: + type: code_interpreter + container: auto + OpenResponsesMcpTool: + type: object + properties: + type: + type: string + enum: + - mcp + server_label: + type: string + allowed_tools: + anyOf: + - type: array + items: + type: string + - type: object + properties: + tool_names: + type: array + items: + type: string + read_only: + type: boolean + - nullable: true + - nullable: true + authorization: + type: string + connector_id: + type: string + enum: + - connector_dropbox + - connector_gmail + - connector_googlecalendar + - connector_googledrive + - connector_microsoftteams + - connector_outlookcalendar + - connector_outlookemail + - connector_sharepoint + x-speakeasy-unknown-values: allow + headers: + type: object + nullable: true + additionalProperties: + type: string + require_approval: + anyOf: + - type: object + properties: + never: + type: object + properties: + tool_names: + type: array + items: + type: string + always: + type: object + properties: + tool_names: + type: array + items: + type: string + - type: string + enum: + - always + - type: string + enum: + - never + - nullable: true + - nullable: true + server_description: + type: string + server_url: + type: string + required: + - type + - server_label + description: MCP (Model Context Protocol) tool configuration + example: + type: mcp + server_label: my-server + server_url: https://example.com/mcp + OpenResponsesImageGenerationTool: + type: object + properties: + type: + type: string + enum: + - image_generation + background: + type: string + enum: + - transparent + - opaque + - auto + x-speakeasy-unknown-values: allow + input_fidelity: + type: string + nullable: true + enum: + - high + - low + x-speakeasy-unknown-values: allow + input_image_mask: + type: object + properties: + image_url: + type: string + file_id: + type: string + model: + type: string + enum: + - gpt-image-1 + - gpt-image-1-mini + x-speakeasy-unknown-values: allow + moderation: + type: string + enum: + - auto + - low + x-speakeasy-unknown-values: allow + output_compression: + type: number + output_format: + type: string + enum: + - png + - webp + - jpeg + x-speakeasy-unknown-values: allow + partial_images: + type: number + quality: + type: string + enum: + - low + - medium + - high + - auto + x-speakeasy-unknown-values: allow + size: + type: string + enum: + - 1024x1024 + - 1024x1536 + - 1536x1024 + - auto + x-speakeasy-unknown-values: allow + required: + - type + description: Image generation tool configuration + example: + type: image_generation + quality: high + OpenResponsesLocalShellTool: + type: object + properties: + type: + type: string + enum: + - local_shell + required: + - type + description: Local shell tool configuration + example: + type: local_shell + OpenResponsesFunctionShellTool: + type: object + properties: + type: + type: string + enum: + - shell + required: + - type + description: Shell tool configuration + example: + type: shell + OpenResponsesApplyPatchTool: + type: object + properties: + type: + type: string + enum: + - apply_patch + required: + - type + description: Apply patch tool configuration + example: + type: apply_patch + OpenResponsesCustomTool: + type: object + properties: + type: + type: string + enum: + - custom + name: + type: string + description: + type: string + format: + anyOf: + - type: object + properties: + type: + type: string + enum: + - text + required: + - type + - type: object + properties: + type: + type: string + enum: + - grammar + definition: + type: string + syntax: + type: string + enum: + - lark + - regex + x-speakeasy-unknown-values: allow + required: + - type + - definition + - syntax + required: + - type + - name + description: Custom tool configuration + example: + type: custom + name: my_tool + OpenAIResponsesToolChoice: + anyOf: + - type: string + enum: + - auto + - type: string + enum: + - none + - type: string + enum: + - required + - type: object + properties: + type: + type: string + enum: + - function + name: + type: string + required: + - type + - name + - type: object + properties: + type: + anyOf: + - type: string + enum: + - web_search_preview_2025_03_11 + - type: string + enum: + - web_search_preview + required: + - type + OpenAIResponsesPrompt: + type: object + nullable: true + properties: + id: + type: string + variables: + type: object + nullable: true + additionalProperties: + anyOf: + - type: string + - $ref: '#/components/schemas/ResponseInputText' + - $ref: '#/components/schemas/ResponseInputImage' + - $ref: '#/components/schemas/ResponseInputFile' + required: + - id + OpenAIResponsesReasoningEffort: + type: string + nullable: true + enum: - xhigh - high - medium @@ -1357,6 +1978,15 @@ components: - $ref: '#/components/schemas/OpenResponsesWebSearchPreview20250311Tool' - $ref: '#/components/schemas/OpenResponsesWebSearchTool' - $ref: '#/components/schemas/OpenResponsesWebSearch20250826Tool' + - $ref: '#/components/schemas/OpenResponsesFileSearchTool' + - $ref: '#/components/schemas/OpenResponsesComputerTool' + - $ref: '#/components/schemas/OpenResponsesCodeInterpreterTool' + - $ref: '#/components/schemas/OpenResponsesMcpTool' + - $ref: '#/components/schemas/OpenResponsesImageGenerationTool' + - $ref: '#/components/schemas/OpenResponsesLocalShellTool' + - $ref: '#/components/schemas/OpenResponsesFunctionShellTool' + - $ref: '#/components/schemas/OpenResponsesApplyPatchTool' + - $ref: '#/components/schemas/OpenResponsesCustomTool' tool_choice: $ref: '#/components/schemas/OpenAIResponsesToolChoice' parallel_tool_calls: @@ -1845,6 +2475,10 @@ components: type: string logprob: type: number + bytes: + type: array + items: + type: number description: Alternative token with its log probability example: token: hello @@ -1860,6 +2494,10 @@ components: type: array items: $ref: '#/components/schemas/OpenResponsesTopLogprobs' + bytes: + type: array + items: + type: number required: - logprob - token @@ -2498,16 +3136,103 @@ components: output_index: 0 sequence_number: 4 item_id: call-123 - OpenResponsesStreamEvent: - oneOf: - - allOf: - - $ref: '#/components/schemas/OpenResponsesCreatedEvent' - - type: object - properties: - response: - $ref: '#/components/schemas/OpenResponsesNonStreamingResponse' - description: Event emitted when a response is created - example: + OpenAIResponsesWebSearchCallInProgress: + type: object + properties: + type: + type: string + enum: + - response.web_search_call.in_progress + item_id: + type: string + output_index: + type: number + sequence_number: + type: number + required: + - type + - item_id + - output_index + - sequence_number + OpenResponsesWebSearchCallInProgress: + allOf: + - $ref: '#/components/schemas/OpenAIResponsesWebSearchCallInProgress' + - type: object + properties: {} + description: Web search call in progress + example: + type: response.web_search_call.in_progress + output_index: 0 + sequence_number: 1 + item_id: ws-123 + OpenAIResponsesWebSearchCallSearching: + type: object + properties: + type: + type: string + enum: + - response.web_search_call.searching + item_id: + type: string + output_index: + type: number + sequence_number: + type: number + required: + - type + - item_id + - output_index + - sequence_number + OpenResponsesWebSearchCallSearching: + allOf: + - $ref: '#/components/schemas/OpenAIResponsesWebSearchCallSearching' + - type: object + properties: {} + description: Web search call is searching + example: + type: response.web_search_call.searching + output_index: 0 + sequence_number: 2 + item_id: ws-123 + OpenAIResponsesSearchCompleted: + type: object + properties: + type: + type: string + enum: + - response.web_search_call.completed + item_id: + type: string + output_index: + type: number + sequence_number: + type: number + required: + - type + - item_id + - output_index + - sequence_number + OpenResponsesWebSearchCallCompleted: + allOf: + - $ref: '#/components/schemas/OpenAIResponsesSearchCompleted' + - type: object + properties: {} + description: Web search call completed + example: + type: response.web_search_call.completed + output_index: 0 + sequence_number: 3 + item_id: ws-123 + OpenResponsesStreamEvent: + oneOf: + - allOf: + - $ref: '#/components/schemas/OpenResponsesCreatedEvent' + - type: object + properties: + response: + $ref: '#/components/schemas/OpenResponsesNonStreamingResponse' + description: Event emitted when a response is created + example: type: response.created response: id: resp-abc123 @@ -2724,7 +3449,32 @@ components: - allOf: - $ref: '#/components/schemas/OpenResponsesTextDeltaEvent' - type: object - properties: {} + properties: + logprobs: + type: array + items: + allOf: + - $ref: '#/components/schemas/OpenResponsesLogProbs' + - type: object + properties: + top_logprobs: + type: array + items: + allOf: + - $ref: '#/components/schemas/OpenResponsesTopLogprobs' + - type: object + properties: {} + description: Alternative token with its log probability + example: + token: hello + logprob: -0.5 + description: Log probability information for a token + example: + logprob: -0.1 + token: world + top_logprobs: + - token: hello + logprob: -0.5 description: Event emitted when a text delta is streamed example: type: response.output_text.delta @@ -2737,7 +3487,32 @@ components: - allOf: - $ref: '#/components/schemas/OpenResponsesTextDoneEvent' - type: object - properties: {} + properties: + logprobs: + type: array + items: + allOf: + - $ref: '#/components/schemas/OpenResponsesLogProbs' + - type: object + properties: + top_logprobs: + type: array + items: + allOf: + - $ref: '#/components/schemas/OpenResponsesTopLogprobs' + - type: object + properties: {} + description: Alternative token with its log probability + example: + token: hello + logprob: -0.5 + description: Log probability information for a token + example: + logprob: -0.1 + token: world + top_logprobs: + - token: hello + logprob: -0.5 description: Event emitted when text streaming is complete example: type: response.output_text.done @@ -2835,6 +3610,9 @@ components: - $ref: '#/components/schemas/OpenResponsesImageGenCallGenerating' - $ref: '#/components/schemas/OpenResponsesImageGenCallPartialImage' - $ref: '#/components/schemas/OpenResponsesImageGenCallCompleted' + - $ref: '#/components/schemas/OpenResponsesWebSearchCallInProgress' + - $ref: '#/components/schemas/OpenResponsesWebSearchCallSearching' + - $ref: '#/components/schemas/OpenResponsesWebSearchCallCompleted' description: Union of all possible event types emitted during response streaming example: type: response.created @@ -3386,9 +4164,21 @@ components: - $ref: '#/components/schemas/ResponseInputAudio' - $ref: '#/components/schemas/ResponseInputVideo' - type: string + - nullable: true + phase: + anyOf: + - type: string + enum: + - commentary + - type: string + enum: + - final_answer + - 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. + example: final_answer required: - role - - content OpenResponsesInputMessageItem: type: object properties: @@ -3411,6 +4201,7 @@ components: - developer content: type: array + nullable: true items: oneOf: - $ref: '#/components/schemas/ResponseInputText' @@ -3428,7 +4219,6 @@ components: - $ref: '#/components/schemas/ResponseInputVideo' required: - role - - content OpenResponsesFunctionToolCall: type: object properties: @@ -3473,7 +4263,22 @@ components: call_id: type: string output: - type: string + anyOf: + - type: string + - type: array + items: + oneOf: + - $ref: '#/components/schemas/ResponseInputText' + - allOf: + - $ref: '#/components/schemas/ResponseInputImage' + - type: object + properties: {} + description: Image input content item + example: + type: input_image + detail: auto + image_url: https://example.com/image.jpg + - $ref: '#/components/schemas/ResponseInputFile' status: $ref: '#/components/schemas/ToolCallStatus' required: @@ -3498,16 +4303,89 @@ components: - $ref: '#/components/schemas/OpenResponsesInputMessageItem' - $ref: '#/components/schemas/OpenResponsesFunctionToolCall' - $ref: '#/components/schemas/OpenResponsesFunctionCallOutput' - - $ref: '#/components/schemas/ResponsesOutputMessage' - - $ref: '#/components/schemas/ResponsesOutputItemReasoning' + - allOf: + - $ref: '#/components/schemas/ResponsesOutputMessage' + - type: object + properties: + content: + anyOf: + - type: array + items: + anyOf: + - $ref: '#/components/schemas/ResponseOutputText' + - $ref: '#/components/schemas/OpenAIResponsesRefusalContent' + - type: string + - nullable: true + example: + id: msg-123 + type: message + role: assistant + status: completed + content: + - type: output_text + text: Hello! How can I help you? + annotations: [] + description: An output message item + - allOf: + - $ref: '#/components/schemas/ResponsesOutputItemReasoning' + - type: object + properties: + summary: + type: array + nullable: true + items: + $ref: '#/components/schemas/ReasoningSummaryText' + example: + id: reasoning-123 + type: reasoning + status: completed + summary: + - type: summary_text + text: Analyzed the problem and found the optimal solution. + content: + - type: reasoning_text + text: First, we analyze the problem... + signature: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj... + format: anthropic-claude-v1 + description: An output item containing reasoning - $ref: '#/components/schemas/ResponsesOutputItemFunctionCall' - $ref: '#/components/schemas/ResponsesWebSearchCallOutput' - $ref: '#/components/schemas/ResponsesOutputItemFileSearchCall' - $ref: '#/components/schemas/ResponsesImageGenerationCall' + - $ref: '#/components/schemas/ResponsesServerToolOutput' description: Input for a response request - can be a string or array of items example: - role: user content: What is the weather today? + ResponsesWebSearchServerTool: + type: object + properties: + type: + type: string + enum: + - openrouter:web_search + parameters: + type: object + properties: + max_results: + type: number + minimum: 1 + maximum: 25 + description: Maximum number of search results to return per search call. Defaults to 5. + example: 5 + max_total_results: + type: number + minimum: 1 + 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 + required: + - type + description: 'OpenRouter built-in server tool: searches the web for current information' + example: + type: openrouter:web_search + parameters: + max_results: 5 OpenResponsesResponseText: allOf: - $ref: '#/components/schemas/ResponseTextConfig' @@ -3567,6 +4445,7 @@ components: ProviderName: type: string enum: + - AkashML - AI21 - AionLabs - Alibaba @@ -3663,6 +4542,7 @@ components: - price - throughput - latency + - exacto description: The provider sorting strategy (price, throughput, latency) example: price x-speakeasy-unknown-values: allow @@ -3676,6 +4556,7 @@ components: - price - throughput - latency + - exacto description: The provider sorting strategy (price, throughput, latency) example: price x-speakeasy-unknown-values: allow @@ -3764,6 +4645,8 @@ components: enum: - native - exa + - firecrawl + - parallel description: The search engine to use for web search. x-speakeasy-unknown-values: allow PDFParserEngine: @@ -3780,6 +4663,11 @@ components: engine: $ref: '#/components/schemas/PDFParserEngine' description: Options for PDF parsing. + ContextCompressionEngine: + type: string + enum: + - middle-out + description: The compression engine to use. Defaults to "middle-out". OpenResponsesRequest: type: object properties: @@ -3793,7 +4681,7 @@ components: tools: type: array items: - oneOf: + anyOf: - allOf: - $ref: '#/components/schemas/OpenResponsesFunctionTool' - type: object @@ -3821,6 +4709,17 @@ components: - $ref: '#/components/schemas/OpenResponsesWebSearchPreview20250311Tool' - $ref: '#/components/schemas/OpenResponsesWebSearchTool' - $ref: '#/components/schemas/OpenResponsesWebSearch20250826Tool' + - $ref: '#/components/schemas/OpenResponsesFileSearchTool' + - $ref: '#/components/schemas/OpenResponsesComputerTool' + - $ref: '#/components/schemas/OpenResponsesCodeInterpreterTool' + - $ref: '#/components/schemas/OpenResponsesMcpTool' + - $ref: '#/components/schemas/OpenResponsesImageGenerationTool' + - $ref: '#/components/schemas/OpenResponsesLocalShellTool' + - $ref: '#/components/schemas/OpenResponsesFunctionShellTool' + - $ref: '#/components/schemas/OpenResponsesApplyPatchTool' + - $ref: '#/components/schemas/OpenResponsesCustomTool' + - $ref: '#/components/schemas/DatetimeServerTool' + - $ref: '#/components/schemas/ResponsesWebSearchServerTool' tool_choice: $ref: '#/components/schemas/OpenAIResponsesToolChoice' parallel_tool_calls: @@ -4072,6 +4971,26 @@ components: type: string engine: $ref: '#/components/schemas/WebSearchEngine' + include_domains: + type: array + items: + type: string + description: >- + 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: + - example.com + - '*.substack.com' + - openai.com/blog + exclude_domains: + type: array + items: + type: string + description: >- + 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: + - example.com + - '*.substack.com' + - openai.com/blog required: - id - type: object @@ -4098,6 +5017,19 @@ components: description: Set to false to disable the response-healing plugin for this request. Defaults to true. required: - id + - type: object + properties: + id: + type: string + enum: + - context-compression + enabled: + type: boolean + description: Set to false to disable the context-compression plugin for this request. Defaults to true. + engine: + $ref: '#/components/schemas/ContextCompressionEngine' + required: + - id description: Plugins you want to enable for this request, including their settings. route: type: string @@ -4170,6 +5102,17 @@ components: type: string enum: - assistant + container: + type: object + nullable: true + properties: + id: + type: string + expires_at: + type: string + required: + - id + - expires_at content: type: array items: @@ -4331,6 +5274,38 @@ components: - tool_use id: type: string + caller: + oneOf: + - type: object + properties: + type: + type: string + enum: + - direct + required: + - type + - type: object + properties: + type: + type: string + enum: + - code_execution_20250825 + tool_id: + type: string + required: + - type + - tool_id + - type: object + properties: + type: + type: string + enum: + - code_execution_20260120 + tool_id: + type: string + required: + - type + - tool_id name: type: string input: @@ -4338,6 +5313,7 @@ components: required: - type - id + - caller - name - type: object properties: @@ -4372,15 +5348,55 @@ components: - server_tool_use id: type: string + caller: + oneOf: + - type: object + properties: + type: + type: string + enum: + - direct + required: + - type + - type: object + properties: + type: + type: string + enum: + - code_execution_20250825 + tool_id: + type: string + required: + - type + - tool_id + - type: object + properties: + type: + type: string + enum: + - code_execution_20260120 + tool_id: + type: string + required: + - type + - tool_id name: type: string enum: - web_search + - web_fetch + - code_execution + - bash_code_execution + - text_editor_code_execution + - tool_search_tool_regex + - tool_search_tool_bm25 + x-speakeasy-unknown-values: allow input: nullable: true required: - type - id + - caller - name - type: object properties: @@ -4388,19 +5404,51 @@ components: type: string enum: - web_search_tool_result - tool_use_id: - type: string - content: - anyOf: - - type: array - items: - type: object - properties: - type: - type: string - enum: - - web_search_result - encrypted_content: + caller: + oneOf: + - type: object + properties: + type: + type: string + enum: + - direct + required: + - type + - type: object + properties: + type: + type: string + enum: + - code_execution_20250825 + tool_id: + type: string + required: + - type + - tool_id + - type: object + properties: + type: + type: string + enum: + - code_execution_20260120 + tool_id: + type: string + required: + - type + - tool_id + tool_use_id: + type: string + content: + anyOf: + - type: array + items: + type: object + properties: + type: + type: string + enum: + - web_search_result + encrypted_content: type: string page_age: type: string @@ -4429,475 +5477,1775 @@ components: - max_uses_exceeded - too_many_requests - query_too_long + - request_too_large x-speakeasy-unknown-values: allow required: - type - error_code required: - type + - caller - tool_use_id - content - model: - type: string - stop_reason: - type: string - nullable: true - enum: - - end_turn - - max_tokens - - stop_sequence - - tool_use - - pause_turn - - refusal - x-speakeasy-unknown-values: allow - stop_sequence: - type: string - nullable: true - usage: - type: object - properties: - input_tokens: - type: number - output_tokens: - type: number - cache_creation_input_tokens: - type: number - nullable: true - cache_read_input_tokens: - type: number - nullable: true - cache_creation: - type: object - nullable: true - properties: - ephemeral_5m_input_tokens: - type: number - ephemeral_1h_input_tokens: - type: number - required: - - ephemeral_5m_input_tokens - - ephemeral_1h_input_tokens - inference_geo: - type: string - nullable: true - server_tool_use: - type: object - nullable: true - properties: - web_search_requests: - type: number - required: - - web_search_requests - service_tier: - type: string - nullable: true - enum: - - standard - - priority - - batch - x-speakeasy-unknown-values: allow - required: - - input_tokens - - output_tokens - - cache_creation_input_tokens - - cache_read_input_tokens - - cache_creation - - inference_geo - - server_tool_use - - service_tier - required: - - id - - type - - role - - content - - model - - stop_reason - - stop_sequence - - usage - AnthropicMessagesResponse: - allOf: - - $ref: '#/components/schemas/BaseAnthropicMessagesResponse' - - type: object - properties: {} - description: Non-streaming response from the Anthropic Messages API with OpenRouter extensions - example: - id: msg_01XFDUDYJgAACzvnptvVoYEL - type: message - role: assistant - content: - - type: text - text: Hello! I'm doing well, thank you for asking. - citations: null - model: claude-sonnet-4-5-20250929 - stop_reason: end_turn - stop_sequence: null - usage: - input_tokens: 12 - output_tokens: 15 - cache_creation_input_tokens: null - cache_read_input_tokens: null - cache_creation: null - inference_geo: null - server_tool_use: null - service_tier: standard - AnthropicMessagesStreamEvent: - oneOf: - - type: object - properties: - type: - type: string - enum: - - message_start - message: - type: object - properties: - id: - type: string - type: - type: string - enum: - - message - role: - type: string - enum: - - assistant - content: - type: array - items: + - type: object + properties: + type: + type: string + enum: + - web_fetch_tool_result + caller: oneOf: - type: object properties: type: type: string enum: - - text - text: - type: string - citations: - type: array - nullable: true - items: - oneOf: - - type: object - properties: - type: - type: string - enum: - - char_location - cited_text: - type: string - document_index: - type: number - document_title: - type: string - nullable: true - start_char_index: - type: number - end_char_index: - type: number - file_id: - type: string - nullable: true - required: - - type - - cited_text - - document_index - - document_title - - start_char_index - - end_char_index - - file_id - - type: object - properties: - type: - type: string - enum: - - page_location - cited_text: - type: string - document_index: - type: number - document_title: - type: string - nullable: true - start_page_number: - type: number - end_page_number: - type: number - file_id: - type: string - nullable: true - required: - - type - - cited_text - - document_index - - document_title - - start_page_number - - end_page_number - - file_id - - type: object - properties: - type: - type: string - enum: - - content_block_location - cited_text: - type: string - document_index: - type: number - document_title: - type: string - nullable: true - start_block_index: - type: number - end_block_index: - type: number - file_id: - type: string - nullable: true - required: - - type - - cited_text - - document_index - - document_title - - start_block_index - - end_block_index - - file_id - - type: object - properties: - type: - type: string - enum: - - web_search_result_location - cited_text: - type: string - encrypted_index: - type: string - title: - type: string - nullable: true - url: - type: string - required: - - type - - cited_text - - encrypted_index - - title - - url - - type: object - properties: - type: - type: string - enum: - - search_result_location - cited_text: - type: string - search_result_index: - type: number - source: - type: string - title: - type: string - nullable: true - start_block_index: - type: number - end_block_index: - type: number - required: - - type - - cited_text - - search_result_index - - source - - title - - start_block_index - - end_block_index + - direct required: - type - - text - - citations - type: object properties: type: type: string enum: - - tool_use - id: + - code_execution_20250825 + tool_id: type: string - name: - type: string - input: - nullable: true required: - type - - id - - name + - tool_id - type: object properties: type: type: string enum: - - thinking - thinking: - type: string - signature: + - code_execution_20260120 + tool_id: type: string required: - type - - thinking - - signature + - tool_id + content: + oneOf: - type: object properties: type: type: string enum: - - redacted_thinking - data: + - web_fetch_tool_result_error + error_code: type: string + enum: + - invalid_tool_input + - url_too_long + - url_not_allowed + - url_not_accessible + - unsupported_content_type + - too_many_requests + - max_uses_exceeded + - unavailable + x-speakeasy-unknown-values: allow required: - type - - data + - error_code - type: object properties: + content: + type: object + properties: + citations: + type: object + nullable: true + properties: + enabled: + type: boolean + required: + - enabled + source: + anyOf: + - type: object + properties: + data: + type: string + media_type: + type: string + enum: + - application/pdf + type: + type: string + enum: + - base64 + required: + - data + - media_type + - type + - type: object + properties: + data: + type: string + media_type: + type: string + enum: + - text/plain + type: + type: string + enum: + - text + required: + - data + - media_type + - type + title: + type: string + nullable: true + type: + type: string + enum: + - document + required: + - citations + - source + - title + - type + retrieved_at: + type: string + nullable: true type: type: string enum: - - server_tool_use - id: + - web_fetch_result + url: type: string - name: + required: + - content + - retrieved_at + - type + - url + tool_use_id: + type: string + required: + - type + - caller + - content + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - code_execution_tool_result + content: + oneOf: + - type: object + properties: + error_code: type: string enum: - - web_search - input: - nullable: true + - invalid_tool_input + - unavailable + - too_many_requests + - execution_time_exceeded + x-speakeasy-unknown-values: allow + type: + type: string + enum: + - code_execution_tool_result_error + required: + - error_code + - type + - type: object + properties: + content: + type: array + items: + type: object + properties: + file_id: + type: string + type: + type: string + enum: + - code_execution_output + required: + - file_id + - type + return_code: + type: number + stderr: + type: string + stdout: + type: string + type: + type: string + enum: + - code_execution_result required: + - content + - return_code + - stderr + - stdout - type - - id - - name - type: object properties: + content: + type: array + items: + type: object + properties: + file_id: + type: string + type: + type: string + enum: + - code_execution_output + required: + - file_id + - type + encrypted_stdout: + type: string + return_code: + type: number + stderr: + type: string type: type: string enum: - - web_search_tool_result - tool_use_id: + - encrypted_code_execution_result + required: + - content + - encrypted_stdout + - return_code + - stderr + - type + tool_use_id: + type: string + required: + - type + - content + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - bash_code_execution_tool_result + content: + oneOf: + - type: object + properties: + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - too_many_requests + - execution_time_exceeded + - output_file_too_large + x-speakeasy-unknown-values: allow + type: type: string + enum: + - bash_code_execution_tool_result_error + required: + - error_code + - type + - type: object + properties: content: - anyOf: - - type: array - items: - type: object - properties: - type: - type: string - enum: - - web_search_result - encrypted_content: - type: string - page_age: - type: string - nullable: true - title: - type: string - url: - type: string - required: - - type - - encrypted_content - - page_age - - title - - url - - type: object - properties: - type: - type: string - enum: - - web_search_tool_result_error - error_code: - type: string - enum: - - invalid_tool_input - - unavailable - - max_uses_exceeded - - too_many_requests - - query_too_long - x-speakeasy-unknown-values: allow - required: - - type - - error_code + type: array + items: + type: object + properties: + file_id: + type: string + type: + type: string + enum: + - bash_code_execution_output + required: + - file_id + - type + return_code: + type: number + stderr: + type: string + stdout: + type: string + type: + type: string + enum: + - bash_code_execution_result + required: + - content + - return_code + - stderr + - stdout + - type + tool_use_id: + type: string + required: + - type + - content + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - text_editor_code_execution_tool_result + content: + oneOf: + - type: object + properties: + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - too_many_requests + - execution_time_exceeded + - file_not_found + x-speakeasy-unknown-values: allow + error_message: + type: string + nullable: true + type: + type: string + enum: + - text_editor_code_execution_tool_result_error required: + - error_code + - error_message - type - - tool_use_id + - type: object + properties: + content: + type: string + file_type: + type: string + enum: + - text + - image + - pdf + x-speakeasy-unknown-values: allow + num_lines: + type: number + nullable: true + start_line: + type: number + nullable: true + total_lines: + type: number + nullable: true + type: + type: string + enum: + - text_editor_code_execution_view_result + required: - content - model: - type: string - stop_reason: + - file_type + - num_lines + - start_line + - total_lines + - type + - type: object + properties: + is_file_update: + type: boolean + type: + type: string + enum: + - text_editor_code_execution_create_result + required: + - is_file_update + - type + - type: object + properties: + lines: + type: array + nullable: true + items: + type: string + new_lines: + type: number + nullable: true + new_start: + type: number + nullable: true + old_lines: + type: number + nullable: true + old_start: + type: number + nullable: true + type: + type: string + enum: + - text_editor_code_execution_str_replace_result + required: + - lines + - new_lines + - new_start + - old_lines + - old_start + - type + tool_use_id: + type: string + required: + - type + - content + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - tool_search_tool_result + content: + oneOf: + - type: object + properties: + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - too_many_requests + - execution_time_exceeded + x-speakeasy-unknown-values: allow + error_message: + type: string + nullable: true + type: + type: string + enum: + - tool_search_tool_result_error + required: + - error_code + - error_message + - type + - type: object + properties: + tool_references: + type: array + items: + type: object + properties: + tool_name: + type: string + type: + type: string + enum: + - tool_reference + required: + - tool_name + - type + type: + type: string + enum: + - tool_search_tool_search_result + required: + - tool_references + - type + tool_use_id: + type: string + required: + - type + - content + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - container_upload + file_id: + type: string + required: + - type + - file_id + model: + type: string + stop_reason: + type: string + nullable: true + enum: + - end_turn + - max_tokens + - stop_sequence + - tool_use + - pause_turn + - refusal + x-speakeasy-unknown-values: allow + stop_sequence: + type: string + nullable: true + usage: + type: object + properties: + input_tokens: + type: number + output_tokens: + type: number + cache_creation_input_tokens: + type: number + nullable: true + cache_read_input_tokens: + type: number + nullable: true + cache_creation: + type: object + nullable: true + properties: + ephemeral_5m_input_tokens: + type: number + ephemeral_1h_input_tokens: + type: number + required: + - ephemeral_5m_input_tokens + - ephemeral_1h_input_tokens + inference_geo: + type: string + nullable: true + server_tool_use: + type: object + nullable: true + properties: + web_search_requests: + type: number + web_fetch_requests: + type: number + required: + - web_search_requests + - web_fetch_requests + service_tier: + type: string + nullable: true + enum: + - standard + - priority + - batch + x-speakeasy-unknown-values: allow + required: + - input_tokens + - output_tokens + - cache_creation_input_tokens + - cache_read_input_tokens + - cache_creation + - inference_geo + - server_tool_use + - service_tier + required: + - id + - type + - role + - container + - content + - model + - stop_reason + - stop_sequence + - usage + AnthropicMessagesResponse: + allOf: + - $ref: '#/components/schemas/BaseAnthropicMessagesResponse' + - type: object + properties: + provider: + type: string + 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 + - Amazon Bedrock + - Amazon Nova + - Anthropic + - Arcee AI + - AtlasCloud + - Avian + - Azure + - BaseTen + - BytePlus + - Black Forest Labs + - Cerebras + - Chutes + - Cirrascale + - Clarifai + - Cloudflare + - Cohere + - Crusoe + - DeepInfra + - DeepSeek + - 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 + - Relace + - SambaNova + - Seed + - SiliconFlow + - Sourceful + - StepFun + - Stealth + - StreamLake + - Switchpoint + - Together + - Upstage + - Venice + - WandB + - Xiaomi + - xAI + - Z.AI + - FakeProvider + x-speakeasy-unknown-values: allow + description: Non-streaming response from the Anthropic Messages API with OpenRouter extensions + example: + id: msg_01XFDUDYJgAACzvnptvVoYEL + type: message + role: assistant + container: null + content: + - type: text + text: Hello! I'm doing well, thank you for asking. + citations: null + model: claude-sonnet-4-5-20250929 + stop_reason: end_turn + stop_sequence: null + usage: + input_tokens: 12 + output_tokens: 15 + cache_creation_input_tokens: null + cache_read_input_tokens: null + cache_creation: null + inference_geo: null + server_tool_use: null + service_tier: standard + AnthropicMessagesMessageStartEvent: + type: object + properties: + type: + type: string + enum: + - message_start + message: + type: object + properties: + id: + type: string + type: + type: string + enum: + - message + role: + type: string + enum: + - assistant + container: + type: object + nullable: true + properties: + id: + type: string + expires_at: + type: string + required: + - id + - expires_at + content: + type: array + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - text + text: + type: string + citations: + type: array + nullable: true + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - file_id + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - file_id + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - file_id + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + required: + - type + - text + - citations + - type: object + properties: + type: + type: string + enum: + - tool_use + id: + type: string + caller: + oneOf: + - type: object + properties: + type: + type: string + enum: + - direct + required: + - type + - type: object + properties: + type: + type: string + enum: + - code_execution_20250825 + tool_id: + type: string + required: + - type + - tool_id + - type: object + properties: + type: + type: string + enum: + - code_execution_20260120 + tool_id: + type: string + required: + - type + - tool_id + name: + type: string + input: + nullable: true + required: + - type + - id + - caller + - name + - type: object + properties: + type: + type: string + enum: + - thinking + thinking: + type: string + signature: + type: string + required: + - type + - thinking + - signature + - type: object + properties: + type: + type: string + enum: + - redacted_thinking + data: + type: string + required: + - type + - data + - type: object + properties: + type: + type: string + enum: + - server_tool_use + id: + type: string + caller: + oneOf: + - type: object + properties: + type: + type: string + enum: + - direct + required: + - type + - type: object + properties: + type: + type: string + enum: + - code_execution_20250825 + tool_id: + type: string + required: + - type + - tool_id + - type: object + properties: + type: + type: string + enum: + - code_execution_20260120 + tool_id: + type: string + required: + - type + - tool_id + name: + type: string + enum: + - web_search + - web_fetch + - code_execution + - bash_code_execution + - text_editor_code_execution + - tool_search_tool_regex + - tool_search_tool_bm25 + x-speakeasy-unknown-values: allow + input: + nullable: true + required: + - type + - id + - caller + - name + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result + caller: + oneOf: + - type: object + properties: + type: + type: string + enum: + - direct + required: + - type + - type: object + properties: + type: + type: string + enum: + - code_execution_20250825 + tool_id: + type: string + required: + - type + - tool_id + - type: object + properties: + type: + type: string + enum: + - code_execution_20260120 + tool_id: + type: string + required: + - type + - tool_id + tool_use_id: + type: string + content: + anyOf: + - type: array + items: + type: object + properties: + type: + type: string + enum: + - web_search_result + encrypted_content: + type: string + page_age: + type: string + nullable: true + title: + type: string + url: + type: string + required: + - type + - encrypted_content + - page_age + - title + - url + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result_error + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - max_uses_exceeded + - too_many_requests + - query_too_long + - request_too_large + x-speakeasy-unknown-values: allow + required: + - type + - error_code + required: + - type + - caller + - tool_use_id + - content + - type: object + properties: + type: + type: string + enum: + - web_fetch_tool_result + caller: + oneOf: + - type: object + properties: + type: + type: string + enum: + - direct + required: + - type + - type: object + properties: + type: + type: string + enum: + - code_execution_20250825 + tool_id: + type: string + required: + - type + - tool_id + - type: object + properties: + type: + type: string + enum: + - code_execution_20260120 + tool_id: + type: string + required: + - type + - tool_id + content: + oneOf: + - type: object + properties: + type: + type: string + enum: + - web_fetch_tool_result_error + error_code: + type: string + enum: + - invalid_tool_input + - url_too_long + - url_not_allowed + - url_not_accessible + - unsupported_content_type + - too_many_requests + - max_uses_exceeded + - unavailable + x-speakeasy-unknown-values: allow + required: + - type + - error_code + - type: object + properties: + content: + type: object + properties: + citations: + type: object + nullable: true + properties: + enabled: + type: boolean + required: + - enabled + source: + anyOf: + - type: object + properties: + data: + type: string + media_type: + type: string + enum: + - application/pdf + type: + type: string + enum: + - base64 + required: + - data + - media_type + - type + - type: object + properties: + data: + type: string + media_type: + type: string + enum: + - text/plain + type: + type: string + enum: + - text + required: + - data + - media_type + - type + title: + type: string + nullable: true + type: + type: string + enum: + - document + required: + - citations + - source + - title + - type + retrieved_at: + type: string + nullable: true + type: + type: string + enum: + - web_fetch_result + url: + type: string + required: + - content + - retrieved_at + - type + - url + tool_use_id: + type: string + required: + - type + - caller + - content + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - code_execution_tool_result + content: + oneOf: + - type: object + properties: + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - too_many_requests + - execution_time_exceeded + x-speakeasy-unknown-values: allow + type: + type: string + enum: + - code_execution_tool_result_error + required: + - error_code + - type + - type: object + properties: + content: + type: array + items: + type: object + properties: + file_id: + type: string + type: + type: string + enum: + - code_execution_output + required: + - file_id + - type + return_code: + type: number + stderr: + type: string + stdout: + type: string + type: + type: string + enum: + - code_execution_result + required: + - content + - return_code + - stderr + - stdout + - type + - type: object + properties: + content: + type: array + items: + type: object + properties: + file_id: + type: string + type: + type: string + enum: + - code_execution_output + required: + - file_id + - type + encrypted_stdout: + type: string + return_code: + type: number + stderr: + type: string + type: + type: string + enum: + - encrypted_code_execution_result + required: + - content + - encrypted_stdout + - return_code + - stderr + - type + tool_use_id: + type: string + required: + - type + - content + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - bash_code_execution_tool_result + content: + oneOf: + - type: object + properties: + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - too_many_requests + - execution_time_exceeded + - output_file_too_large + x-speakeasy-unknown-values: allow + type: + type: string + enum: + - bash_code_execution_tool_result_error + required: + - error_code + - type + - type: object + properties: + content: + type: array + items: + type: object + properties: + file_id: + type: string + type: + type: string + enum: + - bash_code_execution_output + required: + - file_id + - type + return_code: + type: number + stderr: + type: string + stdout: + type: string + type: + type: string + enum: + - bash_code_execution_result + required: + - content + - return_code + - stderr + - stdout + - type + tool_use_id: + type: string + required: + - type + - content + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - text_editor_code_execution_tool_result + content: + oneOf: + - type: object + properties: + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - too_many_requests + - execution_time_exceeded + - file_not_found + x-speakeasy-unknown-values: allow + error_message: + type: string + nullable: true + type: + type: string + enum: + - text_editor_code_execution_tool_result_error + required: + - error_code + - error_message + - type + - type: object + properties: + content: + type: string + file_type: + type: string + enum: + - text + - image + - pdf + x-speakeasy-unknown-values: allow + num_lines: + type: number + nullable: true + start_line: + type: number + nullable: true + total_lines: + type: number + nullable: true + type: + type: string + enum: + - text_editor_code_execution_view_result + required: + - content + - file_type + - num_lines + - start_line + - total_lines + - type + - type: object + properties: + is_file_update: + type: boolean + type: + type: string + enum: + - text_editor_code_execution_create_result + required: + - is_file_update + - type + - type: object + properties: + lines: + type: array + nullable: true + items: + type: string + new_lines: + type: number + nullable: true + new_start: + type: number + nullable: true + old_lines: + type: number + nullable: true + old_start: + type: number + nullable: true + type: + type: string + enum: + - text_editor_code_execution_str_replace_result + required: + - lines + - new_lines + - new_start + - old_lines + - old_start + - type + tool_use_id: + type: string + required: + - type + - content + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - tool_search_tool_result + content: + oneOf: + - type: object + properties: + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - too_many_requests + - execution_time_exceeded + x-speakeasy-unknown-values: allow + error_message: + type: string + nullable: true + type: + type: string + enum: + - tool_search_tool_result_error + required: + - error_code + - error_message + - type + - type: object + properties: + tool_references: + type: array + items: + type: object + properties: + tool_name: + type: string + type: + type: string + enum: + - tool_reference + required: + - tool_name + - type + type: + type: string + enum: + - tool_search_tool_search_result + required: + - tool_references + - type + tool_use_id: + type: string + required: + - type + - content + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - container_upload + file_id: + type: string + required: + - type + - file_id + model: + type: string + stop_reason: + nullable: true + stop_sequence: + nullable: true + usage: + type: object + properties: + input_tokens: + type: number + output_tokens: + type: number + cache_creation_input_tokens: + type: number nullable: true - stop_sequence: + cache_read_input_tokens: + type: number nullable: true - usage: + cache_creation: type: object + nullable: true properties: - input_tokens: + ephemeral_5m_input_tokens: type: number - output_tokens: + ephemeral_1h_input_tokens: type: number - cache_creation_input_tokens: + required: + - ephemeral_5m_input_tokens + - ephemeral_1h_input_tokens + inference_geo: + type: string + nullable: true + server_tool_use: + type: object + nullable: true + properties: + web_search_requests: type: number - nullable: true - cache_read_input_tokens: + web_fetch_requests: type: number - nullable: true - cache_creation: - type: object - nullable: true - properties: - ephemeral_5m_input_tokens: - type: number - ephemeral_1h_input_tokens: - type: number - required: - - ephemeral_5m_input_tokens - - ephemeral_1h_input_tokens - inference_geo: - type: string - nullable: true - server_tool_use: - type: object - nullable: true - properties: - web_search_requests: - type: number - required: - - web_search_requests - service_tier: - type: string - nullable: true - enum: - - standard - - priority - - batch - x-speakeasy-unknown-values: allow required: - - input_tokens - - output_tokens - - cache_creation_input_tokens - - cache_read_input_tokens - - cache_creation - - inference_geo - - server_tool_use - - service_tier + - web_search_requests + - web_fetch_requests + service_tier: + type: string + nullable: true + enum: + - standard + - priority + - batch + x-speakeasy-unknown-values: allow required: - - id - - type - - role - - content - - model - - stop_reason - - stop_sequence - - usage + - input_tokens + - output_tokens + - cache_creation_input_tokens + - cache_read_input_tokens + - cache_creation + - inference_geo + - server_tool_use + - service_tier + provider: + type: string + 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 + - Amazon Bedrock + - Amazon Nova + - Anthropic + - Arcee AI + - AtlasCloud + - Avian + - Azure + - BaseTen + - BytePlus + - Black Forest Labs + - Cerebras + - Chutes + - Cirrascale + - Clarifai + - Cloudflare + - Cohere + - Crusoe + - DeepInfra + - DeepSeek + - 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 + - Relace + - SambaNova + - Seed + - SiliconFlow + - Sourceful + - StepFun + - Stealth + - StreamLake + - Switchpoint + - Together + - Upstage + - Venice + - WandB + - Xiaomi + - xAI + - Z.AI + - FakeProvider + x-speakeasy-unknown-values: allow required: + - id - type - - message + - role + - container + - content + - model + - stop_reason + - stop_sequence + - usage + required: + - type + - message + description: Event sent at the start of a streaming message + AnthropicMessagesStreamEvent: + oneOf: + - $ref: '#/components/schemas/AnthropicMessagesMessageStartEvent' - type: object properties: type: @@ -4907,6 +7255,17 @@ components: delta: type: object properties: + container: + type: object + nullable: true + properties: + id: + type: string + expires_at: + type: string + required: + - id + - expires_at stop_reason: type: string nullable: true @@ -4922,6 +7281,7 @@ components: type: string nullable: true required: + - container - stop_reason - stop_sequence usage: @@ -4944,8 +7304,11 @@ components: properties: web_search_requests: type: number + web_fetch_requests: + type: number required: - web_search_requests + - web_fetch_requests required: - input_tokens - output_tokens @@ -5117,126 +7480,710 @@ components: - search_result_index - source - title - - start_block_index - - end_block_index + - start_block_index + - end_block_index + required: + - type + - text + - citations + - type: object + properties: + type: + type: string + enum: + - tool_use + id: + type: string + caller: + oneOf: + - type: object + properties: + type: + type: string + enum: + - direct + required: + - type + - type: object + properties: + type: + type: string + enum: + - code_execution_20250825 + tool_id: + type: string + required: + - type + - tool_id + - type: object + properties: + type: + type: string + enum: + - code_execution_20260120 + tool_id: + type: string + required: + - type + - tool_id + name: + type: string + input: + nullable: true + required: + - type + - id + - caller + - name + - type: object + properties: + type: + type: string + enum: + - thinking + thinking: + type: string + signature: + type: string + required: + - type + - thinking + - signature + - type: object + properties: + type: + type: string + enum: + - redacted_thinking + data: + type: string + required: + - type + - data + - type: object + properties: + type: + type: string + enum: + - server_tool_use + id: + type: string + caller: + oneOf: + - type: object + properties: + type: + type: string + enum: + - direct + required: + - type + - type: object + properties: + type: + type: string + enum: + - code_execution_20250825 + tool_id: + type: string + required: + - type + - tool_id + - type: object + properties: + type: + type: string + enum: + - code_execution_20260120 + tool_id: + type: string + required: + - type + - tool_id + name: + type: string + enum: + - web_search + - web_fetch + - code_execution + - bash_code_execution + - text_editor_code_execution + - tool_search_tool_regex + - tool_search_tool_bm25 + x-speakeasy-unknown-values: allow + input: + nullable: true + required: + - type + - id + - caller + - name + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result + caller: + oneOf: + - type: object + properties: + type: + type: string + enum: + - direct + required: + - type + - type: object + properties: + type: + type: string + enum: + - code_execution_20250825 + tool_id: + type: string + required: + - type + - tool_id + - type: object + properties: + type: + type: string + enum: + - code_execution_20260120 + tool_id: + type: string + required: + - type + - tool_id + tool_use_id: + type: string + content: + anyOf: + - type: array + items: + type: object + properties: + type: + type: string + enum: + - web_search_result + encrypted_content: + type: string + page_age: + type: string + nullable: true + title: + type: string + url: + type: string + required: + - type + - encrypted_content + - page_age + - title + - url + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result_error + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - max_uses_exceeded + - too_many_requests + - query_too_long + - request_too_large + x-speakeasy-unknown-values: allow + required: + - type + - error_code required: - type - - text - - citations + - caller + - tool_use_id + - content - type: object properties: type: type: string enum: - - tool_use - id: - type: string - name: + - web_fetch_tool_result + caller: + oneOf: + - type: object + properties: + type: + type: string + enum: + - direct + required: + - type + - type: object + properties: + type: + type: string + enum: + - code_execution_20250825 + tool_id: + type: string + required: + - type + - tool_id + - type: object + properties: + type: + type: string + enum: + - code_execution_20260120 + tool_id: + type: string + required: + - type + - tool_id + content: + oneOf: + - type: object + properties: + type: + type: string + enum: + - web_fetch_tool_result_error + error_code: + type: string + enum: + - invalid_tool_input + - url_too_long + - url_not_allowed + - url_not_accessible + - unsupported_content_type + - too_many_requests + - max_uses_exceeded + - unavailable + x-speakeasy-unknown-values: allow + required: + - type + - error_code + - type: object + properties: + content: + type: object + properties: + citations: + type: object + nullable: true + properties: + enabled: + type: boolean + required: + - enabled + source: + anyOf: + - type: object + properties: + data: + type: string + media_type: + type: string + enum: + - application/pdf + type: + type: string + enum: + - base64 + required: + - data + - media_type + - type + - type: object + properties: + data: + type: string + media_type: + type: string + enum: + - text/plain + type: + type: string + enum: + - text + required: + - data + - media_type + - type + title: + type: string + nullable: true + type: + type: string + enum: + - document + required: + - citations + - source + - title + - type + retrieved_at: + type: string + nullable: true + type: + type: string + enum: + - web_fetch_result + url: + type: string + required: + - content + - retrieved_at + - type + - url + tool_use_id: type: string - input: - nullable: true required: - type - - id - - name + - caller + - content + - tool_use_id - type: object properties: type: type: string enum: - - thinking - thinking: - type: string - signature: + - code_execution_tool_result + content: + oneOf: + - type: object + properties: + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - too_many_requests + - execution_time_exceeded + x-speakeasy-unknown-values: allow + type: + type: string + enum: + - code_execution_tool_result_error + required: + - error_code + - type + - type: object + properties: + content: + type: array + items: + type: object + properties: + file_id: + type: string + type: + type: string + enum: + - code_execution_output + required: + - file_id + - type + return_code: + type: number + stderr: + type: string + stdout: + type: string + type: + type: string + enum: + - code_execution_result + required: + - content + - return_code + - stderr + - stdout + - type + - type: object + properties: + content: + type: array + items: + type: object + properties: + file_id: + type: string + type: + type: string + enum: + - code_execution_output + required: + - file_id + - type + encrypted_stdout: + type: string + return_code: + type: number + stderr: + type: string + type: + type: string + enum: + - encrypted_code_execution_result + required: + - content + - encrypted_stdout + - return_code + - stderr + - type + tool_use_id: type: string required: - type - - thinking - - signature + - content + - tool_use_id - type: object properties: type: type: string enum: - - redacted_thinking - data: + - bash_code_execution_tool_result + content: + oneOf: + - type: object + properties: + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - too_many_requests + - execution_time_exceeded + - output_file_too_large + x-speakeasy-unknown-values: allow + type: + type: string + enum: + - bash_code_execution_tool_result_error + required: + - error_code + - type + - type: object + properties: + content: + type: array + items: + type: object + properties: + file_id: + type: string + type: + type: string + enum: + - bash_code_execution_output + required: + - file_id + - type + return_code: + type: number + stderr: + type: string + stdout: + type: string + type: + type: string + enum: + - bash_code_execution_result + required: + - content + - return_code + - stderr + - stdout + - type + tool_use_id: type: string required: - type - - data + - content + - tool_use_id - type: object properties: type: type: string enum: - - server_tool_use - id: - type: string - name: + - text_editor_code_execution_tool_result + content: + oneOf: + - type: object + properties: + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - too_many_requests + - execution_time_exceeded + - file_not_found + x-speakeasy-unknown-values: allow + error_message: + type: string + nullable: true + type: + type: string + enum: + - text_editor_code_execution_tool_result_error + required: + - error_code + - error_message + - type + - type: object + properties: + content: + type: string + file_type: + type: string + enum: + - text + - image + - pdf + x-speakeasy-unknown-values: allow + num_lines: + type: number + nullable: true + start_line: + type: number + nullable: true + total_lines: + type: number + nullable: true + type: + type: string + enum: + - text_editor_code_execution_view_result + required: + - content + - file_type + - num_lines + - start_line + - total_lines + - type + - type: object + properties: + is_file_update: + type: boolean + type: + type: string + enum: + - text_editor_code_execution_create_result + required: + - is_file_update + - type + - type: object + properties: + lines: + type: array + nullable: true + items: + type: string + new_lines: + type: number + nullable: true + new_start: + type: number + nullable: true + old_lines: + type: number + nullable: true + old_start: + type: number + nullable: true + type: + type: string + enum: + - text_editor_code_execution_str_replace_result + required: + - lines + - new_lines + - new_start + - old_lines + - old_start + - type + tool_use_id: type: string - enum: - - web_search - input: - nullable: true required: - type - - id - - name + - content + - tool_use_id - type: object properties: type: type: string enum: - - web_search_tool_result - tool_use_id: - type: string + - tool_search_tool_result content: - anyOf: - - type: array - items: - type: object - properties: - type: - type: string - enum: - - web_search_result - encrypted_content: - type: string - page_age: - type: string - nullable: true - title: - type: string - url: - type: string - required: - - type - - encrypted_content - - page_age - - title - - url + oneOf: - type: object properties: - type: - type: string - enum: - - web_search_tool_result_error error_code: type: string enum: - invalid_tool_input - unavailable - - max_uses_exceeded - too_many_requests - - query_too_long + - execution_time_exceeded x-speakeasy-unknown-values: allow + error_message: + type: string + nullable: true + type: + type: string + enum: + - tool_search_tool_result_error required: - - type - error_code + - error_message + - type + - type: object + properties: + tool_references: + type: array + items: + type: object + properties: + tool_name: + type: string + type: + type: string + enum: + - tool_reference + required: + - tool_name + - type + type: + type: string + enum: + - tool_search_tool_search_result + required: + - tool_references + - type + tool_use_id: + type: string required: - type - - tool_use_id - content + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - container_upload + file_id: + type: string + required: + - type + - file_id required: - type - index @@ -6143,49 +9090,304 @@ components: type: type: string enum: - - web_search_result_location - cited_text: - type: string - encrypted_index: - type: string - title: - type: string - nullable: true - url: - type: string - required: - - type - - cited_text - - encrypted_index - - title - - url - - type: object - properties: - type: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + required: + - type + - text + - type: object + properties: + type: + type: string + enum: + - image + source: + oneOf: + - type: object + properties: + type: + type: string + enum: + - base64 + media_type: + type: string + enum: + - image/jpeg + - image/png + - image/gif + - image/webp + x-speakeasy-unknown-values: allow + data: + type: string + required: + - type + - media_type + - data + - type: object + properties: + type: + type: string + enum: + - url + url: + type: string + required: + - type + - url + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + required: + - type + - source + - type: object + properties: + type: + type: string + enum: + - tool_reference + tool_name: + type: string + required: + - type + - tool_name + - type: object + properties: + type: + type: string + enum: + - search_result + source: + type: string + title: + type: string + content: + type: array + items: + type: object + properties: + type: + type: string + enum: + - text + text: + type: string + citations: + type: array + nullable: true + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: type: string enum: - - search_result_location - cited_text: - type: string - search_result_index: - type: number - source: - type: string - title: - type: string - nullable: true - start_block_index: - type: number - end_block_index: - type: number + - 5m + - 1h + x-speakeasy-unknown-values: allow required: - type - - cited_text - - search_result_index - - source - - title - - start_block_index - - end_block_index + required: + - type + - text + citations: + type: object + properties: + enabled: + type: boolean cache_control: type: object properties: @@ -6203,13 +9405,15 @@ components: - type required: - type - - text + - source + - title + - content - type: object properties: type: type: string enum: - - image + - document source: oneOf: - type: object @@ -6221,17 +9425,252 @@ components: media_type: type: string enum: - - image/jpeg - - image/png - - image/gif - - image/webp - x-speakeasy-unknown-values: allow + - application/pdf + data: + type: string + required: + - type + - media_type + - data + - type: object + properties: + type: + type: string + enum: + - text + media_type: + type: string + enum: + - text/plain data: type: string required: - type - media_type - data + - type: object + properties: + type: + type: string + enum: + - content + content: + anyOf: + - type: string + - type: array + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - text + text: + type: string + citations: + type: array + nullable: true + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + required: + - type + - text + - type: object + properties: + type: + type: string + enum: + - image + source: + oneOf: + - type: object + properties: + type: + type: string + enum: + - base64 + media_type: + type: string + enum: + - image/jpeg + - image/png + - image/gif + - image/webp + x-speakeasy-unknown-values: allow + data: + type: string + required: + - type + - media_type + - data + - type: object + properties: + type: + type: string + enum: + - url + url: + type: string + required: + - type + - url + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + required: + - type + - source + required: + - type + - content - type: object properties: type: @@ -6243,6 +9682,18 @@ components: required: - type - url + citations: + type: object + nullable: true + properties: + enabled: + type: boolean + context: + type: string + nullable: true + title: + type: string + nullable: true cache_control: type: object properties: @@ -6318,6 +9769,13 @@ components: type: string enum: - web_search + - web_fetch + - code_execution + - bash_code_execution + - text_editor_code_execution + - tool_search_tool_regex + - tool_search_tool_bm25 + x-speakeasy-unknown-values: allow input: nullable: true cache_control: @@ -6601,6 +10059,83 @@ components: - role - content description: Anthropic message with OpenRouter extensions + AnthropicWebSearchServerTool: + type: object + properties: + type: + type: string + enum: + - openrouter:web_search + parameters: + type: object + properties: + engine: + type: string + enum: + - auto + - native + - exa + 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 (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. + example: auto + x-speakeasy-unknown-values: allow + max_results: + type: number + minimum: 1 + maximum: 25 + description: >- + Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. + example: 5 + max_total_results: + type: number + minimum: 1 + 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 + search_context_size: + type: string + enum: + - low + - medium + - high + 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. + x-speakeasy-unknown-values: allow + user_location: + type: object + properties: + type: + type: string + enum: + - approximate + city: + type: string + region: + type: string + country: + type: string + timezone: + type: string + description: Approximate user location for location-biased results. + allowed_domains: + type: array + items: + type: string + description: >- + Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search. + excluded_domains: + type: array + items: + type: string + description: >- + Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search. + required: + - type + description: 'OpenRouter built-in server tool: searches the web for current information' + example: + type: openrouter:web_search + parameters: + max_results: 5 AnthropicOutputConfig: type: object properties: @@ -6616,7 +10151,24 @@ components: 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`, or `max`. example: medium x-speakeasy-unknown-values: allow - description: Configuration for controlling output behavior. Currently supports the effort parameter for Claude Opus 4.5. + format: + type: object + nullable: true + properties: + type: + type: string + enum: + - json_schema + schema: + type: object + additionalProperties: + nullable: true + required: + - type + - schema + 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). + description: Configuration for controlling output behavior. Supports the effort parameter and structured output format. AnthropicMessagesRequest: type: object properties: @@ -6626,6 +10178,7 @@ components: type: number messages: type: array + nullable: true items: $ref: '#/components/schemas/OpenRouterAnthropicMessageParam' system: @@ -6794,8 +10347,6 @@ components: type: array items: type: string - stream: - type: boolean temperature: type: number top_p: @@ -6805,7 +10356,7 @@ components: tools: type: array items: - oneOf: + anyOf: - type: object properties: name: @@ -6817,8 +10368,7 @@ components: properties: type: type: string - enum: - - object + default: object properties: nullable: true required: @@ -6826,8 +10376,6 @@ components: nullable: true items: type: string - required: - - type additionalProperties: nullable: true type: @@ -6971,6 +10519,8 @@ components: required: - type - name + - $ref: '#/components/schemas/DatetimeServerTool' + - $ref: '#/components/schemas/AnthropicWebSearchServerTool' tool_choice: oneOf: - type: object @@ -7049,6 +10599,160 @@ components: - auto - standard_only x-speakeasy-unknown-values: allow + output_config: + $ref: '#/components/schemas/AnthropicOutputConfig' + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + stream: + type: boolean + context_management: + type: object + nullable: true + properties: + edits: + type: array + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - clear_tool_uses_20250919 + clear_at_least: + type: object + nullable: true + properties: + type: + type: string + enum: + - input_tokens + value: + type: number + required: + - type + - value + clear_tool_inputs: + anyOf: + - type: boolean + - type: array + items: + type: string + - nullable: true + exclude_tools: + type: array + nullable: true + items: + type: string + keep: + type: object + properties: + type: + type: string + enum: + - tool_uses + value: + type: number + required: + - type + - value + trigger: + oneOf: + - type: object + properties: + type: + type: string + enum: + - input_tokens + value: + type: number + required: + - type + - value + - type: object + properties: + type: + type: string + enum: + - tool_uses + value: + type: number + required: + - type + - value + required: + - type + - type: object + properties: + type: + type: string + enum: + - clear_thinking_20251015 + keep: + anyOf: + - type: object + properties: + type: + type: string + enum: + - thinking_turns + value: + type: number + required: + - type + - value + - type: object + properties: + type: + type: string + enum: + - all + required: + - type + - type: string + enum: + - all + required: + - type + - type: object + properties: + type: + type: string + enum: + - compact_20260112 + instructions: + type: string + nullable: true + pause_after_compaction: + type: boolean + trigger: + type: object + nullable: true + properties: + type: + type: string + enum: + - input_tokens + value: + type: number + required: + - type + - value + required: + - type provider: type: object nullable: true @@ -7201,6 +10905,26 @@ components: type: string engine: $ref: '#/components/schemas/WebSearchEngine' + include_domains: + type: array + items: + type: string + description: >- + 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: + - example.com + - '*.substack.com' + - openai.com/blog + exclude_domains: + type: array + items: + type: string + description: >- + 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: + - example.com + - '*.substack.com' + - openai.com/blog required: - id - type: object @@ -7227,6 +10951,19 @@ components: description: Set to false to disable the response-healing plugin for this request. Defaults to true. required: - id + - type: object + properties: + id: + type: string + enum: + - context-compression + enabled: + type: boolean + description: Set to false to disable the context-compression plugin for this request. Defaults to true. + engine: + $ref: '#/components/schemas/ContextCompressionEngine' + required: + - id description: Plugins you want to enable for this request, including their settings. route: type: string @@ -7272,11 +11009,8 @@ components: type: array items: type: string - output_config: - $ref: '#/components/schemas/AnthropicOutputConfig' required: - model - - max_tokens - messages description: Request schema for Anthropic Messages API endpoint example: @@ -7543,6 +11277,34 @@ components: type: video_url video_url: url: https://example.com/video.mp4 + ChatMessageContentItemFile: + type: object + properties: + type: + type: string + enum: + - file + file: + type: object + properties: + file_data: + type: string + description: File content as base64 data URL or URL + file_id: + type: string + description: File ID for previously uploaded files + filename: + type: string + description: Original filename + required: + - type + - file + description: File content part for document processing + example: + type: file + file: + file_data: https://example.com/document.pdf + filename: document.pdf ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/ChatMessageContentItemText' @@ -7556,6 +11318,7 @@ components: mapping: input_video: '#/components/schemas/ChatMessageContentItemVideoLegacy' video_url: '#/components/schemas/ChatMessageContentItemVideo' + - $ref: '#/components/schemas/ChatMessageContentItemFile' discriminator: propertyName: type description: Content part for chat completion messages @@ -7734,6 +11497,27 @@ components: example: - image_url: url: data:image/png;base64,iVBORw0KGgo... + ChatCompletionAudioOutput: + type: object + properties: + id: + type: string + description: Audio output identifier + expires_at: + type: number + description: Audio expiration timestamp + data: + type: string + description: Base64 encoded audio data + transcript: + type: string + description: Audio transcript + description: Audio output data or reference + example: + id: audio_abc123 + expires_at: 1677652400 + data: UklGRnoGAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQoGAACBhYqFbF1f + transcript: Hello! How can I help you today? AssistantMessage: type: object properties: @@ -7769,6 +11553,8 @@ components: $ref: '#/components/schemas/AssistantMessageReasoningDetails' images: $ref: '#/components/schemas/AssistantMessageImages' + audio: + $ref: '#/components/schemas/ChatCompletionAudioOutput' required: - role description: Assistant message for requests and responses @@ -7841,7 +11627,6 @@ components: description: Log probabilities for refusal tokens required: - content - - refusal description: Log probabilities for the completion example: content: @@ -7978,6 +11763,7 @@ components: - created - model - object + - system_fingerprint description: Chat completion response example: id: chatcmpl-123 @@ -8064,6 +11850,10 @@ components: description: Tool calls delta reasoning_details: $ref: '#/components/schemas/AssistantMessageReasoningDetails' + audio: + allOf: + - $ref: '#/components/schemas/ChatCompletionAudioOutput' + - description: Audio output data description: Delta changes in streaming response example: role: assistant @@ -8121,7 +11911,6 @@ components: - chat.completion.chunk system_fingerprint: type: string - nullable: true description: System fingerprint example: fp_44709d6fcb error: @@ -8440,91 +12229,331 @@ components: function: type: object properties: - name: + name: + type: string + description: Function name to call + example: get_weather + required: + - name + required: + - type + - function + description: Named tool choice for specific function + example: + type: function + function: + name: get_weather + ToolChoiceOption: + anyOf: + - type: string + enum: + - none + - type: string + enum: + - auto + - type: string + enum: + - required + - $ref: '#/components/schemas/NamedToolChoice' + description: Tool choice configuration + example: auto + DatetimeServerTool: + type: object + properties: + type: + type: string + enum: + - openrouter:datetime + parameters: + type: object + properties: + timezone: + type: string + description: IANA timezone name (e.g. "America/New_York"). Defaults to UTC. + example: America/New_York + required: + - type + description: 'OpenRouter built-in server tool: returns the current date and time' + example: + type: openrouter:datetime + parameters: + timezone: America/New_York + WebSearchServerTool: + type: object + properties: + type: + type: string + enum: + - openrouter:web_search + parameters: + type: object + properties: + engine: + type: string + enum: + - auto + - native + - exa + 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 (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. + example: auto + x-speakeasy-unknown-values: allow + max_results: + type: number + minimum: 1 + maximum: 25 + description: >- + Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. + example: 5 + max_total_results: + type: number + minimum: 1 + 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 + search_context_size: + type: string + enum: + - low + - medium + - high + 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. + x-speakeasy-unknown-values: allow + user_location: + type: object + properties: + type: + type: string + enum: + - approximate + city: + type: string + region: + type: string + country: + type: string + timezone: + type: string + description: Approximate user location for location-biased results. + allowed_domains: + type: array + items: + type: string + description: >- + Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search. + excluded_domains: + type: array + items: + type: string + description: >- + Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search. + required: + - type + description: 'OpenRouter built-in server tool: searches the web for current information' + example: + type: openrouter:web_search + parameters: + engine: auto + max_results: 5 + WebSearchShorthand: + type: object + properties: + type: + type: string + enum: + - web_search + - web_search_preview + - web_search_preview_2025_03_11 + - web_search_2025_08_26 + x-speakeasy-unknown-values: allow + engine: + type: string + enum: + - auto + - native + - exa + 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 (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. + example: auto + x-speakeasy-unknown-values: allow + max_results: + type: number + minimum: 1 + maximum: 25 + description: >- + Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. + example: 5 + max_total_results: + type: number + minimum: 1 + 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 + search_context_size: + type: string + enum: + - low + - medium + - high + 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. + x-speakeasy-unknown-values: allow + user_location: + type: object + properties: + type: + type: string + enum: + - approximate + city: + type: string + region: + type: string + country: + type: string + timezone: + type: string + description: Approximate user location for location-biased results. + allowed_domains: + type: array + items: + type: string + description: >- + Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search. + excluded_domains: + type: array + items: + type: string + description: >- + Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search. + parameters: + type: object + properties: + engine: type: string - description: Function name to call - example: get_weather - required: - - name + enum: + - auto + - native + - exa + 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 (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. + example: auto + x-speakeasy-unknown-values: allow + max_results: + type: number + minimum: 1 + maximum: 25 + description: >- + Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. + example: 5 + max_total_results: + type: number + minimum: 1 + 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 + search_context_size: + type: string + enum: + - low + - medium + - high + 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. + x-speakeasy-unknown-values: allow + user_location: + type: object + properties: + type: + type: string + enum: + - approximate + city: + type: string + region: + type: string + country: + type: string + timezone: + type: string + description: Approximate user location for location-biased results. + allowed_domains: + type: array + items: + type: string + description: >- + Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search. + excluded_domains: + type: array + items: + type: string + description: >- + Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search. required: - type - - function - description: Named tool choice for specific function - example: - type: function - function: - name: get_weather - ToolChoiceOption: - anyOf: - - type: string - enum: - - none - - type: string - enum: - - auto - - type: string - enum: - - required - - $ref: '#/components/schemas/NamedToolChoice' - description: Tool choice configuration - example: auto + description: Web search tool using OpenAI Responses API syntax. Automatically converted to openrouter:web_search. ToolDefinitionJson: - type: object - properties: - type: - type: string - enum: - - function - function: - type: object + anyOf: + - type: object properties: - name: - type: string - maxLength: 64 - description: Function name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars) - example: get_weather - description: + type: type: string - description: Function description for the model - example: Get the current weather for a location - parameters: - type: object - additionalProperties: - nullable: true - description: Function parameters as JSON Schema object - example: - type: object - properties: - location: - type: string - description: City name - required: - - location - strict: - type: boolean - nullable: true - description: Enable strict schema adherence - example: false - required: - - name - description: Function definition for tool calling - example: - name: get_weather - description: Get the current weather for a location - parameters: + enum: + - function + function: type: object properties: - location: + name: type: string - description: City name + maxLength: 64 + description: Function name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars) + example: get_weather + description: + type: string + description: Function description for the model + example: Get the current weather for a location + parameters: + type: object + additionalProperties: + nullable: true + description: Function parameters as JSON Schema object + example: + type: object + properties: + location: + type: string + description: City name + required: + - location + strict: + type: boolean + nullable: true + description: Enable strict schema adherence + example: false required: - - location - cache_control: - $ref: '#/components/schemas/ChatMessageContentItemCacheControl' - required: - - type - - function - description: Tool definition for function calling + - name + description: Function definition for tool calling + example: + name: get_weather + description: Get the current weather for a location + parameters: + type: object + properties: + location: + type: string + description: City name + required: + - location + cache_control: + $ref: '#/components/schemas/ChatMessageContentItemCacheControl' + required: + - type + - function + - $ref: '#/components/schemas/DatetimeServerTool' + - $ref: '#/components/schemas/WebSearchServerTool' + - $ref: '#/components/schemas/WebSearchShorthand' + description: Tool definition for function calling (regular function or OpenRouter built-in server tool) example: type: function function: @@ -8710,6 +12739,26 @@ components: type: string engine: $ref: '#/components/schemas/WebSearchEngine' + include_domains: + type: array + items: + type: string + description: >- + 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: + - example.com + - '*.substack.com' + - openai.com/blog + exclude_domains: + type: array + items: + type: string + description: >- + 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: + - example.com + - '*.substack.com' + - openai.com/blog required: - id - type: object @@ -8736,6 +12785,19 @@ components: description: Set to false to disable the response-healing plugin for this request. Defaults to true. required: - id + - type: object + properties: + id: + type: string + enum: + - context-compression + enabled: + type: boolean + description: Set to false to disable the context-compression plugin for this request. Defaults to true. + engine: + $ref: '#/components/schemas/ContextCompressionEngine' + required: + - id description: Plugins you want to enable for this request, including their settings. route: type: string @@ -8826,7 +12888,7 @@ components: type: number nullable: true minimum: 1 - description: Maximum tokens (deprecated, use max_completion_tokens) + description: 'Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16.' example: 100 metadata: type: object @@ -8956,11 +13018,29 @@ components: enum: - text - image + - audio x-speakeasy-unknown-values: allow - description: Output modalities for the response. Supported values are "text" and "image". + description: Output modalities for the response. Supported values are "text", "image", and "audio". example: - text - image + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + 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. required: - messages description: Chat completion request parameters @@ -9206,6 +13286,7 @@ components: - image - embeddings - audio + - video example: text x-speakeasy-unknown-values: allow ModelArchitecture: @@ -9356,17 +13437,34 @@ components: nullable: true minimum: 0 maximum: 1 + top_k: + type: integer + nullable: true + minimum: 0 frequency_penalty: type: number nullable: true minimum: -2 maximum: 2 + presence_penalty: + type: number + nullable: true + minimum: -2 + maximum: 2 + repetition_penalty: + type: number + nullable: true + minimum: 0 + maximum: 2 additionalProperties: false description: Default parameters for this model example: temperature: 0.7 top_p: 0.9 + top_k: 0 frequency_penalty: 0 + presence_penalty: 0 + repetition_penalty: 1 Model: type: object properties: @@ -9865,7 +13963,41 @@ components: p75: 38.5 p90: 28.3 p99: 15.1 - parameters: {AppIdentifier: {name: HTTP-Referer, in: header, schema: {type: string}, description: "The app identifier should be your app's URL and is used as the primary identifier for rankings.\nThis is used to track API usage per application.\n"}, AppDisplayName: {name: X-Title, in: header, schema: {type: string}, description: "The app display name allows you to customize how your app appears in OpenRouter's dashboard.\n"}} + ConflictResponseErrorData: + type: object + properties: + code: + type: integer + message: + type: string + metadata: + type: object + nullable: true + additionalProperties: + nullable: true + required: + - code + - message + description: Error data for ConflictResponse + example: + code: 409 + message: Resource conflict. Please try again later. + ConflictResponse: + type: object + properties: + error: + $ref: '#/components/schemas/ConflictResponseErrorData' + user_id: + type: string + nullable: true + required: + - error + description: Conflict - Resource conflict or concurrent modification + example: + error: + code: 409 + message: Resource conflict. Please try again later. + parameters: {AppIdentifier: {name: HTTP-Referer, in: header, schema: {type: string}, description: "The app identifier should be your app's URL and is used as the primary identifier for rankings.\nThis is used to track API usage per application.\n"}, AppDisplayName: {name: X-OpenRouter-Title, in: header, schema: {type: string}, description: "The app display name allows you to customize how your app appears in OpenRouter's dashboard.\n"}, AppCategories: {name: X-OpenRouter-Categories, in: header, schema: {type: string}, description: "Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.\n"}} securitySchemes: apiKey: type: http @@ -9988,6 +14120,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /messages: post: x-speakeasy-ignore: true @@ -10219,6 +14352,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /activity: get: tags: @@ -10291,6 +14425,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /chat/completions: post: x-speakeasy-group: chat @@ -10405,6 +14540,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /credits: get: x-speakeasy-name-override: getCredits @@ -10467,6 +14603,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /credits/coinbase: post: security: @@ -10592,6 +14729,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /embeddings: post: x-speakeasy-name-override: generate @@ -10799,6 +14937,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /embeddings/models: get: tags: @@ -10829,6 +14968,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /generation: get: tags: @@ -11056,6 +15196,7 @@ paths: - Together 2 - Ubicloud - 01.AI + - AkashML - AI21 - AionLabs - Alibaba @@ -11141,6 +15282,14 @@ paths: required: - status description: List of provider responses for this generation, including fallback attempts + user_agent: + type: string + nullable: true + description: User-Agent header from the request + http_referer: + type: string + nullable: true + description: Referer header from the request required: - id - upstream_id @@ -11176,6 +15325,8 @@ paths: - api_type - router - provider_responses + - user_agent + - http_referer description: Generation data required: - data @@ -11232,12 +15383,24 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /models/count: get: tags: - Models x-speakeasy-name-override: count summary: Get total count of available models + parameters: + - schema: + 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". + example: text + required: false + 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". + name: output_modalities + in: query responses: '200': description: Returns the total count of available models @@ -11245,6 +15408,12 @@ paths: application/json: schema: $ref: '#/components/schemas/ModelsCountResponse' + '400': + description: Bad Request - Invalid output_modalities value + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' '500': description: Internal Server Error content: @@ -11255,6 +15424,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /models: get: tags: @@ -11289,6 +15459,16 @@ paths: required: false name: supported_parameters in: query + - schema: + 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". + example: text + required: false + 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". + name: output_modalities + in: query responses: '200': description: Returns a list of models or RSS feed @@ -11312,6 +15492,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /models/user: get: tags: @@ -11351,6 +15532,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /models/{author}/{slug}/endpoints: get: tags: @@ -11396,6 +15578,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /endpoints/zdr: get: tags: @@ -11426,6 +15609,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /providers: get: tags: @@ -11490,6 +15674,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /keys: get: operationId: list @@ -11936,6 +16121,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /keys/{hash}: patch: x-speakeasy-name-override: update @@ -12436,6 +16622,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /guardrails: get: operationId: listGuardrails @@ -12516,6 +16703,14 @@ paths: - openai - anthropic - google + ignored_providers: + type: array + nullable: true + items: + type: string + description: List of provider IDs to exclude from routing + example: + - azure allowed_models: type: array nullable: true @@ -12554,6 +16749,7 @@ paths: - openai - anthropic - google + ignored_providers: null allowed_models: null enforce_zdr: false created_at: '2025-08-24T10:30:00Z' @@ -12577,6 +16773,7 @@ paths: - openai - anthropic - google + ignored_providers: null allowed_models: null enforce_zdr: false created_at: '2025-08-24T10:30:00Z' @@ -12648,6 +16845,15 @@ paths: - openai - anthropic - deepseek + ignored_providers: + type: array + nullable: true + items: + type: string + minItems: 1 + description: List of provider IDs to exclude from routing + example: + - azure allowed_models: type: array nullable: true @@ -12675,6 +16881,7 @@ paths: - openai - anthropic - deepseek + ignored_providers: null allowed_models: null enforce_zdr: false required: true @@ -12730,6 +16937,14 @@ paths: - openai - anthropic - google + ignored_providers: + type: array + nullable: true + items: + type: string + description: List of provider IDs to exclude from routing + example: + - azure allowed_models: type: array nullable: true @@ -12768,6 +16983,7 @@ paths: - openai - anthropic - google + ignored_providers: null allowed_models: null enforce_zdr: false created_at: '2025-08-24T10:30:00Z' @@ -12786,6 +17002,7 @@ paths: - openai - anthropic - google + ignored_providers: null allowed_models: null enforce_zdr: false created_at: '2025-08-24T10:30:00Z' @@ -12811,6 +17028,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /guardrails/{id}: get: operationId: getGuardrail @@ -12881,6 +17099,14 @@ paths: - openai - anthropic - google + ignored_providers: + type: array + nullable: true + items: + type: string + description: List of provider IDs to exclude from routing + example: + - azure allowed_models: type: array nullable: true @@ -12919,6 +17145,7 @@ paths: - openai - anthropic - google + ignored_providers: null allowed_models: null enforce_zdr: false created_at: '2025-08-24T10:30:00Z' @@ -12937,6 +17164,7 @@ paths: - openai - anthropic - google + ignored_providers: null allowed_models: null enforce_zdr: false created_at: '2025-08-24T10:30:00Z' @@ -13022,6 +17250,15 @@ paths: - openai - anthropic - deepseek + ignored_providers: + type: array + nullable: true + items: + type: string + minItems: 1 + description: List of provider IDs to exclude from routing + example: + - azure allowed_models: type: array nullable: true @@ -13094,6 +17331,14 @@ paths: - openai - anthropic - google + ignored_providers: + type: array + nullable: true + items: + type: string + description: List of provider IDs to exclude from routing + example: + - azure allowed_models: type: array nullable: true @@ -13132,6 +17377,7 @@ paths: - openai - anthropic - google + ignored_providers: null allowed_models: null enforce_zdr: false created_at: '2025-08-24T10:30:00Z' @@ -13148,6 +17394,7 @@ paths: reset_interval: weekly allowed_providers: - openai + ignored_providers: null allowed_models: null enforce_zdr: true created_at: '2025-08-24T10:30:00Z' @@ -13231,6 +17478,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /guardrails/assignments/keys: get: operationId: listKeyAssignments @@ -13332,6 +17580,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /guardrails/assignments/members: get: operationId: listMemberAssignments @@ -13428,6 +17677,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /guardrails/{id}/assignments/keys: get: operationId: listGuardrailKeyAssignments @@ -13618,6 +17868,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /guardrails/{id}/assignments/members: get: operationId: listGuardrailMemberAssignments @@ -13804,6 +18055,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /guardrails/{id}/assignments/keys/remove: post: operationId: bulkUnassignKeysFromGuardrail @@ -13882,6 +18134,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /guardrails/{id}/assignments/members/remove: post: operationId: bulkUnassignMembersFromGuardrail @@ -13961,6 +18214,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /key: get: operationId: getCurrentKey @@ -14160,6 +18414,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /auth/keys: post: operationId: exchangeAuthCodeForAPIKey @@ -14241,6 +18496,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /auth/keys/code: post: x-speakeasy-name-override: createAuthCode @@ -14359,6 +18615,12 @@ paths: application/json: schema: $ref: '#/components/schemas/UnauthorizedResponse' + '409': + description: Conflict - App upsert conflict during auth code creation + content: + application/json: + schema: + $ref: '#/components/schemas/ConflictResponse' '500': description: Internal Server Error - Unexpected server error content: @@ -14369,6 +18631,7 @@ paths: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" tags: - name: API Keys description: API key management endpoints @@ -14406,3 +18669,4 @@ x-speakeasy-globals: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" diff --git a/.speakeasy/overlays/add-headers.overlay.yaml b/.speakeasy/overlays/add-headers.overlay.yaml index a6a3474..91f56e8 100644 --- a/.speakeasy/overlays/add-headers.overlay.yaml +++ b/.speakeasy/overlays/add-headers.overlay.yaml @@ -1,17 +1,18 @@ overlay: 1.0.0 x-speakeasy-jsonpath: rfc9535 info: - title: Add HTTP-Referer and X-Title as global parameters + title: Add HTTP-Referer and X-OpenRouter-Title as global parameters version: 0.0.0 actions: # Add global parameters for app identification - target: $ - description: Add x-speakeasy-globals for HTTP-Referer and X-Title headers + description: Add x-speakeasy-globals for HTTP-Referer, X-OpenRouter-Title, and X-OpenRouter-Categories headers update: x-speakeasy-globals: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" # Add component parameters - target: $.components @@ -27,12 +28,19 @@ actions: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. AppDisplayName: - name: X-Title + name: X-OpenRouter-Title in: header schema: type: string description: | The app display name allows you to customize how your app appears in OpenRouter's dashboard. + AppCategories: + name: X-OpenRouter-Categories + in: header + schema: + type: string + description: | + Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. # Add header parameters to all paths so Speakeasy matches them with globals - target: $.paths[*] @@ -41,3 +49,4 @@ actions: parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 5d22d6c..6f5e53a 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -8,8 +8,8 @@ sources: - latest OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:8a64fb1c1030c87db14bca3af4883e06b9d5853c153a5fd0f2e4c15166e034dd - sourceBlobDigest: sha256:7f6d7d20424f27ec13e6ae45a1599dab23f2573a69d634b1bb1c346f8a328ae9 + sourceRevisionDigest: sha256:33bc86b7a9b24082a410a8b5cbdd05ee359c9be2c88a2947893942d6bca20dca + sourceBlobDigest: sha256:63c840be5dfe448c1d3f6ec9c15e1d92d117b35cccd134b1e736e1fb563d013d tags: - latest - main @@ -18,10 +18,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:8a64fb1c1030c87db14bca3af4883e06b9d5853c153a5fd0f2e4c15166e034dd - sourceBlobDigest: sha256:7f6d7d20424f27ec13e6ae45a1599dab23f2573a69d634b1bb1c346f8a328ae9 + sourceRevisionDigest: sha256:33bc86b7a9b24082a410a8b5cbdd05ee359c9be2c88a2947893942d6bca20dca + sourceBlobDigest: sha256:63c840be5dfe448c1d3f6ec9c15e1d92d117b35cccd134b1e736e1fb563d013d codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:349390cb3f04fb4fdd6292a33ff1ee0659846fe1e3f03bede5bf13f3e70c447f + codeSamplesRevisionDigest: sha256:b23dcc24419d8d006315e89e7a2fe131e28d72f19edb4fa920c97658e9e78073 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.666.0 diff --git a/README-PYPI.md b/README-PYPI.md index 8dd9349..5f7e784 100644 --- a/README-PYPI.md +++ b/README-PYPI.md @@ -183,7 +183,8 @@ def main(): with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: # Rest of application here... @@ -194,7 +195,8 @@ async def amain(): async with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: # Rest of application here... diff --git a/README.md b/README.md index 8dd9349..5f7e784 100644 --- a/README.md +++ b/README.md @@ -183,7 +183,8 @@ def main(): with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: # Rest of application here... @@ -194,7 +195,8 @@ async def amain(): async with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: # Rest of application here... diff --git a/USAGE.md b/USAGE.md index 96d2883..dfa6a25 100644 --- a/USAGE.md +++ b/USAGE.md @@ -7,7 +7,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -33,7 +34,8 @@ async def main(): async with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: diff --git a/docs/components/action.md b/docs/components/action.md new file mode 100644 index 0000000..7e76bbe --- /dev/null +++ b/docs/components/action.md @@ -0,0 +1,23 @@ +# Action + + +## Supported Types + +### `components.ActionSearch` + +```python +value: components.ActionSearch = /* values here */ +``` + +### `components.ActionOpenPage` + +```python +value: components.ActionOpenPage = /* values here */ +``` + +### `components.ActionFindInPage` + +```python +value: components.ActionFindInPage = /* values here */ +``` + diff --git a/docs/components/actionfindinpage.md b/docs/components/actionfindinpage.md new file mode 100644 index 0000000..7ddbd3d --- /dev/null +++ b/docs/components/actionfindinpage.md @@ -0,0 +1,10 @@ +# ActionFindInPage + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `type` | [components.TypeFindInPage](../components/typefindinpage.md) | :heavy_check_mark: | N/A | +| `pattern` | *str* | :heavy_check_mark: | N/A | +| `url` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/actionopenpage.md b/docs/components/actionopenpage.md new file mode 100644 index 0000000..0401058 --- /dev/null +++ b/docs/components/actionopenpage.md @@ -0,0 +1,9 @@ +# ActionOpenPage + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `type` | [components.TypeOpenPage](../components/typeopenpage.md) | :heavy_check_mark: | N/A | +| `url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/actionsearch.md b/docs/components/actionsearch.md new file mode 100644 index 0000000..fbb7847 --- /dev/null +++ b/docs/components/actionsearch.md @@ -0,0 +1,11 @@ +# ActionSearch + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `type` | [components.TypeSearch](../components/typesearch.md) | :heavy_check_mark: | N/A | +| `query` | *str* | :heavy_check_mark: | N/A | +| `queries` | List[*str*] | :heavy_minus_sign: | N/A | +| `sources` | List[[components.Source](../components/source.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/allowedtools.md b/docs/components/allowedtools.md new file mode 100644 index 0000000..f8ca32c --- /dev/null +++ b/docs/components/allowedtools.md @@ -0,0 +1,9 @@ +# AllowedTools + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `tool_names` | List[*str*] | :heavy_minus_sign: | N/A | +| `read_only` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/always.md b/docs/components/always.md new file mode 100644 index 0000000..a7a7fd1 --- /dev/null +++ b/docs/components/always.md @@ -0,0 +1,8 @@ +# Always + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `tool_names` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/assistantmessage.md b/docs/components/assistantmessage.md index 49cee5c..bd89d45 100644 --- a/docs/components/assistantmessage.md +++ b/docs/components/assistantmessage.md @@ -5,13 +5,14 @@ Assistant message for requests and responses ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `role` | [components.AssistantMessageRole](../components/assistantmessagerole.md) | :heavy_check_mark: | N/A | | -| `content` | [OptionalNullable[components.AssistantMessageContent]](../components/assistantmessagecontent.md) | :heavy_minus_sign: | Assistant message content | | -| `name` | *Optional[str]* | :heavy_minus_sign: | Optional name for the assistant | | -| `tool_calls` | List[[components.ChatMessageToolCall](../components/chatmessagetoolcall.md)] | :heavy_minus_sign: | Tool calls made by the assistant | | -| `refusal` | *OptionalNullable[str]* | :heavy_minus_sign: | Refusal message if content was refused | | -| `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | Reasoning output | | -| `reasoning_details` | List[[components.ReasoningDetailUnion](../components/reasoningdetailunion.md)] | :heavy_minus_sign: | Reasoning details for extended thinking models | | -| `images` | List[[components.AssistantMessageImages](../components/assistantmessageimages.md)] | :heavy_minus_sign: | Generated images from image generation models | [
{
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgo..."
}
}
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `role` | [components.AssistantMessageRole](../components/assistantmessagerole.md) | :heavy_check_mark: | N/A | | +| `content` | [OptionalNullable[components.AssistantMessageContent]](../components/assistantmessagecontent.md) | :heavy_minus_sign: | Assistant message content | | +| `name` | *Optional[str]* | :heavy_minus_sign: | Optional name for the assistant | | +| `tool_calls` | List[[components.ChatMessageToolCall](../components/chatmessagetoolcall.md)] | :heavy_minus_sign: | Tool calls made by the assistant | | +| `refusal` | *OptionalNullable[str]* | :heavy_minus_sign: | Refusal message if content was refused | | +| `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | Reasoning output | | +| `reasoning_details` | List[[components.ReasoningDetailUnion](../components/reasoningdetailunion.md)] | :heavy_minus_sign: | Reasoning details for extended thinking models | | +| `images` | List[[components.AssistantMessageImages](../components/assistantmessageimages.md)] | :heavy_minus_sign: | Generated images from image generation models | [
{
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgo..."
}
}
] | +| `audio` | [Optional[components.ChatCompletionAudioOutput]](../components/chatcompletionaudiooutput.md) | :heavy_minus_sign: | Audio output data or reference | {
"id": "audio_abc123",
"expires_at": 1677652400,
"data": "UklGRnoGAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQoGAACBhYqFbF1f",
"transcript": "Hello! How can I help you today?"
} | \ No newline at end of file diff --git a/docs/components/background.md b/docs/components/background.md new file mode 100644 index 0000000..62f0f52 --- /dev/null +++ b/docs/components/background.md @@ -0,0 +1,10 @@ +# Background + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `TRANSPARENT` | transparent | +| `OPAQUE` | opaque | +| `AUTO` | auto | \ No newline at end of file diff --git a/docs/components/by.md b/docs/components/by.md index 87730c5..557c891 100644 --- a/docs/components/by.md +++ b/docs/components/by.md @@ -9,4 +9,5 @@ The provider sorting strategy (price, throughput, latency) | ------------ | ------------ | | `PRICE` | price | | `THROUGHPUT` | throughput | -| `LATENCY` | latency | \ No newline at end of file +| `LATENCY` | latency | +| `EXACTO` | exacto | \ No newline at end of file diff --git a/docs/components/cachecontrol.md b/docs/components/cachecontrol.md new file mode 100644 index 0000000..e603df5 --- /dev/null +++ b/docs/components/cachecontrol.md @@ -0,0 +1,11 @@ +# CacheControl + +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. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `type` | [components.ChatGenerationParamsType](../components/chatgenerationparamstype.md) | :heavy_check_mark: | N/A | +| `ttl` | [Optional[components.ChatGenerationParamsTTL]](../components/chatgenerationparamsttl.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/chatcompletionaudiooutput.md b/docs/components/chatcompletionaudiooutput.md new file mode 100644 index 0000000..1183fb4 --- /dev/null +++ b/docs/components/chatcompletionaudiooutput.md @@ -0,0 +1,13 @@ +# ChatCompletionAudioOutput + +Audio output data or reference + + +## Fields + +| Field | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `id` | *Optional[str]* | :heavy_minus_sign: | Audio output identifier | +| `expires_at` | *Optional[float]* | :heavy_minus_sign: | Audio expiration timestamp | +| `data` | *Optional[str]* | :heavy_minus_sign: | Base64 encoded audio data | +| `transcript` | *Optional[str]* | :heavy_minus_sign: | Audio transcript | \ No newline at end of file diff --git a/docs/components/chatgenerationparams.md b/docs/components/chatgenerationparams.md index 871f7ac..ff592d1 100644 --- a/docs/components/chatgenerationparams.md +++ b/docs/components/chatgenerationparams.md @@ -20,7 +20,7 @@ Chat completion request parameters | `logprobs` | *OptionalNullable[bool]* | :heavy_minus_sign: | Return log probabilities | false | | `top_logprobs` | *OptionalNullable[float]* | :heavy_minus_sign: | Number of top log probabilities to return (0-20) | 5 | | `max_completion_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum tokens in completion | 100 | -| `max_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum tokens (deprecated, use max_completion_tokens) | 100 | +| `max_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16. | 100 | | `metadata` | Dict[str, *str*] | :heavy_minus_sign: | Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) | {
"user_id": "user-123",
"session_id": "session-456"
} | | `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Presence penalty (-2.0 to 2.0) | 0 | | `reasoning` | [Optional[components.Reasoning]](../components/reasoning.md) | :heavy_minus_sign: | Configuration options for reasoning models | {
"effort": "medium",
"summary": "concise"
} | @@ -36,4 +36,5 @@ Chat completion request parameters | `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | Nucleus sampling parameter (0-1) | 1 | | `debug` | [Optional[components.DebugOptions]](../components/debugoptions.md) | :heavy_minus_sign: | Debug options for inspecting request transformations (streaming only) | {
"echo_upstream_body": true
} | | `image_config` | Dict[str, [components.ChatGenerationParamsImageConfig](../components/chatgenerationparamsimageconfig.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"
} | -| `modalities` | List[[components.Modality](../components/modality.md)] | :heavy_minus_sign: | Output modalities for the response. Supported values are "text" and "image". | [
"text",
"image"
] | \ No newline at end of file +| `modalities` | List[[components.Modality](../components/modality.md)] | :heavy_minus_sign: | Output modalities for the response. Supported values are "text", "image", and "audio". | [
"text",
"image"
] | +| `cache_control` | [Optional[components.CacheControl]](../components/cachecontrol.md) | :heavy_minus_sign: | 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. | | \ No newline at end of file diff --git a/docs/components/chatgenerationparamsby.md b/docs/components/chatgenerationparamsby.md index 6952f17..ae1595b 100644 --- a/docs/components/chatgenerationparamsby.md +++ b/docs/components/chatgenerationparamsby.md @@ -9,4 +9,5 @@ The provider sorting strategy (price, throughput, latency) | ------------ | ------------ | | `PRICE` | price | | `THROUGHPUT` | throughput | -| `LATENCY` | latency | \ No newline at end of file +| `LATENCY` | latency | +| `EXACTO` | exacto | \ No newline at end of file diff --git a/docs/components/chatgenerationparamsidcontextcompression.md b/docs/components/chatgenerationparamsidcontextcompression.md new file mode 100644 index 0000000..da0d579 --- /dev/null +++ b/docs/components/chatgenerationparamsidcontextcompression.md @@ -0,0 +1,8 @@ +# ChatGenerationParamsIDContextCompression + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `CONTEXT_COMPRESSION` | context-compression | \ No newline at end of file diff --git a/docs/components/chatgenerationparamsplugincontextcompression.md b/docs/components/chatgenerationparamsplugincontextcompression.md new file mode 100644 index 0000000..c20aac9 --- /dev/null +++ b/docs/components/chatgenerationparamsplugincontextcompression.md @@ -0,0 +1,10 @@ +# ChatGenerationParamsPluginContextCompression + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `id` | [components.ChatGenerationParamsIDContextCompression](../components/chatgenerationparamsidcontextcompression.md) | :heavy_check_mark: | N/A | +| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the context-compression plugin for this request. Defaults to true. | +| `engine` | [Optional[components.ContextCompressionEngine]](../components/contextcompressionengine.md) | :heavy_minus_sign: | The compression engine to use. Defaults to "middle-out". | \ No newline at end of file diff --git a/docs/components/chatgenerationparamspluginunion.md b/docs/components/chatgenerationparamspluginunion.md index 5457d76..84fa3ed 100644 --- a/docs/components/chatgenerationparamspluginunion.md +++ b/docs/components/chatgenerationparamspluginunion.md @@ -33,3 +33,9 @@ value: components.ChatGenerationParamsPluginFileParser = /* values here */ value: components.ChatGenerationParamsPluginResponseHealing = /* values here */ ``` +### `components.ChatGenerationParamsPluginContextCompression` + +```python +value: components.ChatGenerationParamsPluginContextCompression = /* values here */ +``` + diff --git a/docs/components/chatgenerationparamspluginweb.md b/docs/components/chatgenerationparamspluginweb.md index e8c97d0..e7e84b0 100644 --- a/docs/components/chatgenerationparamspluginweb.md +++ b/docs/components/chatgenerationparamspluginweb.md @@ -3,10 +3,12 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `id` | [components.ChatGenerationParamsIDWeb](../components/chatgenerationparamsidweb.md) | :heavy_check_mark: | N/A | -| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the web-search plugin for this request. Defaults to true. | -| `max_results` | *Optional[float]* | :heavy_minus_sign: | N/A | -| `search_prompt` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `engine` | [Optional[components.WebSearchEngine]](../components/websearchengine.md) | :heavy_minus_sign: | The search engine to use for web search. | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | [components.ChatGenerationParamsIDWeb](../components/chatgenerationparamsidweb.md) | :heavy_check_mark: | N/A | | +| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the web-search plugin for this request. Defaults to true. | | +| `max_results` | *Optional[float]* | :heavy_minus_sign: | N/A | | +| `search_prompt` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `engine` | [Optional[components.WebSearchEngine]](../components/websearchengine.md) | :heavy_minus_sign: | The search engine to use for web search. | | +| `include_domains` | List[*str*] | :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"
] | +| `exclude_domains` | List[*str*] | :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"
] | \ No newline at end of file diff --git a/docs/components/chatgenerationparamsprovidersort.md b/docs/components/chatgenerationparamsprovidersort.md index dad38c3..53decc0 100644 --- a/docs/components/chatgenerationparamsprovidersort.md +++ b/docs/components/chatgenerationparamsprovidersort.md @@ -9,4 +9,5 @@ The provider sorting strategy (price, throughput, latency) | ------------ | ------------ | | `PRICE` | price | | `THROUGHPUT` | throughput | -| `LATENCY` | latency | \ No newline at end of file +| `LATENCY` | latency | +| `EXACTO` | exacto | \ No newline at end of file diff --git a/docs/components/chatgenerationparamsprovidersortconfigenum.md b/docs/components/chatgenerationparamsprovidersortconfigenum.md index 8117c95..e120ca2 100644 --- a/docs/components/chatgenerationparamsprovidersortconfigenum.md +++ b/docs/components/chatgenerationparamsprovidersortconfigenum.md @@ -7,4 +7,5 @@ | ------------ | ------------ | | `PRICE` | price | | `THROUGHPUT` | throughput | -| `LATENCY` | latency | \ No newline at end of file +| `LATENCY` | latency | +| `EXACTO` | exacto | \ No newline at end of file diff --git a/docs/components/chatgenerationparamssortenum.md b/docs/components/chatgenerationparamssortenum.md index eac8dc3..f396d89 100644 --- a/docs/components/chatgenerationparamssortenum.md +++ b/docs/components/chatgenerationparamssortenum.md @@ -7,4 +7,5 @@ | ------------ | ------------ | | `PRICE` | price | | `THROUGHPUT` | throughput | -| `LATENCY` | latency | \ No newline at end of file +| `LATENCY` | latency | +| `EXACTO` | exacto | \ No newline at end of file diff --git a/docs/components/ttl.md b/docs/components/chatgenerationparamsttl.md similarity index 79% rename from docs/components/ttl.md rename to docs/components/chatgenerationparamsttl.md index 0cbc7f3..4272a3b 100644 --- a/docs/components/ttl.md +++ b/docs/components/chatgenerationparamsttl.md @@ -1,4 +1,4 @@ -# TTL +# ChatGenerationParamsTTL ## Values diff --git a/docs/components/chatgenerationparamstype.md b/docs/components/chatgenerationparamstype.md new file mode 100644 index 0000000..1e20885 --- /dev/null +++ b/docs/components/chatgenerationparamstype.md @@ -0,0 +1,8 @@ +# ChatGenerationParamsType + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `EPHEMERAL` | ephemeral | \ No newline at end of file diff --git a/docs/components/chatmessagecontentitem.md b/docs/components/chatmessagecontentitem.md index 197da42..f379042 100644 --- a/docs/components/chatmessagecontentitem.md +++ b/docs/components/chatmessagecontentitem.md @@ -29,3 +29,9 @@ value: components.ChatMessageContentItemAudio = /* values here */ value: components.ChatMessageContentItem1 = /* values here */ ``` +### `components.ChatMessageContentItemFile` + +```python +value: components.ChatMessageContentItemFile = /* values here */ +``` + diff --git a/docs/components/chatmessagecontentitemcachecontrol.md b/docs/components/chatmessagecontentitemcachecontrol.md index df820de..4f7ce60 100644 --- a/docs/components/chatmessagecontentitemcachecontrol.md +++ b/docs/components/chatmessagecontentitemcachecontrol.md @@ -5,7 +5,7 @@ Cache control for the content part ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `type` | [components.ChatMessageContentItemCacheControlType](../components/chatmessagecontentitemcachecontroltype.md) | :heavy_check_mark: | N/A | -| `ttl` | [Optional[components.TTL]](../components/ttl.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `type` | [components.ChatMessageContentItemCacheControlType](../components/chatmessagecontentitemcachecontroltype.md) | :heavy_check_mark: | N/A | +| `ttl` | [Optional[components.ChatMessageContentItemCacheControlTTL]](../components/chatmessagecontentitemcachecontrolttl.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/chatmessagecontentitemcachecontrolttl.md b/docs/components/chatmessagecontentitemcachecontrolttl.md new file mode 100644 index 0000000..5567e47 --- /dev/null +++ b/docs/components/chatmessagecontentitemcachecontrolttl.md @@ -0,0 +1,9 @@ +# ChatMessageContentItemCacheControlTTL + + +## Values + +| Name | Value | +| ------- | ------- | +| `FIVEM` | 5m | +| `ONEH` | 1h | \ No newline at end of file diff --git a/docs/components/chatmessagecontentitemfile.md b/docs/components/chatmessagecontentitemfile.md new file mode 100644 index 0000000..a8aa6d2 --- /dev/null +++ b/docs/components/chatmessagecontentitemfile.md @@ -0,0 +1,11 @@ +# ChatMessageContentItemFile + +File content part for document processing + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `type` | [components.ChatMessageContentItemFileType](../components/chatmessagecontentitemfiletype.md) | :heavy_check_mark: | N/A | +| `file` | [components.File](../components/file.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/chatmessagecontentitemfiletype.md b/docs/components/chatmessagecontentitemfiletype.md new file mode 100644 index 0000000..2ce7058 --- /dev/null +++ b/docs/components/chatmessagecontentitemfiletype.md @@ -0,0 +1,8 @@ +# ChatMessageContentItemFileType + + +## Values + +| Name | Value | +| ------ | ------ | +| `FILE` | file | \ No newline at end of file diff --git a/docs/components/chatmessagetokenlogprobs.md b/docs/components/chatmessagetokenlogprobs.md index 0b8961f..a59f8e4 100644 --- a/docs/components/chatmessagetokenlogprobs.md +++ b/docs/components/chatmessagetokenlogprobs.md @@ -8,4 +8,4 @@ Log probabilities for the completion | Field | Type | Required | Description | | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | | `content` | List[[components.ChatMessageTokenLogprob](../components/chatmessagetokenlogprob.md)] | :heavy_check_mark: | Log probabilities for content tokens | -| `refusal` | List[[components.ChatMessageTokenLogprob](../components/chatmessagetokenlogprob.md)] | :heavy_check_mark: | Log probabilities for refusal tokens | \ No newline at end of file +| `refusal` | List[[components.ChatMessageTokenLogprob](../components/chatmessagetokenlogprob.md)] | :heavy_minus_sign: | Log probabilities for refusal tokens | \ No newline at end of file diff --git a/docs/components/chatresponse.md b/docs/components/chatresponse.md index 50e5966..a03c9d9 100644 --- a/docs/components/chatresponse.md +++ b/docs/components/chatresponse.md @@ -12,5 +12,5 @@ Chat completion response | `created` | *float* | :heavy_check_mark: | Unix timestamp of creation | 1677652288 | | `model` | *str* | :heavy_check_mark: | Model used for completion | openai/gpt-4 | | `object` | [components.ChatResponseObject](../components/chatresponseobject.md) | :heavy_check_mark: | N/A | | -| `system_fingerprint` | *OptionalNullable[str]* | :heavy_minus_sign: | System fingerprint | fp_44709d6fcb | +| `system_fingerprint` | *Nullable[str]* | :heavy_check_mark: | System fingerprint | fp_44709d6fcb | | `usage` | [Optional[components.ChatGenerationTokenUsage]](../components/chatgenerationtokenusage.md) | :heavy_minus_sign: | Token usage statistics | {
"completion_tokens": 15,
"prompt_tokens": 10,
"total_tokens": 25,
"completion_tokens_details": {
"reasoning_tokens": 5
},
"prompt_tokens_details": {
"cached_tokens": 2
}
} | \ No newline at end of file diff --git a/docs/components/chatstreamingmessagechunk.md b/docs/components/chatstreamingmessagechunk.md index a91123f..343048a 100644 --- a/docs/components/chatstreamingmessagechunk.md +++ b/docs/components/chatstreamingmessagechunk.md @@ -5,11 +5,12 @@ Delta changes in streaming response ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `role` | [Optional[components.ChatStreamingMessageChunkRole]](../components/chatstreamingmessagechunkrole.md) | :heavy_minus_sign: | The role of the message author | assistant | -| `content` | *OptionalNullable[str]* | :heavy_minus_sign: | Message content delta | Hello | -| `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | Reasoning content delta | I need to | -| `refusal` | *OptionalNullable[str]* | :heavy_minus_sign: | Refusal message delta | | -| `tool_calls` | List[[components.ChatStreamingMessageToolCall](../components/chatstreamingmessagetoolcall.md)] | :heavy_minus_sign: | Tool calls delta | | -| `reasoning_details` | List[[components.ReasoningDetailUnion](../components/reasoningdetailunion.md)] | :heavy_minus_sign: | Reasoning details for extended thinking models | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `role` | [Optional[components.ChatStreamingMessageChunkRole]](../components/chatstreamingmessagechunkrole.md) | :heavy_minus_sign: | The role of the message author | assistant | +| `content` | *OptionalNullable[str]* | :heavy_minus_sign: | Message content delta | Hello | +| `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | Reasoning content delta | I need to | +| `refusal` | *OptionalNullable[str]* | :heavy_minus_sign: | Refusal message delta | | +| `tool_calls` | List[[components.ChatStreamingMessageToolCall](../components/chatstreamingmessagetoolcall.md)] | :heavy_minus_sign: | Tool calls delta | | +| `reasoning_details` | List[[components.ReasoningDetailUnion](../components/reasoningdetailunion.md)] | :heavy_minus_sign: | Reasoning details for extended thinking models | | +| `audio` | [Optional[components.ChatCompletionAudioOutput]](../components/chatcompletionaudiooutput.md) | :heavy_minus_sign: | N/A | {
"id": "audio_abc123",
"expires_at": 1677652400,
"data": "UklGRnoGAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQoGAACBhYqFbF1f",
"transcript": "Hello! How can I help you today?"
} | \ No newline at end of file diff --git a/docs/components/chatstreamingresponsechunk.md b/docs/components/chatstreamingresponsechunk.md index 1d7647e..80adc82 100644 --- a/docs/components/chatstreamingresponsechunk.md +++ b/docs/components/chatstreamingresponsechunk.md @@ -12,6 +12,6 @@ Streaming chat completion chunk | `created` | *float* | :heavy_check_mark: | Unix timestamp of creation | 1677652288 | | `model` | *str* | :heavy_check_mark: | Model used for completion | openai/gpt-4 | | `object` | [components.ChatStreamingResponseChunkObject](../components/chatstreamingresponsechunkobject.md) | :heavy_check_mark: | N/A | | -| `system_fingerprint` | *OptionalNullable[str]* | :heavy_minus_sign: | System fingerprint | fp_44709d6fcb | +| `system_fingerprint` | *Optional[str]* | :heavy_minus_sign: | System fingerprint | fp_44709d6fcb | | `error` | [Optional[components.Error]](../components/error.md) | :heavy_minus_sign: | Error information | {
"message": "Rate limit exceeded",
"code": 429
} | | `usage` | [Optional[components.ChatGenerationTokenUsage]](../components/chatgenerationtokenusage.md) | :heavy_minus_sign: | Token usage statistics | {
"completion_tokens": 15,
"prompt_tokens": 10,
"total_tokens": 25,
"completion_tokens_details": {
"reasoning_tokens": 5
},
"prompt_tokens_details": {
"cached_tokens": 2
}
} | \ No newline at end of file diff --git a/docs/components/compoundfilter.md b/docs/components/compoundfilter.md new file mode 100644 index 0000000..a6cbe94 --- /dev/null +++ b/docs/components/compoundfilter.md @@ -0,0 +1,11 @@ +# CompoundFilter + +A compound filter that combines multiple comparison or compound filters + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `type` | [components.CompoundFilterType](../components/compoundfiltertype.md) | :heavy_check_mark: | N/A | +| `filters` | List[Dict[str, *Nullable[Any]*]] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/compoundfiltertype.md b/docs/components/compoundfiltertype.md new file mode 100644 index 0000000..162ed71 --- /dev/null +++ b/docs/components/compoundfiltertype.md @@ -0,0 +1,9 @@ +# CompoundFilterType + + +## Values + +| Name | Value | +| ----- | ----- | +| `AND` | and | +| `OR` | or | \ No newline at end of file diff --git a/docs/components/conflictresponseerrordata.md b/docs/components/conflictresponseerrordata.md new file mode 100644 index 0000000..fb319b9 --- /dev/null +++ b/docs/components/conflictresponseerrordata.md @@ -0,0 +1,12 @@ +# ConflictResponseErrorData + +Error data for ConflictResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `code` | *int* | :heavy_check_mark: | N/A | +| `message` | *str* | :heavy_check_mark: | N/A | +| `metadata` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/connectorid.md b/docs/components/connectorid.md new file mode 100644 index 0000000..673ad13 --- /dev/null +++ b/docs/components/connectorid.md @@ -0,0 +1,15 @@ +# ConnectorID + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `CONNECTOR_DROPBOX` | connector_dropbox | +| `CONNECTOR_GMAIL` | connector_gmail | +| `CONNECTOR_GOOGLECALENDAR` | connector_googlecalendar | +| `CONNECTOR_GOOGLEDRIVE` | connector_googledrive | +| `CONNECTOR_MICROSOFTTEAMS` | connector_microsoftteams | +| `CONNECTOR_OUTLOOKCALENDAR` | connector_outlookcalendar | +| `CONNECTOR_OUTLOOKEMAIL` | connector_outlookemail | +| `CONNECTOR_SHAREPOINT` | connector_sharepoint | \ No newline at end of file diff --git a/docs/components/container.md b/docs/components/container.md new file mode 100644 index 0000000..df11163 --- /dev/null +++ b/docs/components/container.md @@ -0,0 +1,17 @@ +# Container + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `components.ContainerAuto` + +```python +value: components.ContainerAuto = /* values here */ +``` + diff --git a/docs/components/containerauto.md b/docs/components/containerauto.md new file mode 100644 index 0000000..2ccdc1e --- /dev/null +++ b/docs/components/containerauto.md @@ -0,0 +1,10 @@ +# ContainerAuto + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `type` | [components.ContainerType](../components/containertype.md) | :heavy_check_mark: | N/A | +| `file_ids` | List[*str*] | :heavy_minus_sign: | N/A | +| `memory_limit` | [OptionalNullable[components.MemoryLimit]](../components/memorylimit.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/containertype.md b/docs/components/containertype.md new file mode 100644 index 0000000..9be5b3c --- /dev/null +++ b/docs/components/containertype.md @@ -0,0 +1,8 @@ +# ContainerType + + +## Values + +| Name | Value | +| ------ | ------ | +| `AUTO` | auto | \ No newline at end of file diff --git a/docs/components/contextcompressionengine.md b/docs/components/contextcompressionengine.md new file mode 100644 index 0000000..aa78a36 --- /dev/null +++ b/docs/components/contextcompressionengine.md @@ -0,0 +1,10 @@ +# ContextCompressionEngine + +The compression engine to use. Defaults to "middle-out". + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `MIDDLE_OUT` | middle-out | \ No newline at end of file diff --git a/docs/components/datetimeservertool.md b/docs/components/datetimeservertool.md new file mode 100644 index 0000000..7c2623f --- /dev/null +++ b/docs/components/datetimeservertool.md @@ -0,0 +1,11 @@ +# DatetimeServerTool + +OpenRouter built-in server tool: returns the current date and time + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `type` | [components.DatetimeServerToolType](../components/datetimeservertooltype.md) | :heavy_check_mark: | N/A | +| `parameters` | [Optional[components.DatetimeServerToolParameters]](../components/datetimeservertoolparameters.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/datetimeservertoolparameters.md b/docs/components/datetimeservertoolparameters.md new file mode 100644 index 0000000..5fd2e47 --- /dev/null +++ b/docs/components/datetimeservertoolparameters.md @@ -0,0 +1,8 @@ +# DatetimeServerToolParameters + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `timezone` | *Optional[str]* | :heavy_minus_sign: | IANA timezone name (e.g. "America/New_York"). Defaults to UTC. | America/New_York | \ No newline at end of file diff --git a/docs/components/datetimeservertooltype.md b/docs/components/datetimeservertooltype.md new file mode 100644 index 0000000..870296b --- /dev/null +++ b/docs/components/datetimeservertooltype.md @@ -0,0 +1,8 @@ +# DatetimeServerToolType + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `OPENROUTER_DATETIME` | openrouter:datetime | \ No newline at end of file diff --git a/docs/components/defaultparameters.md b/docs/components/defaultparameters.md index b343b60..da72f0d 100644 --- a/docs/components/defaultparameters.md +++ b/docs/components/defaultparameters.md @@ -9,4 +9,7 @@ Default parameters for this model | ------------------------- | ------------------------- | ------------------------- | ------------------------- | | `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `top_k` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `repetition_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/environment.md b/docs/components/environment.md new file mode 100644 index 0000000..e58da65 --- /dev/null +++ b/docs/components/environment.md @@ -0,0 +1,12 @@ +# Environment + + +## Values + +| Name | Value | +| --------- | --------- | +| `WINDOWS` | windows | +| `MAC` | mac | +| `LINUX` | linux | +| `UBUNTU` | ubuntu | +| `BROWSER` | browser | \ No newline at end of file diff --git a/docs/components/file.md b/docs/components/file.md new file mode 100644 index 0000000..d2a2e85 --- /dev/null +++ b/docs/components/file.md @@ -0,0 +1,10 @@ +# File + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `file_data` | *Optional[str]* | :heavy_minus_sign: | File content as base64 data URL or URL | +| `file_id` | *Optional[str]* | :heavy_minus_sign: | File ID for previously uploaded files | +| `filename` | *Optional[str]* | :heavy_minus_sign: | Original filename | \ No newline at end of file diff --git a/docs/components/filters.md b/docs/components/filters.md new file mode 100644 index 0000000..4d44fd6 --- /dev/null +++ b/docs/components/filters.md @@ -0,0 +1,23 @@ +# Filters + + +## Supported Types + +### `components.OpenResponsesFileSearchToolFilters` + +```python +value: components.OpenResponsesFileSearchToolFilters = /* values here */ +``` + +### `components.CompoundFilter` + +```python +value: components.CompoundFilter = /* values here */ +``` + +### `Any` + +```python +value: Any = /* values here */ +``` + diff --git a/docs/components/filterstype.md b/docs/components/filterstype.md new file mode 100644 index 0000000..9dda683 --- /dev/null +++ b/docs/components/filterstype.md @@ -0,0 +1,13 @@ +# FiltersType + + +## Values + +| Name | Value | +| ----- | ----- | +| `EQ` | eq | +| `NE` | ne | +| `GT` | gt | +| `GTE` | gte | +| `LT` | lt | +| `LTE` | lte | \ No newline at end of file diff --git a/docs/components/format_.md b/docs/components/format_.md new file mode 100644 index 0000000..96e07e7 --- /dev/null +++ b/docs/components/format_.md @@ -0,0 +1,17 @@ +# Format + + +## Supported Types + +### `components.FormatText` + +```python +value: components.FormatText = /* values here */ +``` + +### `components.FormatGrammar` + +```python +value: components.FormatGrammar = /* values here */ +``` + diff --git a/docs/components/formatgrammar.md b/docs/components/formatgrammar.md new file mode 100644 index 0000000..0a8c433 --- /dev/null +++ b/docs/components/formatgrammar.md @@ -0,0 +1,10 @@ +# FormatGrammar + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `type` | [components.FormatTypeGrammar](../components/formattypegrammar.md) | :heavy_check_mark: | N/A | +| `definition` | *str* | :heavy_check_mark: | N/A | +| `syntax` | [components.Syntax](../components/syntax.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/formattext.md b/docs/components/formattext.md new file mode 100644 index 0000000..80dd1f8 --- /dev/null +++ b/docs/components/formattext.md @@ -0,0 +1,8 @@ +# FormatText + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `type` | [components.FormatTypeText](../components/formattypetext.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/formattypegrammar.md b/docs/components/formattypegrammar.md new file mode 100644 index 0000000..cededf3 --- /dev/null +++ b/docs/components/formattypegrammar.md @@ -0,0 +1,8 @@ +# FormatTypeGrammar + + +## Values + +| Name | Value | +| --------- | --------- | +| `GRAMMAR` | grammar | \ No newline at end of file diff --git a/docs/components/formattypetext.md b/docs/components/formattypetext.md new file mode 100644 index 0000000..7d38cb8 --- /dev/null +++ b/docs/components/formattypetext.md @@ -0,0 +1,8 @@ +# FormatTypeText + + +## Values + +| Name | Value | +| ------ | ------ | +| `TEXT` | text | \ No newline at end of file diff --git a/docs/components/inputfidelity.md b/docs/components/inputfidelity.md new file mode 100644 index 0000000..e89ae05 --- /dev/null +++ b/docs/components/inputfidelity.md @@ -0,0 +1,9 @@ +# InputFidelity + + +## Values + +| Name | Value | +| ------ | ------ | +| `HIGH` | high | +| `LOW` | low | \ No newline at end of file diff --git a/docs/components/inputimagemask.md b/docs/components/inputimagemask.md new file mode 100644 index 0000000..911ea05 --- /dev/null +++ b/docs/components/inputimagemask.md @@ -0,0 +1,9 @@ +# InputImageMask + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `image_url` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `file_id` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/memorylimit.md b/docs/components/memorylimit.md new file mode 100644 index 0000000..39f5ae2 --- /dev/null +++ b/docs/components/memorylimit.md @@ -0,0 +1,11 @@ +# MemoryLimit + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `ONEG` | 1g | +| `FOURG` | 4g | +| `SIXTEENG` | 16g | +| `SIXTY_FOURG` | 64g | \ No newline at end of file diff --git a/docs/components/modality.md b/docs/components/modality.md index 4edb378..54561e4 100644 --- a/docs/components/modality.md +++ b/docs/components/modality.md @@ -6,4 +6,5 @@ | Name | Value | | ------- | ------- | | `TEXT` | text | -| `IMAGE` | image | \ No newline at end of file +| `IMAGE` | image | +| `AUDIO` | audio | \ No newline at end of file diff --git a/docs/components/model.md b/docs/components/model.md index 86c7cd6..9ba7e16 100644 --- a/docs/components/model.md +++ b/docs/components/model.md @@ -19,5 +19,5 @@ Information about an AI model available on OpenRouter | `top_provider` | [components.TopProviderInfo](../components/topproviderinfo.md) | :heavy_check_mark: | Information about the top provider for this model | {
"context_length": 8192,
"max_completion_tokens": 4096,
"is_moderated": true
} | | `per_request_limits` | [Nullable[components.PerRequestLimits]](../components/perrequestlimits.md) | :heavy_check_mark: | Per-request token limits | {
"prompt_tokens": 1000,
"completion_tokens": 1000
} | | `supported_parameters` | List[[components.Parameter](../components/parameter.md)] | :heavy_check_mark: | List of supported parameters for this model | | -| `default_parameters` | [Nullable[components.DefaultParameters]](../components/defaultparameters.md) | :heavy_check_mark: | Default parameters for this model | {
"temperature": 0.7,
"top_p": 0.9,
"frequency_penalty": 0
} | +| `default_parameters` | [Nullable[components.DefaultParameters]](../components/defaultparameters.md) | :heavy_check_mark: | Default parameters for this model | {
"temperature": 0.7,
"top_p": 0.9,
"top_k": 0,
"frequency_penalty": 0,
"presence_penalty": 0,
"repetition_penalty": 1
} | | `expiration_date` | *OptionalNullable[str]* | :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 | \ No newline at end of file diff --git a/docs/components/modelenum.md b/docs/components/modelenum.md new file mode 100644 index 0000000..0698ec6 --- /dev/null +++ b/docs/components/modelenum.md @@ -0,0 +1,9 @@ +# ModelEnum + + +## Values + +| Name | Value | +| ------------------ | ------------------ | +| `GPT_IMAGE_1` | gpt-image-1 | +| `GPT_IMAGE_1_MINI` | gpt-image-1-mini | \ No newline at end of file diff --git a/docs/components/moderation.md b/docs/components/moderation.md new file mode 100644 index 0000000..e537afb --- /dev/null +++ b/docs/components/moderation.md @@ -0,0 +1,9 @@ +# Moderation + + +## Values + +| Name | Value | +| ------ | ------ | +| `AUTO` | auto | +| `LOW` | low | \ No newline at end of file diff --git a/docs/components/never.md b/docs/components/never.md new file mode 100644 index 0000000..32da565 --- /dev/null +++ b/docs/components/never.md @@ -0,0 +1,8 @@ +# Never + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `tool_names` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/openairesponsesinputfunctioncalloutput.md b/docs/components/openairesponsesinputfunctioncalloutput.md index dde5cba..3a10286 100644 --- a/docs/components/openairesponsesinputfunctioncalloutput.md +++ b/docs/components/openairesponsesinputfunctioncalloutput.md @@ -8,5 +8,5 @@ | `type` | [components.OpenAIResponsesInputTypeFunctionCallOutput](../components/openairesponsesinputtypefunctioncalloutput.md) | :heavy_check_mark: | N/A | | | `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | | `call_id` | *str* | :heavy_check_mark: | N/A | | -| `output` | *str* | :heavy_check_mark: | N/A | | +| `output` | [components.OpenAIResponsesInputOutput2](../components/openairesponsesinputoutput2.md) | :heavy_check_mark: | N/A | | | `status` | [OptionalNullable[components.ToolCallStatus]](../components/toolcallstatus.md) | :heavy_minus_sign: | N/A | completed | \ No newline at end of file diff --git a/docs/components/openairesponsesinputmessage1.md b/docs/components/openairesponsesinputmessage1.md index 3bbf8a8..c205d36 100644 --- a/docs/components/openairesponsesinputmessage1.md +++ b/docs/components/openairesponsesinputmessage1.md @@ -3,8 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `type` | [Optional[components.OpenAIResponsesInputTypeMessage1]](../components/openairesponsesinputtypemessage1.md) | :heavy_minus_sign: | N/A | -| `role` | [components.OpenAIResponsesInputRoleUnion1](../components/openairesponsesinputroleunion1.md) | :heavy_check_mark: | N/A | -| `content` | [components.OpenAIResponsesInputContent2](../components/openairesponsesinputcontent2.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `type` | [Optional[components.OpenAIResponsesInputTypeMessage1]](../components/openairesponsesinputtypemessage1.md) | :heavy_minus_sign: | N/A | +| `role` | [components.OpenAIResponsesInputRoleUnion1](../components/openairesponsesinputroleunion1.md) | :heavy_check_mark: | N/A | +| `content` | [components.OpenAIResponsesInputContent2](../components/openairesponsesinputcontent2.md) | :heavy_check_mark: | N/A | +| `phase` | [OptionalNullable[components.OpenAIResponsesInputPhaseUnion]](../components/openairesponsesinputphaseunion.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/openairesponsesinputoutput1.md b/docs/components/openairesponsesinputoutput1.md new file mode 100644 index 0000000..21d6951 --- /dev/null +++ b/docs/components/openairesponsesinputoutput1.md @@ -0,0 +1,23 @@ +# OpenAIResponsesInputOutput1 + + +## Supported Types + +### `components.ResponseInputText` + +```python +value: components.ResponseInputText = /* values here */ +``` + +### `components.ResponseInputImage` + +```python +value: components.ResponseInputImage = /* values here */ +``` + +### `components.ResponseInputFile` + +```python +value: components.ResponseInputFile = /* values here */ +``` + diff --git a/docs/components/openairesponsesinputoutput2.md b/docs/components/openairesponsesinputoutput2.md new file mode 100644 index 0000000..ee1d7d6 --- /dev/null +++ b/docs/components/openairesponsesinputoutput2.md @@ -0,0 +1,17 @@ +# OpenAIResponsesInputOutput2 + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[components.OpenAIResponsesInputOutput1]` + +```python +value: List[components.OpenAIResponsesInputOutput1] = /* values here */ +``` + diff --git a/docs/components/openairesponsesinputphasecommentary.md b/docs/components/openairesponsesinputphasecommentary.md new file mode 100644 index 0000000..8dab1f1 --- /dev/null +++ b/docs/components/openairesponsesinputphasecommentary.md @@ -0,0 +1,8 @@ +# OpenAIResponsesInputPhaseCommentary + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `COMMENTARY` | commentary | \ No newline at end of file diff --git a/docs/components/openairesponsesinputphasefinalanswer.md b/docs/components/openairesponsesinputphasefinalanswer.md new file mode 100644 index 0000000..7682625 --- /dev/null +++ b/docs/components/openairesponsesinputphasefinalanswer.md @@ -0,0 +1,8 @@ +# OpenAIResponsesInputPhaseFinalAnswer + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `FINAL_ANSWER` | final_answer | \ No newline at end of file diff --git a/docs/components/openairesponsesinputphaseunion.md b/docs/components/openairesponsesinputphaseunion.md new file mode 100644 index 0000000..a144030 --- /dev/null +++ b/docs/components/openairesponsesinputphaseunion.md @@ -0,0 +1,23 @@ +# OpenAIResponsesInputPhaseUnion + + +## Supported Types + +### `components.OpenAIResponsesInputPhaseCommentary` + +```python +value: components.OpenAIResponsesInputPhaseCommentary = /* values here */ +``` + +### `components.OpenAIResponsesInputPhaseFinalAnswer` + +```python +value: components.OpenAIResponsesInputPhaseFinalAnswer = /* values here */ +``` + +### `Any` + +```python +value: Any = /* values here */ +``` + diff --git a/docs/components/openresponsesapplypatchtool.md b/docs/components/openresponsesapplypatchtool.md new file mode 100644 index 0000000..43da3de --- /dev/null +++ b/docs/components/openresponsesapplypatchtool.md @@ -0,0 +1,10 @@ +# OpenResponsesApplyPatchTool + +Apply patch tool configuration + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `type` | [components.OpenResponsesApplyPatchToolType](../components/openresponsesapplypatchtooltype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/openresponsesapplypatchtooltype.md b/docs/components/openresponsesapplypatchtooltype.md new file mode 100644 index 0000000..e3720a4 --- /dev/null +++ b/docs/components/openresponsesapplypatchtooltype.md @@ -0,0 +1,8 @@ +# OpenResponsesApplyPatchToolType + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `APPLY_PATCH` | apply_patch | \ No newline at end of file diff --git a/docs/components/openresponsescodeinterpretertool.md b/docs/components/openresponsescodeinterpretertool.md new file mode 100644 index 0000000..ac876be --- /dev/null +++ b/docs/components/openresponsescodeinterpretertool.md @@ -0,0 +1,11 @@ +# OpenResponsesCodeInterpreterTool + +Code interpreter tool configuration + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `type` | [components.TypeCodeInterpreter](../components/typecodeinterpreter.md) | :heavy_check_mark: | N/A | +| `container` | [components.Container](../components/container.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/openresponsescomputertool.md b/docs/components/openresponsescomputertool.md new file mode 100644 index 0000000..0478234 --- /dev/null +++ b/docs/components/openresponsescomputertool.md @@ -0,0 +1,13 @@ +# OpenResponsesComputerTool + +Computer use preview tool configuration + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `type` | [components.OpenResponsesComputerToolType](../components/openresponsescomputertooltype.md) | :heavy_check_mark: | N/A | +| `display_height` | *float* | :heavy_check_mark: | N/A | +| `display_width` | *float* | :heavy_check_mark: | N/A | +| `environment` | [components.Environment](../components/environment.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/openresponsescomputertooltype.md b/docs/components/openresponsescomputertooltype.md new file mode 100644 index 0000000..df9eded --- /dev/null +++ b/docs/components/openresponsescomputertooltype.md @@ -0,0 +1,8 @@ +# OpenResponsesComputerToolType + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `COMPUTER_USE_PREVIEW` | computer_use_preview | \ No newline at end of file diff --git a/docs/components/openresponsescustomtool.md b/docs/components/openresponsescustomtool.md new file mode 100644 index 0000000..230ca66 --- /dev/null +++ b/docs/components/openresponsescustomtool.md @@ -0,0 +1,13 @@ +# OpenResponsesCustomTool + +Custom tool configuration + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `type` | [components.TypeCustom](../components/typecustom.md) | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `description` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `format_` | [Optional[components.Format]](../components/format_.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/openresponseseasyinputmessage.md b/docs/components/openresponseseasyinputmessage.md index 155dd0b..68c7615 100644 --- a/docs/components/openresponseseasyinputmessage.md +++ b/docs/components/openresponseseasyinputmessage.md @@ -3,8 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `type` | [Optional[components.OpenResponsesEasyInputMessageTypeMessage]](../components/openresponseseasyinputmessagetypemessage.md) | :heavy_minus_sign: | N/A | -| `role` | [components.OpenResponsesEasyInputMessageRoleUnion](../components/openresponseseasyinputmessageroleunion.md) | :heavy_check_mark: | N/A | -| `content` | [components.OpenResponsesEasyInputMessageContentUnion2](../components/openresponseseasyinputmessagecontentunion2.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | [Optional[components.OpenResponsesEasyInputMessageTypeMessage]](../components/openresponseseasyinputmessagetypemessage.md) | :heavy_minus_sign: | N/A | | +| `role` | [components.OpenResponsesEasyInputMessageRoleUnion](../components/openresponseseasyinputmessageroleunion.md) | :heavy_check_mark: | N/A | | +| `content` | [OptionalNullable[components.OpenResponsesEasyInputMessageContentUnion2]](../components/openresponseseasyinputmessagecontentunion2.md) | :heavy_minus_sign: | N/A | | +| `phase` | [OptionalNullable[components.OpenResponsesEasyInputMessagePhaseUnion]](../components/openresponseseasyinputmessagephaseunion.md) | :heavy_minus_sign: | 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. | final_answer | \ No newline at end of file diff --git a/docs/components/openresponseseasyinputmessagecontentunion2.md b/docs/components/openresponseseasyinputmessagecontentunion2.md index 7bad765..f6041fd 100644 --- a/docs/components/openresponseseasyinputmessagecontentunion2.md +++ b/docs/components/openresponseseasyinputmessagecontentunion2.md @@ -15,3 +15,9 @@ value: List[components.OpenResponsesEasyInputMessageContentUnion1] = /* values h value: str = /* values here */ ``` +### `Any` + +```python +value: Any = /* values here */ +``` + diff --git a/docs/components/openresponseseasyinputmessagephasecommentary.md b/docs/components/openresponseseasyinputmessagephasecommentary.md new file mode 100644 index 0000000..12f4dfa --- /dev/null +++ b/docs/components/openresponseseasyinputmessagephasecommentary.md @@ -0,0 +1,8 @@ +# OpenResponsesEasyInputMessagePhaseCommentary + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `COMMENTARY` | commentary | \ No newline at end of file diff --git a/docs/components/openresponseseasyinputmessagephasefinalanswer.md b/docs/components/openresponseseasyinputmessagephasefinalanswer.md new file mode 100644 index 0000000..3ccb88b --- /dev/null +++ b/docs/components/openresponseseasyinputmessagephasefinalanswer.md @@ -0,0 +1,8 @@ +# OpenResponsesEasyInputMessagePhaseFinalAnswer + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `FINAL_ANSWER` | final_answer | \ No newline at end of file diff --git a/docs/components/openresponseseasyinputmessagephaseunion.md b/docs/components/openresponseseasyinputmessagephaseunion.md new file mode 100644 index 0000000..5a1b99c --- /dev/null +++ b/docs/components/openresponseseasyinputmessagephaseunion.md @@ -0,0 +1,25 @@ +# OpenResponsesEasyInputMessagePhaseUnion + +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. + + +## Supported Types + +### `components.OpenResponsesEasyInputMessagePhaseCommentary` + +```python +value: components.OpenResponsesEasyInputMessagePhaseCommentary = /* values here */ +``` + +### `components.OpenResponsesEasyInputMessagePhaseFinalAnswer` + +```python +value: components.OpenResponsesEasyInputMessagePhaseFinalAnswer = /* values here */ +``` + +### `Any` + +```python +value: Any = /* values here */ +``` + diff --git a/docs/components/openresponsesfilesearchtool.md b/docs/components/openresponsesfilesearchtool.md new file mode 100644 index 0000000..8316d8d --- /dev/null +++ b/docs/components/openresponsesfilesearchtool.md @@ -0,0 +1,14 @@ +# OpenResponsesFileSearchTool + +File search tool configuration + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `type` | [components.TypeFileSearch](../components/typefilesearch.md) | :heavy_check_mark: | N/A | +| `vector_store_ids` | List[*str*] | :heavy_check_mark: | N/A | +| `filters` | [OptionalNullable[components.Filters]](../components/filters.md) | :heavy_minus_sign: | N/A | +| `max_num_results` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `ranking_options` | [Optional[components.RankingOptions]](../components/rankingoptions.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/openresponsesfilesearchtoolfilters.md b/docs/components/openresponsesfilesearchtoolfilters.md new file mode 100644 index 0000000..d4e3eb7 --- /dev/null +++ b/docs/components/openresponsesfilesearchtoolfilters.md @@ -0,0 +1,10 @@ +# OpenResponsesFileSearchToolFilters + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `key` | *str* | :heavy_check_mark: | N/A | +| `type` | [components.FiltersType](../components/filterstype.md) | :heavy_check_mark: | N/A | +| `value` | [components.Value2](../components/value2.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/openresponsesfunctioncalloutput.md b/docs/components/openresponsesfunctioncalloutput.md index adf40a2..6528b4b 100644 --- a/docs/components/openresponsesfunctioncalloutput.md +++ b/docs/components/openresponsesfunctioncalloutput.md @@ -5,10 +5,10 @@ The output from a function call execution ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `type` | [components.OpenResponsesFunctionCallOutputType](../components/openresponsesfunctioncalloutputtype.md) | :heavy_check_mark: | N/A | | -| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | -| `call_id` | *str* | :heavy_check_mark: | N/A | | -| `output` | *str* | :heavy_check_mark: | N/A | | -| `status` | [OptionalNullable[components.ToolCallStatus]](../components/toolcallstatus.md) | :heavy_minus_sign: | N/A | completed | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `type` | [components.OpenResponsesFunctionCallOutputTypeFunctionCallOutput](../components/openresponsesfunctioncalloutputtypefunctioncalloutput.md) | :heavy_check_mark: | N/A | | +| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `call_id` | *str* | :heavy_check_mark: | N/A | | +| `output` | [components.OpenResponsesFunctionCallOutputOutputUnion2](../components/openresponsesfunctioncalloutputoutputunion2.md) | :heavy_check_mark: | N/A | | +| `status` | [OptionalNullable[components.ToolCallStatus]](../components/toolcallstatus.md) | :heavy_minus_sign: | N/A | completed | \ No newline at end of file diff --git a/docs/components/openresponsesfunctioncalloutputdetail.md b/docs/components/openresponsesfunctioncalloutputdetail.md new file mode 100644 index 0000000..958edf3 --- /dev/null +++ b/docs/components/openresponsesfunctioncalloutputdetail.md @@ -0,0 +1,10 @@ +# OpenResponsesFunctionCallOutputDetail + + +## Values + +| Name | Value | +| ------ | ------ | +| `AUTO` | auto | +| `HIGH` | high | +| `LOW` | low | \ No newline at end of file diff --git a/docs/components/openresponsesfunctioncalloutputoutputunion1.md b/docs/components/openresponsesfunctioncalloutputoutputunion1.md new file mode 100644 index 0000000..b1f3ac8 --- /dev/null +++ b/docs/components/openresponsesfunctioncalloutputoutputunion1.md @@ -0,0 +1,23 @@ +# OpenResponsesFunctionCallOutputOutputUnion1 + + +## Supported Types + +### `components.ResponseInputText` + +```python +value: components.ResponseInputText = /* values here */ +``` + +### `components.OutputInputImage` + +```python +value: components.OutputInputImage = /* values here */ +``` + +### `components.ResponseInputFile` + +```python +value: components.ResponseInputFile = /* values here */ +``` + diff --git a/docs/components/openresponsesfunctioncalloutputoutputunion2.md b/docs/components/openresponsesfunctioncalloutputoutputunion2.md new file mode 100644 index 0000000..487c46f --- /dev/null +++ b/docs/components/openresponsesfunctioncalloutputoutputunion2.md @@ -0,0 +1,17 @@ +# OpenResponsesFunctionCallOutputOutputUnion2 + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `List[components.OpenResponsesFunctionCallOutputOutputUnion1]` + +```python +value: List[components.OpenResponsesFunctionCallOutputOutputUnion1] = /* values here */ +``` + diff --git a/docs/components/openresponsesfunctioncalloutputtype.md b/docs/components/openresponsesfunctioncalloutputtypefunctioncalloutput.md similarity index 75% rename from docs/components/openresponsesfunctioncalloutputtype.md rename to docs/components/openresponsesfunctioncalloutputtypefunctioncalloutput.md index 41370cf..1ab2141 100644 --- a/docs/components/openresponsesfunctioncalloutputtype.md +++ b/docs/components/openresponsesfunctioncalloutputtypefunctioncalloutput.md @@ -1,4 +1,4 @@ -# OpenResponsesFunctionCallOutputType +# OpenResponsesFunctionCallOutputTypeFunctionCallOutput ## Values diff --git a/docs/components/openresponsesfunctionshelltool.md b/docs/components/openresponsesfunctionshelltool.md new file mode 100644 index 0000000..377d8e4 --- /dev/null +++ b/docs/components/openresponsesfunctionshelltool.md @@ -0,0 +1,10 @@ +# OpenResponsesFunctionShellTool + +Shell tool configuration + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `type` | [components.OpenResponsesFunctionShellToolType](../components/openresponsesfunctionshelltooltype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/openresponsesfunctionshelltooltype.md b/docs/components/openresponsesfunctionshelltooltype.md new file mode 100644 index 0000000..08b20ad --- /dev/null +++ b/docs/components/openresponsesfunctionshelltooltype.md @@ -0,0 +1,8 @@ +# OpenResponsesFunctionShellToolType + + +## Values + +| Name | Value | +| ------- | ------- | +| `SHELL` | shell | \ No newline at end of file diff --git a/docs/components/openresponsesimagegenerationtool.md b/docs/components/openresponsesimagegenerationtool.md new file mode 100644 index 0000000..adb0600 --- /dev/null +++ b/docs/components/openresponsesimagegenerationtool.md @@ -0,0 +1,20 @@ +# OpenResponsesImageGenerationTool + +Image generation tool configuration + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `type` | [components.OpenResponsesImageGenerationToolType](../components/openresponsesimagegenerationtooltype.md) | :heavy_check_mark: | N/A | +| `background` | [Optional[components.Background]](../components/background.md) | :heavy_minus_sign: | N/A | +| `input_fidelity` | [OptionalNullable[components.InputFidelity]](../components/inputfidelity.md) | :heavy_minus_sign: | N/A | +| `input_image_mask` | [Optional[components.InputImageMask]](../components/inputimagemask.md) | :heavy_minus_sign: | N/A | +| `model` | [Optional[components.ModelEnum]](../components/modelenum.md) | :heavy_minus_sign: | N/A | +| `moderation` | [Optional[components.Moderation]](../components/moderation.md) | :heavy_minus_sign: | N/A | +| `output_compression` | *Optional[float]* | :heavy_minus_sign: | N/A | +| `output_format` | [Optional[components.OutputFormat]](../components/outputformat.md) | :heavy_minus_sign: | N/A | +| `partial_images` | *Optional[float]* | :heavy_minus_sign: | N/A | +| `quality` | [Optional[components.Quality]](../components/quality.md) | :heavy_minus_sign: | N/A | +| `size` | [Optional[components.Size]](../components/size.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/openresponsesimagegenerationtooltype.md b/docs/components/openresponsesimagegenerationtooltype.md new file mode 100644 index 0000000..8e642c4 --- /dev/null +++ b/docs/components/openresponsesimagegenerationtooltype.md @@ -0,0 +1,8 @@ +# OpenResponsesImageGenerationToolType + + +## Values + +| Name | Value | +| ------------------ | ------------------ | +| `IMAGE_GENERATION` | image_generation | \ No newline at end of file diff --git a/docs/components/openresponsesinputcontent1.md b/docs/components/openresponsesinputcontent1.md new file mode 100644 index 0000000..a67838d --- /dev/null +++ b/docs/components/openresponsesinputcontent1.md @@ -0,0 +1,17 @@ +# OpenResponsesInputContent1 + + +## Supported Types + +### `components.ResponseOutputText` + +```python +value: components.ResponseOutputText = /* values here */ +``` + +### `components.OpenAIResponsesRefusalContent` + +```python +value: components.OpenAIResponsesRefusalContent = /* values here */ +``` + diff --git a/docs/components/openresponsesinputcontent2.md b/docs/components/openresponsesinputcontent2.md new file mode 100644 index 0000000..c610c0f --- /dev/null +++ b/docs/components/openresponsesinputcontent2.md @@ -0,0 +1,23 @@ +# OpenResponsesInputContent2 + + +## Supported Types + +### `List[components.OpenResponsesInputContent1]` + +```python +value: List[components.OpenResponsesInputContent1] = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + +### `Any` + +```python +value: Any = /* values here */ +``` + diff --git a/docs/components/openresponsesinputformat.md b/docs/components/openresponsesinputformat.md new file mode 100644 index 0000000..a7f8855 --- /dev/null +++ b/docs/components/openresponsesinputformat.md @@ -0,0 +1,15 @@ +# OpenResponsesInputFormat + +The format of the reasoning content + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `UNKNOWN` | unknown | +| `OPENAI_RESPONSES_V1` | openai-responses-v1 | +| `AZURE_OPENAI_RESPONSES_V1` | azure-openai-responses-v1 | +| `XAI_RESPONSES_V1` | xai-responses-v1 | +| `ANTHROPIC_CLAUDE_V1` | anthropic-claude-v1 | +| `GOOGLE_GEMINI_V1` | google-gemini-v1 | \ No newline at end of file diff --git a/docs/components/openresponsesinputmessage.md b/docs/components/openresponsesinputmessage.md new file mode 100644 index 0000000..4e1182a --- /dev/null +++ b/docs/components/openresponsesinputmessage.md @@ -0,0 +1,15 @@ +# OpenResponsesInputMessage + +An output message item + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `role` | [components.OpenResponsesInputRole](../components/openresponsesinputrole.md) | :heavy_check_mark: | N/A | +| `type` | [components.OpenResponsesInputTypeMessage](../components/openresponsesinputtypemessage.md) | :heavy_check_mark: | N/A | +| `status` | [Optional[components.OpenResponsesInputStatusUnion1]](../components/openresponsesinputstatusunion1.md) | :heavy_minus_sign: | N/A | +| `content` | [Nullable[components.OpenResponsesInputContent2]](../components/openresponsesinputcontent2.md) | :heavy_check_mark: | N/A | +| `phase` | [OptionalNullable[components.OpenResponsesInputPhaseUnion]](../components/openresponsesinputphaseunion.md) | :heavy_minus_sign: | 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. | \ No newline at end of file diff --git a/docs/components/openresponsesinputmessageitem.md b/docs/components/openresponsesinputmessageitem.md index 827c798..98d0c16 100644 --- a/docs/components/openresponsesinputmessageitem.md +++ b/docs/components/openresponsesinputmessageitem.md @@ -8,4 +8,4 @@ | `id` | *Optional[str]* | :heavy_minus_sign: | N/A | | `type` | [Optional[components.OpenResponsesInputMessageItemTypeMessage]](../components/openresponsesinputmessageitemtypemessage.md) | :heavy_minus_sign: | N/A | | `role` | [components.OpenResponsesInputMessageItemRoleUnion](../components/openresponsesinputmessageitemroleunion.md) | :heavy_check_mark: | N/A | -| `content` | List[[components.OpenResponsesInputMessageItemContentUnion](../components/openresponsesinputmessageitemcontentunion.md)] | :heavy_check_mark: | N/A | \ No newline at end of file +| `content` | List[[components.OpenResponsesInputMessageItemContentUnion](../components/openresponsesinputmessageitemcontentunion.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/openresponsesinputphasecommentary.md b/docs/components/openresponsesinputphasecommentary.md new file mode 100644 index 0000000..1579bed --- /dev/null +++ b/docs/components/openresponsesinputphasecommentary.md @@ -0,0 +1,8 @@ +# OpenResponsesInputPhaseCommentary + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `COMMENTARY` | commentary | \ No newline at end of file diff --git a/docs/components/openresponsesinputphasefinalanswer.md b/docs/components/openresponsesinputphasefinalanswer.md new file mode 100644 index 0000000..ea07f94 --- /dev/null +++ b/docs/components/openresponsesinputphasefinalanswer.md @@ -0,0 +1,8 @@ +# OpenResponsesInputPhaseFinalAnswer + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `FINAL_ANSWER` | final_answer | \ No newline at end of file diff --git a/docs/components/openresponsesinputphaseunion.md b/docs/components/openresponsesinputphaseunion.md new file mode 100644 index 0000000..3dc0a90 --- /dev/null +++ b/docs/components/openresponsesinputphaseunion.md @@ -0,0 +1,25 @@ +# OpenResponsesInputPhaseUnion + +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. + + +## Supported Types + +### `components.OpenResponsesInputPhaseCommentary` + +```python +value: components.OpenResponsesInputPhaseCommentary = /* values here */ +``` + +### `components.OpenResponsesInputPhaseFinalAnswer` + +```python +value: components.OpenResponsesInputPhaseFinalAnswer = /* values here */ +``` + +### `Any` + +```python +value: Any = /* values here */ +``` + diff --git a/docs/components/openresponsesinputreasoning.md b/docs/components/openresponsesinputreasoning.md new file mode 100644 index 0000000..0961b90 --- /dev/null +++ b/docs/components/openresponsesinputreasoning.md @@ -0,0 +1,17 @@ +# OpenResponsesInputReasoning + +An output item containing reasoning + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `type` | [components.OpenResponsesInputTypeReasoning](../components/openresponsesinputtypereasoning.md) | :heavy_check_mark: | N/A | | +| `id` | *str* | :heavy_check_mark: | N/A | | +| `content` | List[[components.ReasoningTextContent](../components/reasoningtextcontent.md)] | :heavy_minus_sign: | N/A | | +| `summary` | List[[components.ReasoningSummaryText](../components/reasoningsummarytext.md)] | :heavy_check_mark: | N/A | | +| `encrypted_content` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `status` | [Optional[components.OpenResponsesInputStatusUnion2]](../components/openresponsesinputstatusunion2.md) | :heavy_minus_sign: | N/A | | +| `signature` | *OptionalNullable[str]* | :heavy_minus_sign: | A signature for the reasoning content, used for verification | EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj... | +| `format_` | [OptionalNullable[components.OpenResponsesInputFormat]](../components/openresponsesinputformat.md) | :heavy_minus_sign: | The format of the reasoning content | anthropic-claude-v1 | \ No newline at end of file diff --git a/docs/components/openresponsesinputrole.md b/docs/components/openresponsesinputrole.md new file mode 100644 index 0000000..944cc5a --- /dev/null +++ b/docs/components/openresponsesinputrole.md @@ -0,0 +1,8 @@ +# OpenResponsesInputRole + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `ASSISTANT` | assistant | \ No newline at end of file diff --git a/docs/components/openresponsesinputstatuscompleted1.md b/docs/components/openresponsesinputstatuscompleted1.md new file mode 100644 index 0000000..dba48b4 --- /dev/null +++ b/docs/components/openresponsesinputstatuscompleted1.md @@ -0,0 +1,8 @@ +# OpenResponsesInputStatusCompleted1 + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `COMPLETED` | completed | \ No newline at end of file diff --git a/docs/components/openresponsesinputstatuscompleted2.md b/docs/components/openresponsesinputstatuscompleted2.md new file mode 100644 index 0000000..a6cbd66 --- /dev/null +++ b/docs/components/openresponsesinputstatuscompleted2.md @@ -0,0 +1,8 @@ +# OpenResponsesInputStatusCompleted2 + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `COMPLETED` | completed | \ No newline at end of file diff --git a/docs/components/openresponsesinputstatusincomplete1.md b/docs/components/openresponsesinputstatusincomplete1.md new file mode 100644 index 0000000..27bd081 --- /dev/null +++ b/docs/components/openresponsesinputstatusincomplete1.md @@ -0,0 +1,8 @@ +# OpenResponsesInputStatusIncomplete1 + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `INCOMPLETE` | incomplete | \ No newline at end of file diff --git a/docs/components/openresponsesinputstatusincomplete2.md b/docs/components/openresponsesinputstatusincomplete2.md new file mode 100644 index 0000000..cf26427 --- /dev/null +++ b/docs/components/openresponsesinputstatusincomplete2.md @@ -0,0 +1,8 @@ +# OpenResponsesInputStatusIncomplete2 + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `INCOMPLETE` | incomplete | \ No newline at end of file diff --git a/docs/components/openresponsesinputstatusinprogress1.md b/docs/components/openresponsesinputstatusinprogress1.md new file mode 100644 index 0000000..29836cf --- /dev/null +++ b/docs/components/openresponsesinputstatusinprogress1.md @@ -0,0 +1,8 @@ +# OpenResponsesInputStatusInProgress1 + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `IN_PROGRESS` | in_progress | \ No newline at end of file diff --git a/docs/components/openresponsesinputstatusinprogress2.md b/docs/components/openresponsesinputstatusinprogress2.md new file mode 100644 index 0000000..2ccac55 --- /dev/null +++ b/docs/components/openresponsesinputstatusinprogress2.md @@ -0,0 +1,8 @@ +# OpenResponsesInputStatusInProgress2 + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `IN_PROGRESS` | in_progress | \ No newline at end of file diff --git a/docs/components/openresponsesinputstatusunion1.md b/docs/components/openresponsesinputstatusunion1.md new file mode 100644 index 0000000..075b8c6 --- /dev/null +++ b/docs/components/openresponsesinputstatusunion1.md @@ -0,0 +1,23 @@ +# OpenResponsesInputStatusUnion1 + + +## Supported Types + +### `components.OpenResponsesInputStatusCompleted1` + +```python +value: components.OpenResponsesInputStatusCompleted1 = /* values here */ +``` + +### `components.OpenResponsesInputStatusIncomplete1` + +```python +value: components.OpenResponsesInputStatusIncomplete1 = /* values here */ +``` + +### `components.OpenResponsesInputStatusInProgress1` + +```python +value: components.OpenResponsesInputStatusInProgress1 = /* values here */ +``` + diff --git a/docs/components/openresponsesinputstatusunion2.md b/docs/components/openresponsesinputstatusunion2.md new file mode 100644 index 0000000..f415ee2 --- /dev/null +++ b/docs/components/openresponsesinputstatusunion2.md @@ -0,0 +1,23 @@ +# OpenResponsesInputStatusUnion2 + + +## Supported Types + +### `components.OpenResponsesInputStatusCompleted2` + +```python +value: components.OpenResponsesInputStatusCompleted2 = /* values here */ +``` + +### `components.OpenResponsesInputStatusIncomplete2` + +```python +value: components.OpenResponsesInputStatusIncomplete2 = /* values here */ +``` + +### `components.OpenResponsesInputStatusInProgress2` + +```python +value: components.OpenResponsesInputStatusInProgress2 = /* values here */ +``` + diff --git a/docs/components/openresponsesinputtypemessage.md b/docs/components/openresponsesinputtypemessage.md new file mode 100644 index 0000000..d00de40 --- /dev/null +++ b/docs/components/openresponsesinputtypemessage.md @@ -0,0 +1,8 @@ +# OpenResponsesInputTypeMessage + + +## Values + +| Name | Value | +| --------- | --------- | +| `MESSAGE` | message | \ No newline at end of file diff --git a/docs/components/openresponsesinputtypereasoning.md b/docs/components/openresponsesinputtypereasoning.md new file mode 100644 index 0000000..2e19572 --- /dev/null +++ b/docs/components/openresponsesinputtypereasoning.md @@ -0,0 +1,8 @@ +# OpenResponsesInputTypeReasoning + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `REASONING` | reasoning | \ No newline at end of file diff --git a/docs/components/openresponsesinput.md b/docs/components/openresponsesinputunion.md similarity index 52% rename from docs/components/openresponsesinput.md rename to docs/components/openresponsesinputunion.md index ac87902..9865b79 100644 --- a/docs/components/openresponsesinput.md +++ b/docs/components/openresponsesinputunion.md @@ -1,4 +1,4 @@ -# OpenResponsesInput +# OpenResponsesInputUnion Input for a response request - can be a string or array of items @@ -11,9 +11,9 @@ Input for a response request - can be a string or array of items value: str = /* values here */ ``` -### `List[components.OpenResponsesInput1]` +### `List[components.OpenResponsesInputUnion1]` ```python -value: List[components.OpenResponsesInput1] = /* values here */ +value: List[components.OpenResponsesInputUnion1] = /* values here */ ``` diff --git a/docs/components/openresponsesinput1.md b/docs/components/openresponsesinputunion1.md similarity index 76% rename from docs/components/openresponsesinput1.md rename to docs/components/openresponsesinputunion1.md index 8144878..cd1990a 100644 --- a/docs/components/openresponsesinput1.md +++ b/docs/components/openresponsesinputunion1.md @@ -1,4 +1,4 @@ -# OpenResponsesInput1 +# OpenResponsesInputUnion1 ## Supported Types @@ -33,16 +33,16 @@ value: components.OpenResponsesFunctionToolCall = /* values here */ value: components.OpenResponsesFunctionCallOutput = /* values here */ ``` -### `components.ResponsesOutputMessage` +### `components.OpenResponsesInputMessage` ```python -value: components.ResponsesOutputMessage = /* values here */ +value: components.OpenResponsesInputMessage = /* values here */ ``` -### `components.ResponsesOutputItemReasoning` +### `components.OpenResponsesInputReasoning` ```python -value: components.ResponsesOutputItemReasoning = /* values here */ +value: components.OpenResponsesInputReasoning = /* values here */ ``` ### `components.ResponsesOutputItemFunctionCall` @@ -69,3 +69,9 @@ value: components.ResponsesOutputItemFileSearchCall = /* values here */ value: components.ResponsesImageGenerationCall = /* values here */ ``` +### `components.ResponsesServerToolOutput` + +```python +value: components.ResponsesServerToolOutput = /* values here */ +``` + diff --git a/docs/components/openresponseslocalshelltool.md b/docs/components/openresponseslocalshelltool.md new file mode 100644 index 0000000..dcddddb --- /dev/null +++ b/docs/components/openresponseslocalshelltool.md @@ -0,0 +1,10 @@ +# OpenResponsesLocalShellTool + +Local shell tool configuration + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `type` | [components.OpenResponsesLocalShellToolType](../components/openresponseslocalshelltooltype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/openresponseslocalshelltooltype.md b/docs/components/openresponseslocalshelltooltype.md new file mode 100644 index 0000000..74ee7b7 --- /dev/null +++ b/docs/components/openresponseslocalshelltooltype.md @@ -0,0 +1,8 @@ +# OpenResponsesLocalShellToolType + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `LOCAL_SHELL` | local_shell | \ No newline at end of file diff --git a/docs/components/openresponseslogprobs.md b/docs/components/openresponseslogprobs.md deleted file mode 100644 index 205bcac..0000000 --- a/docs/components/openresponseslogprobs.md +++ /dev/null @@ -1,12 +0,0 @@ -# OpenResponsesLogProbs - -Log probability information for a token - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `logprob` | *float* | :heavy_check_mark: | N/A | -| `token` | *str* | :heavy_check_mark: | N/A | -| `top_logprobs` | List[[components.OpenResponsesTopLogprobs](../components/openresponsestoplogprobs.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/openresponsesmcptool.md b/docs/components/openresponsesmcptool.md new file mode 100644 index 0000000..425dbfb --- /dev/null +++ b/docs/components/openresponsesmcptool.md @@ -0,0 +1,18 @@ +# OpenResponsesMcpTool + +MCP (Model Context Protocol) tool configuration + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `type` | [components.OpenResponsesMcpToolType](../components/openresponsesmcptooltype.md) | :heavy_check_mark: | N/A | +| `server_label` | *str* | :heavy_check_mark: | N/A | +| `allowed_tools` | *OptionalNullable[Any]* | :heavy_minus_sign: | N/A | +| `authorization` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `connector_id` | [Optional[components.ConnectorID]](../components/connectorid.md) | :heavy_minus_sign: | N/A | +| `headers` | Dict[str, *str*] | :heavy_minus_sign: | N/A | +| `require_approval` | *OptionalNullable[Any]* | :heavy_minus_sign: | N/A | +| `server_description` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `server_url` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/openresponsesmcptooltype.md b/docs/components/openresponsesmcptooltype.md new file mode 100644 index 0000000..8c0a65b --- /dev/null +++ b/docs/components/openresponsesmcptooltype.md @@ -0,0 +1,8 @@ +# OpenResponsesMcpToolType + + +## Values + +| Name | Value | +| ----- | ----- | +| `MCP` | mcp | \ No newline at end of file diff --git a/docs/components/openresponsesnonstreamingresponsetoolunion.md b/docs/components/openresponsesnonstreamingresponsetoolunion.md index cac4b7d..0944446 100644 --- a/docs/components/openresponsesnonstreamingresponsetoolunion.md +++ b/docs/components/openresponsesnonstreamingresponsetoolunion.md @@ -33,3 +33,57 @@ value: components.OpenResponsesWebSearchTool = /* values here */ value: components.OpenResponsesWebSearch20250826Tool = /* values here */ ``` +### `components.OpenResponsesFileSearchTool` + +```python +value: components.OpenResponsesFileSearchTool = /* values here */ +``` + +### `components.OpenResponsesComputerTool` + +```python +value: components.OpenResponsesComputerTool = /* values here */ +``` + +### `components.OpenResponsesCodeInterpreterTool` + +```python +value: components.OpenResponsesCodeInterpreterTool = /* values here */ +``` + +### `components.OpenResponsesMcpTool` + +```python +value: components.OpenResponsesMcpTool = /* values here */ +``` + +### `components.OpenResponsesImageGenerationTool` + +```python +value: components.OpenResponsesImageGenerationTool = /* values here */ +``` + +### `components.OpenResponsesLocalShellTool` + +```python +value: components.OpenResponsesLocalShellTool = /* values here */ +``` + +### `components.OpenResponsesFunctionShellTool` + +```python +value: components.OpenResponsesFunctionShellTool = /* values here */ +``` + +### `components.OpenResponsesApplyPatchTool` + +```python +value: components.OpenResponsesApplyPatchTool = /* values here */ +``` + +### `components.OpenResponsesCustomTool` + +```python +value: components.OpenResponsesCustomTool = /* values here */ +``` + diff --git a/docs/components/openresponsesrequest.md b/docs/components/openresponsesrequest.md index 23cf648..b33b9e1 100644 --- a/docs/components/openresponsesrequest.md +++ b/docs/components/openresponsesrequest.md @@ -7,7 +7,7 @@ Request schema for Responses endpoint | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `input` | [Optional[components.OpenResponsesInput]](../components/openresponsesinput.md) | :heavy_minus_sign: | Input for a response request - can be a string or array of items | [
{
"role": "user",
"content": "What is the weather today?"
}
] | +| `input` | [Optional[components.OpenResponsesInputUnion]](../components/openresponsesinputunion.md) | :heavy_minus_sign: | Input for a response request - can be a string or array of items | [
{
"role": "user",
"content": "What is the weather today?"
}
] | | `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | | `metadata` | Dict[str, *str*] | :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. | {
"user_id": "123",
"session_id": "abc-def-ghi"
} | | `tools` | List[[components.OpenResponsesRequestToolUnion](../components/openresponsesrequesttoolunion.md)] | :heavy_minus_sign: | N/A | | diff --git a/docs/components/openresponsesrequestidcontextcompression.md b/docs/components/openresponsesrequestidcontextcompression.md new file mode 100644 index 0000000..11597a3 --- /dev/null +++ b/docs/components/openresponsesrequestidcontextcompression.md @@ -0,0 +1,8 @@ +# OpenResponsesRequestIDContextCompression + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `CONTEXT_COMPRESSION` | context-compression | \ No newline at end of file diff --git a/docs/components/openresponsesrequestplugincontextcompression.md b/docs/components/openresponsesrequestplugincontextcompression.md new file mode 100644 index 0000000..e919da3 --- /dev/null +++ b/docs/components/openresponsesrequestplugincontextcompression.md @@ -0,0 +1,10 @@ +# OpenResponsesRequestPluginContextCompression + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `id` | [components.OpenResponsesRequestIDContextCompression](../components/openresponsesrequestidcontextcompression.md) | :heavy_check_mark: | N/A | +| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the context-compression plugin for this request. Defaults to true. | +| `engine` | [Optional[components.ContextCompressionEngine]](../components/contextcompressionengine.md) | :heavy_minus_sign: | The compression engine to use. Defaults to "middle-out". | \ No newline at end of file diff --git a/docs/components/openresponsesrequestpluginunion.md b/docs/components/openresponsesrequestpluginunion.md index e164b2e..38c436d 100644 --- a/docs/components/openresponsesrequestpluginunion.md +++ b/docs/components/openresponsesrequestpluginunion.md @@ -33,3 +33,9 @@ value: components.OpenResponsesRequestPluginFileParser = /* values here */ value: components.OpenResponsesRequestPluginResponseHealing = /* values here */ ``` +### `components.OpenResponsesRequestPluginContextCompression` + +```python +value: components.OpenResponsesRequestPluginContextCompression = /* values here */ +``` + diff --git a/docs/components/openresponsesrequestpluginweb.md b/docs/components/openresponsesrequestpluginweb.md index d308049..0c0185d 100644 --- a/docs/components/openresponsesrequestpluginweb.md +++ b/docs/components/openresponsesrequestpluginweb.md @@ -3,10 +3,12 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `id` | [components.OpenResponsesRequestIDWeb](../components/openresponsesrequestidweb.md) | :heavy_check_mark: | N/A | -| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the web-search plugin for this request. Defaults to true. | -| `max_results` | *Optional[float]* | :heavy_minus_sign: | N/A | -| `search_prompt` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `engine` | [Optional[components.WebSearchEngine]](../components/websearchengine.md) | :heavy_minus_sign: | The search engine to use for web search. | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | [components.OpenResponsesRequestIDWeb](../components/openresponsesrequestidweb.md) | :heavy_check_mark: | N/A | | +| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the web-search plugin for this request. Defaults to true. | | +| `max_results` | *Optional[float]* | :heavy_minus_sign: | N/A | | +| `search_prompt` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `engine` | [Optional[components.WebSearchEngine]](../components/websearchengine.md) | :heavy_minus_sign: | The search engine to use for web search. | | +| `include_domains` | List[*str*] | :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"
] | +| `exclude_domains` | List[*str*] | :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"
] | \ No newline at end of file diff --git a/docs/components/openresponsesrequesttoolunion.md b/docs/components/openresponsesrequesttoolunion.md index d05f4d7..1454062 100644 --- a/docs/components/openresponsesrequesttoolunion.md +++ b/docs/components/openresponsesrequesttoolunion.md @@ -33,3 +33,69 @@ value: components.OpenResponsesWebSearchTool = /* values here */ value: components.OpenResponsesWebSearch20250826Tool = /* values here */ ``` +### `components.OpenResponsesFileSearchTool` + +```python +value: components.OpenResponsesFileSearchTool = /* values here */ +``` + +### `components.OpenResponsesComputerTool` + +```python +value: components.OpenResponsesComputerTool = /* values here */ +``` + +### `components.OpenResponsesCodeInterpreterTool` + +```python +value: components.OpenResponsesCodeInterpreterTool = /* values here */ +``` + +### `components.OpenResponsesMcpTool` + +```python +value: components.OpenResponsesMcpTool = /* values here */ +``` + +### `components.OpenResponsesImageGenerationTool` + +```python +value: components.OpenResponsesImageGenerationTool = /* values here */ +``` + +### `components.OpenResponsesLocalShellTool` + +```python +value: components.OpenResponsesLocalShellTool = /* values here */ +``` + +### `components.OpenResponsesFunctionShellTool` + +```python +value: components.OpenResponsesFunctionShellTool = /* values here */ +``` + +### `components.OpenResponsesApplyPatchTool` + +```python +value: components.OpenResponsesApplyPatchTool = /* values here */ +``` + +### `components.OpenResponsesCustomTool` + +```python +value: components.OpenResponsesCustomTool = /* values here */ +``` + +### `components.DatetimeServerTool` + +```python +value: components.DatetimeServerTool = /* values here */ +``` + +### `components.ResponsesWebSearchServerTool` + +```python +value: components.ResponsesWebSearchServerTool = /* values here */ +``` + diff --git a/docs/components/openresponsesstreamevent.md b/docs/components/openresponsesstreamevent.md index bc0a98a..0ddf550 100644 --- a/docs/components/openresponsesstreamevent.md +++ b/docs/components/openresponsesstreamevent.md @@ -167,3 +167,21 @@ value: components.OpenResponsesImageGenCallPartialImage = /* values here */ value: components.OpenResponsesImageGenCallCompleted = /* values here */ ``` +### `components.OpenResponsesWebSearchCallInProgress` + +```python +value: components.OpenResponsesWebSearchCallInProgress = /* values here */ +``` + +### `components.OpenResponsesWebSearchCallSearching` + +```python +value: components.OpenResponsesWebSearchCallSearching = /* values here */ +``` + +### `components.OpenResponsesWebSearchCallCompleted` + +```python +value: components.OpenResponsesWebSearchCallCompleted = /* values here */ +``` + diff --git a/docs/components/openresponsesstreameventlogprob1.md b/docs/components/openresponsesstreameventlogprob1.md new file mode 100644 index 0000000..b4ec2bf --- /dev/null +++ b/docs/components/openresponsesstreameventlogprob1.md @@ -0,0 +1,13 @@ +# OpenResponsesStreamEventLogprob1 + +Log probability information for a token + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `logprob` | *float* | :heavy_check_mark: | N/A | +| `token` | *str* | :heavy_check_mark: | N/A | +| `top_logprobs` | List[[components.OpenResponsesStreamEventTopLogprob1](../components/openresponsesstreameventtoplogprob1.md)] | :heavy_minus_sign: | N/A | +| `bytes_` | List[*float*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/openresponsesstreameventlogprob2.md b/docs/components/openresponsesstreameventlogprob2.md new file mode 100644 index 0000000..bbe335d --- /dev/null +++ b/docs/components/openresponsesstreameventlogprob2.md @@ -0,0 +1,13 @@ +# OpenResponsesStreamEventLogprob2 + +Log probability information for a token + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `logprob` | *float* | :heavy_check_mark: | N/A | +| `token` | *str* | :heavy_check_mark: | N/A | +| `top_logprobs` | List[[components.OpenResponsesStreamEventTopLogprob2](../components/openresponsesstreameventtoplogprob2.md)] | :heavy_minus_sign: | N/A | +| `bytes_` | List[*float*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/openresponsesstreameventresponseoutputtextdelta.md b/docs/components/openresponsesstreameventresponseoutputtextdelta.md index c2567ea..8eba002 100644 --- a/docs/components/openresponsesstreameventresponseoutputtextdelta.md +++ b/docs/components/openresponsesstreameventresponseoutputtextdelta.md @@ -5,12 +5,12 @@ Event emitted when a text delta is streamed ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `type` | [components.TypeResponseOutputTextDelta](../components/typeresponseoutputtextdelta.md) | :heavy_check_mark: | N/A | -| `logprobs` | List[[components.OpenResponsesLogProbs](../components/openresponseslogprobs.md)] | :heavy_check_mark: | N/A | -| `output_index` | *float* | :heavy_check_mark: | N/A | -| `item_id` | *str* | :heavy_check_mark: | N/A | -| `content_index` | *float* | :heavy_check_mark: | N/A | -| `delta` | *str* | :heavy_check_mark: | N/A | -| `sequence_number` | *float* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `type` | [components.TypeResponseOutputTextDelta](../components/typeresponseoutputtextdelta.md) | :heavy_check_mark: | N/A | +| `logprobs` | List[[components.OpenResponsesStreamEventLogprob1](../components/openresponsesstreameventlogprob1.md)] | :heavy_check_mark: | N/A | +| `output_index` | *float* | :heavy_check_mark: | N/A | +| `item_id` | *str* | :heavy_check_mark: | N/A | +| `content_index` | *float* | :heavy_check_mark: | N/A | +| `delta` | *str* | :heavy_check_mark: | N/A | +| `sequence_number` | *float* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/openresponsesstreameventresponseoutputtextdone.md b/docs/components/openresponsesstreameventresponseoutputtextdone.md index eefdc29..e413154 100644 --- a/docs/components/openresponsesstreameventresponseoutputtextdone.md +++ b/docs/components/openresponsesstreameventresponseoutputtextdone.md @@ -5,12 +5,12 @@ Event emitted when text streaming is complete ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `type` | [components.TypeResponseOutputTextDone](../components/typeresponseoutputtextdone.md) | :heavy_check_mark: | N/A | -| `output_index` | *float* | :heavy_check_mark: | N/A | -| `item_id` | *str* | :heavy_check_mark: | N/A | -| `content_index` | *float* | :heavy_check_mark: | N/A | -| `text` | *str* | :heavy_check_mark: | N/A | -| `sequence_number` | *float* | :heavy_check_mark: | N/A | -| `logprobs` | List[[components.OpenResponsesLogProbs](../components/openresponseslogprobs.md)] | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `type` | [components.TypeResponseOutputTextDone](../components/typeresponseoutputtextdone.md) | :heavy_check_mark: | N/A | +| `output_index` | *float* | :heavy_check_mark: | N/A | +| `item_id` | *str* | :heavy_check_mark: | N/A | +| `content_index` | *float* | :heavy_check_mark: | N/A | +| `text` | *str* | :heavy_check_mark: | N/A | +| `sequence_number` | *float* | :heavy_check_mark: | N/A | +| `logprobs` | List[[components.OpenResponsesStreamEventLogprob2](../components/openresponsesstreameventlogprob2.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/openresponsestoplogprobs.md b/docs/components/openresponsesstreameventtoplogprob1.md similarity index 76% rename from docs/components/openresponsestoplogprobs.md rename to docs/components/openresponsesstreameventtoplogprob1.md index aa7d39b..4de667f 100644 --- a/docs/components/openresponsestoplogprobs.md +++ b/docs/components/openresponsesstreameventtoplogprob1.md @@ -1,4 +1,4 @@ -# OpenResponsesTopLogprobs +# OpenResponsesStreamEventTopLogprob1 Alternative token with its log probability @@ -8,4 +8,5 @@ Alternative token with its log probability | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | | `token` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `logprob` | *Optional[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `logprob` | *Optional[float]* | :heavy_minus_sign: | N/A | +| `bytes_` | List[*float*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/openresponsesstreameventtoplogprob2.md b/docs/components/openresponsesstreameventtoplogprob2.md new file mode 100644 index 0000000..5e45f1f --- /dev/null +++ b/docs/components/openresponsesstreameventtoplogprob2.md @@ -0,0 +1,12 @@ +# OpenResponsesStreamEventTopLogprob2 + +Alternative token with its log probability + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `token` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `logprob` | *Optional[float]* | :heavy_minus_sign: | N/A | +| `bytes_` | List[*float*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/openresponseswebsearch20250826tool.md b/docs/components/openresponseswebsearch20250826tool.md index 8ba9326..d40a92b 100644 --- a/docs/components/openresponseswebsearch20250826tool.md +++ b/docs/components/openresponseswebsearch20250826tool.md @@ -5,9 +5,11 @@ Web search tool configuration (2025-08-26 version) ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | -| `type` | [components.OpenResponsesWebSearch20250826ToolType](../components/openresponseswebsearch20250826tooltype.md) | :heavy_check_mark: | N/A | | -| `filters` | [OptionalNullable[components.OpenResponsesWebSearch20250826ToolFilters]](../components/openresponseswebsearch20250826toolfilters.md) | :heavy_minus_sign: | N/A | | -| `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | -| `user_location` | [OptionalNullable[components.ResponsesWebSearchUserLocation]](../components/responseswebsearchuserlocation.md) | :heavy_minus_sign: | User location information for web search | {
"type": "approximate",
"city": "San Francisco",
"country": "USA",
"region": "California",
"timezone": "America/Los_Angeles"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | [components.OpenResponsesWebSearch20250826ToolType](../components/openresponseswebsearch20250826tooltype.md) | :heavy_check_mark: | N/A | | +| `filters` | [OptionalNullable[components.OpenResponsesWebSearch20250826ToolFilters]](../components/openresponseswebsearch20250826toolfilters.md) | :heavy_minus_sign: | N/A | | +| `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | +| `user_location` | [OptionalNullable[components.ResponsesWebSearchUserLocation]](../components/responseswebsearchuserlocation.md) | :heavy_minus_sign: | User location information for web search | {
"type": "approximate",
"city": "San Francisco",
"country": "USA",
"region": "California",
"timezone": "America/Los_Angeles"
} | +| `engine` | [Optional[components.OpenResponsesWebSearch20250826ToolEngine]](../components/openresponseswebsearch20250826toolengine.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 (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. | auto | +| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. | 5 | \ No newline at end of file diff --git a/docs/components/openresponseswebsearch20250826toolengine.md b/docs/components/openresponseswebsearch20250826toolengine.md new file mode 100644 index 0000000..09b69aa --- /dev/null +++ b/docs/components/openresponseswebsearch20250826toolengine.md @@ -0,0 +1,12 @@ +# OpenResponsesWebSearch20250826ToolEngine + +Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. + + +## Values + +| Name | Value | +| -------- | -------- | +| `AUTO` | auto | +| `NATIVE` | native | +| `EXA` | exa | \ No newline at end of file diff --git a/docs/components/openresponseswebsearch20250826toolfilters.md b/docs/components/openresponseswebsearch20250826toolfilters.md index 58c6a3b..cac1373 100644 --- a/docs/components/openresponseswebsearch20250826toolfilters.md +++ b/docs/components/openresponseswebsearch20250826toolfilters.md @@ -5,4 +5,5 @@ | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `allowed_domains` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file +| `allowed_domains` | List[*str*] | :heavy_minus_sign: | N/A | +| `excluded_domains` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/openresponseswebsearchcallcompleted.md b/docs/components/openresponseswebsearchcallcompleted.md new file mode 100644 index 0000000..036435d --- /dev/null +++ b/docs/components/openresponseswebsearchcallcompleted.md @@ -0,0 +1,13 @@ +# OpenResponsesWebSearchCallCompleted + +Web search call completed + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `type` | [components.OpenResponsesWebSearchCallCompletedType](../components/openresponseswebsearchcallcompletedtype.md) | :heavy_check_mark: | N/A | +| `item_id` | *str* | :heavy_check_mark: | N/A | +| `output_index` | *float* | :heavy_check_mark: | N/A | +| `sequence_number` | *float* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/openresponseswebsearchcallcompletedtype.md b/docs/components/openresponseswebsearchcallcompletedtype.md new file mode 100644 index 0000000..5645cdc --- /dev/null +++ b/docs/components/openresponseswebsearchcallcompletedtype.md @@ -0,0 +1,8 @@ +# OpenResponsesWebSearchCallCompletedType + + +## Values + +| Name | Value | +| ------------------------------------ | ------------------------------------ | +| `RESPONSE_WEB_SEARCH_CALL_COMPLETED` | response.web_search_call.completed | \ No newline at end of file diff --git a/docs/components/openresponseswebsearchcallinprogress.md b/docs/components/openresponseswebsearchcallinprogress.md new file mode 100644 index 0000000..0742f76 --- /dev/null +++ b/docs/components/openresponseswebsearchcallinprogress.md @@ -0,0 +1,13 @@ +# OpenResponsesWebSearchCallInProgress + +Web search call in progress + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `type` | [components.OpenResponsesWebSearchCallInProgressType](../components/openresponseswebsearchcallinprogresstype.md) | :heavy_check_mark: | N/A | +| `item_id` | *str* | :heavy_check_mark: | N/A | +| `output_index` | *float* | :heavy_check_mark: | N/A | +| `sequence_number` | *float* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/openresponseswebsearchcallinprogresstype.md b/docs/components/openresponseswebsearchcallinprogresstype.md new file mode 100644 index 0000000..b14d891 --- /dev/null +++ b/docs/components/openresponseswebsearchcallinprogresstype.md @@ -0,0 +1,8 @@ +# OpenResponsesWebSearchCallInProgressType + + +## Values + +| Name | Value | +| -------------------------------------- | -------------------------------------- | +| `RESPONSE_WEB_SEARCH_CALL_IN_PROGRESS` | response.web_search_call.in_progress | \ No newline at end of file diff --git a/docs/components/openresponseswebsearchcallsearching.md b/docs/components/openresponseswebsearchcallsearching.md new file mode 100644 index 0000000..e552a00 --- /dev/null +++ b/docs/components/openresponseswebsearchcallsearching.md @@ -0,0 +1,13 @@ +# OpenResponsesWebSearchCallSearching + +Web search call is searching + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `type` | [components.OpenResponsesWebSearchCallSearchingType](../components/openresponseswebsearchcallsearchingtype.md) | :heavy_check_mark: | N/A | +| `item_id` | *str* | :heavy_check_mark: | N/A | +| `output_index` | *float* | :heavy_check_mark: | N/A | +| `sequence_number` | *float* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/openresponseswebsearchcallsearchingtype.md b/docs/components/openresponseswebsearchcallsearchingtype.md new file mode 100644 index 0000000..816367a --- /dev/null +++ b/docs/components/openresponseswebsearchcallsearchingtype.md @@ -0,0 +1,8 @@ +# OpenResponsesWebSearchCallSearchingType + + +## Values + +| Name | Value | +| ------------------------------------ | ------------------------------------ | +| `RESPONSE_WEB_SEARCH_CALL_SEARCHING` | response.web_search_call.searching | \ No newline at end of file diff --git a/docs/components/openresponseswebsearchpreview20250311tool.md b/docs/components/openresponseswebsearchpreview20250311tool.md index 1b63f77..4914a3c 100644 --- a/docs/components/openresponseswebsearchpreview20250311tool.md +++ b/docs/components/openresponseswebsearchpreview20250311tool.md @@ -5,8 +5,11 @@ Web search preview tool configuration (2025-03-11 version) ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| `type` | [components.OpenResponsesWebSearchPreview20250311ToolType](../components/openresponseswebsearchpreview20250311tooltype.md) | :heavy_check_mark: | N/A | | -| `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | -| `user_location` | [OptionalNullable[components.WebSearchPreviewToolUserLocation]](../components/websearchpreviewtooluserlocation.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | [components.OpenResponsesWebSearchPreview20250311ToolType](../components/openresponseswebsearchpreview20250311tooltype.md) | :heavy_check_mark: | N/A | | +| `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | +| `user_location` | [OptionalNullable[components.WebSearchPreviewToolUserLocation]](../components/websearchpreviewtooluserlocation.md) | :heavy_minus_sign: | N/A | | +| `engine` | [Optional[components.OpenResponsesWebSearchPreview20250311ToolEngine]](../components/openresponseswebsearchpreview20250311toolengine.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 (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. | auto | +| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. | 5 | +| `filters` | [OptionalNullable[components.OpenResponsesWebSearchPreview20250311ToolFilters]](../components/openresponseswebsearchpreview20250311toolfilters.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/components/openresponseswebsearchpreview20250311toolengine.md b/docs/components/openresponseswebsearchpreview20250311toolengine.md new file mode 100644 index 0000000..c7713b9 --- /dev/null +++ b/docs/components/openresponseswebsearchpreview20250311toolengine.md @@ -0,0 +1,12 @@ +# OpenResponsesWebSearchPreview20250311ToolEngine + +Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. + + +## Values + +| Name | Value | +| -------- | -------- | +| `AUTO` | auto | +| `NATIVE` | native | +| `EXA` | exa | \ No newline at end of file diff --git a/docs/components/openresponseswebsearchpreview20250311toolfilters.md b/docs/components/openresponseswebsearchpreview20250311toolfilters.md new file mode 100644 index 0000000..be51113 --- /dev/null +++ b/docs/components/openresponseswebsearchpreview20250311toolfilters.md @@ -0,0 +1,9 @@ +# OpenResponsesWebSearchPreview20250311ToolFilters + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `allowed_domains` | List[*str*] | :heavy_minus_sign: | N/A | +| `excluded_domains` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/openresponseswebsearchpreviewtool.md b/docs/components/openresponseswebsearchpreviewtool.md index 67b7a4f..673f95e 100644 --- a/docs/components/openresponseswebsearchpreviewtool.md +++ b/docs/components/openresponseswebsearchpreviewtool.md @@ -5,8 +5,11 @@ Web search preview tool configuration ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | -| `type` | [components.OpenResponsesWebSearchPreviewToolType](../components/openresponseswebsearchpreviewtooltype.md) | :heavy_check_mark: | N/A | | -| `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | -| `user_location` | [OptionalNullable[components.WebSearchPreviewToolUserLocation]](../components/websearchpreviewtooluserlocation.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | [components.OpenResponsesWebSearchPreviewToolType](../components/openresponseswebsearchpreviewtooltype.md) | :heavy_check_mark: | N/A | | +| `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | +| `user_location` | [OptionalNullable[components.WebSearchPreviewToolUserLocation]](../components/websearchpreviewtooluserlocation.md) | :heavy_minus_sign: | N/A | | +| `engine` | [Optional[components.OpenResponsesWebSearchPreviewToolEngine]](../components/openresponseswebsearchpreviewtoolengine.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 (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. | auto | +| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. | 5 | +| `filters` | [OptionalNullable[components.OpenResponsesWebSearchPreviewToolFilters]](../components/openresponseswebsearchpreviewtoolfilters.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/components/openresponseswebsearchpreviewtoolengine.md b/docs/components/openresponseswebsearchpreviewtoolengine.md new file mode 100644 index 0000000..4e7249c --- /dev/null +++ b/docs/components/openresponseswebsearchpreviewtoolengine.md @@ -0,0 +1,12 @@ +# OpenResponsesWebSearchPreviewToolEngine + +Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. + + +## Values + +| Name | Value | +| -------- | -------- | +| `AUTO` | auto | +| `NATIVE` | native | +| `EXA` | exa | \ No newline at end of file diff --git a/docs/components/openresponseswebsearchpreviewtoolfilters.md b/docs/components/openresponseswebsearchpreviewtoolfilters.md new file mode 100644 index 0000000..d4b11e6 --- /dev/null +++ b/docs/components/openresponseswebsearchpreviewtoolfilters.md @@ -0,0 +1,9 @@ +# OpenResponsesWebSearchPreviewToolFilters + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `allowed_domains` | List[*str*] | :heavy_minus_sign: | N/A | +| `excluded_domains` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/openresponseswebsearchtool.md b/docs/components/openresponseswebsearchtool.md index 94eeb60..e955409 100644 --- a/docs/components/openresponseswebsearchtool.md +++ b/docs/components/openresponseswebsearchtool.md @@ -5,9 +5,11 @@ Web search tool configuration ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -| `type` | [components.OpenResponsesWebSearchToolType](../components/openresponseswebsearchtooltype.md) | :heavy_check_mark: | N/A | | -| `filters` | [OptionalNullable[components.OpenResponsesWebSearchToolFilters]](../components/openresponseswebsearchtoolfilters.md) | :heavy_minus_sign: | N/A | | -| `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | -| `user_location` | [OptionalNullable[components.ResponsesWebSearchUserLocation]](../components/responseswebsearchuserlocation.md) | :heavy_minus_sign: | User location information for web search | {
"type": "approximate",
"city": "San Francisco",
"country": "USA",
"region": "California",
"timezone": "America/Los_Angeles"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | [components.OpenResponsesWebSearchToolType](../components/openresponseswebsearchtooltype.md) | :heavy_check_mark: | N/A | | +| `filters` | [OptionalNullable[components.OpenResponsesWebSearchToolFilters]](../components/openresponseswebsearchtoolfilters.md) | :heavy_minus_sign: | N/A | | +| `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | +| `user_location` | [OptionalNullable[components.ResponsesWebSearchUserLocation]](../components/responseswebsearchuserlocation.md) | :heavy_minus_sign: | User location information for web search | {
"type": "approximate",
"city": "San Francisco",
"country": "USA",
"region": "California",
"timezone": "America/Los_Angeles"
} | +| `engine` | [Optional[components.OpenResponsesWebSearchToolEngine]](../components/openresponseswebsearchtoolengine.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 (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. | auto | +| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. | 5 | \ No newline at end of file diff --git a/docs/components/openresponseswebsearchtoolengine.md b/docs/components/openresponseswebsearchtoolengine.md new file mode 100644 index 0000000..29a9fa9 --- /dev/null +++ b/docs/components/openresponseswebsearchtoolengine.md @@ -0,0 +1,12 @@ +# OpenResponsesWebSearchToolEngine + +Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. + + +## Values + +| Name | Value | +| -------- | -------- | +| `AUTO` | auto | +| `NATIVE` | native | +| `EXA` | exa | \ No newline at end of file diff --git a/docs/components/openresponseswebsearchtoolfilters.md b/docs/components/openresponseswebsearchtoolfilters.md index 2528409..5a26638 100644 --- a/docs/components/openresponseswebsearchtoolfilters.md +++ b/docs/components/openresponseswebsearchtoolfilters.md @@ -5,4 +5,5 @@ | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `allowed_domains` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file +| `allowed_domains` | List[*str*] | :heavy_minus_sign: | N/A | +| `excluded_domains` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/outputformat.md b/docs/components/outputformat.md new file mode 100644 index 0000000..7f5c545 --- /dev/null +++ b/docs/components/outputformat.md @@ -0,0 +1,10 @@ +# OutputFormat + + +## Values + +| Name | Value | +| ------ | ------ | +| `PNG` | png | +| `WEBP` | webp | +| `JPEG` | jpeg | \ No newline at end of file diff --git a/docs/components/outputinputimage.md b/docs/components/outputinputimage.md new file mode 100644 index 0000000..7eb78c5 --- /dev/null +++ b/docs/components/outputinputimage.md @@ -0,0 +1,12 @@ +# OutputInputImage + +Image input content item + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `type` | [components.OutputType](../components/outputtype.md) | :heavy_check_mark: | N/A | +| `detail` | [components.OpenResponsesFunctionCallOutputDetail](../components/openresponsesfunctioncalloutputdetail.md) | :heavy_check_mark: | N/A | +| `image_url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/outputmessage.md b/docs/components/outputmessage.md index 4ce0ea9..4cb87d5 100644 --- a/docs/components/outputmessage.md +++ b/docs/components/outputmessage.md @@ -3,10 +3,11 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `id` | *str* | :heavy_check_mark: | N/A | -| `role` | [components.OutputMessageRole](../components/outputmessagerole.md) | :heavy_check_mark: | N/A | -| `type` | [components.OutputMessageType](../components/outputmessagetype.md) | :heavy_check_mark: | N/A | -| `status` | [Optional[components.OutputMessageStatusUnion]](../components/outputmessagestatusunion.md) | :heavy_minus_sign: | N/A | -| `content` | List[[components.OutputMessageContent](../components/outputmessagecontent.md)] | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `role` | [components.OutputMessageRole](../components/outputmessagerole.md) | :heavy_check_mark: | N/A | +| `type` | [components.OutputMessageType](../components/outputmessagetype.md) | :heavy_check_mark: | N/A | +| `status` | [Optional[components.OutputMessageStatusUnion]](../components/outputmessagestatusunion.md) | :heavy_minus_sign: | N/A | +| `content` | List[[components.OutputMessageContent](../components/outputmessagecontent.md)] | :heavy_check_mark: | N/A | +| `phase` | [OptionalNullable[components.OutputMessagePhaseUnion]](../components/outputmessagephaseunion.md) | :heavy_minus_sign: | 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. | \ No newline at end of file diff --git a/docs/components/outputmessagephasecommentary.md b/docs/components/outputmessagephasecommentary.md new file mode 100644 index 0000000..1053c34 --- /dev/null +++ b/docs/components/outputmessagephasecommentary.md @@ -0,0 +1,8 @@ +# OutputMessagePhaseCommentary + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `COMMENTARY` | commentary | \ No newline at end of file diff --git a/docs/components/outputmessagephasefinalanswer.md b/docs/components/outputmessagephasefinalanswer.md new file mode 100644 index 0000000..ce8cf69 --- /dev/null +++ b/docs/components/outputmessagephasefinalanswer.md @@ -0,0 +1,8 @@ +# OutputMessagePhaseFinalAnswer + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `FINAL_ANSWER` | final_answer | \ No newline at end of file diff --git a/docs/components/outputmessagephaseunion.md b/docs/components/outputmessagephaseunion.md new file mode 100644 index 0000000..e5d9815 --- /dev/null +++ b/docs/components/outputmessagephaseunion.md @@ -0,0 +1,25 @@ +# OutputMessagePhaseUnion + +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. + + +## Supported Types + +### `components.OutputMessagePhaseCommentary` + +```python +value: components.OutputMessagePhaseCommentary = /* values here */ +``` + +### `components.OutputMessagePhaseFinalAnswer` + +```python +value: components.OutputMessagePhaseFinalAnswer = /* values here */ +``` + +### `Any` + +```python +value: Any = /* values here */ +``` + diff --git a/docs/components/outputmodality.md b/docs/components/outputmodality.md index 1601276..faae463 100644 --- a/docs/components/outputmodality.md +++ b/docs/components/outputmodality.md @@ -8,4 +8,5 @@ | `TEXT` | text | | `IMAGE` | image | | `EMBEDDINGS` | embeddings | -| `AUDIO` | audio | \ No newline at end of file +| `AUDIO` | audio | +| `VIDEO` | video | \ No newline at end of file diff --git a/docs/components/outputtype.md b/docs/components/outputtype.md new file mode 100644 index 0000000..81e1750 --- /dev/null +++ b/docs/components/outputtype.md @@ -0,0 +1,8 @@ +# OutputType + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `INPUT_IMAGE` | input_image | \ No newline at end of file diff --git a/docs/components/providername.md b/docs/components/providername.md index 66caed6..478d28b 100644 --- a/docs/components/providername.md +++ b/docs/components/providername.md @@ -5,6 +5,7 @@ | Name | Value | | ------------------- | ------------------- | +| `AKASH_ML` | AkashML | | `AI21` | AI21 | | `AION_LABS` | AionLabs | | `ALIBABA` | Alibaba | diff --git a/docs/components/providerpreferencesby.md b/docs/components/providerpreferencesby.md index 3202834..2af40e5 100644 --- a/docs/components/providerpreferencesby.md +++ b/docs/components/providerpreferencesby.md @@ -9,4 +9,5 @@ The provider sorting strategy (price, throughput, latency) | ------------ | ------------ | | `PRICE` | price | | `THROUGHPUT` | throughput | -| `LATENCY` | latency | \ No newline at end of file +| `LATENCY` | latency | +| `EXACTO` | exacto | \ No newline at end of file diff --git a/docs/components/providerpreferencesprovidersort.md b/docs/components/providerpreferencesprovidersort.md index 396da79..2f06e03 100644 --- a/docs/components/providerpreferencesprovidersort.md +++ b/docs/components/providerpreferencesprovidersort.md @@ -9,4 +9,5 @@ The provider sorting strategy (price, throughput, latency) | ------------ | ------------ | | `PRICE` | price | | `THROUGHPUT` | throughput | -| `LATENCY` | latency | \ No newline at end of file +| `LATENCY` | latency | +| `EXACTO` | exacto | \ No newline at end of file diff --git a/docs/components/providerpreferencesprovidersortconfigenum.md b/docs/components/providerpreferencesprovidersortconfigenum.md index 12ef73b..3e50142 100644 --- a/docs/components/providerpreferencesprovidersortconfigenum.md +++ b/docs/components/providerpreferencesprovidersortconfigenum.md @@ -7,4 +7,5 @@ | ------------ | ------------ | | `PRICE` | price | | `THROUGHPUT` | throughput | -| `LATENCY` | latency | \ No newline at end of file +| `LATENCY` | latency | +| `EXACTO` | exacto | \ No newline at end of file diff --git a/docs/components/providerpreferencessortenum.md b/docs/components/providerpreferencessortenum.md index 4b608c9..70cdaa9 100644 --- a/docs/components/providerpreferencessortenum.md +++ b/docs/components/providerpreferencessortenum.md @@ -7,4 +7,5 @@ | ------------ | ------------ | | `PRICE` | price | | `THROUGHPUT` | throughput | -| `LATENCY` | latency | \ No newline at end of file +| `LATENCY` | latency | +| `EXACTO` | exacto | \ No newline at end of file diff --git a/docs/components/providersort.md b/docs/components/providersort.md index ca5b358..82a08f5 100644 --- a/docs/components/providersort.md +++ b/docs/components/providersort.md @@ -9,4 +9,5 @@ The provider sorting strategy (price, throughput, latency) | ------------ | ------------ | | `PRICE` | price | | `THROUGHPUT` | throughput | -| `LATENCY` | latency | \ No newline at end of file +| `LATENCY` | latency | +| `EXACTO` | exacto | \ No newline at end of file diff --git a/docs/components/quality.md b/docs/components/quality.md new file mode 100644 index 0000000..a09a449 --- /dev/null +++ b/docs/components/quality.md @@ -0,0 +1,11 @@ +# Quality + + +## Values + +| Name | Value | +| -------- | -------- | +| `LOW` | low | +| `MEDIUM` | medium | +| `HIGH` | high | +| `AUTO` | auto | \ No newline at end of file diff --git a/docs/components/ranker.md b/docs/components/ranker.md new file mode 100644 index 0000000..1257699 --- /dev/null +++ b/docs/components/ranker.md @@ -0,0 +1,9 @@ +# Ranker + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `AUTO` | auto | +| `DEFAULT_2024_11_15` | default-2024-11-15 | \ No newline at end of file diff --git a/docs/components/rankingoptions.md b/docs/components/rankingoptions.md new file mode 100644 index 0000000..b1917b1 --- /dev/null +++ b/docs/components/rankingoptions.md @@ -0,0 +1,9 @@ +# RankingOptions + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `ranker` | [Optional[components.Ranker]](../components/ranker.md) | :heavy_minus_sign: | N/A | +| `score_threshold` | *Optional[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/requireapproval.md b/docs/components/requireapproval.md new file mode 100644 index 0000000..e69f115 --- /dev/null +++ b/docs/components/requireapproval.md @@ -0,0 +1,9 @@ +# RequireApproval + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `never` | [Optional[components.Never]](../components/never.md) | :heavy_minus_sign: | N/A | +| `always` | [Optional[components.Always]](../components/always.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/requireapprovalalways.md b/docs/components/requireapprovalalways.md new file mode 100644 index 0000000..327ede0 --- /dev/null +++ b/docs/components/requireapprovalalways.md @@ -0,0 +1,8 @@ +# RequireApprovalAlways + + +## Values + +| Name | Value | +| -------- | -------- | +| `ALWAYS` | always | \ No newline at end of file diff --git a/docs/components/requireapprovalnever.md b/docs/components/requireapprovalnever.md new file mode 100644 index 0000000..7cd7f14 --- /dev/null +++ b/docs/components/requireapprovalnever.md @@ -0,0 +1,8 @@ +# RequireApprovalNever + + +## Values + +| Name | Value | +| ------- | ------- | +| `NEVER` | never | \ No newline at end of file diff --git a/docs/components/responseoutputtext.md b/docs/components/responseoutputtext.md index 0fba621..1c8bea4 100644 --- a/docs/components/responseoutputtext.md +++ b/docs/components/responseoutputtext.md @@ -8,4 +8,4 @@ | `type` | [components.ResponseOutputTextType](../components/responseoutputtexttype.md) | :heavy_check_mark: | N/A | | `text` | *str* | :heavy_check_mark: | N/A | | `annotations` | List[[components.OpenAIResponsesAnnotation](../components/openairesponsesannotation.md)] | :heavy_minus_sign: | N/A | -| `logprobs` | List[[components.Logprob](../components/logprob.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file +| `logprobs` | List[[components.ResponseOutputTextLogprob](../components/responseoutputtextlogprob.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/logprob.md b/docs/components/responseoutputtextlogprob.md similarity index 98% rename from docs/components/logprob.md rename to docs/components/responseoutputtextlogprob.md index 3952f4f..8d54154 100644 --- a/docs/components/logprob.md +++ b/docs/components/responseoutputtextlogprob.md @@ -1,4 +1,4 @@ -# Logprob +# ResponseOutputTextLogprob ## Fields diff --git a/docs/components/responsesoutputitem.md b/docs/components/responsesoutputitem.md index 01b3528..082c8d8 100644 --- a/docs/components/responsesoutputitem.md +++ b/docs/components/responsesoutputitem.md @@ -41,3 +41,9 @@ value: components.ResponsesOutputItemFileSearchCall = /* values here */ value: components.ResponsesImageGenerationCall = /* values here */ ``` +### `components.ResponsesServerToolOutput` + +```python +value: components.ResponsesServerToolOutput = /* values here */ +``` + diff --git a/docs/components/responsesoutputmessage.md b/docs/components/responsesoutputmessage.md index 84766c4..b65a1a0 100644 --- a/docs/components/responsesoutputmessage.md +++ b/docs/components/responsesoutputmessage.md @@ -5,10 +5,11 @@ An output message item ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `id` | *str* | :heavy_check_mark: | N/A | -| `role` | [components.ResponsesOutputMessageRole](../components/responsesoutputmessagerole.md) | :heavy_check_mark: | N/A | -| `type` | [components.ResponsesOutputMessageType](../components/responsesoutputmessagetype.md) | :heavy_check_mark: | N/A | -| `status` | [Optional[components.ResponsesOutputMessageStatusUnion]](../components/responsesoutputmessagestatusunion.md) | :heavy_minus_sign: | N/A | -| `content` | List[[components.ResponsesOutputMessageContent](../components/responsesoutputmessagecontent.md)] | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | N/A | +| `role` | [components.ResponsesOutputMessageRole](../components/responsesoutputmessagerole.md) | :heavy_check_mark: | N/A | +| `type` | [components.ResponsesOutputMessageType](../components/responsesoutputmessagetype.md) | :heavy_check_mark: | N/A | +| `status` | [Optional[components.ResponsesOutputMessageStatusUnion]](../components/responsesoutputmessagestatusunion.md) | :heavy_minus_sign: | N/A | +| `content` | List[[components.ResponsesOutputMessageContent](../components/responsesoutputmessagecontent.md)] | :heavy_check_mark: | N/A | +| `phase` | [OptionalNullable[components.ResponsesOutputMessagePhaseUnion]](../components/responsesoutputmessagephaseunion.md) | :heavy_minus_sign: | 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. | \ No newline at end of file diff --git a/docs/components/responsesoutputmessagephasecommentary.md b/docs/components/responsesoutputmessagephasecommentary.md new file mode 100644 index 0000000..0d9a7a7 --- /dev/null +++ b/docs/components/responsesoutputmessagephasecommentary.md @@ -0,0 +1,8 @@ +# ResponsesOutputMessagePhaseCommentary + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `COMMENTARY` | commentary | \ No newline at end of file diff --git a/docs/components/responsesoutputmessagephasefinalanswer.md b/docs/components/responsesoutputmessagephasefinalanswer.md new file mode 100644 index 0000000..f2eafc7 --- /dev/null +++ b/docs/components/responsesoutputmessagephasefinalanswer.md @@ -0,0 +1,8 @@ +# ResponsesOutputMessagePhaseFinalAnswer + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `FINAL_ANSWER` | final_answer | \ No newline at end of file diff --git a/docs/components/responsesoutputmessagephaseunion.md b/docs/components/responsesoutputmessagephaseunion.md new file mode 100644 index 0000000..2da105d --- /dev/null +++ b/docs/components/responsesoutputmessagephaseunion.md @@ -0,0 +1,25 @@ +# ResponsesOutputMessagePhaseUnion + +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. + + +## Supported Types + +### `components.ResponsesOutputMessagePhaseCommentary` + +```python +value: components.ResponsesOutputMessagePhaseCommentary = /* values here */ +``` + +### `components.ResponsesOutputMessagePhaseFinalAnswer` + +```python +value: components.ResponsesOutputMessagePhaseFinalAnswer = /* values here */ +``` + +### `Any` + +```python +value: Any = /* values here */ +``` + diff --git a/docs/components/responsesservertooloutput.md b/docs/components/responsesservertooloutput.md new file mode 100644 index 0000000..d55368d --- /dev/null +++ b/docs/components/responsesservertooloutput.md @@ -0,0 +1,13 @@ +# ResponsesServerToolOutput + +A generic OpenRouter server tool output item + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `type` | *str* | :heavy_check_mark: | Server tool type (e.g. openrouter:datetime, openrouter:web_search) | | +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `status` | [components.ResponsesServerToolOutputStatus](../components/responsesservertooloutputstatus.md) | :heavy_check_mark: | N/A | | +| `__pydantic_extra__` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | {
"type": "openrouter:web_search",
"id": "ws_tmp_abc123",
"status": "completed"
} | \ No newline at end of file diff --git a/docs/components/responsesservertooloutputstatus.md b/docs/components/responsesservertooloutputstatus.md new file mode 100644 index 0000000..799f555 --- /dev/null +++ b/docs/components/responsesservertooloutputstatus.md @@ -0,0 +1,10 @@ +# ResponsesServerToolOutputStatus + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `COMPLETED` | completed | +| `IN_PROGRESS` | in_progress | +| `INCOMPLETE` | incomplete | \ No newline at end of file diff --git a/docs/components/responseswebsearchcalloutput.md b/docs/components/responseswebsearchcalloutput.md index 3514d2f..ac75f1c 100644 --- a/docs/components/responseswebsearchcalloutput.md +++ b/docs/components/responseswebsearchcalloutput.md @@ -3,8 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `type` | [components.ResponsesWebSearchCallOutputType](../components/responseswebsearchcalloutputtype.md) | :heavy_check_mark: | N/A | | -| `id` | *str* | :heavy_check_mark: | N/A | | -| `status` | [components.WebSearchStatus](../components/websearchstatus.md) | :heavy_check_mark: | N/A | completed | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `type` | [components.TypeWebSearchCall](../components/typewebsearchcall.md) | :heavy_check_mark: | N/A | | +| `id` | *str* | :heavy_check_mark: | N/A | | +| `action` | [components.Action](../components/action.md) | :heavy_check_mark: | N/A | | +| `status` | [components.WebSearchStatus](../components/websearchstatus.md) | :heavy_check_mark: | N/A | completed | \ No newline at end of file diff --git a/docs/components/responseswebsearchservertool.md b/docs/components/responseswebsearchservertool.md new file mode 100644 index 0000000..f2642d6 --- /dev/null +++ b/docs/components/responseswebsearchservertool.md @@ -0,0 +1,11 @@ +# ResponsesWebSearchServerTool + +OpenRouter built-in server tool: searches the web for current information + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `type` | [components.ResponsesWebSearchServerToolType](../components/responseswebsearchservertooltype.md) | :heavy_check_mark: | N/A | +| `parameters` | [Optional[components.ResponsesWebSearchServerToolParameters]](../components/responseswebsearchservertoolparameters.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/responseswebsearchservertoolparameters.md b/docs/components/responseswebsearchservertoolparameters.md new file mode 100644 index 0000000..7301ab9 --- /dev/null +++ b/docs/components/responseswebsearchservertoolparameters.md @@ -0,0 +1,9 @@ +# ResponsesWebSearchServerToolParameters + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. | 5 | +| `max_total_results` | *Optional[float]* | :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/components/responseswebsearchservertooltype.md b/docs/components/responseswebsearchservertooltype.md new file mode 100644 index 0000000..f539e24 --- /dev/null +++ b/docs/components/responseswebsearchservertooltype.md @@ -0,0 +1,8 @@ +# ResponsesWebSearchServerToolType + + +## Values + +| Name | Value | +| ----------------------- | ----------------------- | +| `OPENROUTER_WEB_SEARCH` | openrouter:web_search | \ No newline at end of file diff --git a/docs/components/size.md b/docs/components/size.md new file mode 100644 index 0000000..4334c6b --- /dev/null +++ b/docs/components/size.md @@ -0,0 +1,11 @@ +# Size + + +## Values + +| Name | Value | +| ----------------------------------------------- | ----------------------------------------------- | +| `ONE_THOUSAND_AND_TWENTY_FOURX1024` | 1024x1024 | +| `ONE_THOUSAND_AND_TWENTY_FOURX1536` | 1024x1536 | +| `ONE_THOUSAND_FIVE_HUNDRED_AND_THIRTY_SIXX1024` | 1536x1024 | +| `AUTO` | auto | \ No newline at end of file diff --git a/docs/components/source.md b/docs/components/source.md new file mode 100644 index 0000000..372e389 --- /dev/null +++ b/docs/components/source.md @@ -0,0 +1,9 @@ +# Source + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `type` | [components.TypeURL](../components/typeurl.md) | :heavy_check_mark: | N/A | +| `url` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/syntax.md b/docs/components/syntax.md new file mode 100644 index 0000000..4b82eb6 --- /dev/null +++ b/docs/components/syntax.md @@ -0,0 +1,9 @@ +# Syntax + + +## Values + +| Name | Value | +| ------- | ------- | +| `LARK` | lark | +| `REGEX` | regex | \ No newline at end of file diff --git a/docs/components/tooldefinitionjson.md b/docs/components/tooldefinitionjson.md index 2a327b7..1706071 100644 --- a/docs/components/tooldefinitionjson.md +++ b/docs/components/tooldefinitionjson.md @@ -1,12 +1,49 @@ # ToolDefinitionJSON -Tool definition for function calling +Tool definition for function calling (regular function or OpenRouter built-in server tool) -## Fields +## Supported Types + +### `components.ToolDefinitionJSONFunction` + +```python +value: components.ToolDefinitionJSONFunction = /* values here */ +``` + +### `components.DatetimeServerTool` + +```python +value: components.DatetimeServerTool = /* values here */ +``` + +### `components.WebSearchServerTool` + +```python +value: components.WebSearchServerTool = /* values here */ +``` + +### `components.WebSearchShorthand` + +```python +value: components.WebSearchShorthand = /* values here */ +``` + +### `components.WebSearchShorthand` + +```python +value: components.WebSearchShorthand = /* values here */ +``` + +### `components.WebSearchShorthand` + +```python +value: components.WebSearchShorthand = /* values here */ +``` + +### `components.WebSearchShorthand` + +```python +value: components.WebSearchShorthand = /* values here */ +``` -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | [components.ToolDefinitionJSONType](../components/tooldefinitionjsontype.md) | :heavy_check_mark: | N/A | | -| `function` | [components.ToolDefinitionJSONFunction](../components/tooldefinitionjsonfunction.md) | :heavy_check_mark: | Function definition for tool calling | {
"name": "get_weather",
"description": "Get the current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City name"
}
},
"required": [
"location"
]
}
} | -| `cache_control` | [Optional[components.ChatMessageContentItemCacheControl]](../components/chatmessagecontentitemcachecontrol.md) | :heavy_minus_sign: | Cache control for the content part | {
"type": "ephemeral",
"ttl": "5m"
} | \ No newline at end of file diff --git a/docs/components/tooldefinitionjsonfunction.md b/docs/components/tooldefinitionjsonfunction.md index d2863a1..944f6ae 100644 --- a/docs/components/tooldefinitionjsonfunction.md +++ b/docs/components/tooldefinitionjsonfunction.md @@ -1,13 +1,10 @@ # ToolDefinitionJSONFunction -Function definition for tool calling - ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -| `name` | *str* | :heavy_check_mark: | Function name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars) | get_weather | -| `description` | *Optional[str]* | :heavy_minus_sign: | Function description for the model | Get the current weather for a location | -| `parameters` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | Function parameters as JSON Schema object | {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City name"
}
},
"required": [
"location"
]
} | -| `strict` | *OptionalNullable[bool]* | :heavy_minus_sign: | Enable strict schema adherence | false | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | [components.ToolDefinitionJSONType](../components/tooldefinitionjsontype.md) | :heavy_check_mark: | N/A | | +| `function` | [components.ToolDefinitionJSONFunctionFunction](../components/tooldefinitionjsonfunctionfunction.md) | :heavy_check_mark: | Function definition for tool calling | {
"name": "get_weather",
"description": "Get the current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City name"
}
},
"required": [
"location"
]
}
} | +| `cache_control` | [Optional[components.ChatMessageContentItemCacheControl]](../components/chatmessagecontentitemcachecontrol.md) | :heavy_minus_sign: | Cache control for the content part | {
"type": "ephemeral",
"ttl": "5m"
} | \ No newline at end of file diff --git a/docs/components/tooldefinitionjsonfunctionfunction.md b/docs/components/tooldefinitionjsonfunctionfunction.md new file mode 100644 index 0000000..be59bda --- /dev/null +++ b/docs/components/tooldefinitionjsonfunctionfunction.md @@ -0,0 +1,13 @@ +# ToolDefinitionJSONFunctionFunction + +Function definition for tool calling + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | Function name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars) | get_weather | +| `description` | *Optional[str]* | :heavy_minus_sign: | Function description for the model | Get the current weather for a location | +| `parameters` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | Function parameters as JSON Schema object | {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City name"
}
},
"required": [
"location"
]
} | +| `strict` | *OptionalNullable[bool]* | :heavy_minus_sign: | Enable strict schema adherence | false | \ No newline at end of file diff --git a/docs/components/typecodeinterpreter.md b/docs/components/typecodeinterpreter.md new file mode 100644 index 0000000..761e09a --- /dev/null +++ b/docs/components/typecodeinterpreter.md @@ -0,0 +1,8 @@ +# TypeCodeInterpreter + + +## Values + +| Name | Value | +| ------------------ | ------------------ | +| `CODE_INTERPRETER` | code_interpreter | \ No newline at end of file diff --git a/docs/components/typecustom.md b/docs/components/typecustom.md new file mode 100644 index 0000000..798b1c5 --- /dev/null +++ b/docs/components/typecustom.md @@ -0,0 +1,8 @@ +# TypeCustom + + +## Values + +| Name | Value | +| -------- | -------- | +| `CUSTOM` | custom | \ No newline at end of file diff --git a/docs/components/typefilesearch.md b/docs/components/typefilesearch.md new file mode 100644 index 0000000..36e3406 --- /dev/null +++ b/docs/components/typefilesearch.md @@ -0,0 +1,8 @@ +# TypeFileSearch + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `FILE_SEARCH` | file_search | \ No newline at end of file diff --git a/docs/components/typefindinpage.md b/docs/components/typefindinpage.md new file mode 100644 index 0000000..14fa785 --- /dev/null +++ b/docs/components/typefindinpage.md @@ -0,0 +1,8 @@ +# TypeFindInPage + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `FIND_IN_PAGE` | find_in_page | \ No newline at end of file diff --git a/docs/components/typeopenpage.md b/docs/components/typeopenpage.md new file mode 100644 index 0000000..37b2408 --- /dev/null +++ b/docs/components/typeopenpage.md @@ -0,0 +1,8 @@ +# TypeOpenPage + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `OPEN_PAGE` | open_page | \ No newline at end of file diff --git a/docs/components/typesearch.md b/docs/components/typesearch.md new file mode 100644 index 0000000..bfea226 --- /dev/null +++ b/docs/components/typesearch.md @@ -0,0 +1,8 @@ +# TypeSearch + + +## Values + +| Name | Value | +| -------- | -------- | +| `SEARCH` | search | \ No newline at end of file diff --git a/docs/components/typeurl.md b/docs/components/typeurl.md new file mode 100644 index 0000000..8965e38 --- /dev/null +++ b/docs/components/typeurl.md @@ -0,0 +1,8 @@ +# TypeURL + + +## Values + +| Name | Value | +| ----- | ----- | +| `URL` | url | \ No newline at end of file diff --git a/docs/components/responseswebsearchcalloutputtype.md b/docs/components/typewebsearchcall.md similarity index 79% rename from docs/components/responseswebsearchcalloutputtype.md rename to docs/components/typewebsearchcall.md index faaec22..f0a4b73 100644 --- a/docs/components/responseswebsearchcalloutputtype.md +++ b/docs/components/typewebsearchcall.md @@ -1,4 +1,4 @@ -# ResponsesWebSearchCallOutputType +# TypeWebSearchCall ## Values diff --git a/docs/components/value1.md b/docs/components/value1.md new file mode 100644 index 0000000..a969ac1 --- /dev/null +++ b/docs/components/value1.md @@ -0,0 +1,17 @@ +# Value1 + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/components/value2.md b/docs/components/value2.md new file mode 100644 index 0000000..a281d05 --- /dev/null +++ b/docs/components/value2.md @@ -0,0 +1,29 @@ +# Value2 + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + +### `bool` + +```python +value: bool = /* values here */ +``` + +### `List[components.Value1]` + +```python +value: List[components.Value1] = /* values here */ +``` + diff --git a/docs/components/websearchengine.md b/docs/components/websearchengine.md index 0b843a8..c0da505 100644 --- a/docs/components/websearchengine.md +++ b/docs/components/websearchengine.md @@ -5,7 +5,9 @@ The search engine to use for web search. ## Values -| Name | Value | -| -------- | -------- | -| `NATIVE` | native | -| `EXA` | exa | \ No newline at end of file +| Name | Value | +| ----------- | ----------- | +| `NATIVE` | native | +| `EXA` | exa | +| `FIRECRAWL` | firecrawl | +| `PARALLEL` | parallel | \ No newline at end of file diff --git a/docs/components/websearchservertool.md b/docs/components/websearchservertool.md new file mode 100644 index 0000000..3502364 --- /dev/null +++ b/docs/components/websearchservertool.md @@ -0,0 +1,11 @@ +# WebSearchServerTool + +OpenRouter built-in server tool: searches the web for current information + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `type` | [components.WebSearchServerToolTypeOpenrouterWebSearch](../components/websearchservertooltypeopenrouterwebsearch.md) | :heavy_check_mark: | N/A | +| `parameters` | [Optional[components.WebSearchServerToolParameters]](../components/websearchservertoolparameters.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/websearchservertoolengine.md b/docs/components/websearchservertoolengine.md new file mode 100644 index 0000000..e469c18 --- /dev/null +++ b/docs/components/websearchservertoolengine.md @@ -0,0 +1,12 @@ +# WebSearchServerToolEngine + +Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. + + +## Values + +| Name | Value | +| -------- | -------- | +| `AUTO` | auto | +| `NATIVE` | native | +| `EXA` | exa | \ No newline at end of file diff --git a/docs/components/websearchservertoolparameters.md b/docs/components/websearchservertoolparameters.md new file mode 100644 index 0000000..c0135de --- /dev/null +++ b/docs/components/websearchservertoolparameters.md @@ -0,0 +1,14 @@ +# WebSearchServerToolParameters + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `engine` | [Optional[components.WebSearchServerToolEngine]](../components/websearchservertoolengine.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 (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. | auto | +| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. | 5 | +| `max_total_results` | *Optional[float]* | :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 | +| `search_context_size` | [Optional[components.WebSearchServerToolSearchContextSize]](../components/websearchservertoolsearchcontextsize.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. | | +| `user_location` | [Optional[components.WebSearchServerToolUserLocation]](../components/websearchservertooluserlocation.md) | :heavy_minus_sign: | Approximate user location for location-biased results. | | +| `allowed_domains` | List[*str*] | :heavy_minus_sign: | Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search. | | +| `excluded_domains` | List[*str*] | :heavy_minus_sign: | Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search. | | \ No newline at end of file diff --git a/docs/components/websearchservertoolparameterstype.md b/docs/components/websearchservertoolparameterstype.md new file mode 100644 index 0000000..2cec5fb --- /dev/null +++ b/docs/components/websearchservertoolparameterstype.md @@ -0,0 +1,8 @@ +# WebSearchServerToolParametersType + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `APPROXIMATE` | approximate | \ No newline at end of file diff --git a/docs/components/websearchservertoolsearchcontextsize.md b/docs/components/websearchservertoolsearchcontextsize.md new file mode 100644 index 0000000..519bd4b --- /dev/null +++ b/docs/components/websearchservertoolsearchcontextsize.md @@ -0,0 +1,12 @@ +# WebSearchServerToolSearchContextSize + +How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search. + + +## Values + +| Name | Value | +| -------- | -------- | +| `LOW` | low | +| `MEDIUM` | medium | +| `HIGH` | high | \ No newline at end of file diff --git a/docs/components/websearchservertooltypeopenrouterwebsearch.md b/docs/components/websearchservertooltypeopenrouterwebsearch.md new file mode 100644 index 0000000..41beb16 --- /dev/null +++ b/docs/components/websearchservertooltypeopenrouterwebsearch.md @@ -0,0 +1,8 @@ +# WebSearchServerToolTypeOpenrouterWebSearch + + +## Values + +| Name | Value | +| ----------------------- | ----------------------- | +| `OPENROUTER_WEB_SEARCH` | openrouter:web_search | \ No newline at end of file diff --git a/docs/components/websearchservertooluserlocation.md b/docs/components/websearchservertooluserlocation.md new file mode 100644 index 0000000..3f68fc4 --- /dev/null +++ b/docs/components/websearchservertooluserlocation.md @@ -0,0 +1,14 @@ +# WebSearchServerToolUserLocation + +Approximate user location for location-biased results. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `type` | [Optional[components.WebSearchServerToolParametersType]](../components/websearchservertoolparameterstype.md) | :heavy_minus_sign: | N/A | +| `city` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `region` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `country` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `timezone` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/websearchshorthand.md b/docs/components/websearchshorthand.md new file mode 100644 index 0000000..8090540 --- /dev/null +++ b/docs/components/websearchshorthand.md @@ -0,0 +1,18 @@ +# WebSearchShorthand + +Web search tool using OpenAI Responses API syntax. Automatically converted to openrouter:web_search. + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | [components.WebSearchShorthandType](../components/websearchshorthandtype.md) | :heavy_check_mark: | N/A | | +| `engine` | [Optional[components.WebSearchShorthandEngine]](../components/websearchshorthandengine.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 (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. | auto | +| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. | 5 | +| `max_total_results` | *Optional[float]* | :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 | +| `search_context_size` | [Optional[components.WebSearchShorthandSearchContextSize]](../components/websearchshorthandsearchcontextsize.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. | | +| `user_location` | [Optional[components.WebSearchShorthandUserLocation]](../components/websearchshorthanduserlocation.md) | :heavy_minus_sign: | Approximate user location for location-biased results. | | +| `allowed_domains` | List[*str*] | :heavy_minus_sign: | Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search. | | +| `excluded_domains` | List[*str*] | :heavy_minus_sign: | Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search. | | +| `parameters` | [Optional[components.WebSearchShorthandParameters]](../components/websearchshorthandparameters.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/components/websearchshorthandengine.md b/docs/components/websearchshorthandengine.md new file mode 100644 index 0000000..a3aa92d --- /dev/null +++ b/docs/components/websearchshorthandengine.md @@ -0,0 +1,12 @@ +# WebSearchShorthandEngine + +Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. + + +## Values + +| Name | Value | +| -------- | -------- | +| `AUTO` | auto | +| `NATIVE` | native | +| `EXA` | exa | \ No newline at end of file diff --git a/docs/components/websearchshorthandparameters.md b/docs/components/websearchshorthandparameters.md new file mode 100644 index 0000000..71bb9b8 --- /dev/null +++ b/docs/components/websearchshorthandparameters.md @@ -0,0 +1,14 @@ +# WebSearchShorthandParameters + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `engine` | [Optional[components.WebSearchShorthandParametersEngine]](../components/websearchshorthandparametersengine.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 (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. | auto | +| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. | 5 | +| `max_total_results` | *Optional[float]* | :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 | +| `search_context_size` | [Optional[components.WebSearchShorthandParametersSearchContextSize]](../components/websearchshorthandparameterssearchcontextsize.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. | | +| `user_location` | [Optional[components.WebSearchShorthandParametersUserLocation]](../components/websearchshorthandparametersuserlocation.md) | :heavy_minus_sign: | Approximate user location for location-biased results. | | +| `allowed_domains` | List[*str*] | :heavy_minus_sign: | Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search. | | +| `excluded_domains` | List[*str*] | :heavy_minus_sign: | Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search. | | \ No newline at end of file diff --git a/docs/components/websearchshorthandparametersengine.md b/docs/components/websearchshorthandparametersengine.md new file mode 100644 index 0000000..c963530 --- /dev/null +++ b/docs/components/websearchshorthandparametersengine.md @@ -0,0 +1,12 @@ +# WebSearchShorthandParametersEngine + +Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. + + +## Values + +| Name | Value | +| -------- | -------- | +| `AUTO` | auto | +| `NATIVE` | native | +| `EXA` | exa | \ No newline at end of file diff --git a/docs/components/websearchshorthandparameterssearchcontextsize.md b/docs/components/websearchshorthandparameterssearchcontextsize.md new file mode 100644 index 0000000..118270a --- /dev/null +++ b/docs/components/websearchshorthandparameterssearchcontextsize.md @@ -0,0 +1,12 @@ +# WebSearchShorthandParametersSearchContextSize + +How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search. + + +## Values + +| Name | Value | +| -------- | -------- | +| `LOW` | low | +| `MEDIUM` | medium | +| `HIGH` | high | \ No newline at end of file diff --git a/docs/components/websearchshorthandparameterstype.md b/docs/components/websearchshorthandparameterstype.md new file mode 100644 index 0000000..d0615a8 --- /dev/null +++ b/docs/components/websearchshorthandparameterstype.md @@ -0,0 +1,8 @@ +# WebSearchShorthandParametersType + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `APPROXIMATE` | approximate | \ No newline at end of file diff --git a/docs/components/websearchshorthandparametersuserlocation.md b/docs/components/websearchshorthandparametersuserlocation.md new file mode 100644 index 0000000..fc5374c --- /dev/null +++ b/docs/components/websearchshorthandparametersuserlocation.md @@ -0,0 +1,14 @@ +# WebSearchShorthandParametersUserLocation + +Approximate user location for location-biased results. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `type` | [Optional[components.WebSearchShorthandParametersType]](../components/websearchshorthandparameterstype.md) | :heavy_minus_sign: | N/A | +| `city` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `region` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `country` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `timezone` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/websearchshorthandsearchcontextsize.md b/docs/components/websearchshorthandsearchcontextsize.md new file mode 100644 index 0000000..157f9d0 --- /dev/null +++ b/docs/components/websearchshorthandsearchcontextsize.md @@ -0,0 +1,12 @@ +# WebSearchShorthandSearchContextSize + +How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search. + + +## Values + +| Name | Value | +| -------- | -------- | +| `LOW` | low | +| `MEDIUM` | medium | +| `HIGH` | high | \ No newline at end of file diff --git a/docs/components/websearchshorthandtype.md b/docs/components/websearchshorthandtype.md new file mode 100644 index 0000000..02fc102 --- /dev/null +++ b/docs/components/websearchshorthandtype.md @@ -0,0 +1,11 @@ +# WebSearchShorthandType + + +## Values + +| Name | Value | +| ------------------------------- | ------------------------------- | +| `WEB_SEARCH` | web_search | +| `WEB_SEARCH_PREVIEW` | web_search_preview | +| `WEB_SEARCH_PREVIEW_2025_03_11` | web_search_preview_2025_03_11 | +| `WEB_SEARCH_2025_08_26` | web_search_2025_08_26 | \ No newline at end of file diff --git a/docs/components/websearchshorthandtypeapproximate.md b/docs/components/websearchshorthandtypeapproximate.md new file mode 100644 index 0000000..aeeaa63 --- /dev/null +++ b/docs/components/websearchshorthandtypeapproximate.md @@ -0,0 +1,8 @@ +# WebSearchShorthandTypeApproximate + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `APPROXIMATE` | approximate | \ No newline at end of file diff --git a/docs/components/websearchshorthanduserlocation.md b/docs/components/websearchshorthanduserlocation.md new file mode 100644 index 0000000..ae546a6 --- /dev/null +++ b/docs/components/websearchshorthanduserlocation.md @@ -0,0 +1,14 @@ +# WebSearchShorthandUserLocation + +Approximate user location for location-biased results. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `type` | [Optional[components.WebSearchShorthandTypeApproximate]](../components/websearchshorthandtypeapproximate.md) | :heavy_minus_sign: | N/A | +| `city` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `region` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `country` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `timezone` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/errors/conflictresponseerror.md b/docs/errors/conflictresponseerror.md new file mode 100644 index 0000000..b3da3b7 --- /dev/null +++ b/docs/errors/conflictresponseerror.md @@ -0,0 +1,11 @@ +# ConflictResponseError + +Conflict - Resource conflict or concurrent modification + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `error` | [components.ConflictResponseErrorData](../components/conflictresponseerrordata.md) | :heavy_check_mark: | Error data for ConflictResponse | {
"code": 409,
"message": "Resource conflict. Please try again later."
} | +| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/internal/globals.md b/docs/models/internal/globals.md index 5399b31..5b30448 100644 --- a/docs/models/internal/globals.md +++ b/docs/models/internal/globals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/bulkassignkeystoguardrailglobals.md b/docs/operations/bulkassignkeystoguardrailglobals.md index e54eb49..1b45a85 100644 --- a/docs/operations/bulkassignkeystoguardrailglobals.md +++ b/docs/operations/bulkassignkeystoguardrailglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/bulkassignkeystoguardrailrequest.md b/docs/operations/bulkassignkeystoguardrailrequest.md index 61e77dd..ea428c6 100644 --- a/docs/operations/bulkassignkeystoguardrailrequest.md +++ b/docs/operations/bulkassignkeystoguardrailrequest.md @@ -6,6 +6,7 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | | `request_body` | [operations.BulkAssignKeysToGuardrailRequestBody](../operations/bulkassignkeystoguardrailrequestbody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/operations/bulkassignmemberstoguardrailglobals.md b/docs/operations/bulkassignmemberstoguardrailglobals.md index 0194980..b970409 100644 --- a/docs/operations/bulkassignmemberstoguardrailglobals.md +++ b/docs/operations/bulkassignmemberstoguardrailglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/bulkassignmemberstoguardrailrequest.md b/docs/operations/bulkassignmemberstoguardrailrequest.md index 25ff165..beaf174 100644 --- a/docs/operations/bulkassignmemberstoguardrailrequest.md +++ b/docs/operations/bulkassignmemberstoguardrailrequest.md @@ -6,6 +6,7 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | | `request_body` | [operations.BulkAssignMembersToGuardrailRequestBody](../operations/bulkassignmemberstoguardrailrequestbody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/operations/bulkunassignkeysfromguardrailglobals.md b/docs/operations/bulkunassignkeysfromguardrailglobals.md index 7241f74..8472ab4 100644 --- a/docs/operations/bulkunassignkeysfromguardrailglobals.md +++ b/docs/operations/bulkunassignkeysfromguardrailglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/bulkunassignkeysfromguardrailrequest.md b/docs/operations/bulkunassignkeysfromguardrailrequest.md index 07aa84f..b80c239 100644 --- a/docs/operations/bulkunassignkeysfromguardrailrequest.md +++ b/docs/operations/bulkunassignkeysfromguardrailrequest.md @@ -6,6 +6,7 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | | `request_body` | [operations.BulkUnassignKeysFromGuardrailRequestBody](../operations/bulkunassignkeysfromguardrailrequestbody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/operations/bulkunassignmembersfromguardrailglobals.md b/docs/operations/bulkunassignmembersfromguardrailglobals.md index 57ed776..5df6bb6 100644 --- a/docs/operations/bulkunassignmembersfromguardrailglobals.md +++ b/docs/operations/bulkunassignmembersfromguardrailglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/bulkunassignmembersfromguardrailrequest.md b/docs/operations/bulkunassignmembersfromguardrailrequest.md index f85e43e..90a9475 100644 --- a/docs/operations/bulkunassignmembersfromguardrailrequest.md +++ b/docs/operations/bulkunassignmembersfromguardrailrequest.md @@ -6,6 +6,7 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | | `request_body` | [operations.BulkUnassignMembersFromGuardrailRequestBody](../operations/bulkunassignmembersfromguardrailrequestbody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/operations/createauthkeyscodeglobals.md b/docs/operations/createauthkeyscodeglobals.md index cc084f7..ab7e4e5 100644 --- a/docs/operations/createauthkeyscodeglobals.md +++ b/docs/operations/createauthkeyscodeglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/createauthkeyscoderequest.md b/docs/operations/createauthkeyscoderequest.md index 2fa48ef..6dc0617 100644 --- a/docs/operations/createauthkeyscoderequest.md +++ b/docs/operations/createauthkeyscoderequest.md @@ -6,5 +6,6 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `request_body` | [operations.CreateAuthKeysCodeRequestBody](../operations/createauthkeyscoderequestbody.md) | :heavy_check_mark: | N/A | {
"callback_url": "https://myapp.com/auth/callback",
"code_challenge": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM",
"code_challenge_method": "S256",
"limit": 100
} | \ No newline at end of file diff --git a/docs/operations/createcoinbasechargeglobals.md b/docs/operations/createcoinbasechargeglobals.md index 5287403..dcc7d37 100644 --- a/docs/operations/createcoinbasechargeglobals.md +++ b/docs/operations/createcoinbasechargeglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/createcoinbasechargerequest.md b/docs/operations/createcoinbasechargerequest.md index d90e033..e6f0307 100644 --- a/docs/operations/createcoinbasechargerequest.md +++ b/docs/operations/createcoinbasechargerequest.md @@ -6,5 +6,6 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `create_charge_request` | [components.CreateChargeRequest](../components/createchargerequest.md) | :heavy_check_mark: | N/A | {
"amount": 100,
"sender": "0x1234567890123456789012345678901234567890",
"chain_id": 1
} | \ No newline at end of file diff --git a/docs/operations/createembeddingsglobals.md b/docs/operations/createembeddingsglobals.md index adb19bc..13b9e13 100644 --- a/docs/operations/createembeddingsglobals.md +++ b/docs/operations/createembeddingsglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/createembeddingsrequest.md b/docs/operations/createembeddingsrequest.md index cace1a6..f0c5d83 100644 --- a/docs/operations/createembeddingsrequest.md +++ b/docs/operations/createembeddingsrequest.md @@ -6,5 +6,6 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | `request_body` | [operations.CreateEmbeddingsRequestBody](../operations/createembeddingsrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/operations/createguardraildata.md b/docs/operations/createguardraildata.md index f98ee89..0cfc0cf 100644 --- a/docs/operations/createguardraildata.md +++ b/docs/operations/createguardraildata.md @@ -13,6 +13,7 @@ The created guardrail | `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | Spending limit in USD | 100 | | `reset_interval` | [OptionalNullable[operations.CreateGuardrailResetIntervalResponse]](../operations/createguardrailresetintervalresponse.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | | `allowed_providers` | List[*str*] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"google"
] | +| `ignored_providers` | List[*str*] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | | `allowed_models` | List[*str*] | :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"
] | | `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention | false | | `created_at` | *str* | :heavy_check_mark: | ISO 8601 timestamp of when the guardrail was created | 2025-08-24T10:30:00Z | diff --git a/docs/operations/createguardrailglobals.md b/docs/operations/createguardrailglobals.md index b11f112..862c364 100644 --- a/docs/operations/createguardrailglobals.md +++ b/docs/operations/createguardrailglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/createguardrailrequest.md b/docs/operations/createguardrailrequest.md index ff71d5e..1f1c944 100644 --- a/docs/operations/createguardrailrequest.md +++ b/docs/operations/createguardrailrequest.md @@ -3,8 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `request_body` | [operations.CreateGuardrailRequestBody](../operations/createguardrailrequestbody.md) | :heavy_check_mark: | N/A | {
"name": "My New Guardrail",
"description": "A guardrail for limiting API usage",
"limit_usd": 50,
"reset_interval": "monthly",
"allowed_providers": [
"openai",
"anthropic",
"deepseek"
],
"allowed_models": null,
"enforce_zdr": false
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `request_body` | [operations.CreateGuardrailRequestBody](../operations/createguardrailrequestbody.md) | :heavy_check_mark: | N/A | {
"name": "My New Guardrail",
"description": "A guardrail for limiting API usage",
"limit_usd": 50,
"reset_interval": "monthly",
"allowed_providers": [
"openai",
"anthropic",
"deepseek"
],
"ignored_providers": null,
"allowed_models": null,
"enforce_zdr": false
} | \ No newline at end of file diff --git a/docs/operations/createguardrailrequestbody.md b/docs/operations/createguardrailrequestbody.md index 0dae486..843fd1e 100644 --- a/docs/operations/createguardrailrequestbody.md +++ b/docs/operations/createguardrailrequestbody.md @@ -10,5 +10,6 @@ | `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | Spending limit in USD | 50 | | `reset_interval` | [OptionalNullable[operations.CreateGuardrailResetIntervalRequest]](../operations/createguardrailresetintervalrequest.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | | `allowed_providers` | List[*str*] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | +| `ignored_providers` | List[*str*] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | | `allowed_models` | List[*str*] | :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"
] | | `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention | false | \ No newline at end of file diff --git a/docs/operations/createguardrailresponse.md b/docs/operations/createguardrailresponse.md index 0afc006..4cf770b 100644 --- a/docs/operations/createguardrailresponse.md +++ b/docs/operations/createguardrailresponse.md @@ -5,6 +5,6 @@ Guardrail created successfully ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [operations.CreateGuardrailData](../operations/createguardraildata.md) | :heavy_check_mark: | The created guardrail | {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production Guardrail",
"description": "Guardrail for production environment",
"limit_usd": 100,
"reset_interval": "monthly",
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"allowed_models": null,
"enforce_zdr": false,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [operations.CreateGuardrailData](../operations/createguardraildata.md) | :heavy_check_mark: | The created guardrail | {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production Guardrail",
"description": "Guardrail for production environment",
"limit_usd": 100,
"reset_interval": "monthly",
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"ignored_providers": null,
"allowed_models": null,
"enforce_zdr": false,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z"
} | \ No newline at end of file diff --git a/docs/operations/createkeysglobals.md b/docs/operations/createkeysglobals.md index 3c02678..6fea461 100644 --- a/docs/operations/createkeysglobals.md +++ b/docs/operations/createkeysglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/createkeysrequest.md b/docs/operations/createkeysrequest.md index b949a60..281d4e8 100644 --- a/docs/operations/createkeysrequest.md +++ b/docs/operations/createkeysrequest.md @@ -6,5 +6,6 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `request_body` | [operations.CreateKeysRequestBody](../operations/createkeysrequestbody.md) | :heavy_check_mark: | N/A | {
"name": "My New API Key",
"limit": 50,
"limit_reset": "monthly",
"include_byok_in_limit": true,
"expires_at": "2027-12-31T23:59:59Z"
} | \ No newline at end of file diff --git a/docs/operations/createresponsesglobals.md b/docs/operations/createresponsesglobals.md index 6b6ca55..265872c 100644 --- a/docs/operations/createresponsesglobals.md +++ b/docs/operations/createresponsesglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/createresponsesrequest.md b/docs/operations/createresponsesrequest.md index 1eba6ef..df34949 100644 --- a/docs/operations/createresponsesrequest.md +++ b/docs/operations/createresponsesrequest.md @@ -6,5 +6,6 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `open_responses_request` | [components.OpenResponsesRequest](../components/openresponsesrequest.md) | :heavy_check_mark: | N/A | {
"model": "anthropic/claude-4.5-sonnet-20250929",
"input": [
{
"type": "message",
"content": "Hello, how are you?",
"role": "user"
}
],
"temperature": 0.7,
"top_p": 0.9,
"tools": [
{
"type": "function",
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string"
}
}
}
}
]
} | \ No newline at end of file diff --git a/docs/operations/deleteguardrailglobals.md b/docs/operations/deleteguardrailglobals.md index f3c784f..8b3caa0 100644 --- a/docs/operations/deleteguardrailglobals.md +++ b/docs/operations/deleteguardrailglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/deleteguardrailrequest.md b/docs/operations/deleteguardrailrequest.md index 148b738..14aa025 100644 --- a/docs/operations/deleteguardrailrequest.md +++ b/docs/operations/deleteguardrailrequest.md @@ -6,5 +6,6 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail to delete | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/operations/deletekeysglobals.md b/docs/operations/deletekeysglobals.md index b987a26..0bbd498 100644 --- a/docs/operations/deletekeysglobals.md +++ b/docs/operations/deletekeysglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/deletekeysrequest.md b/docs/operations/deletekeysrequest.md index 4c6e567..61b9714 100644 --- a/docs/operations/deletekeysrequest.md +++ b/docs/operations/deletekeysrequest.md @@ -6,5 +6,6 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to delete | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | \ No newline at end of file diff --git a/docs/operations/exchangeauthcodeforapikeyglobals.md b/docs/operations/exchangeauthcodeforapikeyglobals.md index 1f4c2b5..91c8773 100644 --- a/docs/operations/exchangeauthcodeforapikeyglobals.md +++ b/docs/operations/exchangeauthcodeforapikeyglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/exchangeauthcodeforapikeyrequest.md b/docs/operations/exchangeauthcodeforapikeyrequest.md index d175446..d818ef4 100644 --- a/docs/operations/exchangeauthcodeforapikeyrequest.md +++ b/docs/operations/exchangeauthcodeforapikeyrequest.md @@ -6,5 +6,6 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `request_body` | [operations.ExchangeAuthCodeForAPIKeyRequestBody](../operations/exchangeauthcodeforapikeyrequestbody.md) | :heavy_check_mark: | N/A | {
"code": "auth_code_abc123def456",
"code_verifier": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk",
"code_challenge_method": "S256"
} | \ No newline at end of file diff --git a/docs/operations/getcreditsglobals.md b/docs/operations/getcreditsglobals.md index ea59176..bb29d2d 100644 --- a/docs/operations/getcreditsglobals.md +++ b/docs/operations/getcreditsglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/getcreditsrequest.md b/docs/operations/getcreditsrequest.md index e6066dc..f86e975 100644 --- a/docs/operations/getcreditsrequest.md +++ b/docs/operations/getcreditsrequest.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/getcurrentkeyglobals.md b/docs/operations/getcurrentkeyglobals.md index fd90af9..905f7d1 100644 --- a/docs/operations/getcurrentkeyglobals.md +++ b/docs/operations/getcurrentkeyglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/getcurrentkeyrequest.md b/docs/operations/getcurrentkeyrequest.md index fd28cff..e209746 100644 --- a/docs/operations/getcurrentkeyrequest.md +++ b/docs/operations/getcurrentkeyrequest.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/getgenerationdata.md b/docs/operations/getgenerationdata.md index f8c54d1..a980f2a 100644 --- a/docs/operations/getgenerationdata.md +++ b/docs/operations/getgenerationdata.md @@ -40,4 +40,6 @@ Generation data | `external_user` | *Nullable[str]* | :heavy_check_mark: | External user identifier | user-123 | | `api_type` | [Nullable[operations.APIType]](../operations/apitype.md) | :heavy_check_mark: | Type of API used for the generation | | | `router` | *Nullable[str]* | :heavy_check_mark: | Router used for the request (e.g., openrouter/auto) | openrouter/auto | -| `provider_responses` | List[[operations.ProviderResponse](../operations/providerresponse.md)] | :heavy_check_mark: | List of provider responses for this generation, including fallback attempts | | \ No newline at end of file +| `provider_responses` | List[[operations.ProviderResponse](../operations/providerresponse.md)] | :heavy_check_mark: | List of provider responses for this generation, including fallback attempts | | +| `user_agent` | *Nullable[str]* | :heavy_check_mark: | User-Agent header from the request | | +| `http_referer` | *Nullable[str]* | :heavy_check_mark: | Referer header from the request | | \ No newline at end of file diff --git a/docs/operations/getgenerationglobals.md b/docs/operations/getgenerationglobals.md index e8e8104..8420035 100644 --- a/docs/operations/getgenerationglobals.md +++ b/docs/operations/getgenerationglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/getgenerationrequest.md b/docs/operations/getgenerationrequest.md index ec8100a..5fa33b6 100644 --- a/docs/operations/getgenerationrequest.md +++ b/docs/operations/getgenerationrequest.md @@ -6,5 +6,6 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | `id` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/operations/getguardraildata.md b/docs/operations/getguardraildata.md index 5a31535..25bde01 100644 --- a/docs/operations/getguardraildata.md +++ b/docs/operations/getguardraildata.md @@ -13,6 +13,7 @@ The guardrail | `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | Spending limit in USD | 100 | | `reset_interval` | [OptionalNullable[operations.GetGuardrailResetInterval]](../operations/getguardrailresetinterval.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | | `allowed_providers` | List[*str*] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"google"
] | +| `ignored_providers` | List[*str*] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | | `allowed_models` | List[*str*] | :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"
] | | `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention | false | | `created_at` | *str* | :heavy_check_mark: | ISO 8601 timestamp of when the guardrail was created | 2025-08-24T10:30:00Z | diff --git a/docs/operations/getguardrailglobals.md b/docs/operations/getguardrailglobals.md index e9b5b80..63bf9d6 100644 --- a/docs/operations/getguardrailglobals.md +++ b/docs/operations/getguardrailglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/getguardrailrequest.md b/docs/operations/getguardrailrequest.md index e8d2af8..ad49c82 100644 --- a/docs/operations/getguardrailrequest.md +++ b/docs/operations/getguardrailrequest.md @@ -6,5 +6,6 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail to retrieve | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/operations/getguardrailresponse.md b/docs/operations/getguardrailresponse.md index ee53506..08739b6 100644 --- a/docs/operations/getguardrailresponse.md +++ b/docs/operations/getguardrailresponse.md @@ -5,6 +5,6 @@ Guardrail details ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [operations.GetGuardrailData](../operations/getguardraildata.md) | :heavy_check_mark: | The guardrail | {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production Guardrail",
"description": "Guardrail for production environment",
"limit_usd": 100,
"reset_interval": "monthly",
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"allowed_models": null,
"enforce_zdr": false,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [operations.GetGuardrailData](../operations/getguardraildata.md) | :heavy_check_mark: | The guardrail | {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production Guardrail",
"description": "Guardrail for production environment",
"limit_usd": 100,
"reset_interval": "monthly",
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"ignored_providers": null,
"allowed_models": null,
"enforce_zdr": false,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z"
} | \ No newline at end of file diff --git a/docs/operations/getkeyglobals.md b/docs/operations/getkeyglobals.md index c88bdda..585d2a3 100644 --- a/docs/operations/getkeyglobals.md +++ b/docs/operations/getkeyglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/getkeyrequest.md b/docs/operations/getkeyrequest.md index 519c418..b7b0a30 100644 --- a/docs/operations/getkeyrequest.md +++ b/docs/operations/getkeyrequest.md @@ -6,5 +6,6 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to retrieve | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | \ No newline at end of file diff --git a/docs/operations/getmodelsglobals.md b/docs/operations/getmodelsglobals.md index 31e9969..9533d03 100644 --- a/docs/operations/getmodelsglobals.md +++ b/docs/operations/getmodelsglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/getmodelsrequest.md b/docs/operations/getmodelsrequest.md index 469aeb5..1a66d5a 100644 --- a/docs/operations/getmodelsrequest.md +++ b/docs/operations/getmodelsrequest.md @@ -3,9 +3,11 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `category` | [Optional[operations.Category]](../operations/category.md) | :heavy_minus_sign: | Filter models by use case category | programming | -| `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `category` | [Optional[operations.Category]](../operations/category.md) | :heavy_minus_sign: | Filter models by use case category | programming | +| `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `output_modalities` | *Optional[str]* | :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 diff --git a/docs/operations/getuseractivityglobals.md b/docs/operations/getuseractivityglobals.md index cfcdb0a..a67a41d 100644 --- a/docs/operations/getuseractivityglobals.md +++ b/docs/operations/getuseractivityglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/getuseractivityrequest.md b/docs/operations/getuseractivityrequest.md index 97457f0..6d4d521 100644 --- a/docs/operations/getuseractivityrequest.md +++ b/docs/operations/getuseractivityrequest.md @@ -6,5 +6,6 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `date_` | *Optional[str]* | :heavy_minus_sign: | Filter by a single UTC date in the last 30 days (YYYY-MM-DD format). | 2025-08-24 | \ No newline at end of file diff --git a/docs/operations/listembeddingsmodelsglobals.md b/docs/operations/listembeddingsmodelsglobals.md index 6cf29a9..20150d7 100644 --- a/docs/operations/listembeddingsmodelsglobals.md +++ b/docs/operations/listembeddingsmodelsglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/listembeddingsmodelsrequest.md b/docs/operations/listembeddingsmodelsrequest.md index 1dd1657..d3628eb 100644 --- a/docs/operations/listembeddingsmodelsrequest.md +++ b/docs/operations/listembeddingsmodelsrequest.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/listendpointsglobals.md b/docs/operations/listendpointsglobals.md index b00c95a..5a81187 100644 --- a/docs/operations/listendpointsglobals.md +++ b/docs/operations/listendpointsglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/listendpointsrequest.md b/docs/operations/listendpointsrequest.md index 39a1d0d..86d4ace 100644 --- a/docs/operations/listendpointsrequest.md +++ b/docs/operations/listendpointsrequest.md @@ -6,6 +6,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | `author` | *str* | :heavy_check_mark: | N/A | | `slug` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/operations/listendpointszdrglobals.md b/docs/operations/listendpointszdrglobals.md index a858e43..6abb940 100644 --- a/docs/operations/listendpointszdrglobals.md +++ b/docs/operations/listendpointszdrglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/listendpointszdrrequest.md b/docs/operations/listendpointszdrrequest.md index ab1f161..727be2c 100644 --- a/docs/operations/listendpointszdrrequest.md +++ b/docs/operations/listendpointszdrrequest.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/listglobals.md b/docs/operations/listglobals.md index 8d10965..53064e4 100644 --- a/docs/operations/listglobals.md +++ b/docs/operations/listglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/listguardrailkeyassignmentsglobals.md b/docs/operations/listguardrailkeyassignmentsglobals.md index d431a1d..a9cc4a3 100644 --- a/docs/operations/listguardrailkeyassignmentsglobals.md +++ b/docs/operations/listguardrailkeyassignmentsglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/listguardrailkeyassignmentsrequest.md b/docs/operations/listguardrailkeyassignmentsrequest.md index bb75011..e78c271 100644 --- a/docs/operations/listguardrailkeyassignmentsrequest.md +++ b/docs/operations/listguardrailkeyassignmentsrequest.md @@ -6,7 +6,8 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | | `offset` | *Optional[str]* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | | `limit` | *Optional[str]* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | \ No newline at end of file diff --git a/docs/operations/listguardrailmemberassignmentsglobals.md b/docs/operations/listguardrailmemberassignmentsglobals.md index efaa3d9..58ce40e 100644 --- a/docs/operations/listguardrailmemberassignmentsglobals.md +++ b/docs/operations/listguardrailmemberassignmentsglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/listguardrailmemberassignmentsrequest.md b/docs/operations/listguardrailmemberassignmentsrequest.md index 313f1c3..2ebeffb 100644 --- a/docs/operations/listguardrailmemberassignmentsrequest.md +++ b/docs/operations/listguardrailmemberassignmentsrequest.md @@ -6,7 +6,8 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | | `offset` | *Optional[str]* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | | `limit` | *Optional[str]* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | \ No newline at end of file diff --git a/docs/operations/listguardrailsdata.md b/docs/operations/listguardrailsdata.md index 7457408..4b94ae2 100644 --- a/docs/operations/listguardrailsdata.md +++ b/docs/operations/listguardrailsdata.md @@ -11,6 +11,7 @@ | `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | Spending limit in USD | 100 | | `reset_interval` | [OptionalNullable[operations.ListGuardrailsResetInterval]](../operations/listguardrailsresetinterval.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | | `allowed_providers` | List[*str*] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"google"
] | +| `ignored_providers` | List[*str*] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | | `allowed_models` | List[*str*] | :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"
] | | `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention | false | | `created_at` | *str* | :heavy_check_mark: | ISO 8601 timestamp of when the guardrail was created | 2025-08-24T10:30:00Z | diff --git a/docs/operations/listguardrailsglobals.md b/docs/operations/listguardrailsglobals.md index 65ea039..4a623f2 100644 --- a/docs/operations/listguardrailsglobals.md +++ b/docs/operations/listguardrailsglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/listguardrailsrequest.md b/docs/operations/listguardrailsrequest.md index 4e3330b..598440f 100644 --- a/docs/operations/listguardrailsrequest.md +++ b/docs/operations/listguardrailsrequest.md @@ -6,6 +6,7 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `offset` | *Optional[str]* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | | `limit` | *Optional[str]* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | \ No newline at end of file diff --git a/docs/operations/listkeyassignmentsglobals.md b/docs/operations/listkeyassignmentsglobals.md index b606693..6c0713d 100644 --- a/docs/operations/listkeyassignmentsglobals.md +++ b/docs/operations/listkeyassignmentsglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/listkeyassignmentsrequest.md b/docs/operations/listkeyassignmentsrequest.md index ce886c0..c3db738 100644 --- a/docs/operations/listkeyassignmentsrequest.md +++ b/docs/operations/listkeyassignmentsrequest.md @@ -6,6 +6,7 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `offset` | *Optional[str]* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | | `limit` | *Optional[str]* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | \ No newline at end of file diff --git a/docs/operations/listmemberassignmentsglobals.md b/docs/operations/listmemberassignmentsglobals.md index 9cd0e16..7d4eb65 100644 --- a/docs/operations/listmemberassignmentsglobals.md +++ b/docs/operations/listmemberassignmentsglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/listmemberassignmentsrequest.md b/docs/operations/listmemberassignmentsrequest.md index 8ec3f2a..61416c7 100644 --- a/docs/operations/listmemberassignmentsrequest.md +++ b/docs/operations/listmemberassignmentsrequest.md @@ -6,6 +6,7 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `offset` | *Optional[str]* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | | `limit` | *Optional[str]* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | \ No newline at end of file diff --git a/docs/operations/listmodelscountglobals.md b/docs/operations/listmodelscountglobals.md index b0ddc73..1c3931a 100644 --- a/docs/operations/listmodelscountglobals.md +++ b/docs/operations/listmodelscountglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/listmodelscountrequest.md b/docs/operations/listmodelscountrequest.md index 95df935..02da5e2 100644 --- a/docs/operations/listmodelscountrequest.md +++ b/docs/operations/listmodelscountrequest.md @@ -3,7 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `output_modalities` | *Optional[str]* | :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 diff --git a/docs/operations/listmodelsuserglobals.md b/docs/operations/listmodelsuserglobals.md index 59b2ab0..b8ca3d3 100644 --- a/docs/operations/listmodelsuserglobals.md +++ b/docs/operations/listmodelsuserglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/listmodelsuserrequest.md b/docs/operations/listmodelsuserrequest.md index 9113594..68b87e3 100644 --- a/docs/operations/listmodelsuserrequest.md +++ b/docs/operations/listmodelsuserrequest.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/listprovidersglobals.md b/docs/operations/listprovidersglobals.md index 2edb4d2..6aacb32 100644 --- a/docs/operations/listprovidersglobals.md +++ b/docs/operations/listprovidersglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/listprovidersrequest.md b/docs/operations/listprovidersrequest.md index a06e73d..9e96cc6 100644 --- a/docs/operations/listprovidersrequest.md +++ b/docs/operations/listprovidersrequest.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/listrequest.md b/docs/operations/listrequest.md index d2ab395..0118178 100644 --- a/docs/operations/listrequest.md +++ b/docs/operations/listrequest.md @@ -6,6 +6,7 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `include_disabled` | *Optional[str]* | :heavy_minus_sign: | Whether to include disabled API keys in the response | false | | `offset` | *Optional[str]* | :heavy_minus_sign: | Number of API keys to skip for pagination | 0 | \ No newline at end of file diff --git a/docs/operations/providername.md b/docs/operations/providername.md index 86b88ca..03dd496 100644 --- a/docs/operations/providername.md +++ b/docs/operations/providername.md @@ -33,6 +33,7 @@ | `TOGETHER_2` | Together 2 | | `UBICLOUD` | Ubicloud | | `ONE_DOT_AI` | 01.AI | +| `AKASH_ML` | AkashML | | `AI21` | AI21 | | `AION_LABS` | AionLabs | | `ALIBABA` | Alibaba | diff --git a/docs/operations/sendchatcompletionrequestglobals.md b/docs/operations/sendchatcompletionrequestglobals.md index b37d22f..3256c02 100644 --- a/docs/operations/sendchatcompletionrequestglobals.md +++ b/docs/operations/sendchatcompletionrequestglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/sendchatcompletionrequestrequest.md b/docs/operations/sendchatcompletionrequestrequest.md index 9eefdae..9e97113 100644 --- a/docs/operations/sendchatcompletionrequestrequest.md +++ b/docs/operations/sendchatcompletionrequestrequest.md @@ -6,5 +6,6 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `chat_generation_params` | [components.ChatGenerationParams](../components/chatgenerationparams.md) | :heavy_check_mark: | N/A | {
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What is the capital of France?"
}
],
"model": "openai/gpt-4",
"temperature": 0.7,
"max_tokens": 150
} | \ No newline at end of file diff --git a/docs/operations/updateguardraildata.md b/docs/operations/updateguardraildata.md index 8ef0a03..2a97bda 100644 --- a/docs/operations/updateguardraildata.md +++ b/docs/operations/updateguardraildata.md @@ -13,6 +13,7 @@ The updated guardrail | `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | Spending limit in USD | 100 | | `reset_interval` | [OptionalNullable[operations.UpdateGuardrailResetIntervalResponse]](../operations/updateguardrailresetintervalresponse.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | | `allowed_providers` | List[*str*] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"google"
] | +| `ignored_providers` | List[*str*] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | | `allowed_models` | List[*str*] | :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"
] | | `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention | false | | `created_at` | *str* | :heavy_check_mark: | ISO 8601 timestamp of when the guardrail was created | 2025-08-24T10:30:00Z | diff --git a/docs/operations/updateguardrailglobals.md b/docs/operations/updateguardrailglobals.md index fc66661..d72ffed 100644 --- a/docs/operations/updateguardrailglobals.md +++ b/docs/operations/updateguardrailglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/updateguardrailrequest.md b/docs/operations/updateguardrailrequest.md index 04fe91c..7ccfb1e 100644 --- a/docs/operations/updateguardrailrequest.md +++ b/docs/operations/updateguardrailrequest.md @@ -6,6 +6,7 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail to update | 550e8400-e29b-41d4-a716-446655440000 | | `request_body` | [operations.UpdateGuardrailRequestBody](../operations/updateguardrailrequestbody.md) | :heavy_check_mark: | N/A | {
"name": "Updated Guardrail Name",
"description": "Updated description",
"limit_usd": 75,
"reset_interval": "weekly"
} | \ No newline at end of file diff --git a/docs/operations/updateguardrailrequestbody.md b/docs/operations/updateguardrailrequestbody.md index fe16a07..9365423 100644 --- a/docs/operations/updateguardrailrequestbody.md +++ b/docs/operations/updateguardrailrequestbody.md @@ -10,5 +10,6 @@ | `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | New spending limit in USD | 75 | | `reset_interval` | [OptionalNullable[operations.UpdateGuardrailResetIntervalRequest]](../operations/updateguardrailresetintervalrequest.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | | `allowed_providers` | List[*str*] | :heavy_minus_sign: | New list of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | +| `ignored_providers` | List[*str*] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | | `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2"
] | | `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention | true | \ No newline at end of file diff --git a/docs/operations/updateguardrailresponse.md b/docs/operations/updateguardrailresponse.md index c068ca8..19b1364 100644 --- a/docs/operations/updateguardrailresponse.md +++ b/docs/operations/updateguardrailresponse.md @@ -5,6 +5,6 @@ Guardrail updated successfully ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [operations.UpdateGuardrailData](../operations/updateguardraildata.md) | :heavy_check_mark: | The updated guardrail | {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production Guardrail",
"description": "Guardrail for production environment",
"limit_usd": 100,
"reset_interval": "monthly",
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"allowed_models": null,
"enforce_zdr": false,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [operations.UpdateGuardrailData](../operations/updateguardraildata.md) | :heavy_check_mark: | The updated guardrail | {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production Guardrail",
"description": "Guardrail for production environment",
"limit_usd": 100,
"reset_interval": "monthly",
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"ignored_providers": null,
"allowed_models": null,
"enforce_zdr": false,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z"
} | \ No newline at end of file diff --git a/docs/operations/updatekeysglobals.md b/docs/operations/updatekeysglobals.md index c13bcc6..4588f44 100644 --- a/docs/operations/updatekeysglobals.md +++ b/docs/operations/updatekeysglobals.md @@ -6,4 +6,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| \ No newline at end of file +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/operations/updatekeysrequest.md b/docs/operations/updatekeysrequest.md index c2c5c25..75e5838 100644 --- a/docs/operations/updatekeysrequest.md +++ b/docs/operations/updatekeysrequest.md @@ -6,6 +6,7 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to update | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | | `request_body` | [operations.UpdateKeysRequestBody](../operations/updatekeysrequestbody.md) | :heavy_check_mark: | N/A | {
"name": "Updated API Key Name",
"disabled": false,
"limit": 75,
"limit_reset": "daily",
"include_byok_in_limit": true
} | \ No newline at end of file diff --git a/docs/sdks/analytics/README.md b/docs/sdks/analytics/README.md index 781dc23..14a826a 100644 --- a/docs/sdks/analytics/README.md +++ b/docs/sdks/analytics/README.md @@ -23,7 +23,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -39,7 +40,8 @@ with OpenRouter( | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `date_` | *Optional[str]* | :heavy_minus_sign: | Filter by a single UTC date in the last 30 days (YYYY-MM-DD format). | 2025-08-24 | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | diff --git a/docs/sdks/apikeys/README.md b/docs/sdks/apikeys/README.md index eaa58d5..c86e271 100644 --- a/docs/sdks/apikeys/README.md +++ b/docs/sdks/apikeys/README.md @@ -28,7 +28,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -44,7 +45,8 @@ with OpenRouter( | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `include_disabled` | *Optional[str]* | :heavy_minus_sign: | Whether to include disabled API keys in the response | false | | `offset` | *Optional[str]* | :heavy_minus_sign: | Number of API keys to skip for pagination | 0 | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | @@ -76,7 +78,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -93,7 +96,8 @@ with OpenRouter( | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | *str* | :heavy_check_mark: | Name for the new API key | My New API Key | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `limit` | *OptionalNullable[float]* | :heavy_minus_sign: | Optional spending limit for the API key in USD | 50 | | `limit_reset` | [OptionalNullable[operations.CreateKeysLimitReset]](../../operations/createkeyslimitreset.md) | :heavy_minus_sign: | 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. | monthly | | `include_byok_in_limit` | *Optional[bool]* | :heavy_minus_sign: | Whether to include BYOK usage in the limit | true | @@ -128,7 +132,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -145,7 +150,8 @@ with OpenRouter( | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to update | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `name` | *Optional[str]* | :heavy_minus_sign: | New name for the API key | Updated API Key Name | | `disabled` | *Optional[bool]* | :heavy_minus_sign: | Whether to disable the API key | false | | `limit` | *OptionalNullable[float]* | :heavy_minus_sign: | New spending limit for the API key in USD | 75 | @@ -182,7 +188,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -199,7 +206,8 @@ with OpenRouter( | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to delete | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -230,7 +238,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -247,7 +256,8 @@ with OpenRouter( | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to retrieve | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -278,7 +288,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -294,7 +305,8 @@ with OpenRouter( | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/chat/README.md b/docs/sdks/chat/README.md index a64005c..0470760 100644 --- a/docs/sdks/chat/README.md +++ b/docs/sdks/chat/README.md @@ -21,7 +21,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -49,7 +50,8 @@ with OpenRouter( | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `messages` | List[[components.Message](../../components/message.md)] | :heavy_check_mark: | List of messages for the conversation | [
{
"role": "user",
"content": "Hello!"
}
] | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `provider` | [OptionalNullable[components.ChatGenerationParamsProvider]](../../components/chatgenerationparamsprovider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | | | `plugins` | List[[components.ChatGenerationParamsPluginUnion](../../components/chatgenerationparamspluginunion.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | | | `user` | *Optional[str]* | :heavy_minus_sign: | Unique user identifier | user-123 | @@ -62,7 +64,7 @@ with OpenRouter( | `logprobs` | *OptionalNullable[bool]* | :heavy_minus_sign: | Return log probabilities | false | | `top_logprobs` | *OptionalNullable[float]* | :heavy_minus_sign: | Number of top log probabilities to return (0-20) | 5 | | `max_completion_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum tokens in completion | 100 | -| `max_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum tokens (deprecated, use max_completion_tokens) | 100 | +| `max_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16. | 100 | | `metadata` | Dict[str, *str*] | :heavy_minus_sign: | Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) | {
"user_id": "user-123",
"session_id": "session-456"
} | | `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Presence penalty (-2.0 to 2.0) | 0 | | `reasoning` | [Optional[components.Reasoning]](../../components/reasoning.md) | :heavy_minus_sign: | Configuration options for reasoning models | {
"effort": "medium",
"summary": "concise"
} | @@ -78,7 +80,8 @@ with OpenRouter( | `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | Nucleus sampling parameter (0-1) | 1 | | `debug` | [Optional[components.DebugOptions]](../../components/debugoptions.md) | :heavy_minus_sign: | Debug options for inspecting request transformations (streaming only) | {
"echo_upstream_body": true
} | | `image_config` | Dict[str, [components.ChatGenerationParamsImageConfig](../../components/chatgenerationparamsimageconfig.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"
} | -| `modalities` | List[[components.Modality](../../components/modality.md)] | :heavy_minus_sign: | Output modalities for the response. Supported values are "text" and "image". | [
"text",
"image"
] | +| `modalities` | List[[components.Modality](../../components/modality.md)] | :heavy_minus_sign: | Output modalities for the response. Supported values are "text", "image", and "audio". | [
"text",
"image"
] | +| `cache_control` | [Optional[components.CacheControl]](../../components/cachecontrol.md) | :heavy_minus_sign: | 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. | | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/docs/sdks/credits/README.md b/docs/sdks/credits/README.md index 5744ee5..4773141 100644 --- a/docs/sdks/credits/README.md +++ b/docs/sdks/credits/README.md @@ -24,7 +24,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -40,7 +41,8 @@ with OpenRouter( | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -70,7 +72,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", ) as open_router: res = open_router.credits.create_coinbase_charge(security=operations.CreateCoinbaseChargeSecurity( @@ -91,7 +94,8 @@ with OpenRouter( | `sender` | *str* | :heavy_check_mark: | N/A | | `chain_id` | [components.ChainID](../../components/chainid.md) | :heavy_check_mark: | N/A | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/embeddings/README.md b/docs/sdks/embeddings/README.md index 5a383c1..f909eb3 100644 --- a/docs/sdks/embeddings/README.md +++ b/docs/sdks/embeddings/README.md @@ -24,7 +24,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -42,7 +43,8 @@ with OpenRouter( | `input` | [operations.InputUnion](../../operations/inputunion.md) | :heavy_check_mark: | N/A | | `model` | *str* | :heavy_check_mark: | N/A | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | `encoding_format` | [Optional[operations.EncodingFormat]](../../operations/encodingformat.md) | :heavy_minus_sign: | N/A | | `dimensions` | *Optional[int]* | :heavy_minus_sign: | N/A | | `user` | *Optional[str]* | :heavy_minus_sign: | N/A | @@ -84,7 +86,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -100,7 +103,8 @@ with OpenRouter( | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/endpoints/README.md b/docs/sdks/endpoints/README.md index 2e74416..6e3d446 100644 --- a/docs/sdks/endpoints/README.md +++ b/docs/sdks/endpoints/README.md @@ -24,7 +24,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -42,7 +43,8 @@ with OpenRouter( | `author` | *str* | :heavy_check_mark: | N/A | | `slug` | *str* | :heavy_check_mark: | N/A | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -71,7 +73,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -87,7 +90,8 @@ with OpenRouter( | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/generations/README.md b/docs/sdks/generations/README.md index cc602ad..89f0d7d 100644 --- a/docs/sdks/generations/README.md +++ b/docs/sdks/generations/README.md @@ -23,7 +23,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -40,7 +41,8 @@ with OpenRouter( | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | *str* | :heavy_check_mark: | N/A | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/guardrails/README.md b/docs/sdks/guardrails/README.md index 3e4a07f..4bd5a78 100644 --- a/docs/sdks/guardrails/README.md +++ b/docs/sdks/guardrails/README.md @@ -35,7 +35,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -51,7 +52,8 @@ with OpenRouter( | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `offset` | *Optional[str]* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | | `limit` | *Optional[str]* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | @@ -82,7 +84,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -99,11 +102,13 @@ with OpenRouter( | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | *str* | :heavy_check_mark: | Name for the new guardrail | My New Guardrail | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the guardrail | A guardrail for limiting API usage | | `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | Spending limit in USD | 50 | | `reset_interval` | [OptionalNullable[operations.CreateGuardrailResetIntervalRequest]](../../operations/createguardrailresetintervalrequest.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | | `allowed_providers` | List[*str*] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | +| `ignored_providers` | List[*str*] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | | `allowed_models` | List[*str*] | :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"
] | | `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention | false | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | @@ -135,7 +140,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -152,7 +158,8 @@ with OpenRouter( | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail to retrieve | 550e8400-e29b-41d4-a716-446655440000 | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -182,7 +189,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -199,12 +207,14 @@ with OpenRouter( | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail to update | 550e8400-e29b-41d4-a716-446655440000 | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `name` | *Optional[str]* | :heavy_minus_sign: | New name for the guardrail | Updated Guardrail Name | | `description` | *OptionalNullable[str]* | :heavy_minus_sign: | New description for the guardrail | Updated description | | `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | New spending limit in USD | 75 | | `reset_interval` | [OptionalNullable[operations.UpdateGuardrailResetIntervalRequest]](../../operations/updateguardrailresetintervalrequest.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | | `allowed_providers` | List[*str*] | :heavy_minus_sign: | New list of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | +| `ignored_providers` | List[*str*] | :heavy_minus_sign: | List of provider IDs to exclude from routing | [
"azure"
] | | `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2"
] | | `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention | true | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | @@ -237,7 +247,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -254,7 +265,8 @@ with OpenRouter( | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail to delete | 550e8400-e29b-41d4-a716-446655440000 | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -284,7 +296,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -300,7 +313,8 @@ with OpenRouter( | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `offset` | *Optional[str]* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | | `limit` | *Optional[str]* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | @@ -331,7 +345,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -347,7 +362,8 @@ with OpenRouter( | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `offset` | *Optional[str]* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | | `limit` | *Optional[str]* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | @@ -378,7 +394,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -395,7 +412,8 @@ with OpenRouter( | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `offset` | *Optional[str]* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | | `limit` | *Optional[str]* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | @@ -427,7 +445,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -447,7 +466,8 @@ with OpenRouter( | `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | | `key_hashes` | List[*str*] | :heavy_check_mark: | Array of API key hashes to assign to the guardrail | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -478,7 +498,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -495,7 +516,8 @@ with OpenRouter( | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `offset` | *Optional[str]* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | | `limit` | *Optional[str]* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | @@ -527,7 +549,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -548,7 +571,8 @@ with OpenRouter( | `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | | `member_user_ids` | List[*str*] | :heavy_check_mark: | Array of member user IDs to assign to the guardrail | [
"user_abc123",
"user_def456"
] | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -579,7 +603,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -599,7 +624,8 @@ with OpenRouter( | `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | | `key_hashes` | List[*str*] | :heavy_check_mark: | Array of API key hashes to unassign from the guardrail | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -630,7 +656,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -651,7 +678,8 @@ with OpenRouter( | `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | | `member_user_ids` | List[*str*] | :heavy_check_mark: | Array of member user IDs to unassign from the guardrail | [
"user_abc123",
"user_def456"
] | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/docs/sdks/models/README.md b/docs/sdks/models/README.md index 4140cc6..243ea62 100644 --- a/docs/sdks/models/README.md +++ b/docs/sdks/models/README.md @@ -25,7 +25,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -38,11 +39,13 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `output_modalities` | *Optional[str]* | :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 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -52,6 +55,7 @@ with OpenRouter( | Error Type | Status Code | Content Type | | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | @@ -69,7 +73,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -82,13 +87,15 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `category` | [Optional[operations.Category]](../../operations/category.md) | :heavy_minus_sign: | Filter models by use case category | programming | -| `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | N/A | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `category` | [Optional[operations.Category]](../../operations/category.md) | :heavy_minus_sign: | Filter models by use case category | programming | +| `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `output_modalities` | *Optional[str]* | :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 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -116,7 +123,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", ) as open_router: res = open_router.models.list_for_user(security=operations.ListModelsUserSecurity( @@ -134,7 +142,8 @@ with OpenRouter( | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `security` | [operations.ListModelsUserSecurity](../../operations/listmodelsusersecurity.md) | :heavy_check_mark: | N/A | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/oauth/README.md b/docs/sdks/oauth/README.md index 198b2d6..7683f6f 100644 --- a/docs/sdks/oauth/README.md +++ b/docs/sdks/oauth/README.md @@ -24,7 +24,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -41,7 +42,8 @@ with OpenRouter( | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `code` | *str* | :heavy_check_mark: | The authorization code received from the OAuth redirect | auth_code_abc123def456 | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `code_verifier` | *Optional[str]* | :heavy_minus_sign: | The code verifier if code_challenge was used in the authorization request | dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk | | `code_challenge_method` | [OptionalNullable[operations.ExchangeAuthCodeForAPIKeyCodeChallengeMethod]](../../operations/exchangeauthcodeforapikeycodechallengemethod.md) | :heavy_minus_sign: | The method used to generate the code challenge | S256 | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | @@ -73,7 +75,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -90,7 +93,8 @@ with OpenRouter( | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `callback_url` | *str* | :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 | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `code_challenge` | *Optional[str]* | :heavy_minus_sign: | PKCE code challenge for enhanced security | E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM | | `code_challenge_method` | [Optional[operations.CreateAuthKeysCodeCodeChallengeMethod]](../../operations/createauthkeyscodecodechallengemethod.md) | :heavy_minus_sign: | The method used to generate the code challenge | S256 | | `limit` | *Optional[float]* | :heavy_minus_sign: | Credit limit for the API key to be created | 100 | @@ -109,5 +113,6 @@ with OpenRouter( | ---------------------------------- | ---------------------------------- | ---------------------------------- | | errors.BadRequestResponseError | 400 | application/json | | errors.UnauthorizedResponseError | 401 | application/json | +| errors.ConflictResponseError | 409 | application/json | | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/providers/README.md b/docs/sdks/providers/README.md index fcec440..7c9d463 100644 --- a/docs/sdks/providers/README.md +++ b/docs/sdks/providers/README.md @@ -23,7 +23,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -39,7 +40,8 @@ with OpenRouter( | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/responses/README.md b/docs/sdks/responses/README.md index 0a725df..9f34722 100644 --- a/docs/sdks/responses/README.md +++ b/docs/sdks/responses/README.md @@ -23,7 +23,8 @@ import os with OpenRouter( http_referer="", - x_title="", + x_open_router_title="", + x_open_router_categories="", api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: @@ -41,8 +42,9 @@ with OpenRouter( | Parameter | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `input` | [Optional[components.OpenResponsesInput]](../../components/openresponsesinput.md) | :heavy_minus_sign: | Input for a response request - can be a string or array of items | [
{
"role": "user",
"content": "What is the weather today?"
}
] | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `input` | [Optional[components.OpenResponsesInputUnion]](../../components/openresponsesinputunion.md) | :heavy_minus_sign: | Input for a response request - can be a string or array of items | [
{
"role": "user",
"content": "What is the weather today?"
}
] | | `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | | `metadata` | Dict[str, *str*] | :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. | {
"user_id": "123",
"session_id": "abc-def-ghi"
} | | `tools` | List[[components.OpenResponsesRequestToolUnion](../../components/openresponsesrequesttoolunion.md)] | :heavy_minus_sign: | N/A | | diff --git a/pyproject.toml b/pyproject.toml index 0d48888..f6a7a4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "0.7.11" +version = "0.9.0" description = "Official Python Client SDK for OpenRouter." authors = [{ name = "OpenRouter" },] readme = "README-PYPI.md" diff --git a/src/openrouter/_version.py b/src/openrouter/_version.py index 8cf17ae..b98c252 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "0.7.11" +__version__: str = "0.9.0" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.768.0" -__user_agent__: str = "speakeasy-sdk/python 0.7.11 2.768.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 0.9.0 2.768.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/analytics.py b/src/openrouter/analytics.py index 1e6a8c1..4d707db 100644 --- a/src/openrouter/analytics.py +++ b/src/openrouter/analytics.py @@ -16,7 +16,8 @@ def get_user_activity( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, date_: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -30,7 +31,9 @@ def get_user_activity( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param date_: Filter by a single UTC date in the last 30 days (YYYY-MM-DD format). :param retries: Override the default retry configuration for this method @@ -50,7 +53,8 @@ def get_user_activity( request = operations.GetUserActivityRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, date_=date_, ) @@ -68,7 +72,8 @@ def get_user_activity( http_headers=http_headers, _globals=operations.GetUserActivityGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -138,7 +143,8 @@ async def get_user_activity_async( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, date_: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -152,7 +158,9 @@ async def get_user_activity_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param date_: Filter by a single UTC date in the last 30 days (YYYY-MM-DD format). :param retries: Override the default retry configuration for this method @@ -172,7 +180,8 @@ async def get_user_activity_async( request = operations.GetUserActivityRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, date_=date_, ) @@ -190,7 +199,8 @@ async def get_user_activity_async( http_headers=http_headers, _globals=operations.GetUserActivityGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, diff --git a/src/openrouter/api_keys.py b/src/openrouter/api_keys.py index c87c6f1..0c1e8d0 100644 --- a/src/openrouter/api_keys.py +++ b/src/openrouter/api_keys.py @@ -17,7 +17,8 @@ def list( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, include_disabled: Optional[str] = None, offset: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -32,7 +33,9 @@ def list( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param include_disabled: Whether to include disabled API keys in the response :param offset: Number of API keys to skip for pagination @@ -53,7 +56,8 @@ def list( request = operations.ListRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, include_disabled=include_disabled, offset=offset, ) @@ -72,7 +76,8 @@ def list( http_headers=http_headers, _globals=operations.ListGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -137,7 +142,8 @@ async def list_async( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, include_disabled: Optional[str] = None, offset: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -152,7 +158,9 @@ async def list_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param include_disabled: Whether to include disabled API keys in the response :param offset: Number of API keys to skip for pagination @@ -173,7 +181,8 @@ async def list_async( request = operations.ListRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, include_disabled=include_disabled, offset=offset, ) @@ -192,7 +201,8 @@ async def list_async( http_headers=http_headers, _globals=operations.ListGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -258,7 +268,8 @@ def create( *, name: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, limit: OptionalNullable[float] = UNSET, limit_reset: OptionalNullable[operations.CreateKeysLimitReset] = UNSET, include_byok_in_limit: Optional[bool] = None, @@ -276,7 +287,9 @@ def create( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param limit: Optional spending limit for the API key in USD :param limit_reset: 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. @@ -299,7 +312,8 @@ def create( request = operations.CreateKeysRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, request_body=operations.CreateKeysRequestBody( name=name, limit=limit, @@ -323,7 +337,8 @@ def create( http_headers=http_headers, _globals=operations.CreateKeysGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -401,7 +416,8 @@ async def create_async( *, name: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, limit: OptionalNullable[float] = UNSET, limit_reset: OptionalNullable[operations.CreateKeysLimitReset] = UNSET, include_byok_in_limit: Optional[bool] = None, @@ -419,7 +435,9 @@ async def create_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param limit: Optional spending limit for the API key in USD :param limit_reset: 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. @@ -442,7 +460,8 @@ async def create_async( request = operations.CreateKeysRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, request_body=operations.CreateKeysRequestBody( name=name, limit=limit, @@ -466,7 +485,8 @@ async def create_async( http_headers=http_headers, _globals=operations.CreateKeysGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -544,7 +564,8 @@ def update( *, hash: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, name: Optional[str] = None, disabled: Optional[bool] = None, limit: OptionalNullable[float] = UNSET, @@ -563,7 +584,9 @@ def update( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param name: New name for the API key :param disabled: Whether to disable the API key @@ -587,7 +610,8 @@ def update( request = operations.UpdateKeysRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, hash=hash, request_body=operations.UpdateKeysRequestBody( name=name, @@ -612,7 +636,8 @@ def update( http_headers=http_headers, _globals=operations.UpdateKeysGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -695,7 +720,8 @@ async def update_async( *, hash: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, name: Optional[str] = None, disabled: Optional[bool] = None, limit: OptionalNullable[float] = UNSET, @@ -714,7 +740,9 @@ async def update_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param name: New name for the API key :param disabled: Whether to disable the API key @@ -738,7 +766,8 @@ async def update_async( request = operations.UpdateKeysRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, hash=hash, request_body=operations.UpdateKeysRequestBody( name=name, @@ -763,7 +792,8 @@ async def update_async( http_headers=http_headers, _globals=operations.UpdateKeysGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -846,7 +876,8 @@ def delete( *, hash: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -860,7 +891,9 @@ def delete( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -879,7 +912,8 @@ def delete( request = operations.DeleteKeysRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, hash=hash, ) @@ -897,7 +931,8 @@ def delete( http_headers=http_headers, _globals=operations.DeleteKeysGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -968,7 +1003,8 @@ async def delete_async( *, hash: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -982,7 +1018,9 @@ async def delete_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -1001,7 +1039,8 @@ async def delete_async( request = operations.DeleteKeysRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, hash=hash, ) @@ -1019,7 +1058,8 @@ async def delete_async( http_headers=http_headers, _globals=operations.DeleteKeysGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -1090,7 +1130,8 @@ def get( *, hash: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1104,7 +1145,9 @@ def get( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -1123,7 +1166,8 @@ def get( request = operations.GetKeyRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, hash=hash, ) @@ -1141,7 +1185,8 @@ def get( http_headers=http_headers, _globals=operations.GetKeyGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -1212,7 +1257,8 @@ async def get_async( *, hash: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1226,7 +1272,9 @@ async def get_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -1245,7 +1293,8 @@ async def get_async( request = operations.GetKeyRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, hash=hash, ) @@ -1263,7 +1312,8 @@ async def get_async( http_headers=http_headers, _globals=operations.GetKeyGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -1333,7 +1383,8 @@ def get_current_key_metadata( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1346,7 +1397,9 @@ def get_current_key_metadata( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -1365,7 +1418,8 @@ def get_current_key_metadata( request = operations.GetCurrentKeyRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, ) req = self._build_request( @@ -1382,7 +1436,8 @@ def get_current_key_metadata( http_headers=http_headers, _globals=operations.GetCurrentKeyGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -1442,7 +1497,8 @@ async def get_current_key_metadata_async( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1455,7 +1511,9 @@ async def get_current_key_metadata_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -1474,7 +1532,8 @@ async def get_current_key_metadata_async( request = operations.GetCurrentKeyRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, ) req = self._build_request_async( @@ -1491,7 +1550,8 @@ async def get_current_key_metadata_async( http_headers=http_headers, _globals=operations.GetCurrentKeyGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, diff --git a/src/openrouter/chat.py b/src/openrouter/chat.py index 0830ebe..0a2008b 100644 --- a/src/openrouter/chat.py +++ b/src/openrouter/chat.py @@ -22,7 +22,8 @@ def send( *, messages: Union[List[components.Message], List[components.MessageTypedDict]], http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, provider: OptionalNullable[ Union[ components.ChatGenerationParamsProvider, @@ -89,6 +90,9 @@ def send( ] ] = None, modalities: Optional[List[components.Modality]] = None, + cache_control: Optional[ + Union[components.CacheControl, components.CacheControlTypedDict] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -102,7 +106,9 @@ def send( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param plugins: Plugins you want to enable for this request, including their settings. @@ -116,7 +122,7 @@ def send( :param logprobs: Return log probabilities :param top_logprobs: Number of top log probabilities to return (0-20) :param max_completion_tokens: Maximum tokens in completion - :param max_tokens: Maximum tokens (deprecated, use max_completion_tokens) + :param max_tokens: Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16. :param metadata: Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) :param presence_penalty: Presence penalty (-2.0 to 2.0) :param reasoning: Configuration options for reasoning models @@ -132,7 +138,8 @@ def send( :param top_p: Nucleus sampling parameter (0-1) :param debug: Debug options for inspecting request transformations (streaming only) :param image_config: 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. - :param modalities: Output modalities for the response. Supported values are \"text\" and \"image\". + :param modalities: Output modalities for the response. Supported values are \"text\", \"image\", and \"audio\". + :param cache_control: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -146,7 +153,8 @@ def send( *, messages: Union[List[components.Message], List[components.MessageTypedDict]], http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, provider: OptionalNullable[ Union[ components.ChatGenerationParamsProvider, @@ -213,6 +221,9 @@ def send( ] ] = None, modalities: Optional[List[components.Modality]] = None, + cache_control: Optional[ + Union[components.CacheControl, components.CacheControlTypedDict] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -226,7 +237,9 @@ def send( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param plugins: Plugins you want to enable for this request, including their settings. @@ -240,7 +253,7 @@ def send( :param logprobs: Return log probabilities :param top_logprobs: Number of top log probabilities to return (0-20) :param max_completion_tokens: Maximum tokens in completion - :param max_tokens: Maximum tokens (deprecated, use max_completion_tokens) + :param max_tokens: Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16. :param metadata: Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) :param presence_penalty: Presence penalty (-2.0 to 2.0) :param reasoning: Configuration options for reasoning models @@ -256,7 +269,8 @@ def send( :param top_p: Nucleus sampling parameter (0-1) :param debug: Debug options for inspecting request transformations (streaming only) :param image_config: 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. - :param modalities: Output modalities for the response. Supported values are \"text\" and \"image\". + :param modalities: Output modalities for the response. Supported values are \"text\", \"image\", and \"audio\". + :param cache_control: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -269,7 +283,8 @@ def send( *, messages: Union[List[components.Message], List[components.MessageTypedDict]], http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, provider: OptionalNullable[ Union[ components.ChatGenerationParamsProvider, @@ -336,6 +351,9 @@ def send( ] ] = None, modalities: Optional[List[components.Modality]] = None, + cache_control: Optional[ + Union[components.CacheControl, components.CacheControlTypedDict] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -349,7 +367,9 @@ def send( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param plugins: Plugins you want to enable for this request, including their settings. @@ -363,7 +383,7 @@ def send( :param logprobs: Return log probabilities :param top_logprobs: Number of top log probabilities to return (0-20) :param max_completion_tokens: Maximum tokens in completion - :param max_tokens: Maximum tokens (deprecated, use max_completion_tokens) + :param max_tokens: Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16. :param metadata: Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) :param presence_penalty: Presence penalty (-2.0 to 2.0) :param reasoning: Configuration options for reasoning models @@ -379,7 +399,8 @@ def send( :param top_p: Nucleus sampling parameter (0-1) :param debug: Debug options for inspecting request transformations (streaming only) :param image_config: 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. - :param modalities: Output modalities for the response. Supported values are \"text\" and \"image\". + :param modalities: Output modalities for the response. Supported values are \"text\", \"image\", and \"audio\". + :param cache_control: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -398,7 +419,8 @@ def send( request = operations.SendChatCompletionRequestRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, chat_generation_params=components.ChatGenerationParams( provider=utils.get_pydantic_model( provider, OptionalNullable[components.ChatGenerationParamsProvider] @@ -448,6 +470,9 @@ def send( ), image_config=image_config, modalities=modalities, + cache_control=utils.get_pydantic_model( + cache_control, Optional[components.CacheControl] + ), ), ) @@ -465,7 +490,8 @@ def send( http_headers=http_headers, _globals=operations.SendChatCompletionRequestGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -654,7 +680,8 @@ async def send_async( *, messages: Union[List[components.Message], List[components.MessageTypedDict]], http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, provider: OptionalNullable[ Union[ components.ChatGenerationParamsProvider, @@ -721,6 +748,9 @@ async def send_async( ] ] = None, modalities: Optional[List[components.Modality]] = None, + cache_control: Optional[ + Union[components.CacheControl, components.CacheControlTypedDict] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -734,7 +764,9 @@ async def send_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param plugins: Plugins you want to enable for this request, including their settings. @@ -748,7 +780,7 @@ async def send_async( :param logprobs: Return log probabilities :param top_logprobs: Number of top log probabilities to return (0-20) :param max_completion_tokens: Maximum tokens in completion - :param max_tokens: Maximum tokens (deprecated, use max_completion_tokens) + :param max_tokens: Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16. :param metadata: Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) :param presence_penalty: Presence penalty (-2.0 to 2.0) :param reasoning: Configuration options for reasoning models @@ -764,7 +796,8 @@ async def send_async( :param top_p: Nucleus sampling parameter (0-1) :param debug: Debug options for inspecting request transformations (streaming only) :param image_config: 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. - :param modalities: Output modalities for the response. Supported values are \"text\" and \"image\". + :param modalities: Output modalities for the response. Supported values are \"text\", \"image\", and \"audio\". + :param cache_control: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -778,7 +811,8 @@ async def send_async( *, messages: Union[List[components.Message], List[components.MessageTypedDict]], http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, provider: OptionalNullable[ Union[ components.ChatGenerationParamsProvider, @@ -845,6 +879,9 @@ async def send_async( ] ] = None, modalities: Optional[List[components.Modality]] = None, + cache_control: Optional[ + Union[components.CacheControl, components.CacheControlTypedDict] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -858,7 +895,9 @@ async def send_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param plugins: Plugins you want to enable for this request, including their settings. @@ -872,7 +911,7 @@ async def send_async( :param logprobs: Return log probabilities :param top_logprobs: Number of top log probabilities to return (0-20) :param max_completion_tokens: Maximum tokens in completion - :param max_tokens: Maximum tokens (deprecated, use max_completion_tokens) + :param max_tokens: Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16. :param metadata: Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) :param presence_penalty: Presence penalty (-2.0 to 2.0) :param reasoning: Configuration options for reasoning models @@ -888,7 +927,8 @@ async def send_async( :param top_p: Nucleus sampling parameter (0-1) :param debug: Debug options for inspecting request transformations (streaming only) :param image_config: 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. - :param modalities: Output modalities for the response. Supported values are \"text\" and \"image\". + :param modalities: Output modalities for the response. Supported values are \"text\", \"image\", and \"audio\". + :param cache_control: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -901,7 +941,8 @@ async def send_async( *, messages: Union[List[components.Message], List[components.MessageTypedDict]], http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, provider: OptionalNullable[ Union[ components.ChatGenerationParamsProvider, @@ -968,6 +1009,9 @@ async def send_async( ] ] = None, modalities: Optional[List[components.Modality]] = None, + cache_control: Optional[ + Union[components.CacheControl, components.CacheControlTypedDict] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -981,7 +1025,9 @@ async def send_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param plugins: Plugins you want to enable for this request, including their settings. @@ -995,7 +1041,7 @@ async def send_async( :param logprobs: Return log probabilities :param top_logprobs: Number of top log probabilities to return (0-20) :param max_completion_tokens: Maximum tokens in completion - :param max_tokens: Maximum tokens (deprecated, use max_completion_tokens) + :param max_tokens: Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16. :param metadata: Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) :param presence_penalty: Presence penalty (-2.0 to 2.0) :param reasoning: Configuration options for reasoning models @@ -1011,7 +1057,8 @@ async def send_async( :param top_p: Nucleus sampling parameter (0-1) :param debug: Debug options for inspecting request transformations (streaming only) :param image_config: 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. - :param modalities: Output modalities for the response. Supported values are \"text\" and \"image\". + :param modalities: Output modalities for the response. Supported values are \"text\", \"image\", and \"audio\". + :param cache_control: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -1030,7 +1077,8 @@ async def send_async( request = operations.SendChatCompletionRequestRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, chat_generation_params=components.ChatGenerationParams( provider=utils.get_pydantic_model( provider, OptionalNullable[components.ChatGenerationParamsProvider] @@ -1080,6 +1128,9 @@ async def send_async( ), image_config=image_config, modalities=modalities, + cache_control=utils.get_pydantic_model( + cache_control, Optional[components.CacheControl] + ), ), ) @@ -1097,7 +1148,8 @@ async def send_async( http_headers=http_headers, _globals=operations.SendChatCompletionRequestGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( diff --git a/src/openrouter/components/__init__.py b/src/openrouter/components/__init__.py index 051bc59..82e5843 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -28,11 +28,18 @@ BadRequestResponseErrorData, BadRequestResponseErrorDataTypedDict, ) + from .chatcompletionaudiooutput import ( + ChatCompletionAudioOutput, + ChatCompletionAudioOutputTypedDict, + ) from .chatcompletionfinishreason import ChatCompletionFinishReason from .chatgenerationparams import ( + CacheControl, + CacheControlTypedDict, ChatGenerationParams, ChatGenerationParamsBy, ChatGenerationParamsIDAutoRouter, + ChatGenerationParamsIDContextCompression, ChatGenerationParamsIDFileParser, ChatGenerationParamsIDModeration, ChatGenerationParamsIDResponseHealing, @@ -50,6 +57,8 @@ ChatGenerationParamsPartition, ChatGenerationParamsPluginAutoRouter, ChatGenerationParamsPluginAutoRouterTypedDict, + ChatGenerationParamsPluginContextCompression, + ChatGenerationParamsPluginContextCompressionTypedDict, ChatGenerationParamsPluginFileParser, ChatGenerationParamsPluginFileParserTypedDict, ChatGenerationParamsPluginModeration, @@ -71,8 +80,10 @@ ChatGenerationParamsSortEnum, ChatGenerationParamsSortUnion, ChatGenerationParamsSortUnionTypedDict, + ChatGenerationParamsTTL, ChatGenerationParamsTrace, ChatGenerationParamsTraceTypedDict, + ChatGenerationParamsType, ChatGenerationParamsTypedDict, Effort, Modality, @@ -106,9 +117,16 @@ ) from .chatmessagecontentitemcachecontrol import ( ChatMessageContentItemCacheControl, + ChatMessageContentItemCacheControlTTL, ChatMessageContentItemCacheControlType, ChatMessageContentItemCacheControlTypedDict, - TTL, + ) + from .chatmessagecontentitemfile import ( + ChatMessageContentItemFile, + ChatMessageContentItemFileType, + ChatMessageContentItemFileTypedDict, + File, + FileTypedDict, ) from .chatmessagecontentitemimage import ( ChatMessageContentItemImage, @@ -173,12 +191,29 @@ ErrorTypedDict, ) from .chatstreamoptions import ChatStreamOptions, ChatStreamOptionsTypedDict + from .compoundfilter import ( + CompoundFilter, + CompoundFilterType, + CompoundFilterTypedDict, + ) + from .conflictresponseerrordata import ( + ConflictResponseErrorData, + ConflictResponseErrorDataTypedDict, + ) + from .contextcompressionengine import ContextCompressionEngine from .createchargerequest import ( ChainID, CreateChargeRequest, CreateChargeRequestTypedDict, ) from .datacollection import DataCollection + from .datetimeservertool import ( + DatetimeServerTool, + DatetimeServerToolParameters, + DatetimeServerToolParametersTypedDict, + DatetimeServerToolType, + DatetimeServerToolTypedDict, + ) from .debugoptions import DebugOptions, DebugOptionsTypedDict from .defaultparameters import DefaultParameters, DefaultParametersTypedDict from .developermessage import ( @@ -265,6 +300,14 @@ OpenAIResponsesInputMessage1TypedDict, OpenAIResponsesInputMessage2, OpenAIResponsesInputMessage2TypedDict, + OpenAIResponsesInputOutput1, + OpenAIResponsesInputOutput1TypedDict, + OpenAIResponsesInputOutput2, + OpenAIResponsesInputOutput2TypedDict, + OpenAIResponsesInputPhaseCommentary, + OpenAIResponsesInputPhaseFinalAnswer, + OpenAIResponsesInputPhaseUnion, + OpenAIResponsesInputPhaseUnionTypedDict, OpenAIResponsesInputRoleAssistant, OpenAIResponsesInputRoleDeveloper1, OpenAIResponsesInputRoleDeveloper2, @@ -320,6 +363,42 @@ TypeTypedDict, ) from .openairesponsestruncation import OpenAIResponsesTruncation + from .openresponsesapplypatchtool import ( + OpenResponsesApplyPatchTool, + OpenResponsesApplyPatchToolType, + OpenResponsesApplyPatchToolTypedDict, + ) + from .openresponsescodeinterpretertool import ( + Container, + ContainerAuto, + ContainerAutoTypedDict, + ContainerType, + ContainerTypedDict, + MemoryLimit, + OpenResponsesCodeInterpreterTool, + OpenResponsesCodeInterpreterToolTypedDict, + TypeCodeInterpreter, + ) + from .openresponsescomputertool import ( + Environment, + OpenResponsesComputerTool, + OpenResponsesComputerToolType, + OpenResponsesComputerToolTypedDict, + ) + from .openresponsescustomtool import ( + Format, + FormatGrammar, + FormatGrammarTypedDict, + FormatText, + FormatTextTypedDict, + FormatTypeGrammar, + FormatTypeText, + FormatTypedDict, + OpenResponsesCustomTool, + OpenResponsesCustomToolTypedDict, + Syntax, + TypeCustom, + ) from .openresponseseasyinputmessage import ( OpenResponsesEasyInputMessage, OpenResponsesEasyInputMessageContentInputImage, @@ -330,6 +409,10 @@ OpenResponsesEasyInputMessageContentUnion2, OpenResponsesEasyInputMessageContentUnion2TypedDict, OpenResponsesEasyInputMessageDetail, + OpenResponsesEasyInputMessagePhaseCommentary, + OpenResponsesEasyInputMessagePhaseFinalAnswer, + OpenResponsesEasyInputMessagePhaseUnion, + OpenResponsesEasyInputMessagePhaseUnionTypedDict, OpenResponsesEasyInputMessageRoleAssistant, OpenResponsesEasyInputMessageRoleDeveloper, OpenResponsesEasyInputMessageRoleSystem, @@ -344,10 +427,40 @@ OpenResponsesErrorEventType, OpenResponsesErrorEventTypedDict, ) + from .openresponsesfilesearchtool import ( + Filters, + FiltersType, + FiltersTypedDict, + OpenResponsesFileSearchTool, + OpenResponsesFileSearchToolFilters, + OpenResponsesFileSearchToolFiltersTypedDict, + OpenResponsesFileSearchToolTypedDict, + Ranker, + RankingOptions, + RankingOptionsTypedDict, + TypeFileSearch, + Value1, + Value1TypedDict, + Value2, + Value2TypedDict, + ) from .openresponsesfunctioncalloutput import ( OpenResponsesFunctionCallOutput, - OpenResponsesFunctionCallOutputType, + OpenResponsesFunctionCallOutputDetail, + OpenResponsesFunctionCallOutputOutputUnion1, + OpenResponsesFunctionCallOutputOutputUnion1TypedDict, + OpenResponsesFunctionCallOutputOutputUnion2, + OpenResponsesFunctionCallOutputOutputUnion2TypedDict, + OpenResponsesFunctionCallOutputTypeFunctionCallOutput, OpenResponsesFunctionCallOutputTypedDict, + OutputInputImage, + OutputInputImageTypedDict, + OutputType, + ) + from .openresponsesfunctionshelltool import ( + OpenResponsesFunctionShellTool, + OpenResponsesFunctionShellToolType, + OpenResponsesFunctionShellToolTypedDict, ) from .openresponsesfunctiontoolcall import ( OpenResponsesFunctionToolCall, @@ -374,11 +487,51 @@ OpenResponsesImageGenCallPartialImageType, OpenResponsesImageGenCallPartialImageTypedDict, ) - from .openresponsesinput import ( - OpenResponsesInput, - OpenResponsesInput1, - OpenResponsesInput1TypedDict, - OpenResponsesInputTypedDict, + from .openresponsesimagegenerationtool import ( + Background, + InputFidelity, + InputImageMask, + InputImageMaskTypedDict, + ModelEnum, + Moderation, + OpenResponsesImageGenerationTool, + OpenResponsesImageGenerationToolType, + OpenResponsesImageGenerationToolTypedDict, + OutputFormat, + Quality, + Size, + ) + from .openresponsesinput_union import ( + OpenResponsesInputContent1, + OpenResponsesInputContent1TypedDict, + OpenResponsesInputContent2, + OpenResponsesInputContent2TypedDict, + OpenResponsesInputFormat, + OpenResponsesInputMessage, + OpenResponsesInputMessageTypedDict, + OpenResponsesInputPhaseCommentary, + OpenResponsesInputPhaseFinalAnswer, + OpenResponsesInputPhaseUnion, + OpenResponsesInputPhaseUnionTypedDict, + OpenResponsesInputReasoning, + OpenResponsesInputReasoningTypedDict, + OpenResponsesInputRole, + OpenResponsesInputStatusCompleted1, + OpenResponsesInputStatusCompleted2, + OpenResponsesInputStatusInProgress1, + OpenResponsesInputStatusInProgress2, + OpenResponsesInputStatusIncomplete1, + OpenResponsesInputStatusIncomplete2, + OpenResponsesInputStatusUnion1, + OpenResponsesInputStatusUnion1TypedDict, + OpenResponsesInputStatusUnion2, + OpenResponsesInputStatusUnion2TypedDict, + OpenResponsesInputTypeMessage, + OpenResponsesInputTypeReasoning, + OpenResponsesInputUnion, + OpenResponsesInputUnion1, + OpenResponsesInputUnion1TypedDict, + OpenResponsesInputUnionTypedDict, ) from .openresponsesinputmessageitem import ( OpenResponsesInputMessageItem, @@ -396,9 +549,26 @@ OpenResponsesInputMessageItemTypeMessage, OpenResponsesInputMessageItemTypedDict, ) - from .openresponseslogprobs import ( - OpenResponsesLogProbs, - OpenResponsesLogProbsTypedDict, + from .openresponseslocalshelltool import ( + OpenResponsesLocalShellTool, + OpenResponsesLocalShellToolType, + OpenResponsesLocalShellToolTypedDict, + ) + from .openresponsesmcptool import ( + AllowedTools, + AllowedToolsTypedDict, + Always, + AlwaysTypedDict, + ConnectorID, + Never, + NeverTypedDict, + OpenResponsesMcpTool, + OpenResponsesMcpToolType, + OpenResponsesMcpToolTypedDict, + RequireApproval, + RequireApprovalAlways, + RequireApprovalNever, + RequireApprovalTypedDict, ) from .openresponsesnonstreamingresponse import ( OpenResponsesNonStreamingResponse, @@ -453,6 +623,7 @@ from .openresponsesrequest import ( OpenResponsesRequest, OpenResponsesRequestIDAutoRouter, + OpenResponsesRequestIDContextCompression, OpenResponsesRequestIDFileParser, OpenResponsesRequestIDModeration, OpenResponsesRequestIDResponseHealing, @@ -469,6 +640,8 @@ OpenResponsesRequestOrderTypedDict, OpenResponsesRequestPluginAutoRouter, OpenResponsesRequestPluginAutoRouterTypedDict, + OpenResponsesRequestPluginContextCompression, + OpenResponsesRequestPluginContextCompressionTypedDict, OpenResponsesRequestPluginFileParser, OpenResponsesRequestPluginFileParserTypedDict, OpenResponsesRequestPluginModeration, @@ -501,6 +674,10 @@ ) from .openresponsesstreamevent import ( OpenResponsesStreamEvent, + OpenResponsesStreamEventLogprob1, + OpenResponsesStreamEventLogprob1TypedDict, + OpenResponsesStreamEventLogprob2, + OpenResponsesStreamEventLogprob2TypedDict, OpenResponsesStreamEventResponseCompleted, OpenResponsesStreamEventResponseCompletedTypedDict, OpenResponsesStreamEventResponseContentPartAdded, @@ -535,6 +712,10 @@ OpenResponsesStreamEventResponseRefusalDeltaTypedDict, OpenResponsesStreamEventResponseRefusalDone, OpenResponsesStreamEventResponseRefusalDoneTypedDict, + OpenResponsesStreamEventTopLogprob1, + OpenResponsesStreamEventTopLogprob1TypedDict, + OpenResponsesStreamEventTopLogprob2, + OpenResponsesStreamEventTopLogprob2TypedDict, OpenResponsesStreamEventTypedDict, Part1, Part1TypedDict, @@ -558,10 +739,6 @@ TypeResponseRefusalDelta, TypeResponseRefusalDone, ) - from .openresponsestoplogprobs import ( - OpenResponsesTopLogprobs, - OpenResponsesTopLogprobsTypedDict, - ) from .openresponsesusage import ( CostDetails, CostDetailsTypedDict, @@ -574,23 +751,46 @@ ) from .openresponseswebsearch20250826tool import ( OpenResponsesWebSearch20250826Tool, + OpenResponsesWebSearch20250826ToolEngine, OpenResponsesWebSearch20250826ToolFilters, OpenResponsesWebSearch20250826ToolFiltersTypedDict, OpenResponsesWebSearch20250826ToolType, OpenResponsesWebSearch20250826ToolTypedDict, ) + from .openresponseswebsearchcallcompleted import ( + OpenResponsesWebSearchCallCompleted, + OpenResponsesWebSearchCallCompletedType, + OpenResponsesWebSearchCallCompletedTypedDict, + ) + from .openresponseswebsearchcallinprogress import ( + OpenResponsesWebSearchCallInProgress, + OpenResponsesWebSearchCallInProgressType, + OpenResponsesWebSearchCallInProgressTypedDict, + ) + from .openresponseswebsearchcallsearching import ( + OpenResponsesWebSearchCallSearching, + OpenResponsesWebSearchCallSearchingType, + OpenResponsesWebSearchCallSearchingTypedDict, + ) from .openresponseswebsearchpreview20250311tool import ( OpenResponsesWebSearchPreview20250311Tool, + OpenResponsesWebSearchPreview20250311ToolEngine, + OpenResponsesWebSearchPreview20250311ToolFilters, + OpenResponsesWebSearchPreview20250311ToolFiltersTypedDict, OpenResponsesWebSearchPreview20250311ToolType, OpenResponsesWebSearchPreview20250311ToolTypedDict, ) from .openresponseswebsearchpreviewtool import ( OpenResponsesWebSearchPreviewTool, + OpenResponsesWebSearchPreviewToolEngine, + OpenResponsesWebSearchPreviewToolFilters, + OpenResponsesWebSearchPreviewToolFiltersTypedDict, OpenResponsesWebSearchPreviewToolType, OpenResponsesWebSearchPreviewToolTypedDict, ) from .openresponseswebsearchtool import ( OpenResponsesWebSearchTool, + OpenResponsesWebSearchToolEngine, OpenResponsesWebSearchToolFilters, OpenResponsesWebSearchToolFiltersTypedDict, OpenResponsesWebSearchToolType, @@ -605,6 +805,10 @@ OutputMessage, OutputMessageContent, OutputMessageContentTypedDict, + OutputMessagePhaseCommentary, + OutputMessagePhaseFinalAnswer, + OutputMessagePhaseUnion, + OutputMessagePhaseUnionTypedDict, OutputMessageRole, OutputMessageStatusCompleted, OutputMessageStatusInProgress, @@ -781,9 +985,9 @@ ResponseInputVideoTypedDict, ) from .responseoutputtext import ( - Logprob, - LogprobTypedDict, ResponseOutputText, + ResponseOutputTextLogprob, + ResponseOutputTextLogprobTypedDict, ResponseOutputTextTopLogprob, ResponseOutputTextTopLogprobTypedDict, ResponseOutputTextType, @@ -840,6 +1044,10 @@ ResponsesOutputMessage, ResponsesOutputMessageContent, ResponsesOutputMessageContentTypedDict, + ResponsesOutputMessagePhaseCommentary, + ResponsesOutputMessagePhaseFinalAnswer, + ResponsesOutputMessagePhaseUnion, + ResponsesOutputMessagePhaseUnionTypedDict, ResponsesOutputMessageRole, ResponsesOutputMessageStatusCompleted, ResponsesOutputMessageStatusInProgress, @@ -851,10 +1059,36 @@ ) from .responsesoutputmodality import ResponsesOutputModality from .responsessearchcontextsize import ResponsesSearchContextSize + from .responsesservertooloutput import ( + ResponsesServerToolOutput, + ResponsesServerToolOutputStatus, + ResponsesServerToolOutputTypedDict, + ) from .responseswebsearchcalloutput import ( + Action, + ActionFindInPage, + ActionFindInPageTypedDict, + ActionOpenPage, + ActionOpenPageTypedDict, + ActionSearch, + ActionSearchTypedDict, + ActionTypedDict, ResponsesWebSearchCallOutput, - ResponsesWebSearchCallOutputType, ResponsesWebSearchCallOutputTypedDict, + Source, + SourceTypedDict, + TypeFindInPage, + TypeOpenPage, + TypeSearch, + TypeURL, + TypeWebSearchCall, + ) + from .responseswebsearchservertool import ( + ResponsesWebSearchServerTool, + ResponsesWebSearchServerToolParameters, + ResponsesWebSearchServerToolParametersTypedDict, + ResponsesWebSearchServerToolType, + ResponsesWebSearchServerToolTypedDict, ) from .responseswebsearchuserlocation import ( ResponsesWebSearchUserLocation, @@ -889,6 +1123,8 @@ from .tooldefinitionjson import ( ToolDefinitionJSON, ToolDefinitionJSONFunction, + ToolDefinitionJSONFunctionFunction, + ToolDefinitionJSONFunctionFunctionTypedDict, ToolDefinitionJSONFunctionTypedDict, ToolDefinitionJSONType, ToolDefinitionJSONTypedDict, @@ -928,11 +1164,52 @@ WebSearchPreviewToolUserLocationType, WebSearchPreviewToolUserLocationTypedDict, ) + from .websearchservertool import ( + WebSearchServerTool, + WebSearchServerToolEngine, + WebSearchServerToolParameters, + WebSearchServerToolParametersType, + WebSearchServerToolParametersTypedDict, + WebSearchServerToolSearchContextSize, + WebSearchServerToolTypeOpenrouterWebSearch, + WebSearchServerToolTypedDict, + WebSearchServerToolUserLocation, + WebSearchServerToolUserLocationTypedDict, + ) + from .websearchshorthand import ( + WebSearchShorthand, + WebSearchShorthandEngine, + WebSearchShorthandParameters, + WebSearchShorthandParametersEngine, + WebSearchShorthandParametersSearchContextSize, + WebSearchShorthandParametersType, + WebSearchShorthandParametersTypedDict, + WebSearchShorthandParametersUserLocation, + WebSearchShorthandParametersUserLocationTypedDict, + WebSearchShorthandSearchContextSize, + WebSearchShorthandType, + WebSearchShorthandTypeApproximate, + WebSearchShorthandTypedDict, + WebSearchShorthandUserLocation, + WebSearchShorthandUserLocationTypedDict, + ) from .websearchstatus import WebSearchStatus __all__ = [ + "Action", + "ActionFindInPage", + "ActionFindInPageTypedDict", + "ActionOpenPage", + "ActionOpenPageTypedDict", + "ActionSearch", + "ActionSearchTypedDict", + "ActionTypedDict", "ActivityItem", "ActivityItemTypedDict", + "AllowedTools", + "AllowedToolsTypedDict", + "Always", + "AlwaysTypedDict", "Architecture", "ArchitectureTypedDict", "AssistantMessage", @@ -944,16 +1221,22 @@ "AssistantMessageImagesTypedDict", "AssistantMessageRole", "AssistantMessageTypedDict", + "Background", "BadGatewayResponseErrorData", "BadGatewayResponseErrorDataTypedDict", "BadRequestResponseErrorData", "BadRequestResponseErrorDataTypedDict", "By", + "CacheControl", + "CacheControlTypedDict", "ChainID", + "ChatCompletionAudioOutput", + "ChatCompletionAudioOutputTypedDict", "ChatCompletionFinishReason", "ChatGenerationParams", "ChatGenerationParamsBy", "ChatGenerationParamsIDAutoRouter", + "ChatGenerationParamsIDContextCompression", "ChatGenerationParamsIDFileParser", "ChatGenerationParamsIDModeration", "ChatGenerationParamsIDResponseHealing", @@ -971,6 +1254,8 @@ "ChatGenerationParamsPartition", "ChatGenerationParamsPluginAutoRouter", "ChatGenerationParamsPluginAutoRouterTypedDict", + "ChatGenerationParamsPluginContextCompression", + "ChatGenerationParamsPluginContextCompressionTypedDict", "ChatGenerationParamsPluginFileParser", "ChatGenerationParamsPluginFileParserTypedDict", "ChatGenerationParamsPluginModeration", @@ -992,8 +1277,10 @@ "ChatGenerationParamsSortEnum", "ChatGenerationParamsSortUnion", "ChatGenerationParamsSortUnionTypedDict", + "ChatGenerationParamsTTL", "ChatGenerationParamsTrace", "ChatGenerationParamsTraceTypedDict", + "ChatGenerationParamsType", "ChatGenerationParamsTypedDict", "ChatGenerationTokenUsage", "ChatGenerationTokenUsageTypedDict", @@ -1006,8 +1293,12 @@ "ChatMessageContentItemAudioType", "ChatMessageContentItemAudioTypedDict", "ChatMessageContentItemCacheControl", + "ChatMessageContentItemCacheControlTTL", "ChatMessageContentItemCacheControlType", "ChatMessageContentItemCacheControlTypedDict", + "ChatMessageContentItemFile", + "ChatMessageContentItemFileType", + "ChatMessageContentItemFileTypedDict", "ChatMessageContentItemImage", "ChatMessageContentItemImageDetail", "ChatMessageContentItemImageImageURL", @@ -1058,6 +1349,18 @@ "Code", "CompletionTokensDetails", "CompletionTokensDetailsTypedDict", + "CompoundFilter", + "CompoundFilterType", + "CompoundFilterTypedDict", + "ConflictResponseErrorData", + "ConflictResponseErrorDataTypedDict", + "ConnectorID", + "Container", + "ContainerAuto", + "ContainerAutoTypedDict", + "ContainerType", + "ContainerTypedDict", + "ContextCompressionEngine", "CostDetails", "CostDetailsTypedDict", "CreateChargeRequest", @@ -1065,6 +1368,11 @@ "Data", "DataCollection", "DataTypedDict", + "DatetimeServerTool", + "DatetimeServerToolParameters", + "DatetimeServerToolParametersTypedDict", + "DatetimeServerToolType", + "DatetimeServerToolTypedDict", "DebugOptions", "DebugOptionsTypedDict", "DefaultParameters", @@ -1078,17 +1386,34 @@ "EdgeNetworkTimeoutResponseErrorDataTypedDict", "Effort", "EndpointStatus", + "Environment", "Error", "ErrorTypedDict", + "File", "FileCitation", "FileCitationType", "FileCitationTypedDict", "FilePath", "FilePathType", "FilePathTypedDict", + "FileTypedDict", + "Filters", + "FiltersType", + "FiltersTypedDict", "ForbiddenResponseErrorData", "ForbiddenResponseErrorDataTypedDict", + "Format", + "FormatGrammar", + "FormatGrammarTypedDict", + "FormatText", + "FormatTextTypedDict", + "FormatTypeGrammar", + "FormatTypeText", + "FormatTypedDict", "ImageGenerationStatus", + "InputFidelity", + "InputImageMask", + "InputImageMaskTypedDict", "InputModality", "InputTokensDetails", "InputTokensDetailsTypedDict", @@ -1099,8 +1424,7 @@ "JSONSchemaConfigTypedDict", "ListEndpointsResponse", "ListEndpointsResponseTypedDict", - "Logprob", - "LogprobTypedDict", + "MemoryLimit", "Message", "MessageTypedDict", "Modality", @@ -1108,17 +1432,21 @@ "ModelArchitecture", "ModelArchitectureInstructType", "ModelArchitectureTypedDict", + "ModelEnum", "ModelGroup", "ModelTypedDict", "ModelsCountResponse", "ModelsCountResponseTypedDict", "ModelsListResponse", "ModelsListResponseTypedDict", + "Moderation", "NamedToolChoice", "NamedToolChoiceFunction", "NamedToolChoiceFunctionTypedDict", "NamedToolChoiceType", "NamedToolChoiceTypedDict", + "Never", + "NeverTypedDict", "NotFoundResponseErrorData", "NotFoundResponseErrorDataTypedDict", "OpenAIResponsesAnnotation", @@ -1140,6 +1468,14 @@ "OpenAIResponsesInputMessage1TypedDict", "OpenAIResponsesInputMessage2", "OpenAIResponsesInputMessage2TypedDict", + "OpenAIResponsesInputOutput1", + "OpenAIResponsesInputOutput1TypedDict", + "OpenAIResponsesInputOutput2", + "OpenAIResponsesInputOutput2TypedDict", + "OpenAIResponsesInputPhaseCommentary", + "OpenAIResponsesInputPhaseFinalAnswer", + "OpenAIResponsesInputPhaseUnion", + "OpenAIResponsesInputPhaseUnionTypedDict", "OpenAIResponsesInputRoleAssistant", "OpenAIResponsesInputRoleDeveloper1", "OpenAIResponsesInputRoleDeveloper2", @@ -1182,6 +1518,16 @@ "OpenAIResponsesToolChoiceUnion", "OpenAIResponsesToolChoiceUnionTypedDict", "OpenAIResponsesTruncation", + "OpenResponsesApplyPatchTool", + "OpenResponsesApplyPatchToolType", + "OpenResponsesApplyPatchToolTypedDict", + "OpenResponsesCodeInterpreterTool", + "OpenResponsesCodeInterpreterToolTypedDict", + "OpenResponsesComputerTool", + "OpenResponsesComputerToolType", + "OpenResponsesComputerToolTypedDict", + "OpenResponsesCustomTool", + "OpenResponsesCustomToolTypedDict", "OpenResponsesEasyInputMessage", "OpenResponsesEasyInputMessageContentInputImage", "OpenResponsesEasyInputMessageContentInputImageTypedDict", @@ -1191,6 +1537,10 @@ "OpenResponsesEasyInputMessageContentUnion2", "OpenResponsesEasyInputMessageContentUnion2TypedDict", "OpenResponsesEasyInputMessageDetail", + "OpenResponsesEasyInputMessagePhaseCommentary", + "OpenResponsesEasyInputMessagePhaseFinalAnswer", + "OpenResponsesEasyInputMessagePhaseUnion", + "OpenResponsesEasyInputMessagePhaseUnionTypedDict", "OpenResponsesEasyInputMessageRoleAssistant", "OpenResponsesEasyInputMessageRoleDeveloper", "OpenResponsesEasyInputMessageRoleSystem", @@ -1202,9 +1552,21 @@ "OpenResponsesErrorEvent", "OpenResponsesErrorEventType", "OpenResponsesErrorEventTypedDict", + "OpenResponsesFileSearchTool", + "OpenResponsesFileSearchToolFilters", + "OpenResponsesFileSearchToolFiltersTypedDict", + "OpenResponsesFileSearchToolTypedDict", "OpenResponsesFunctionCallOutput", - "OpenResponsesFunctionCallOutputType", + "OpenResponsesFunctionCallOutputDetail", + "OpenResponsesFunctionCallOutputOutputUnion1", + "OpenResponsesFunctionCallOutputOutputUnion1TypedDict", + "OpenResponsesFunctionCallOutputOutputUnion2", + "OpenResponsesFunctionCallOutputOutputUnion2TypedDict", + "OpenResponsesFunctionCallOutputTypeFunctionCallOutput", "OpenResponsesFunctionCallOutputTypedDict", + "OpenResponsesFunctionShellTool", + "OpenResponsesFunctionShellToolType", + "OpenResponsesFunctionShellToolTypedDict", "OpenResponsesFunctionToolCall", "OpenResponsesFunctionToolCallType", "OpenResponsesFunctionToolCallTypedDict", @@ -1220,9 +1582,15 @@ "OpenResponsesImageGenCallPartialImage", "OpenResponsesImageGenCallPartialImageType", "OpenResponsesImageGenCallPartialImageTypedDict", - "OpenResponsesInput", - "OpenResponsesInput1", - "OpenResponsesInput1TypedDict", + "OpenResponsesImageGenerationTool", + "OpenResponsesImageGenerationToolType", + "OpenResponsesImageGenerationToolTypedDict", + "OpenResponsesInputContent1", + "OpenResponsesInputContent1TypedDict", + "OpenResponsesInputContent2", + "OpenResponsesInputContent2TypedDict", + "OpenResponsesInputFormat", + "OpenResponsesInputMessage", "OpenResponsesInputMessageItem", "OpenResponsesInputMessageItemContentInputImage", "OpenResponsesInputMessageItemContentInputImageTypedDict", @@ -1237,9 +1605,36 @@ "OpenResponsesInputMessageItemRoleUser", "OpenResponsesInputMessageItemTypeMessage", "OpenResponsesInputMessageItemTypedDict", - "OpenResponsesInputTypedDict", - "OpenResponsesLogProbs", - "OpenResponsesLogProbsTypedDict", + "OpenResponsesInputMessageTypedDict", + "OpenResponsesInputPhaseCommentary", + "OpenResponsesInputPhaseFinalAnswer", + "OpenResponsesInputPhaseUnion", + "OpenResponsesInputPhaseUnionTypedDict", + "OpenResponsesInputReasoning", + "OpenResponsesInputReasoningTypedDict", + "OpenResponsesInputRole", + "OpenResponsesInputStatusCompleted1", + "OpenResponsesInputStatusCompleted2", + "OpenResponsesInputStatusInProgress1", + "OpenResponsesInputStatusInProgress2", + "OpenResponsesInputStatusIncomplete1", + "OpenResponsesInputStatusIncomplete2", + "OpenResponsesInputStatusUnion1", + "OpenResponsesInputStatusUnion1TypedDict", + "OpenResponsesInputStatusUnion2", + "OpenResponsesInputStatusUnion2TypedDict", + "OpenResponsesInputTypeMessage", + "OpenResponsesInputTypeReasoning", + "OpenResponsesInputUnion", + "OpenResponsesInputUnion1", + "OpenResponsesInputUnion1TypedDict", + "OpenResponsesInputUnionTypedDict", + "OpenResponsesLocalShellTool", + "OpenResponsesLocalShellToolType", + "OpenResponsesLocalShellToolTypedDict", + "OpenResponsesMcpTool", + "OpenResponsesMcpToolType", + "OpenResponsesMcpToolTypedDict", "OpenResponsesNonStreamingResponse", "OpenResponsesNonStreamingResponseObject", "OpenResponsesNonStreamingResponseToolFunction", @@ -1276,6 +1671,7 @@ "OpenResponsesReasoningTypedDict", "OpenResponsesRequest", "OpenResponsesRequestIDAutoRouter", + "OpenResponsesRequestIDContextCompression", "OpenResponsesRequestIDFileParser", "OpenResponsesRequestIDModeration", "OpenResponsesRequestIDResponseHealing", @@ -1292,6 +1688,8 @@ "OpenResponsesRequestOrderTypedDict", "OpenResponsesRequestPluginAutoRouter", "OpenResponsesRequestPluginAutoRouterTypedDict", + "OpenResponsesRequestPluginContextCompression", + "OpenResponsesRequestPluginContextCompressionTypedDict", "OpenResponsesRequestPluginFileParser", "OpenResponsesRequestPluginFileParserTypedDict", "OpenResponsesRequestPluginModeration", @@ -1318,6 +1716,10 @@ "OpenResponsesResponseTextTypedDict", "OpenResponsesResponseTextVerbosity", "OpenResponsesStreamEvent", + "OpenResponsesStreamEventLogprob1", + "OpenResponsesStreamEventLogprob1TypedDict", + "OpenResponsesStreamEventLogprob2", + "OpenResponsesStreamEventLogprob2TypedDict", "OpenResponsesStreamEventResponseCompleted", "OpenResponsesStreamEventResponseCompletedTypedDict", "OpenResponsesStreamEventResponseContentPartAdded", @@ -1352,33 +1754,59 @@ "OpenResponsesStreamEventResponseRefusalDeltaTypedDict", "OpenResponsesStreamEventResponseRefusalDone", "OpenResponsesStreamEventResponseRefusalDoneTypedDict", + "OpenResponsesStreamEventTopLogprob1", + "OpenResponsesStreamEventTopLogprob1TypedDict", + "OpenResponsesStreamEventTopLogprob2", + "OpenResponsesStreamEventTopLogprob2TypedDict", "OpenResponsesStreamEventTypedDict", - "OpenResponsesTopLogprobs", - "OpenResponsesTopLogprobsTypedDict", "OpenResponsesUsage", "OpenResponsesUsageTypedDict", "OpenResponsesWebSearch20250826Tool", + "OpenResponsesWebSearch20250826ToolEngine", "OpenResponsesWebSearch20250826ToolFilters", "OpenResponsesWebSearch20250826ToolFiltersTypedDict", "OpenResponsesWebSearch20250826ToolType", "OpenResponsesWebSearch20250826ToolTypedDict", + "OpenResponsesWebSearchCallCompleted", + "OpenResponsesWebSearchCallCompletedType", + "OpenResponsesWebSearchCallCompletedTypedDict", + "OpenResponsesWebSearchCallInProgress", + "OpenResponsesWebSearchCallInProgressType", + "OpenResponsesWebSearchCallInProgressTypedDict", + "OpenResponsesWebSearchCallSearching", + "OpenResponsesWebSearchCallSearchingType", + "OpenResponsesWebSearchCallSearchingTypedDict", "OpenResponsesWebSearchPreview20250311Tool", + "OpenResponsesWebSearchPreview20250311ToolEngine", + "OpenResponsesWebSearchPreview20250311ToolFilters", + "OpenResponsesWebSearchPreview20250311ToolFiltersTypedDict", "OpenResponsesWebSearchPreview20250311ToolType", "OpenResponsesWebSearchPreview20250311ToolTypedDict", "OpenResponsesWebSearchPreviewTool", + "OpenResponsesWebSearchPreviewToolEngine", + "OpenResponsesWebSearchPreviewToolFilters", + "OpenResponsesWebSearchPreviewToolFiltersTypedDict", "OpenResponsesWebSearchPreviewToolType", "OpenResponsesWebSearchPreviewToolTypedDict", "OpenResponsesWebSearchTool", + "OpenResponsesWebSearchToolEngine", "OpenResponsesWebSearchToolFilters", "OpenResponsesWebSearchToolFiltersTypedDict", "OpenResponsesWebSearchToolType", "OpenResponsesWebSearchToolTypedDict", + "OutputFormat", + "OutputInputImage", + "OutputInputImageTypedDict", "OutputItemImageGenerationCall", "OutputItemImageGenerationCallType", "OutputItemImageGenerationCallTypedDict", "OutputMessage", "OutputMessageContent", "OutputMessageContentTypedDict", + "OutputMessagePhaseCommentary", + "OutputMessagePhaseFinalAnswer", + "OutputMessagePhaseUnion", + "OutputMessagePhaseUnionTypedDict", "OutputMessageRole", "OutputMessageStatusCompleted", "OutputMessageStatusInProgress", @@ -1390,6 +1818,7 @@ "OutputModality", "OutputTokensDetails", "OutputTokensDetailsTypedDict", + "OutputType", "PDFParserEngine", "PDFParserOptions", "PDFParserOptionsTypedDict", @@ -1451,7 +1880,11 @@ "PublicEndpointTypedDict", "PublicPricing", "PublicPricingTypedDict", + "Quality", "Quantization", + "Ranker", + "RankingOptions", + "RankingOptionsTypedDict", "Reason", "Reasoning", "ReasoningDetailEncrypted", @@ -1478,6 +1911,10 @@ "ReasoningTypedDict", "RequestTimeoutResponseErrorData", "RequestTimeoutResponseErrorDataTypedDict", + "RequireApproval", + "RequireApprovalAlways", + "RequireApprovalNever", + "RequireApprovalTypedDict", "ResponseFormat", "ResponseFormatJSONObject", "ResponseFormatJSONObjectType", @@ -1517,6 +1954,8 @@ "ResponseInputVideoType", "ResponseInputVideoTypedDict", "ResponseOutputText", + "ResponseOutputTextLogprob", + "ResponseOutputTextLogprobTypedDict", "ResponseOutputTextTopLogprob", "ResponseOutputTextTopLogprobTypedDict", "ResponseOutputTextType", @@ -1560,6 +1999,10 @@ "ResponsesOutputMessage", "ResponsesOutputMessageContent", "ResponsesOutputMessageContentTypedDict", + "ResponsesOutputMessagePhaseCommentary", + "ResponsesOutputMessagePhaseFinalAnswer", + "ResponsesOutputMessagePhaseUnion", + "ResponsesOutputMessagePhaseUnionTypedDict", "ResponsesOutputMessageRole", "ResponsesOutputMessageStatusCompleted", "ResponsesOutputMessageStatusInProgress", @@ -1570,9 +2013,16 @@ "ResponsesOutputMessageTypedDict", "ResponsesOutputModality", "ResponsesSearchContextSize", + "ResponsesServerToolOutput", + "ResponsesServerToolOutputStatus", + "ResponsesServerToolOutputTypedDict", "ResponsesWebSearchCallOutput", - "ResponsesWebSearchCallOutputType", "ResponsesWebSearchCallOutputTypedDict", + "ResponsesWebSearchServerTool", + "ResponsesWebSearchServerToolParameters", + "ResponsesWebSearchServerToolParametersTypedDict", + "ResponsesWebSearchServerToolType", + "ResponsesWebSearchServerToolTypedDict", "ResponsesWebSearchUserLocation", "ResponsesWebSearchUserLocationType", "ResponsesWebSearchUserLocationTypedDict", @@ -1581,14 +2031,17 @@ "ServiceTier", "ServiceUnavailableResponseErrorData", "ServiceUnavailableResponseErrorDataTypedDict", + "Size", + "Source", + "SourceTypedDict", "Stop", "StopTypedDict", + "Syntax", "SystemMessage", "SystemMessageContent", "SystemMessageContentTypedDict", "SystemMessageRole", "SystemMessageTypedDict", - "TTL", "Tokenizer", "TooManyRequestsResponseErrorData", "TooManyRequestsResponseErrorDataTypedDict", @@ -1600,6 +2053,8 @@ "ToolChoiceOptionTypedDict", "ToolDefinitionJSON", "ToolDefinitionJSONFunction", + "ToolDefinitionJSONFunctionFunction", + "ToolDefinitionJSONFunctionFunctionTypedDict", "ToolDefinitionJSONFunctionTypedDict", "ToolDefinitionJSONType", "ToolDefinitionJSONTypedDict", @@ -1612,6 +2067,11 @@ "TopProviderInfoTypedDict", "Truncation", "Type", + "TypeCodeInterpreter", + "TypeCustom", + "TypeFileSearch", + "TypeFindInPage", + "TypeOpenPage", "TypeResponseCompleted", "TypeResponseContentPartAdded", "TypeResponseContentPartDone", @@ -1629,7 +2089,10 @@ "TypeResponseReasoningSummaryPartDone", "TypeResponseRefusalDelta", "TypeResponseRefusalDone", + "TypeSearch", "TypeTypedDict", + "TypeURL", + "TypeWebSearchCall", "URLCitation", "URLCitationType", "URLCitationTypedDict", @@ -1642,6 +2105,10 @@ "UserMessageContentTypedDict", "UserMessageRole", "UserMessageTypedDict", + "Value1", + "Value1TypedDict", + "Value2", + "Value2TypedDict", "Variables", "VariablesTypedDict", "VideoInput", @@ -1650,6 +2117,31 @@ "WebSearchPreviewToolUserLocation", "WebSearchPreviewToolUserLocationType", "WebSearchPreviewToolUserLocationTypedDict", + "WebSearchServerTool", + "WebSearchServerToolEngine", + "WebSearchServerToolParameters", + "WebSearchServerToolParametersType", + "WebSearchServerToolParametersTypedDict", + "WebSearchServerToolSearchContextSize", + "WebSearchServerToolTypeOpenrouterWebSearch", + "WebSearchServerToolTypedDict", + "WebSearchServerToolUserLocation", + "WebSearchServerToolUserLocationTypedDict", + "WebSearchShorthand", + "WebSearchShorthandEngine", + "WebSearchShorthandParameters", + "WebSearchShorthandParametersEngine", + "WebSearchShorthandParametersSearchContextSize", + "WebSearchShorthandParametersType", + "WebSearchShorthandParametersTypedDict", + "WebSearchShorthandParametersUserLocation", + "WebSearchShorthandParametersUserLocationTypedDict", + "WebSearchShorthandSearchContextSize", + "WebSearchShorthandType", + "WebSearchShorthandTypeApproximate", + "WebSearchShorthandTypedDict", + "WebSearchShorthandUserLocation", + "WebSearchShorthandUserLocationTypedDict", "WebSearchStatus", ] @@ -1669,10 +2161,15 @@ "BadGatewayResponseErrorDataTypedDict": ".badgatewayresponseerrordata", "BadRequestResponseErrorData": ".badrequestresponseerrordata", "BadRequestResponseErrorDataTypedDict": ".badrequestresponseerrordata", + "ChatCompletionAudioOutput": ".chatcompletionaudiooutput", + "ChatCompletionAudioOutputTypedDict": ".chatcompletionaudiooutput", "ChatCompletionFinishReason": ".chatcompletionfinishreason", + "CacheControl": ".chatgenerationparams", + "CacheControlTypedDict": ".chatgenerationparams", "ChatGenerationParams": ".chatgenerationparams", "ChatGenerationParamsBy": ".chatgenerationparams", "ChatGenerationParamsIDAutoRouter": ".chatgenerationparams", + "ChatGenerationParamsIDContextCompression": ".chatgenerationparams", "ChatGenerationParamsIDFileParser": ".chatgenerationparams", "ChatGenerationParamsIDModeration": ".chatgenerationparams", "ChatGenerationParamsIDResponseHealing": ".chatgenerationparams", @@ -1690,6 +2187,8 @@ "ChatGenerationParamsPartition": ".chatgenerationparams", "ChatGenerationParamsPluginAutoRouter": ".chatgenerationparams", "ChatGenerationParamsPluginAutoRouterTypedDict": ".chatgenerationparams", + "ChatGenerationParamsPluginContextCompression": ".chatgenerationparams", + "ChatGenerationParamsPluginContextCompressionTypedDict": ".chatgenerationparams", "ChatGenerationParamsPluginFileParser": ".chatgenerationparams", "ChatGenerationParamsPluginFileParserTypedDict": ".chatgenerationparams", "ChatGenerationParamsPluginModeration": ".chatgenerationparams", @@ -1711,8 +2210,10 @@ "ChatGenerationParamsSortEnum": ".chatgenerationparams", "ChatGenerationParamsSortUnion": ".chatgenerationparams", "ChatGenerationParamsSortUnionTypedDict": ".chatgenerationparams", + "ChatGenerationParamsTTL": ".chatgenerationparams", "ChatGenerationParamsTrace": ".chatgenerationparams", "ChatGenerationParamsTraceTypedDict": ".chatgenerationparams", + "ChatGenerationParamsType": ".chatgenerationparams", "ChatGenerationParamsTypedDict": ".chatgenerationparams", "Effort": ".chatgenerationparams", "Modality": ".chatgenerationparams", @@ -1738,9 +2239,14 @@ "ChatMessageContentItemAudioType": ".chatmessagecontentitemaudio", "ChatMessageContentItemAudioTypedDict": ".chatmessagecontentitemaudio", "ChatMessageContentItemCacheControl": ".chatmessagecontentitemcachecontrol", + "ChatMessageContentItemCacheControlTTL": ".chatmessagecontentitemcachecontrol", "ChatMessageContentItemCacheControlType": ".chatmessagecontentitemcachecontrol", "ChatMessageContentItemCacheControlTypedDict": ".chatmessagecontentitemcachecontrol", - "TTL": ".chatmessagecontentitemcachecontrol", + "ChatMessageContentItemFile": ".chatmessagecontentitemfile", + "ChatMessageContentItemFileType": ".chatmessagecontentitemfile", + "ChatMessageContentItemFileTypedDict": ".chatmessagecontentitemfile", + "File": ".chatmessagecontentitemfile", + "FileTypedDict": ".chatmessagecontentitemfile", "ChatMessageContentItemImage": ".chatmessagecontentitemimage", "ChatMessageContentItemImageDetail": ".chatmessagecontentitemimage", "ChatMessageContentItemImageImageURL": ".chatmessagecontentitemimage", @@ -1789,10 +2295,21 @@ "ErrorTypedDict": ".chatstreamingresponsechunk", "ChatStreamOptions": ".chatstreamoptions", "ChatStreamOptionsTypedDict": ".chatstreamoptions", + "CompoundFilter": ".compoundfilter", + "CompoundFilterType": ".compoundfilter", + "CompoundFilterTypedDict": ".compoundfilter", + "ConflictResponseErrorData": ".conflictresponseerrordata", + "ConflictResponseErrorDataTypedDict": ".conflictresponseerrordata", + "ContextCompressionEngine": ".contextcompressionengine", "ChainID": ".createchargerequest", "CreateChargeRequest": ".createchargerequest", "CreateChargeRequestTypedDict": ".createchargerequest", "DataCollection": ".datacollection", + "DatetimeServerTool": ".datetimeservertool", + "DatetimeServerToolParameters": ".datetimeservertool", + "DatetimeServerToolParametersTypedDict": ".datetimeservertool", + "DatetimeServerToolType": ".datetimeservertool", + "DatetimeServerToolTypedDict": ".datetimeservertool", "DebugOptions": ".debugoptions", "DebugOptionsTypedDict": ".debugoptions", "DefaultParameters": ".defaultparameters", @@ -1866,6 +2383,14 @@ "OpenAIResponsesInputMessage1TypedDict": ".openairesponsesinput_union", "OpenAIResponsesInputMessage2": ".openairesponsesinput_union", "OpenAIResponsesInputMessage2TypedDict": ".openairesponsesinput_union", + "OpenAIResponsesInputOutput1": ".openairesponsesinput_union", + "OpenAIResponsesInputOutput1TypedDict": ".openairesponsesinput_union", + "OpenAIResponsesInputOutput2": ".openairesponsesinput_union", + "OpenAIResponsesInputOutput2TypedDict": ".openairesponsesinput_union", + "OpenAIResponsesInputPhaseCommentary": ".openairesponsesinput_union", + "OpenAIResponsesInputPhaseFinalAnswer": ".openairesponsesinput_union", + "OpenAIResponsesInputPhaseUnion": ".openairesponsesinput_union", + "OpenAIResponsesInputPhaseUnionTypedDict": ".openairesponsesinput_union", "OpenAIResponsesInputRoleAssistant": ".openairesponsesinput_union", "OpenAIResponsesInputRoleDeveloper1": ".openairesponsesinput_union", "OpenAIResponsesInputRoleDeveloper2": ".openairesponsesinput_union", @@ -1912,6 +2437,34 @@ "Type": ".openairesponsestoolchoice_union", "TypeTypedDict": ".openairesponsestoolchoice_union", "OpenAIResponsesTruncation": ".openairesponsestruncation", + "OpenResponsesApplyPatchTool": ".openresponsesapplypatchtool", + "OpenResponsesApplyPatchToolType": ".openresponsesapplypatchtool", + "OpenResponsesApplyPatchToolTypedDict": ".openresponsesapplypatchtool", + "Container": ".openresponsescodeinterpretertool", + "ContainerAuto": ".openresponsescodeinterpretertool", + "ContainerAutoTypedDict": ".openresponsescodeinterpretertool", + "ContainerType": ".openresponsescodeinterpretertool", + "ContainerTypedDict": ".openresponsescodeinterpretertool", + "MemoryLimit": ".openresponsescodeinterpretertool", + "OpenResponsesCodeInterpreterTool": ".openresponsescodeinterpretertool", + "OpenResponsesCodeInterpreterToolTypedDict": ".openresponsescodeinterpretertool", + "TypeCodeInterpreter": ".openresponsescodeinterpretertool", + "Environment": ".openresponsescomputertool", + "OpenResponsesComputerTool": ".openresponsescomputertool", + "OpenResponsesComputerToolType": ".openresponsescomputertool", + "OpenResponsesComputerToolTypedDict": ".openresponsescomputertool", + "Format": ".openresponsescustomtool", + "FormatGrammar": ".openresponsescustomtool", + "FormatGrammarTypedDict": ".openresponsescustomtool", + "FormatText": ".openresponsescustomtool", + "FormatTextTypedDict": ".openresponsescustomtool", + "FormatTypeGrammar": ".openresponsescustomtool", + "FormatTypeText": ".openresponsescustomtool", + "FormatTypedDict": ".openresponsescustomtool", + "OpenResponsesCustomTool": ".openresponsescustomtool", + "OpenResponsesCustomToolTypedDict": ".openresponsescustomtool", + "Syntax": ".openresponsescustomtool", + "TypeCustom": ".openresponsescustomtool", "OpenResponsesEasyInputMessage": ".openresponseseasyinputmessage", "OpenResponsesEasyInputMessageContentInputImage": ".openresponseseasyinputmessage", "OpenResponsesEasyInputMessageContentInputImageTypedDict": ".openresponseseasyinputmessage", @@ -1921,6 +2474,10 @@ "OpenResponsesEasyInputMessageContentUnion2": ".openresponseseasyinputmessage", "OpenResponsesEasyInputMessageContentUnion2TypedDict": ".openresponseseasyinputmessage", "OpenResponsesEasyInputMessageDetail": ".openresponseseasyinputmessage", + "OpenResponsesEasyInputMessagePhaseCommentary": ".openresponseseasyinputmessage", + "OpenResponsesEasyInputMessagePhaseFinalAnswer": ".openresponseseasyinputmessage", + "OpenResponsesEasyInputMessagePhaseUnion": ".openresponseseasyinputmessage", + "OpenResponsesEasyInputMessagePhaseUnionTypedDict": ".openresponseseasyinputmessage", "OpenResponsesEasyInputMessageRoleAssistant": ".openresponseseasyinputmessage", "OpenResponsesEasyInputMessageRoleDeveloper": ".openresponseseasyinputmessage", "OpenResponsesEasyInputMessageRoleSystem": ".openresponseseasyinputmessage", @@ -1932,9 +2489,35 @@ "OpenResponsesErrorEvent": ".openresponseserrorevent", "OpenResponsesErrorEventType": ".openresponseserrorevent", "OpenResponsesErrorEventTypedDict": ".openresponseserrorevent", + "Filters": ".openresponsesfilesearchtool", + "FiltersType": ".openresponsesfilesearchtool", + "FiltersTypedDict": ".openresponsesfilesearchtool", + "OpenResponsesFileSearchTool": ".openresponsesfilesearchtool", + "OpenResponsesFileSearchToolFilters": ".openresponsesfilesearchtool", + "OpenResponsesFileSearchToolFiltersTypedDict": ".openresponsesfilesearchtool", + "OpenResponsesFileSearchToolTypedDict": ".openresponsesfilesearchtool", + "Ranker": ".openresponsesfilesearchtool", + "RankingOptions": ".openresponsesfilesearchtool", + "RankingOptionsTypedDict": ".openresponsesfilesearchtool", + "TypeFileSearch": ".openresponsesfilesearchtool", + "Value1": ".openresponsesfilesearchtool", + "Value1TypedDict": ".openresponsesfilesearchtool", + "Value2": ".openresponsesfilesearchtool", + "Value2TypedDict": ".openresponsesfilesearchtool", "OpenResponsesFunctionCallOutput": ".openresponsesfunctioncalloutput", - "OpenResponsesFunctionCallOutputType": ".openresponsesfunctioncalloutput", + "OpenResponsesFunctionCallOutputDetail": ".openresponsesfunctioncalloutput", + "OpenResponsesFunctionCallOutputOutputUnion1": ".openresponsesfunctioncalloutput", + "OpenResponsesFunctionCallOutputOutputUnion1TypedDict": ".openresponsesfunctioncalloutput", + "OpenResponsesFunctionCallOutputOutputUnion2": ".openresponsesfunctioncalloutput", + "OpenResponsesFunctionCallOutputOutputUnion2TypedDict": ".openresponsesfunctioncalloutput", + "OpenResponsesFunctionCallOutputTypeFunctionCallOutput": ".openresponsesfunctioncalloutput", "OpenResponsesFunctionCallOutputTypedDict": ".openresponsesfunctioncalloutput", + "OutputInputImage": ".openresponsesfunctioncalloutput", + "OutputInputImageTypedDict": ".openresponsesfunctioncalloutput", + "OutputType": ".openresponsesfunctioncalloutput", + "OpenResponsesFunctionShellTool": ".openresponsesfunctionshelltool", + "OpenResponsesFunctionShellToolType": ".openresponsesfunctionshelltool", + "OpenResponsesFunctionShellToolTypedDict": ".openresponsesfunctionshelltool", "OpenResponsesFunctionToolCall": ".openresponsesfunctiontoolcall", "OpenResponsesFunctionToolCallType": ".openresponsesfunctiontoolcall", "OpenResponsesFunctionToolCallTypedDict": ".openresponsesfunctiontoolcall", @@ -1950,10 +2533,48 @@ "OpenResponsesImageGenCallPartialImage": ".openresponsesimagegencallpartialimage", "OpenResponsesImageGenCallPartialImageType": ".openresponsesimagegencallpartialimage", "OpenResponsesImageGenCallPartialImageTypedDict": ".openresponsesimagegencallpartialimage", - "OpenResponsesInput": ".openresponsesinput", - "OpenResponsesInput1": ".openresponsesinput", - "OpenResponsesInput1TypedDict": ".openresponsesinput", - "OpenResponsesInputTypedDict": ".openresponsesinput", + "Background": ".openresponsesimagegenerationtool", + "InputFidelity": ".openresponsesimagegenerationtool", + "InputImageMask": ".openresponsesimagegenerationtool", + "InputImageMaskTypedDict": ".openresponsesimagegenerationtool", + "ModelEnum": ".openresponsesimagegenerationtool", + "Moderation": ".openresponsesimagegenerationtool", + "OpenResponsesImageGenerationTool": ".openresponsesimagegenerationtool", + "OpenResponsesImageGenerationToolType": ".openresponsesimagegenerationtool", + "OpenResponsesImageGenerationToolTypedDict": ".openresponsesimagegenerationtool", + "OutputFormat": ".openresponsesimagegenerationtool", + "Quality": ".openresponsesimagegenerationtool", + "Size": ".openresponsesimagegenerationtool", + "OpenResponsesInputContent1": ".openresponsesinput_union", + "OpenResponsesInputContent1TypedDict": ".openresponsesinput_union", + "OpenResponsesInputContent2": ".openresponsesinput_union", + "OpenResponsesInputContent2TypedDict": ".openresponsesinput_union", + "OpenResponsesInputFormat": ".openresponsesinput_union", + "OpenResponsesInputMessage": ".openresponsesinput_union", + "OpenResponsesInputMessageTypedDict": ".openresponsesinput_union", + "OpenResponsesInputPhaseCommentary": ".openresponsesinput_union", + "OpenResponsesInputPhaseFinalAnswer": ".openresponsesinput_union", + "OpenResponsesInputPhaseUnion": ".openresponsesinput_union", + "OpenResponsesInputPhaseUnionTypedDict": ".openresponsesinput_union", + "OpenResponsesInputReasoning": ".openresponsesinput_union", + "OpenResponsesInputReasoningTypedDict": ".openresponsesinput_union", + "OpenResponsesInputRole": ".openresponsesinput_union", + "OpenResponsesInputStatusCompleted1": ".openresponsesinput_union", + "OpenResponsesInputStatusCompleted2": ".openresponsesinput_union", + "OpenResponsesInputStatusInProgress1": ".openresponsesinput_union", + "OpenResponsesInputStatusInProgress2": ".openresponsesinput_union", + "OpenResponsesInputStatusIncomplete1": ".openresponsesinput_union", + "OpenResponsesInputStatusIncomplete2": ".openresponsesinput_union", + "OpenResponsesInputStatusUnion1": ".openresponsesinput_union", + "OpenResponsesInputStatusUnion1TypedDict": ".openresponsesinput_union", + "OpenResponsesInputStatusUnion2": ".openresponsesinput_union", + "OpenResponsesInputStatusUnion2TypedDict": ".openresponsesinput_union", + "OpenResponsesInputTypeMessage": ".openresponsesinput_union", + "OpenResponsesInputTypeReasoning": ".openresponsesinput_union", + "OpenResponsesInputUnion": ".openresponsesinput_union", + "OpenResponsesInputUnion1": ".openresponsesinput_union", + "OpenResponsesInputUnion1TypedDict": ".openresponsesinput_union", + "OpenResponsesInputUnionTypedDict": ".openresponsesinput_union", "OpenResponsesInputMessageItem": ".openresponsesinputmessageitem", "OpenResponsesInputMessageItemContentInputImage": ".openresponsesinputmessageitem", "OpenResponsesInputMessageItemContentInputImageTypedDict": ".openresponsesinputmessageitem", @@ -1968,8 +2589,23 @@ "OpenResponsesInputMessageItemRoleUser": ".openresponsesinputmessageitem", "OpenResponsesInputMessageItemTypeMessage": ".openresponsesinputmessageitem", "OpenResponsesInputMessageItemTypedDict": ".openresponsesinputmessageitem", - "OpenResponsesLogProbs": ".openresponseslogprobs", - "OpenResponsesLogProbsTypedDict": ".openresponseslogprobs", + "OpenResponsesLocalShellTool": ".openresponseslocalshelltool", + "OpenResponsesLocalShellToolType": ".openresponseslocalshelltool", + "OpenResponsesLocalShellToolTypedDict": ".openresponseslocalshelltool", + "AllowedTools": ".openresponsesmcptool", + "AllowedToolsTypedDict": ".openresponsesmcptool", + "Always": ".openresponsesmcptool", + "AlwaysTypedDict": ".openresponsesmcptool", + "ConnectorID": ".openresponsesmcptool", + "Never": ".openresponsesmcptool", + "NeverTypedDict": ".openresponsesmcptool", + "OpenResponsesMcpTool": ".openresponsesmcptool", + "OpenResponsesMcpToolType": ".openresponsesmcptool", + "OpenResponsesMcpToolTypedDict": ".openresponsesmcptool", + "RequireApproval": ".openresponsesmcptool", + "RequireApprovalAlways": ".openresponsesmcptool", + "RequireApprovalNever": ".openresponsesmcptool", + "RequireApprovalTypedDict": ".openresponsesmcptool", "OpenResponsesNonStreamingResponse": ".openresponsesnonstreamingresponse", "OpenResponsesNonStreamingResponseObject": ".openresponsesnonstreamingresponse", "OpenResponsesNonStreamingResponseToolFunction": ".openresponsesnonstreamingresponse", @@ -2006,6 +2642,7 @@ "OpenResponsesReasoningSummaryTextDoneEventTypedDict": ".openresponsesreasoningsummarytextdoneevent", "OpenResponsesRequest": ".openresponsesrequest", "OpenResponsesRequestIDAutoRouter": ".openresponsesrequest", + "OpenResponsesRequestIDContextCompression": ".openresponsesrequest", "OpenResponsesRequestIDFileParser": ".openresponsesrequest", "OpenResponsesRequestIDModeration": ".openresponsesrequest", "OpenResponsesRequestIDResponseHealing": ".openresponsesrequest", @@ -2022,6 +2659,8 @@ "OpenResponsesRequestOrderTypedDict": ".openresponsesrequest", "OpenResponsesRequestPluginAutoRouter": ".openresponsesrequest", "OpenResponsesRequestPluginAutoRouterTypedDict": ".openresponsesrequest", + "OpenResponsesRequestPluginContextCompression": ".openresponsesrequest", + "OpenResponsesRequestPluginContextCompressionTypedDict": ".openresponsesrequest", "OpenResponsesRequestPluginFileParser": ".openresponsesrequest", "OpenResponsesRequestPluginFileParserTypedDict": ".openresponsesrequest", "OpenResponsesRequestPluginModeration": ".openresponsesrequest", @@ -2050,6 +2689,10 @@ "OpenResponsesResponseTextTypedDict": ".openresponsesresponsetext", "OpenResponsesResponseTextVerbosity": ".openresponsesresponsetext", "OpenResponsesStreamEvent": ".openresponsesstreamevent", + "OpenResponsesStreamEventLogprob1": ".openresponsesstreamevent", + "OpenResponsesStreamEventLogprob1TypedDict": ".openresponsesstreamevent", + "OpenResponsesStreamEventLogprob2": ".openresponsesstreamevent", + "OpenResponsesStreamEventLogprob2TypedDict": ".openresponsesstreamevent", "OpenResponsesStreamEventResponseCompleted": ".openresponsesstreamevent", "OpenResponsesStreamEventResponseCompletedTypedDict": ".openresponsesstreamevent", "OpenResponsesStreamEventResponseContentPartAdded": ".openresponsesstreamevent", @@ -2084,6 +2727,10 @@ "OpenResponsesStreamEventResponseRefusalDeltaTypedDict": ".openresponsesstreamevent", "OpenResponsesStreamEventResponseRefusalDone": ".openresponsesstreamevent", "OpenResponsesStreamEventResponseRefusalDoneTypedDict": ".openresponsesstreamevent", + "OpenResponsesStreamEventTopLogprob1": ".openresponsesstreamevent", + "OpenResponsesStreamEventTopLogprob1TypedDict": ".openresponsesstreamevent", + "OpenResponsesStreamEventTopLogprob2": ".openresponsesstreamevent", + "OpenResponsesStreamEventTopLogprob2TypedDict": ".openresponsesstreamevent", "OpenResponsesStreamEventTypedDict": ".openresponsesstreamevent", "Part1": ".openresponsesstreamevent", "Part1TypedDict": ".openresponsesstreamevent", @@ -2106,8 +2753,6 @@ "TypeResponseReasoningSummaryPartDone": ".openresponsesstreamevent", "TypeResponseRefusalDelta": ".openresponsesstreamevent", "TypeResponseRefusalDone": ".openresponsesstreamevent", - "OpenResponsesTopLogprobs": ".openresponsestoplogprobs", - "OpenResponsesTopLogprobsTypedDict": ".openresponsestoplogprobs", "CostDetails": ".openresponsesusage", "CostDetailsTypedDict": ".openresponsesusage", "InputTokensDetails": ".openresponsesusage", @@ -2117,17 +2762,34 @@ "OutputTokensDetails": ".openresponsesusage", "OutputTokensDetailsTypedDict": ".openresponsesusage", "OpenResponsesWebSearch20250826Tool": ".openresponseswebsearch20250826tool", + "OpenResponsesWebSearch20250826ToolEngine": ".openresponseswebsearch20250826tool", "OpenResponsesWebSearch20250826ToolFilters": ".openresponseswebsearch20250826tool", "OpenResponsesWebSearch20250826ToolFiltersTypedDict": ".openresponseswebsearch20250826tool", "OpenResponsesWebSearch20250826ToolType": ".openresponseswebsearch20250826tool", "OpenResponsesWebSearch20250826ToolTypedDict": ".openresponseswebsearch20250826tool", + "OpenResponsesWebSearchCallCompleted": ".openresponseswebsearchcallcompleted", + "OpenResponsesWebSearchCallCompletedType": ".openresponseswebsearchcallcompleted", + "OpenResponsesWebSearchCallCompletedTypedDict": ".openresponseswebsearchcallcompleted", + "OpenResponsesWebSearchCallInProgress": ".openresponseswebsearchcallinprogress", + "OpenResponsesWebSearchCallInProgressType": ".openresponseswebsearchcallinprogress", + "OpenResponsesWebSearchCallInProgressTypedDict": ".openresponseswebsearchcallinprogress", + "OpenResponsesWebSearchCallSearching": ".openresponseswebsearchcallsearching", + "OpenResponsesWebSearchCallSearchingType": ".openresponseswebsearchcallsearching", + "OpenResponsesWebSearchCallSearchingTypedDict": ".openresponseswebsearchcallsearching", "OpenResponsesWebSearchPreview20250311Tool": ".openresponseswebsearchpreview20250311tool", + "OpenResponsesWebSearchPreview20250311ToolEngine": ".openresponseswebsearchpreview20250311tool", + "OpenResponsesWebSearchPreview20250311ToolFilters": ".openresponseswebsearchpreview20250311tool", + "OpenResponsesWebSearchPreview20250311ToolFiltersTypedDict": ".openresponseswebsearchpreview20250311tool", "OpenResponsesWebSearchPreview20250311ToolType": ".openresponseswebsearchpreview20250311tool", "OpenResponsesWebSearchPreview20250311ToolTypedDict": ".openresponseswebsearchpreview20250311tool", "OpenResponsesWebSearchPreviewTool": ".openresponseswebsearchpreviewtool", + "OpenResponsesWebSearchPreviewToolEngine": ".openresponseswebsearchpreviewtool", + "OpenResponsesWebSearchPreviewToolFilters": ".openresponseswebsearchpreviewtool", + "OpenResponsesWebSearchPreviewToolFiltersTypedDict": ".openresponseswebsearchpreviewtool", "OpenResponsesWebSearchPreviewToolType": ".openresponseswebsearchpreviewtool", "OpenResponsesWebSearchPreviewToolTypedDict": ".openresponseswebsearchpreviewtool", "OpenResponsesWebSearchTool": ".openresponseswebsearchtool", + "OpenResponsesWebSearchToolEngine": ".openresponseswebsearchtool", "OpenResponsesWebSearchToolFilters": ".openresponseswebsearchtool", "OpenResponsesWebSearchToolFiltersTypedDict": ".openresponseswebsearchtool", "OpenResponsesWebSearchToolType": ".openresponseswebsearchtool", @@ -2138,6 +2800,10 @@ "OutputMessage": ".outputmessage", "OutputMessageContent": ".outputmessage", "OutputMessageContentTypedDict": ".outputmessage", + "OutputMessagePhaseCommentary": ".outputmessage", + "OutputMessagePhaseFinalAnswer": ".outputmessage", + "OutputMessagePhaseUnion": ".outputmessage", + "OutputMessagePhaseUnionTypedDict": ".outputmessage", "OutputMessageRole": ".outputmessage", "OutputMessageStatusCompleted": ".outputmessage", "OutputMessageStatusInProgress": ".outputmessage", @@ -2263,9 +2929,9 @@ "ResponseInputVideo": ".responseinputvideo", "ResponseInputVideoType": ".responseinputvideo", "ResponseInputVideoTypedDict": ".responseinputvideo", - "Logprob": ".responseoutputtext", - "LogprobTypedDict": ".responseoutputtext", "ResponseOutputText": ".responseoutputtext", + "ResponseOutputTextLogprob": ".responseoutputtext", + "ResponseOutputTextLogprobTypedDict": ".responseoutputtext", "ResponseOutputTextTopLogprob": ".responseoutputtext", "ResponseOutputTextTopLogprobTypedDict": ".responseoutputtext", "ResponseOutputTextType": ".responseoutputtext", @@ -2307,6 +2973,10 @@ "ResponsesOutputMessage": ".responsesoutputmessage", "ResponsesOutputMessageContent": ".responsesoutputmessage", "ResponsesOutputMessageContentTypedDict": ".responsesoutputmessage", + "ResponsesOutputMessagePhaseCommentary": ".responsesoutputmessage", + "ResponsesOutputMessagePhaseFinalAnswer": ".responsesoutputmessage", + "ResponsesOutputMessagePhaseUnion": ".responsesoutputmessage", + "ResponsesOutputMessagePhaseUnionTypedDict": ".responsesoutputmessage", "ResponsesOutputMessageRole": ".responsesoutputmessage", "ResponsesOutputMessageStatusCompleted": ".responsesoutputmessage", "ResponsesOutputMessageStatusInProgress": ".responsesoutputmessage", @@ -2317,9 +2987,31 @@ "ResponsesOutputMessageTypedDict": ".responsesoutputmessage", "ResponsesOutputModality": ".responsesoutputmodality", "ResponsesSearchContextSize": ".responsessearchcontextsize", + "ResponsesServerToolOutput": ".responsesservertooloutput", + "ResponsesServerToolOutputStatus": ".responsesservertooloutput", + "ResponsesServerToolOutputTypedDict": ".responsesservertooloutput", + "Action": ".responseswebsearchcalloutput", + "ActionFindInPage": ".responseswebsearchcalloutput", + "ActionFindInPageTypedDict": ".responseswebsearchcalloutput", + "ActionOpenPage": ".responseswebsearchcalloutput", + "ActionOpenPageTypedDict": ".responseswebsearchcalloutput", + "ActionSearch": ".responseswebsearchcalloutput", + "ActionSearchTypedDict": ".responseswebsearchcalloutput", + "ActionTypedDict": ".responseswebsearchcalloutput", "ResponsesWebSearchCallOutput": ".responseswebsearchcalloutput", - "ResponsesWebSearchCallOutputType": ".responseswebsearchcalloutput", "ResponsesWebSearchCallOutputTypedDict": ".responseswebsearchcalloutput", + "Source": ".responseswebsearchcalloutput", + "SourceTypedDict": ".responseswebsearchcalloutput", + "TypeFindInPage": ".responseswebsearchcalloutput", + "TypeOpenPage": ".responseswebsearchcalloutput", + "TypeSearch": ".responseswebsearchcalloutput", + "TypeURL": ".responseswebsearchcalloutput", + "TypeWebSearchCall": ".responseswebsearchcalloutput", + "ResponsesWebSearchServerTool": ".responseswebsearchservertool", + "ResponsesWebSearchServerToolParameters": ".responseswebsearchservertool", + "ResponsesWebSearchServerToolParametersTypedDict": ".responseswebsearchservertool", + "ResponsesWebSearchServerToolType": ".responseswebsearchservertool", + "ResponsesWebSearchServerToolTypedDict": ".responseswebsearchservertool", "ResponsesWebSearchUserLocation": ".responseswebsearchuserlocation", "ResponsesWebSearchUserLocationType": ".responseswebsearchuserlocation", "ResponsesWebSearchUserLocationTypedDict": ".responseswebsearchuserlocation", @@ -2343,6 +3035,8 @@ "ToolChoiceOptionTypedDict": ".toolchoiceoption", "ToolDefinitionJSON": ".tooldefinitionjson", "ToolDefinitionJSONFunction": ".tooldefinitionjson", + "ToolDefinitionJSONFunctionFunction": ".tooldefinitionjson", + "ToolDefinitionJSONFunctionFunctionTypedDict": ".tooldefinitionjson", "ToolDefinitionJSONFunctionTypedDict": ".tooldefinitionjson", "ToolDefinitionJSONType": ".tooldefinitionjson", "ToolDefinitionJSONTypedDict": ".tooldefinitionjson", @@ -2373,6 +3067,31 @@ "WebSearchPreviewToolUserLocation": ".websearchpreviewtooluserlocation", "WebSearchPreviewToolUserLocationType": ".websearchpreviewtooluserlocation", "WebSearchPreviewToolUserLocationTypedDict": ".websearchpreviewtooluserlocation", + "WebSearchServerTool": ".websearchservertool", + "WebSearchServerToolEngine": ".websearchservertool", + "WebSearchServerToolParameters": ".websearchservertool", + "WebSearchServerToolParametersType": ".websearchservertool", + "WebSearchServerToolParametersTypedDict": ".websearchservertool", + "WebSearchServerToolSearchContextSize": ".websearchservertool", + "WebSearchServerToolTypeOpenrouterWebSearch": ".websearchservertool", + "WebSearchServerToolTypedDict": ".websearchservertool", + "WebSearchServerToolUserLocation": ".websearchservertool", + "WebSearchServerToolUserLocationTypedDict": ".websearchservertool", + "WebSearchShorthand": ".websearchshorthand", + "WebSearchShorthandEngine": ".websearchshorthand", + "WebSearchShorthandParameters": ".websearchshorthand", + "WebSearchShorthandParametersEngine": ".websearchshorthand", + "WebSearchShorthandParametersSearchContextSize": ".websearchshorthand", + "WebSearchShorthandParametersType": ".websearchshorthand", + "WebSearchShorthandParametersTypedDict": ".websearchshorthand", + "WebSearchShorthandParametersUserLocation": ".websearchshorthand", + "WebSearchShorthandParametersUserLocationTypedDict": ".websearchshorthand", + "WebSearchShorthandSearchContextSize": ".websearchshorthand", + "WebSearchShorthandType": ".websearchshorthand", + "WebSearchShorthandTypeApproximate": ".websearchshorthand", + "WebSearchShorthandTypedDict": ".websearchshorthand", + "WebSearchShorthandUserLocation": ".websearchshorthand", + "WebSearchShorthandUserLocationTypedDict": ".websearchshorthand", "WebSearchStatus": ".websearchstatus", } diff --git a/src/openrouter/components/assistantmessage.py b/src/openrouter/components/assistantmessage.py index 53c5026..7666beb 100644 --- a/src/openrouter/components/assistantmessage.py +++ b/src/openrouter/components/assistantmessage.py @@ -5,6 +5,10 @@ AssistantMessageImages, AssistantMessageImagesTypedDict, ) +from .chatcompletionaudiooutput import ( + ChatCompletionAudioOutput, + ChatCompletionAudioOutputTypedDict, +) from .chatmessagecontentitem import ( ChatMessageContentItem, ChatMessageContentItemTypedDict, @@ -57,6 +61,8 @@ class AssistantMessageTypedDict(TypedDict): r"""Reasoning details for extended thinking models""" images: NotRequired[List[AssistantMessageImagesTypedDict]] r"""Generated images from image generation models""" + audio: NotRequired[ChatCompletionAudioOutputTypedDict] + r"""Audio output data or reference""" class AssistantMessage(BaseModel): @@ -85,6 +91,9 @@ class AssistantMessage(BaseModel): images: Optional[List[AssistantMessageImages]] = None r"""Generated images from image generation models""" + audio: Optional[ChatCompletionAudioOutput] = None + r"""Audio output data or reference""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = [ @@ -95,6 +104,7 @@ def serialize_model(self, handler): "reasoning", "reasoning_details", "images", + "audio", ] nullable_fields = ["content", "refusal", "reasoning"] null_default_fields = [] diff --git a/src/openrouter/components/chatcompletionaudiooutput.py b/src/openrouter/components/chatcompletionaudiooutput.py new file mode 100644 index 0000000..b270993 --- /dev/null +++ b/src/openrouter/components/chatcompletionaudiooutput.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class ChatCompletionAudioOutputTypedDict(TypedDict): + r"""Audio output data or reference""" + + id: NotRequired[str] + r"""Audio output identifier""" + expires_at: NotRequired[float] + r"""Audio expiration timestamp""" + data: NotRequired[str] + r"""Base64 encoded audio data""" + transcript: NotRequired[str] + r"""Audio transcript""" + + +class ChatCompletionAudioOutput(BaseModel): + r"""Audio output data or reference""" + + id: Optional[str] = None + r"""Audio output identifier""" + + expires_at: Optional[float] = None + r"""Audio expiration timestamp""" + + data: Optional[str] = None + r"""Base64 encoded audio data""" + + transcript: Optional[str] = None + r"""Audio transcript""" diff --git a/src/openrouter/components/chatgenerationparams.py b/src/openrouter/components/chatgenerationparams.py index fa8b22c..d5eea80 100644 --- a/src/openrouter/components/chatgenerationparams.py +++ b/src/openrouter/components/chatgenerationparams.py @@ -2,6 +2,7 @@ from __future__ import annotations from .chatstreamoptions import ChatStreamOptions, ChatStreamOptionsTypedDict +from .contextcompressionengine import ContextCompressionEngine from .datacollection import DataCollection from .debugoptions import DebugOptions, DebugOptionsTypedDict from .message import Message, MessageTypedDict @@ -87,6 +88,7 @@ "price", "throughput", "latency", + "exacto", ], UnrecognizedStr, ] @@ -96,6 +98,7 @@ "price", "throughput", "latency", + "exacto", ] @@ -104,6 +107,7 @@ "price", "throughput", "latency", + "exacto", ], UnrecognizedStr, ] @@ -194,6 +198,7 @@ def serialize_model(self, handler): "price", "throughput", "latency", + "exacto", ], UnrecognizedStr, ] @@ -401,6 +406,27 @@ def serialize_model(self, handler): return m +ChatGenerationParamsIDContextCompression = Literal["context-compression",] + + +class ChatGenerationParamsPluginContextCompressionTypedDict(TypedDict): + id: ChatGenerationParamsIDContextCompression + enabled: NotRequired[bool] + r"""Set to false to disable the context-compression plugin for this request. Defaults to true.""" + engine: NotRequired[ContextCompressionEngine] + r"""The compression engine to use. Defaults to \"middle-out\".""" + + +class ChatGenerationParamsPluginContextCompression(BaseModel): + id: ChatGenerationParamsIDContextCompression + + enabled: Optional[bool] = None + r"""Set to false to disable the context-compression plugin for this request. Defaults to true.""" + + engine: Optional[ContextCompressionEngine] = None + r"""The compression engine to use. Defaults to \"middle-out\".""" + + ChatGenerationParamsIDResponseHealing = Literal["response-healing",] @@ -449,6 +475,10 @@ class ChatGenerationParamsPluginWebTypedDict(TypedDict): search_prompt: NotRequired[str] engine: NotRequired[WebSearchEngine] r"""The search engine to use for web search.""" + include_domains: NotRequired[List[str]] + r"""A list of domains to restrict web search results to. Supports wildcards (e.g. \"*.substack.com\") and path filtering (e.g. \"openai.com/blog\").""" + exclude_domains: NotRequired[List[str]] + r"""A list of domains to exclude from web search results. Supports wildcards (e.g. \"*.substack.com\") and path filtering (e.g. \"openai.com/blog\").""" class ChatGenerationParamsPluginWeb(BaseModel): @@ -466,6 +496,12 @@ class ChatGenerationParamsPluginWeb(BaseModel): ] = None r"""The search engine to use for web search.""" + include_domains: Optional[List[str]] = None + r"""A list of domains to restrict web search results to. Supports wildcards (e.g. \"*.substack.com\") and path filtering (e.g. \"openai.com/blog\").""" + + exclude_domains: Optional[List[str]] = None + r"""A list of domains to exclude from web search results. Supports wildcards (e.g. \"*.substack.com\") and path filtering (e.g. \"openai.com/blog\").""" + ChatGenerationParamsIDModeration = Literal["moderation",] @@ -506,6 +542,7 @@ class ChatGenerationParamsPluginAutoRouter(BaseModel): ChatGenerationParamsPluginResponseHealingTypedDict, ChatGenerationParamsPluginAutoRouterTypedDict, ChatGenerationParamsPluginFileParserTypedDict, + ChatGenerationParamsPluginContextCompressionTypedDict, ChatGenerationParamsPluginWebTypedDict, ], ) @@ -518,6 +555,9 @@ class ChatGenerationParamsPluginAutoRouter(BaseModel): Annotated[ChatGenerationParamsPluginWeb, Tag("web")], Annotated[ChatGenerationParamsPluginFileParser, Tag("file-parser")], Annotated[ChatGenerationParamsPluginResponseHealing, Tag("response-healing")], + Annotated[ + ChatGenerationParamsPluginContextCompression, Tag("context-compression") + ], ], Discriminator(lambda m: get_discriminator(m, "id", "id")), ] @@ -671,11 +711,41 @@ def serialize_model(self, handler): Literal[ "text", "image", + "audio", ], UnrecognizedStr, ] +ChatGenerationParamsType = Literal["ephemeral",] + + +ChatGenerationParamsTTL = Union[ + Literal[ + "5m", + "1h", + ], + UnrecognizedStr, +] + + +class CacheControlTypedDict(TypedDict): + r"""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.""" + + type: ChatGenerationParamsType + ttl: NotRequired[ChatGenerationParamsTTL] + + +class CacheControl(BaseModel): + r"""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.""" + + type: ChatGenerationParamsType + + ttl: Annotated[ + Optional[ChatGenerationParamsTTL], PlainValidator(validate_open_enum(False)) + ] = None + + class ChatGenerationParamsTypedDict(TypedDict): r"""Chat completion request parameters""" @@ -706,7 +776,7 @@ class ChatGenerationParamsTypedDict(TypedDict): max_completion_tokens: NotRequired[Nullable[float]] r"""Maximum tokens in completion""" max_tokens: NotRequired[Nullable[float]] - r"""Maximum tokens (deprecated, use max_completion_tokens)""" + r"""Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16.""" metadata: NotRequired[Dict[str, str]] r"""Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values)""" presence_penalty: NotRequired[Nullable[float]] @@ -737,7 +807,9 @@ class ChatGenerationParamsTypedDict(TypedDict): image_config: NotRequired[Dict[str, ChatGenerationParamsImageConfigTypedDict]] r"""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.""" modalities: NotRequired[List[Modality]] - r"""Output modalities for the response. Supported values are \"text\" and \"image\".""" + r"""Output modalities for the response. Supported values are \"text\", \"image\", and \"audio\".""" + cache_control: NotRequired[CacheControlTypedDict] + r"""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.""" class ChatGenerationParams(BaseModel): @@ -783,7 +855,7 @@ class ChatGenerationParams(BaseModel): r"""Maximum tokens in completion""" max_tokens: OptionalNullable[float] = UNSET - r"""Maximum tokens (deprecated, use max_completion_tokens)""" + r"""Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16.""" metadata: Optional[Dict[str, str]] = None r"""Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values)""" @@ -832,7 +904,10 @@ class ChatGenerationParams(BaseModel): modalities: Optional[ List[Annotated[Modality, PlainValidator(validate_open_enum(False))]] ] = None - r"""Output modalities for the response. Supported values are \"text\" and \"image\".""" + r"""Output modalities for the response. Supported values are \"text\", \"image\", and \"audio\".""" + + cache_control: Optional[CacheControl] = None + r"""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.""" @model_serializer(mode="wrap") def serialize_model(self, handler): @@ -866,6 +941,7 @@ def serialize_model(self, handler): "debug", "image_config", "modalities", + "cache_control", ] nullable_fields = [ "provider", diff --git a/src/openrouter/components/chatmessagecontentitem.py b/src/openrouter/components/chatmessagecontentitem.py index e650b7f..8ebc9b7 100644 --- a/src/openrouter/components/chatmessagecontentitem.py +++ b/src/openrouter/components/chatmessagecontentitem.py @@ -5,6 +5,10 @@ ChatMessageContentItemAudio, ChatMessageContentItemAudioTypedDict, ) +from .chatmessagecontentitemfile import ( + ChatMessageContentItemFile, + ChatMessageContentItemFileTypedDict, +) from .chatmessagecontentitemimage import ( ChatMessageContentItemImage, ChatMessageContentItemImageTypedDict, @@ -49,6 +53,7 @@ Union[ ChatMessageContentItemImageTypedDict, ChatMessageContentItemAudioTypedDict, + ChatMessageContentItemFileTypedDict, ChatMessageContentItemTextTypedDict, ChatMessageContentItem1TypedDict, ], @@ -61,6 +66,7 @@ Union[ ChatMessageContentItemImage, ChatMessageContentItemAudio, + ChatMessageContentItemFile, ChatMessageContentItemText, ChatMessageContentItem1, ], diff --git a/src/openrouter/components/chatmessagecontentitemcachecontrol.py b/src/openrouter/components/chatmessagecontentitemcachecontrol.py index d8ed801..af4b966 100644 --- a/src/openrouter/components/chatmessagecontentitemcachecontrol.py +++ b/src/openrouter/components/chatmessagecontentitemcachecontrol.py @@ -11,7 +11,7 @@ ChatMessageContentItemCacheControlType = Literal["ephemeral",] -TTL = Union[ +ChatMessageContentItemCacheControlTTL = Union[ Literal[ "5m", "1h", @@ -24,7 +24,7 @@ class ChatMessageContentItemCacheControlTypedDict(TypedDict): r"""Cache control for the content part""" type: ChatMessageContentItemCacheControlType - ttl: NotRequired[TTL] + ttl: NotRequired[ChatMessageContentItemCacheControlTTL] class ChatMessageContentItemCacheControl(BaseModel): @@ -32,4 +32,7 @@ class ChatMessageContentItemCacheControl(BaseModel): type: ChatMessageContentItemCacheControlType - ttl: Annotated[Optional[TTL], PlainValidator(validate_open_enum(False))] = None + ttl: Annotated[ + Optional[ChatMessageContentItemCacheControlTTL], + PlainValidator(validate_open_enum(False)), + ] = None diff --git a/src/openrouter/components/chatmessagecontentitemfile.py b/src/openrouter/components/chatmessagecontentitemfile.py new file mode 100644 index 0000000..0256bb3 --- /dev/null +++ b/src/openrouter/components/chatmessagecontentitemfile.py @@ -0,0 +1,44 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Literal, Optional +from typing_extensions import NotRequired, TypedDict + + +ChatMessageContentItemFileType = Literal["file",] + + +class FileTypedDict(TypedDict): + file_data: NotRequired[str] + r"""File content as base64 data URL or URL""" + file_id: NotRequired[str] + r"""File ID for previously uploaded files""" + filename: NotRequired[str] + r"""Original filename""" + + +class File(BaseModel): + file_data: Optional[str] = None + r"""File content as base64 data URL or URL""" + + file_id: Optional[str] = None + r"""File ID for previously uploaded files""" + + filename: Optional[str] = None + r"""Original filename""" + + +class ChatMessageContentItemFileTypedDict(TypedDict): + r"""File content part for document processing""" + + type: ChatMessageContentItemFileType + file: FileTypedDict + + +class ChatMessageContentItemFile(BaseModel): + r"""File content part for document processing""" + + type: ChatMessageContentItemFileType + + file: File diff --git a/src/openrouter/components/chatmessagetokenlogprobs.py b/src/openrouter/components/chatmessagetokenlogprobs.py index 6af442a..d73e5e1 100644 --- a/src/openrouter/components/chatmessagetokenlogprobs.py +++ b/src/openrouter/components/chatmessagetokenlogprobs.py @@ -5,10 +5,16 @@ ChatMessageTokenLogprob, ChatMessageTokenLogprobTypedDict, ) -from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) from pydantic import model_serializer from typing import List -from typing_extensions import TypedDict +from typing_extensions import NotRequired, TypedDict class ChatMessageTokenLogprobsTypedDict(TypedDict): @@ -16,7 +22,7 @@ class ChatMessageTokenLogprobsTypedDict(TypedDict): content: Nullable[List[ChatMessageTokenLogprobTypedDict]] r"""Log probabilities for content tokens""" - refusal: Nullable[List[ChatMessageTokenLogprobTypedDict]] + refusal: NotRequired[Nullable[List[ChatMessageTokenLogprobTypedDict]]] r"""Log probabilities for refusal tokens""" @@ -26,12 +32,12 @@ class ChatMessageTokenLogprobs(BaseModel): content: Nullable[List[ChatMessageTokenLogprob]] r"""Log probabilities for content tokens""" - refusal: Nullable[List[ChatMessageTokenLogprob]] + refusal: OptionalNullable[List[ChatMessageTokenLogprob]] = UNSET r"""Log probabilities for refusal tokens""" @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = [] + optional_fields = ["refusal"] nullable_fields = ["content", "refusal"] null_default_fields = [] diff --git a/src/openrouter/components/chatresponse.py b/src/openrouter/components/chatresponse.py index 4aa696f..b9f1c19 100644 --- a/src/openrouter/components/chatresponse.py +++ b/src/openrouter/components/chatresponse.py @@ -6,13 +6,7 @@ ChatGenerationTokenUsageTypedDict, ) from .chatresponsechoice import ChatResponseChoice, ChatResponseChoiceTypedDict -from openrouter.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL from pydantic import model_serializer from typing import List, Literal, Optional from typing_extensions import NotRequired, TypedDict @@ -33,7 +27,7 @@ class ChatResponseTypedDict(TypedDict): model: str r"""Model used for completion""" object: ChatResponseObject - system_fingerprint: NotRequired[Nullable[str]] + system_fingerprint: Nullable[str] r"""System fingerprint""" usage: NotRequired[ChatGenerationTokenUsageTypedDict] r"""Token usage statistics""" @@ -56,7 +50,7 @@ class ChatResponse(BaseModel): object: ChatResponseObject - system_fingerprint: OptionalNullable[str] = UNSET + system_fingerprint: Nullable[str] r"""System fingerprint""" usage: Optional[ChatGenerationTokenUsage] = None @@ -64,7 +58,7 @@ class ChatResponse(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["system_fingerprint", "usage"] + optional_fields = ["usage"] nullable_fields = ["system_fingerprint"] null_default_fields = [] diff --git a/src/openrouter/components/chatstreamingmessagechunk.py b/src/openrouter/components/chatstreamingmessagechunk.py index fb1d23e..016a6df 100644 --- a/src/openrouter/components/chatstreamingmessagechunk.py +++ b/src/openrouter/components/chatstreamingmessagechunk.py @@ -1,6 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .chatcompletionaudiooutput import ( + ChatCompletionAudioOutput, + ChatCompletionAudioOutputTypedDict, +) from .chatstreamingmessagetoolcall import ( ChatStreamingMessageToolCall, ChatStreamingMessageToolCallTypedDict, @@ -37,6 +41,7 @@ class ChatStreamingMessageChunkTypedDict(TypedDict): r"""Tool calls delta""" reasoning_details: NotRequired[List[ReasoningDetailUnionTypedDict]] r"""Reasoning details for extended thinking models""" + audio: NotRequired[ChatCompletionAudioOutputTypedDict] class ChatStreamingMessageChunk(BaseModel): @@ -60,6 +65,8 @@ class ChatStreamingMessageChunk(BaseModel): reasoning_details: Optional[List[ReasoningDetailUnion]] = None r"""Reasoning details for extended thinking models""" + audio: Optional[ChatCompletionAudioOutput] = None + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = [ @@ -69,6 +76,7 @@ def serialize_model(self, handler): "refusal", "tool_calls", "reasoning_details", + "audio", ] nullable_fields = ["content", "reasoning", "refusal"] null_default_fields = [] diff --git a/src/openrouter/components/chatstreamingresponsechunk.py b/src/openrouter/components/chatstreamingresponsechunk.py index d2a1fe0..2d7c347 100644 --- a/src/openrouter/components/chatstreamingresponsechunk.py +++ b/src/openrouter/components/chatstreamingresponsechunk.py @@ -6,14 +6,7 @@ ChatGenerationTokenUsageTypedDict, ) from .chatstreamingchoice import ChatStreamingChoice, ChatStreamingChoiceTypedDict -from openrouter.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from pydantic import model_serializer +from openrouter.types import BaseModel from typing import List, Literal, Optional from typing_extensions import NotRequired, TypedDict @@ -52,7 +45,7 @@ class ChatStreamingResponseChunkTypedDict(TypedDict): model: str r"""Model used for completion""" object: ChatStreamingResponseChunkObject - system_fingerprint: NotRequired[Nullable[str]] + system_fingerprint: NotRequired[str] r"""System fingerprint""" error: NotRequired[ErrorTypedDict] r"""Error information""" @@ -77,7 +70,7 @@ class ChatStreamingResponseChunk(BaseModel): object: ChatStreamingResponseChunkObject - system_fingerprint: OptionalNullable[str] = UNSET + system_fingerprint: Optional[str] = None r"""System fingerprint""" error: Optional[Error] = None @@ -85,33 +78,3 @@ class ChatStreamingResponseChunk(BaseModel): usage: Optional[ChatGenerationTokenUsage] = None r"""Token usage statistics""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["system_fingerprint", "error", "usage"] - nullable_fields = ["system_fingerprint"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/openrouter/components/compoundfilter.py b/src/openrouter/components/compoundfilter.py new file mode 100644 index 0000000..f4bcd55 --- /dev/null +++ b/src/openrouter/components/compoundfilter.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, Nullable, UnrecognizedStr +from openrouter.utils import validate_open_enum +from pydantic.functional_validators import PlainValidator +from typing import Any, Dict, List, Literal, Union +from typing_extensions import Annotated, TypedDict + + +CompoundFilterType = Union[ + Literal[ + "and", + "or", + ], + UnrecognizedStr, +] + + +class CompoundFilterTypedDict(TypedDict): + r"""A compound filter that combines multiple comparison or compound filters""" + + type: CompoundFilterType + filters: List[Dict[str, Nullable[Any]]] + + +class CompoundFilter(BaseModel): + r"""A compound filter that combines multiple comparison or compound filters""" + + type: Annotated[CompoundFilterType, PlainValidator(validate_open_enum(False))] + + filters: List[Dict[str, Nullable[Any]]] diff --git a/src/openrouter/components/conflictresponseerrordata.py b/src/openrouter/components/conflictresponseerrordata.py new file mode 100644 index 0000000..fdbfb16 --- /dev/null +++ b/src/openrouter/components/conflictresponseerrordata.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, Dict +from typing_extensions import NotRequired, TypedDict + + +class ConflictResponseErrorDataTypedDict(TypedDict): + r"""Error data for ConflictResponse""" + + code: int + message: str + metadata: NotRequired[Nullable[Dict[str, Nullable[Any]]]] + + +class ConflictResponseErrorData(BaseModel): + r"""Error data for ConflictResponse""" + + code: int + + message: str + + metadata: OptionalNullable[Dict[str, Nullable[Any]]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["metadata"] + nullable_fields = ["metadata"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/openrouter/components/contextcompressionengine.py b/src/openrouter/components/contextcompressionengine.py new file mode 100644 index 0000000..7d5b6f7 --- /dev/null +++ b/src/openrouter/components/contextcompressionengine.py @@ -0,0 +1,8 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from typing import Literal + + +ContextCompressionEngine = Literal["middle-out",] +r"""The compression engine to use. Defaults to \"middle-out\".""" diff --git a/src/openrouter/components/datetimeservertool.py b/src/openrouter/components/datetimeservertool.py new file mode 100644 index 0000000..ced5c34 --- /dev/null +++ b/src/openrouter/components/datetimeservertool.py @@ -0,0 +1,34 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Literal, Optional +from typing_extensions import NotRequired, TypedDict + + +DatetimeServerToolType = Literal["openrouter:datetime",] + + +class DatetimeServerToolParametersTypedDict(TypedDict): + timezone: NotRequired[str] + r"""IANA timezone name (e.g. \"America/New_York\"). Defaults to UTC.""" + + +class DatetimeServerToolParameters(BaseModel): + timezone: Optional[str] = None + r"""IANA timezone name (e.g. \"America/New_York\"). Defaults to UTC.""" + + +class DatetimeServerToolTypedDict(TypedDict): + r"""OpenRouter built-in server tool: returns the current date and time""" + + type: DatetimeServerToolType + parameters: NotRequired[DatetimeServerToolParametersTypedDict] + + +class DatetimeServerTool(BaseModel): + r"""OpenRouter built-in server tool: returns the current date and time""" + + type: DatetimeServerToolType + + parameters: Optional[DatetimeServerToolParameters] = None diff --git a/src/openrouter/components/defaultparameters.py b/src/openrouter/components/defaultparameters.py index b28498a..8af36cc 100644 --- a/src/openrouter/components/defaultparameters.py +++ b/src/openrouter/components/defaultparameters.py @@ -17,7 +17,10 @@ class DefaultParametersTypedDict(TypedDict): temperature: NotRequired[Nullable[float]] top_p: NotRequired[Nullable[float]] + top_k: NotRequired[Nullable[int]] frequency_penalty: NotRequired[Nullable[float]] + presence_penalty: NotRequired[Nullable[float]] + repetition_penalty: NotRequired[Nullable[float]] class DefaultParameters(BaseModel): @@ -27,12 +30,32 @@ class DefaultParameters(BaseModel): top_p: OptionalNullable[float] = UNSET + top_k: OptionalNullable[int] = UNSET + frequency_penalty: OptionalNullable[float] = UNSET + presence_penalty: OptionalNullable[float] = UNSET + + repetition_penalty: OptionalNullable[float] = UNSET + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["temperature", "top_p", "frequency_penalty"] - nullable_fields = ["temperature", "top_p", "frequency_penalty"] + optional_fields = [ + "temperature", + "top_p", + "top_k", + "frequency_penalty", + "presence_penalty", + "repetition_penalty", + ] + nullable_fields = [ + "temperature", + "top_p", + "top_k", + "frequency_penalty", + "presence_penalty", + "repetition_penalty", + ] null_default_fields = [] serialized = handler(self) diff --git a/src/openrouter/components/openairesponsesinput_union.py b/src/openrouter/components/openairesponsesinput_union.py index aab3daf..0e0b1fa 100644 --- a/src/openrouter/components/openairesponsesinput_union.py +++ b/src/openrouter/components/openairesponsesinput_union.py @@ -86,10 +86,41 @@ def serialize_model(self, handler): OpenAIResponsesInputTypeFunctionCallOutput = Literal["function_call_output",] +OpenAIResponsesInputOutput1TypedDict = TypeAliasType( + "OpenAIResponsesInputOutput1TypedDict", + Union[ + ResponseInputTextTypedDict, + ResponseInputImageTypedDict, + ResponseInputFileTypedDict, + ], +) + + +OpenAIResponsesInputOutput1 = Annotated[ + Union[ + Annotated[ResponseInputText, Tag("input_text")], + Annotated[ResponseInputImage, Tag("input_image")], + Annotated[ResponseInputFile, Tag("input_file")], + ], + Discriminator(lambda m: get_discriminator(m, "type", "type")), +] + + +OpenAIResponsesInputOutput2TypedDict = TypeAliasType( + "OpenAIResponsesInputOutput2TypedDict", + Union[str, List[OpenAIResponsesInputOutput1TypedDict]], +) + + +OpenAIResponsesInputOutput2 = TypeAliasType( + "OpenAIResponsesInputOutput2", Union[str, List[OpenAIResponsesInputOutput1]] +) + + class OpenAIResponsesInputFunctionCallOutputTypedDict(TypedDict): type: OpenAIResponsesInputTypeFunctionCallOutput call_id: str - output: str + output: OpenAIResponsesInputOutput2TypedDict id: NotRequired[Nullable[str]] status: NotRequired[Nullable[ToolCallStatus]] @@ -99,7 +130,7 @@ class OpenAIResponsesInputFunctionCallOutput(BaseModel): call_id: str - output: str + output: OpenAIResponsesInputOutput2 id: OptionalNullable[str] = UNSET @@ -279,10 +310,33 @@ class OpenAIResponsesInputMessage2(BaseModel): ) +OpenAIResponsesInputPhaseFinalAnswer = Literal["final_answer",] + + +OpenAIResponsesInputPhaseCommentary = Literal["commentary",] + + +OpenAIResponsesInputPhaseUnionTypedDict = TypeAliasType( + "OpenAIResponsesInputPhaseUnionTypedDict", + Union[ + OpenAIResponsesInputPhaseCommentary, OpenAIResponsesInputPhaseFinalAnswer, Any + ], +) + + +OpenAIResponsesInputPhaseUnion = TypeAliasType( + "OpenAIResponsesInputPhaseUnion", + Union[ + OpenAIResponsesInputPhaseCommentary, OpenAIResponsesInputPhaseFinalAnswer, Any + ], +) + + class OpenAIResponsesInputMessage1TypedDict(TypedDict): role: OpenAIResponsesInputRoleUnion1TypedDict content: OpenAIResponsesInputContent2TypedDict type: NotRequired[OpenAIResponsesInputTypeMessage1] + phase: NotRequired[Nullable[OpenAIResponsesInputPhaseUnionTypedDict]] class OpenAIResponsesInputMessage1(BaseModel): @@ -292,6 +346,38 @@ class OpenAIResponsesInputMessage1(BaseModel): type: Optional[OpenAIResponsesInputTypeMessage1] = None + phase: OptionalNullable[OpenAIResponsesInputPhaseUnion] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["type", "phase"] + nullable_fields = ["phase"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + OpenAIResponsesInputUnion1TypedDict = TypeAliasType( "OpenAIResponsesInputUnion1TypedDict", @@ -300,8 +386,8 @@ class OpenAIResponsesInputMessage1(BaseModel): OpenAIResponsesInputMessage2TypedDict, OutputItemImageGenerationCallTypedDict, OpenAIResponsesInputFunctionCallOutputTypedDict, - OutputMessageTypedDict, OpenAIResponsesInputFunctionCallTypedDict, + OutputMessageTypedDict, ], ) @@ -313,8 +399,8 @@ class OpenAIResponsesInputMessage1(BaseModel): OpenAIResponsesInputMessage2, OutputItemImageGenerationCall, OpenAIResponsesInputFunctionCallOutput, - OutputMessage, OpenAIResponsesInputFunctionCall, + OutputMessage, ], ) diff --git a/src/openrouter/components/openresponsesapplypatchtool.py b/src/openrouter/components/openresponsesapplypatchtool.py new file mode 100644 index 0000000..583e811 --- /dev/null +++ b/src/openrouter/components/openresponsesapplypatchtool.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +OpenResponsesApplyPatchToolType = Literal["apply_patch",] + + +class OpenResponsesApplyPatchToolTypedDict(TypedDict): + r"""Apply patch tool configuration""" + + type: OpenResponsesApplyPatchToolType + + +class OpenResponsesApplyPatchTool(BaseModel): + r"""Apply patch tool configuration""" + + type: OpenResponsesApplyPatchToolType diff --git a/src/openrouter/components/openresponsescodeinterpretertool.py b/src/openrouter/components/openresponsescodeinterpretertool.py new file mode 100644 index 0000000..9b2ae39 --- /dev/null +++ b/src/openrouter/components/openresponsescodeinterpretertool.py @@ -0,0 +1,102 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from openrouter.utils import validate_open_enum +from pydantic import model_serializer +from pydantic.functional_validators import PlainValidator +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +TypeCodeInterpreter = Literal["code_interpreter",] + + +ContainerType = Literal["auto",] + + +MemoryLimit = Union[ + Literal[ + "1g", + "4g", + "16g", + "64g", + ], + UnrecognizedStr, +] + + +class ContainerAutoTypedDict(TypedDict): + type: ContainerType + file_ids: NotRequired[List[str]] + memory_limit: NotRequired[Nullable[MemoryLimit]] + + +class ContainerAuto(BaseModel): + type: ContainerType + + file_ids: Optional[List[str]] = None + + memory_limit: Annotated[ + OptionalNullable[MemoryLimit], PlainValidator(validate_open_enum(False)) + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["file_ids", "memory_limit"] + nullable_fields = ["memory_limit"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +ContainerTypedDict = TypeAliasType( + "ContainerTypedDict", Union[ContainerAutoTypedDict, str] +) + + +Container = TypeAliasType("Container", Union[ContainerAuto, str]) + + +class OpenResponsesCodeInterpreterToolTypedDict(TypedDict): + r"""Code interpreter tool configuration""" + + type: TypeCodeInterpreter + container: ContainerTypedDict + + +class OpenResponsesCodeInterpreterTool(BaseModel): + r"""Code interpreter tool configuration""" + + type: TypeCodeInterpreter + + container: Container diff --git a/src/openrouter/components/openresponsescomputertool.py b/src/openrouter/components/openresponsescomputertool.py new file mode 100644 index 0000000..2d42678 --- /dev/null +++ b/src/openrouter/components/openresponsescomputertool.py @@ -0,0 +1,44 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UnrecognizedStr +from openrouter.utils import validate_open_enum +from pydantic.functional_validators import PlainValidator +from typing import Literal, Union +from typing_extensions import Annotated, TypedDict + + +OpenResponsesComputerToolType = Literal["computer_use_preview",] + + +Environment = Union[ + Literal[ + "windows", + "mac", + "linux", + "ubuntu", + "browser", + ], + UnrecognizedStr, +] + + +class OpenResponsesComputerToolTypedDict(TypedDict): + r"""Computer use preview tool configuration""" + + type: OpenResponsesComputerToolType + display_height: float + display_width: float + environment: Environment + + +class OpenResponsesComputerTool(BaseModel): + r"""Computer use preview tool configuration""" + + type: OpenResponsesComputerToolType + + display_height: float + + display_width: float + + environment: Annotated[Environment, PlainValidator(validate_open_enum(False))] diff --git a/src/openrouter/components/openresponsescustomtool.py b/src/openrouter/components/openresponsescustomtool.py new file mode 100644 index 0000000..51a788d --- /dev/null +++ b/src/openrouter/components/openresponsescustomtool.py @@ -0,0 +1,82 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UnrecognizedStr +from openrouter.utils import get_discriminator, validate_open_enum +import pydantic +from pydantic import Discriminator, Tag +from pydantic.functional_validators import PlainValidator +from typing import Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +TypeCustom = Literal["custom",] + + +FormatTypeGrammar = Literal["grammar",] + + +Syntax = Union[ + Literal[ + "lark", + "regex", + ], + UnrecognizedStr, +] + + +class FormatGrammarTypedDict(TypedDict): + type: FormatTypeGrammar + definition: str + syntax: Syntax + + +class FormatGrammar(BaseModel): + type: FormatTypeGrammar + + definition: str + + syntax: Annotated[Syntax, PlainValidator(validate_open_enum(False))] + + +FormatTypeText = Literal["text",] + + +class FormatTextTypedDict(TypedDict): + type: FormatTypeText + + +class FormatText(BaseModel): + type: FormatTypeText + + +FormatTypedDict = TypeAliasType( + "FormatTypedDict", Union[FormatTextTypedDict, FormatGrammarTypedDict] +) + + +Format = Annotated[ + Union[Annotated[FormatText, Tag("text")], Annotated[FormatGrammar, Tag("grammar")]], + Discriminator(lambda m: get_discriminator(m, "type", "type")), +] + + +class OpenResponsesCustomToolTypedDict(TypedDict): + r"""Custom tool configuration""" + + type: TypeCustom + name: str + description: NotRequired[str] + format_: NotRequired[FormatTypedDict] + + +class OpenResponsesCustomTool(BaseModel): + r"""Custom tool configuration""" + + type: TypeCustom + + name: str + + description: Optional[str] = None + + format_: Annotated[Optional[Format], pydantic.Field(alias="format")] = None diff --git a/src/openrouter/components/openresponseseasyinputmessage.py b/src/openrouter/components/openresponseseasyinputmessage.py index fa62a0c..67d2fbd 100644 --- a/src/openrouter/components/openresponseseasyinputmessage.py +++ b/src/openrouter/components/openresponseseasyinputmessage.py @@ -16,7 +16,7 @@ from openrouter.utils import get_discriminator, validate_open_enum from pydantic import Discriminator, Tag, model_serializer from pydantic.functional_validators import PlainValidator -from typing import List, Literal, Optional, Union +from typing import Any, List, Literal, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -146,25 +146,88 @@ def serialize_model(self, handler): OpenResponsesEasyInputMessageContentUnion2TypedDict = TypeAliasType( "OpenResponsesEasyInputMessageContentUnion2TypedDict", - Union[List[OpenResponsesEasyInputMessageContentUnion1TypedDict], str], + Union[List[OpenResponsesEasyInputMessageContentUnion1TypedDict], str, Any], ) OpenResponsesEasyInputMessageContentUnion2 = TypeAliasType( "OpenResponsesEasyInputMessageContentUnion2", - Union[List[OpenResponsesEasyInputMessageContentUnion1], str], + Union[List[OpenResponsesEasyInputMessageContentUnion1], str, Any], ) +OpenResponsesEasyInputMessagePhaseFinalAnswer = Literal["final_answer",] + + +OpenResponsesEasyInputMessagePhaseCommentary = Literal["commentary",] + + +OpenResponsesEasyInputMessagePhaseUnionTypedDict = TypeAliasType( + "OpenResponsesEasyInputMessagePhaseUnionTypedDict", + Union[ + OpenResponsesEasyInputMessagePhaseCommentary, + OpenResponsesEasyInputMessagePhaseFinalAnswer, + Any, + ], +) +r"""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.""" + + +OpenResponsesEasyInputMessagePhaseUnion = TypeAliasType( + "OpenResponsesEasyInputMessagePhaseUnion", + Union[ + OpenResponsesEasyInputMessagePhaseCommentary, + OpenResponsesEasyInputMessagePhaseFinalAnswer, + Any, + ], +) +r"""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.""" + + class OpenResponsesEasyInputMessageTypedDict(TypedDict): role: OpenResponsesEasyInputMessageRoleUnionTypedDict - content: OpenResponsesEasyInputMessageContentUnion2TypedDict type: NotRequired[OpenResponsesEasyInputMessageTypeMessage] + content: NotRequired[Nullable[OpenResponsesEasyInputMessageContentUnion2TypedDict]] + phase: NotRequired[Nullable[OpenResponsesEasyInputMessagePhaseUnionTypedDict]] + r"""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.""" class OpenResponsesEasyInputMessage(BaseModel): role: OpenResponsesEasyInputMessageRoleUnion - content: OpenResponsesEasyInputMessageContentUnion2 - type: Optional[OpenResponsesEasyInputMessageTypeMessage] = None + + content: OptionalNullable[OpenResponsesEasyInputMessageContentUnion2] = UNSET + + phase: OptionalNullable[OpenResponsesEasyInputMessagePhaseUnion] = UNSET + r"""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.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["type", "content", "phase"] + nullable_fields = ["content", "phase"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/openrouter/components/openresponsesfilesearchtool.py b/src/openrouter/components/openresponsesfilesearchtool.py new file mode 100644 index 0000000..1da6491 --- /dev/null +++ b/src/openrouter/components/openresponsesfilesearchtool.py @@ -0,0 +1,148 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .compoundfilter import CompoundFilter, CompoundFilterTypedDict +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from openrouter.utils import validate_open_enum +from pydantic import model_serializer +from pydantic.functional_validators import PlainValidator +from typing import Any, List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +TypeFileSearch = Literal["file_search",] + + +FiltersType = Union[ + Literal[ + "eq", + "ne", + "gt", + "gte", + "lt", + "lte", + ], + UnrecognizedStr, +] + + +Value1TypedDict = TypeAliasType("Value1TypedDict", Union[str, float]) + + +Value1 = TypeAliasType("Value1", Union[str, float]) + + +Value2TypedDict = TypeAliasType( + "Value2TypedDict", Union[str, float, bool, List[Value1TypedDict]] +) + + +Value2 = TypeAliasType("Value2", Union[str, float, bool, List[Value1]]) + + +class OpenResponsesFileSearchToolFiltersTypedDict(TypedDict): + key: str + type: FiltersType + value: Value2TypedDict + + +class OpenResponsesFileSearchToolFilters(BaseModel): + key: str + + type: Annotated[FiltersType, PlainValidator(validate_open_enum(False))] + + value: Value2 + + +FiltersTypedDict = TypeAliasType( + "FiltersTypedDict", + Union[CompoundFilterTypedDict, OpenResponsesFileSearchToolFiltersTypedDict, Any], +) + + +Filters = TypeAliasType( + "Filters", Union[CompoundFilter, OpenResponsesFileSearchToolFilters, Any] +) + + +Ranker = Union[ + Literal[ + "auto", + "default-2024-11-15", + ], + UnrecognizedStr, +] + + +class RankingOptionsTypedDict(TypedDict): + ranker: NotRequired[Ranker] + score_threshold: NotRequired[float] + + +class RankingOptions(BaseModel): + ranker: Annotated[Optional[Ranker], PlainValidator(validate_open_enum(False))] = ( + None + ) + + score_threshold: Optional[float] = None + + +class OpenResponsesFileSearchToolTypedDict(TypedDict): + r"""File search tool configuration""" + + type: TypeFileSearch + vector_store_ids: List[str] + filters: NotRequired[Nullable[FiltersTypedDict]] + max_num_results: NotRequired[int] + ranking_options: NotRequired[RankingOptionsTypedDict] + + +class OpenResponsesFileSearchTool(BaseModel): + r"""File search tool configuration""" + + type: TypeFileSearch + + vector_store_ids: List[str] + + filters: OptionalNullable[Filters] = UNSET + + max_num_results: Optional[int] = None + + ranking_options: Optional[RankingOptions] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["filters", "max_num_results", "ranking_options"] + nullable_fields = ["filters"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/openrouter/components/openresponsesfunctioncalloutput.py b/src/openrouter/components/openresponsesfunctioncalloutput.py index d033081..4d010c4 100644 --- a/src/openrouter/components/openresponsesfunctioncalloutput.py +++ b/src/openrouter/components/openresponsesfunctioncalloutput.py @@ -1,6 +1,8 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .responseinputfile import ResponseInputFile, ResponseInputFileTypedDict +from .responseinputtext import ResponseInputText, ResponseInputTextTypedDict from .toolcallstatus import ToolCallStatus from openrouter.types import ( BaseModel, @@ -8,23 +10,119 @@ OptionalNullable, UNSET, UNSET_SENTINEL, + UnrecognizedStr, ) -from openrouter.utils import validate_open_enum -from pydantic import model_serializer +from openrouter.utils import get_discriminator, validate_open_enum +from pydantic import Discriminator, Tag, model_serializer from pydantic.functional_validators import PlainValidator -from typing import Literal -from typing_extensions import Annotated, NotRequired, TypedDict +from typing import List, Literal, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict -OpenResponsesFunctionCallOutputType = Literal["function_call_output",] +OpenResponsesFunctionCallOutputTypeFunctionCallOutput = Literal["function_call_output",] + + +OutputType = Literal["input_image",] + + +OpenResponsesFunctionCallOutputDetail = Union[ + Literal[ + "auto", + "high", + "low", + ], + UnrecognizedStr, +] + + +class OutputInputImageTypedDict(TypedDict): + r"""Image input content item""" + + type: OutputType + detail: OpenResponsesFunctionCallOutputDetail + image_url: NotRequired[Nullable[str]] + + +class OutputInputImage(BaseModel): + r"""Image input content item""" + + type: OutputType + + detail: Annotated[ + OpenResponsesFunctionCallOutputDetail, PlainValidator(validate_open_enum(False)) + ] + + image_url: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["image_url"] + nullable_fields = ["image_url"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +OpenResponsesFunctionCallOutputOutputUnion1TypedDict = TypeAliasType( + "OpenResponsesFunctionCallOutputOutputUnion1TypedDict", + Union[ + ResponseInputTextTypedDict, + OutputInputImageTypedDict, + ResponseInputFileTypedDict, + ], +) + + +OpenResponsesFunctionCallOutputOutputUnion1 = Annotated[ + Union[ + Annotated[ResponseInputText, Tag("input_text")], + Annotated[OutputInputImage, Tag("input_image")], + Annotated[ResponseInputFile, Tag("input_file")], + ], + Discriminator(lambda m: get_discriminator(m, "type", "type")), +] + + +OpenResponsesFunctionCallOutputOutputUnion2TypedDict = TypeAliasType( + "OpenResponsesFunctionCallOutputOutputUnion2TypedDict", + Union[str, List[OpenResponsesFunctionCallOutputOutputUnion1TypedDict]], +) + + +OpenResponsesFunctionCallOutputOutputUnion2 = TypeAliasType( + "OpenResponsesFunctionCallOutputOutputUnion2", + Union[str, List[OpenResponsesFunctionCallOutputOutputUnion1]], +) class OpenResponsesFunctionCallOutputTypedDict(TypedDict): r"""The output from a function call execution""" - type: OpenResponsesFunctionCallOutputType + type: OpenResponsesFunctionCallOutputTypeFunctionCallOutput call_id: str - output: str + output: OpenResponsesFunctionCallOutputOutputUnion2TypedDict id: NotRequired[Nullable[str]] status: NotRequired[Nullable[ToolCallStatus]] @@ -32,11 +130,11 @@ class OpenResponsesFunctionCallOutputTypedDict(TypedDict): class OpenResponsesFunctionCallOutput(BaseModel): r"""The output from a function call execution""" - type: OpenResponsesFunctionCallOutputType + type: OpenResponsesFunctionCallOutputTypeFunctionCallOutput call_id: str - output: str + output: OpenResponsesFunctionCallOutputOutputUnion2 id: OptionalNullable[str] = UNSET diff --git a/src/openrouter/components/openresponsesfunctionshelltool.py b/src/openrouter/components/openresponsesfunctionshelltool.py new file mode 100644 index 0000000..518e551 --- /dev/null +++ b/src/openrouter/components/openresponsesfunctionshelltool.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +OpenResponsesFunctionShellToolType = Literal["shell",] + + +class OpenResponsesFunctionShellToolTypedDict(TypedDict): + r"""Shell tool configuration""" + + type: OpenResponsesFunctionShellToolType + + +class OpenResponsesFunctionShellTool(BaseModel): + r"""Shell tool configuration""" + + type: OpenResponsesFunctionShellToolType diff --git a/src/openrouter/components/openresponsesimagegenerationtool.py b/src/openrouter/components/openresponsesimagegenerationtool.py new file mode 100644 index 0000000..f2e695c --- /dev/null +++ b/src/openrouter/components/openresponsesimagegenerationtool.py @@ -0,0 +1,194 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from openrouter.utils import validate_open_enum +from pydantic import model_serializer +from pydantic.functional_validators import PlainValidator +from typing import Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +OpenResponsesImageGenerationToolType = Literal["image_generation",] + + +Background = Union[ + Literal[ + "transparent", + "opaque", + "auto", + ], + UnrecognizedStr, +] + + +InputFidelity = Union[ + Literal[ + "high", + "low", + ], + UnrecognizedStr, +] + + +class InputImageMaskTypedDict(TypedDict): + image_url: NotRequired[str] + file_id: NotRequired[str] + + +class InputImageMask(BaseModel): + image_url: Optional[str] = None + + file_id: Optional[str] = None + + +ModelEnum = Union[ + Literal[ + "gpt-image-1", + "gpt-image-1-mini", + ], + UnrecognizedStr, +] + + +Moderation = Union[ + Literal[ + "auto", + "low", + ], + UnrecognizedStr, +] + + +OutputFormat = Union[ + Literal[ + "png", + "webp", + "jpeg", + ], + UnrecognizedStr, +] + + +Quality = Union[ + Literal[ + "low", + "medium", + "high", + "auto", + ], + UnrecognizedStr, +] + + +Size = Union[ + Literal[ + "1024x1024", + "1024x1536", + "1536x1024", + "auto", + ], + UnrecognizedStr, +] + + +class OpenResponsesImageGenerationToolTypedDict(TypedDict): + r"""Image generation tool configuration""" + + type: OpenResponsesImageGenerationToolType + background: NotRequired[Background] + input_fidelity: NotRequired[Nullable[InputFidelity]] + input_image_mask: NotRequired[InputImageMaskTypedDict] + model: NotRequired[ModelEnum] + moderation: NotRequired[Moderation] + output_compression: NotRequired[float] + output_format: NotRequired[OutputFormat] + partial_images: NotRequired[float] + quality: NotRequired[Quality] + size: NotRequired[Size] + + +class OpenResponsesImageGenerationTool(BaseModel): + r"""Image generation tool configuration""" + + type: OpenResponsesImageGenerationToolType + + background: Annotated[ + Optional[Background], PlainValidator(validate_open_enum(False)) + ] = None + + input_fidelity: Annotated[ + OptionalNullable[InputFidelity], PlainValidator(validate_open_enum(False)) + ] = UNSET + + input_image_mask: Optional[InputImageMask] = None + + model: Annotated[Optional[ModelEnum], PlainValidator(validate_open_enum(False))] = ( + None + ) + + moderation: Annotated[ + Optional[Moderation], PlainValidator(validate_open_enum(False)) + ] = None + + output_compression: Optional[float] = None + + output_format: Annotated[ + Optional[OutputFormat], PlainValidator(validate_open_enum(False)) + ] = None + + partial_images: Optional[float] = None + + quality: Annotated[Optional[Quality], PlainValidator(validate_open_enum(False))] = ( + None + ) + + size: Annotated[Optional[Size], PlainValidator(validate_open_enum(False))] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "background", + "input_fidelity", + "input_image_mask", + "model", + "moderation", + "output_compression", + "output_format", + "partial_images", + "quality", + "size", + ] + nullable_fields = ["input_fidelity"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/openrouter/components/openresponsesinput.py b/src/openrouter/components/openresponsesinput.py deleted file mode 100644 index e40fe56..0000000 --- a/src/openrouter/components/openresponsesinput.py +++ /dev/null @@ -1,97 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .openresponseseasyinputmessage import ( - OpenResponsesEasyInputMessage, - OpenResponsesEasyInputMessageTypedDict, -) -from .openresponsesfunctioncalloutput import ( - OpenResponsesFunctionCallOutput, - OpenResponsesFunctionCallOutputTypedDict, -) -from .openresponsesfunctiontoolcall import ( - OpenResponsesFunctionToolCall, - OpenResponsesFunctionToolCallTypedDict, -) -from .openresponsesinputmessageitem import ( - OpenResponsesInputMessageItem, - OpenResponsesInputMessageItemTypedDict, -) -from .openresponsesreasoning import ( - OpenResponsesReasoning, - OpenResponsesReasoningTypedDict, -) -from .responsesimagegenerationcall import ( - ResponsesImageGenerationCall, - ResponsesImageGenerationCallTypedDict, -) -from .responsesoutputitemfilesearchcall import ( - ResponsesOutputItemFileSearchCall, - ResponsesOutputItemFileSearchCallTypedDict, -) -from .responsesoutputitemfunctioncall import ( - ResponsesOutputItemFunctionCall, - ResponsesOutputItemFunctionCallTypedDict, -) -from .responsesoutputitemreasoning import ( - ResponsesOutputItemReasoning, - ResponsesOutputItemReasoningTypedDict, -) -from .responsesoutputmessage import ( - ResponsesOutputMessage, - ResponsesOutputMessageTypedDict, -) -from .responseswebsearchcalloutput import ( - ResponsesWebSearchCallOutput, - ResponsesWebSearchCallOutputTypedDict, -) -from typing import List, Union -from typing_extensions import TypeAliasType - - -OpenResponsesInput1TypedDict = TypeAliasType( - "OpenResponsesInput1TypedDict", - Union[ - OpenResponsesEasyInputMessageTypedDict, - ResponsesWebSearchCallOutputTypedDict, - OpenResponsesInputMessageItemTypedDict, - ResponsesOutputItemFileSearchCallTypedDict, - ResponsesImageGenerationCallTypedDict, - OpenResponsesFunctionCallOutputTypedDict, - ResponsesOutputMessageTypedDict, - OpenResponsesFunctionToolCallTypedDict, - ResponsesOutputItemFunctionCallTypedDict, - OpenResponsesReasoningTypedDict, - ResponsesOutputItemReasoningTypedDict, - ], -) - - -OpenResponsesInput1 = TypeAliasType( - "OpenResponsesInput1", - Union[ - OpenResponsesEasyInputMessage, - ResponsesWebSearchCallOutput, - OpenResponsesInputMessageItem, - ResponsesOutputItemFileSearchCall, - ResponsesImageGenerationCall, - OpenResponsesFunctionCallOutput, - ResponsesOutputMessage, - OpenResponsesFunctionToolCall, - ResponsesOutputItemFunctionCall, - OpenResponsesReasoning, - ResponsesOutputItemReasoning, - ], -) - - -OpenResponsesInputTypedDict = TypeAliasType( - "OpenResponsesInputTypedDict", Union[str, List[OpenResponsesInput1TypedDict]] -) -r"""Input for a response request - can be a string or array of items""" - - -OpenResponsesInput = TypeAliasType( - "OpenResponsesInput", Union[str, List[OpenResponsesInput1]] -) -r"""Input for a response request - can be a string or array of items""" diff --git a/src/openrouter/components/openresponsesinput_union.py b/src/openrouter/components/openresponsesinput_union.py new file mode 100644 index 0000000..1473bc4 --- /dev/null +++ b/src/openrouter/components/openresponsesinput_union.py @@ -0,0 +1,386 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .openairesponsesrefusalcontent import ( + OpenAIResponsesRefusalContent, + OpenAIResponsesRefusalContentTypedDict, +) +from .openresponseseasyinputmessage import ( + OpenResponsesEasyInputMessage, + OpenResponsesEasyInputMessageTypedDict, +) +from .openresponsesfunctioncalloutput import ( + OpenResponsesFunctionCallOutput, + OpenResponsesFunctionCallOutputTypedDict, +) +from .openresponsesfunctiontoolcall import ( + OpenResponsesFunctionToolCall, + OpenResponsesFunctionToolCallTypedDict, +) +from .openresponsesinputmessageitem import ( + OpenResponsesInputMessageItem, + OpenResponsesInputMessageItemTypedDict, +) +from .openresponsesreasoning import ( + OpenResponsesReasoning, + OpenResponsesReasoningTypedDict, +) +from .reasoningsummarytext import ReasoningSummaryText, ReasoningSummaryTextTypedDict +from .reasoningtextcontent import ReasoningTextContent, ReasoningTextContentTypedDict +from .responseoutputtext import ResponseOutputText, ResponseOutputTextTypedDict +from .responsesimagegenerationcall import ( + ResponsesImageGenerationCall, + ResponsesImageGenerationCallTypedDict, +) +from .responsesoutputitemfilesearchcall import ( + ResponsesOutputItemFileSearchCall, + ResponsesOutputItemFileSearchCallTypedDict, +) +from .responsesoutputitemfunctioncall import ( + ResponsesOutputItemFunctionCall, + ResponsesOutputItemFunctionCallTypedDict, +) +from .responsesservertooloutput import ( + ResponsesServerToolOutput, + ResponsesServerToolOutputTypedDict, +) +from .responseswebsearchcalloutput import ( + ResponsesWebSearchCallOutput, + ResponsesWebSearchCallOutputTypedDict, +) +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from openrouter.utils import get_discriminator, validate_open_enum +import pydantic +from pydantic import Discriminator, Tag, model_serializer +from pydantic.functional_validators import PlainValidator +from typing import Any, List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +OpenResponsesInputTypeReasoning = Literal["reasoning",] + + +OpenResponsesInputStatusInProgress2 = Literal["in_progress",] + + +OpenResponsesInputStatusIncomplete2 = Literal["incomplete",] + + +OpenResponsesInputStatusCompleted2 = Literal["completed",] + + +OpenResponsesInputStatusUnion2TypedDict = TypeAliasType( + "OpenResponsesInputStatusUnion2TypedDict", + Union[ + OpenResponsesInputStatusCompleted2, + OpenResponsesInputStatusIncomplete2, + OpenResponsesInputStatusInProgress2, + ], +) + + +OpenResponsesInputStatusUnion2 = TypeAliasType( + "OpenResponsesInputStatusUnion2", + Union[ + OpenResponsesInputStatusCompleted2, + OpenResponsesInputStatusIncomplete2, + OpenResponsesInputStatusInProgress2, + ], +) + + +OpenResponsesInputFormat = Union[ + Literal[ + "unknown", + "openai-responses-v1", + "azure-openai-responses-v1", + "xai-responses-v1", + "anthropic-claude-v1", + "google-gemini-v1", + ], + UnrecognizedStr, +] +r"""The format of the reasoning content""" + + +class OpenResponsesInputReasoningTypedDict(TypedDict): + r"""An output item containing reasoning""" + + type: OpenResponsesInputTypeReasoning + id: str + summary: Nullable[List[ReasoningSummaryTextTypedDict]] + content: NotRequired[Nullable[List[ReasoningTextContentTypedDict]]] + encrypted_content: NotRequired[Nullable[str]] + status: NotRequired[OpenResponsesInputStatusUnion2TypedDict] + signature: NotRequired[Nullable[str]] + r"""A signature for the reasoning content, used for verification""" + format_: NotRequired[Nullable[OpenResponsesInputFormat]] + r"""The format of the reasoning content""" + + +class OpenResponsesInputReasoning(BaseModel): + r"""An output item containing reasoning""" + + type: OpenResponsesInputTypeReasoning + + id: str + + summary: Nullable[List[ReasoningSummaryText]] + + content: OptionalNullable[List[ReasoningTextContent]] = UNSET + + encrypted_content: OptionalNullable[str] = UNSET + + status: Optional[OpenResponsesInputStatusUnion2] = None + + signature: OptionalNullable[str] = UNSET + r"""A signature for the reasoning content, used for verification""" + + format_: Annotated[ + Annotated[ + OptionalNullable[OpenResponsesInputFormat], + PlainValidator(validate_open_enum(False)), + ], + pydantic.Field(alias="format"), + ] = UNSET + r"""The format of the reasoning content""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "content", + "encrypted_content", + "status", + "signature", + "format", + ] + nullable_fields = [ + "content", + "summary", + "encrypted_content", + "signature", + "format", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +OpenResponsesInputRole = Literal["assistant",] + + +OpenResponsesInputTypeMessage = Literal["message",] + + +OpenResponsesInputStatusInProgress1 = Literal["in_progress",] + + +OpenResponsesInputStatusIncomplete1 = Literal["incomplete",] + + +OpenResponsesInputStatusCompleted1 = Literal["completed",] + + +OpenResponsesInputStatusUnion1TypedDict = TypeAliasType( + "OpenResponsesInputStatusUnion1TypedDict", + Union[ + OpenResponsesInputStatusCompleted1, + OpenResponsesInputStatusIncomplete1, + OpenResponsesInputStatusInProgress1, + ], +) + + +OpenResponsesInputStatusUnion1 = TypeAliasType( + "OpenResponsesInputStatusUnion1", + Union[ + OpenResponsesInputStatusCompleted1, + OpenResponsesInputStatusIncomplete1, + OpenResponsesInputStatusInProgress1, + ], +) + + +OpenResponsesInputContent1TypedDict = TypeAliasType( + "OpenResponsesInputContent1TypedDict", + Union[OpenAIResponsesRefusalContentTypedDict, ResponseOutputTextTypedDict], +) + + +OpenResponsesInputContent1 = Annotated[ + Union[ + Annotated[ResponseOutputText, Tag("output_text")], + Annotated[OpenAIResponsesRefusalContent, Tag("refusal")], + ], + Discriminator(lambda m: get_discriminator(m, "type", "type")), +] + + +OpenResponsesInputContent2TypedDict = TypeAliasType( + "OpenResponsesInputContent2TypedDict", + Union[List[OpenResponsesInputContent1TypedDict], str, Any], +) + + +OpenResponsesInputContent2 = TypeAliasType( + "OpenResponsesInputContent2", Union[List[OpenResponsesInputContent1], str, Any] +) + + +OpenResponsesInputPhaseFinalAnswer = Literal["final_answer",] + + +OpenResponsesInputPhaseCommentary = Literal["commentary",] + + +OpenResponsesInputPhaseUnionTypedDict = TypeAliasType( + "OpenResponsesInputPhaseUnionTypedDict", + Union[OpenResponsesInputPhaseCommentary, OpenResponsesInputPhaseFinalAnswer, Any], +) +r"""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.""" + + +OpenResponsesInputPhaseUnion = TypeAliasType( + "OpenResponsesInputPhaseUnion", + Union[OpenResponsesInputPhaseCommentary, OpenResponsesInputPhaseFinalAnswer, Any], +) +r"""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.""" + + +class OpenResponsesInputMessageTypedDict(TypedDict): + r"""An output message item""" + + id: str + role: OpenResponsesInputRole + type: OpenResponsesInputTypeMessage + content: Nullable[OpenResponsesInputContent2TypedDict] + status: NotRequired[OpenResponsesInputStatusUnion1TypedDict] + phase: NotRequired[Nullable[OpenResponsesInputPhaseUnionTypedDict]] + r"""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.""" + + +class OpenResponsesInputMessage(BaseModel): + r"""An output message item""" + + id: str + + role: OpenResponsesInputRole + + type: OpenResponsesInputTypeMessage + + content: Nullable[OpenResponsesInputContent2] + + status: Optional[OpenResponsesInputStatusUnion1] = None + + phase: OptionalNullable[OpenResponsesInputPhaseUnion] = UNSET + r"""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.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["status", "phase"] + nullable_fields = ["content", "phase"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +OpenResponsesInputUnion1TypedDict = TypeAliasType( + "OpenResponsesInputUnion1TypedDict", + Union[ + OpenResponsesEasyInputMessageTypedDict, + OpenResponsesInputMessageItemTypedDict, + ResponsesWebSearchCallOutputTypedDict, + ResponsesOutputItemFileSearchCallTypedDict, + ResponsesImageGenerationCallTypedDict, + ResponsesServerToolOutputTypedDict, + OpenResponsesFunctionCallOutputTypedDict, + OpenResponsesFunctionToolCallTypedDict, + OpenResponsesInputMessageTypedDict, + ResponsesOutputItemFunctionCallTypedDict, + OpenResponsesReasoningTypedDict, + OpenResponsesInputReasoningTypedDict, + ], +) + + +OpenResponsesInputUnion1 = TypeAliasType( + "OpenResponsesInputUnion1", + Union[ + OpenResponsesEasyInputMessage, + OpenResponsesInputMessageItem, + ResponsesWebSearchCallOutput, + ResponsesOutputItemFileSearchCall, + ResponsesImageGenerationCall, + ResponsesServerToolOutput, + OpenResponsesFunctionCallOutput, + OpenResponsesFunctionToolCall, + OpenResponsesInputMessage, + ResponsesOutputItemFunctionCall, + OpenResponsesReasoning, + OpenResponsesInputReasoning, + ], +) + + +OpenResponsesInputUnionTypedDict = TypeAliasType( + "OpenResponsesInputUnionTypedDict", + Union[str, List[OpenResponsesInputUnion1TypedDict]], +) +r"""Input for a response request - can be a string or array of items""" + + +OpenResponsesInputUnion = TypeAliasType( + "OpenResponsesInputUnion", Union[str, List[OpenResponsesInputUnion1]] +) +r"""Input for a response request - can be a string or array of items""" diff --git a/src/openrouter/components/openresponsesinputmessageitem.py b/src/openrouter/components/openresponsesinputmessageitem.py index 4b4a234..0ef39f6 100644 --- a/src/openrouter/components/openresponsesinputmessageitem.py +++ b/src/openrouter/components/openresponsesinputmessageitem.py @@ -141,16 +141,48 @@ def serialize_model(self, handler): class OpenResponsesInputMessageItemTypedDict(TypedDict): role: OpenResponsesInputMessageItemRoleUnionTypedDict - content: List[OpenResponsesInputMessageItemContentUnionTypedDict] id: NotRequired[str] type: NotRequired[OpenResponsesInputMessageItemTypeMessage] + content: NotRequired[ + Nullable[List[OpenResponsesInputMessageItemContentUnionTypedDict]] + ] class OpenResponsesInputMessageItem(BaseModel): role: OpenResponsesInputMessageItemRoleUnion - content: List[OpenResponsesInputMessageItemContentUnion] - id: Optional[str] = None type: Optional[OpenResponsesInputMessageItemTypeMessage] = None + + content: OptionalNullable[List[OpenResponsesInputMessageItemContentUnion]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["id", "type", "content"] + nullable_fields = ["content"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/openrouter/components/openresponseslocalshelltool.py b/src/openrouter/components/openresponseslocalshelltool.py new file mode 100644 index 0000000..50b0013 --- /dev/null +++ b/src/openrouter/components/openresponseslocalshelltool.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +OpenResponsesLocalShellToolType = Literal["local_shell",] + + +class OpenResponsesLocalShellToolTypedDict(TypedDict): + r"""Local shell tool configuration""" + + type: OpenResponsesLocalShellToolType + + +class OpenResponsesLocalShellTool(BaseModel): + r"""Local shell tool configuration""" + + type: OpenResponsesLocalShellToolType diff --git a/src/openrouter/components/openresponseslogprobs.py b/src/openrouter/components/openresponseslogprobs.py deleted file mode 100644 index 78b6a1c..0000000 --- a/src/openrouter/components/openresponseslogprobs.py +++ /dev/null @@ -1,28 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .openresponsestoplogprobs import ( - OpenResponsesTopLogprobs, - OpenResponsesTopLogprobsTypedDict, -) -from openrouter.types import BaseModel -from typing import List, Optional -from typing_extensions import NotRequired, TypedDict - - -class OpenResponsesLogProbsTypedDict(TypedDict): - r"""Log probability information for a token""" - - logprob: float - token: str - top_logprobs: NotRequired[List[OpenResponsesTopLogprobsTypedDict]] - - -class OpenResponsesLogProbs(BaseModel): - r"""Log probability information for a token""" - - logprob: float - - token: str - - top_logprobs: Optional[List[OpenResponsesTopLogprobs]] = None diff --git a/src/openrouter/components/openresponsesmcptool.py b/src/openrouter/components/openresponsesmcptool.py new file mode 100644 index 0000000..5f15a1c --- /dev/null +++ b/src/openrouter/components/openresponsesmcptool.py @@ -0,0 +1,154 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from openrouter.utils import validate_open_enum +from pydantic import model_serializer +from pydantic.functional_validators import PlainValidator +from typing import Any, Dict, List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +OpenResponsesMcpToolType = Literal["mcp",] + + +class AllowedToolsTypedDict(TypedDict): + tool_names: NotRequired[List[str]] + read_only: NotRequired[bool] + + +class AllowedTools(BaseModel): + tool_names: Optional[List[str]] = None + + read_only: Optional[bool] = None + + +ConnectorID = Union[ + Literal[ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint", + ], + UnrecognizedStr, +] + + +RequireApprovalNever = Literal["never",] + + +RequireApprovalAlways = Literal["always",] + + +class NeverTypedDict(TypedDict): + tool_names: NotRequired[List[str]] + + +class Never(BaseModel): + tool_names: Optional[List[str]] = None + + +class AlwaysTypedDict(TypedDict): + tool_names: NotRequired[List[str]] + + +class Always(BaseModel): + tool_names: Optional[List[str]] = None + + +class RequireApprovalTypedDict(TypedDict): + never: NotRequired[NeverTypedDict] + always: NotRequired[AlwaysTypedDict] + + +class RequireApproval(BaseModel): + never: Optional[Never] = None + + always: Optional[Always] = None + + +class OpenResponsesMcpToolTypedDict(TypedDict): + r"""MCP (Model Context Protocol) tool configuration""" + + type: OpenResponsesMcpToolType + server_label: str + allowed_tools: NotRequired[Nullable[Any]] + authorization: NotRequired[str] + connector_id: NotRequired[ConnectorID] + headers: NotRequired[Nullable[Dict[str, str]]] + require_approval: NotRequired[Nullable[Any]] + server_description: NotRequired[str] + server_url: NotRequired[str] + + +class OpenResponsesMcpTool(BaseModel): + r"""MCP (Model Context Protocol) tool configuration""" + + type: OpenResponsesMcpToolType + + server_label: str + + allowed_tools: OptionalNullable[Any] = UNSET + + authorization: Optional[str] = None + + connector_id: Annotated[ + Optional[ConnectorID], PlainValidator(validate_open_enum(False)) + ] = None + + headers: OptionalNullable[Dict[str, str]] = UNSET + + require_approval: OptionalNullable[Any] = UNSET + + server_description: Optional[str] = None + + server_url: Optional[str] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "allowed_tools", + "authorization", + "connector_id", + "headers", + "require_approval", + "server_description", + "server_url", + ] + nullable_fields = ["allowed_tools", "headers", "require_approval"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/openrouter/components/openresponsesnonstreamingresponse.py b/src/openrouter/components/openresponsesnonstreamingresponse.py index 5bacc19..6740614 100644 --- a/src/openrouter/components/openresponsesnonstreamingresponse.py +++ b/src/openrouter/components/openresponsesnonstreamingresponse.py @@ -21,6 +21,39 @@ OpenAIResponsesToolChoiceUnionTypedDict, ) from .openairesponsestruncation import OpenAIResponsesTruncation +from .openresponsesapplypatchtool import ( + OpenResponsesApplyPatchTool, + OpenResponsesApplyPatchToolTypedDict, +) +from .openresponsescodeinterpretertool import ( + OpenResponsesCodeInterpreterTool, + OpenResponsesCodeInterpreterToolTypedDict, +) +from .openresponsescomputertool import ( + OpenResponsesComputerTool, + OpenResponsesComputerToolTypedDict, +) +from .openresponsescustomtool import ( + OpenResponsesCustomTool, + OpenResponsesCustomToolTypedDict, +) +from .openresponsesfilesearchtool import ( + OpenResponsesFileSearchTool, + OpenResponsesFileSearchToolTypedDict, +) +from .openresponsesfunctionshelltool import ( + OpenResponsesFunctionShellTool, + OpenResponsesFunctionShellToolTypedDict, +) +from .openresponsesimagegenerationtool import ( + OpenResponsesImageGenerationTool, + OpenResponsesImageGenerationToolTypedDict, +) +from .openresponseslocalshelltool import ( + OpenResponsesLocalShellTool, + OpenResponsesLocalShellToolTypedDict, +) +from .openresponsesmcptool import OpenResponsesMcpTool, OpenResponsesMcpToolTypedDict from .openresponsesusage import OpenResponsesUsage, OpenResponsesUsageTypedDict from .openresponseswebsearch20250826tool import ( OpenResponsesWebSearch20250826Tool, @@ -118,11 +151,20 @@ def serialize_model(self, handler): OpenResponsesNonStreamingResponseToolUnionTypedDict = TypeAliasType( "OpenResponsesNonStreamingResponseToolUnionTypedDict", Union[ - OpenResponsesWebSearchPreviewToolTypedDict, - OpenResponsesWebSearchPreview20250311ToolTypedDict, + OpenResponsesLocalShellToolTypedDict, + OpenResponsesApplyPatchToolTypedDict, + OpenResponsesFunctionShellToolTypedDict, + OpenResponsesCodeInterpreterToolTypedDict, + OpenResponsesCustomToolTypedDict, + OpenResponsesComputerToolTypedDict, + OpenResponsesNonStreamingResponseToolFunctionTypedDict, + OpenResponsesFileSearchToolTypedDict, OpenResponsesWebSearchToolTypedDict, OpenResponsesWebSearch20250826ToolTypedDict, - OpenResponsesNonStreamingResponseToolFunctionTypedDict, + OpenResponsesWebSearchPreview20250311ToolTypedDict, + OpenResponsesWebSearchPreviewToolTypedDict, + OpenResponsesMcpToolTypedDict, + OpenResponsesImageGenerationToolTypedDict, ], ) @@ -137,6 +179,15 @@ def serialize_model(self, handler): ], Annotated[OpenResponsesWebSearchTool, Tag("web_search")], Annotated[OpenResponsesWebSearch20250826Tool, Tag("web_search_2025_08_26")], + Annotated[OpenResponsesFileSearchTool, Tag("file_search")], + Annotated[OpenResponsesComputerTool, Tag("computer_use_preview")], + Annotated[OpenResponsesCodeInterpreterTool, Tag("code_interpreter")], + Annotated[OpenResponsesMcpTool, Tag("mcp")], + Annotated[OpenResponsesImageGenerationTool, Tag("image_generation")], + Annotated[OpenResponsesLocalShellTool, Tag("local_shell")], + Annotated[OpenResponsesFunctionShellTool, Tag("shell")], + Annotated[OpenResponsesApplyPatchTool, Tag("apply_patch")], + Annotated[OpenResponsesCustomTool, Tag("custom")], ], Discriminator(lambda m: get_discriminator(m, "type", "type")), ] diff --git a/src/openrouter/components/openresponsesrequest.py b/src/openrouter/components/openresponsesrequest.py index 35e6daf..95243a4 100644 --- a/src/openrouter/components/openresponsesrequest.py +++ b/src/openrouter/components/openresponsesrequest.py @@ -1,14 +1,52 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .contextcompressionengine import ContextCompressionEngine from .datacollection import DataCollection +from .datetimeservertool import DatetimeServerTool, DatetimeServerToolTypedDict from .openairesponsesincludable import OpenAIResponsesIncludable from .openairesponsesprompt import OpenAIResponsesPrompt, OpenAIResponsesPromptTypedDict from .openairesponsestoolchoice_union import ( OpenAIResponsesToolChoiceUnion, OpenAIResponsesToolChoiceUnionTypedDict, ) -from .openresponsesinput import OpenResponsesInput, OpenResponsesInputTypedDict +from .openresponsesapplypatchtool import ( + OpenResponsesApplyPatchTool, + OpenResponsesApplyPatchToolTypedDict, +) +from .openresponsescodeinterpretertool import ( + OpenResponsesCodeInterpreterTool, + OpenResponsesCodeInterpreterToolTypedDict, +) +from .openresponsescomputertool import ( + OpenResponsesComputerTool, + OpenResponsesComputerToolTypedDict, +) +from .openresponsescustomtool import ( + OpenResponsesCustomTool, + OpenResponsesCustomToolTypedDict, +) +from .openresponsesfilesearchtool import ( + OpenResponsesFileSearchTool, + OpenResponsesFileSearchToolTypedDict, +) +from .openresponsesfunctionshelltool import ( + OpenResponsesFunctionShellTool, + OpenResponsesFunctionShellToolTypedDict, +) +from .openresponsesimagegenerationtool import ( + OpenResponsesImageGenerationTool, + OpenResponsesImageGenerationToolTypedDict, +) +from .openresponsesinput_union import ( + OpenResponsesInputUnion, + OpenResponsesInputUnionTypedDict, +) +from .openresponseslocalshelltool import ( + OpenResponsesLocalShellTool, + OpenResponsesLocalShellToolTypedDict, +) +from .openresponsesmcptool import OpenResponsesMcpTool, OpenResponsesMcpToolTypedDict from .openresponsesreasoningconfig import ( OpenResponsesReasoningConfig, OpenResponsesReasoningConfigTypedDict, @@ -44,6 +82,10 @@ from .providersortconfig import ProviderSortConfig, ProviderSortConfigTypedDict from .quantization import Quantization from .responsesoutputmodality import ResponsesOutputModality +from .responseswebsearchservertool import ( + ResponsesWebSearchServerTool, + ResponsesWebSearchServerToolTypedDict, +) from .websearchengine import WebSearchEngine from openrouter.types import ( BaseModel, @@ -121,11 +163,22 @@ def serialize_model(self, handler): OpenResponsesRequestToolUnionTypedDict = TypeAliasType( "OpenResponsesRequestToolUnionTypedDict", Union[ - OpenResponsesWebSearchPreviewToolTypedDict, - OpenResponsesWebSearchPreview20250311ToolTypedDict, - OpenResponsesWebSearchToolTypedDict, - OpenResponsesWebSearch20250826ToolTypedDict, + OpenResponsesLocalShellToolTypedDict, + OpenResponsesApplyPatchToolTypedDict, + OpenResponsesFunctionShellToolTypedDict, + ResponsesWebSearchServerToolTypedDict, + DatetimeServerToolTypedDict, + OpenResponsesCodeInterpreterToolTypedDict, + OpenResponsesCustomToolTypedDict, + OpenResponsesComputerToolTypedDict, OpenResponsesRequestToolFunctionTypedDict, + OpenResponsesFileSearchToolTypedDict, + OpenResponsesWebSearch20250826ToolTypedDict, + OpenResponsesWebSearchToolTypedDict, + OpenResponsesWebSearchPreview20250311ToolTypedDict, + OpenResponsesWebSearchPreviewToolTypedDict, + OpenResponsesMcpToolTypedDict, + OpenResponsesImageGenerationToolTypedDict, ], ) @@ -140,6 +193,17 @@ def serialize_model(self, handler): ], Annotated[OpenResponsesWebSearchTool, Tag("web_search")], Annotated[OpenResponsesWebSearch20250826Tool, Tag("web_search_2025_08_26")], + Annotated[OpenResponsesFileSearchTool, Tag("file_search")], + Annotated[OpenResponsesComputerTool, Tag("computer_use_preview")], + Annotated[OpenResponsesCodeInterpreterTool, Tag("code_interpreter")], + Annotated[OpenResponsesMcpTool, Tag("mcp")], + Annotated[OpenResponsesImageGenerationTool, Tag("image_generation")], + Annotated[OpenResponsesLocalShellTool, Tag("local_shell")], + Annotated[OpenResponsesFunctionShellTool, Tag("shell")], + Annotated[OpenResponsesApplyPatchTool, Tag("apply_patch")], + Annotated[OpenResponsesCustomTool, Tag("custom")], + Annotated[DatetimeServerTool, Tag("openrouter:datetime")], + Annotated[ResponsesWebSearchServerTool, Tag("openrouter:web_search")], ], Discriminator(lambda m: get_discriminator(m, "type", "type")), ] @@ -395,6 +459,27 @@ def serialize_model(self, handler): return m +OpenResponsesRequestIDContextCompression = Literal["context-compression",] + + +class OpenResponsesRequestPluginContextCompressionTypedDict(TypedDict): + id: OpenResponsesRequestIDContextCompression + enabled: NotRequired[bool] + r"""Set to false to disable the context-compression plugin for this request. Defaults to true.""" + engine: NotRequired[ContextCompressionEngine] + r"""The compression engine to use. Defaults to \"middle-out\".""" + + +class OpenResponsesRequestPluginContextCompression(BaseModel): + id: OpenResponsesRequestIDContextCompression + + enabled: Optional[bool] = None + r"""Set to false to disable the context-compression plugin for this request. Defaults to true.""" + + engine: Optional[ContextCompressionEngine] = None + r"""The compression engine to use. Defaults to \"middle-out\".""" + + OpenResponsesRequestIDResponseHealing = Literal["response-healing",] @@ -443,6 +528,10 @@ class OpenResponsesRequestPluginWebTypedDict(TypedDict): search_prompt: NotRequired[str] engine: NotRequired[WebSearchEngine] r"""The search engine to use for web search.""" + include_domains: NotRequired[List[str]] + r"""A list of domains to restrict web search results to. Supports wildcards (e.g. \"*.substack.com\") and path filtering (e.g. \"openai.com/blog\").""" + exclude_domains: NotRequired[List[str]] + r"""A list of domains to exclude from web search results. Supports wildcards (e.g. \"*.substack.com\") and path filtering (e.g. \"openai.com/blog\").""" class OpenResponsesRequestPluginWeb(BaseModel): @@ -460,6 +549,12 @@ class OpenResponsesRequestPluginWeb(BaseModel): ] = None r"""The search engine to use for web search.""" + include_domains: Optional[List[str]] = None + r"""A list of domains to restrict web search results to. Supports wildcards (e.g. \"*.substack.com\") and path filtering (e.g. \"openai.com/blog\").""" + + exclude_domains: Optional[List[str]] = None + r"""A list of domains to exclude from web search results. Supports wildcards (e.g. \"*.substack.com\") and path filtering (e.g. \"openai.com/blog\").""" + OpenResponsesRequestIDModeration = Literal["moderation",] @@ -500,6 +595,7 @@ class OpenResponsesRequestPluginAutoRouter(BaseModel): OpenResponsesRequestPluginResponseHealingTypedDict, OpenResponsesRequestPluginAutoRouterTypedDict, OpenResponsesRequestPluginFileParserTypedDict, + OpenResponsesRequestPluginContextCompressionTypedDict, OpenResponsesRequestPluginWebTypedDict, ], ) @@ -512,6 +608,9 @@ class OpenResponsesRequestPluginAutoRouter(BaseModel): Annotated[OpenResponsesRequestPluginWeb, Tag("web")], Annotated[OpenResponsesRequestPluginFileParser, Tag("file-parser")], Annotated[OpenResponsesRequestPluginResponseHealing, Tag("response-healing")], + Annotated[ + OpenResponsesRequestPluginContextCompression, Tag("context-compression") + ], ], Discriminator(lambda m: get_discriminator(m, "id", "id")), ] @@ -557,7 +656,7 @@ def additional_properties(self, value): class OpenResponsesRequestTypedDict(TypedDict): r"""Request schema for Responses endpoint""" - input: NotRequired[OpenResponsesInputTypedDict] + input: NotRequired[OpenResponsesInputUnionTypedDict] r"""Input for a response request - can be a string or array of items""" instructions: NotRequired[Nullable[str]] metadata: NotRequired[Nullable[Dict[str, str]]] @@ -608,7 +707,7 @@ class OpenResponsesRequestTypedDict(TypedDict): class OpenResponsesRequest(BaseModel): r"""Request schema for Responses endpoint""" - input: Optional[OpenResponsesInput] = None + input: Optional[OpenResponsesInputUnion] = None r"""Input for a response request - can be a string or array of items""" instructions: OptionalNullable[str] = UNSET diff --git a/src/openrouter/components/openresponsesstreamevent.py b/src/openrouter/components/openresponsesstreamevent.py index 8b21548..050ed98 100644 --- a/src/openrouter/components/openresponsesstreamevent.py +++ b/src/openrouter/components/openresponsesstreamevent.py @@ -29,7 +29,6 @@ OpenResponsesImageGenCallPartialImage, OpenResponsesImageGenCallPartialImageTypedDict, ) -from .openresponseslogprobs import OpenResponsesLogProbs, OpenResponsesLogProbsTypedDict from .openresponsesnonstreamingresponse import ( OpenResponsesNonStreamingResponse, OpenResponsesNonStreamingResponseTypedDict, @@ -54,15 +53,28 @@ OpenResponsesReasoningSummaryTextDoneEvent, OpenResponsesReasoningSummaryTextDoneEventTypedDict, ) +from .openresponseswebsearchcallcompleted import ( + OpenResponsesWebSearchCallCompleted, + OpenResponsesWebSearchCallCompletedTypedDict, +) +from .openresponseswebsearchcallinprogress import ( + OpenResponsesWebSearchCallInProgress, + OpenResponsesWebSearchCallInProgressTypedDict, +) +from .openresponseswebsearchcallsearching import ( + OpenResponsesWebSearchCallSearching, + OpenResponsesWebSearchCallSearchingTypedDict, +) from .reasoningsummarytext import ReasoningSummaryText, ReasoningSummaryTextTypedDict from .reasoningtextcontent import ReasoningTextContent, ReasoningTextContentTypedDict from .responseoutputtext import ResponseOutputText, ResponseOutputTextTypedDict from .responsesoutputitem import ResponsesOutputItem, ResponsesOutputItemTypedDict from openrouter.types import BaseModel from openrouter.utils import get_discriminator +import pydantic from pydantic import Discriminator, Tag -from typing import List, Literal, Union -from typing_extensions import Annotated, TypeAliasType, TypedDict +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict TypeResponseReasoningSummaryPartDone = Literal["response.reasoning_summary_part.done",] @@ -254,6 +266,45 @@ class OpenResponsesStreamEventResponseRefusalDelta(BaseModel): TypeResponseOutputTextDone = Literal["response.output_text.done",] +class OpenResponsesStreamEventTopLogprob2TypedDict(TypedDict): + r"""Alternative token with its log probability""" + + token: NotRequired[str] + logprob: NotRequired[float] + bytes_: NotRequired[List[float]] + + +class OpenResponsesStreamEventTopLogprob2(BaseModel): + r"""Alternative token with its log probability""" + + token: Optional[str] = None + + logprob: Optional[float] = None + + bytes_: Annotated[Optional[List[float]], pydantic.Field(alias="bytes")] = None + + +class OpenResponsesStreamEventLogprob2TypedDict(TypedDict): + r"""Log probability information for a token""" + + logprob: float + token: str + top_logprobs: NotRequired[List[OpenResponsesStreamEventTopLogprob2TypedDict]] + bytes_: NotRequired[List[float]] + + +class OpenResponsesStreamEventLogprob2(BaseModel): + r"""Log probability information for a token""" + + logprob: float + + token: str + + top_logprobs: Optional[List[OpenResponsesStreamEventTopLogprob2]] = None + + bytes_: Annotated[Optional[List[float]], pydantic.Field(alias="bytes")] = None + + class OpenResponsesStreamEventResponseOutputTextDoneTypedDict(TypedDict): r"""Event emitted when text streaming is complete""" @@ -263,7 +314,7 @@ class OpenResponsesStreamEventResponseOutputTextDoneTypedDict(TypedDict): content_index: float text: str sequence_number: float - logprobs: List[OpenResponsesLogProbsTypedDict] + logprobs: List[OpenResponsesStreamEventLogprob2TypedDict] class OpenResponsesStreamEventResponseOutputTextDone(BaseModel): @@ -281,17 +332,56 @@ class OpenResponsesStreamEventResponseOutputTextDone(BaseModel): sequence_number: float - logprobs: List[OpenResponsesLogProbs] + logprobs: List[OpenResponsesStreamEventLogprob2] TypeResponseOutputTextDelta = Literal["response.output_text.delta",] +class OpenResponsesStreamEventTopLogprob1TypedDict(TypedDict): + r"""Alternative token with its log probability""" + + token: NotRequired[str] + logprob: NotRequired[float] + bytes_: NotRequired[List[float]] + + +class OpenResponsesStreamEventTopLogprob1(BaseModel): + r"""Alternative token with its log probability""" + + token: Optional[str] = None + + logprob: Optional[float] = None + + bytes_: Annotated[Optional[List[float]], pydantic.Field(alias="bytes")] = None + + +class OpenResponsesStreamEventLogprob1TypedDict(TypedDict): + r"""Log probability information for a token""" + + logprob: float + token: str + top_logprobs: NotRequired[List[OpenResponsesStreamEventTopLogprob1TypedDict]] + bytes_: NotRequired[List[float]] + + +class OpenResponsesStreamEventLogprob1(BaseModel): + r"""Log probability information for a token""" + + logprob: float + + token: str + + top_logprobs: Optional[List[OpenResponsesStreamEventTopLogprob1]] = None + + bytes_: Annotated[Optional[List[float]], pydantic.Field(alias="bytes")] = None + + class OpenResponsesStreamEventResponseOutputTextDeltaTypedDict(TypedDict): r"""Event emitted when a text delta is streamed""" type: TypeResponseOutputTextDelta - logprobs: List[OpenResponsesLogProbsTypedDict] + logprobs: List[OpenResponsesStreamEventLogprob1TypedDict] output_index: float item_id: str content_index: float @@ -304,7 +394,7 @@ class OpenResponsesStreamEventResponseOutputTextDelta(BaseModel): type: TypeResponseOutputTextDelta - logprobs: List[OpenResponsesLogProbs] + logprobs: List[OpenResponsesStreamEventLogprob1] output_index: float @@ -594,22 +684,25 @@ class OpenResponsesStreamEventResponseCreated(BaseModel): OpenResponsesStreamEventResponseFailedTypedDict, OpenResponsesStreamEventResponseOutputItemAddedTypedDict, OpenResponsesStreamEventResponseOutputItemDoneTypedDict, + OpenResponsesWebSearchCallCompletedTypedDict, + OpenResponsesWebSearchCallSearchingTypedDict, + OpenResponsesWebSearchCallInProgressTypedDict, OpenResponsesImageGenCallCompletedTypedDict, OpenResponsesImageGenCallGeneratingTypedDict, OpenResponsesImageGenCallInProgressTypedDict, - OpenResponsesErrorEventTypedDict, OpenResponsesStreamEventResponseFunctionCallArgumentsDeltaTypedDict, - OpenResponsesStreamEventResponseRefusalDeltaTypedDict, + OpenResponsesErrorEventTypedDict, + OpenResponsesReasoningSummaryTextDeltaEventTypedDict, + OpenResponsesReasoningSummaryTextDoneEventTypedDict, + OpenResponsesReasoningDeltaEventTypedDict, + OpenResponsesReasoningDoneEventTypedDict, OpenResponsesReasoningSummaryPartAddedEventTypedDict, + OpenResponsesStreamEventResponseReasoningSummaryPartDoneTypedDict, OpenResponsesStreamEventResponseContentPartAddedTypedDict, - OpenResponsesImageGenCallPartialImageTypedDict, OpenResponsesStreamEventResponseFunctionCallArgumentsDoneTypedDict, - OpenResponsesReasoningDeltaEventTypedDict, - OpenResponsesReasoningDoneEventTypedDict, OpenResponsesStreamEventResponseRefusalDoneTypedDict, - OpenResponsesStreamEventResponseReasoningSummaryPartDoneTypedDict, - OpenResponsesReasoningSummaryTextDeltaEventTypedDict, - OpenResponsesReasoningSummaryTextDoneEventTypedDict, + OpenResponsesStreamEventResponseRefusalDeltaTypedDict, + OpenResponsesImageGenCallPartialImageTypedDict, OpenResponsesStreamEventResponseContentPartDoneTypedDict, OpenResponsesStreamEventResponseOutputTextDeltaTypedDict, OpenResponsesStreamEventResponseOutputTextDoneTypedDict, @@ -709,6 +802,18 @@ class OpenResponsesStreamEventResponseCreated(BaseModel): OpenResponsesImageGenCallCompleted, Tag("response.image_generation_call.completed"), ], + Annotated[ + OpenResponsesWebSearchCallInProgress, + Tag("response.web_search_call.in_progress"), + ], + Annotated[ + OpenResponsesWebSearchCallSearching, + Tag("response.web_search_call.searching"), + ], + Annotated[ + OpenResponsesWebSearchCallCompleted, + Tag("response.web_search_call.completed"), + ], ], Discriminator(lambda m: get_discriminator(m, "type", "type")), ] diff --git a/src/openrouter/components/openresponsestoplogprobs.py b/src/openrouter/components/openresponsestoplogprobs.py deleted file mode 100644 index 5e27a3d..0000000 --- a/src/openrouter/components/openresponsestoplogprobs.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel -from typing import Optional -from typing_extensions import NotRequired, TypedDict - - -class OpenResponsesTopLogprobsTypedDict(TypedDict): - r"""Alternative token with its log probability""" - - token: NotRequired[str] - logprob: NotRequired[float] - - -class OpenResponsesTopLogprobs(BaseModel): - r"""Alternative token with its log probability""" - - token: Optional[str] = None - - logprob: Optional[float] = None diff --git a/src/openrouter/components/openresponseswebsearch20250826tool.py b/src/openrouter/components/openresponseswebsearch20250826tool.py index 671afdf..0add0a3 100644 --- a/src/openrouter/components/openresponseswebsearch20250826tool.py +++ b/src/openrouter/components/openresponseswebsearch20250826tool.py @@ -12,11 +12,12 @@ OptionalNullable, UNSET, UNSET_SENTINEL, + UnrecognizedStr, ) from openrouter.utils import validate_open_enum from pydantic import model_serializer from pydantic.functional_validators import PlainValidator -from typing import List, Literal, Optional +from typing import List, Literal, Optional, Union from typing_extensions import Annotated, NotRequired, TypedDict @@ -25,15 +26,18 @@ class OpenResponsesWebSearch20250826ToolFiltersTypedDict(TypedDict): allowed_domains: NotRequired[Nullable[List[str]]] + excluded_domains: NotRequired[Nullable[List[str]]] class OpenResponsesWebSearch20250826ToolFilters(BaseModel): allowed_domains: OptionalNullable[List[str]] = UNSET + excluded_domains: OptionalNullable[List[str]] = UNSET + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["allowed_domains"] - nullable_fields = ["allowed_domains"] + optional_fields = ["allowed_domains", "excluded_domains"] + nullable_fields = ["allowed_domains", "excluded_domains"] null_default_fields = [] serialized = handler(self) @@ -61,6 +65,17 @@ def serialize_model(self, handler): return m +OpenResponsesWebSearch20250826ToolEngine = Union[ + Literal[ + "auto", + "native", + "exa", + ], + UnrecognizedStr, +] +r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API.""" + + class OpenResponsesWebSearch20250826ToolTypedDict(TypedDict): r"""Web search tool configuration (2025-08-26 version)""" @@ -70,6 +85,10 @@ class OpenResponsesWebSearch20250826ToolTypedDict(TypedDict): r"""Size of the search context for web search tools""" user_location: NotRequired[Nullable[ResponsesWebSearchUserLocationTypedDict]] r"""User location information for web search""" + engine: NotRequired[OpenResponsesWebSearch20250826ToolEngine] + r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API.""" + max_results: NotRequired[float] + r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.""" class OpenResponsesWebSearch20250826Tool(BaseModel): @@ -87,9 +106,24 @@ class OpenResponsesWebSearch20250826Tool(BaseModel): user_location: OptionalNullable[ResponsesWebSearchUserLocation] = UNSET r"""User location information for web search""" + engine: Annotated[ + Optional[OpenResponsesWebSearch20250826ToolEngine], + PlainValidator(validate_open_enum(False)), + ] = None + r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API.""" + + max_results: Optional[float] = None + r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["filters", "search_context_size", "user_location"] + optional_fields = [ + "filters", + "search_context_size", + "user_location", + "engine", + "max_results", + ] nullable_fields = ["filters", "user_location"] null_default_fields = [] diff --git a/src/openrouter/components/openresponseswebsearchcallcompleted.py b/src/openrouter/components/openresponseswebsearchcallcompleted.py new file mode 100644 index 0000000..d2d0419 --- /dev/null +++ b/src/openrouter/components/openresponseswebsearchcallcompleted.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +OpenResponsesWebSearchCallCompletedType = Literal["response.web_search_call.completed",] + + +class OpenResponsesWebSearchCallCompletedTypedDict(TypedDict): + r"""Web search call completed""" + + type: OpenResponsesWebSearchCallCompletedType + item_id: str + output_index: float + sequence_number: float + + +class OpenResponsesWebSearchCallCompleted(BaseModel): + r"""Web search call completed""" + + type: OpenResponsesWebSearchCallCompletedType + + item_id: str + + output_index: float + + sequence_number: float diff --git a/src/openrouter/components/openresponseswebsearchcallinprogress.py b/src/openrouter/components/openresponseswebsearchcallinprogress.py new file mode 100644 index 0000000..1e7bfb3 --- /dev/null +++ b/src/openrouter/components/openresponseswebsearchcallinprogress.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +OpenResponsesWebSearchCallInProgressType = Literal[ + "response.web_search_call.in_progress", +] + + +class OpenResponsesWebSearchCallInProgressTypedDict(TypedDict): + r"""Web search call in progress""" + + type: OpenResponsesWebSearchCallInProgressType + item_id: str + output_index: float + sequence_number: float + + +class OpenResponsesWebSearchCallInProgress(BaseModel): + r"""Web search call in progress""" + + type: OpenResponsesWebSearchCallInProgressType + + item_id: str + + output_index: float + + sequence_number: float diff --git a/src/openrouter/components/openresponseswebsearchcallsearching.py b/src/openrouter/components/openresponseswebsearchcallsearching.py new file mode 100644 index 0000000..50f206e --- /dev/null +++ b/src/openrouter/components/openresponseswebsearchcallsearching.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +OpenResponsesWebSearchCallSearchingType = Literal["response.web_search_call.searching",] + + +class OpenResponsesWebSearchCallSearchingTypedDict(TypedDict): + r"""Web search call is searching""" + + type: OpenResponsesWebSearchCallSearchingType + item_id: str + output_index: float + sequence_number: float + + +class OpenResponsesWebSearchCallSearching(BaseModel): + r"""Web search call is searching""" + + type: OpenResponsesWebSearchCallSearchingType + + item_id: str + + output_index: float + + sequence_number: float diff --git a/src/openrouter/components/openresponseswebsearchpreview20250311tool.py b/src/openrouter/components/openresponseswebsearchpreview20250311tool.py index 38803d8..4d76244 100644 --- a/src/openrouter/components/openresponseswebsearchpreview20250311tool.py +++ b/src/openrouter/components/openresponseswebsearchpreview20250311tool.py @@ -12,11 +12,12 @@ OptionalNullable, UNSET, UNSET_SENTINEL, + UnrecognizedStr, ) from openrouter.utils import validate_open_enum from pydantic import model_serializer from pydantic.functional_validators import PlainValidator -from typing import Literal, Optional +from typing import List, Literal, Optional, Union from typing_extensions import Annotated, NotRequired, TypedDict @@ -25,6 +26,58 @@ ] +OpenResponsesWebSearchPreview20250311ToolEngine = Union[ + Literal[ + "auto", + "native", + "exa", + ], + UnrecognizedStr, +] +r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API.""" + + +class OpenResponsesWebSearchPreview20250311ToolFiltersTypedDict(TypedDict): + allowed_domains: NotRequired[Nullable[List[str]]] + excluded_domains: NotRequired[Nullable[List[str]]] + + +class OpenResponsesWebSearchPreview20250311ToolFilters(BaseModel): + allowed_domains: OptionalNullable[List[str]] = UNSET + + excluded_domains: OptionalNullable[List[str]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["allowed_domains", "excluded_domains"] + nullable_fields = ["allowed_domains", "excluded_domains"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + class OpenResponsesWebSearchPreview20250311ToolTypedDict(TypedDict): r"""Web search preview tool configuration (2025-03-11 version)""" @@ -32,6 +85,13 @@ class OpenResponsesWebSearchPreview20250311ToolTypedDict(TypedDict): search_context_size: NotRequired[ResponsesSearchContextSize] r"""Size of the search context for web search tools""" user_location: NotRequired[Nullable[WebSearchPreviewToolUserLocationTypedDict]] + engine: NotRequired[OpenResponsesWebSearchPreview20250311ToolEngine] + r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API.""" + max_results: NotRequired[float] + r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.""" + filters: NotRequired[ + Nullable[OpenResponsesWebSearchPreview20250311ToolFiltersTypedDict] + ] class OpenResponsesWebSearchPreview20250311Tool(BaseModel): @@ -46,10 +106,27 @@ class OpenResponsesWebSearchPreview20250311Tool(BaseModel): user_location: OptionalNullable[WebSearchPreviewToolUserLocation] = UNSET + engine: Annotated[ + Optional[OpenResponsesWebSearchPreview20250311ToolEngine], + PlainValidator(validate_open_enum(False)), + ] = None + r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API.""" + + max_results: Optional[float] = None + r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.""" + + filters: OptionalNullable[OpenResponsesWebSearchPreview20250311ToolFilters] = UNSET + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["search_context_size", "user_location"] - nullable_fields = ["user_location"] + optional_fields = [ + "search_context_size", + "user_location", + "engine", + "max_results", + "filters", + ] + nullable_fields = ["user_location", "filters"] null_default_fields = [] serialized = handler(self) diff --git a/src/openrouter/components/openresponseswebsearchpreviewtool.py b/src/openrouter/components/openresponseswebsearchpreviewtool.py index 2c074cd..c6d5de8 100644 --- a/src/openrouter/components/openresponseswebsearchpreviewtool.py +++ b/src/openrouter/components/openresponseswebsearchpreviewtool.py @@ -12,17 +12,70 @@ OptionalNullable, UNSET, UNSET_SENTINEL, + UnrecognizedStr, ) from openrouter.utils import validate_open_enum from pydantic import model_serializer from pydantic.functional_validators import PlainValidator -from typing import Literal, Optional +from typing import List, Literal, Optional, Union from typing_extensions import Annotated, NotRequired, TypedDict OpenResponsesWebSearchPreviewToolType = Literal["web_search_preview",] +OpenResponsesWebSearchPreviewToolEngine = Union[ + Literal[ + "auto", + "native", + "exa", + ], + UnrecognizedStr, +] +r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API.""" + + +class OpenResponsesWebSearchPreviewToolFiltersTypedDict(TypedDict): + allowed_domains: NotRequired[Nullable[List[str]]] + excluded_domains: NotRequired[Nullable[List[str]]] + + +class OpenResponsesWebSearchPreviewToolFilters(BaseModel): + allowed_domains: OptionalNullable[List[str]] = UNSET + + excluded_domains: OptionalNullable[List[str]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["allowed_domains", "excluded_domains"] + nullable_fields = ["allowed_domains", "excluded_domains"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + class OpenResponsesWebSearchPreviewToolTypedDict(TypedDict): r"""Web search preview tool configuration""" @@ -30,6 +83,11 @@ class OpenResponsesWebSearchPreviewToolTypedDict(TypedDict): search_context_size: NotRequired[ResponsesSearchContextSize] r"""Size of the search context for web search tools""" user_location: NotRequired[Nullable[WebSearchPreviewToolUserLocationTypedDict]] + engine: NotRequired[OpenResponsesWebSearchPreviewToolEngine] + r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API.""" + max_results: NotRequired[float] + r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.""" + filters: NotRequired[Nullable[OpenResponsesWebSearchPreviewToolFiltersTypedDict]] class OpenResponsesWebSearchPreviewTool(BaseModel): @@ -44,10 +102,27 @@ class OpenResponsesWebSearchPreviewTool(BaseModel): user_location: OptionalNullable[WebSearchPreviewToolUserLocation] = UNSET + engine: Annotated[ + Optional[OpenResponsesWebSearchPreviewToolEngine], + PlainValidator(validate_open_enum(False)), + ] = None + r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API.""" + + max_results: Optional[float] = None + r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.""" + + filters: OptionalNullable[OpenResponsesWebSearchPreviewToolFilters] = UNSET + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["search_context_size", "user_location"] - nullable_fields = ["user_location"] + optional_fields = [ + "search_context_size", + "user_location", + "engine", + "max_results", + "filters", + ] + nullable_fields = ["user_location", "filters"] null_default_fields = [] serialized = handler(self) diff --git a/src/openrouter/components/openresponseswebsearchtool.py b/src/openrouter/components/openresponseswebsearchtool.py index 0c93a22..eea286e 100644 --- a/src/openrouter/components/openresponseswebsearchtool.py +++ b/src/openrouter/components/openresponseswebsearchtool.py @@ -12,11 +12,12 @@ OptionalNullable, UNSET, UNSET_SENTINEL, + UnrecognizedStr, ) from openrouter.utils import validate_open_enum from pydantic import model_serializer from pydantic.functional_validators import PlainValidator -from typing import List, Literal, Optional +from typing import List, Literal, Optional, Union from typing_extensions import Annotated, NotRequired, TypedDict @@ -25,15 +26,18 @@ class OpenResponsesWebSearchToolFiltersTypedDict(TypedDict): allowed_domains: NotRequired[Nullable[List[str]]] + excluded_domains: NotRequired[Nullable[List[str]]] class OpenResponsesWebSearchToolFilters(BaseModel): allowed_domains: OptionalNullable[List[str]] = UNSET + excluded_domains: OptionalNullable[List[str]] = UNSET + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["allowed_domains"] - nullable_fields = ["allowed_domains"] + optional_fields = ["allowed_domains", "excluded_domains"] + nullable_fields = ["allowed_domains", "excluded_domains"] null_default_fields = [] serialized = handler(self) @@ -61,6 +65,17 @@ def serialize_model(self, handler): return m +OpenResponsesWebSearchToolEngine = Union[ + Literal[ + "auto", + "native", + "exa", + ], + UnrecognizedStr, +] +r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API.""" + + class OpenResponsesWebSearchToolTypedDict(TypedDict): r"""Web search tool configuration""" @@ -70,6 +85,10 @@ class OpenResponsesWebSearchToolTypedDict(TypedDict): r"""Size of the search context for web search tools""" user_location: NotRequired[Nullable[ResponsesWebSearchUserLocationTypedDict]] r"""User location information for web search""" + engine: NotRequired[OpenResponsesWebSearchToolEngine] + r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API.""" + max_results: NotRequired[float] + r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.""" class OpenResponsesWebSearchTool(BaseModel): @@ -87,9 +106,24 @@ class OpenResponsesWebSearchTool(BaseModel): user_location: OptionalNullable[ResponsesWebSearchUserLocation] = UNSET r"""User location information for web search""" + engine: Annotated[ + Optional[OpenResponsesWebSearchToolEngine], + PlainValidator(validate_open_enum(False)), + ] = None + r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API.""" + + max_results: Optional[float] = None + r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["filters", "search_context_size", "user_location"] + optional_fields = [ + "filters", + "search_context_size", + "user_location", + "engine", + "max_results", + ] nullable_fields = ["filters", "user_location"] null_default_fields = [] diff --git a/src/openrouter/components/outputmessage.py b/src/openrouter/components/outputmessage.py index 1304077..497bcc0 100644 --- a/src/openrouter/components/outputmessage.py +++ b/src/openrouter/components/outputmessage.py @@ -6,10 +6,16 @@ OpenAIResponsesRefusalContentTypedDict, ) from .responseoutputtext import ResponseOutputText, ResponseOutputTextTypedDict -from openrouter.types import BaseModel +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) from openrouter.utils import get_discriminator -from pydantic import Discriminator, Tag -from typing import List, Literal, Optional, Union +from pydantic import Discriminator, Tag, model_serializer +from typing import Any, List, Literal, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -63,12 +69,34 @@ ] +OutputMessagePhaseFinalAnswer = Literal["final_answer",] + + +OutputMessagePhaseCommentary = Literal["commentary",] + + +OutputMessagePhaseUnionTypedDict = TypeAliasType( + "OutputMessagePhaseUnionTypedDict", + Union[OutputMessagePhaseCommentary, OutputMessagePhaseFinalAnswer, Any], +) +r"""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.""" + + +OutputMessagePhaseUnion = TypeAliasType( + "OutputMessagePhaseUnion", + Union[OutputMessagePhaseCommentary, OutputMessagePhaseFinalAnswer, Any], +) +r"""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.""" + + class OutputMessageTypedDict(TypedDict): id: str role: OutputMessageRole type: OutputMessageType content: List[OutputMessageContentTypedDict] status: NotRequired[OutputMessageStatusUnionTypedDict] + phase: NotRequired[Nullable[OutputMessagePhaseUnionTypedDict]] + r"""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.""" class OutputMessage(BaseModel): @@ -81,3 +109,36 @@ class OutputMessage(BaseModel): content: List[OutputMessageContent] status: Optional[OutputMessageStatusUnion] = None + + phase: OptionalNullable[OutputMessagePhaseUnion] = UNSET + r"""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.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["status", "phase"] + nullable_fields = ["phase"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/openrouter/components/outputmodality.py b/src/openrouter/components/outputmodality.py index a127bd4..b3120b0 100644 --- a/src/openrouter/components/outputmodality.py +++ b/src/openrouter/components/outputmodality.py @@ -11,6 +11,7 @@ "image", "embeddings", "audio", + "video", ], UnrecognizedStr, ] diff --git a/src/openrouter/components/providername.py b/src/openrouter/components/providername.py index 67f95e7..27a4542 100644 --- a/src/openrouter/components/providername.py +++ b/src/openrouter/components/providername.py @@ -7,6 +7,7 @@ ProviderName = Union[ Literal[ + "AkashML", "AI21", "AionLabs", "Alibaba", diff --git a/src/openrouter/components/providerpreferences.py b/src/openrouter/components/providerpreferences.py index 8cb76ac..819a6da 100644 --- a/src/openrouter/components/providerpreferences.py +++ b/src/openrouter/components/providerpreferences.py @@ -62,6 +62,7 @@ "price", "throughput", "latency", + "exacto", ], UnrecognizedStr, ] @@ -71,6 +72,7 @@ "price", "throughput", "latency", + "exacto", ] @@ -79,6 +81,7 @@ "price", "throughput", "latency", + "exacto", ], UnrecognizedStr, ] @@ -168,6 +171,7 @@ def serialize_model(self, handler): "price", "throughput", "latency", + "exacto", ], UnrecognizedStr, ] diff --git a/src/openrouter/components/providersort.py b/src/openrouter/components/providersort.py index 528a881..7325f36 100644 --- a/src/openrouter/components/providersort.py +++ b/src/openrouter/components/providersort.py @@ -10,6 +10,7 @@ "price", "throughput", "latency", + "exacto", ], UnrecognizedStr, ] diff --git a/src/openrouter/components/providersortconfig.py b/src/openrouter/components/providersortconfig.py index cba451e..4e1073b 100644 --- a/src/openrouter/components/providersortconfig.py +++ b/src/openrouter/components/providersortconfig.py @@ -21,6 +21,7 @@ "price", "throughput", "latency", + "exacto", ], UnrecognizedStr, ] diff --git a/src/openrouter/components/responseoutputtext.py b/src/openrouter/components/responseoutputtext.py index f962eb0..b92a2b1 100644 --- a/src/openrouter/components/responseoutputtext.py +++ b/src/openrouter/components/responseoutputtext.py @@ -28,14 +28,14 @@ class ResponseOutputTextTopLogprob(BaseModel): logprob: float -class LogprobTypedDict(TypedDict): +class ResponseOutputTextLogprobTypedDict(TypedDict): token: str bytes_: List[float] logprob: float top_logprobs: List[ResponseOutputTextTopLogprobTypedDict] -class Logprob(BaseModel): +class ResponseOutputTextLogprob(BaseModel): token: str bytes_: Annotated[List[float], pydantic.Field(alias="bytes")] @@ -49,7 +49,7 @@ class ResponseOutputTextTypedDict(TypedDict): type: ResponseOutputTextType text: str annotations: NotRequired[List[OpenAIResponsesAnnotationTypedDict]] - logprobs: NotRequired[List[LogprobTypedDict]] + logprobs: NotRequired[List[ResponseOutputTextLogprobTypedDict]] class ResponseOutputText(BaseModel): @@ -59,4 +59,4 @@ class ResponseOutputText(BaseModel): annotations: Optional[List[OpenAIResponsesAnnotation]] = None - logprobs: Optional[List[Logprob]] = None + logprobs: Optional[List[ResponseOutputTextLogprob]] = None diff --git a/src/openrouter/components/responsesoutputitem.py b/src/openrouter/components/responsesoutputitem.py index 5aff987..a9c6043 100644 --- a/src/openrouter/components/responsesoutputitem.py +++ b/src/openrouter/components/responsesoutputitem.py @@ -21,14 +21,16 @@ ResponsesOutputMessage, ResponsesOutputMessageTypedDict, ) +from .responsesservertooloutput import ( + ResponsesServerToolOutput, + ResponsesServerToolOutputTypedDict, +) from .responseswebsearchcalloutput import ( ResponsesWebSearchCallOutput, ResponsesWebSearchCallOutputTypedDict, ) -from openrouter.utils import get_discriminator -from pydantic import Discriminator, Tag from typing import Union -from typing_extensions import Annotated, TypeAliasType +from typing_extensions import TypeAliasType ResponsesOutputItemTypedDict = TypeAliasType( @@ -37,6 +39,7 @@ ResponsesWebSearchCallOutputTypedDict, ResponsesOutputItemFileSearchCallTypedDict, ResponsesImageGenerationCallTypedDict, + ResponsesServerToolOutputTypedDict, ResponsesOutputMessageTypedDict, ResponsesOutputItemFunctionCallTypedDict, ResponsesOutputItemReasoningTypedDict, @@ -45,15 +48,16 @@ r"""An output item from the response""" -ResponsesOutputItem = Annotated[ +ResponsesOutputItem = TypeAliasType( + "ResponsesOutputItem", Union[ - Annotated[ResponsesOutputMessage, Tag("message")], - Annotated[ResponsesOutputItemReasoning, Tag("reasoning")], - Annotated[ResponsesOutputItemFunctionCall, Tag("function_call")], - Annotated[ResponsesWebSearchCallOutput, Tag("web_search_call")], - Annotated[ResponsesOutputItemFileSearchCall, Tag("file_search_call")], - Annotated[ResponsesImageGenerationCall, Tag("image_generation_call")], + ResponsesWebSearchCallOutput, + ResponsesOutputItemFileSearchCall, + ResponsesImageGenerationCall, + ResponsesServerToolOutput, + ResponsesOutputMessage, + ResponsesOutputItemFunctionCall, + ResponsesOutputItemReasoning, ], - Discriminator(lambda m: get_discriminator(m, "type", "type")), -] +) r"""An output item from the response""" diff --git a/src/openrouter/components/responsesoutputmessage.py b/src/openrouter/components/responsesoutputmessage.py index 6717a26..5302365 100644 --- a/src/openrouter/components/responsesoutputmessage.py +++ b/src/openrouter/components/responsesoutputmessage.py @@ -6,10 +6,16 @@ OpenAIResponsesRefusalContentTypedDict, ) from .responseoutputtext import ResponseOutputText, ResponseOutputTextTypedDict -from openrouter.types import BaseModel +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) from openrouter.utils import get_discriminator -from pydantic import Discriminator, Tag -from typing import List, Literal, Optional, Union +from pydantic import Discriminator, Tag, model_serializer +from typing import Any, List, Literal, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -63,6 +69,34 @@ ] +ResponsesOutputMessagePhaseFinalAnswer = Literal["final_answer",] + + +ResponsesOutputMessagePhaseCommentary = Literal["commentary",] + + +ResponsesOutputMessagePhaseUnionTypedDict = TypeAliasType( + "ResponsesOutputMessagePhaseUnionTypedDict", + Union[ + ResponsesOutputMessagePhaseCommentary, + ResponsesOutputMessagePhaseFinalAnswer, + Any, + ], +) +r"""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.""" + + +ResponsesOutputMessagePhaseUnion = TypeAliasType( + "ResponsesOutputMessagePhaseUnion", + Union[ + ResponsesOutputMessagePhaseCommentary, + ResponsesOutputMessagePhaseFinalAnswer, + Any, + ], +) +r"""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.""" + + class ResponsesOutputMessageTypedDict(TypedDict): r"""An output message item""" @@ -71,6 +105,8 @@ class ResponsesOutputMessageTypedDict(TypedDict): type: ResponsesOutputMessageType content: List[ResponsesOutputMessageContentTypedDict] status: NotRequired[ResponsesOutputMessageStatusUnionTypedDict] + phase: NotRequired[Nullable[ResponsesOutputMessagePhaseUnionTypedDict]] + r"""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.""" class ResponsesOutputMessage(BaseModel): @@ -85,3 +121,36 @@ class ResponsesOutputMessage(BaseModel): content: List[ResponsesOutputMessageContent] status: Optional[ResponsesOutputMessageStatusUnion] = None + + phase: OptionalNullable[ResponsesOutputMessagePhaseUnion] = UNSET + r"""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.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["status", "phase"] + nullable_fields = ["phase"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/openrouter/components/responsesservertooloutput.py b/src/openrouter/components/responsesservertooloutput.py new file mode 100644 index 0000000..fd0fb12 --- /dev/null +++ b/src/openrouter/components/responsesservertooloutput.py @@ -0,0 +1,55 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, Nullable, UnrecognizedStr +from openrouter.utils import validate_open_enum +import pydantic +from pydantic import ConfigDict +from pydantic.functional_validators import PlainValidator +from typing import Any, Dict, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +ResponsesServerToolOutputStatus = Union[ + Literal[ + "completed", + "in_progress", + "incomplete", + ], + UnrecognizedStr, +] + + +class ResponsesServerToolOutputTypedDict(TypedDict): + r"""A generic OpenRouter server tool output item""" + + type: str + r"""Server tool type (e.g. openrouter:datetime, openrouter:web_search)""" + status: ResponsesServerToolOutputStatus + id: NotRequired[str] + + +class ResponsesServerToolOutput(BaseModel): + r"""A generic OpenRouter server tool output item""" + + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Nullable[Any]] = pydantic.Field(init=False) + + type: str + r"""Server tool type (e.g. openrouter:datetime, openrouter:web_search)""" + + status: Annotated[ + ResponsesServerToolOutputStatus, PlainValidator(validate_open_enum(False)) + ] + + id: Optional[str] = None + + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] diff --git a/src/openrouter/components/responseswebsearchcalloutput.py b/src/openrouter/components/responseswebsearchcalloutput.py index 98621d6..1998402 100644 --- a/src/openrouter/components/responseswebsearchcalloutput.py +++ b/src/openrouter/components/responseswebsearchcalloutput.py @@ -2,25 +2,146 @@ from __future__ import annotations from .websearchstatus import WebSearchStatus -from openrouter.types import BaseModel -from openrouter.utils import validate_open_enum +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from openrouter.utils import get_discriminator, validate_open_enum +from pydantic import Discriminator, Tag, model_serializer from pydantic.functional_validators import PlainValidator -from typing import Literal -from typing_extensions import Annotated, TypedDict +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict -ResponsesWebSearchCallOutputType = Literal["web_search_call",] +TypeWebSearchCall = Literal["web_search_call",] + + +TypeFindInPage = Literal["find_in_page",] + + +class ActionFindInPageTypedDict(TypedDict): + type: TypeFindInPage + pattern: str + url: str + + +class ActionFindInPage(BaseModel): + type: TypeFindInPage + + pattern: str + + url: str + + +TypeOpenPage = Literal["open_page",] + + +class ActionOpenPageTypedDict(TypedDict): + type: TypeOpenPage + url: NotRequired[Nullable[str]] + + +class ActionOpenPage(BaseModel): + type: TypeOpenPage + + url: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["url"] + nullable_fields = ["url"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +TypeSearch = Literal["search",] + + +TypeURL = Literal["url",] + + +class SourceTypedDict(TypedDict): + type: TypeURL + url: str + + +class Source(BaseModel): + type: TypeURL + + url: str + + +class ActionSearchTypedDict(TypedDict): + type: TypeSearch + query: str + queries: NotRequired[List[str]] + sources: NotRequired[List[SourceTypedDict]] + + +class ActionSearch(BaseModel): + type: TypeSearch + + query: str + + queries: Optional[List[str]] = None + + sources: Optional[List[Source]] = None + + +ActionTypedDict = TypeAliasType( + "ActionTypedDict", + Union[ActionOpenPageTypedDict, ActionFindInPageTypedDict, ActionSearchTypedDict], +) + + +Action = Annotated[ + Union[ + Annotated[ActionSearch, Tag("search")], + Annotated[ActionOpenPage, Tag("open_page")], + Annotated[ActionFindInPage, Tag("find_in_page")], + ], + Discriminator(lambda m: get_discriminator(m, "type", "type")), +] class ResponsesWebSearchCallOutputTypedDict(TypedDict): - type: ResponsesWebSearchCallOutputType + type: TypeWebSearchCall id: str + action: ActionTypedDict status: WebSearchStatus class ResponsesWebSearchCallOutput(BaseModel): - type: ResponsesWebSearchCallOutputType + type: TypeWebSearchCall id: str + action: Action + status: Annotated[WebSearchStatus, PlainValidator(validate_open_enum(False))] diff --git a/src/openrouter/components/responseswebsearchservertool.py b/src/openrouter/components/responseswebsearchservertool.py new file mode 100644 index 0000000..16475a2 --- /dev/null +++ b/src/openrouter/components/responseswebsearchservertool.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Literal, Optional +from typing_extensions import NotRequired, TypedDict + + +ResponsesWebSearchServerToolType = Literal["openrouter:web_search",] + + +class ResponsesWebSearchServerToolParametersTypedDict(TypedDict): + max_results: NotRequired[float] + r"""Maximum number of search results to return per search call. Defaults to 5.""" + max_total_results: NotRequired[float] + r"""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.""" + + +class ResponsesWebSearchServerToolParameters(BaseModel): + max_results: Optional[float] = None + r"""Maximum number of search results to return per search call. Defaults to 5.""" + + max_total_results: Optional[float] = None + r"""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.""" + + +class ResponsesWebSearchServerToolTypedDict(TypedDict): + r"""OpenRouter built-in server tool: searches the web for current information""" + + type: ResponsesWebSearchServerToolType + parameters: NotRequired[ResponsesWebSearchServerToolParametersTypedDict] + + +class ResponsesWebSearchServerTool(BaseModel): + r"""OpenRouter built-in server tool: searches the web for current information""" + + type: ResponsesWebSearchServerToolType + + parameters: Optional[ResponsesWebSearchServerToolParameters] = None diff --git a/src/openrouter/components/tooldefinitionjson.py b/src/openrouter/components/tooldefinitionjson.py index 56f14a9..102447d 100644 --- a/src/openrouter/components/tooldefinitionjson.py +++ b/src/openrouter/components/tooldefinitionjson.py @@ -5,6 +5,9 @@ ChatMessageContentItemCacheControl, ChatMessageContentItemCacheControlTypedDict, ) +from .datetimeservertool import DatetimeServerTool, DatetimeServerToolTypedDict +from .websearchservertool import WebSearchServerTool, WebSearchServerToolTypedDict +from .websearchshorthand import WebSearchShorthand, WebSearchShorthandTypedDict from openrouter.types import ( BaseModel, Nullable, @@ -12,15 +15,16 @@ UNSET, UNSET_SENTINEL, ) -from pydantic import model_serializer -from typing import Any, Dict, Literal, Optional -from typing_extensions import NotRequired, TypedDict +from openrouter.utils import get_discriminator +from pydantic import Discriminator, Tag, model_serializer +from typing import Any, Dict, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict ToolDefinitionJSONType = Literal["function",] -class ToolDefinitionJSONFunctionTypedDict(TypedDict): +class ToolDefinitionJSONFunctionFunctionTypedDict(TypedDict): r"""Function definition for tool calling""" name: str @@ -33,7 +37,7 @@ class ToolDefinitionJSONFunctionTypedDict(TypedDict): r"""Enable strict schema adherence""" -class ToolDefinitionJSONFunction(BaseModel): +class ToolDefinitionJSONFunctionFunction(BaseModel): r"""Function definition for tool calling""" name: str @@ -79,23 +83,46 @@ def serialize_model(self, handler): return m -class ToolDefinitionJSONTypedDict(TypedDict): - r"""Tool definition for function calling""" - +class ToolDefinitionJSONFunctionTypedDict(TypedDict): type: ToolDefinitionJSONType - function: ToolDefinitionJSONFunctionTypedDict + function: ToolDefinitionJSONFunctionFunctionTypedDict r"""Function definition for tool calling""" cache_control: NotRequired[ChatMessageContentItemCacheControlTypedDict] r"""Cache control for the content part""" -class ToolDefinitionJSON(BaseModel): - r"""Tool definition for function calling""" - +class ToolDefinitionJSONFunction(BaseModel): type: ToolDefinitionJSONType - function: ToolDefinitionJSONFunction + function: ToolDefinitionJSONFunctionFunction r"""Function definition for tool calling""" cache_control: Optional[ChatMessageContentItemCacheControl] = None r"""Cache control for the content part""" + + +ToolDefinitionJSONTypedDict = TypeAliasType( + "ToolDefinitionJSONTypedDict", + Union[ + DatetimeServerToolTypedDict, + WebSearchServerToolTypedDict, + ToolDefinitionJSONFunctionTypedDict, + WebSearchShorthandTypedDict, + ], +) +r"""Tool definition for function calling (regular function or OpenRouter built-in server tool)""" + + +ToolDefinitionJSON = Annotated[ + Union[ + Annotated[ToolDefinitionJSONFunction, Tag("function")], + Annotated[DatetimeServerTool, Tag("openrouter:datetime")], + Annotated[WebSearchServerTool, Tag("openrouter:web_search")], + Annotated[WebSearchShorthand, Tag("web_search")], + Annotated[WebSearchShorthand, Tag("web_search_preview")], + Annotated[WebSearchShorthand, Tag("web_search_preview_2025_03_11")], + Annotated[WebSearchShorthand, Tag("web_search_2025_08_26")], + ], + Discriminator(lambda m: get_discriminator(m, "type", "type")), +] +r"""Tool definition for function calling (regular function or OpenRouter built-in server tool)""" diff --git a/src/openrouter/components/websearchengine.py b/src/openrouter/components/websearchengine.py index 40dafa8..992db72 100644 --- a/src/openrouter/components/websearchengine.py +++ b/src/openrouter/components/websearchengine.py @@ -9,6 +9,8 @@ Literal[ "native", "exa", + "firecrawl", + "parallel", ], UnrecognizedStr, ] diff --git a/src/openrouter/components/websearchservertool.py b/src/openrouter/components/websearchservertool.py new file mode 100644 index 0000000..989f107 --- /dev/null +++ b/src/openrouter/components/websearchservertool.py @@ -0,0 +1,120 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UnrecognizedStr +from openrouter.utils import validate_open_enum +from pydantic.functional_validators import PlainValidator +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +WebSearchServerToolTypeOpenrouterWebSearch = Literal["openrouter:web_search",] + + +WebSearchServerToolEngine = Union[ + Literal[ + "auto", + "native", + "exa", + ], + UnrecognizedStr, +] +r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API.""" + + +WebSearchServerToolSearchContextSize = Union[ + Literal[ + "low", + "medium", + "high", + ], + UnrecognizedStr, +] +r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.""" + + +WebSearchServerToolParametersType = Literal["approximate",] + + +class WebSearchServerToolUserLocationTypedDict(TypedDict): + r"""Approximate user location for location-biased results.""" + + type: NotRequired[WebSearchServerToolParametersType] + city: NotRequired[str] + region: NotRequired[str] + country: NotRequired[str] + timezone: NotRequired[str] + + +class WebSearchServerToolUserLocation(BaseModel): + r"""Approximate user location for location-biased results.""" + + type: Optional[WebSearchServerToolParametersType] = None + + city: Optional[str] = None + + region: Optional[str] = None + + country: Optional[str] = None + + timezone: Optional[str] = None + + +class WebSearchServerToolParametersTypedDict(TypedDict): + engine: NotRequired[WebSearchServerToolEngine] + r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API.""" + max_results: NotRequired[float] + r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.""" + max_total_results: NotRequired[float] + r"""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.""" + search_context_size: NotRequired[WebSearchServerToolSearchContextSize] + r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.""" + user_location: NotRequired[WebSearchServerToolUserLocationTypedDict] + r"""Approximate user location for location-biased results.""" + allowed_domains: NotRequired[List[str]] + r"""Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search.""" + excluded_domains: NotRequired[List[str]] + r"""Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search.""" + + +class WebSearchServerToolParameters(BaseModel): + engine: Annotated[ + Optional[WebSearchServerToolEngine], PlainValidator(validate_open_enum(False)) + ] = None + r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API.""" + + max_results: Optional[float] = None + r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.""" + + max_total_results: Optional[float] = None + r"""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.""" + + search_context_size: Annotated[ + Optional[WebSearchServerToolSearchContextSize], + PlainValidator(validate_open_enum(False)), + ] = None + r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.""" + + user_location: Optional[WebSearchServerToolUserLocation] = None + r"""Approximate user location for location-biased results.""" + + allowed_domains: Optional[List[str]] = None + r"""Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search.""" + + excluded_domains: Optional[List[str]] = None + r"""Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search.""" + + +class WebSearchServerToolTypedDict(TypedDict): + r"""OpenRouter built-in server tool: searches the web for current information""" + + type: WebSearchServerToolTypeOpenrouterWebSearch + parameters: NotRequired[WebSearchServerToolParametersTypedDict] + + +class WebSearchServerTool(BaseModel): + r"""OpenRouter built-in server tool: searches the web for current information""" + + type: WebSearchServerToolTypeOpenrouterWebSearch + + parameters: Optional[WebSearchServerToolParameters] = None diff --git a/src/openrouter/components/websearchshorthand.py b/src/openrouter/components/websearchshorthand.py new file mode 100644 index 0000000..225880a --- /dev/null +++ b/src/openrouter/components/websearchshorthand.py @@ -0,0 +1,218 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, UnrecognizedStr +from openrouter.utils import validate_open_enum +from pydantic.functional_validators import PlainValidator +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +WebSearchShorthandType = Union[ + Literal[ + "web_search", + "web_search_preview", + "web_search_preview_2025_03_11", + "web_search_2025_08_26", + ], + UnrecognizedStr, +] + + +WebSearchShorthandEngine = Union[ + Literal[ + "auto", + "native", + "exa", + ], + UnrecognizedStr, +] +r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API.""" + + +WebSearchShorthandSearchContextSize = Union[ + Literal[ + "low", + "medium", + "high", + ], + UnrecognizedStr, +] +r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.""" + + +WebSearchShorthandTypeApproximate = Literal["approximate",] + + +class WebSearchShorthandUserLocationTypedDict(TypedDict): + r"""Approximate user location for location-biased results.""" + + type: NotRequired[WebSearchShorthandTypeApproximate] + city: NotRequired[str] + region: NotRequired[str] + country: NotRequired[str] + timezone: NotRequired[str] + + +class WebSearchShorthandUserLocation(BaseModel): + r"""Approximate user location for location-biased results.""" + + type: Optional[WebSearchShorthandTypeApproximate] = None + + city: Optional[str] = None + + region: Optional[str] = None + + country: Optional[str] = None + + timezone: Optional[str] = None + + +WebSearchShorthandParametersEngine = Union[ + Literal[ + "auto", + "native", + "exa", + ], + UnrecognizedStr, +] +r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API.""" + + +WebSearchShorthandParametersSearchContextSize = Union[ + Literal[ + "low", + "medium", + "high", + ], + UnrecognizedStr, +] +r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.""" + + +WebSearchShorthandParametersType = Literal["approximate",] + + +class WebSearchShorthandParametersUserLocationTypedDict(TypedDict): + r"""Approximate user location for location-biased results.""" + + type: NotRequired[WebSearchShorthandParametersType] + city: NotRequired[str] + region: NotRequired[str] + country: NotRequired[str] + timezone: NotRequired[str] + + +class WebSearchShorthandParametersUserLocation(BaseModel): + r"""Approximate user location for location-biased results.""" + + type: Optional[WebSearchShorthandParametersType] = None + + city: Optional[str] = None + + region: Optional[str] = None + + country: Optional[str] = None + + timezone: Optional[str] = None + + +class WebSearchShorthandParametersTypedDict(TypedDict): + engine: NotRequired[WebSearchShorthandParametersEngine] + r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API.""" + max_results: NotRequired[float] + r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.""" + max_total_results: NotRequired[float] + r"""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.""" + search_context_size: NotRequired[WebSearchShorthandParametersSearchContextSize] + r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.""" + user_location: NotRequired[WebSearchShorthandParametersUserLocationTypedDict] + r"""Approximate user location for location-biased results.""" + allowed_domains: NotRequired[List[str]] + r"""Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search.""" + excluded_domains: NotRequired[List[str]] + r"""Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search.""" + + +class WebSearchShorthandParameters(BaseModel): + engine: Annotated[ + Optional[WebSearchShorthandParametersEngine], + PlainValidator(validate_open_enum(False)), + ] = None + r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API.""" + + max_results: Optional[float] = None + r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.""" + + max_total_results: Optional[float] = None + r"""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.""" + + search_context_size: Annotated[ + Optional[WebSearchShorthandParametersSearchContextSize], + PlainValidator(validate_open_enum(False)), + ] = None + r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.""" + + user_location: Optional[WebSearchShorthandParametersUserLocation] = None + r"""Approximate user location for location-biased results.""" + + allowed_domains: Optional[List[str]] = None + r"""Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search.""" + + excluded_domains: Optional[List[str]] = None + r"""Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search.""" + + +class WebSearchShorthandTypedDict(TypedDict): + r"""Web search tool using OpenAI Responses API syntax. Automatically converted to openrouter:web_search.""" + + type: WebSearchShorthandType + engine: NotRequired[WebSearchShorthandEngine] + r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API.""" + max_results: NotRequired[float] + r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.""" + max_total_results: NotRequired[float] + r"""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.""" + search_context_size: NotRequired[WebSearchShorthandSearchContextSize] + r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.""" + user_location: NotRequired[WebSearchShorthandUserLocationTypedDict] + r"""Approximate user location for location-biased results.""" + allowed_domains: NotRequired[List[str]] + r"""Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search.""" + excluded_domains: NotRequired[List[str]] + r"""Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search.""" + parameters: NotRequired[WebSearchShorthandParametersTypedDict] + + +class WebSearchShorthand(BaseModel): + r"""Web search tool using OpenAI Responses API syntax. Automatically converted to openrouter:web_search.""" + + type: Annotated[WebSearchShorthandType, PlainValidator(validate_open_enum(False))] + + engine: Annotated[ + Optional[WebSearchShorthandEngine], PlainValidator(validate_open_enum(False)) + ] = None + r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API.""" + + max_results: Optional[float] = None + r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.""" + + max_total_results: Optional[float] = None + r"""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.""" + + search_context_size: Annotated[ + Optional[WebSearchShorthandSearchContextSize], + PlainValidator(validate_open_enum(False)), + ] = None + r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.""" + + user_location: Optional[WebSearchShorthandUserLocation] = None + r"""Approximate user location for location-biased results.""" + + allowed_domains: Optional[List[str]] = None + r"""Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search.""" + + excluded_domains: Optional[List[str]] = None + r"""Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search.""" + + parameters: Optional[WebSearchShorthandParameters] = None diff --git a/src/openrouter/credits.py b/src/openrouter/credits.py index 9ad87fd..43b95ff 100644 --- a/src/openrouter/credits.py +++ b/src/openrouter/credits.py @@ -16,7 +16,8 @@ def get_credits( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -29,7 +30,9 @@ def get_credits( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -48,7 +51,8 @@ def get_credits( request = operations.GetCreditsRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, ) req = self._build_request( @@ -65,7 +69,8 @@ def get_credits( http_headers=http_headers, _globals=operations.GetCreditsGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -130,7 +135,8 @@ async def get_credits_async( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -143,7 +149,9 @@ async def get_credits_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -162,7 +170,8 @@ async def get_credits_async( request = operations.GetCreditsRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, ) req = self._build_request_async( @@ -179,7 +188,8 @@ async def get_credits_async( http_headers=http_headers, _globals=operations.GetCreditsGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -251,7 +261,8 @@ def create_coinbase_charge( sender: str, chain_id: components.ChainID, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -268,7 +279,9 @@ def create_coinbase_charge( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -287,7 +300,8 @@ def create_coinbase_charge( request = operations.CreateCoinbaseChargeRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, create_charge_request=components.CreateChargeRequest( amount=amount, sender=sender, @@ -309,7 +323,8 @@ def create_coinbase_charge( http_headers=http_headers, _globals=operations.CreateCoinbaseChargeGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=utils.get_pydantic_model( security, operations.CreateCoinbaseChargeSecurity @@ -395,7 +410,8 @@ async def create_coinbase_charge_async( sender: str, chain_id: components.ChainID, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -412,7 +428,9 @@ async def create_coinbase_charge_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -431,7 +449,8 @@ async def create_coinbase_charge_async( request = operations.CreateCoinbaseChargeRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, create_charge_request=components.CreateChargeRequest( amount=amount, sender=sender, @@ -453,7 +472,8 @@ async def create_coinbase_charge_async( http_headers=http_headers, _globals=operations.CreateCoinbaseChargeGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=utils.get_pydantic_model( security, operations.CreateCoinbaseChargeSecurity diff --git a/src/openrouter/embeddings.py b/src/openrouter/embeddings.py index 9a32c49..0709e41 100644 --- a/src/openrouter/embeddings.py +++ b/src/openrouter/embeddings.py @@ -24,7 +24,8 @@ def generate( input: Union[operations.InputUnion, operations.InputUnionTypedDict], model: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, encoding_format: Optional[operations.EncodingFormat] = None, dimensions: Optional[int] = None, user: Optional[str] = None, @@ -49,7 +50,9 @@ def generate( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param encoding_format: :param dimensions: @@ -74,7 +77,8 @@ def generate( request = operations.CreateEmbeddingsRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, request_body=operations.CreateEmbeddingsRequestBody( input=utils.get_pydantic_model(input, operations.InputUnion), model=model, @@ -104,7 +108,8 @@ def generate( http_headers=http_headers, _globals=operations.CreateEmbeddingsGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -230,7 +235,8 @@ async def generate_async( input: Union[operations.InputUnion, operations.InputUnionTypedDict], model: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, encoding_format: Optional[operations.EncodingFormat] = None, dimensions: Optional[int] = None, user: Optional[str] = None, @@ -255,7 +261,9 @@ async def generate_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param encoding_format: :param dimensions: @@ -280,7 +288,8 @@ async def generate_async( request = operations.CreateEmbeddingsRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, request_body=operations.CreateEmbeddingsRequestBody( input=utils.get_pydantic_model(input, operations.InputUnion), model=model, @@ -310,7 +319,8 @@ async def generate_async( http_headers=http_headers, _globals=operations.CreateEmbeddingsGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -434,7 +444,8 @@ def list_models( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -447,7 +458,9 @@ def list_models( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -466,7 +479,8 @@ def list_models( request = operations.ListEmbeddingsModelsRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, ) req = self._build_request( @@ -483,7 +497,8 @@ def list_models( http_headers=http_headers, _globals=operations.ListEmbeddingsModelsGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -543,7 +558,8 @@ async def list_models_async( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -556,7 +572,9 @@ async def list_models_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -575,7 +593,8 @@ async def list_models_async( request = operations.ListEmbeddingsModelsRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, ) req = self._build_request_async( @@ -592,7 +611,8 @@ async def list_models_async( http_headers=http_headers, _globals=operations.ListEmbeddingsModelsGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, diff --git a/src/openrouter/endpoints.py b/src/openrouter/endpoints.py index 0d37b12..09823d3 100644 --- a/src/openrouter/endpoints.py +++ b/src/openrouter/endpoints.py @@ -18,7 +18,8 @@ def list( author: str, slug: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -31,7 +32,9 @@ def list( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -50,7 +53,8 @@ def list( request = operations.ListEndpointsRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, author=author, slug=slug, ) @@ -69,7 +73,8 @@ def list( http_headers=http_headers, _globals=operations.ListEndpointsGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -131,7 +136,8 @@ async def list_async( author: str, slug: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -144,7 +150,9 @@ async def list_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -163,7 +171,8 @@ async def list_async( request = operations.ListEndpointsRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, author=author, slug=slug, ) @@ -182,7 +191,8 @@ async def list_async( http_headers=http_headers, _globals=operations.ListEndpointsGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -242,7 +252,8 @@ def list_zdr_endpoints( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -253,7 +264,9 @@ def list_zdr_endpoints( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -272,7 +285,8 @@ def list_zdr_endpoints( request = operations.ListEndpointsZdrRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, ) req = self._build_request( @@ -289,7 +303,8 @@ def list_zdr_endpoints( http_headers=http_headers, _globals=operations.ListEndpointsZdrGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -346,7 +361,8 @@ async def list_zdr_endpoints_async( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -357,7 +373,9 @@ async def list_zdr_endpoints_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -376,7 +394,8 @@ async def list_zdr_endpoints_async( request = operations.ListEndpointsZdrRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, ) req = self._build_request_async( @@ -393,7 +412,8 @@ async def list_zdr_endpoints_async( http_headers=http_headers, _globals=operations.ListEndpointsZdrGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, diff --git a/src/openrouter/errors/__init__.py b/src/openrouter/errors/__init__.py index 2c9e7bb..dc5ef68 100644 --- a/src/openrouter/errors/__init__.py +++ b/src/openrouter/errors/__init__.py @@ -15,6 +15,7 @@ BadRequestResponseError, BadRequestResponseErrorData, ) + from .conflictresponse_error import ConflictResponseError, ConflictResponseErrorData from .edgenetworktimeoutresponse_error import ( EdgeNetworkTimeoutResponseError, EdgeNetworkTimeoutResponseErrorData, @@ -69,6 +70,8 @@ "BadGatewayResponseErrorData", "BadRequestResponseError", "BadRequestResponseErrorData", + "ConflictResponseError", + "ConflictResponseErrorData", "EdgeNetworkTimeoutResponseError", "EdgeNetworkTimeoutResponseErrorData", "ForbiddenResponseError", @@ -104,6 +107,8 @@ "BadGatewayResponseErrorData": ".badgatewayresponse_error", "BadRequestResponseError": ".badrequestresponse_error", "BadRequestResponseErrorData": ".badrequestresponse_error", + "ConflictResponseError": ".conflictresponse_error", + "ConflictResponseErrorData": ".conflictresponse_error", "EdgeNetworkTimeoutResponseError": ".edgenetworktimeoutresponse_error", "EdgeNetworkTimeoutResponseErrorData": ".edgenetworktimeoutresponse_error", "ForbiddenResponseError": ".forbiddenresponse_error", diff --git a/src/openrouter/errors/conflictresponse_error.py b/src/openrouter/errors/conflictresponse_error.py new file mode 100644 index 0000000..85b6d7c --- /dev/null +++ b/src/openrouter/errors/conflictresponse_error.py @@ -0,0 +1,36 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from dataclasses import dataclass, field +import httpx +from openrouter.components import ( + conflictresponseerrordata as components_conflictresponseerrordata, +) +from openrouter.errors import OpenRouterError +from openrouter.types import BaseModel, OptionalNullable, UNSET +from typing import Optional + + +class ConflictResponseErrorData(BaseModel): + error: components_conflictresponseerrordata.ConflictResponseErrorData + r"""Error data for ConflictResponse""" + + user_id: OptionalNullable[str] = UNSET + + +@dataclass(unsafe_hash=True) +class ConflictResponseError(OpenRouterError): + r"""Conflict - Resource conflict or concurrent modification""" + + data: ConflictResponseErrorData = field(hash=False) + + def __init__( + self, + data: ConflictResponseErrorData, + raw_response: httpx.Response, + body: Optional[str] = None, + ): + fallback = body or raw_response.text + message = str(data.error.message) or fallback + super().__init__(message, raw_response, body) + object.__setattr__(self, "data", data) diff --git a/src/openrouter/generations.py b/src/openrouter/generations.py index 7a3a199..ccf3642 100644 --- a/src/openrouter/generations.py +++ b/src/openrouter/generations.py @@ -17,7 +17,8 @@ def get_generation( *, id: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -29,7 +30,9 @@ def get_generation( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -48,7 +51,8 @@ def get_generation( request = operations.GetGenerationRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, id=id, ) @@ -66,7 +70,8 @@ def get_generation( http_headers=http_headers, _globals=operations.GetGenerationGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -168,7 +173,8 @@ async def get_generation_async( *, id: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -180,7 +186,9 @@ async def get_generation_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -199,7 +207,8 @@ async def get_generation_async( request = operations.GetGenerationRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, id=id, ) @@ -217,7 +226,8 @@ async def get_generation_async( http_headers=http_headers, _globals=operations.GetGenerationGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, diff --git a/src/openrouter/guardrails.py b/src/openrouter/guardrails.py index a8454a6..31dd3fb 100644 --- a/src/openrouter/guardrails.py +++ b/src/openrouter/guardrails.py @@ -16,7 +16,8 @@ def list( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, offset: Optional[str] = None, limit: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -31,7 +32,9 @@ def list( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param offset: Number of records to skip for pagination :param limit: Maximum number of records to return (max 100) @@ -52,7 +55,8 @@ def list( request = operations.ListGuardrailsRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, offset=offset, limit=limit, ) @@ -71,7 +75,8 @@ def list( http_headers=http_headers, _globals=operations.ListGuardrailsGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -131,7 +136,8 @@ async def list_async( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, offset: Optional[str] = None, limit: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -146,7 +152,9 @@ async def list_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param offset: Number of records to skip for pagination :param limit: Maximum number of records to return (max 100) @@ -167,7 +175,8 @@ async def list_async( request = operations.ListGuardrailsRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, offset=offset, limit=limit, ) @@ -186,7 +195,8 @@ async def list_async( http_headers=http_headers, _globals=operations.ListGuardrailsGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -247,13 +257,15 @@ def create( *, name: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, description: OptionalNullable[str] = UNSET, limit_usd: OptionalNullable[float] = UNSET, reset_interval: OptionalNullable[ operations.CreateGuardrailResetIntervalRequest ] = UNSET, allowed_providers: OptionalNullable[List[str]] = UNSET, + ignored_providers: OptionalNullable[List[str]] = UNSET, allowed_models: OptionalNullable[List[str]] = UNSET, enforce_zdr: OptionalNullable[bool] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -269,12 +281,15 @@ def create( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param description: Description of the guardrail :param limit_usd: Spending limit in USD :param reset_interval: Interval at which the limit resets (daily, weekly, monthly) :param allowed_providers: List of allowed provider IDs + :param ignored_providers: List of provider IDs to exclude from routing :param allowed_models: Array of model identifiers (slug or canonical_slug accepted) :param enforce_zdr: Whether to enforce zero data retention :param retries: Override the default retry configuration for this method @@ -294,13 +309,15 @@ def create( request = operations.CreateGuardrailRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, request_body=operations.CreateGuardrailRequestBody( name=name, description=description, limit_usd=limit_usd, reset_interval=reset_interval, allowed_providers=allowed_providers, + ignored_providers=ignored_providers, allowed_models=allowed_models, enforce_zdr=enforce_zdr, ), @@ -320,7 +337,8 @@ def create( http_headers=http_headers, _globals=operations.CreateGuardrailGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -393,13 +411,15 @@ async def create_async( *, name: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, description: OptionalNullable[str] = UNSET, limit_usd: OptionalNullable[float] = UNSET, reset_interval: OptionalNullable[ operations.CreateGuardrailResetIntervalRequest ] = UNSET, allowed_providers: OptionalNullable[List[str]] = UNSET, + ignored_providers: OptionalNullable[List[str]] = UNSET, allowed_models: OptionalNullable[List[str]] = UNSET, enforce_zdr: OptionalNullable[bool] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -415,12 +435,15 @@ async def create_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param description: Description of the guardrail :param limit_usd: Spending limit in USD :param reset_interval: Interval at which the limit resets (daily, weekly, monthly) :param allowed_providers: List of allowed provider IDs + :param ignored_providers: List of provider IDs to exclude from routing :param allowed_models: Array of model identifiers (slug or canonical_slug accepted) :param enforce_zdr: Whether to enforce zero data retention :param retries: Override the default retry configuration for this method @@ -440,13 +463,15 @@ async def create_async( request = operations.CreateGuardrailRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, request_body=operations.CreateGuardrailRequestBody( name=name, description=description, limit_usd=limit_usd, reset_interval=reset_interval, allowed_providers=allowed_providers, + ignored_providers=ignored_providers, allowed_models=allowed_models, enforce_zdr=enforce_zdr, ), @@ -466,7 +491,8 @@ async def create_async( http_headers=http_headers, _globals=operations.CreateGuardrailGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -539,7 +565,8 @@ def get( *, id: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -553,7 +580,9 @@ def get( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -572,7 +601,8 @@ def get( request = operations.GetGuardrailRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, id=id, ) @@ -590,7 +620,8 @@ def get( http_headers=http_headers, _globals=operations.GetGuardrailGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -656,7 +687,8 @@ async def get_async( *, id: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -670,7 +702,9 @@ async def get_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -689,7 +723,8 @@ async def get_async( request = operations.GetGuardrailRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, id=id, ) @@ -707,7 +742,8 @@ async def get_async( http_headers=http_headers, _globals=operations.GetGuardrailGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -773,7 +809,8 @@ def update( *, id: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, name: Optional[str] = None, description: OptionalNullable[str] = UNSET, limit_usd: OptionalNullable[float] = UNSET, @@ -781,6 +818,7 @@ def update( operations.UpdateGuardrailResetIntervalRequest ] = UNSET, allowed_providers: OptionalNullable[List[str]] = UNSET, + ignored_providers: OptionalNullable[List[str]] = UNSET, allowed_models: OptionalNullable[List[str]] = UNSET, enforce_zdr: OptionalNullable[bool] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -796,13 +834,16 @@ def update( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param name: New name for the guardrail :param description: New description for the guardrail :param limit_usd: New spending limit in USD :param reset_interval: Interval at which the limit resets (daily, weekly, monthly) :param allowed_providers: New list of allowed provider IDs + :param ignored_providers: List of provider IDs to exclude from routing :param allowed_models: Array of model identifiers (slug or canonical_slug accepted) :param enforce_zdr: Whether to enforce zero data retention :param retries: Override the default retry configuration for this method @@ -822,7 +863,8 @@ def update( request = operations.UpdateGuardrailRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, id=id, request_body=operations.UpdateGuardrailRequestBody( name=name, @@ -830,6 +872,7 @@ def update( limit_usd=limit_usd, reset_interval=reset_interval, allowed_providers=allowed_providers, + ignored_providers=ignored_providers, allowed_models=allowed_models, enforce_zdr=enforce_zdr, ), @@ -849,7 +892,8 @@ def update( http_headers=http_headers, _globals=operations.UpdateGuardrailGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -927,7 +971,8 @@ async def update_async( *, id: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, name: Optional[str] = None, description: OptionalNullable[str] = UNSET, limit_usd: OptionalNullable[float] = UNSET, @@ -935,6 +980,7 @@ async def update_async( operations.UpdateGuardrailResetIntervalRequest ] = UNSET, allowed_providers: OptionalNullable[List[str]] = UNSET, + ignored_providers: OptionalNullable[List[str]] = UNSET, allowed_models: OptionalNullable[List[str]] = UNSET, enforce_zdr: OptionalNullable[bool] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -950,13 +996,16 @@ async def update_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param name: New name for the guardrail :param description: New description for the guardrail :param limit_usd: New spending limit in USD :param reset_interval: Interval at which the limit resets (daily, weekly, monthly) :param allowed_providers: New list of allowed provider IDs + :param ignored_providers: List of provider IDs to exclude from routing :param allowed_models: Array of model identifiers (slug or canonical_slug accepted) :param enforce_zdr: Whether to enforce zero data retention :param retries: Override the default retry configuration for this method @@ -976,7 +1025,8 @@ async def update_async( request = operations.UpdateGuardrailRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, id=id, request_body=operations.UpdateGuardrailRequestBody( name=name, @@ -984,6 +1034,7 @@ async def update_async( limit_usd=limit_usd, reset_interval=reset_interval, allowed_providers=allowed_providers, + ignored_providers=ignored_providers, allowed_models=allowed_models, enforce_zdr=enforce_zdr, ), @@ -1003,7 +1054,8 @@ async def update_async( http_headers=http_headers, _globals=operations.UpdateGuardrailGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -1081,7 +1133,8 @@ def delete( *, id: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1095,7 +1148,9 @@ def delete( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -1114,7 +1169,8 @@ def delete( request = operations.DeleteGuardrailRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, id=id, ) @@ -1132,7 +1188,8 @@ def delete( http_headers=http_headers, _globals=operations.DeleteGuardrailGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -1198,7 +1255,8 @@ async def delete_async( *, id: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1212,7 +1270,9 @@ async def delete_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -1231,7 +1291,8 @@ async def delete_async( request = operations.DeleteGuardrailRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, id=id, ) @@ -1249,7 +1310,8 @@ async def delete_async( http_headers=http_headers, _globals=operations.DeleteGuardrailGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -1314,7 +1376,8 @@ def list_key_assignments( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, offset: Optional[str] = None, limit: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -1329,7 +1392,9 @@ def list_key_assignments( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param offset: Number of records to skip for pagination :param limit: Maximum number of records to return (max 100) @@ -1350,7 +1415,8 @@ def list_key_assignments( request = operations.ListKeyAssignmentsRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, offset=offset, limit=limit, ) @@ -1369,7 +1435,8 @@ def list_key_assignments( http_headers=http_headers, _globals=operations.ListKeyAssignmentsGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -1431,7 +1498,8 @@ async def list_key_assignments_async( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, offset: Optional[str] = None, limit: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -1446,7 +1514,9 @@ async def list_key_assignments_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param offset: Number of records to skip for pagination :param limit: Maximum number of records to return (max 100) @@ -1467,7 +1537,8 @@ async def list_key_assignments_async( request = operations.ListKeyAssignmentsRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, offset=offset, limit=limit, ) @@ -1486,7 +1557,8 @@ async def list_key_assignments_async( http_headers=http_headers, _globals=operations.ListKeyAssignmentsGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -1548,7 +1620,8 @@ def list_member_assignments( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, offset: Optional[str] = None, limit: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -1563,7 +1636,9 @@ def list_member_assignments( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param offset: Number of records to skip for pagination :param limit: Maximum number of records to return (max 100) @@ -1584,7 +1659,8 @@ def list_member_assignments( request = operations.ListMemberAssignmentsRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, offset=offset, limit=limit, ) @@ -1603,7 +1679,8 @@ def list_member_assignments( http_headers=http_headers, _globals=operations.ListMemberAssignmentsGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -1665,7 +1742,8 @@ async def list_member_assignments_async( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, offset: Optional[str] = None, limit: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -1680,7 +1758,9 @@ async def list_member_assignments_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param offset: Number of records to skip for pagination :param limit: Maximum number of records to return (max 100) @@ -1701,7 +1781,8 @@ async def list_member_assignments_async( request = operations.ListMemberAssignmentsRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, offset=offset, limit=limit, ) @@ -1720,7 +1801,8 @@ async def list_member_assignments_async( http_headers=http_headers, _globals=operations.ListMemberAssignmentsGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -1783,7 +1865,8 @@ def list_guardrail_key_assignments( *, id: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, offset: Optional[str] = None, limit: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -1799,7 +1882,9 @@ def list_guardrail_key_assignments( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param offset: Number of records to skip for pagination :param limit: Maximum number of records to return (max 100) @@ -1820,7 +1905,8 @@ def list_guardrail_key_assignments( request = operations.ListGuardrailKeyAssignmentsRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, id=id, offset=offset, limit=limit, @@ -1840,7 +1926,8 @@ def list_guardrail_key_assignments( http_headers=http_headers, _globals=operations.ListGuardrailKeyAssignmentsGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -1908,7 +1995,8 @@ async def list_guardrail_key_assignments_async( *, id: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, offset: Optional[str] = None, limit: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -1924,7 +2012,9 @@ async def list_guardrail_key_assignments_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param offset: Number of records to skip for pagination :param limit: Maximum number of records to return (max 100) @@ -1945,7 +2035,8 @@ async def list_guardrail_key_assignments_async( request = operations.ListGuardrailKeyAssignmentsRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, id=id, offset=offset, limit=limit, @@ -1965,7 +2056,8 @@ async def list_guardrail_key_assignments_async( http_headers=http_headers, _globals=operations.ListGuardrailKeyAssignmentsGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -2034,7 +2126,8 @@ def bulk_assign_keys( id: str, key_hashes: List[str], http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -2049,7 +2142,9 @@ def bulk_assign_keys( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -2068,7 +2163,8 @@ def bulk_assign_keys( request = operations.BulkAssignKeysToGuardrailRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, id=id, request_body=operations.BulkAssignKeysToGuardrailRequestBody( key_hashes=key_hashes, @@ -2089,7 +2185,8 @@ def bulk_assign_keys( http_headers=http_headers, _globals=operations.BulkAssignKeysToGuardrailGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -2170,7 +2267,8 @@ async def bulk_assign_keys_async( id: str, key_hashes: List[str], http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -2185,7 +2283,9 @@ async def bulk_assign_keys_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -2204,7 +2304,8 @@ async def bulk_assign_keys_async( request = operations.BulkAssignKeysToGuardrailRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, id=id, request_body=operations.BulkAssignKeysToGuardrailRequestBody( key_hashes=key_hashes, @@ -2225,7 +2326,8 @@ async def bulk_assign_keys_async( http_headers=http_headers, _globals=operations.BulkAssignKeysToGuardrailGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -2305,7 +2407,8 @@ def list_guardrail_member_assignments( *, id: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, offset: Optional[str] = None, limit: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -2321,7 +2424,9 @@ def list_guardrail_member_assignments( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param offset: Number of records to skip for pagination :param limit: Maximum number of records to return (max 100) @@ -2342,7 +2447,8 @@ def list_guardrail_member_assignments( request = operations.ListGuardrailMemberAssignmentsRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, id=id, offset=offset, limit=limit, @@ -2362,7 +2468,8 @@ def list_guardrail_member_assignments( http_headers=http_headers, _globals=operations.ListGuardrailMemberAssignmentsGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -2430,7 +2537,8 @@ async def list_guardrail_member_assignments_async( *, id: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, offset: Optional[str] = None, limit: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -2446,7 +2554,9 @@ async def list_guardrail_member_assignments_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param offset: Number of records to skip for pagination :param limit: Maximum number of records to return (max 100) @@ -2467,7 +2577,8 @@ async def list_guardrail_member_assignments_async( request = operations.ListGuardrailMemberAssignmentsRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, id=id, offset=offset, limit=limit, @@ -2487,7 +2598,8 @@ async def list_guardrail_member_assignments_async( http_headers=http_headers, _globals=operations.ListGuardrailMemberAssignmentsGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -2556,7 +2668,8 @@ def bulk_assign_members( id: str, member_user_ids: List[str], http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -2571,7 +2684,9 @@ def bulk_assign_members( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -2590,7 +2705,8 @@ def bulk_assign_members( request = operations.BulkAssignMembersToGuardrailRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, id=id, request_body=operations.BulkAssignMembersToGuardrailRequestBody( member_user_ids=member_user_ids, @@ -2611,7 +2727,8 @@ def bulk_assign_members( http_headers=http_headers, _globals=operations.BulkAssignMembersToGuardrailGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -2692,7 +2809,8 @@ async def bulk_assign_members_async( id: str, member_user_ids: List[str], http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -2707,7 +2825,9 @@ async def bulk_assign_members_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -2726,7 +2846,8 @@ async def bulk_assign_members_async( request = operations.BulkAssignMembersToGuardrailRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, id=id, request_body=operations.BulkAssignMembersToGuardrailRequestBody( member_user_ids=member_user_ids, @@ -2747,7 +2868,8 @@ async def bulk_assign_members_async( http_headers=http_headers, _globals=operations.BulkAssignMembersToGuardrailGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -2828,7 +2950,8 @@ def bulk_unassign_keys( id: str, key_hashes: List[str], http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -2843,7 +2966,9 @@ def bulk_unassign_keys( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -2862,7 +2987,8 @@ def bulk_unassign_keys( request = operations.BulkUnassignKeysFromGuardrailRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, id=id, request_body=operations.BulkUnassignKeysFromGuardrailRequestBody( key_hashes=key_hashes, @@ -2883,7 +3009,8 @@ def bulk_unassign_keys( http_headers=http_headers, _globals=operations.BulkUnassignKeysFromGuardrailGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -2964,7 +3091,8 @@ async def bulk_unassign_keys_async( id: str, key_hashes: List[str], http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -2979,7 +3107,9 @@ async def bulk_unassign_keys_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -2998,7 +3128,8 @@ async def bulk_unassign_keys_async( request = operations.BulkUnassignKeysFromGuardrailRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, id=id, request_body=operations.BulkUnassignKeysFromGuardrailRequestBody( key_hashes=key_hashes, @@ -3019,7 +3150,8 @@ async def bulk_unassign_keys_async( http_headers=http_headers, _globals=operations.BulkUnassignKeysFromGuardrailGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -3100,7 +3232,8 @@ def bulk_unassign_members( id: str, member_user_ids: List[str], http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -3115,7 +3248,9 @@ def bulk_unassign_members( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -3134,7 +3269,8 @@ def bulk_unassign_members( request = operations.BulkUnassignMembersFromGuardrailRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, id=id, request_body=operations.BulkUnassignMembersFromGuardrailRequestBody( member_user_ids=member_user_ids, @@ -3155,7 +3291,8 @@ def bulk_unassign_members( http_headers=http_headers, _globals=operations.BulkUnassignMembersFromGuardrailGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -3236,7 +3373,8 @@ async def bulk_unassign_members_async( id: str, member_user_ids: List[str], http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -3251,7 +3389,9 @@ async def bulk_unassign_members_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -3270,7 +3410,8 @@ async def bulk_unassign_members_async( request = operations.BulkUnassignMembersFromGuardrailRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, id=id, request_body=operations.BulkUnassignMembersFromGuardrailRequestBody( member_user_ids=member_user_ids, @@ -3291,7 +3432,8 @@ async def bulk_unassign_members_async( http_headers=http_headers, _globals=operations.BulkUnassignMembersFromGuardrailGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( diff --git a/src/openrouter/models/internal/globals.py b/src/openrouter/models/internal/globals.py index 248f13e..701741b 100644 --- a/src/openrouter/models/internal/globals.py +++ b/src/openrouter/models/internal/globals.py @@ -14,10 +14,14 @@ class GlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class Globals(BaseModel): @@ -31,11 +35,20 @@ class Globals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ diff --git a/src/openrouter/models_.py b/src/openrouter/models_.py index ae103c1..9da3b00 100644 --- a/src/openrouter/models_.py +++ b/src/openrouter/models_.py @@ -16,7 +16,9 @@ def count( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + output_modalities: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -27,8 +29,11 @@ def count( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param output_modalities: 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\". :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -46,7 +51,9 @@ def count( request = operations.ListModelsCountRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + output_modalities=output_modalities, ) req = self._build_request( @@ -63,7 +70,8 @@ def count( http_headers=http_headers, _globals=operations.ListModelsCountGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -89,13 +97,18 @@ def count( ), ), request=req, - error_status_codes=["4XX", "500", "5XX"], + error_status_codes=["400", "4XX", "500", "5XX"], retry_config=retry_config, ) response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return unmarshal_json_response(components.ModelsCountResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) if utils.match_response(http_res, "500", "application/json"): response_data = unmarshal_json_response( errors.InternalServerResponseErrorData, http_res @@ -118,7 +131,9 @@ async def count_async( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, + output_modalities: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -129,8 +144,11 @@ async def count_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + :param output_modalities: 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\". :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -148,7 +166,9 @@ async def count_async( request = operations.ListModelsCountRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, + output_modalities=output_modalities, ) req = self._build_request_async( @@ -165,7 +185,8 @@ async def count_async( http_headers=http_headers, _globals=operations.ListModelsCountGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -191,13 +212,18 @@ async def count_async( ), ), request=req, - error_status_codes=["4XX", "500", "5XX"], + error_status_codes=["400", "4XX", "500", "5XX"], retry_config=retry_config, ) response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return unmarshal_json_response(components.ModelsCountResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) if utils.match_response(http_res, "500", "application/json"): response_data = unmarshal_json_response( errors.InternalServerResponseErrorData, http_res @@ -220,9 +246,11 @@ def list( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, category: Optional[operations.Category] = None, supported_parameters: Optional[str] = None, + output_modalities: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -233,10 +261,13 @@ def list( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param category: Filter models by use case category :param supported_parameters: + :param output_modalities: 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\". :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -254,9 +285,11 @@ def list( request = operations.GetModelsRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, category=category, supported_parameters=supported_parameters, + output_modalities=output_modalities, ) req = self._build_request( @@ -273,7 +306,8 @@ def list( http_headers=http_headers, _globals=operations.GetModelsGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -333,9 +367,11 @@ async def list_async( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, category: Optional[operations.Category] = None, supported_parameters: Optional[str] = None, + output_modalities: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -346,10 +382,13 @@ async def list_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param category: Filter models by use case category :param supported_parameters: + :param output_modalities: 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\". :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -367,9 +406,11 @@ async def list_async( request = operations.GetModelsRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, category=category, supported_parameters=supported_parameters, + output_modalities=output_modalities, ) req = self._build_request_async( @@ -386,7 +427,8 @@ async def list_async( http_headers=http_headers, _globals=operations.GetModelsGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -450,7 +492,8 @@ def list_for_user( operations.ListModelsUserSecurityTypedDict, ], http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -464,7 +507,9 @@ def list_for_user( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -483,7 +528,8 @@ def list_for_user( request = operations.ListModelsUserRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, ) req = self._build_request( @@ -500,7 +546,8 @@ def list_for_user( http_headers=http_headers, _globals=operations.ListModelsUserGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=utils.get_pydantic_model( security, operations.ListModelsUserSecurity @@ -569,7 +616,8 @@ async def list_for_user_async( operations.ListModelsUserSecurityTypedDict, ], http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -583,7 +631,9 @@ async def list_for_user_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -602,7 +652,8 @@ async def list_for_user_async( request = operations.ListModelsUserRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, ) req = self._build_request_async( @@ -619,7 +670,8 @@ async def list_for_user_async( http_headers=http_headers, _globals=operations.ListModelsUserGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=utils.get_pydantic_model( security, operations.ListModelsUserSecurity diff --git a/src/openrouter/oauth.py b/src/openrouter/oauth.py index ff44c48..b31df9f 100644 --- a/src/openrouter/oauth.py +++ b/src/openrouter/oauth.py @@ -18,7 +18,8 @@ def exchange_auth_code_for_api_key( *, code: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, code_verifier: Optional[str] = None, code_challenge_method: OptionalNullable[ operations.ExchangeAuthCodeForAPIKeyCodeChallengeMethod @@ -36,7 +37,9 @@ def exchange_auth_code_for_api_key( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param code_verifier: The code verifier if code_challenge was used in the authorization request :param code_challenge_method: The method used to generate the code challenge @@ -57,7 +60,8 @@ def exchange_auth_code_for_api_key( request = operations.ExchangeAuthCodeForAPIKeyRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, request_body=operations.ExchangeAuthCodeForAPIKeyRequestBody( code=code, code_verifier=code_verifier, @@ -79,7 +83,8 @@ def exchange_auth_code_for_api_key( http_headers=http_headers, _globals=operations.ExchangeAuthCodeForAPIKeyGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -154,7 +159,8 @@ async def exchange_auth_code_for_api_key_async( *, code: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, code_verifier: Optional[str] = None, code_challenge_method: OptionalNullable[ operations.ExchangeAuthCodeForAPIKeyCodeChallengeMethod @@ -172,7 +178,9 @@ async def exchange_auth_code_for_api_key_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param code_verifier: The code verifier if code_challenge was used in the authorization request :param code_challenge_method: The method used to generate the code challenge @@ -193,7 +201,8 @@ async def exchange_auth_code_for_api_key_async( request = operations.ExchangeAuthCodeForAPIKeyRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, request_body=operations.ExchangeAuthCodeForAPIKeyRequestBody( code=code, code_verifier=code_verifier, @@ -215,7 +224,8 @@ async def exchange_auth_code_for_api_key_async( http_headers=http_headers, _globals=operations.ExchangeAuthCodeForAPIKeyGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -290,7 +300,8 @@ def create_auth_code( *, callback_url: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, code_challenge: Optional[str] = None, code_challenge_method: Optional[ operations.CreateAuthKeysCodeCodeChallengeMethod @@ -312,7 +323,9 @@ def create_auth_code( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param code_challenge: PKCE code challenge for enhanced security :param code_challenge_method: The method used to generate the code challenge @@ -337,7 +350,8 @@ def create_auth_code( request = operations.CreateAuthKeysCodeRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, request_body=operations.CreateAuthKeysCodeRequestBody( callback_url=callback_url, code_challenge=code_challenge, @@ -363,7 +377,8 @@ def create_auth_code( http_headers=http_headers, _globals=operations.CreateAuthKeysCodeGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -396,7 +411,7 @@ def create_auth_code( ), ), request=req, - error_status_codes=["400", "401", "4XX", "500", "5XX"], + error_status_codes=["400", "401", "409", "4XX", "500", "5XX"], retry_config=retry_config, ) @@ -415,6 +430,11 @@ def create_auth_code( errors.UnauthorizedResponseErrorData, http_res ) raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "409", "application/json"): + response_data = unmarshal_json_response( + errors.ConflictResponseErrorData, http_res + ) + raise errors.ConflictResponseError(response_data, http_res) if utils.match_response(http_res, "500", "application/json"): response_data = unmarshal_json_response( errors.InternalServerResponseErrorData, http_res @@ -438,7 +458,8 @@ async def create_auth_code_async( *, callback_url: str, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, code_challenge: Optional[str] = None, code_challenge_method: Optional[ operations.CreateAuthKeysCodeCodeChallengeMethod @@ -460,7 +481,9 @@ async def create_auth_code_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param code_challenge: PKCE code challenge for enhanced security :param code_challenge_method: The method used to generate the code challenge @@ -485,7 +508,8 @@ async def create_auth_code_async( request = operations.CreateAuthKeysCodeRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, request_body=operations.CreateAuthKeysCodeRequestBody( callback_url=callback_url, code_challenge=code_challenge, @@ -511,7 +535,8 @@ async def create_auth_code_async( http_headers=http_headers, _globals=operations.CreateAuthKeysCodeGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -544,7 +569,7 @@ async def create_auth_code_async( ), ), request=req, - error_status_codes=["400", "401", "4XX", "500", "5XX"], + error_status_codes=["400", "401", "409", "4XX", "500", "5XX"], retry_config=retry_config, ) @@ -563,6 +588,11 @@ async def create_auth_code_async( errors.UnauthorizedResponseErrorData, http_res ) raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "409", "application/json"): + response_data = unmarshal_json_response( + errors.ConflictResponseErrorData, http_res + ) + raise errors.ConflictResponseError(response_data, http_res) if utils.match_response(http_res, "500", "application/json"): response_data = unmarshal_json_response( errors.InternalServerResponseErrorData, http_res diff --git a/src/openrouter/operations/bulkassignkeystoguardrail.py b/src/openrouter/operations/bulkassignkeystoguardrail.py index f4e1a67..f258d3d 100644 --- a/src/openrouter/operations/bulkassignkeystoguardrail.py +++ b/src/openrouter/operations/bulkassignkeystoguardrail.py @@ -19,10 +19,14 @@ class BulkAssignKeysToGuardrailGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class BulkAssignKeysToGuardrailGlobals(BaseModel): @@ -36,15 +40,24 @@ class BulkAssignKeysToGuardrailGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class BulkAssignKeysToGuardrailRequestBodyTypedDict(TypedDict): key_hashes: List[str] @@ -65,10 +78,14 @@ class BulkAssignKeysToGuardrailRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class BulkAssignKeysToGuardrailRequest(BaseModel): @@ -92,15 +109,24 @@ class BulkAssignKeysToGuardrailRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class BulkAssignKeysToGuardrailResponseTypedDict(TypedDict): r"""Assignment result""" diff --git a/src/openrouter/operations/bulkassignmemberstoguardrail.py b/src/openrouter/operations/bulkassignmemberstoguardrail.py index fc5c674..1ebb22d 100644 --- a/src/openrouter/operations/bulkassignmemberstoguardrail.py +++ b/src/openrouter/operations/bulkassignmemberstoguardrail.py @@ -19,10 +19,14 @@ class BulkAssignMembersToGuardrailGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class BulkAssignMembersToGuardrailGlobals(BaseModel): @@ -36,15 +40,24 @@ class BulkAssignMembersToGuardrailGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class BulkAssignMembersToGuardrailRequestBodyTypedDict(TypedDict): member_user_ids: List[str] @@ -65,10 +78,14 @@ class BulkAssignMembersToGuardrailRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class BulkAssignMembersToGuardrailRequest(BaseModel): @@ -92,15 +109,24 @@ class BulkAssignMembersToGuardrailRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class BulkAssignMembersToGuardrailResponseTypedDict(TypedDict): r"""Assignment result""" diff --git a/src/openrouter/operations/bulkunassignkeysfromguardrail.py b/src/openrouter/operations/bulkunassignkeysfromguardrail.py index 6b88cbc..45cd84b 100644 --- a/src/openrouter/operations/bulkunassignkeysfromguardrail.py +++ b/src/openrouter/operations/bulkunassignkeysfromguardrail.py @@ -19,10 +19,14 @@ class BulkUnassignKeysFromGuardrailGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class BulkUnassignKeysFromGuardrailGlobals(BaseModel): @@ -36,15 +40,24 @@ class BulkUnassignKeysFromGuardrailGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class BulkUnassignKeysFromGuardrailRequestBodyTypedDict(TypedDict): key_hashes: List[str] @@ -65,10 +78,14 @@ class BulkUnassignKeysFromGuardrailRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class BulkUnassignKeysFromGuardrailRequest(BaseModel): @@ -92,15 +109,24 @@ class BulkUnassignKeysFromGuardrailRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class BulkUnassignKeysFromGuardrailResponseTypedDict(TypedDict): r"""Unassignment result""" diff --git a/src/openrouter/operations/bulkunassignmembersfromguardrail.py b/src/openrouter/operations/bulkunassignmembersfromguardrail.py index 8cdde8d..ac6e0c1 100644 --- a/src/openrouter/operations/bulkunassignmembersfromguardrail.py +++ b/src/openrouter/operations/bulkunassignmembersfromguardrail.py @@ -19,10 +19,14 @@ class BulkUnassignMembersFromGuardrailGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class BulkUnassignMembersFromGuardrailGlobals(BaseModel): @@ -36,15 +40,24 @@ class BulkUnassignMembersFromGuardrailGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class BulkUnassignMembersFromGuardrailRequestBodyTypedDict(TypedDict): member_user_ids: List[str] @@ -65,10 +78,14 @@ class BulkUnassignMembersFromGuardrailRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class BulkUnassignMembersFromGuardrailRequest(BaseModel): @@ -92,15 +109,24 @@ class BulkUnassignMembersFromGuardrailRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class BulkUnassignMembersFromGuardrailResponseTypedDict(TypedDict): r"""Unassignment result""" diff --git a/src/openrouter/operations/createauthkeyscode.py b/src/openrouter/operations/createauthkeyscode.py index 62f121a..610f446 100644 --- a/src/openrouter/operations/createauthkeyscode.py +++ b/src/openrouter/operations/createauthkeyscode.py @@ -29,10 +29,14 @@ class CreateAuthKeysCodeGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class CreateAuthKeysCodeGlobals(BaseModel): @@ -46,15 +50,24 @@ class CreateAuthKeysCodeGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + CreateAuthKeysCodeCodeChallengeMethod = Union[ Literal[ @@ -166,10 +179,14 @@ class CreateAuthKeysCodeRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class CreateAuthKeysCodeRequest(BaseModel): @@ -188,15 +205,24 @@ class CreateAuthKeysCodeRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class CreateAuthKeysCodeDataTypedDict(TypedDict): r"""Auth code data""" diff --git a/src/openrouter/operations/createcoinbasecharge.py b/src/openrouter/operations/createcoinbasecharge.py index 2fe8172..dc83233 100644 --- a/src/openrouter/operations/createcoinbasecharge.py +++ b/src/openrouter/operations/createcoinbasecharge.py @@ -20,10 +20,14 @@ class CreateCoinbaseChargeGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class CreateCoinbaseChargeGlobals(BaseModel): @@ -37,15 +41,24 @@ class CreateCoinbaseChargeGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class CreateCoinbaseChargeSecurityTypedDict(TypedDict): bearer: str @@ -72,10 +85,14 @@ class CreateCoinbaseChargeRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class CreateCoinbaseChargeRequest(BaseModel): @@ -94,15 +111,24 @@ class CreateCoinbaseChargeRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class CallDataTypedDict(TypedDict): deadline: str diff --git a/src/openrouter/operations/createembeddings.py b/src/openrouter/operations/createembeddings.py index 637389e..bf520a6 100644 --- a/src/openrouter/operations/createembeddings.py +++ b/src/openrouter/operations/createembeddings.py @@ -23,10 +23,14 @@ class CreateEmbeddingsGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class CreateEmbeddingsGlobals(BaseModel): @@ -40,15 +44,24 @@ class CreateEmbeddingsGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + TypeImageURL = Literal["image_url",] @@ -165,10 +178,14 @@ class CreateEmbeddingsRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class CreateEmbeddingsRequest(BaseModel): @@ -187,15 +204,24 @@ class CreateEmbeddingsRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + Object = Literal["list",] diff --git a/src/openrouter/operations/createguardrail.py b/src/openrouter/operations/createguardrail.py index 629fa8a..8f24ce4 100644 --- a/src/openrouter/operations/createguardrail.py +++ b/src/openrouter/operations/createguardrail.py @@ -28,10 +28,14 @@ class CreateGuardrailGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class CreateGuardrailGlobals(BaseModel): @@ -45,15 +49,24 @@ class CreateGuardrailGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + CreateGuardrailResetIntervalRequest = Union[ Literal[ @@ -77,6 +90,8 @@ class CreateGuardrailRequestBodyTypedDict(TypedDict): r"""Interval at which the limit resets (daily, weekly, monthly)""" allowed_providers: NotRequired[Nullable[List[str]]] r"""List of allowed provider IDs""" + ignored_providers: NotRequired[Nullable[List[str]]] + r"""List of provider IDs to exclude from routing""" allowed_models: NotRequired[Nullable[List[str]]] r"""Array of model identifiers (slug or canonical_slug accepted)""" enforce_zdr: NotRequired[Nullable[bool]] @@ -102,6 +117,9 @@ class CreateGuardrailRequestBody(BaseModel): allowed_providers: OptionalNullable[List[str]] = UNSET r"""List of allowed provider IDs""" + ignored_providers: OptionalNullable[List[str]] = UNSET + r"""List of provider IDs to exclude from routing""" + allowed_models: OptionalNullable[List[str]] = UNSET r"""Array of model identifiers (slug or canonical_slug accepted)""" @@ -115,6 +133,7 @@ def serialize_model(self, handler): "limit_usd", "reset_interval", "allowed_providers", + "ignored_providers", "allowed_models", "enforce_zdr", ] @@ -123,6 +142,7 @@ def serialize_model(self, handler): "limit_usd", "reset_interval", "allowed_providers", + "ignored_providers", "allowed_models", "enforce_zdr", ] @@ -160,10 +180,14 @@ class CreateGuardrailRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class CreateGuardrailRequest(BaseModel): @@ -182,15 +206,24 @@ class CreateGuardrailRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + CreateGuardrailResetIntervalResponse = Union[ Literal[ @@ -220,6 +253,8 @@ class CreateGuardrailDataTypedDict(TypedDict): r"""Interval at which the limit resets (daily, weekly, monthly)""" allowed_providers: NotRequired[Nullable[List[str]]] r"""List of allowed provider IDs""" + ignored_providers: NotRequired[Nullable[List[str]]] + r"""List of provider IDs to exclude from routing""" allowed_models: NotRequired[Nullable[List[str]]] r"""Array of model canonical_slugs (immutable identifiers)""" enforce_zdr: NotRequired[Nullable[bool]] @@ -255,6 +290,9 @@ class CreateGuardrailData(BaseModel): allowed_providers: OptionalNullable[List[str]] = UNSET r"""List of allowed provider IDs""" + ignored_providers: OptionalNullable[List[str]] = UNSET + r"""List of provider IDs to exclude from routing""" + allowed_models: OptionalNullable[List[str]] = UNSET r"""Array of model canonical_slugs (immutable identifiers)""" @@ -271,6 +309,7 @@ def serialize_model(self, handler): "limit_usd", "reset_interval", "allowed_providers", + "ignored_providers", "allowed_models", "enforce_zdr", "updated_at", @@ -280,6 +319,7 @@ def serialize_model(self, handler): "limit_usd", "reset_interval", "allowed_providers", + "ignored_providers", "allowed_models", "enforce_zdr", "updated_at", diff --git a/src/openrouter/operations/createkeys.py b/src/openrouter/operations/createkeys.py index f53ff9e..afaf0d8 100644 --- a/src/openrouter/operations/createkeys.py +++ b/src/openrouter/operations/createkeys.py @@ -29,10 +29,14 @@ class CreateKeysGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class CreateKeysGlobals(BaseModel): @@ -46,15 +50,24 @@ class CreateKeysGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + CreateKeysLimitReset = Union[ Literal[ @@ -142,10 +155,14 @@ class CreateKeysRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class CreateKeysRequest(BaseModel): @@ -164,15 +181,24 @@ class CreateKeysRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class CreateKeysDataTypedDict(TypedDict): r"""The created API key information""" diff --git a/src/openrouter/operations/createresponses.py b/src/openrouter/operations/createresponses.py index 2865ddc..5c2b8b5 100644 --- a/src/openrouter/operations/createresponses.py +++ b/src/openrouter/operations/createresponses.py @@ -24,10 +24,14 @@ class CreateResponsesGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class CreateResponsesGlobals(BaseModel): @@ -41,15 +45,24 @@ class CreateResponsesGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class CreateResponsesRequestTypedDict(TypedDict): open_responses_request: ( @@ -60,10 +73,14 @@ class CreateResponsesRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class CreateResponsesRequest(BaseModel): @@ -82,15 +99,24 @@ class CreateResponsesRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class CreateResponsesResponseBodyTypedDict(TypedDict): r"""Successful response""" diff --git a/src/openrouter/operations/deleteguardrail.py b/src/openrouter/operations/deleteguardrail.py index 23367ff..2eade13 100644 --- a/src/openrouter/operations/deleteguardrail.py +++ b/src/openrouter/operations/deleteguardrail.py @@ -20,10 +20,14 @@ class DeleteGuardrailGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class DeleteGuardrailGlobals(BaseModel): @@ -37,15 +41,24 @@ class DeleteGuardrailGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class DeleteGuardrailRequestTypedDict(TypedDict): id: str @@ -55,10 +68,14 @@ class DeleteGuardrailRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class DeleteGuardrailRequest(BaseModel): @@ -77,15 +94,24 @@ class DeleteGuardrailRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class DeleteGuardrailResponseTypedDict(TypedDict): r"""Guardrail deleted successfully""" diff --git a/src/openrouter/operations/deletekeys.py b/src/openrouter/operations/deletekeys.py index 986ea96..51d4881 100644 --- a/src/openrouter/operations/deletekeys.py +++ b/src/openrouter/operations/deletekeys.py @@ -20,10 +20,14 @@ class DeleteKeysGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class DeleteKeysGlobals(BaseModel): @@ -37,15 +41,24 @@ class DeleteKeysGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class DeleteKeysRequestTypedDict(TypedDict): hash: str @@ -55,10 +68,14 @@ class DeleteKeysRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class DeleteKeysRequest(BaseModel): @@ -77,15 +94,24 @@ class DeleteKeysRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class DeleteKeysResponseTypedDict(TypedDict): r"""API key deleted successfully""" diff --git a/src/openrouter/operations/exchangeauthcodeforapikey.py b/src/openrouter/operations/exchangeauthcodeforapikey.py index 4e14679..eb44748 100644 --- a/src/openrouter/operations/exchangeauthcodeforapikey.py +++ b/src/openrouter/operations/exchangeauthcodeforapikey.py @@ -28,10 +28,14 @@ class ExchangeAuthCodeForAPIKeyGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class ExchangeAuthCodeForAPIKeyGlobals(BaseModel): @@ -45,15 +49,24 @@ class ExchangeAuthCodeForAPIKeyGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + ExchangeAuthCodeForAPIKeyCodeChallengeMethod = Union[ Literal[ @@ -127,10 +140,14 @@ class ExchangeAuthCodeForAPIKeyRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class ExchangeAuthCodeForAPIKeyRequest(BaseModel): @@ -149,15 +166,24 @@ class ExchangeAuthCodeForAPIKeyRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class ExchangeAuthCodeForAPIKeyResponseTypedDict(TypedDict): r"""Successfully exchanged code for an API key""" diff --git a/src/openrouter/operations/getcredits.py b/src/openrouter/operations/getcredits.py index 4c79e6d..54ebfd6 100644 --- a/src/openrouter/operations/getcredits.py +++ b/src/openrouter/operations/getcredits.py @@ -14,10 +14,14 @@ class GetCreditsGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class GetCreditsGlobals(BaseModel): @@ -31,15 +35,24 @@ class GetCreditsGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class GetCreditsRequestTypedDict(TypedDict): http_referer: NotRequired[str] @@ -47,10 +60,14 @@ class GetCreditsRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class GetCreditsRequest(BaseModel): @@ -64,15 +81,24 @@ class GetCreditsRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class GetCreditsDataTypedDict(TypedDict): total_credits: float diff --git a/src/openrouter/operations/getcurrentkey.py b/src/openrouter/operations/getcurrentkey.py index 8836057..70808d4 100644 --- a/src/openrouter/operations/getcurrentkey.py +++ b/src/openrouter/operations/getcurrentkey.py @@ -22,10 +22,14 @@ class GetCurrentKeyGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class GetCurrentKeyGlobals(BaseModel): @@ -39,15 +43,24 @@ class GetCurrentKeyGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class GetCurrentKeyRequestTypedDict(TypedDict): http_referer: NotRequired[str] @@ -55,10 +68,14 @@ class GetCurrentKeyRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class GetCurrentKeyRequest(BaseModel): @@ -72,15 +89,24 @@ class GetCurrentKeyRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + @deprecated( "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." diff --git a/src/openrouter/operations/getgeneration.py b/src/openrouter/operations/getgeneration.py index 05aa6ff..7f3df9d 100644 --- a/src/openrouter/operations/getgeneration.py +++ b/src/openrouter/operations/getgeneration.py @@ -21,10 +21,14 @@ class GetGenerationGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class GetGenerationGlobals(BaseModel): @@ -38,15 +42,24 @@ class GetGenerationGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class GetGenerationRequestTypedDict(TypedDict): id: str @@ -55,10 +68,14 @@ class GetGenerationRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class GetGenerationRequest(BaseModel): @@ -76,15 +93,24 @@ class GetGenerationRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + APIType = Union[ Literal[ @@ -126,6 +152,7 @@ class GetGenerationRequest(BaseModel): "Together 2", "Ubicloud", "01.AI", + "AkashML", "AI21", "AionLabs", "Alibaba", @@ -341,6 +368,10 @@ class GetGenerationDataTypedDict(TypedDict): r"""Router used for the request (e.g., openrouter/auto)""" provider_responses: Nullable[List[ProviderResponseTypedDict]] r"""List of provider responses for this generation, including fallback attempts""" + user_agent: Nullable[str] + r"""User-Agent header from the request""" + http_referer: Nullable[str] + r"""Referer header from the request""" class GetGenerationData(BaseModel): @@ -448,6 +479,12 @@ class GetGenerationData(BaseModel): provider_responses: Nullable[List[ProviderResponse]] r"""List of provider responses for this generation, including fallback attempts""" + user_agent: Nullable[str] + r"""User-Agent header from the request""" + + http_referer: Nullable[str] + r"""Referer header from the request""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = [] @@ -479,6 +516,8 @@ def serialize_model(self, handler): "api_type", "router", "provider_responses", + "user_agent", + "http_referer", ] null_default_fields = [] diff --git a/src/openrouter/operations/getguardrail.py b/src/openrouter/operations/getguardrail.py index 8d185cc..f8f5d38 100644 --- a/src/openrouter/operations/getguardrail.py +++ b/src/openrouter/operations/getguardrail.py @@ -28,10 +28,14 @@ class GetGuardrailGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class GetGuardrailGlobals(BaseModel): @@ -45,15 +49,24 @@ class GetGuardrailGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class GetGuardrailRequestTypedDict(TypedDict): id: str @@ -63,10 +76,14 @@ class GetGuardrailRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class GetGuardrailRequest(BaseModel): @@ -85,15 +102,24 @@ class GetGuardrailRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + GetGuardrailResetInterval = Union[ Literal[ @@ -123,6 +149,8 @@ class GetGuardrailDataTypedDict(TypedDict): r"""Interval at which the limit resets (daily, weekly, monthly)""" allowed_providers: NotRequired[Nullable[List[str]]] r"""List of allowed provider IDs""" + ignored_providers: NotRequired[Nullable[List[str]]] + r"""List of provider IDs to exclude from routing""" allowed_models: NotRequired[Nullable[List[str]]] r"""Array of model canonical_slugs (immutable identifiers)""" enforce_zdr: NotRequired[Nullable[bool]] @@ -158,6 +186,9 @@ class GetGuardrailData(BaseModel): allowed_providers: OptionalNullable[List[str]] = UNSET r"""List of allowed provider IDs""" + ignored_providers: OptionalNullable[List[str]] = UNSET + r"""List of provider IDs to exclude from routing""" + allowed_models: OptionalNullable[List[str]] = UNSET r"""Array of model canonical_slugs (immutable identifiers)""" @@ -174,6 +205,7 @@ def serialize_model(self, handler): "limit_usd", "reset_interval", "allowed_providers", + "ignored_providers", "allowed_models", "enforce_zdr", "updated_at", @@ -183,6 +215,7 @@ def serialize_model(self, handler): "limit_usd", "reset_interval", "allowed_providers", + "ignored_providers", "allowed_models", "enforce_zdr", "updated_at", diff --git a/src/openrouter/operations/getkey.py b/src/openrouter/operations/getkey.py index af7317e..127716e 100644 --- a/src/openrouter/operations/getkey.py +++ b/src/openrouter/operations/getkey.py @@ -22,10 +22,14 @@ class GetKeyGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class GetKeyGlobals(BaseModel): @@ -39,15 +43,24 @@ class GetKeyGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class GetKeyRequestTypedDict(TypedDict): hash: str @@ -57,10 +70,14 @@ class GetKeyRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class GetKeyRequest(BaseModel): @@ -79,15 +96,24 @@ class GetKeyRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class GetKeyDataTypedDict(TypedDict): r"""The API key information""" diff --git a/src/openrouter/operations/getmodels.py b/src/openrouter/operations/getmodels.py index 6a9cc9e..472068d 100644 --- a/src/openrouter/operations/getmodels.py +++ b/src/openrouter/operations/getmodels.py @@ -20,10 +20,14 @@ class GetModelsGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class GetModelsGlobals(BaseModel): @@ -37,15 +41,24 @@ class GetModelsGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + Category = Union[ Literal[ @@ -73,13 +86,19 @@ class GetModelsRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + """ category: NotRequired[Category] r"""Filter models by use case category""" supported_parameters: NotRequired[str] + output_modalities: NotRequired[str] + r"""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\".""" class GetModelsRequest(BaseModel): @@ -93,15 +112,24 @@ class GetModelsRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + category: Annotated[ Annotated[Optional[Category], PlainValidator(validate_open_enum(False))], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), @@ -112,3 +140,9 @@ class GetModelsRequest(BaseModel): Optional[str], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None + + output_modalities: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""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\".""" diff --git a/src/openrouter/operations/getuseractivity.py b/src/openrouter/operations/getuseractivity.py index fef1ba4..9dacdcd 100644 --- a/src/openrouter/operations/getuseractivity.py +++ b/src/openrouter/operations/getuseractivity.py @@ -15,10 +15,14 @@ class GetUserActivityGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class GetUserActivityGlobals(BaseModel): @@ -32,15 +36,24 @@ class GetUserActivityGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class GetUserActivityRequestTypedDict(TypedDict): http_referer: NotRequired[str] @@ -48,9 +61,13 @@ class GetUserActivityRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + """ date_: NotRequired[str] r"""Filter by a single UTC date in the last 30 days (YYYY-MM-DD format).""" @@ -67,15 +84,24 @@ class GetUserActivityRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + date_: Annotated[ Optional[str], pydantic.Field(alias="date"), diff --git a/src/openrouter/operations/list.py b/src/openrouter/operations/list.py index 63ecc47..1cb60f4 100644 --- a/src/openrouter/operations/list.py +++ b/src/openrouter/operations/list.py @@ -22,10 +22,14 @@ class ListGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class ListGlobals(BaseModel): @@ -39,15 +43,24 @@ class ListGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class ListRequestTypedDict(TypedDict): http_referer: NotRequired[str] @@ -55,9 +68,13 @@ class ListRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + """ include_disabled: NotRequired[str] r"""Whether to include disabled API keys in the response""" @@ -76,15 +93,24 @@ class ListRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + include_disabled: Annotated[ Optional[str], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), diff --git a/src/openrouter/operations/listembeddingsmodels.py b/src/openrouter/operations/listembeddingsmodels.py index fc32d4d..a4042ee 100644 --- a/src/openrouter/operations/listembeddingsmodels.py +++ b/src/openrouter/operations/listembeddingsmodels.py @@ -14,10 +14,14 @@ class ListEmbeddingsModelsGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class ListEmbeddingsModelsGlobals(BaseModel): @@ -31,15 +35,24 @@ class ListEmbeddingsModelsGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class ListEmbeddingsModelsRequestTypedDict(TypedDict): http_referer: NotRequired[str] @@ -47,10 +60,14 @@ class ListEmbeddingsModelsRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class ListEmbeddingsModelsRequest(BaseModel): @@ -64,11 +81,20 @@ class ListEmbeddingsModelsRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ diff --git a/src/openrouter/operations/listendpoints.py b/src/openrouter/operations/listendpoints.py index 3e20e63..4470cd2 100644 --- a/src/openrouter/operations/listendpoints.py +++ b/src/openrouter/operations/listendpoints.py @@ -17,10 +17,14 @@ class ListEndpointsGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class ListEndpointsGlobals(BaseModel): @@ -34,15 +38,24 @@ class ListEndpointsGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class ListEndpointsRequestTypedDict(TypedDict): author: str @@ -52,10 +65,14 @@ class ListEndpointsRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class ListEndpointsRequest(BaseModel): @@ -77,15 +94,24 @@ class ListEndpointsRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class ListEndpointsResponseTypedDict(TypedDict): r"""Returns a list of endpoints""" diff --git a/src/openrouter/operations/listendpointszdr.py b/src/openrouter/operations/listendpointszdr.py index 6814c5e..23e735d 100644 --- a/src/openrouter/operations/listendpointszdr.py +++ b/src/openrouter/operations/listendpointszdr.py @@ -15,10 +15,14 @@ class ListEndpointsZdrGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class ListEndpointsZdrGlobals(BaseModel): @@ -32,15 +36,24 @@ class ListEndpointsZdrGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class ListEndpointsZdrRequestTypedDict(TypedDict): http_referer: NotRequired[str] @@ -48,10 +61,14 @@ class ListEndpointsZdrRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class ListEndpointsZdrRequest(BaseModel): @@ -65,15 +82,24 @@ class ListEndpointsZdrRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class ListEndpointsZdrResponseTypedDict(TypedDict): r"""Returns a list of endpoints""" diff --git a/src/openrouter/operations/listguardrailkeyassignments.py b/src/openrouter/operations/listguardrailkeyassignments.py index d90770f..28a84b6 100644 --- a/src/openrouter/operations/listguardrailkeyassignments.py +++ b/src/openrouter/operations/listguardrailkeyassignments.py @@ -20,10 +20,14 @@ class ListGuardrailKeyAssignmentsGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class ListGuardrailKeyAssignmentsGlobals(BaseModel): @@ -37,15 +41,24 @@ class ListGuardrailKeyAssignmentsGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class ListGuardrailKeyAssignmentsRequestTypedDict(TypedDict): id: str @@ -55,9 +68,13 @@ class ListGuardrailKeyAssignmentsRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + """ offset: NotRequired[str] r"""Number of records to skip for pagination""" @@ -81,15 +98,24 @@ class ListGuardrailKeyAssignmentsRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + offset: Annotated[ Optional[str], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), diff --git a/src/openrouter/operations/listguardrailmemberassignments.py b/src/openrouter/operations/listguardrailmemberassignments.py index 45b6c42..88cb8d0 100644 --- a/src/openrouter/operations/listguardrailmemberassignments.py +++ b/src/openrouter/operations/listguardrailmemberassignments.py @@ -20,10 +20,14 @@ class ListGuardrailMemberAssignmentsGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class ListGuardrailMemberAssignmentsGlobals(BaseModel): @@ -37,15 +41,24 @@ class ListGuardrailMemberAssignmentsGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class ListGuardrailMemberAssignmentsRequestTypedDict(TypedDict): id: str @@ -55,9 +68,13 @@ class ListGuardrailMemberAssignmentsRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + """ offset: NotRequired[str] r"""Number of records to skip for pagination""" @@ -81,15 +98,24 @@ class ListGuardrailMemberAssignmentsRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + offset: Annotated[ Optional[str], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), diff --git a/src/openrouter/operations/listguardrails.py b/src/openrouter/operations/listguardrails.py index 89f34ae..d6c1886 100644 --- a/src/openrouter/operations/listguardrails.py +++ b/src/openrouter/operations/listguardrails.py @@ -28,10 +28,14 @@ class ListGuardrailsGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class ListGuardrailsGlobals(BaseModel): @@ -45,15 +49,24 @@ class ListGuardrailsGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class ListGuardrailsRequestTypedDict(TypedDict): http_referer: NotRequired[str] @@ -61,9 +74,13 @@ class ListGuardrailsRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + """ offset: NotRequired[str] r"""Number of records to skip for pagination""" @@ -82,15 +99,24 @@ class ListGuardrailsRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + offset: Annotated[ Optional[str], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), @@ -130,6 +156,8 @@ class ListGuardrailsDataTypedDict(TypedDict): r"""Interval at which the limit resets (daily, weekly, monthly)""" allowed_providers: NotRequired[Nullable[List[str]]] r"""List of allowed provider IDs""" + ignored_providers: NotRequired[Nullable[List[str]]] + r"""List of provider IDs to exclude from routing""" allowed_models: NotRequired[Nullable[List[str]]] r"""Array of model canonical_slugs (immutable identifiers)""" enforce_zdr: NotRequired[Nullable[bool]] @@ -163,6 +191,9 @@ class ListGuardrailsData(BaseModel): allowed_providers: OptionalNullable[List[str]] = UNSET r"""List of allowed provider IDs""" + ignored_providers: OptionalNullable[List[str]] = UNSET + r"""List of provider IDs to exclude from routing""" + allowed_models: OptionalNullable[List[str]] = UNSET r"""Array of model canonical_slugs (immutable identifiers)""" @@ -179,6 +210,7 @@ def serialize_model(self, handler): "limit_usd", "reset_interval", "allowed_providers", + "ignored_providers", "allowed_models", "enforce_zdr", "updated_at", @@ -188,6 +220,7 @@ def serialize_model(self, handler): "limit_usd", "reset_interval", "allowed_providers", + "ignored_providers", "allowed_models", "enforce_zdr", "updated_at", diff --git a/src/openrouter/operations/listkeyassignments.py b/src/openrouter/operations/listkeyassignments.py index 870d9de..36df9a6 100644 --- a/src/openrouter/operations/listkeyassignments.py +++ b/src/openrouter/operations/listkeyassignments.py @@ -15,10 +15,14 @@ class ListKeyAssignmentsGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class ListKeyAssignmentsGlobals(BaseModel): @@ -32,15 +36,24 @@ class ListKeyAssignmentsGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class ListKeyAssignmentsRequestTypedDict(TypedDict): http_referer: NotRequired[str] @@ -48,9 +61,13 @@ class ListKeyAssignmentsRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + """ offset: NotRequired[str] r"""Number of records to skip for pagination""" @@ -69,15 +86,24 @@ class ListKeyAssignmentsRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + offset: Annotated[ Optional[str], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), diff --git a/src/openrouter/operations/listmemberassignments.py b/src/openrouter/operations/listmemberassignments.py index c6ae44e..a6684dd 100644 --- a/src/openrouter/operations/listmemberassignments.py +++ b/src/openrouter/operations/listmemberassignments.py @@ -15,10 +15,14 @@ class ListMemberAssignmentsGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class ListMemberAssignmentsGlobals(BaseModel): @@ -32,15 +36,24 @@ class ListMemberAssignmentsGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class ListMemberAssignmentsRequestTypedDict(TypedDict): http_referer: NotRequired[str] @@ -48,9 +61,13 @@ class ListMemberAssignmentsRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. + """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + """ offset: NotRequired[str] r"""Number of records to skip for pagination""" @@ -69,15 +86,24 @@ class ListMemberAssignmentsRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + offset: Annotated[ Optional[str], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), diff --git a/src/openrouter/operations/listmodelscount.py b/src/openrouter/operations/listmodelscount.py index 77b8ead..3d8a59a 100644 --- a/src/openrouter/operations/listmodelscount.py +++ b/src/openrouter/operations/listmodelscount.py @@ -2,7 +2,7 @@ from __future__ import annotations from openrouter.types import BaseModel -from openrouter.utils import FieldMetadata, HeaderMetadata +from openrouter.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from typing import Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -14,10 +14,14 @@ class ListModelsCountGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class ListModelsCountGlobals(BaseModel): @@ -31,15 +35,24 @@ class ListModelsCountGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class ListModelsCountRequestTypedDict(TypedDict): http_referer: NotRequired[str] @@ -47,10 +60,16 @@ class ListModelsCountRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + output_modalities: NotRequired[str] + r"""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\".""" class ListModelsCountRequest(BaseModel): @@ -64,11 +83,26 @@ class ListModelsCountRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + + output_modalities: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""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\".""" diff --git a/src/openrouter/operations/listmodelsuser.py b/src/openrouter/operations/listmodelsuser.py index 8f3668f..d25eea8 100644 --- a/src/openrouter/operations/listmodelsuser.py +++ b/src/openrouter/operations/listmodelsuser.py @@ -14,10 +14,14 @@ class ListModelsUserGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class ListModelsUserGlobals(BaseModel): @@ -31,15 +35,24 @@ class ListModelsUserGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class ListModelsUserSecurityTypedDict(TypedDict): bearer: str @@ -65,10 +78,14 @@ class ListModelsUserRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class ListModelsUserRequest(BaseModel): @@ -82,11 +99,20 @@ class ListModelsUserRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ diff --git a/src/openrouter/operations/listproviders.py b/src/openrouter/operations/listproviders.py index 2f905fd..fc35388 100644 --- a/src/openrouter/operations/listproviders.py +++ b/src/openrouter/operations/listproviders.py @@ -21,10 +21,14 @@ class ListProvidersGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class ListProvidersGlobals(BaseModel): @@ -38,15 +42,24 @@ class ListProvidersGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class ListProvidersRequestTypedDict(TypedDict): http_referer: NotRequired[str] @@ -54,10 +67,14 @@ class ListProvidersRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class ListProvidersRequest(BaseModel): @@ -71,15 +88,24 @@ class ListProvidersRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class ListProvidersDataTypedDict(TypedDict): name: str diff --git a/src/openrouter/operations/sendchatcompletionrequest.py b/src/openrouter/operations/sendchatcompletionrequest.py index bb23c22..ddd922f 100644 --- a/src/openrouter/operations/sendchatcompletionrequest.py +++ b/src/openrouter/operations/sendchatcompletionrequest.py @@ -24,10 +24,14 @@ class SendChatCompletionRequestGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class SendChatCompletionRequestGlobals(BaseModel): @@ -41,15 +45,24 @@ class SendChatCompletionRequestGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class SendChatCompletionRequestRequestTypedDict(TypedDict): chat_generation_params: ( @@ -60,10 +73,14 @@ class SendChatCompletionRequestRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class SendChatCompletionRequestRequest(BaseModel): @@ -82,15 +99,24 @@ class SendChatCompletionRequestRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class SendChatCompletionRequestResponseBodyTypedDict(TypedDict): r"""Successful chat completion response""" diff --git a/src/openrouter/operations/updateguardrail.py b/src/openrouter/operations/updateguardrail.py index 061dc40..77946e4 100644 --- a/src/openrouter/operations/updateguardrail.py +++ b/src/openrouter/operations/updateguardrail.py @@ -29,10 +29,14 @@ class UpdateGuardrailGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class UpdateGuardrailGlobals(BaseModel): @@ -46,15 +50,24 @@ class UpdateGuardrailGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + UpdateGuardrailResetIntervalRequest = Union[ Literal[ @@ -78,6 +91,8 @@ class UpdateGuardrailRequestBodyTypedDict(TypedDict): r"""Interval at which the limit resets (daily, weekly, monthly)""" allowed_providers: NotRequired[Nullable[List[str]]] r"""New list of allowed provider IDs""" + ignored_providers: NotRequired[Nullable[List[str]]] + r"""List of provider IDs to exclude from routing""" allowed_models: NotRequired[Nullable[List[str]]] r"""Array of model identifiers (slug or canonical_slug accepted)""" enforce_zdr: NotRequired[Nullable[bool]] @@ -103,6 +118,9 @@ class UpdateGuardrailRequestBody(BaseModel): allowed_providers: OptionalNullable[List[str]] = UNSET r"""New list of allowed provider IDs""" + ignored_providers: OptionalNullable[List[str]] = UNSET + r"""List of provider IDs to exclude from routing""" + allowed_models: OptionalNullable[List[str]] = UNSET r"""Array of model identifiers (slug or canonical_slug accepted)""" @@ -117,6 +135,7 @@ def serialize_model(self, handler): "limit_usd", "reset_interval", "allowed_providers", + "ignored_providers", "allowed_models", "enforce_zdr", ] @@ -125,6 +144,7 @@ def serialize_model(self, handler): "limit_usd", "reset_interval", "allowed_providers", + "ignored_providers", "allowed_models", "enforce_zdr", ] @@ -164,10 +184,14 @@ class UpdateGuardrailRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class UpdateGuardrailRequest(BaseModel): @@ -191,15 +215,24 @@ class UpdateGuardrailRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + UpdateGuardrailResetIntervalResponse = Union[ Literal[ @@ -229,6 +262,8 @@ class UpdateGuardrailDataTypedDict(TypedDict): r"""Interval at which the limit resets (daily, weekly, monthly)""" allowed_providers: NotRequired[Nullable[List[str]]] r"""List of allowed provider IDs""" + ignored_providers: NotRequired[Nullable[List[str]]] + r"""List of provider IDs to exclude from routing""" allowed_models: NotRequired[Nullable[List[str]]] r"""Array of model canonical_slugs (immutable identifiers)""" enforce_zdr: NotRequired[Nullable[bool]] @@ -264,6 +299,9 @@ class UpdateGuardrailData(BaseModel): allowed_providers: OptionalNullable[List[str]] = UNSET r"""List of allowed provider IDs""" + ignored_providers: OptionalNullable[List[str]] = UNSET + r"""List of provider IDs to exclude from routing""" + allowed_models: OptionalNullable[List[str]] = UNSET r"""Array of model canonical_slugs (immutable identifiers)""" @@ -280,6 +318,7 @@ def serialize_model(self, handler): "limit_usd", "reset_interval", "allowed_providers", + "ignored_providers", "allowed_models", "enforce_zdr", "updated_at", @@ -289,6 +328,7 @@ def serialize_model(self, handler): "limit_usd", "reset_interval", "allowed_providers", + "ignored_providers", "allowed_models", "enforce_zdr", "updated_at", diff --git a/src/openrouter/operations/updatekeys.py b/src/openrouter/operations/updatekeys.py index 740bf48..068686b 100644 --- a/src/openrouter/operations/updatekeys.py +++ b/src/openrouter/operations/updatekeys.py @@ -30,10 +30,14 @@ class UpdateKeysGlobalsTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class UpdateKeysGlobals(BaseModel): @@ -47,15 +51,24 @@ class UpdateKeysGlobals(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + UpdateKeysLimitReset = Union[ Literal[ @@ -146,10 +159,14 @@ class UpdateKeysRequestTypedDict(TypedDict): This is used to track API usage per application. """ - x_title: NotRequired[str] + x_open_router_title: NotRequired[str] r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: NotRequired[str] + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ class UpdateKeysRequest(BaseModel): @@ -173,15 +190,24 @@ class UpdateKeysRequest(BaseModel): """ - x_title: Annotated[ + x_open_router_title: Annotated[ Optional[str], - pydantic.Field(alias="X-Title"), + pydantic.Field(alias="X-OpenRouter-Title"), FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), ] = None r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. """ + x_open_router_categories: Annotated[ + Optional[str], + pydantic.Field(alias="X-OpenRouter-Categories"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. + + """ + class UpdateKeysDataTypedDict(TypedDict): r"""The updated API key information""" diff --git a/src/openrouter/providers.py b/src/openrouter/providers.py index 228f618..31e1e3a 100644 --- a/src/openrouter/providers.py +++ b/src/openrouter/providers.py @@ -16,7 +16,8 @@ def list( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -27,7 +28,9 @@ def list( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -46,7 +49,8 @@ def list( request = operations.ListProvidersRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, ) req = self._build_request( @@ -63,7 +67,8 @@ def list( http_headers=http_headers, _globals=operations.ListProvidersGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, @@ -118,7 +123,8 @@ async def list_async( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -129,7 +135,9 @@ async def list_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -148,7 +156,8 @@ async def list_async( request = operations.ListProvidersRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, ) req = self._build_request_async( @@ -165,7 +174,8 @@ async def list_async( http_headers=http_headers, _globals=operations.ListProvidersGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, allow_empty_value=None, diff --git a/src/openrouter/responses.py b/src/openrouter/responses.py index d3382e7..b070787 100644 --- a/src/openrouter/responses.py +++ b/src/openrouter/responses.py @@ -23,9 +23,13 @@ def send( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, input: Optional[ - Union[components.OpenResponsesInput, components.OpenResponsesInputTypedDict] + Union[ + components.OpenResponsesInputUnion, + components.OpenResponsesInputUnionTypedDict, + ] ] = None, instructions: OptionalNullable[str] = UNSET, metadata: OptionalNullable[Dict[str, str]] = UNSET, @@ -117,7 +121,9 @@ def send( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param input: Input for a response request - can be a string or array of items :param instructions: @@ -165,9 +171,13 @@ def send( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, input: Optional[ - Union[components.OpenResponsesInput, components.OpenResponsesInputTypedDict] + Union[ + components.OpenResponsesInputUnion, + components.OpenResponsesInputUnionTypedDict, + ] ] = None, instructions: OptionalNullable[str] = UNSET, metadata: OptionalNullable[Dict[str, str]] = UNSET, @@ -259,7 +269,9 @@ def send( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param input: Input for a response request - can be a string or array of items :param instructions: @@ -306,9 +318,13 @@ def send( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, input: Optional[ - Union[components.OpenResponsesInput, components.OpenResponsesInputTypedDict] + Union[ + components.OpenResponsesInputUnion, + components.OpenResponsesInputUnionTypedDict, + ] ] = None, instructions: OptionalNullable[str] = UNSET, metadata: OptionalNullable[Dict[str, str]] = UNSET, @@ -400,7 +416,9 @@ def send( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param input: Input for a response request - can be a string or array of items :param instructions: @@ -454,10 +472,11 @@ def send( request = operations.CreateResponsesRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, open_responses_request=components.OpenResponsesRequest( input=utils.get_pydantic_model( - input, Optional[components.OpenResponsesInput] + input, Optional[components.OpenResponsesInputUnion] ), instructions=instructions, metadata=metadata, @@ -525,7 +544,8 @@ def send( http_headers=http_headers, _globals=operations.CreateResponsesGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( @@ -713,9 +733,13 @@ async def send_async( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, input: Optional[ - Union[components.OpenResponsesInput, components.OpenResponsesInputTypedDict] + Union[ + components.OpenResponsesInputUnion, + components.OpenResponsesInputUnionTypedDict, + ] ] = None, instructions: OptionalNullable[str] = UNSET, metadata: OptionalNullable[Dict[str, str]] = UNSET, @@ -807,7 +831,9 @@ async def send_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param input: Input for a response request - can be a string or array of items :param instructions: @@ -855,9 +881,13 @@ async def send_async( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, input: Optional[ - Union[components.OpenResponsesInput, components.OpenResponsesInputTypedDict] + Union[ + components.OpenResponsesInputUnion, + components.OpenResponsesInputUnionTypedDict, + ] ] = None, instructions: OptionalNullable[str] = UNSET, metadata: OptionalNullable[Dict[str, str]] = UNSET, @@ -949,7 +979,9 @@ async def send_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param input: Input for a response request - can be a string or array of items :param instructions: @@ -996,9 +1028,13 @@ async def send_async( self, *, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, input: Optional[ - Union[components.OpenResponsesInput, components.OpenResponsesInputTypedDict] + Union[ + components.OpenResponsesInputUnion, + components.OpenResponsesInputUnionTypedDict, + ] ] = None, instructions: OptionalNullable[str] = UNSET, metadata: OptionalNullable[Dict[str, str]] = UNSET, @@ -1090,7 +1126,9 @@ async def send_async( :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. This is used to track API usage per application. - :param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. + + :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param input: Input for a response request - can be a string or array of items :param instructions: @@ -1144,10 +1182,11 @@ async def send_async( request = operations.CreateResponsesRequest( http_referer=http_referer, - x_title=x_title, + x_open_router_title=x_open_router_title, + x_open_router_categories=x_open_router_categories, open_responses_request=components.OpenResponsesRequest( input=utils.get_pydantic_model( - input, Optional[components.OpenResponsesInput] + input, Optional[components.OpenResponsesInputUnion] ), instructions=instructions, metadata=metadata, @@ -1215,7 +1254,8 @@ async def send_async( http_headers=http_headers, _globals=operations.CreateResponsesGlobals( http_referer=self.sdk_configuration.globals.http_referer, - x_title=self.sdk_configuration.globals.x_title, + x_open_router_title=self.sdk_configuration.globals.x_open_router_title, + x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, ), security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( diff --git a/src/openrouter/sdk.py b/src/openrouter/sdk.py index 84ff3ef..5796a31 100644 --- a/src/openrouter/sdk.py +++ b/src/openrouter/sdk.py @@ -76,7 +76,8 @@ def __init__( self, api_key: Optional[Union[Optional[str], Callable[[], Optional[str]]]] = None, http_referer: Optional[str] = None, - x_title: Optional[str] = None, + x_open_router_title: Optional[str] = None, + x_open_router_categories: Optional[str] = None, server: Optional[str] = None, server_url: Optional[str] = None, url_params: Optional[Dict[str, str]] = None, @@ -90,7 +91,8 @@ def __init__( :param api_key: The api_key required for authentication :param http_referer: Configures the http_referer parameter for all supported operations - :param x_title: Configures the x_title parameter for all supported operations + :param x_open_router_title: Configures the x_open_router_title parameter for all supported operations + :param x_open_router_categories: Configures the x_open_router_categories parameter for all supported operations :param server: The server by name to use for all methods :param server_url: The server URL to use for all methods :param url_params: Parameters to optionally template the server URL with @@ -135,7 +137,12 @@ def __init__( http_referer=utils.get_global_from_env( http_referer, "OPENROUTER_HTTP_REFERER", str ), - x_title=utils.get_global_from_env(x_title, "OPENROUTER_X_TITLE", str), + x_open_router_title=utils.get_global_from_env( + x_open_router_title, "OPENROUTER_X_OPEN_ROUTER_TITLE", str + ), + x_open_router_categories=utils.get_global_from_env( + x_open_router_categories, "OPENROUTER_X_OPEN_ROUTER_CATEGORIES", str + ), ) BaseSDK.__init__( diff --git a/uv.lock b/uv.lock index 65058fe..77d7504 100644 --- a/uv.lock +++ b/uv.lock @@ -211,7 +211,7 @@ wheels = [ [[package]] name = "openrouter" -version = "0.7.11" +version = "0.9.0" source = { editable = "." } dependencies = [ { name = "httpcore" },