mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-31 12:30:30 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7d69e3763 | ||
|
|
b2098ff28e | ||
|
|
1cad51abb6 |
+186
-87
@@ -1,12 +1,12 @@
|
||||
lockVersion: 2.0.0
|
||||
id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d
|
||||
management:
|
||||
docChecksum: 7136b263714e485a5a96ee056b6e3f36
|
||||
docChecksum: 964d64d091f299f9571920aef96087db
|
||||
docVersion: 1.0.0
|
||||
speakeasyVersion: 1.666.0
|
||||
generationVersion: 2.768.0
|
||||
releaseVersion: 0.1.3
|
||||
configChecksum: d03f8606816d7028a10e566c4ff2ac44
|
||||
releaseVersion: 0.7.9
|
||||
configChecksum: 5ccea59f057d7c14ca469fae260f6c47
|
||||
repoURL: https://github.com/OpenRouterTeam/python-sdk.git
|
||||
installationURL: https://github.com/OpenRouterTeam/python-sdk.git
|
||||
published: true
|
||||
@@ -14,6 +14,7 @@ features:
|
||||
python:
|
||||
acceptHeaders: 3.0.0
|
||||
additionalDependencies: 1.0.0
|
||||
additionalProperties: 1.0.1
|
||||
constsAndDefaults: 1.0.5
|
||||
core: 5.23.13
|
||||
defaultEnabledRetries: 0.2.0
|
||||
@@ -53,94 +54,97 @@ generatedFiles:
|
||||
- docs/components/architecture.md
|
||||
- docs/components/assistantmessage.md
|
||||
- docs/components/assistantmessagecontent.md
|
||||
- docs/components/assistantmessageimageurl.md
|
||||
- docs/components/assistantmessageimages.md
|
||||
- docs/components/assistantmessageimagesimageurl.md
|
||||
- docs/components/assistantmessagerole.md
|
||||
- docs/components/badgatewayresponseerrordata.md
|
||||
- docs/components/badrequestresponseerrordata.md
|
||||
- docs/components/by.md
|
||||
- docs/components/chainid.md
|
||||
- docs/components/chatcompletionfinishreason.md
|
||||
- docs/components/chaterrorerror.md
|
||||
- docs/components/chatgenerationparams.md
|
||||
- docs/components/chatgenerationparamsdatacollection.md
|
||||
- docs/components/chatgenerationparamsby.md
|
||||
- docs/components/chatgenerationparamsidautorouter.md
|
||||
- docs/components/chatgenerationparamsidfileparser.md
|
||||
- docs/components/chatgenerationparamsidmoderation.md
|
||||
- docs/components/chatgenerationparamsidresponsehealing.md
|
||||
- docs/components/chatgenerationparamsidweb.md
|
||||
- docs/components/chatgenerationparamsignore.md
|
||||
- docs/components/chatgenerationparamsimageconfig.md
|
||||
- docs/components/chatgenerationparamsmaxprice.md
|
||||
- docs/components/chatgenerationparamsonly.md
|
||||
- docs/components/chatgenerationparamsorder.md
|
||||
- docs/components/chatgenerationparamspartition.md
|
||||
- docs/components/chatgenerationparamspluginautorouter.md
|
||||
- docs/components/chatgenerationparamspluginfileparser.md
|
||||
- docs/components/chatgenerationparamspluginmoderation.md
|
||||
- docs/components/chatgenerationparamspluginresponsehealing.md
|
||||
- docs/components/chatgenerationparamspluginunion.md
|
||||
- docs/components/chatgenerationparamspluginweb.md
|
||||
- docs/components/chatgenerationparamspreferredmaxlatency.md
|
||||
- docs/components/chatgenerationparamspreferredmaxlatencyunion.md
|
||||
- docs/components/chatgenerationparamspreferredminthroughput.md
|
||||
- docs/components/chatgenerationparamspreferredminthroughputunion.md
|
||||
- docs/components/chatgenerationparamsprovider.md
|
||||
- docs/components/chatgenerationparamsresponseformatjsonobject.md
|
||||
- docs/components/chatgenerationparamsresponseformatpython.md
|
||||
- docs/components/chatgenerationparamsresponseformattext.md
|
||||
- docs/components/chatgenerationparamsresponseformatunion.md
|
||||
- docs/components/chatgenerationparamsstop.md
|
||||
- docs/components/chatgenerationparamsprovidersort.md
|
||||
- docs/components/chatgenerationparamsprovidersortconfig.md
|
||||
- docs/components/chatgenerationparamsprovidersortconfigenum.md
|
||||
- docs/components/chatgenerationparamsprovidersortconfigunion.md
|
||||
- docs/components/chatgenerationparamssortenum.md
|
||||
- docs/components/chatgenerationparamssortunion.md
|
||||
- docs/components/chatgenerationparamstrace.md
|
||||
- docs/components/chatgenerationtokenusage.md
|
||||
- docs/components/chatmessagecontentitem.md
|
||||
- docs/components/chatmessagecontentitem1.md
|
||||
- docs/components/chatmessagecontentitemaudio.md
|
||||
- docs/components/chatmessagecontentitemaudioinputaudio.md
|
||||
- docs/components/chatmessagecontentitemaudiotype.md
|
||||
- docs/components/chatmessagecontentitemcachecontrol.md
|
||||
- docs/components/chatmessagecontentitemcachecontroltype.md
|
||||
- docs/components/chatmessagecontentitemimage.md
|
||||
- docs/components/chatmessagecontentitemimagedetail.md
|
||||
- docs/components/chatmessagecontentitemimageimageurl.md
|
||||
- docs/components/chatmessagecontentitemimagetype.md
|
||||
- docs/components/chatmessagecontentitemtext.md
|
||||
- docs/components/chatmessagecontentitemtexttype.md
|
||||
- docs/components/chatmessagecontentitemvideo.md
|
||||
- docs/components/chatmessagecontentitemvideoinputvideo.md
|
||||
- docs/components/chatmessagecontentitemvideovideourl.md
|
||||
- docs/components/chatmessagecontentitemvideolegacy.md
|
||||
- docs/components/chatmessagecontentitemvideolegacytype.md
|
||||
- docs/components/chatmessagecontentitemvideotype.md
|
||||
- docs/components/chatmessagetokenlogprob.md
|
||||
- docs/components/chatmessagetokenlogprobs.md
|
||||
- docs/components/chatmessagetokenlogprobtoplogprob.md
|
||||
- docs/components/chatmessagetoolcall.md
|
||||
- docs/components/chatmessagetoolcallfunction.md
|
||||
- docs/components/chatmessagetoolcalltype.md
|
||||
- docs/components/chatresponse.md
|
||||
- docs/components/chatresponsechoice.md
|
||||
- docs/components/chatresponseobject.md
|
||||
- docs/components/chatstreamingchoice.md
|
||||
- docs/components/chatstreamingmessagechunk.md
|
||||
- docs/components/chatstreamingmessagechunkrole.md
|
||||
- docs/components/chatstreamingmessagetoolcall.md
|
||||
- docs/components/chatstreamingmessagetoolcallfunction.md
|
||||
- docs/components/chatstreamingmessagetoolcalltype.md
|
||||
- docs/components/chatstreamingresponsechunk.md
|
||||
- docs/components/chatstreamingresponsechunkdata.md
|
||||
- docs/components/chatstreamingresponsechunkerror.md
|
||||
- docs/components/chatstreamingresponsechunkobject.md
|
||||
- docs/components/chatstreamoptions.md
|
||||
- docs/components/code.md
|
||||
- docs/components/codeenum.md
|
||||
- docs/components/completionchoice.md
|
||||
- docs/components/completioncreateparams.md
|
||||
- docs/components/completioncreateparamsresponseformatjsonobject.md
|
||||
- docs/components/completioncreateparamsresponseformatpython.md
|
||||
- docs/components/completioncreateparamsresponseformattext.md
|
||||
- docs/components/completioncreateparamsresponseformatunion.md
|
||||
- docs/components/completioncreateparamsstop.md
|
||||
- docs/components/completionfinishreason.md
|
||||
- docs/components/completionlogprobs.md
|
||||
- docs/components/completionresponse.md
|
||||
- docs/components/completiontokensdetails.md
|
||||
- docs/components/completionusage.md
|
||||
- docs/components/costdetails.md
|
||||
- docs/components/createchargerequest.md
|
||||
- docs/components/data.md
|
||||
- docs/components/datacollection.md
|
||||
- docs/components/debug.md
|
||||
- docs/components/debugoptions.md
|
||||
- docs/components/defaultparameters.md
|
||||
- docs/components/developermessage.md
|
||||
- docs/components/developermessagecontent.md
|
||||
- docs/components/developermessagerole.md
|
||||
- docs/components/edgenetworktimeoutresponseerrordata.md
|
||||
- docs/components/effort.md
|
||||
- docs/components/endpointstatus.md
|
||||
- docs/components/engine.md
|
||||
- docs/components/error.md
|
||||
- docs/components/filecitation.md
|
||||
- docs/components/filecitationtype.md
|
||||
- docs/components/filepath.md
|
||||
- docs/components/filepathtype.md
|
||||
- docs/components/forbiddenresponseerrordata.md
|
||||
- docs/components/idautorouter.md
|
||||
- docs/components/idfileparser.md
|
||||
- docs/components/idmoderation.md
|
||||
- docs/components/idresponsehealing.md
|
||||
- docs/components/idweb.md
|
||||
- docs/components/image.md
|
||||
- docs/components/imagegenerationstatus.md
|
||||
- docs/components/inputmodality.md
|
||||
- docs/components/inputtokensdetails.md
|
||||
@@ -150,20 +154,17 @@ generatedFiles:
|
||||
- docs/components/listendpointsresponse.md
|
||||
- docs/components/logprob.md
|
||||
- docs/components/message.md
|
||||
- docs/components/messagecontent.md
|
||||
- docs/components/messagedeveloper.md
|
||||
- docs/components/modality.md
|
||||
- docs/components/model.md
|
||||
- docs/components/modelarchitecture.md
|
||||
- docs/components/modelarchitectureinstructtype.md
|
||||
- docs/components/modelgroup.md
|
||||
- docs/components/modelscountresponse.md
|
||||
- docs/components/modelscountresponsedata.md
|
||||
- docs/components/modelslistresponse.md
|
||||
- docs/components/namedtoolchoice.md
|
||||
- docs/components/namedtoolchoicefunction.md
|
||||
- docs/components/namedtoolchoicetype.md
|
||||
- docs/components/notfoundresponseerrordata.md
|
||||
- docs/components/object.md
|
||||
- docs/components/openairesponsesannotation.md
|
||||
- docs/components/openairesponsesincludable.md
|
||||
- docs/components/openairesponsesincompletedetails.md
|
||||
@@ -246,6 +247,7 @@ generatedFiles:
|
||||
- docs/components/openresponsesinputmessageitemtypemessage.md
|
||||
- docs/components/openresponseslogprobs.md
|
||||
- docs/components/openresponsesnonstreamingresponse.md
|
||||
- docs/components/openresponsesnonstreamingresponseobject.md
|
||||
- docs/components/openresponsesnonstreamingresponsetoolfunction.md
|
||||
- docs/components/openresponsesnonstreamingresponsetoolunion.md
|
||||
- docs/components/openresponsesnonstreamingresponsetype.md
|
||||
@@ -268,6 +270,11 @@ generatedFiles:
|
||||
- docs/components/openresponsesreasoningsummarytextdoneeventtype.md
|
||||
- docs/components/openresponsesreasoningtype.md
|
||||
- docs/components/openresponsesrequest.md
|
||||
- docs/components/openresponsesrequestidautorouter.md
|
||||
- docs/components/openresponsesrequestidfileparser.md
|
||||
- docs/components/openresponsesrequestidmoderation.md
|
||||
- docs/components/openresponsesrequestidresponsehealing.md
|
||||
- docs/components/openresponsesrequestidweb.md
|
||||
- docs/components/openresponsesrequestignore.md
|
||||
- docs/components/openresponsesrequestimageconfig.md
|
||||
- docs/components/openresponsesrequestmaxprice.md
|
||||
@@ -283,6 +290,7 @@ generatedFiles:
|
||||
- docs/components/openresponsesrequestsort.md
|
||||
- docs/components/openresponsesrequesttoolfunction.md
|
||||
- docs/components/openresponsesrequesttoolunion.md
|
||||
- docs/components/openresponsesrequesttrace.md
|
||||
- docs/components/openresponsesrequesttype.md
|
||||
- docs/components/openresponsesresponsetext.md
|
||||
- docs/components/openresponsesresponsetextverbosity.md
|
||||
@@ -334,8 +342,6 @@ generatedFiles:
|
||||
- docs/components/partition.md
|
||||
- docs/components/payloadtoolargeresponseerrordata.md
|
||||
- docs/components/paymentrequiredresponseerrordata.md
|
||||
- docs/components/pdf.md
|
||||
- docs/components/pdfengine.md
|
||||
- docs/components/pdfparserengine.md
|
||||
- docs/components/pdfparseroptions.md
|
||||
- docs/components/percentilelatencycutoffs.md
|
||||
@@ -345,11 +351,11 @@ generatedFiles:
|
||||
- docs/components/preferredmaxlatency.md
|
||||
- docs/components/preferredminthroughput.md
|
||||
- docs/components/pricing.md
|
||||
- docs/components/prompt.md
|
||||
- docs/components/prompttokensdetails.md
|
||||
- docs/components/providername.md
|
||||
- docs/components/provideroverloadedresponseerrordata.md
|
||||
- docs/components/providerpreferences.md
|
||||
- docs/components/providerpreferencesby.md
|
||||
- docs/components/providerpreferencesignore.md
|
||||
- docs/components/providerpreferencesmaxprice.md
|
||||
- docs/components/providerpreferencesonly.md
|
||||
@@ -357,28 +363,46 @@ generatedFiles:
|
||||
- docs/components/providerpreferencespartition.md
|
||||
- docs/components/providerpreferencesprovidersort.md
|
||||
- docs/components/providerpreferencesprovidersortconfig.md
|
||||
- docs/components/providerpreferencesprovidersortconfigenum.md
|
||||
- docs/components/providerpreferencesprovidersortconfigunion.md
|
||||
- docs/components/providerpreferencessortenum.md
|
||||
- docs/components/providerpreferencessortunion.md
|
||||
- docs/components/providersort.md
|
||||
- docs/components/providersortconfig.md
|
||||
- docs/components/providersortconfigenum.md
|
||||
- docs/components/providersortconfigunion.md
|
||||
- docs/components/providersortunion.md
|
||||
- docs/components/publicendpoint.md
|
||||
- docs/components/publicendpointquantization.md
|
||||
- docs/components/publicpricing.md
|
||||
- docs/components/quantization.md
|
||||
- docs/components/quantizations.md
|
||||
- docs/components/reason.md
|
||||
- docs/components/reasoning.md
|
||||
- docs/components/reasoningdetailencrypted.md
|
||||
- docs/components/reasoningdetailencryptedformat.md
|
||||
- docs/components/reasoningdetailencryptedtype.md
|
||||
- docs/components/reasoningdetailsummary.md
|
||||
- docs/components/reasoningdetailsummaryformat.md
|
||||
- docs/components/reasoningdetailsummarytype.md
|
||||
- docs/components/reasoningdetailtext.md
|
||||
- docs/components/reasoningdetailtextformat.md
|
||||
- docs/components/reasoningdetailtexttype.md
|
||||
- docs/components/reasoningdetailunion.md
|
||||
- docs/components/reasoningsummarytext.md
|
||||
- docs/components/reasoningsummarytexttype.md
|
||||
- docs/components/reasoningsummaryverbosity.md
|
||||
- docs/components/reasoningtextcontent.md
|
||||
- docs/components/reasoningtextcontenttype.md
|
||||
- docs/components/requesttimeoutresponseerrordata.md
|
||||
- docs/components/responseformat.md
|
||||
- docs/components/responseformatjsonobject.md
|
||||
- docs/components/responseformatjsonobjecttype.md
|
||||
- docs/components/responseformatjsonschema.md
|
||||
- docs/components/responseformatjsonschematype.md
|
||||
- docs/components/responseformattext.md
|
||||
- docs/components/responseformattextconfig.md
|
||||
- docs/components/responseformattextgrammar.md
|
||||
- docs/components/responseformattextgrammartype.md
|
||||
- docs/components/responseformattextpython.md
|
||||
- docs/components/responseformattextpythontype.md
|
||||
- docs/components/responseformattexttype.md
|
||||
- docs/components/responseinputaudio.md
|
||||
- docs/components/responseinputaudioformat.md
|
||||
- docs/components/responseinputaudioinputaudio.md
|
||||
@@ -396,8 +420,6 @@ generatedFiles:
|
||||
- docs/components/responseoutputtexttoplogprob.md
|
||||
- docs/components/responseoutputtexttype.md
|
||||
- docs/components/responseserrorfield.md
|
||||
- docs/components/responsesformatjsonobject.md
|
||||
- docs/components/responsesformatjsonobjecttype.md
|
||||
- docs/components/responsesformattext.md
|
||||
- docs/components/responsesformattextjsonschemaconfig.md
|
||||
- docs/components/responsesformattextjsonschemaconfigtype.md
|
||||
@@ -436,27 +458,25 @@ generatedFiles:
|
||||
- docs/components/responseswebsearchuserlocationtype.md
|
||||
- docs/components/responsetextconfig.md
|
||||
- docs/components/responsetextconfigverbosity.md
|
||||
- docs/components/route.md
|
||||
- docs/components/schema0.md
|
||||
- docs/components/schema0enum.md
|
||||
- docs/components/schema2.md
|
||||
- docs/components/schema2reasoningencrypted.md
|
||||
- docs/components/schema2reasoningsummary.md
|
||||
- docs/components/schema2reasoningtext.md
|
||||
- docs/components/schema4.md
|
||||
- docs/components/security.md
|
||||
- docs/components/servicetier.md
|
||||
- docs/components/serviceunavailableresponseerrordata.md
|
||||
- docs/components/sortenum.md
|
||||
- docs/components/streamoptions.md
|
||||
- docs/components/stop.md
|
||||
- docs/components/systemmessage.md
|
||||
- docs/components/systemmessagecontent.md
|
||||
- docs/components/systemmessagerole.md
|
||||
- docs/components/tokenizer.md
|
||||
- docs/components/toolcallstatus.md
|
||||
- docs/components/toolchoiceoption.md
|
||||
- docs/components/toolchoiceoptionauto.md
|
||||
- docs/components/toolchoiceoptionnone.md
|
||||
- docs/components/toolchoiceoptionrequired.md
|
||||
- docs/components/tooldefinitionjson.md
|
||||
- docs/components/tooldefinitionjsonfunction.md
|
||||
- docs/components/tooldefinitionjsontype.md
|
||||
- docs/components/toolresponsemessage.md
|
||||
- docs/components/toolresponsemessagecontent.md
|
||||
- docs/components/toolresponsemessagerole.md
|
||||
- docs/components/toomanyrequestsresponseerrordata.md
|
||||
- docs/components/topproviderinfo.md
|
||||
- docs/components/truncation.md
|
||||
@@ -485,16 +505,15 @@ generatedFiles:
|
||||
- docs/components/urlcitationtype.md
|
||||
- docs/components/usermessage.md
|
||||
- docs/components/usermessagecontent.md
|
||||
- docs/components/usermessagerole.md
|
||||
- docs/components/variables.md
|
||||
- docs/components/videourl1.md
|
||||
- docs/components/videourl2.md
|
||||
- docs/components/videoinput.md
|
||||
- docs/components/websearchengine.md
|
||||
- docs/components/websearchpreviewtooluserlocation.md
|
||||
- docs/components/websearchpreviewtooluserlocationtype.md
|
||||
- docs/components/websearchstatus.md
|
||||
- docs/errors/badgatewayresponseerror.md
|
||||
- docs/errors/badrequestresponseerror.md
|
||||
- docs/errors/chaterror.md
|
||||
- docs/errors/edgenetworktimeoutresponseerror.md
|
||||
- docs/errors/forbiddenresponseerror.md
|
||||
- docs/errors/internalserverresponseerror.md
|
||||
@@ -510,15 +529,19 @@ generatedFiles:
|
||||
- docs/models/internal/globals.md
|
||||
- docs/models/utils/retryconfig.md
|
||||
- docs/operations/apitype.md
|
||||
- docs/operations/bulkassignkeystoguardrailglobals.md
|
||||
- docs/operations/bulkassignkeystoguardrailrequest.md
|
||||
- docs/operations/bulkassignkeystoguardrailrequestbody.md
|
||||
- docs/operations/bulkassignkeystoguardrailresponse.md
|
||||
- docs/operations/bulkassignmemberstoguardrailglobals.md
|
||||
- docs/operations/bulkassignmemberstoguardrailrequest.md
|
||||
- docs/operations/bulkassignmemberstoguardrailrequestbody.md
|
||||
- docs/operations/bulkassignmemberstoguardrailresponse.md
|
||||
- docs/operations/bulkunassignkeysfromguardrailglobals.md
|
||||
- docs/operations/bulkunassignkeysfromguardrailrequest.md
|
||||
- docs/operations/bulkunassignkeysfromguardrailrequestbody.md
|
||||
- docs/operations/bulkunassignkeysfromguardrailresponse.md
|
||||
- docs/operations/bulkunassignmembersfromguardrailglobals.md
|
||||
- docs/operations/bulkunassignmembersfromguardrailrequest.md
|
||||
- docs/operations/bulkunassignmembersfromguardrailrequestbody.md
|
||||
- docs/operations/bulkunassignmembersfromguardrailresponse.md
|
||||
@@ -529,105 +552,154 @@ generatedFiles:
|
||||
- docs/operations/contenttext.md
|
||||
- docs/operations/createauthkeyscodecodechallengemethod.md
|
||||
- docs/operations/createauthkeyscodedata.md
|
||||
- docs/operations/createauthkeyscodeglobals.md
|
||||
- docs/operations/createauthkeyscoderequest.md
|
||||
- docs/operations/createauthkeyscoderequestbody.md
|
||||
- docs/operations/createauthkeyscoderesponse.md
|
||||
- docs/operations/createcoinbasechargedata.md
|
||||
- docs/operations/createcoinbasechargeglobals.md
|
||||
- docs/operations/createcoinbasechargerequest.md
|
||||
- docs/operations/createcoinbasechargeresponse.md
|
||||
- docs/operations/createcoinbasechargesecurity.md
|
||||
- docs/operations/createembeddingsdata.md
|
||||
- docs/operations/createembeddingsglobals.md
|
||||
- docs/operations/createembeddingsrequest.md
|
||||
- docs/operations/createembeddingsrequestbody.md
|
||||
- docs/operations/createembeddingsresponse.md
|
||||
- docs/operations/createembeddingsresponsebody.md
|
||||
- docs/operations/createguardraildata.md
|
||||
- docs/operations/createguardrailglobals.md
|
||||
- docs/operations/createguardrailrequest.md
|
||||
- docs/operations/createguardrailrequestbody.md
|
||||
- docs/operations/createguardrailresetintervalrequest.md
|
||||
- docs/operations/createguardrailresetintervalresponse.md
|
||||
- docs/operations/createguardrailresponse.md
|
||||
- docs/operations/createkeysdata.md
|
||||
- docs/operations/createkeysglobals.md
|
||||
- docs/operations/createkeyslimitreset.md
|
||||
- docs/operations/createkeysrequest.md
|
||||
- docs/operations/createkeysrequestbody.md
|
||||
- docs/operations/createkeysresponse.md
|
||||
- docs/operations/createresponsesglobals.md
|
||||
- docs/operations/createresponsesrequest.md
|
||||
- docs/operations/createresponsesresponse.md
|
||||
- docs/operations/createresponsesresponsebody.md
|
||||
- docs/operations/deleteguardrailglobals.md
|
||||
- docs/operations/deleteguardrailrequest.md
|
||||
- docs/operations/deleteguardrailresponse.md
|
||||
- docs/operations/deletekeysglobals.md
|
||||
- docs/operations/deletekeysrequest.md
|
||||
- docs/operations/deletekeysresponse.md
|
||||
- docs/operations/embedding.md
|
||||
- docs/operations/encodingformat.md
|
||||
- docs/operations/exchangeauthcodeforapikeycodechallengemethod.md
|
||||
- docs/operations/exchangeauthcodeforapikeyglobals.md
|
||||
- docs/operations/exchangeauthcodeforapikeyrequest.md
|
||||
- docs/operations/exchangeauthcodeforapikeyrequestbody.md
|
||||
- docs/operations/exchangeauthcodeforapikeyresponse.md
|
||||
- docs/operations/getcreditsdata.md
|
||||
- docs/operations/getcreditsglobals.md
|
||||
- docs/operations/getcreditsrequest.md
|
||||
- docs/operations/getcreditsresponse.md
|
||||
- docs/operations/getcurrentkeydata.md
|
||||
- docs/operations/getcurrentkeyglobals.md
|
||||
- docs/operations/getcurrentkeyrequest.md
|
||||
- docs/operations/getcurrentkeyresponse.md
|
||||
- docs/operations/getgenerationdata.md
|
||||
- docs/operations/getgenerationglobals.md
|
||||
- docs/operations/getgenerationrequest.md
|
||||
- docs/operations/getgenerationresponse.md
|
||||
- docs/operations/getguardraildata.md
|
||||
- docs/operations/getguardrailglobals.md
|
||||
- docs/operations/getguardrailrequest.md
|
||||
- docs/operations/getguardrailresetinterval.md
|
||||
- docs/operations/getguardrailresponse.md
|
||||
- docs/operations/getkeydata.md
|
||||
- docs/operations/getkeyglobals.md
|
||||
- docs/operations/getkeyrequest.md
|
||||
- docs/operations/getkeyresponse.md
|
||||
- docs/operations/getmodelsglobals.md
|
||||
- docs/operations/getmodelsrequest.md
|
||||
- docs/operations/getuseractivityglobals.md
|
||||
- docs/operations/getuseractivityrequest.md
|
||||
- docs/operations/getuseractivityresponse.md
|
||||
- docs/operations/imageurl.md
|
||||
- docs/operations/input.md
|
||||
- docs/operations/inputunion.md
|
||||
- docs/operations/listdata.md
|
||||
- docs/operations/listembeddingsmodelsglobals.md
|
||||
- docs/operations/listembeddingsmodelsrequest.md
|
||||
- docs/operations/listendpointsglobals.md
|
||||
- docs/operations/listendpointsrequest.md
|
||||
- docs/operations/listendpointsresponse.md
|
||||
- docs/operations/listendpointszdrglobals.md
|
||||
- docs/operations/listendpointszdrrequest.md
|
||||
- docs/operations/listendpointszdrresponse.md
|
||||
- docs/operations/listglobals.md
|
||||
- docs/operations/listguardrailkeyassignmentsdata.md
|
||||
- docs/operations/listguardrailkeyassignmentsglobals.md
|
||||
- docs/operations/listguardrailkeyassignmentsrequest.md
|
||||
- docs/operations/listguardrailkeyassignmentsresponse.md
|
||||
- docs/operations/listguardrailmemberassignmentsdata.md
|
||||
- docs/operations/listguardrailmemberassignmentsglobals.md
|
||||
- docs/operations/listguardrailmemberassignmentsrequest.md
|
||||
- docs/operations/listguardrailmemberassignmentsresponse.md
|
||||
- docs/operations/listguardrailsdata.md
|
||||
- docs/operations/listguardrailsglobals.md
|
||||
- docs/operations/listguardrailsrequest.md
|
||||
- docs/operations/listguardrailsresetinterval.md
|
||||
- docs/operations/listguardrailsresponse.md
|
||||
- docs/operations/listkeyassignmentsdata.md
|
||||
- docs/operations/listkeyassignmentsglobals.md
|
||||
- docs/operations/listkeyassignmentsrequest.md
|
||||
- docs/operations/listkeyassignmentsresponse.md
|
||||
- docs/operations/listmemberassignmentsdata.md
|
||||
- docs/operations/listmemberassignmentsglobals.md
|
||||
- docs/operations/listmemberassignmentsrequest.md
|
||||
- docs/operations/listmemberassignmentsresponse.md
|
||||
- docs/operations/listmodelscountglobals.md
|
||||
- docs/operations/listmodelscountrequest.md
|
||||
- docs/operations/listmodelsuserglobals.md
|
||||
- docs/operations/listmodelsuserrequest.md
|
||||
- docs/operations/listmodelsusersecurity.md
|
||||
- docs/operations/listprovidersdata.md
|
||||
- docs/operations/listprovidersglobals.md
|
||||
- docs/operations/listprovidersrequest.md
|
||||
- docs/operations/listprovidersresponse.md
|
||||
- docs/operations/listrequest.md
|
||||
- docs/operations/listresponse.md
|
||||
- docs/operations/metadata.md
|
||||
- docs/operations/object.md
|
||||
- docs/operations/objectembedding.md
|
||||
- docs/operations/providername.md
|
||||
- docs/operations/providerresponse.md
|
||||
- docs/operations/ratelimit.md
|
||||
- docs/operations/sendchatcompletionrequestglobals.md
|
||||
- docs/operations/sendchatcompletionrequestrequest.md
|
||||
- docs/operations/sendchatcompletionrequestresponse.md
|
||||
- docs/operations/sendchatcompletionrequestresponsebody.md
|
||||
- docs/operations/transferintent.md
|
||||
- docs/operations/typeimageurl.md
|
||||
- docs/operations/typetext.md
|
||||
- docs/operations/updateguardraildata.md
|
||||
- docs/operations/updateguardrailglobals.md
|
||||
- docs/operations/updateguardrailrequest.md
|
||||
- docs/operations/updateguardrailrequestbody.md
|
||||
- docs/operations/updateguardrailresetintervalrequest.md
|
||||
- docs/operations/updateguardrailresetintervalresponse.md
|
||||
- docs/operations/updateguardrailresponse.md
|
||||
- docs/operations/updatekeysdata.md
|
||||
- docs/operations/updatekeysglobals.md
|
||||
- docs/operations/updatekeyslimitreset.md
|
||||
- docs/operations/updatekeysrequest.md
|
||||
- docs/operations/updatekeysrequestbody.md
|
||||
- docs/operations/updatekeysresponse.md
|
||||
- docs/operations/usage.md
|
||||
- docs/operations/usagelimittype.md
|
||||
- docs/operations/web3data.md
|
||||
- docs/sdks/analytics/README.md
|
||||
- docs/sdks/apikeys/README.md
|
||||
- docs/sdks/chat/README.md
|
||||
- docs/sdks/completions/README.md
|
||||
- docs/sdks/credits/README.md
|
||||
- docs/sdks/embeddings/README.md
|
||||
- docs/sdks/endpoints/README.md
|
||||
@@ -651,16 +723,13 @@ generatedFiles:
|
||||
- src/openrouter/basesdk.py
|
||||
- src/openrouter/beta.py
|
||||
- src/openrouter/chat.py
|
||||
- src/openrouter/completions.py
|
||||
- src/openrouter/components/__init__.py
|
||||
- src/openrouter/components/_schema0.py
|
||||
- src/openrouter/components/_schema2.py
|
||||
- src/openrouter/components/activityitem.py
|
||||
- src/openrouter/components/assistantmessage.py
|
||||
- src/openrouter/components/assistantmessageimages.py
|
||||
- src/openrouter/components/badgatewayresponseerrordata.py
|
||||
- src/openrouter/components/badrequestresponseerrordata.py
|
||||
- src/openrouter/components/chatcompletionfinishreason.py
|
||||
- src/openrouter/components/chaterror.py
|
||||
- src/openrouter/components/chatgenerationparams.py
|
||||
- src/openrouter/components/chatgenerationtokenusage.py
|
||||
- src/openrouter/components/chatmessagecontentitem.py
|
||||
@@ -669,6 +738,7 @@ generatedFiles:
|
||||
- src/openrouter/components/chatmessagecontentitemimage.py
|
||||
- src/openrouter/components/chatmessagecontentitemtext.py
|
||||
- src/openrouter/components/chatmessagecontentitemvideo.py
|
||||
- src/openrouter/components/chatmessagecontentitemvideolegacy.py
|
||||
- src/openrouter/components/chatmessagetokenlogprob.py
|
||||
- src/openrouter/components/chatmessagetokenlogprobs.py
|
||||
- src/openrouter/components/chatmessagetoolcall.py
|
||||
@@ -679,14 +749,11 @@ generatedFiles:
|
||||
- src/openrouter/components/chatstreamingmessagetoolcall.py
|
||||
- src/openrouter/components/chatstreamingresponsechunk.py
|
||||
- src/openrouter/components/chatstreamoptions.py
|
||||
- src/openrouter/components/completionchoice.py
|
||||
- src/openrouter/components/completioncreateparams.py
|
||||
- src/openrouter/components/completionlogprobs.py
|
||||
- src/openrouter/components/completionresponse.py
|
||||
- src/openrouter/components/completionusage.py
|
||||
- src/openrouter/components/createchargerequest.py
|
||||
- src/openrouter/components/datacollection.py
|
||||
- src/openrouter/components/debugoptions.py
|
||||
- src/openrouter/components/defaultparameters.py
|
||||
- src/openrouter/components/developermessage.py
|
||||
- src/openrouter/components/edgenetworktimeoutresponseerrordata.py
|
||||
- src/openrouter/components/endpointstatus.py
|
||||
- src/openrouter/components/filecitation.py
|
||||
@@ -765,17 +832,23 @@ generatedFiles:
|
||||
- src/openrouter/components/providerpreferences.py
|
||||
- src/openrouter/components/providersort.py
|
||||
- src/openrouter/components/providersortconfig.py
|
||||
- src/openrouter/components/providersortunion.py
|
||||
- src/openrouter/components/publicendpoint.py
|
||||
- src/openrouter/components/publicpricing.py
|
||||
- src/openrouter/components/quantization.py
|
||||
- src/openrouter/components/reasoningdetailencrypted.py
|
||||
- src/openrouter/components/reasoningdetailsummary.py
|
||||
- src/openrouter/components/reasoningdetailtext.py
|
||||
- src/openrouter/components/reasoningdetailunion.py
|
||||
- src/openrouter/components/reasoningsummarytext.py
|
||||
- src/openrouter/components/reasoningsummaryverbosity.py
|
||||
- src/openrouter/components/reasoningtextcontent.py
|
||||
- src/openrouter/components/requesttimeoutresponseerrordata.py
|
||||
- src/openrouter/components/responseformatjsonobject.py
|
||||
- src/openrouter/components/responseformatjsonschema.py
|
||||
- src/openrouter/components/responseformattext.py
|
||||
- src/openrouter/components/responseformattextconfig.py
|
||||
- src/openrouter/components/responseformattextgrammar.py
|
||||
- src/openrouter/components/responseformattextpython.py
|
||||
- src/openrouter/components/responseinputaudio.py
|
||||
- src/openrouter/components/responseinputfile.py
|
||||
- src/openrouter/components/responseinputimage.py
|
||||
@@ -783,7 +856,6 @@ generatedFiles:
|
||||
- src/openrouter/components/responseinputvideo.py
|
||||
- src/openrouter/components/responseoutputtext.py
|
||||
- src/openrouter/components/responseserrorfield.py
|
||||
- src/openrouter/components/responsesformatjsonobject.py
|
||||
- src/openrouter/components/responsesformattext.py
|
||||
- src/openrouter/components/responsesformattextjsonschemaconfig.py
|
||||
- src/openrouter/components/responsesimagegenerationcall.py
|
||||
@@ -801,6 +873,7 @@ generatedFiles:
|
||||
- src/openrouter/components/serviceunavailableresponseerrordata.py
|
||||
- src/openrouter/components/systemmessage.py
|
||||
- src/openrouter/components/toolcallstatus.py
|
||||
- src/openrouter/components/toolchoiceoption.py
|
||||
- src/openrouter/components/tooldefinitionjson.py
|
||||
- src/openrouter/components/toolresponsemessage.py
|
||||
- src/openrouter/components/toomanyrequestsresponseerrordata.py
|
||||
@@ -809,6 +882,7 @@ generatedFiles:
|
||||
- src/openrouter/components/unprocessableentityresponseerrordata.py
|
||||
- src/openrouter/components/urlcitation.py
|
||||
- src/openrouter/components/usermessage.py
|
||||
- src/openrouter/components/videoinput.py
|
||||
- src/openrouter/components/websearchengine.py
|
||||
- src/openrouter/components/websearchpreviewtooluserlocation.py
|
||||
- src/openrouter/components/websearchstatus.py
|
||||
@@ -818,7 +892,6 @@ generatedFiles:
|
||||
- src/openrouter/errors/__init__.py
|
||||
- src/openrouter/errors/badgatewayresponse_error.py
|
||||
- src/openrouter/errors/badrequestresponse_error.py
|
||||
- src/openrouter/errors/chaterror.py
|
||||
- src/openrouter/errors/edgenetworktimeoutresponse_error.py
|
||||
- src/openrouter/errors/forbiddenresponse_error.py
|
||||
- src/openrouter/errors/internalserverresponse_error.py
|
||||
@@ -865,6 +938,7 @@ generatedFiles:
|
||||
- src/openrouter/operations/getmodels.py
|
||||
- src/openrouter/operations/getuseractivity.py
|
||||
- src/openrouter/operations/list.py
|
||||
- src/openrouter/operations/listembeddingsmodels.py
|
||||
- src/openrouter/operations/listendpoints.py
|
||||
- src/openrouter/operations/listendpointszdr.py
|
||||
- src/openrouter/operations/listguardrailkeyassignments.py
|
||||
@@ -872,6 +946,7 @@ generatedFiles:
|
||||
- src/openrouter/operations/listguardrails.py
|
||||
- src/openrouter/operations/listkeyassignments.py
|
||||
- src/openrouter/operations/listmemberassignments.py
|
||||
- src/openrouter/operations/listmodelscount.py
|
||||
- src/openrouter/operations/listmodelsuser.py
|
||||
- src/openrouter/operations/listproviders.py
|
||||
- src/openrouter/operations/sendchatcompletionrequest.py
|
||||
@@ -948,7 +1023,7 @@ examples:
|
||||
"401":
|
||||
application/json: {"error": {"code": 401, "message": "Missing Authentication header"}}
|
||||
"403":
|
||||
application/json: {"error": {"code": 403, "message": "Only provisioning keys can perform this operation"}}
|
||||
application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}}
|
||||
"500":
|
||||
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
|
||||
getCredits:
|
||||
@@ -959,7 +1034,7 @@ examples:
|
||||
"401":
|
||||
application/json: {"error": {"code": 401, "message": "Missing Authentication header"}}
|
||||
"403":
|
||||
application/json: {"error": {"code": 403, "message": "Only provisioning keys can perform this operation"}}
|
||||
application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}}
|
||||
"500":
|
||||
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
|
||||
createCoinbaseCharge:
|
||||
@@ -1021,7 +1096,7 @@ examples:
|
||||
id: "<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"}}
|
||||
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": []}}
|
||||
"401":
|
||||
application/json: {"error": {"code": 401, "message": "Missing Authentication header"}}
|
||||
"402":
|
||||
@@ -1063,6 +1138,8 @@ examples:
|
||||
application/json: {"error": {"code": 401, "message": "Missing Authentication header"}}
|
||||
"500":
|
||||
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
|
||||
"404":
|
||||
application/json: {"error": {"code": 404, "message": "Resource not found"}}
|
||||
listEndpoints:
|
||||
speakeasy-default-list-endpoints:
|
||||
parameters:
|
||||
@@ -1191,7 +1268,7 @@ examples:
|
||||
speakeasy-default-get-current-key:
|
||||
responses:
|
||||
"200":
|
||||
application/json: {"data": {"label": "sk-or-v1-au7...890", "limit": 100, "usage": 25.5, "usage_daily": 25.5, "usage_weekly": 25.5, "usage_monthly": 25.5, "byok_usage": 17.38, "byok_usage_daily": 17.38, "byok_usage_weekly": 17.38, "byok_usage_monthly": 17.38, "is_free_tier": false, "is_provisioning_key": false, "limit_remaining": 74.5, "limit_reset": "monthly", "include_byok_in_limit": false, "rate_limit": {"requests": 1000, "interval": "1h", "note": "This field is deprecated and safe to ignore."}}}
|
||||
application/json: {"data": {"label": "sk-or-v1-au7...890", "limit": 100, "usage": 25.5, "usage_daily": 25.5, "usage_weekly": 25.5, "usage_monthly": 25.5, "byok_usage": 17.38, "byok_usage_daily": 17.38, "byok_usage_weekly": 17.38, "byok_usage_monthly": 17.38, "is_free_tier": false, "is_management_key": false, "is_provisioning_key": false, "limit_remaining": 74.5, "limit_reset": "monthly", "include_byok_in_limit": false, "rate_limit": {"requests": 1000, "interval": "1h", "note": "This field is deprecated and safe to ignore."}}}
|
||||
"401":
|
||||
application/json: {"error": {"code": 401, "message": "Missing Authentication header"}}
|
||||
"500":
|
||||
@@ -1206,7 +1283,7 @@ examples:
|
||||
"400":
|
||||
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
|
||||
"403":
|
||||
application/json: {"error": {"code": 403, "message": "Only provisioning keys can perform this operation"}}
|
||||
application/json: {"error": {"code": 403, "message": "Only management keys can perform this operation"}}
|
||||
"500":
|
||||
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
|
||||
createAuthKeysCode:
|
||||
@@ -1225,14 +1302,36 @@ examples:
|
||||
sendChatCompletionRequest:
|
||||
speakeasy-default-send-chat-completion-request:
|
||||
requestBody:
|
||||
application/json: {"messages": [], "stream": false}
|
||||
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": "<id>", "choices": [], "created": 6524.91, "model": "Silverado", "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"}
|
||||
"400":
|
||||
application/json: {"error": {"code": "<value>", "message": "<value>"}}
|
||||
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
|
||||
"500":
|
||||
application/json: {"error": {"code": "<value>", "message": "<value>"}}
|
||||
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
|
||||
"401":
|
||||
application/json: {"error": {"code": 401, "message": "Missing Authentication header"}}
|
||||
"402":
|
||||
application/json: {"error": {"code": 402, "message": "Insufficient credits. Add more using https://openrouter.ai/credits"}}
|
||||
"404":
|
||||
application/json: {"error": {"code": 404, "message": "Resource not found"}}
|
||||
"408":
|
||||
application/json: {"error": {"code": 408, "message": "Operation timed out. Please try again later."}}
|
||||
"413":
|
||||
application/json: {"error": {"code": 413, "message": "Request payload too large"}}
|
||||
"422":
|
||||
application/json: {"error": {"code": 422, "message": "Invalid argument"}}
|
||||
"429":
|
||||
application/json: {"error": {"code": 429, "message": "Rate limit exceeded"}}
|
||||
"502":
|
||||
application/json: {"error": {"code": 502, "message": "Provider returned error"}}
|
||||
"503":
|
||||
application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}}
|
||||
"524":
|
||||
application/json: {"error": {"code": 524, "message": "Request timed out. Please try again later."}}
|
||||
"529":
|
||||
application/json: {"error": {"code": 529, "message": "Provider returned error"}}
|
||||
createCompletions:
|
||||
speakeasy-default-create-completions:
|
||||
requestBody:
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ generation:
|
||||
skipResponseBodyAssertions: false
|
||||
preApplyUnionDiscriminators: true
|
||||
python:
|
||||
version: 0.1.3
|
||||
version: 0.7.9
|
||||
additionalDependencies:
|
||||
dev: {}
|
||||
main: {}
|
||||
|
||||
+2145
-1725
File diff suppressed because it is too large
Load Diff
+2198
-1707
File diff suppressed because it is too large
Load Diff
@@ -33,3 +33,11 @@ actions:
|
||||
type: string
|
||||
description: |
|
||||
The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
# Add header parameters to all paths so Speakeasy matches them with globals
|
||||
- target: $.paths[*]
|
||||
description: Reference app identification headers on all paths so Speakeasy injects them via globals
|
||||
update:
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
|
||||
@@ -8,19 +8,20 @@ sources:
|
||||
- latest
|
||||
OpenRouter API:
|
||||
sourceNamespace: open-router-chat-completions-api
|
||||
sourceRevisionDigest: sha256:291e215687f85db05005d79dd87602a75b8086f39a841700fdbaaff7690b4f76
|
||||
sourceBlobDigest: sha256:166639d08f0ae9687cea532ed8a93db59e63293c6a6f4d17d63f015b60d643d2
|
||||
sourceRevisionDigest: sha256:a3034772624fc11a890e6f565c3b098739adb96956c73135e3657329c2849f94
|
||||
sourceBlobDigest: sha256:ab42c91f594ab94318c39aeb198f94752b11c18690aaf5e664f133c911d0f16e
|
||||
tags:
|
||||
- latest
|
||||
- main
|
||||
- 1.0.0
|
||||
targets:
|
||||
open-router:
|
||||
source: OpenRouter API
|
||||
sourceNamespace: open-router-chat-completions-api
|
||||
sourceRevisionDigest: sha256:291e215687f85db05005d79dd87602a75b8086f39a841700fdbaaff7690b4f76
|
||||
sourceBlobDigest: sha256:166639d08f0ae9687cea532ed8a93db59e63293c6a6f4d17d63f015b60d643d2
|
||||
sourceRevisionDigest: sha256:a3034772624fc11a890e6f565c3b098739adb96956c73135e3657329c2849f94
|
||||
sourceBlobDigest: sha256:ab42c91f594ab94318c39aeb198f94752b11c18690aaf5e664f133c911d0f16e
|
||||
codeSamplesNamespace: open-router-python-code-samples
|
||||
codeSamplesRevisionDigest: sha256:f19eae09ec90a23147935f07a86f75dbbc998e6bac3b820351a1e5f147fec590
|
||||
codeSamplesRevisionDigest: sha256:653bbd091c56bce37f09a8e2d61c4ee5addde427957a630217d7afc3c05946bb
|
||||
workflow:
|
||||
workflowVersion: 1.0.0
|
||||
speakeasyVersion: 1.666.0
|
||||
|
||||
@@ -182,6 +182,8 @@ import os
|
||||
def main():
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
# Rest of application here...
|
||||
@@ -191,6 +193,8 @@ def main():
|
||||
async def amain():
|
||||
|
||||
async with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
# Rest of application here...
|
||||
|
||||
@@ -182,6 +182,8 @@ import os
|
||||
def main():
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
# Rest of application here...
|
||||
@@ -191,6 +193,8 @@ def main():
|
||||
async def amain():
|
||||
|
||||
async with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
# Rest of application here...
|
||||
|
||||
@@ -6,6 +6,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -30,6 +32,8 @@ import os
|
||||
async def main():
|
||||
|
||||
async with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
# AssistantMessage
|
||||
|
||||
Assistant message for requests and responses
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
||||
| `role` | *Literal["assistant"]* | :heavy_check_mark: | N/A |
|
||||
| `content` | [OptionalNullable[components.AssistantMessageContent]](../components/assistantmessagecontent.md) | :heavy_minus_sign: | N/A |
|
||||
| `name` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `tool_calls` | List[[components.ChatMessageToolCall](../components/chatmessagetoolcall.md)] | :heavy_minus_sign: | N/A |
|
||||
| `refusal` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
||||
| `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
||||
| `reasoning_details` | List[[components.Schema2](../components/schema2.md)] | :heavy_minus_sign: | N/A |
|
||||
| `images` | List[[components.Image](../components/image.md)] | :heavy_minus_sign: | N/A |
|
||||
| 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 | [<br/>{<br/>"image_url": {<br/>"url": "data:image/png;base64,iVBORw0KGgo..."<br/>}<br/>}<br/>] |
|
||||
@@ -1,5 +1,7 @@
|
||||
# AssistantMessageContent
|
||||
|
||||
Assistant message content
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
@@ -15,3 +17,9 @@ value: str = /* values here */
|
||||
value: List[components.ChatMessageContentItem] = /* values here */
|
||||
```
|
||||
|
||||
### `Any`
|
||||
|
||||
```python
|
||||
value: Any = /* values here */
|
||||
```
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# AssistantMessageImages
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
||||
| `image_url` | [components.AssistantMessageImagesImageURL](../components/assistantmessageimagesimageurl.md) | :heavy_check_mark: | N/A |
|
||||
@@ -0,0 +1,8 @@
|
||||
# AssistantMessageImagesImageURL
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- |
|
||||
| `url` | *str* | :heavy_check_mark: | URL or base64-encoded data of the generated image |
|
||||
@@ -1,8 +0,0 @@
|
||||
# AssistantMessageImageURL
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `url` | *str* | :heavy_check_mark: | N/A |
|
||||
@@ -0,0 +1,8 @@
|
||||
# AssistantMessageRole
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ----------- | ----------- |
|
||||
| `ASSISTANT` | assistant |
|
||||
@@ -0,0 +1,12 @@
|
||||
# By
|
||||
|
||||
The provider sorting strategy (price, throughput, latency)
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------ | ------------ |
|
||||
| `PRICE` | price |
|
||||
| `THROUGHPUT` | throughput |
|
||||
| `LATENCY` | latency |
|
||||
@@ -1,11 +0,0 @@
|
||||
# ChatErrorError
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- |
|
||||
| `code` | [Nullable[components.Code]](../components/code.md) | :heavy_check_mark: | N/A |
|
||||
| `message` | *str* | :heavy_check_mark: | N/A |
|
||||
| `param` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
||||
| `type` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
||||
@@ -1,36 +1,39 @@
|
||||
# ChatGenerationParams
|
||||
|
||||
Chat completion request parameters
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `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. |
|
||||
| `route` | [OptionalNullable[components.Route]](../components/route.md) | :heavy_minus_sign: | N/A |
|
||||
| `user` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `session_id` | *Optional[str]* | :heavy_minus_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. |
|
||||
| `messages` | List[[components.Message](../components/message.md)] | :heavy_check_mark: | N/A |
|
||||
| `model` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `models` | List[*str*] | :heavy_minus_sign: | N/A |
|
||||
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `logit_bias` | Dict[str, *float*] | :heavy_minus_sign: | N/A |
|
||||
| `logprobs` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
|
||||
| `top_logprobs` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `max_completion_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `max_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | N/A |
|
||||
| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `reasoning` | [Optional[components.Reasoning]](../components/reasoning.md) | :heavy_minus_sign: | N/A |
|
||||
| `response_format` | [Optional[components.ChatGenerationParamsResponseFormatUnion]](../components/chatgenerationparamsresponseformatunion.md) | :heavy_minus_sign: | N/A |
|
||||
| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
|
||||
| `stop` | [OptionalNullable[components.ChatGenerationParamsStop]](../components/chatgenerationparamsstop.md) | :heavy_minus_sign: | N/A |
|
||||
| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A |
|
||||
| `stream_options` | [OptionalNullable[components.ChatStreamOptions]](../components/chatstreamoptions.md) | :heavy_minus_sign: | N/A |
|
||||
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `tool_choice` | *Optional[Any]* | :heavy_minus_sign: | N/A |
|
||||
| `tools` | List[[components.ToolDefinitionJSON](../components/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A |
|
||||
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `debug` | [Optional[components.Debug]](../components/debug.md) | :heavy_minus_sign: | N/A |
|
||||
| `image_config` | Dict[str, [components.ChatGenerationParamsImageConfig](../components/chatgenerationparamsimageconfig.md)] | :heavy_minus_sign: | N/A |
|
||||
| `modalities` | List[[components.Modality](../components/modality.md)] | :heavy_minus_sign: | N/A |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `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 |
|
||||
| `session_id` | *Optional[str]* | :heavy_minus_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. | |
|
||||
| `trace` | [Optional[components.ChatGenerationParamsTrace]](../components/chatgenerationparamstrace.md) | :heavy_minus_sign: | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | |
|
||||
| `messages` | List[[components.Message](../components/message.md)] | :heavy_check_mark: | List of messages for the conversation | [<br/>{<br/>"role": "user",<br/>"content": "Hello!"<br/>}<br/>] |
|
||||
| `model` | *Optional[str]* | :heavy_minus_sign: | Model to use for completion | openai/gpt-4 |
|
||||
| `models` | List[*str*] | :heavy_minus_sign: | Models to use for completion | [<br/>"openai/gpt-4",<br/>"openai/gpt-4o"<br/>] |
|
||||
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | Frequency penalty (-2.0 to 2.0) | 0 |
|
||||
| `logit_bias` | Dict[str, *float*] | :heavy_minus_sign: | Token logit bias adjustments | {<br/>"50256": -100<br/>} |
|
||||
| `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 |
|
||||
| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) | {<br/>"user_id": "user-123",<br/>"session_id": "session-456"<br/>} |
|
||||
| `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 | {<br/>"effort": "medium",<br/>"summary": "concise"<br/>} |
|
||||
| `response_format` | [Optional[components.ResponseFormat]](../components/responseformat.md) | :heavy_minus_sign: | Response format configuration | {<br/>"type": "json_object"<br/>} |
|
||||
| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | Random seed for deterministic outputs | 42 |
|
||||
| `stop` | [OptionalNullable[components.Stop]](../components/stop.md) | :heavy_minus_sign: | Stop sequences (up to 4) | [<br/>""<br/>] |
|
||||
| `stream` | *Optional[bool]* | :heavy_minus_sign: | Enable streaming response | false |
|
||||
| `stream_options` | [OptionalNullable[components.ChatStreamOptions]](../components/chatstreamoptions.md) | :heavy_minus_sign: | Streaming configuration options | {<br/>"include_usage": true<br/>} |
|
||||
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | Sampling temperature (0-2) | 0.7 |
|
||||
| `parallel_tool_calls` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | |
|
||||
| `tool_choice` | [Optional[components.ToolChoiceOption]](../components/toolchoiceoption.md) | :heavy_minus_sign: | Tool choice configuration | auto |
|
||||
| `tools` | List[[components.ToolDefinitionJSON](../components/tooldefinitionjson.md)] | :heavy_minus_sign: | Available tools for function calling | [<br/>{<br/>"type": "function",<br/>"function": {<br/>"name": "get_weather",<br/>"description": "Get weather"<br/>}<br/>}<br/>] |
|
||||
| `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) | {<br/>"echo_upstream_body": true<br/>} |
|
||||
| `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. | {<br/>"aspect_ratio": "16:9"<br/>} |
|
||||
| `modalities` | List[[components.Modality](../components/modality.md)] | :heavy_minus_sign: | Output modalities for the response. Supported values are "text" and "image". | [<br/>"text",<br/>"image"<br/>] |
|
||||
@@ -0,0 +1,12 @@
|
||||
# ChatGenerationParamsBy
|
||||
|
||||
The provider sorting strategy (price, throughput, latency)
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------ | ------------ |
|
||||
| `PRICE` | price |
|
||||
| `THROUGHPUT` | throughput |
|
||||
| `LATENCY` | latency |
|
||||
@@ -1,9 +0,0 @@
|
||||
# ChatGenerationParamsDataCollection
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------- | ------- |
|
||||
| `DENY` | deny |
|
||||
| `ALLOW` | allow |
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# IDAutoRouter
|
||||
# ChatGenerationParamsIDAutoRouter
|
||||
|
||||
|
||||
## Values
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# IDFileParser
|
||||
# ChatGenerationParamsIDFileParser
|
||||
|
||||
|
||||
## Values
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# IDModeration
|
||||
# ChatGenerationParamsIDModeration
|
||||
|
||||
|
||||
## Values
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# IDResponseHealing
|
||||
# ChatGenerationParamsIDResponseHealing
|
||||
|
||||
|
||||
## Values
|
||||
@@ -1,4 +1,4 @@
|
||||
# IDWeb
|
||||
# ChatGenerationParamsIDWeb
|
||||
|
||||
|
||||
## Values
|
||||
@@ -0,0 +1,17 @@
|
||||
# ChatGenerationParamsIgnore
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `components.ProviderName`
|
||||
|
||||
```python
|
||||
value: components.ProviderName = /* values here */
|
||||
```
|
||||
|
||||
### `str`
|
||||
|
||||
```python
|
||||
value: str = /* values here */
|
||||
```
|
||||
|
||||
@@ -15,3 +15,9 @@ value: str = /* values here */
|
||||
value: float = /* values here */
|
||||
```
|
||||
|
||||
### `List[Nullable[Any]]`
|
||||
|
||||
```python
|
||||
value: List[Nullable[Any]] = /* values here */
|
||||
```
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ The object specifying the maximum price you want to pay for this request. USD pr
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `prompt` | *Optional[Any]* | :heavy_minus_sign: | N/A |
|
||||
| `completion` | *Optional[Any]* | :heavy_minus_sign: | N/A |
|
||||
| `image` | *Optional[Any]* | :heavy_minus_sign: | N/A |
|
||||
| `audio` | *Optional[Any]* | :heavy_minus_sign: | N/A |
|
||||
| `request` | *Optional[Any]* | :heavy_minus_sign: | N/A |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- |
|
||||
| `prompt` | *Optional[str]* | :heavy_minus_sign: | Price per million prompt tokens | 1000 |
|
||||
| `completion` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
||||
| `image` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
||||
| `audio` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
||||
| `request` | *Optional[str]* | :heavy_minus_sign: | N/A | 1000 |
|
||||
@@ -0,0 +1,17 @@
|
||||
# ChatGenerationParamsOnly
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `components.ProviderName`
|
||||
|
||||
```python
|
||||
value: components.ProviderName = /* values here */
|
||||
```
|
||||
|
||||
### `str`
|
||||
|
||||
```python
|
||||
value: str = /* values here */
|
||||
```
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
# ChatGenerationParamsOrder
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `components.ProviderName`
|
||||
|
||||
```python
|
||||
value: components.ProviderName = /* values here */
|
||||
```
|
||||
|
||||
### `str`
|
||||
|
||||
```python
|
||||
value: str = /* values here */
|
||||
```
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# ChatGenerationParamsPartition
|
||||
|
||||
Partitioning strategy for sorting: "model" (default) groups endpoints by model before sorting (fallback models remain fallbacks), "none" sorts all endpoints together regardless of model.
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------- | ------- |
|
||||
| `MODEL` | model |
|
||||
| `NONE` | none |
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------ | ------------------------ | ------------------------ | ------------------------ |
|
||||
| `id` | *Literal["auto-router"]* | :heavy_check_mark: | N/A |
|
||||
| `enabled` | *Optional[bool]* | :heavy_minus_sign: | N/A |
|
||||
| `allowed_models` | List[*str*] | :heavy_minus_sign: | N/A |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `id` | [components.ChatGenerationParamsIDAutoRouter](../components/chatgenerationparamsidautorouter.md) | :heavy_check_mark: | N/A | |
|
||||
| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the auto-router plugin for this request. Defaults to true. | |
|
||||
| `allowed_models` | List[*str*] | :heavy_minus_sign: | List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, uses the default supported models list. | [<br/>"anthropic/*",<br/>"openai/gpt-4o",<br/>"google/*"<br/>] |
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
|
||||
| `id` | *Literal["file-parser"]* | :heavy_check_mark: | N/A |
|
||||
| `enabled` | *Optional[bool]* | :heavy_minus_sign: | N/A |
|
||||
| `pdf` | [Optional[components.Pdf]](../components/pdf.md) | :heavy_minus_sign: | N/A |
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
||||
| `id` | [components.ChatGenerationParamsIDFileParser](../components/chatgenerationparamsidfileparser.md) | :heavy_check_mark: | N/A |
|
||||
| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the file-parser plugin for this request. Defaults to true. |
|
||||
| `pdf` | [Optional[components.PDFParserOptions]](../components/pdfparseroptions.md) | :heavy_minus_sign: | Options for PDF parsing. |
|
||||
@@ -3,6 +3,6 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ----------------------- | ----------------------- | ----------------------- | ----------------------- |
|
||||
| `id` | *Literal["moderation"]* | :heavy_check_mark: | N/A |
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
||||
| `id` | [components.ChatGenerationParamsIDModeration](../components/chatgenerationparamsidmoderation.md) | :heavy_check_mark: | N/A |
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- |
|
||||
| `id` | *Literal["response-healing"]* | :heavy_check_mark: | N/A |
|
||||
| `enabled` | *Optional[bool]* | :heavy_minus_sign: | N/A |
|
||||
| Field | Type | Required | Description |
|
||||
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
||||
| `id` | [components.ChatGenerationParamsIDResponseHealing](../components/chatgenerationparamsidresponsehealing.md) | :heavy_check_mark: | N/A |
|
||||
| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the response-healing plugin for this request. Defaults to true. |
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ |
|
||||
| `id` | *Literal["web"]* | :heavy_check_mark: | N/A |
|
||||
| `enabled` | *Optional[bool]* | :heavy_minus_sign: | N/A |
|
||||
| `max_results` | *Optional[float]* | :heavy_minus_sign: | N/A |
|
||||
| `search_prompt` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `engine` | [Optional[components.Engine]](../components/engine.md) | :heavy_minus_sign: | N/A |
|
||||
| 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. |
|
||||
@@ -1,11 +0,0 @@
|
||||
# ChatGenerationParamsPreferredMaxLatency
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------- | ------------------------- | ------------------------- | ------------------------- |
|
||||
| `p50` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `p75` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `p90` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `p99` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
@@ -1,17 +0,0 @@
|
||||
# ChatGenerationParamsPreferredMaxLatencyUnion
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `float`
|
||||
|
||||
```python
|
||||
value: float = /* values here */
|
||||
```
|
||||
|
||||
### `components.ChatGenerationParamsPreferredMaxLatency`
|
||||
|
||||
```python
|
||||
value: components.ChatGenerationParamsPreferredMaxLatency = /* values here */
|
||||
```
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
# ChatGenerationParamsPreferredMinThroughput
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------- | ------------------------- | ------------------------- | ------------------------- |
|
||||
| `p50` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `p75` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `p90` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `p99` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
@@ -1,17 +0,0 @@
|
||||
# ChatGenerationParamsPreferredMinThroughputUnion
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `float`
|
||||
|
||||
```python
|
||||
value: float = /* values here */
|
||||
```
|
||||
|
||||
### `components.ChatGenerationParamsPreferredMinThroughput`
|
||||
|
||||
```python
|
||||
value: components.ChatGenerationParamsPreferredMinThroughput = /* values here */
|
||||
```
|
||||
|
||||
@@ -1,20 +1,22 @@
|
||||
# ChatGenerationParamsProvider
|
||||
|
||||
When multiple model providers are available, optionally indicate your routing preference.
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `allow_fallbacks` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to allow backup providers to serve requests<br/>- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.<br/>- false: use only the primary/custom provider, and return the upstream error if it's unavailable.<br/> |
|
||||
| `require_parameters` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. |
|
||||
| `data_collection` | [OptionalNullable[components.ChatGenerationParamsDataCollection]](../components/chatgenerationparamsdatacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.<br/>- allow: (default) allow providers which store user data non-transiently and may train on it<br/><br/>- deny: use only providers which do not collect user data. |
|
||||
| `zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
|
||||
| `enforce_distillable_text` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
|
||||
| `order` | List[[components.Schema0](../components/schema0.md)] | :heavy_minus_sign: | An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. |
|
||||
| `only` | List[[components.Schema0](../components/schema0.md)] | :heavy_minus_sign: | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. |
|
||||
| `ignore` | List[[components.Schema0](../components/schema0.md)] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. |
|
||||
| `quantizations` | List[[components.Quantizations](../components/quantizations.md)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. |
|
||||
| `sort` | [OptionalNullable[components.ProviderSortUnion]](../components/providersortunion.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. |
|
||||
| `max_price` | [Optional[components.ChatGenerationParamsMaxPrice]](../components/chatgenerationparamsmaxprice.md) | :heavy_minus_sign: | The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. |
|
||||
| `preferred_min_throughput` | [OptionalNullable[components.ChatGenerationParamsPreferredMinThroughputUnion]](../components/chatgenerationparamspreferredminthroughputunion.md) | :heavy_minus_sign: | Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. |
|
||||
| `preferred_max_latency` | [OptionalNullable[components.ChatGenerationParamsPreferredMaxLatencyUnion]](../components/chatgenerationparamspreferredmaxlatencyunion.md) | :heavy_minus_sign: | Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `allow_fallbacks` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to allow backup providers to serve requests<br/>- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.<br/>- false: use only the primary/custom provider, and return the upstream error if it's unavailable.<br/> | |
|
||||
| `require_parameters` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. | |
|
||||
| `data_collection` | [OptionalNullable[components.DataCollection]](../components/datacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.<br/>- allow: (default) allow providers which store user data non-transiently and may train on it<br/><br/>- deny: use only providers which do not collect user data. | allow |
|
||||
| `zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. | true |
|
||||
| `enforce_distillable_text` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. | true |
|
||||
| `order` | List[[components.ChatGenerationParamsOrder](../components/chatgenerationparamsorder.md)] | :heavy_minus_sign: | An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. | |
|
||||
| `only` | List[[components.ChatGenerationParamsOnly](../components/chatgenerationparamsonly.md)] | :heavy_minus_sign: | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. | |
|
||||
| `ignore` | List[[components.ChatGenerationParamsIgnore](../components/chatgenerationparamsignore.md)] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | |
|
||||
| `quantizations` | List[[components.Quantization](../components/quantization.md)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | |
|
||||
| `sort` | [OptionalNullable[components.ChatGenerationParamsSortUnion]](../components/chatgenerationparamssortunion.md) | :heavy_minus_sign: | N/A | price |
|
||||
| `max_price` | [Optional[components.ChatGenerationParamsMaxPrice]](../components/chatgenerationparamsmaxprice.md) | :heavy_minus_sign: | The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. | |
|
||||
| `preferred_min_throughput` | [OptionalNullable[components.PreferredMinThroughput]](../components/preferredminthroughput.md) | :heavy_minus_sign: | Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. | 100 |
|
||||
| `preferred_max_latency` | [OptionalNullable[components.PreferredMaxLatency]](../components/preferredmaxlatency.md) | :heavy_minus_sign: | Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. | 5 |
|
||||
@@ -0,0 +1,12 @@
|
||||
# ChatGenerationParamsProviderSort
|
||||
|
||||
The provider sorting strategy (price, throughput, latency)
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------ | ------------ |
|
||||
| `PRICE` | price |
|
||||
| `THROUGHPUT` | throughput |
|
||||
| `LATENCY` | latency |
|
||||
@@ -0,0 +1,9 @@
|
||||
# ChatGenerationParamsProviderSortConfig
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `by` | [OptionalNullable[components.ChatGenerationParamsBy]](../components/chatgenerationparamsby.md) | :heavy_minus_sign: | The provider sorting strategy (price, throughput, latency) | price |
|
||||
| `partition` | [OptionalNullable[components.ChatGenerationParamsPartition]](../components/chatgenerationparamspartition.md) | :heavy_minus_sign: | Partitioning strategy for sorting: "model" (default) groups endpoints by model before sorting (fallback models remain fallbacks), "none" sorts all endpoints together regardless of model. | model |
|
||||
@@ -0,0 +1,10 @@
|
||||
# ChatGenerationParamsProviderSortConfigEnum
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------ | ------------ |
|
||||
| `PRICE` | price |
|
||||
| `THROUGHPUT` | throughput |
|
||||
| `LATENCY` | latency |
|
||||
@@ -0,0 +1,17 @@
|
||||
# ChatGenerationParamsProviderSortConfigUnion
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `components.ChatGenerationParamsProviderSortConfig`
|
||||
|
||||
```python
|
||||
value: components.ChatGenerationParamsProviderSortConfig = /* values here */
|
||||
```
|
||||
|
||||
### `components.ChatGenerationParamsProviderSortConfigEnum`
|
||||
|
||||
```python
|
||||
value: components.ChatGenerationParamsProviderSortConfigEnum = /* values here */
|
||||
```
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
# ChatGenerationParamsResponseFormatJSONObject
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------ | ------------------------ | ------------------------ | ------------------------ |
|
||||
| `type` | *Literal["json_object"]* | :heavy_check_mark: | N/A |
|
||||
@@ -1,8 +0,0 @@
|
||||
# ChatGenerationParamsResponseFormatPython
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------- | ------------------- | ------------------- | ------------------- |
|
||||
| `type` | *Literal["python"]* | :heavy_check_mark: | N/A |
|
||||
@@ -1,8 +0,0 @@
|
||||
# ChatGenerationParamsResponseFormatText
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `type` | *Literal["text"]* | :heavy_check_mark: | N/A |
|
||||
@@ -1,35 +0,0 @@
|
||||
# ChatGenerationParamsResponseFormatUnion
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `components.ChatGenerationParamsResponseFormatText`
|
||||
|
||||
```python
|
||||
value: components.ChatGenerationParamsResponseFormatText = /* values here */
|
||||
```
|
||||
|
||||
### `components.ChatGenerationParamsResponseFormatJSONObject`
|
||||
|
||||
```python
|
||||
value: components.ChatGenerationParamsResponseFormatJSONObject = /* values here */
|
||||
```
|
||||
|
||||
### `components.ResponseFormatJSONSchema`
|
||||
|
||||
```python
|
||||
value: components.ResponseFormatJSONSchema = /* values here */
|
||||
```
|
||||
|
||||
### `components.ResponseFormatTextGrammar`
|
||||
|
||||
```python
|
||||
value: components.ResponseFormatTextGrammar = /* values here */
|
||||
```
|
||||
|
||||
### `components.ChatGenerationParamsResponseFormatPython`
|
||||
|
||||
```python
|
||||
value: components.ChatGenerationParamsResponseFormatPython = /* values here */
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# SortEnum
|
||||
# ChatGenerationParamsSortEnum
|
||||
|
||||
|
||||
## Values
|
||||
@@ -0,0 +1,25 @@
|
||||
# ChatGenerationParamsSortUnion
|
||||
|
||||
The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `components.ChatGenerationParamsProviderSort`
|
||||
|
||||
```python
|
||||
value: components.ChatGenerationParamsProviderSort = /* values here */
|
||||
```
|
||||
|
||||
### `components.ChatGenerationParamsProviderSortConfigUnion`
|
||||
|
||||
```python
|
||||
value: components.ChatGenerationParamsProviderSortConfigUnion = /* values here */
|
||||
```
|
||||
|
||||
### `components.ChatGenerationParamsSortEnum`
|
||||
|
||||
```python
|
||||
value: components.ChatGenerationParamsSortEnum = /* values here */
|
||||
```
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
# ChatGenerationParamsTrace
|
||||
|
||||
Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------- | -------------------------- | -------------------------- | -------------------------- |
|
||||
| `trace_id` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `trace_name` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `span_name` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `generation_name` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `parent_span_id` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `__pydantic_extra__` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A |
|
||||
@@ -1,12 +1,14 @@
|
||||
# ChatGenerationTokenUsage
|
||||
|
||||
Token usage statistics
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
|
||||
| `completion_tokens` | *float* | :heavy_check_mark: | N/A |
|
||||
| `prompt_tokens` | *float* | :heavy_check_mark: | N/A |
|
||||
| `total_tokens` | *float* | :heavy_check_mark: | N/A |
|
||||
| `completion_tokens_details` | [OptionalNullable[components.CompletionTokensDetails]](../components/completiontokensdetails.md) | :heavy_minus_sign: | N/A |
|
||||
| `prompt_tokens_details` | [OptionalNullable[components.PromptTokensDetails]](../components/prompttokensdetails.md) | :heavy_minus_sign: | N/A |
|
||||
| `completion_tokens` | *float* | :heavy_check_mark: | Number of tokens in the completion |
|
||||
| `prompt_tokens` | *float* | :heavy_check_mark: | Number of tokens in the prompt |
|
||||
| `total_tokens` | *float* | :heavy_check_mark: | Total number of tokens |
|
||||
| `completion_tokens_details` | [OptionalNullable[components.CompletionTokensDetails]](../components/completiontokensdetails.md) | :heavy_minus_sign: | Detailed completion token usage |
|
||||
| `prompt_tokens_details` | [OptionalNullable[components.PromptTokensDetails]](../components/prompttokensdetails.md) | :heavy_minus_sign: | Detailed prompt token usage |
|
||||
@@ -1,5 +1,7 @@
|
||||
# ChatMessageContentItem
|
||||
|
||||
Content part for chat completion messages
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
@@ -21,15 +23,9 @@ value: components.ChatMessageContentItemImage = /* values here */
|
||||
value: components.ChatMessageContentItemAudio = /* values here */
|
||||
```
|
||||
|
||||
### `components.ChatMessageContentItemVideo`
|
||||
### `components.ChatMessageContentItem1`
|
||||
|
||||
```python
|
||||
value: components.ChatMessageContentItemVideo = /* values here */
|
||||
```
|
||||
|
||||
### `components.ChatMessageContentItemVideo`
|
||||
|
||||
```python
|
||||
value: components.ChatMessageContentItemVideo = /* values here */
|
||||
value: components.ChatMessageContentItem1 = /* values here */
|
||||
```
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
# ChatMessageContentItem1
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `components.ChatMessageContentItemVideoLegacy`
|
||||
|
||||
```python
|
||||
value: components.ChatMessageContentItemVideoLegacy = /* values here */
|
||||
```
|
||||
|
||||
### `components.ChatMessageContentItemVideo`
|
||||
|
||||
```python
|
||||
value: components.ChatMessageContentItemVideo = /* values here */
|
||||
```
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
# ChatMessageContentItemAudio
|
||||
|
||||
Audio input content part. Supported audio formats vary by provider.
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
||||
| `type` | *Literal["input_audio"]* | :heavy_check_mark: | N/A |
|
||||
| `type` | [components.ChatMessageContentItemAudioType](../components/chatmessagecontentitemaudiotype.md) | :heavy_check_mark: | N/A |
|
||||
| `input_audio` | [components.ChatMessageContentItemAudioInputAudio](../components/chatmessagecontentitemaudioinputaudio.md) | :heavy_check_mark: | N/A |
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `data` | *str* | :heavy_check_mark: | N/A |
|
||||
| `format_` | *str* | :heavy_check_mark: | N/A |
|
||||
| Field | Type | Required | Description |
|
||||
| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
||||
| `data` | *str* | :heavy_check_mark: | Base64 encoded audio data |
|
||||
| `format_` | *str* | :heavy_check_mark: | Audio format (e.g., wav, mp3, flac, m4a, ogg, aiff, aac, pcm16, pcm24). Supported formats vary by provider. |
|
||||
@@ -0,0 +1,8 @@
|
||||
# ChatMessageContentItemAudioType
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------- | ------------- |
|
||||
| `INPUT_AUDIO` | input_audio |
|
||||
@@ -1,9 +1,11 @@
|
||||
# ChatMessageContentItemCacheControl
|
||||
|
||||
Cache control for the content part
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
|
||||
| `type` | *Literal["ephemeral"]* | :heavy_check_mark: | N/A |
|
||||
| `ttl` | [Optional[components.TTL]](../components/ttl.md) | :heavy_minus_sign: | N/A |
|
||||
| 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 |
|
||||
@@ -0,0 +1,8 @@
|
||||
# ChatMessageContentItemCacheControlType
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ----------- | ----------- |
|
||||
| `EPHEMERAL` | ephemeral |
|
||||
@@ -1,9 +1,11 @@
|
||||
# ChatMessageContentItemImage
|
||||
|
||||
Image content part for vision models
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
|
||||
| `type` | *Literal["image_url"]* | :heavy_check_mark: | N/A |
|
||||
| `type` | [components.ChatMessageContentItemImageType](../components/chatmessagecontentitemimagetype.md) | :heavy_check_mark: | N/A |
|
||||
| `image_url` | [components.ChatMessageContentItemImageImageURL](../components/chatmessagecontentitemimageimageurl.md) | :heavy_check_mark: | N/A |
|
||||
@@ -1,5 +1,7 @@
|
||||
# ChatMessageContentItemImageDetail
|
||||
|
||||
Image detail level for vision models
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
|
||||
| `url` | *str* | :heavy_check_mark: | N/A |
|
||||
| `detail` | [Optional[components.ChatMessageContentItemImageDetail]](../components/chatmessagecontentitemimagedetail.md) | :heavy_minus_sign: | N/A |
|
||||
| `url` | *str* | :heavy_check_mark: | URL of the image (data: URLs supported) |
|
||||
| `detail` | [Optional[components.ChatMessageContentItemImageDetail]](../components/chatmessagecontentitemimagedetail.md) | :heavy_minus_sign: | Image detail level for vision models |
|
||||
@@ -0,0 +1,8 @@
|
||||
# ChatMessageContentItemImageType
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ----------- | ----------- |
|
||||
| `IMAGE_URL` | image_url |
|
||||
@@ -1,10 +1,12 @@
|
||||
# ChatMessageContentItemText
|
||||
|
||||
Text content part
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
||||
| `type` | *Literal["text"]* | :heavy_check_mark: | N/A |
|
||||
| `text` | *str* | :heavy_check_mark: | N/A |
|
||||
| `cache_control` | [Optional[components.ChatMessageContentItemCacheControl]](../components/chatmessagecontentitemcachecontrol.md) | :heavy_minus_sign: | N/A |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
||||
| `type` | [components.ChatMessageContentItemTextType](../components/chatmessagecontentitemtexttype.md) | :heavy_check_mark: | N/A | |
|
||||
| `text` | *str* | :heavy_check_mark: | N/A | |
|
||||
| `cache_control` | [Optional[components.ChatMessageContentItemCacheControl]](../components/chatmessagecontentitemcachecontrol.md) | :heavy_minus_sign: | Cache control for the content part | {<br/>"type": "ephemeral",<br/>"ttl": "5m"<br/>} |
|
||||
@@ -0,0 +1,8 @@
|
||||
# ChatMessageContentItemTextType
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------ | ------ |
|
||||
| `TEXT` | text |
|
||||
@@ -1,17 +1,11 @@
|
||||
# ChatMessageContentItemVideo
|
||||
|
||||
Video input content part
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `components.ChatMessageContentItemVideoInputVideo`
|
||||
|
||||
```python
|
||||
value: components.ChatMessageContentItemVideoInputVideo = /* values here */
|
||||
```
|
||||
|
||||
### `components.ChatMessageContentItemVideoVideoURL`
|
||||
|
||||
```python
|
||||
value: components.ChatMessageContentItemVideoVideoURL = /* values here */
|
||||
```
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
||||
| `type` | [components.ChatMessageContentItemVideoType](../components/chatmessagecontentitemvideotype.md) | :heavy_check_mark: | N/A |
|
||||
| `video_url` | [components.VideoInput](../components/videoinput.md) | :heavy_check_mark: | Video input object |
|
||||
@@ -1,9 +0,0 @@
|
||||
# ChatMessageContentItemVideoInputVideo
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- |
|
||||
| `type` | *Literal["input_video"]* | :heavy_check_mark: | N/A |
|
||||
| `video_url` | [components.VideoURL1](../components/videourl1.md) | :heavy_check_mark: | N/A |
|
||||
@@ -0,0 +1,13 @@
|
||||
# ~~ChatMessageContentItemVideoLegacy~~
|
||||
|
||||
Video input content part (legacy format - deprecated)
|
||||
|
||||
> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible.
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
||||
| `type` | [components.ChatMessageContentItemVideoLegacyType](../components/chatmessagecontentitemvideolegacytype.md) | :heavy_check_mark: | N/A |
|
||||
| `video_url` | [components.VideoInput](../components/videoinput.md) | :heavy_check_mark: | Video input object |
|
||||
@@ -0,0 +1,8 @@
|
||||
# ChatMessageContentItemVideoLegacyType
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ------------- | ------------- |
|
||||
| `INPUT_VIDEO` | input_video |
|
||||
@@ -0,0 +1,8 @@
|
||||
# ChatMessageContentItemVideoType
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ----------- | ----------- |
|
||||
| `VIDEO_URL` | video_url |
|
||||
@@ -1,9 +0,0 @@
|
||||
# ChatMessageContentItemVideoVideoURL
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- |
|
||||
| `type` | *Literal["video_url"]* | :heavy_check_mark: | N/A |
|
||||
| `video_url` | [components.VideoURL2](../components/videourl2.md) | :heavy_check_mark: | N/A |
|
||||
@@ -1,11 +1,13 @@
|
||||
# ChatMessageTokenLogprob
|
||||
|
||||
Token log probability information
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
||||
| `token` | *str* | :heavy_check_mark: | N/A |
|
||||
| `logprob` | *float* | :heavy_check_mark: | N/A |
|
||||
| `bytes_` | List[*float*] | :heavy_check_mark: | N/A |
|
||||
| `top_logprobs` | List[[components.ChatMessageTokenLogprobTopLogprob](../components/chatmessagetokenlogprobtoplogprob.md)] | :heavy_check_mark: | N/A |
|
||||
| `token` | *str* | :heavy_check_mark: | The token |
|
||||
| `logprob` | *float* | :heavy_check_mark: | Log probability of the token |
|
||||
| `bytes_` | List[*float*] | :heavy_check_mark: | UTF-8 bytes of the token |
|
||||
| `top_logprobs` | List[[components.ChatMessageTokenLogprobTopLogprob](../components/chatmessagetokenlogprobtoplogprob.md)] | :heavy_check_mark: | Top alternative tokens with probabilities |
|
||||
@@ -1,9 +1,11 @@
|
||||
# ChatMessageTokenLogprobs
|
||||
|
||||
Log probabilities for the completion
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
|
||||
| `content` | List[[components.ChatMessageTokenLogprob](../components/chatmessagetokenlogprob.md)] | :heavy_check_mark: | N/A |
|
||||
| `refusal` | List[[components.ChatMessageTokenLogprob](../components/chatmessagetokenlogprob.md)] | :heavy_check_mark: | N/A |
|
||||
| `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 |
|
||||
@@ -1,10 +1,12 @@
|
||||
# ChatMessageToolCall
|
||||
|
||||
Tool call made by the assistant
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
||||
| `id` | *str* | :heavy_check_mark: | N/A |
|
||||
| `type` | *Literal["function"]* | :heavy_check_mark: | N/A |
|
||||
| `id` | *str* | :heavy_check_mark: | Tool call identifier |
|
||||
| `type` | [components.ChatMessageToolCallType](../components/chatmessagetoolcalltype.md) | :heavy_check_mark: | N/A |
|
||||
| `function` | [components.ChatMessageToolCallFunction](../components/chatmessagetoolcallfunction.md) | :heavy_check_mark: | N/A |
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `name` | *str* | :heavy_check_mark: | N/A |
|
||||
| `arguments` | *str* | :heavy_check_mark: | N/A |
|
||||
| Field | Type | Required | Description |
|
||||
| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- |
|
||||
| `name` | *str* | :heavy_check_mark: | Function name to call |
|
||||
| `arguments` | *str* | :heavy_check_mark: | Function arguments as JSON string |
|
||||
@@ -1,9 +1,8 @@
|
||||
# Route
|
||||
# ChatMessageToolCallType
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ---------- | ---------- |
|
||||
| `FALLBACK` | fallback |
|
||||
| `SORT` | sort |
|
||||
| `FUNCTION` | function |
|
||||
@@ -1,14 +1,16 @@
|
||||
# ChatResponse
|
||||
|
||||
Chat completion response
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
|
||||
| `id` | *str* | :heavy_check_mark: | N/A |
|
||||
| `choices` | List[[components.ChatResponseChoice](../components/chatresponsechoice.md)] | :heavy_check_mark: | N/A |
|
||||
| `created` | *float* | :heavy_check_mark: | N/A |
|
||||
| `model` | *str* | :heavy_check_mark: | N/A |
|
||||
| `object` | *Literal["chat.completion"]* | :heavy_check_mark: | N/A |
|
||||
| `system_fingerprint` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
||||
| `usage` | [Optional[components.ChatGenerationTokenUsage]](../components/chatgenerationtokenusage.md) | :heavy_minus_sign: | N/A |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `id` | *str* | :heavy_check_mark: | Unique completion identifier | chatcmpl-123 |
|
||||
| `choices` | List[[components.ChatResponseChoice](../components/chatresponsechoice.md)] | :heavy_check_mark: | List of completion choices | |
|
||||
| `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 |
|
||||
| `usage` | [Optional[components.ChatGenerationTokenUsage]](../components/chatgenerationtokenusage.md) | :heavy_minus_sign: | Token usage statistics | {<br/>"completion_tokens": 15,<br/>"prompt_tokens": 10,<br/>"total_tokens": 25,<br/>"completion_tokens_details": {<br/>"reasoning_tokens": 5<br/>},<br/>"prompt_tokens_details": {<br/>"cached_tokens": 2<br/>}<br/>} |
|
||||
@@ -1,11 +1,13 @@
|
||||
# ChatResponseChoice
|
||||
|
||||
Chat completion choice
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
||||
| `finish_reason` | [Nullable[components.ChatCompletionFinishReason]](../components/chatcompletionfinishreason.md) | :heavy_check_mark: | N/A |
|
||||
| `index` | *float* | :heavy_check_mark: | N/A |
|
||||
| `message` | [components.AssistantMessage](../components/assistantmessage.md) | :heavy_check_mark: | N/A |
|
||||
| `logprobs` | [OptionalNullable[components.ChatMessageTokenLogprobs]](../components/chatmessagetokenlogprobs.md) | :heavy_minus_sign: | N/A |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
|
||||
| `finish_reason` | *Nullable[Any]* | :heavy_check_mark: | N/A | |
|
||||
| `index` | *float* | :heavy_check_mark: | Choice index | 0 |
|
||||
| `message` | [components.AssistantMessage](../components/assistantmessage.md) | :heavy_check_mark: | Assistant message for requests and responses | {<br/>"role": "user",<br/>"content": "What is the capital of France?"<br/>} |
|
||||
| `logprobs` | [OptionalNullable[components.ChatMessageTokenLogprobs]](../components/chatmessagetokenlogprobs.md) | :heavy_minus_sign: | Log probabilities for the completion | {<br/>"content": [<br/>{<br/>"token": " Hello",<br/>"logprob": -0.612345,<br/>"bytes": null,<br/>"top_logprobs": []<br/>}<br/>],<br/>"refusal": null<br/>} |
|
||||
@@ -0,0 +1,8 @@
|
||||
# ChatResponseObject
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ----------------- | ----------------- |
|
||||
| `CHAT_COMPLETION` | chat.completion |
|
||||
@@ -1,11 +1,13 @@
|
||||
# ChatStreamingChoice
|
||||
|
||||
Streaming completion choice chunk
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
||||
| `delta` | [components.ChatStreamingMessageChunk](../components/chatstreamingmessagechunk.md) | :heavy_check_mark: | N/A |
|
||||
| `finish_reason` | [Nullable[components.ChatCompletionFinishReason]](../components/chatcompletionfinishreason.md) | :heavy_check_mark: | N/A |
|
||||
| `index` | *float* | :heavy_check_mark: | N/A |
|
||||
| `logprobs` | [OptionalNullable[components.ChatMessageTokenLogprobs]](../components/chatmessagetokenlogprobs.md) | :heavy_minus_sign: | N/A |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
|
||||
| `delta` | [components.ChatStreamingMessageChunk](../components/chatstreamingmessagechunk.md) | :heavy_check_mark: | Delta changes in streaming response | {<br/>"role": "assistant",<br/>"content": "Hello"<br/>} |
|
||||
| `finish_reason` | *Nullable[Any]* | :heavy_check_mark: | N/A | |
|
||||
| `index` | *float* | :heavy_check_mark: | Choice index | 0 |
|
||||
| `logprobs` | [OptionalNullable[components.ChatMessageTokenLogprobs]](../components/chatmessagetokenlogprobs.md) | :heavy_minus_sign: | Log probabilities for the completion | {<br/>"content": [<br/>{<br/>"token": " Hello",<br/>"logprob": -0.612345,<br/>"bytes": null,<br/>"top_logprobs": []<br/>}<br/>],<br/>"refusal": null<br/>} |
|
||||
@@ -1,13 +1,15 @@
|
||||
# ChatStreamingMessageChunk
|
||||
|
||||
Delta changes in streaming response
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
||||
| `role` | [Optional[components.ChatStreamingMessageChunkRole]](../components/chatstreamingmessagechunkrole.md) | :heavy_minus_sign: | N/A |
|
||||
| `content` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
||||
| `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
||||
| `refusal` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
||||
| `tool_calls` | List[[components.ChatStreamingMessageToolCall](../components/chatstreamingmessagetoolcall.md)] | :heavy_minus_sign: | N/A |
|
||||
| `reasoning_details` | List[[components.Schema2](../components/schema2.md)] | :heavy_minus_sign: | N/A |
|
||||
| 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 | <nil> |
|
||||
| `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 | |
|
||||
@@ -1,5 +1,7 @@
|
||||
# ChatStreamingMessageChunkRole
|
||||
|
||||
The role of the message author
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
# ChatStreamingMessageToolCall
|
||||
|
||||
Tool call delta for streaming responses
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
|
||||
| `index` | *float* | :heavy_check_mark: | N/A |
|
||||
| `id` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `type` | *Optional[Literal["function"]]* | :heavy_minus_sign: | N/A |
|
||||
| `function` | [Optional[components.ChatStreamingMessageToolCallFunction]](../components/chatstreamingmessagetoolcallfunction.md) | :heavy_minus_sign: | N/A |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
|
||||
| `index` | *float* | :heavy_check_mark: | Tool call index in the array | 0 |
|
||||
| `id` | *Optional[str]* | :heavy_minus_sign: | Tool call identifier | call_abc123 |
|
||||
| `type` | [Optional[components.ChatStreamingMessageToolCallType]](../components/chatstreamingmessagetoolcalltype.md) | :heavy_minus_sign: | Tool call type | function |
|
||||
| `function` | [Optional[components.ChatStreamingMessageToolCallFunction]](../components/chatstreamingmessagetoolcallfunction.md) | :heavy_minus_sign: | Function call details | |
|
||||
@@ -1,9 +1,11 @@
|
||||
# ChatStreamingMessageToolCallFunction
|
||||
|
||||
Function call details
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `name` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `arguments` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- |
|
||||
| `name` | *Optional[str]* | :heavy_minus_sign: | Function name | get_weather |
|
||||
| `arguments` | *Optional[str]* | :heavy_minus_sign: | Function arguments as JSON string | {"location": |
|
||||
@@ -0,0 +1,10 @@
|
||||
# ChatStreamingMessageToolCallType
|
||||
|
||||
Tool call type
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ---------- | ---------- |
|
||||
| `FUNCTION` | function |
|
||||
@@ -1,8 +1,17 @@
|
||||
# ChatStreamingResponseChunk
|
||||
|
||||
Streaming chat completion chunk
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
||||
| `data` | [components.ChatStreamingResponseChunkData](../components/chatstreamingresponsechunkdata.md) | :heavy_check_mark: | N/A |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `id` | *str* | :heavy_check_mark: | Unique chunk identifier | chatcmpl-123 |
|
||||
| `choices` | List[[components.ChatStreamingChoice](../components/chatstreamingchoice.md)] | :heavy_check_mark: | List of streaming chunk choices | |
|
||||
| `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 |
|
||||
| `error` | [Optional[components.Error]](../components/error.md) | :heavy_minus_sign: | Error information | {<br/>"message": "Rate limit exceeded",<br/>"code": 429<br/>} |
|
||||
| `usage` | [Optional[components.ChatGenerationTokenUsage]](../components/chatgenerationtokenusage.md) | :heavy_minus_sign: | Token usage statistics | {<br/>"completion_tokens": 15,<br/>"prompt_tokens": 10,<br/>"total_tokens": 25,<br/>"completion_tokens_details": {<br/>"reasoning_tokens": 5<br/>},<br/>"prompt_tokens_details": {<br/>"cached_tokens": 2<br/>}<br/>} |
|
||||
@@ -1,15 +0,0 @@
|
||||
# ChatStreamingResponseChunkData
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
||||
| `id` | *str* | :heavy_check_mark: | N/A |
|
||||
| `choices` | List[[components.ChatStreamingChoice](../components/chatstreamingchoice.md)] | :heavy_check_mark: | N/A |
|
||||
| `created` | *float* | :heavy_check_mark: | N/A |
|
||||
| `model` | *str* | :heavy_check_mark: | N/A |
|
||||
| `object` | *Literal["chat.completion.chunk"]* | :heavy_check_mark: | N/A |
|
||||
| `system_fingerprint` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
||||
| `error` | [Optional[components.ChatStreamingResponseChunkError]](../components/chatstreamingresponsechunkerror.md) | :heavy_minus_sign: | N/A |
|
||||
| `usage` | [Optional[components.ChatGenerationTokenUsage]](../components/chatgenerationtokenusage.md) | :heavy_minus_sign: | N/A |
|
||||
@@ -1,9 +0,0 @@
|
||||
# ChatStreamingResponseChunkError
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `message` | *str* | :heavy_check_mark: | N/A |
|
||||
| `code` | *float* | :heavy_check_mark: | N/A |
|
||||
@@ -0,0 +1,8 @@
|
||||
# ChatStreamingResponseChunkObject
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| ----------------------- | ----------------------- |
|
||||
| `CHAT_COMPLETION_CHUNK` | chat.completion.chunk |
|
||||
@@ -1,8 +1,10 @@
|
||||
# ChatStreamOptions
|
||||
|
||||
Streaming configuration options
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `include_usage` | *Optional[bool]* | :heavy_minus_sign: | N/A |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| ~~`include_usage`~~ | *Optional[bool]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.<br/><br/>Deprecated: This field has no effect. Full usage details are always included. | true |
|
||||
+21
-13
@@ -1,17 +1,25 @@
|
||||
# Code
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `str`
|
||||
|
||||
```python
|
||||
value: str = /* values here */
|
||||
```
|
||||
|
||||
### `float`
|
||||
|
||||
```python
|
||||
value: float = /* values here */
|
||||
```
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| -------------------------------- | -------------------------------- |
|
||||
| `SERVER_ERROR` | server_error |
|
||||
| `RATE_LIMIT_EXCEEDED` | rate_limit_exceeded |
|
||||
| `INVALID_PROMPT` | invalid_prompt |
|
||||
| `VECTOR_STORE_TIMEOUT` | vector_store_timeout |
|
||||
| `INVALID_IMAGE` | invalid_image |
|
||||
| `INVALID_IMAGE_FORMAT` | invalid_image_format |
|
||||
| `INVALID_BASE64_IMAGE` | invalid_base64_image |
|
||||
| `INVALID_IMAGE_URL` | invalid_image_url |
|
||||
| `IMAGE_TOO_LARGE` | image_too_large |
|
||||
| `IMAGE_TOO_SMALL` | image_too_small |
|
||||
| `IMAGE_PARSE_ERROR` | image_parse_error |
|
||||
| `IMAGE_CONTENT_POLICY_VIOLATION` | image_content_policy_violation |
|
||||
| `INVALID_IMAGE_MODE` | invalid_image_mode |
|
||||
| `IMAGE_FILE_TOO_LARGE` | image_file_too_large |
|
||||
| `UNSUPPORTED_IMAGE_MEDIA_TYPE` | unsupported_image_media_type |
|
||||
| `EMPTY_IMAGE_FILE` | empty_image_file |
|
||||
| `FAILED_TO_DOWNLOAD_IMAGE` | failed_to_download_image |
|
||||
| `IMAGE_FILE_NOT_FOUND` | image_file_not_found |
|
||||
@@ -1,25 +0,0 @@
|
||||
# CodeEnum
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
| Name | Value |
|
||||
| -------------------------------- | -------------------------------- |
|
||||
| `SERVER_ERROR` | server_error |
|
||||
| `RATE_LIMIT_EXCEEDED` | rate_limit_exceeded |
|
||||
| `INVALID_PROMPT` | invalid_prompt |
|
||||
| `VECTOR_STORE_TIMEOUT` | vector_store_timeout |
|
||||
| `INVALID_IMAGE` | invalid_image |
|
||||
| `INVALID_IMAGE_FORMAT` | invalid_image_format |
|
||||
| `INVALID_BASE64_IMAGE` | invalid_base64_image |
|
||||
| `INVALID_IMAGE_URL` | invalid_image_url |
|
||||
| `IMAGE_TOO_LARGE` | image_too_large |
|
||||
| `IMAGE_TOO_SMALL` | image_too_small |
|
||||
| `IMAGE_PARSE_ERROR` | image_parse_error |
|
||||
| `IMAGE_CONTENT_POLICY_VIOLATION` | image_content_policy_violation |
|
||||
| `INVALID_IMAGE_MODE` | invalid_image_mode |
|
||||
| `IMAGE_FILE_TOO_LARGE` | image_file_too_large |
|
||||
| `UNSUPPORTED_IMAGE_MEDIA_TYPE` | unsupported_image_media_type |
|
||||
| `EMPTY_IMAGE_FILE` | empty_image_file |
|
||||
| `FAILED_TO_DOWNLOAD_IMAGE` | failed_to_download_image |
|
||||
| `IMAGE_FILE_NOT_FOUND` | image_file_not_found |
|
||||
@@ -1,13 +0,0 @@
|
||||
# CompletionChoice
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
||||
| `text` | *str* | :heavy_check_mark: | N/A |
|
||||
| `index` | *float* | :heavy_check_mark: | N/A |
|
||||
| `logprobs` | [Nullable[components.CompletionLogprobs]](../components/completionlogprobs.md) | :heavy_check_mark: | N/A |
|
||||
| `finish_reason` | [Nullable[components.CompletionFinishReason]](../components/completionfinishreason.md) | :heavy_check_mark: | N/A |
|
||||
| `native_finish_reason` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
||||
@@ -1,28 +0,0 @@
|
||||
# CompletionCreateParams
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `model` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `models` | List[*str*] | :heavy_minus_sign: | N/A |
|
||||
| `prompt` | [components.Prompt](../components/prompt.md) | :heavy_check_mark: | N/A |
|
||||
| `best_of` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
|
||||
| `echo` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
|
||||
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `logit_bias` | Dict[str, *float*] | :heavy_minus_sign: | N/A |
|
||||
| `logprobs` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
|
||||
| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
|
||||
| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
|
||||
| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
|
||||
| `stop` | [OptionalNullable[components.CompletionCreateParamsStop]](../components/completioncreateparamsstop.md) | :heavy_minus_sign: | N/A |
|
||||
| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A |
|
||||
| `stream_options` | [OptionalNullable[components.StreamOptions]](../components/streamoptions.md) | :heavy_minus_sign: | N/A |
|
||||
| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
|
||||
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `user` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | N/A |
|
||||
| `response_format` | [OptionalNullable[components.CompletionCreateParamsResponseFormatUnion]](../components/completioncreateparamsresponseformatunion.md) | :heavy_minus_sign: | N/A |
|
||||
@@ -1,8 +0,0 @@
|
||||
# CompletionCreateParamsResponseFormatJSONObject
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------ | ------------------------ | ------------------------ | ------------------------ |
|
||||
| `type` | *Literal["json_object"]* | :heavy_check_mark: | N/A |
|
||||
@@ -1,8 +0,0 @@
|
||||
# CompletionCreateParamsResponseFormatPython
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------- | ------------------- | ------------------- | ------------------- |
|
||||
| `type` | *Literal["python"]* | :heavy_check_mark: | N/A |
|
||||
@@ -1,8 +0,0 @@
|
||||
# CompletionCreateParamsResponseFormatText
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `type` | *Literal["text"]* | :heavy_check_mark: | N/A |
|
||||
@@ -1,35 +0,0 @@
|
||||
# CompletionCreateParamsResponseFormatUnion
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `components.CompletionCreateParamsResponseFormatText`
|
||||
|
||||
```python
|
||||
value: components.CompletionCreateParamsResponseFormatText = /* values here */
|
||||
```
|
||||
|
||||
### `components.CompletionCreateParamsResponseFormatJSONObject`
|
||||
|
||||
```python
|
||||
value: components.CompletionCreateParamsResponseFormatJSONObject = /* values here */
|
||||
```
|
||||
|
||||
### `components.ResponseFormatJSONSchema`
|
||||
|
||||
```python
|
||||
value: components.ResponseFormatJSONSchema = /* values here */
|
||||
```
|
||||
|
||||
### `components.ResponseFormatTextGrammar`
|
||||
|
||||
```python
|
||||
value: components.ResponseFormatTextGrammar = /* values here */
|
||||
```
|
||||
|
||||
### `components.CompletionCreateParamsResponseFormatPython`
|
||||
|
||||
```python
|
||||
value: components.CompletionCreateParamsResponseFormatPython = /* values here */
|
||||
```
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
# CompletionCreateParamsStop
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `str`
|
||||
|
||||
```python
|
||||
value: str = /* values here */
|
||||
```
|
||||
|
||||
### `List[str]`
|
||||
|
||||
```python
|
||||
value: List[str] = /* values here */
|
||||
```
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user