From f2d057334288ed27131e63fa78b981e32fdb5b5b Mon Sep 17 00:00:00 2001 From: Matt Apperson Date: Tue, 18 Nov 2025 13:32:22 -0500 Subject: [PATCH 1/2] add plugins and providers --- .speakeasy/gen.lock | 85 +- .speakeasy/gen.yaml | 2 +- .speakeasy/in.openapi.yaml | 1043 +++++++++++++---- .speakeasy/out.openapi.yaml | 1038 ++++++++++++---- .speakeasy/workflow.lock | 13 +- docs/models/assistantmessagecontent.md | 6 +- docs/models/chatcompletionfinishreason.md | 17 - docs/models/chatgenerationparams.md | 50 +- .../chatgenerationparamsdatacollection.md | 17 + ...ngine.md => chatgenerationparamsengine.md} | 6 +- docs/models/chatgenerationparamsmaxprice.md | 21 + docs/models/chatgenerationparamspdf.md | 15 + docs/models/chatgenerationparamspdfengine.md | 17 + .../chatgenerationparamspluginfileparser.md | 19 + .../chatgenerationparamspluginmoderation.md | 17 + .../models/chatgenerationparamspluginunion.md | 29 + docs/models/chatgenerationparamspluginweb.md | 20 + docs/models/chatgenerationparamsprovider.md | 25 + .../chatgenerationparamsquantizations.md | 17 + .../sort.md => chatgenerationparamssort.md} | 8 +- docs/models/chatmessagecontentitem.md | 17 +- docs/models/chatmessagecontentitemimage.md | 2 +- docs/models/chatmessagecontentitemvideo.md | 26 +- .../chatmessagecontentitemvideoinputvideo.md | 21 + .../chatmessagecontentitemvideovideourl.md | 21 + docs/models/chatresponsechoice.md | 16 +- docs/models/chatstreamingchoice.md | 16 +- docs/models/chatstreamingresponsechunk.md | 4 +- docs/models/completioncreateparams.md | 48 +- .../completioncreateparamsdatacollection.md | 17 + docs/models/completioncreateparamsengine.md | 17 + docs/models/completioncreateparamsmaxprice.md | 21 + docs/models/completioncreateparamspdf.md | 15 + .../models/completioncreateparamspdfengine.md | 17 + .../completioncreateparamspluginfileparser.md | 19 + .../completioncreateparamspluginmoderation.md | 17 + .../completioncreateparamspluginunion.md | 29 + .../models/completioncreateparamspluginweb.md | 20 + docs/models/completioncreateparamsprovider.md | 25 + .../completioncreateparamsquantizations.md | 17 + docs/models/completioncreateparamssort.md | 17 + docs/models/datacollection.md | 4 +- docs/models/effort.md | 4 +- docs/models/ignore.md | 17 - docs/models/maxprice.md | 21 - docs/models/openairesponsesreasoningeffort.md | 2 +- docs/models/openresponsesreasoningformat.md | 2 +- docs/models/openresponsesrequest.md | 4 +- docs/models/openresponsesrequestengine.md | 17 + docs/models/openresponsesrequestmaxprice.md | 21 + docs/models/openresponsesrequestpdf.md | 15 + ...ne.md => openresponsesrequestpdfengine.md} | 6 +- .../openresponsesrequestpluginfileparser.md | 19 + ...> openresponsesrequestpluginmoderation.md} | 6 +- .../models/openresponsesrequestpluginunion.md | 29 + docs/models/openresponsesrequestpluginweb.md | 20 + ...der.md => openresponsesrequestprovider.md} | 18 +- docs/models/operations/content.md | 25 + docs/models/operations/contentimageurl.md | 21 + docs/models/operations/contenttext.md | 19 + .../operations/createembeddingsprovider.md | 10 +- .../operations/createembeddingsrequest.md | 18 +- docs/models/operations/datacollection.md | 22 - docs/models/operations/encodingformat.md | 18 +- .../models/operations/encodingformatbase64.md | 15 - docs/models/operations/encodingformatfloat.md | 15 - .../operations/getparametersprovider.md | 4 +- docs/models/operations/ignore.md | 17 - docs/models/operations/imageurl.md | 17 + docs/models/operations/input.md | 48 +- docs/models/operations/inputunion.md | 57 + docs/models/operations/maxprice.md | 14 +- docs/models/operations/only.md | 17 - docs/models/operations/order.md | 17 - docs/models/operations/typeimageurl.md | 15 + docs/models/operations/typetext.md | 15 + docs/models/order.md | 17 - docs/models/pdf.md | 15 - docs/models/plugin.md | 29 - docs/models/pluginfileparser.md | 19 - docs/models/pluginweb.md | 20 - docs/models/pricing.md | 31 +- docs/models/providername.md | 2 +- docs/models/{sort.md => providersort.md} | 6 +- docs/models/publicpricing.md | 29 +- docs/models/{only.md => schema0.md} | 6 +- docs/models/schema0enum.md | 17 + docs/models/toolresponsemessagecontent.md | 6 +- docs/models/usermessagecontent.md | 6 +- docs/models/videourl1.md | 17 + docs/models/{videourl.md => videourl2.md} | 8 +- jsr.json | 2 +- package-lock.json | 4 +- package.json | 2 +- src/lib/config.ts | 6 +- src/models/chatcompletionfinishreason.ts | 24 - src/models/chatgenerationparams.ts | 419 +++++++ src/models/chatmessagecontentitem.ts | 12 +- src/models/chatmessagecontentitemvideo.ts | 184 ++- src/models/chatresponsechoice.ts | 9 +- src/models/chatstreamingchoice.ts | 9 +- src/models/completioncreateparams.ts | 423 +++++++ src/models/datacollection.ts | 33 + src/models/index.ts | 4 +- src/models/openairesponsesreasoningeffort.ts | 1 + src/models/openresponsesreasoning.ts | 1 + src/models/openresponsesrequest.ts | 397 +++---- src/models/operations/createembeddings.ts | 332 +++--- src/models/operations/createkeys.ts | 2 +- src/models/operations/getcurrentkey.ts | 2 +- src/models/operations/getkey.ts | 2 +- src/models/operations/getparameters.ts | 10 +- src/models/operations/list.ts | 2 +- src/models/operations/updatekeys.ts | 2 +- src/models/providername.ts | 31 +- src/models/providersort.ts | 24 + src/models/publicendpoint.ts | 36 +- src/models/publicpricing.ts | 36 +- src/models/schema0.ts | 110 ++ 119 files changed, 4257 insertions(+), 1546 deletions(-) delete mode 100644 docs/models/chatcompletionfinishreason.md create mode 100644 docs/models/chatgenerationparamsdatacollection.md rename docs/models/{engine.md => chatgenerationparamsengine.md} (58%) create mode 100644 docs/models/chatgenerationparamsmaxprice.md create mode 100644 docs/models/chatgenerationparamspdf.md create mode 100644 docs/models/chatgenerationparamspdfengine.md create mode 100644 docs/models/chatgenerationparamspluginfileparser.md create mode 100644 docs/models/chatgenerationparamspluginmoderation.md create mode 100644 docs/models/chatgenerationparamspluginunion.md create mode 100644 docs/models/chatgenerationparamspluginweb.md create mode 100644 docs/models/chatgenerationparamsprovider.md create mode 100644 docs/models/chatgenerationparamsquantizations.md rename docs/models/{operations/sort.md => chatgenerationparamssort.md} (52%) create mode 100644 docs/models/chatmessagecontentitemvideoinputvideo.md create mode 100644 docs/models/chatmessagecontentitemvideovideourl.md create mode 100644 docs/models/completioncreateparamsdatacollection.md create mode 100644 docs/models/completioncreateparamsengine.md create mode 100644 docs/models/completioncreateparamsmaxprice.md create mode 100644 docs/models/completioncreateparamspdf.md create mode 100644 docs/models/completioncreateparamspdfengine.md create mode 100644 docs/models/completioncreateparamspluginfileparser.md create mode 100644 docs/models/completioncreateparamspluginmoderation.md create mode 100644 docs/models/completioncreateparamspluginunion.md create mode 100644 docs/models/completioncreateparamspluginweb.md create mode 100644 docs/models/completioncreateparamsprovider.md create mode 100644 docs/models/completioncreateparamsquantizations.md create mode 100644 docs/models/completioncreateparamssort.md delete mode 100644 docs/models/ignore.md delete mode 100644 docs/models/maxprice.md create mode 100644 docs/models/openresponsesrequestengine.md create mode 100644 docs/models/openresponsesrequestmaxprice.md create mode 100644 docs/models/openresponsesrequestpdf.md rename docs/models/{pdfengine.md => openresponsesrequestpdfengine.md} (59%) create mode 100644 docs/models/openresponsesrequestpluginfileparser.md rename docs/models/{pluginmoderation.md => openresponsesrequestpluginmoderation.md} (80%) create mode 100644 docs/models/openresponsesrequestpluginunion.md create mode 100644 docs/models/openresponsesrequestpluginweb.md rename docs/models/{provider.md => openresponsesrequestprovider.md} (93%) create mode 100644 docs/models/operations/content.md create mode 100644 docs/models/operations/contentimageurl.md create mode 100644 docs/models/operations/contenttext.md delete mode 100644 docs/models/operations/datacollection.md delete mode 100644 docs/models/operations/encodingformatbase64.md delete mode 100644 docs/models/operations/encodingformatfloat.md delete mode 100644 docs/models/operations/ignore.md create mode 100644 docs/models/operations/imageurl.md create mode 100644 docs/models/operations/inputunion.md delete mode 100644 docs/models/operations/only.md delete mode 100644 docs/models/operations/order.md create mode 100644 docs/models/operations/typeimageurl.md create mode 100644 docs/models/operations/typetext.md delete mode 100644 docs/models/order.md delete mode 100644 docs/models/pdf.md delete mode 100644 docs/models/plugin.md delete mode 100644 docs/models/pluginfileparser.md delete mode 100644 docs/models/pluginweb.md rename docs/models/{sort.md => providersort.md} (76%) rename docs/models/{only.md => schema0.md} (57%) create mode 100644 docs/models/schema0enum.md create mode 100644 docs/models/videourl1.md rename docs/models/{videourl.md => videourl2.md} (70%) delete mode 100644 src/models/chatcompletionfinishreason.ts create mode 100644 src/models/datacollection.ts create mode 100644 src/models/providersort.ts create mode 100644 src/models/schema0.ts diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 27524edd..cee1ab6a 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 8b6cd71c-ea04-44da-af45-e43968b5928d management: - docChecksum: bc2a17a8bdced4449c22e8cb27f02be5 + docChecksum: 44cd1f9d56cdf4f436acedb547101641 docVersion: 1.0.0 - speakeasyVersion: 1.654.0 - generationVersion: 2.750.0 - releaseVersion: 0.1.11 - configChecksum: f7e503f7b6144914db85599585462a92 + speakeasyVersion: 1.658.2 + generationVersion: 2.755.9 + releaseVersion: 0.1.12 + configChecksum: 58991a7987fc75734e6147cc87d5e7fd repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true @@ -15,7 +15,7 @@ features: acceptHeaders: 2.81.2 additionalDependencies: 0.1.0 constsAndDefaults: 0.1.12 - core: 3.26.5 + core: 3.26.7 customCodeRegions: 0.1.0 defaultEnabledRetries: 0.1.0 deprecations: 2.81.1 @@ -57,13 +57,24 @@ generatedFiles: - docs/models/badgatewayresponseerrordata.md - docs/models/badrequestresponseerrordata.md - docs/models/chainid.md - - docs/models/chatcompletionfinishreason.md - docs/models/chaterrorerror.md - docs/models/chatgenerationparams.md + - docs/models/chatgenerationparamsdatacollection.md + - docs/models/chatgenerationparamsengine.md + - docs/models/chatgenerationparamsmaxprice.md + - docs/models/chatgenerationparamspdf.md + - docs/models/chatgenerationparamspdfengine.md + - docs/models/chatgenerationparamspluginfileparser.md + - docs/models/chatgenerationparamspluginmoderation.md + - docs/models/chatgenerationparamspluginunion.md + - docs/models/chatgenerationparamspluginweb.md + - docs/models/chatgenerationparamsprovider.md + - docs/models/chatgenerationparamsquantizations.md - docs/models/chatgenerationparamsresponseformatjsonobject.md - docs/models/chatgenerationparamsresponseformatpython.md - docs/models/chatgenerationparamsresponseformattext.md - docs/models/chatgenerationparamsresponseformatunion.md + - docs/models/chatgenerationparamssort.md - docs/models/chatgenerationparamsstop.md - docs/models/chatgenerationtokenusage.md - docs/models/chatmessagecontentitem.md @@ -74,6 +85,8 @@ generatedFiles: - docs/models/chatmessagecontentitemimagedetail.md - docs/models/chatmessagecontentitemtext.md - docs/models/chatmessagecontentitemvideo.md + - docs/models/chatmessagecontentitemvideoinputvideo.md + - docs/models/chatmessagecontentitemvideovideourl.md - docs/models/chatmessagetokenlogprob.md - docs/models/chatmessagetokenlogprobs.md - docs/models/chatmessagetoolcall.md @@ -93,10 +106,22 @@ generatedFiles: - docs/models/codeenum.md - docs/models/completionchoice.md - docs/models/completioncreateparams.md + - docs/models/completioncreateparamsdatacollection.md + - docs/models/completioncreateparamsengine.md + - docs/models/completioncreateparamsmaxprice.md + - docs/models/completioncreateparamspdf.md + - docs/models/completioncreateparamspdfengine.md + - docs/models/completioncreateparamspluginfileparser.md + - docs/models/completioncreateparamspluginmoderation.md + - docs/models/completioncreateparamspluginunion.md + - docs/models/completioncreateparamspluginweb.md + - docs/models/completioncreateparamsprovider.md + - docs/models/completioncreateparamsquantizations.md - docs/models/completioncreateparamsresponseformatjsonobject.md - docs/models/completioncreateparamsresponseformatpython.md - docs/models/completioncreateparamsresponseformattext.md - docs/models/completioncreateparamsresponseformatunion.md + - docs/models/completioncreateparamssort.md - docs/models/completioncreateparamsstop.md - docs/models/completionfinishreason.md - docs/models/completionlogprobs.md @@ -110,7 +135,6 @@ generatedFiles: - docs/models/edgenetworktimeoutresponseerrordata.md - docs/models/effort.md - docs/models/endpointstatus.md - - docs/models/engine.md - docs/models/errors/badgatewayresponseerror.md - docs/models/errors/badrequestresponseerror.md - docs/models/errors/chaterror.md @@ -134,7 +158,6 @@ generatedFiles: - docs/models/idfileparser.md - docs/models/idmoderation.md - docs/models/idweb.md - - docs/models/ignore.md - docs/models/imagegenerationstatus.md - docs/models/imageurl.md - docs/models/inputmodality.md @@ -143,7 +166,6 @@ generatedFiles: - docs/models/internalserverresponseerrordata.md - docs/models/jsonschemaconfig.md - docs/models/listendpointsresponse.md - - docs/models/maxprice.md - docs/models/message.md - docs/models/messagecontent.md - docs/models/messagedeveloper.md @@ -158,7 +180,6 @@ generatedFiles: - docs/models/namedtoolchoicefunction.md - docs/models/notfoundresponseerrordata.md - docs/models/objectt.md - - docs/models/only.md - docs/models/openairesponsesannotation.md - docs/models/openairesponsesincludable.md - docs/models/openairesponsesincompletedetails.md @@ -257,6 +278,15 @@ generatedFiles: - docs/models/openresponsesreasoningsummarytextdoneeventtype.md - docs/models/openresponsesreasoningtype.md - docs/models/openresponsesrequest.md + - docs/models/openresponsesrequestengine.md + - docs/models/openresponsesrequestmaxprice.md + - docs/models/openresponsesrequestpdf.md + - docs/models/openresponsesrequestpdfengine.md + - docs/models/openresponsesrequestpluginfileparser.md + - docs/models/openresponsesrequestpluginmoderation.md + - docs/models/openresponsesrequestpluginunion.md + - docs/models/openresponsesrequestpluginweb.md + - docs/models/openresponsesrequestprovider.md - docs/models/openresponsesrequesttoolfunction.md - docs/models/openresponsesrequesttoolunion.md - docs/models/openresponsesrequesttype.md @@ -294,6 +324,9 @@ generatedFiles: - docs/models/openresponseswebsearchtooltype.md - docs/models/operations/apitype.md - docs/models/operations/calldata.md + - docs/models/operations/content.md + - docs/models/operations/contentimageurl.md + - docs/models/operations/contenttext.md - docs/models/operations/createauthkeyscodecodechallengemethod.md - docs/models/operations/createauthkeyscodedata.md - docs/models/operations/createauthkeyscoderequest.md @@ -312,13 +345,10 @@ generatedFiles: - docs/models/operations/createkeysresponse.md - docs/models/operations/createresponsesresponse.md - docs/models/operations/createresponsesresponsebody.md - - docs/models/operations/datacollection.md - docs/models/operations/deletekeysrequest.md - docs/models/operations/deletekeysresponse.md - docs/models/operations/embedding.md - docs/models/operations/encodingformat.md - - docs/models/operations/encodingformatbase64.md - - docs/models/operations/encodingformatfloat.md - docs/models/operations/exchangeauthcodeforapikeycodechallengemethod.md - docs/models/operations/exchangeauthcodeforapikeyrequest.md - docs/models/operations/exchangeauthcodeforapikeyresponse.md @@ -339,8 +369,9 @@ generatedFiles: - docs/models/operations/getparameterssecurity.md - docs/models/operations/getuseractivityrequest.md - docs/models/operations/getuseractivityresponse.md - - docs/models/operations/ignore.md + - docs/models/operations/imageurl.md - docs/models/operations/input.md + - docs/models/operations/inputunion.md - docs/models/operations/listdata.md - docs/models/operations/listendpointsrequest.md - docs/models/operations/listendpointsresponse.md @@ -354,13 +385,12 @@ generatedFiles: - docs/models/operations/metadata.md - docs/models/operations/objectembedding.md - docs/models/operations/objectt.md - - docs/models/operations/only.md - - docs/models/operations/order.md - docs/models/operations/ratelimit.md - docs/models/operations/sendchatcompletionrequestresponse.md - - docs/models/operations/sort.md - docs/models/operations/supportedparameter.md - docs/models/operations/transferintent.md + - docs/models/operations/typeimageurl.md + - docs/models/operations/typetext.md - docs/models/operations/updatekeysdata.md - docs/models/operations/updatekeyslimitreset.md - docs/models/operations/updatekeysrequest.md @@ -368,7 +398,6 @@ generatedFiles: - docs/models/operations/updatekeysresponse.md - docs/models/operations/usage.md - docs/models/operations/web3data.md - - docs/models/order.md - docs/models/outputitemimagegenerationcall.md - docs/models/outputitemimagegenerationcalltype.md - docs/models/outputmessage.md @@ -386,19 +415,13 @@ generatedFiles: - docs/models/part2.md - docs/models/payloadtoolargeresponseerrordata.md - docs/models/paymentrequiredresponseerrordata.md - - docs/models/pdf.md - - docs/models/pdfengine.md - docs/models/perrequestlimits.md - - docs/models/plugin.md - - docs/models/pluginfileparser.md - - docs/models/pluginmoderation.md - - docs/models/pluginweb.md - docs/models/pricing.md - docs/models/prompt.md - docs/models/prompttokensdetails.md - - docs/models/provider.md - docs/models/providername.md - docs/models/provideroverloadedresponseerrordata.md + - docs/models/providersort.md - docs/models/publicendpoint.md - docs/models/publicendpointquantization.md - docs/models/publicpricing.md @@ -466,10 +489,11 @@ generatedFiles: - docs/models/responseswebsearchuserlocationtype.md - docs/models/responsetextconfig.md - docs/models/responsetextconfigverbosity.md + - docs/models/schema0.md + - docs/models/schema0enum.md - docs/models/security.md - docs/models/servicetier.md - docs/models/serviceunavailableresponseerrordata.md - - docs/models/sort.md - docs/models/streamoptions.md - docs/models/systemmessage.md - docs/models/systemmessagecontent.md @@ -508,7 +532,8 @@ generatedFiles: - docs/models/usermessage.md - docs/models/usermessagecontent.md - docs/models/variables.md - - docs/models/videourl.md + - docs/models/videourl1.md + - docs/models/videourl2.md - docs/models/websearchpreviewtooluserlocation.md - docs/models/websearchpreviewtooluserlocationtype.md - docs/models/websearchstatus.md @@ -582,7 +607,6 @@ generatedFiles: - src/models/assistantmessage.ts - src/models/badgatewayresponseerrordata.ts - src/models/badrequestresponseerrordata.ts - - src/models/chatcompletionfinishreason.ts - src/models/chaterror.ts - src/models/chatgenerationparams.ts - src/models/chatgenerationtokenusage.ts @@ -607,6 +631,7 @@ generatedFiles: - src/models/completionresponse.ts - src/models/completionusage.ts - src/models/createchargerequest.ts + - src/models/datacollection.ts - src/models/defaultparameters.ts - src/models/edgenetworktimeoutresponseerrordata.ts - src/models/endpointstatus.ts @@ -720,6 +745,7 @@ generatedFiles: - src/models/perrequestlimits.ts - src/models/providername.ts - src/models/provideroverloadedresponseerrordata.ts + - src/models/providersort.ts - src/models/publicendpoint.ts - src/models/publicpricing.ts - src/models/quantization.ts @@ -749,6 +775,7 @@ generatedFiles: - src/models/responseswebsearchcalloutput.ts - src/models/responseswebsearchuserlocation.ts - src/models/responsetextconfig.ts + - src/models/schema0.ts - src/models/security.ts - src/models/serviceunavailableresponseerrordata.ts - src/models/systemmessage.ts diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index eadf15d5..92245f09 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -30,7 +30,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: false typescript: - version: 0.1.11 + version: 0.1.12 acceptHeaderEnum: false additionalDependencies: dependencies: {} diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml index 3923d43c..282166ba 100644 --- a/.speakeasy/in.openapi.yaml +++ b/.speakeasy/in.openapi.yaml @@ -1058,6 +1058,7 @@ components: - medium - low - minimal + - none ReasoningSummaryVerbosity: type: string enum: @@ -3224,6 +3225,7 @@ components: - openai-responses-v1 - xai-responses-v1 - anthropic-claude-v1 + - google-gemini-v1 example: type: reasoning id: reasoning-abc123 @@ -3423,96 +3425,21 @@ components: - computer_call_output.output.image_url - reasoning.encrypted_content - code_interpreter_call.outputs - ProviderName: + DataCollection: type: string + nullable: true enum: - - AnyScale - - Cent-ML - - HuggingFace - - Hyperbolic 2 - - Lepton - - Lynn 2 - - Lynn - - Mancer - - Modal - - OctoAI - - Recursal - - Reflection - - Replicate - - SambaNova 2 - - SF Compute - - Together 2 - - 01.AI - - AI21 - - AionLabs - - Alibaba - - Amazon Bedrock - - Anthropic - - AtlasCloud - - Atoma - - Avian - - Azure - - BaseTen - - Cerebras - - Chutes - - Cirrascale - - Clarifai - - Cloudflare - - Cohere - - CrofAI - - Crusoe - - DeepInfra - - DeepSeek - - Enfer - - Featherless - - Fireworks - - Friendli - - GMICloud - - Google - - Google AI Studio - - Groq - - Hyperbolic - - Inception - - InferenceNet - - Infermatic - - Inflection - - InoCloud - - Kluster - - Lambda - - Liquid - - Mancer 2 - - Meta - - Minimax - - ModelRun - - Mistral - - Modular - - Moonshot AI - - Morph - - NCompass - - Nebius - - NextBit - - Nineteen - - Novita - - Nvidia - - OpenAI - - OpenInference - - Parasail - - Perplexity - - Phala - - Relace - - SambaNova - - SiliconFlow - - Stealth - - Switchpoint - - Targon - - Together - - Ubicloud - - Venice - - WandB - - xAI - - Z.AI - - FakeProvider - example: OpenAI + - deny + - allow + description: >- + Data collection setting. If no available model provider meets the requirement, your request will return an + error. + + - allow: (default) allow providers which store user data non-transiently and may train on it + + + - deny: use only providers which do not collect user data. + example: allow Quantization: type: string enum: @@ -3526,14 +3453,17 @@ components: - fp32 - unknown example: fp16 - BigNumberUnion: - anyOf: - - type: number - - type: string - - type: number - example: 1000 - description: A value in string or number format that is a large number - example: 1000 + ProviderSort: + type: string + nullable: true + enum: + - price + - throughput + - latency + description: >- + The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is + performed. + example: price OpenResponsesRequest: type: object properties: @@ -3664,19 +3594,7 @@ components: is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. data_collection: - type: string - nullable: true - enum: - - deny - - allow - example: deny - description: > - Data collection setting. If no available model provider meets the requirement, your request will return - an error. - - - allow: (default) allow providers which store user data non-transiently and may train on it - - - deny: use only providers which do not collect user data. + $ref: '#/components/schemas/DataCollection' zdr: type: boolean nullable: true @@ -3693,35 +3611,35 @@ components: example: true order: type: array - nullable: true items: - anyOf: - - $ref: '#/components/schemas/ProviderName' - - type: string + type: string description: >- An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. + example: + - OpenAI + - Anthropic only: type: array - nullable: true items: - anyOf: - - $ref: '#/components/schemas/ProviderName' - - type: string + type: string description: >- List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. + example: + - OpenAI + - Anthropic ignore: type: array - nullable: true items: - anyOf: - - $ref: '#/components/schemas/ProviderName' - - type: string + type: string description: >- List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. + example: + - OpenAI + - Anthropic quantizations: type: array nullable: true @@ -3729,29 +3647,45 @@ components: $ref: '#/components/schemas/Quantization' description: A list of quantization levels to filter the provider by. sort: - type: string - nullable: true - enum: - - price - - throughput - - latency - example: price - description: >- - The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing - is performed. + $ref: '#/components/schemas/ProviderSort' max_price: type: object properties: prompt: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 completion: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 image: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 audio: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 request: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 additionalProperties: false description: >- The object specifying the maximum price you want to pay for this request. USD price per million tokens, @@ -3963,27 +3897,89 @@ components: type: object properties: prompt: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 completion: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 request: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 image: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 + image_token: + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 image_output: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 audio: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 input_audio_cache: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 web_search: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 internal_reasoning: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 input_cache_read: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 input_cache_write: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 discount: type: number required: @@ -4377,6 +4373,72 @@ components: - qwq - qwen3 description: Instruction format type + ProviderName: + type: string + enum: + - AI21 + - AionLabs + - Alibaba + - Amazon Bedrock + - Anthropic + - Arcee + - AtlasCloud + - Avian + - Azure + - BaseTen + - Black Forest Labs + - Cerebras + - Chutes + - Cirrascale + - Clarifai + - Cloudflare + - Cohere + - Crusoe + - DeepInfra + - DeepSeek + - Featherless + - Fireworks + - Friendli + - GMICloud + - Google + - Google AI Studio + - Groq + - Hyperbolic + - Inception + - InferenceNet + - Infermatic + - Inflection + - Liquid + - Mancer 2 + - Minimax + - ModelRun + - Mistral + - Modular + - Moonshot AI + - Morph + - NCompass + - Nebius + - NextBit + - Novita + - Nvidia + - OpenAI + - OpenInference + - Parasail + - Perplexity + - Phala + - Relace + - SambaNova + - SiliconFlow + - Stealth + - Switchpoint + - Targon + - Together + - Venice + - WandB + - xAI + - Z.AI + - FakeProvider + example: OpenAI EndpointStatus: type: integer enum: @@ -4400,27 +4462,89 @@ components: type: object properties: prompt: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 completion: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 request: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 image: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 + image_token: + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 image_output: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 audio: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 input_audio_cache: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 web_search: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 internal_reasoning: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 input_cache_read: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 input_cache_write: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 discount: type: number required: @@ -4591,9 +4715,81 @@ components: uptime_last_30m: 99.5 supports_implicit_caching: true __schema0: - anyOf: - - $ref: '#/components/schemas/ChatCompletionFinishReason' - - type: 'null' + type: array + items: + anyOf: + - type: string + enum: + - AI21 + - AionLabs + - Alibaba + - Amazon Bedrock + - Anthropic + - Arcee + - AtlasCloud + - Avian + - Azure + - BaseTen + - Black Forest Labs + - Cerebras + - Chutes + - Cirrascale + - Clarifai + - Cloudflare + - Cohere + - Crusoe + - DeepInfra + - DeepSeek + - Featherless + - Fireworks + - Friendli + - GMICloud + - Google + - Google AI Studio + - Groq + - Hyperbolic + - Inception + - InferenceNet + - Infermatic + - Inflection + - Liquid + - Mancer 2 + - Minimax + - ModelRun + - Mistral + - Modular + - Moonshot AI + - Morph + - NCompass + - Nebius + - NextBit + - Novita + - Nvidia + - OpenAI + - OpenInference + - Parasail + - Perplexity + - Phala + - Relace + - SambaNova + - SiliconFlow + - Stealth + - Switchpoint + - Targon + - Together + - Venice + - WandB + - xAI + - Z.AI + - FakeProvider + - type: string + __schema1: + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 ModelName: type: string ChatMessageContentItemText: @@ -4657,21 +4853,38 @@ components: - type - input_audio ChatMessageContentItemVideo: - type: object - properties: - type: - type: string - const: input_video - video_url: - type: object + oneOf: + - type: object properties: - url: + type: type: string + const: input_video + video_url: + type: object + properties: + url: + type: string + required: + - url required: - - url - required: - - type - - video_url + - type + - video_url + - type: object + properties: + type: + type: string + const: video_url + video_url: + type: object + properties: + url: + type: string + required: + - url + required: + - type + - video_url + type: object ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/ChatMessageContentItemText' @@ -4686,6 +4899,7 @@ components: image_url: '#/components/schemas/ChatMessageContentItemImage' input_audio: '#/components/schemas/ChatMessageContentItemAudio' input_video: '#/components/schemas/ChatMessageContentItemVideo' + video_url: '#/components/schemas/ChatMessageContentItemVideo' ChatMessageToolCall: type: object properties: @@ -4808,14 +5022,6 @@ components: - completion_tokens - prompt_tokens - total_tokens - ChatCompletionFinishReason: - type: string - enum: - - tool_calls - - stop - - length - - content_filter - - error JSONSchemaConfig: type: object properties: @@ -5023,6 +5229,167 @@ components: ChatGenerationParams: type: object properties: + plugins: + type: array + items: + oneOf: + - type: object + properties: + id: + type: string + const: moderation + required: + - id + - type: object + properties: + id: + type: string + const: web + max_results: + type: number + search_prompt: + type: string + engine: + type: string + enum: + - native + - exa + required: + - id + - type: object + properties: + id: + type: string + const: file-parser + max_files: + type: number + pdf: + type: object + properties: + engine: + type: string + enum: + - mistral-ocr + - pdf-text + - native + required: + - id + type: object + provider: + anyOf: + - type: object + properties: + allow_fallbacks: + description: > + Whether to allow backup providers to serve requests + + - true: (default) when the primary provider (or your custom providers in "order") is unavailable, + use the next best provider. + + - false: use only the primary/custom provider, and return the upstream error if it's unavailable. + anyOf: + - type: boolean + - type: 'null' + require_parameters: + description: >- + Whether to filter providers to only those that support the parameters you've provided. If this + setting is omitted or set to false, then providers will receive only the parameters they support, + and ignore the rest. + anyOf: + - type: boolean + - type: 'null' + data_collection: + description: >- + Data collection setting. If no available model provider meets the requirement, your request will + return an error. + + - allow: (default) allow providers which store user data non-transiently and may train on it + + + - deny: use only providers which do not collect user data. + anyOf: + - type: string + enum: + - deny + - allow + - type: 'null' + zdr: + anyOf: + - type: boolean + - type: 'null' + enforce_distillable_text: + anyOf: + - type: boolean + - type: 'null' + order: + description: >- + An ordered list of provider slugs. The router will attempt to use the first provider in the subset + of this list that supports your requested model, and fall back to the next if it is unavailable. If + no providers are available, the request will fail with an error message. + anyOf: + - $ref: '#/components/schemas/__schema0' + - type: 'null' + only: + description: >- + List of provider slugs to allow. If provided, this list is merged with your account-wide allowed + provider settings for this request. + anyOf: + - $ref: '#/components/schemas/__schema0' + - type: 'null' + ignore: + description: >- + List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored + provider settings for this request. + anyOf: + - $ref: '#/components/schemas/__schema0' + - type: 'null' + quantizations: + description: A list of quantization levels to filter the provider by. + anyOf: + - type: array + items: + type: string + enum: + - int4 + - int8 + - fp4 + - fp6 + - fp8 + - fp16 + - bf16 + - fp32 + - unknown + - type: 'null' + sort: + description: >- + The sorting strategy to use for this request, if "order" is not specified. When set, no load + balancing is performed. + anyOf: + - type: string + enum: + - price + - throughput + - latency + - type: 'null' + max_price: + description: >- + The object specifying the maximum price you want to pay for this request. USD price per million + tokens, for prompt and completion. + type: object + properties: + prompt: + $ref: '#/components/schemas/__schema1' + completion: + $ref: '#/components/schemas/__schema1' + image: + $ref: '#/components/schemas/__schema1' + audio: + $ref: '#/components/schemas/__schema1' + request: + $ref: '#/components/schemas/__schema1' + additionalProperties: false + additionalProperties: false + - type: 'null' messages: minItems: 1 type: array @@ -5087,6 +5454,7 @@ components: anyOf: - type: string enum: + - none - minimal - low - medium @@ -5408,6 +5776,167 @@ components: type: array items: $ref: '#/components/schemas/ModelName' + plugins: + type: array + items: + oneOf: + - type: object + properties: + id: + type: string + const: moderation + required: + - id + - type: object + properties: + id: + type: string + const: web + max_results: + type: number + search_prompt: + type: string + engine: + type: string + enum: + - native + - exa + required: + - id + - type: object + properties: + id: + type: string + const: file-parser + max_files: + type: number + pdf: + type: object + properties: + engine: + type: string + enum: + - mistral-ocr + - pdf-text + - native + required: + - id + type: object + provider: + anyOf: + - type: object + properties: + allow_fallbacks: + description: > + Whether to allow backup providers to serve requests + + - true: (default) when the primary provider (or your custom providers in "order") is unavailable, + use the next best provider. + + - false: use only the primary/custom provider, and return the upstream error if it's unavailable. + anyOf: + - type: boolean + - type: 'null' + require_parameters: + description: >- + Whether to filter providers to only those that support the parameters you've provided. If this + setting is omitted or set to false, then providers will receive only the parameters they support, + and ignore the rest. + anyOf: + - type: boolean + - type: 'null' + data_collection: + description: >- + Data collection setting. If no available model provider meets the requirement, your request will + return an error. + + - allow: (default) allow providers which store user data non-transiently and may train on it + + + - deny: use only providers which do not collect user data. + anyOf: + - type: string + enum: + - deny + - allow + - type: 'null' + zdr: + anyOf: + - type: boolean + - type: 'null' + enforce_distillable_text: + anyOf: + - type: boolean + - type: 'null' + order: + description: >- + An ordered list of provider slugs. The router will attempt to use the first provider in the subset + of this list that supports your requested model, and fall back to the next if it is unavailable. If + no providers are available, the request will fail with an error message. + anyOf: + - $ref: '#/components/schemas/__schema0' + - type: 'null' + only: + description: >- + List of provider slugs to allow. If provided, this list is merged with your account-wide allowed + provider settings for this request. + anyOf: + - $ref: '#/components/schemas/__schema0' + - type: 'null' + ignore: + description: >- + List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored + provider settings for this request. + anyOf: + - $ref: '#/components/schemas/__schema0' + - type: 'null' + quantizations: + description: A list of quantization levels to filter the provider by. + anyOf: + - type: array + items: + type: string + enum: + - int4 + - int8 + - fp4 + - fp6 + - fp8 + - fp16 + - bf16 + - fp32 + - unknown + - type: 'null' + sort: + description: >- + The sorting strategy to use for this request, if "order" is not specified. When set, no load + balancing is performed. + anyOf: + - type: string + enum: + - price + - throughput + - latency + - type: 'null' + max_price: + description: >- + The object specifying the maximum price you want to pay for this request. USD price per million + tokens, for prompt and completion. + type: object + properties: + prompt: + $ref: '#/components/schemas/__schema1' + completion: + $ref: '#/components/schemas/__schema1' + image: + $ref: '#/components/schemas/__schema1' + audio: + $ref: '#/components/schemas/__schema1' + request: + $ref: '#/components/schemas/__schema1' + additionalProperties: false + additionalProperties: false + - type: 'null' prompt: anyOf: - type: string @@ -5972,8 +6501,56 @@ paths: type: array items: type: number + - type: array + items: + type: object + properties: + content: + type: array + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - text + text: + type: string + required: + - type + - text + - type: object + properties: + type: + type: string + enum: + - image_url + image_url: + type: object + properties: + url: + type: string + required: + - url + required: + - type + - image_url + required: + - content model: type: string + encoding_format: + type: string + enum: + - float + - base64 + dimensions: + type: integer + minimum: 0 + exclusiveMinimum: true + user: + type: string provider: type: object properties: @@ -5996,19 +6573,7 @@ paths: setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. data_collection: - type: string - nullable: true - enum: - - deny - - allow - example: deny - description: > - Data collection setting. If no available model provider meets the requirement, your request will - return an error. - - - allow: (default) allow providers which store user data non-transiently and may train on it - - - deny: use only providers which do not collect user data. + $ref: '#/components/schemas/DataCollection' zdr: type: boolean nullable: true @@ -6025,35 +6590,35 @@ paths: example: true order: type: array - nullable: true items: - anyOf: - - $ref: '#/components/schemas/ProviderName' - - type: string + type: string description: >- An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. + example: + - OpenAI + - Anthropic only: type: array - nullable: true items: - anyOf: - - $ref: '#/components/schemas/ProviderName' - - type: string + type: string description: >- List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. + example: + - OpenAI + - Anthropic ignore: type: array - nullable: true items: - anyOf: - - $ref: '#/components/schemas/ProviderName' - - type: string + type: string description: >- List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. + example: + - OpenAI + - Anthropic quantizations: type: array nullable: true @@ -6061,42 +6626,50 @@ paths: $ref: '#/components/schemas/Quantization' description: A list of quantization levels to filter the provider by. sort: - type: string - nullable: true - enum: - - price - - throughput - - latency - example: price - description: >- - The sorting strategy to use for this request, if "order" is not specified. When set, no load - balancing is performed. + $ref: '#/components/schemas/ProviderSort' max_price: type: object properties: prompt: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 completion: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 image: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 audio: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 request: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 additionalProperties: false description: >- The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. - encoding_format: - anyOf: - - type: string - enum: - - float - - type: string - enum: - - base64 - user: + input_type: type: string required: - input @@ -6704,22 +7277,21 @@ paths: - Alibaba - Amazon Bedrock - Anthropic + - Arcee - AtlasCloud - - Atoma - Avian - Azure - BaseTen + - Black Forest Labs - Cerebras - Chutes - Cirrascale - Clarifai - Cloudflare - Cohere - - CrofAI - Crusoe - DeepInfra - DeepSeek - - Enfer - Featherless - Fireworks - Friendli @@ -6732,11 +7304,8 @@ paths: - InferenceNet - Infermatic - Inflection - - Kluster - - Lambda - Liquid - Mancer 2 - - Meta - Minimax - ModelRun - Mistral @@ -6746,7 +7315,6 @@ paths: - NCompass - Nebius - NextBit - - Nineteen - Novita - Nvidia - OpenAI @@ -6761,7 +7329,6 @@ paths: - Switchpoint - Targon - Together - - Ubicloud - Venice - WandB - xAI diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index fdcaa293..93d67d5a 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -1067,6 +1067,7 @@ components: - medium - low - minimal + - none x-speakeasy-unknown-values: allow ReasoningSummaryVerbosity: type: string @@ -3239,6 +3240,7 @@ components: - openai-responses-v1 - xai-responses-v1 - anthropic-claude-v1 + - google-gemini-v1 x-speakeasy-unknown-values: allow example: type: reasoning @@ -3440,96 +3442,20 @@ components: - reasoning.encrypted_content - code_interpreter_call.outputs x-speakeasy-unknown-values: allow - ProviderName: + DataCollection: type: string + nullable: true enum: - - AnyScale - - Cent-ML - - HuggingFace - - Hyperbolic 2 - - Lepton - - Lynn 2 - - Lynn - - Mancer - - Modal - - OctoAI - - Recursal - - Reflection - - Replicate - - SambaNova 2 - - SF Compute - - Together 2 - - 01.AI - - AI21 - - AionLabs - - Alibaba - - Amazon Bedrock - - Anthropic - - AtlasCloud - - Atoma - - Avian - - Azure - - BaseTen - - Cerebras - - Chutes - - Cirrascale - - Clarifai - - Cloudflare - - Cohere - - CrofAI - - Crusoe - - DeepInfra - - DeepSeek - - Enfer - - Featherless - - Fireworks - - Friendli - - GMICloud - - Google - - Google AI Studio - - Groq - - Hyperbolic - - Inception - - InferenceNet - - Infermatic - - Inflection - - InoCloud - - Kluster - - Lambda - - Liquid - - Mancer 2 - - Meta - - Minimax - - ModelRun - - Mistral - - Modular - - Moonshot AI - - Morph - - NCompass - - Nebius - - NextBit - - Nineteen - - Novita - - Nvidia - - OpenAI - - OpenInference - - Parasail - - Perplexity - - Phala - - Relace - - SambaNova - - SiliconFlow - - Stealth - - Switchpoint - - Targon - - Together - - Ubicloud - - Venice - - WandB - - xAI - - Z.AI - - FakeProvider - example: OpenAI + - deny + - allow + description: >- + Data collection setting. If no available model provider meets the requirement, your request will return an error. + + - allow: (default) allow providers which store user data non-transiently and may train on it + + + - deny: use only providers which do not collect user data. + example: allow x-speakeasy-unknown-values: allow Quantization: type: string @@ -3545,14 +3471,17 @@ components: - unknown example: fp16 x-speakeasy-unknown-values: allow - BigNumberUnion: - anyOf: - - type: number - - type: string - - type: number - example: 1000 - description: A value in string or number format that is a large number - example: 1000 + ProviderSort: + type: string + nullable: true + enum: + - price + - throughput + - latency + description: >- + The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. + example: price + x-speakeasy-unknown-values: allow OpenResponsesRequest: type: object properties: @@ -3683,20 +3612,7 @@ components: description: >- Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. data_collection: - type: string - nullable: true - enum: - - deny - - allow - example: deny - description: > - Data collection setting. If no available model provider meets the requirement, your request will return an error. - - - allow: (default) allow providers which store user data non-transiently and may train on it - - - deny: use only providers which do not collect user data. - - x-speakeasy-unknown-values: allow + $ref: '#/components/schemas/DataCollection' zdr: type: boolean nullable: true @@ -3711,31 +3627,31 @@ components: example: true order: type: array - nullable: true items: - anyOf: - - $ref: '#/components/schemas/ProviderName' - - type: string + type: string description: >- An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. + example: + - OpenAI + - Anthropic only: type: array - nullable: true items: - anyOf: - - $ref: '#/components/schemas/ProviderName' - - type: string + type: string description: >- List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. + example: + - OpenAI + - Anthropic ignore: type: array - nullable: true items: - anyOf: - - $ref: '#/components/schemas/ProviderName' - - type: string + type: string description: >- List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. + example: + - OpenAI + - Anthropic quantizations: type: array nullable: true @@ -3743,29 +3659,45 @@ components: $ref: '#/components/schemas/Quantization' description: A list of quantization levels to filter the provider by. sort: - type: string - nullable: true - enum: - - price - - throughput - - latency - example: price - description: >- - The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. - x-speakeasy-unknown-values: allow + $ref: '#/components/schemas/ProviderSort' max_price: type: object properties: prompt: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 completion: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 image: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 audio: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 request: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 additionalProperties: false description: >- The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. @@ -3977,27 +3909,89 @@ components: type: object properties: prompt: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 completion: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 request: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 image: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 + image_token: + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 image_output: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 audio: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 input_audio_cache: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 web_search: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 internal_reasoning: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 input_cache_read: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 input_cache_write: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 discount: type: number required: @@ -4397,6 +4391,73 @@ components: - qwen3 description: Instruction format type x-speakeasy-unknown-values: allow + ProviderName: + type: string + enum: + - AI21 + - AionLabs + - Alibaba + - Amazon Bedrock + - Anthropic + - Arcee + - AtlasCloud + - Avian + - Azure + - BaseTen + - Black Forest Labs + - Cerebras + - Chutes + - Cirrascale + - Clarifai + - Cloudflare + - Cohere + - Crusoe + - DeepInfra + - DeepSeek + - Featherless + - Fireworks + - Friendli + - GMICloud + - Google + - Google AI Studio + - Groq + - Hyperbolic + - Inception + - InferenceNet + - Infermatic + - Inflection + - Liquid + - Mancer 2 + - Minimax + - ModelRun + - Mistral + - Modular + - Moonshot AI + - Morph + - NCompass + - Nebius + - NextBit + - Novita + - Nvidia + - OpenAI + - OpenInference + - Parasail + - Perplexity + - Phala + - Relace + - SambaNova + - SiliconFlow + - Stealth + - Switchpoint + - Targon + - Together + - Venice + - WandB + - xAI + - Z.AI + - FakeProvider + example: OpenAI + x-speakeasy-unknown-values: allow EndpointStatus: type: integer enum: @@ -4421,27 +4482,89 @@ components: type: object properties: prompt: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 completion: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 request: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 image: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 + image_token: + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 image_output: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 audio: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 input_audio_cache: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 web_search: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 internal_reasoning: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 input_cache_read: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 input_cache_write: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 discount: type: number required: @@ -4612,9 +4735,82 @@ components: uptime_last_30m: 99.5 supports_implicit_caching: true __schema0: + type: array + items: + anyOf: + - type: string + enum: + - AI21 + - AionLabs + - Alibaba + - Amazon Bedrock + - Anthropic + - Arcee + - AtlasCloud + - Avian + - Azure + - BaseTen + - Black Forest Labs + - Cerebras + - Chutes + - Cirrascale + - Clarifai + - Cloudflare + - Cohere + - Crusoe + - DeepInfra + - DeepSeek + - Featherless + - Fireworks + - Friendli + - GMICloud + - Google + - Google AI Studio + - Groq + - Hyperbolic + - Inception + - InferenceNet + - Infermatic + - Inflection + - Liquid + - Mancer 2 + - Minimax + - ModelRun + - Mistral + - Modular + - Moonshot AI + - Morph + - NCompass + - Nebius + - NextBit + - Novita + - Nvidia + - OpenAI + - OpenInference + - Parasail + - Perplexity + - Phala + - Relace + - SambaNova + - SiliconFlow + - Stealth + - Switchpoint + - Targon + - Together + - Venice + - WandB + - xAI + - Z.AI + - FakeProvider + x-speakeasy-unknown-values: allow + - type: string + __schema1: anyOf: - - $ref: '#/components/schemas/ChatCompletionFinishReason' - - type: 'null' + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 ModelName: type: string ChatMessageContentItemText: @@ -4680,21 +4876,38 @@ components: - type - input_audio ChatMessageContentItemVideo: - type: object - properties: - type: - type: string - const: input_video - video_url: - type: object + oneOf: + - type: object properties: - url: + type: type: string + const: input_video + video_url: + type: object + properties: + url: + type: string + required: + - url required: - - url - required: - - type - - video_url + - type + - video_url + - type: object + properties: + type: + type: string + const: video_url + video_url: + type: object + properties: + url: + type: string + required: + - url + required: + - type + - video_url + type: object ChatMessageContentItem: oneOf: - $ref: '#/components/schemas/ChatMessageContentItemText' @@ -4709,6 +4922,7 @@ components: image_url: '#/components/schemas/ChatMessageContentItemImage' input_audio: '#/components/schemas/ChatMessageContentItemAudio' input_video: '#/components/schemas/ChatMessageContentItemVideo' + video_url: '#/components/schemas/ChatMessageContentItemVideo' ChatMessageToolCall: type: object properties: @@ -4831,15 +5045,6 @@ components: - completion_tokens - prompt_tokens - total_tokens - ChatCompletionFinishReason: - type: string - enum: - - tool_calls - - stop - - length - - content_filter - - error - x-speakeasy-unknown-values: allow JSONSchemaConfig: type: object properties: @@ -5047,6 +5252,163 @@ components: ChatGenerationParams: type: object properties: + plugins: + type: array + items: + oneOf: + - type: object + properties: + id: + type: string + const: moderation + required: + - id + - type: object + properties: + id: + type: string + const: web + max_results: + type: number + search_prompt: + type: string + engine: + type: string + enum: + - native + - exa + x-speakeasy-unknown-values: allow + required: + - id + - type: object + properties: + id: + type: string + const: file-parser + max_files: + type: number + pdf: + type: object + properties: + engine: + type: string + enum: + - mistral-ocr + - pdf-text + - native + x-speakeasy-unknown-values: allow + required: + - id + type: object + provider: + anyOf: + - type: object + properties: + allow_fallbacks: + description: > + Whether to allow backup providers to serve requests + + - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. + + - false: use only the primary/custom provider, and return the upstream error if it's unavailable. + + anyOf: + - type: boolean + - type: 'null' + require_parameters: + description: >- + Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. + anyOf: + - type: boolean + - type: 'null' + data_collection: + description: >- + Data collection setting. If no available model provider meets the requirement, your request will return an error. + + - allow: (default) allow providers which store user data non-transiently and may train on it + + + - deny: use only providers which do not collect user data. + anyOf: + - type: string + enum: + - deny + - allow + x-speakeasy-unknown-values: allow + - type: 'null' + zdr: + anyOf: + - type: boolean + - type: 'null' + enforce_distillable_text: + anyOf: + - type: boolean + - type: 'null' + order: + description: >- + An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. + anyOf: + - $ref: '#/components/schemas/__schema0' + - type: 'null' + only: + description: >- + List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. + anyOf: + - $ref: '#/components/schemas/__schema0' + - type: 'null' + ignore: + description: >- + List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. + anyOf: + - $ref: '#/components/schemas/__schema0' + - type: 'null' + quantizations: + description: A list of quantization levels to filter the provider by. + anyOf: + - type: array + items: + type: string + enum: + - int4 + - int8 + - fp4 + - fp6 + - fp8 + - fp16 + - bf16 + - fp32 + - unknown + x-speakeasy-unknown-values: allow + - type: 'null' + sort: + description: >- + The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. + anyOf: + - type: string + enum: + - price + - throughput + - latency + x-speakeasy-unknown-values: allow + - type: 'null' + max_price: + description: >- + The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + type: object + properties: + prompt: + $ref: '#/components/schemas/__schema1' + completion: + $ref: '#/components/schemas/__schema1' + image: + $ref: '#/components/schemas/__schema1' + audio: + $ref: '#/components/schemas/__schema1' + request: + $ref: '#/components/schemas/__schema1' + additionalProperties: false + additionalProperties: false + - type: 'null' messages: minItems: 1 type: array @@ -5111,6 +5473,7 @@ components: anyOf: - type: string enum: + - none - minimal - low - medium @@ -5434,6 +5797,163 @@ components: type: array items: $ref: '#/components/schemas/ModelName' + plugins: + type: array + items: + oneOf: + - type: object + properties: + id: + type: string + const: moderation + required: + - id + - type: object + properties: + id: + type: string + const: web + max_results: + type: number + search_prompt: + type: string + engine: + type: string + enum: + - native + - exa + x-speakeasy-unknown-values: allow + required: + - id + - type: object + properties: + id: + type: string + const: file-parser + max_files: + type: number + pdf: + type: object + properties: + engine: + type: string + enum: + - mistral-ocr + - pdf-text + - native + x-speakeasy-unknown-values: allow + required: + - id + type: object + provider: + anyOf: + - type: object + properties: + allow_fallbacks: + description: > + Whether to allow backup providers to serve requests + + - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. + + - false: use only the primary/custom provider, and return the upstream error if it's unavailable. + + anyOf: + - type: boolean + - type: 'null' + require_parameters: + description: >- + Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. + anyOf: + - type: boolean + - type: 'null' + data_collection: + description: >- + Data collection setting. If no available model provider meets the requirement, your request will return an error. + + - allow: (default) allow providers which store user data non-transiently and may train on it + + + - deny: use only providers which do not collect user data. + anyOf: + - type: string + enum: + - deny + - allow + x-speakeasy-unknown-values: allow + - type: 'null' + zdr: + anyOf: + - type: boolean + - type: 'null' + enforce_distillable_text: + anyOf: + - type: boolean + - type: 'null' + order: + description: >- + An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. + anyOf: + - $ref: '#/components/schemas/__schema0' + - type: 'null' + only: + description: >- + List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. + anyOf: + - $ref: '#/components/schemas/__schema0' + - type: 'null' + ignore: + description: >- + List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. + anyOf: + - $ref: '#/components/schemas/__schema0' + - type: 'null' + quantizations: + description: A list of quantization levels to filter the provider by. + anyOf: + - type: array + items: + type: string + enum: + - int4 + - int8 + - fp4 + - fp6 + - fp8 + - fp16 + - bf16 + - fp32 + - unknown + x-speakeasy-unknown-values: allow + - type: 'null' + sort: + description: >- + The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. + anyOf: + - type: string + enum: + - price + - throughput + - latency + x-speakeasy-unknown-values: allow + - type: 'null' + max_price: + description: >- + The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + type: object + properties: + prompt: + $ref: '#/components/schemas/__schema1' + completion: + $ref: '#/components/schemas/__schema1' + image: + $ref: '#/components/schemas/__schema1' + audio: + $ref: '#/components/schemas/__schema1' + request: + $ref: '#/components/schemas/__schema1' + additionalProperties: false + additionalProperties: false + - type: 'null' prompt: anyOf: - type: string @@ -5998,8 +6518,57 @@ paths: type: array items: type: number + - type: array + items: + type: object + properties: + content: + type: array + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - text + text: + type: string + required: + - type + - text + - type: object + properties: + type: + type: string + enum: + - image_url + image_url: + type: object + properties: + url: + type: string + required: + - url + required: + - type + - image_url + required: + - content model: type: string + encoding_format: + type: string + enum: + - float + - base64 + x-speakeasy-unknown-values: allow + dimensions: + type: integer + minimum: 0 + exclusiveMinimum: true + user: + type: string provider: type: object properties: @@ -6019,20 +6588,7 @@ paths: description: >- Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. data_collection: - type: string - nullable: true - enum: - - deny - - allow - example: deny - description: > - Data collection setting. If no available model provider meets the requirement, your request will return an error. - - - allow: (default) allow providers which store user data non-transiently and may train on it - - - deny: use only providers which do not collect user data. - - x-speakeasy-unknown-values: allow + $ref: '#/components/schemas/DataCollection' zdr: type: boolean nullable: true @@ -6047,31 +6603,31 @@ paths: example: true order: type: array - nullable: true items: - anyOf: - - $ref: '#/components/schemas/ProviderName' - - type: string + type: string description: >- An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. + example: + - OpenAI + - Anthropic only: type: array - nullable: true items: - anyOf: - - $ref: '#/components/schemas/ProviderName' - - type: string + type: string description: >- List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. + example: + - OpenAI + - Anthropic ignore: type: array - nullable: true items: - anyOf: - - $ref: '#/components/schemas/ProviderName' - - type: string + type: string description: >- List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. + example: + - OpenAI + - Anthropic quantizations: type: array nullable: true @@ -6079,41 +6635,49 @@ paths: $ref: '#/components/schemas/Quantization' description: A list of quantization levels to filter the provider by. sort: - type: string - nullable: true - enum: - - price - - throughput - - latency - example: price - description: >- - The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. - x-speakeasy-unknown-values: allow + $ref: '#/components/schemas/ProviderSort' max_price: type: object properties: prompt: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 completion: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 image: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 audio: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 request: - $ref: '#/components/schemas/BigNumberUnion' + anyOf: + - type: number + - type: string + - type: number + description: A value in string or number format that is a large number + example: 1000 additionalProperties: false description: >- The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. - encoding_format: - anyOf: - - type: string - enum: - - float - - type: string - enum: - - base64 - user: + input_type: type: string required: - input @@ -6709,22 +7273,21 @@ paths: - Alibaba - Amazon Bedrock - Anthropic + - Arcee - AtlasCloud - - Atoma - Avian - Azure - BaseTen + - Black Forest Labs - Cerebras - Chutes - Cirrascale - Clarifai - Cloudflare - Cohere - - CrofAI - Crusoe - DeepInfra - DeepSeek - - Enfer - Featherless - Fireworks - Friendli @@ -6737,11 +7300,8 @@ paths: - InferenceNet - Infermatic - Inflection - - Kluster - - Lambda - Liquid - Mancer 2 - - Meta - Minimax - ModelRun - Mistral @@ -6751,7 +7311,6 @@ paths: - NCompass - Nebius - NextBit - - Nineteen - Novita - Nvidia - OpenAI @@ -6766,7 +7325,6 @@ paths: - Switchpoint - Targon - Together - - Ubicloud - Venice - WandB - xAI diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 12bf61b6..6b025ad0 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,20 @@ -speakeasyVersion: 1.654.0 +speakeasyVersion: 1.658.2 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:08647b466c00989914e3a2436175152270f771f0a57d055f5bab14cc2d4be89e - sourceBlobDigest: sha256:53027ec57392d9617cc001ece83c2fe1aa6e5dbfd52d170381c34c33c6042c23 + sourceRevisionDigest: sha256:d5e646fa1ab83c0de6aee470767c6da299dedfd6a046af541d2dfe1a525d40fc + sourceBlobDigest: sha256:bec13842f0ec9fa68088c85ce94481a48d27f1aa8e778af57819856e0ccc4679 tags: - latest - - staging - 1.0.0 targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:08647b466c00989914e3a2436175152270f771f0a57d055f5bab14cc2d4be89e - sourceBlobDigest: sha256:53027ec57392d9617cc001ece83c2fe1aa6e5dbfd52d170381c34c33c6042c23 + sourceRevisionDigest: sha256:d5e646fa1ab83c0de6aee470767c6da299dedfd6a046af541d2dfe1a525d40fc + sourceBlobDigest: sha256:bec13842f0ec9fa68088c85ce94481a48d27f1aa8e778af57819856e0ccc4679 codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:e30bf4d24076522aaf92aa570cc8b7ba008d86e9a36336d815e99dbf154d3b47 + codeSamplesRevisionDigest: sha256:e039767b6d5864ba682401614405cad3b78e5ff1374a9c696ad835a795695470 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/docs/models/assistantmessagecontent.md b/docs/models/assistantmessagecontent.md index dfdbba6c..30a5052e 100644 --- a/docs/models/assistantmessagecontent.md +++ b/docs/models/assistantmessagecontent.md @@ -14,8 +14,10 @@ const value: string = ""; ```typescript const value: models.ChatMessageContentItem[] = [ { - type: "text", - text: "", + type: "image_url", + imageUrl: { + url: "https://pretty-reservation.org", + }, }, ]; ``` diff --git a/docs/models/chatcompletionfinishreason.md b/docs/models/chatcompletionfinishreason.md deleted file mode 100644 index b1301308..00000000 --- a/docs/models/chatcompletionfinishreason.md +++ /dev/null @@ -1,17 +0,0 @@ -# ChatCompletionFinishReason - -## Example Usage - -```typescript -import { ChatCompletionFinishReason } from "@openrouter/sdk/models"; - -let value: ChatCompletionFinishReason = "error"; -``` - -## Values - -This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. - -```typescript -"tool_calls" | "stop" | "length" | "content_filter" | "error" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/chatgenerationparams.md b/docs/models/chatgenerationparams.md index c5ec4b35..dbc037cf 100644 --- a/docs/models/chatgenerationparams.md +++ b/docs/models/chatgenerationparams.md @@ -17,27 +17,29 @@ let value: ChatGenerationParams = { ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -| `messages` | *models.Message*[] | :heavy_check_mark: | N/A | -| `model` | *string* | :heavy_minus_sign: | N/A | -| `models` | *string*[] | :heavy_minus_sign: | N/A | -| `frequencyPenalty` | *number* | :heavy_minus_sign: | N/A | -| `logitBias` | Record | :heavy_minus_sign: | N/A | -| `logprobs` | *boolean* | :heavy_minus_sign: | N/A | -| `topLogprobs` | *number* | :heavy_minus_sign: | N/A | -| `maxCompletionTokens` | *number* | :heavy_minus_sign: | N/A | -| `maxTokens` | *number* | :heavy_minus_sign: | N/A | -| `metadata` | Record | :heavy_minus_sign: | N/A | -| `presencePenalty` | *number* | :heavy_minus_sign: | N/A | -| `reasoning` | [models.Reasoning](../models/reasoning.md) | :heavy_minus_sign: | N/A | -| `responseFormat` | *models.ChatGenerationParamsResponseFormatUnion* | :heavy_minus_sign: | N/A | -| `seed` | *number* | :heavy_minus_sign: | N/A | -| `stop` | *models.ChatGenerationParamsStop* | :heavy_minus_sign: | N/A | -| `stream` | *boolean* | :heavy_minus_sign: | N/A | -| `streamOptions` | [models.ChatStreamOptions](../models/chatstreamoptions.md) | :heavy_minus_sign: | N/A | -| `temperature` | *number* | :heavy_minus_sign: | N/A | -| `toolChoice` | *any* | :heavy_minus_sign: | N/A | -| `tools` | [models.ToolDefinitionJson](../models/tooldefinitionjson.md)[] | :heavy_minus_sign: | N/A | -| `topP` | *number* | :heavy_minus_sign: | N/A | -| `user` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `plugins` | *models.ChatGenerationParamsPluginUnion*[] | :heavy_minus_sign: | N/A | +| `provider` | [models.ChatGenerationParamsProvider](../models/chatgenerationparamsprovider.md) | :heavy_minus_sign: | N/A | +| `messages` | *models.Message*[] | :heavy_check_mark: | N/A | +| `model` | *string* | :heavy_minus_sign: | N/A | +| `models` | *string*[] | :heavy_minus_sign: | N/A | +| `frequencyPenalty` | *number* | :heavy_minus_sign: | N/A | +| `logitBias` | Record | :heavy_minus_sign: | N/A | +| `logprobs` | *boolean* | :heavy_minus_sign: | N/A | +| `topLogprobs` | *number* | :heavy_minus_sign: | N/A | +| `maxCompletionTokens` | *number* | :heavy_minus_sign: | N/A | +| `maxTokens` | *number* | :heavy_minus_sign: | N/A | +| `metadata` | Record | :heavy_minus_sign: | N/A | +| `presencePenalty` | *number* | :heavy_minus_sign: | N/A | +| `reasoning` | [models.Reasoning](../models/reasoning.md) | :heavy_minus_sign: | N/A | +| `responseFormat` | *models.ChatGenerationParamsResponseFormatUnion* | :heavy_minus_sign: | N/A | +| `seed` | *number* | :heavy_minus_sign: | N/A | +| `stop` | *models.ChatGenerationParamsStop* | :heavy_minus_sign: | N/A | +| `stream` | *boolean* | :heavy_minus_sign: | N/A | +| `streamOptions` | [models.ChatStreamOptions](../models/chatstreamoptions.md) | :heavy_minus_sign: | N/A | +| `temperature` | *number* | :heavy_minus_sign: | N/A | +| `toolChoice` | *any* | :heavy_minus_sign: | N/A | +| `tools` | [models.ToolDefinitionJson](../models/tooldefinitionjson.md)[] | :heavy_minus_sign: | N/A | +| `topP` | *number* | :heavy_minus_sign: | N/A | +| `user` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/chatgenerationparamsdatacollection.md b/docs/models/chatgenerationparamsdatacollection.md new file mode 100644 index 00000000..3718bbe5 --- /dev/null +++ b/docs/models/chatgenerationparamsdatacollection.md @@ -0,0 +1,17 @@ +# ChatGenerationParamsDataCollection + +## Example Usage + +```typescript +import { ChatGenerationParamsDataCollection } from "@openrouter/sdk/models"; + +let value: ChatGenerationParamsDataCollection = "allow"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"deny" | "allow" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/engine.md b/docs/models/chatgenerationparamsengine.md similarity index 58% rename from docs/models/engine.md rename to docs/models/chatgenerationparamsengine.md index 0c80b2fb..10ac475c 100644 --- a/docs/models/engine.md +++ b/docs/models/chatgenerationparamsengine.md @@ -1,11 +1,11 @@ -# Engine +# ChatGenerationParamsEngine ## Example Usage ```typescript -import { Engine } from "@openrouter/sdk/models"; +import { ChatGenerationParamsEngine } from "@openrouter/sdk/models"; -let value: Engine = "exa"; +let value: ChatGenerationParamsEngine = "native"; ``` ## Values diff --git a/docs/models/chatgenerationparamsmaxprice.md b/docs/models/chatgenerationparamsmaxprice.md new file mode 100644 index 00000000..48f41213 --- /dev/null +++ b/docs/models/chatgenerationparamsmaxprice.md @@ -0,0 +1,21 @@ +# ChatGenerationParamsMaxPrice + +The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + +## Example Usage + +```typescript +import { ChatGenerationParamsMaxPrice } from "@openrouter/sdk/models"; + +let value: ChatGenerationParamsMaxPrice = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `prompt` | *any* | :heavy_minus_sign: | N/A | +| `completion` | *any* | :heavy_minus_sign: | N/A | +| `image` | *any* | :heavy_minus_sign: | N/A | +| `audio` | *any* | :heavy_minus_sign: | N/A | +| `request` | *any* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/chatgenerationparamspdf.md b/docs/models/chatgenerationparamspdf.md new file mode 100644 index 00000000..99e71e2e --- /dev/null +++ b/docs/models/chatgenerationparamspdf.md @@ -0,0 +1,15 @@ +# ChatGenerationParamsPdf + +## Example Usage + +```typescript +import { ChatGenerationParamsPdf } from "@openrouter/sdk/models"; + +let value: ChatGenerationParamsPdf = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `engine` | [models.ChatGenerationParamsPdfEngine](../models/chatgenerationparamspdfengine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/chatgenerationparamspdfengine.md b/docs/models/chatgenerationparamspdfengine.md new file mode 100644 index 00000000..75faf193 --- /dev/null +++ b/docs/models/chatgenerationparamspdfengine.md @@ -0,0 +1,17 @@ +# ChatGenerationParamsPdfEngine + +## Example Usage + +```typescript +import { ChatGenerationParamsPdfEngine } from "@openrouter/sdk/models"; + +let value: ChatGenerationParamsPdfEngine = "mistral-ocr"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"mistral-ocr" | "pdf-text" | "native" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/chatgenerationparamspluginfileparser.md b/docs/models/chatgenerationparamspluginfileparser.md new file mode 100644 index 00000000..8b4bf7ee --- /dev/null +++ b/docs/models/chatgenerationparamspluginfileparser.md @@ -0,0 +1,19 @@ +# ChatGenerationParamsPluginFileParser + +## Example Usage + +```typescript +import { ChatGenerationParamsPluginFileParser } from "@openrouter/sdk/models"; + +let value: ChatGenerationParamsPluginFileParser = { + id: "file-parser", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | N/A | +| `maxFiles` | *number* | :heavy_minus_sign: | N/A | +| `pdf` | [models.ChatGenerationParamsPdf](../models/chatgenerationparamspdf.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/chatgenerationparamspluginmoderation.md b/docs/models/chatgenerationparamspluginmoderation.md new file mode 100644 index 00000000..2ad767f2 --- /dev/null +++ b/docs/models/chatgenerationparamspluginmoderation.md @@ -0,0 +1,17 @@ +# ChatGenerationParamsPluginModeration + +## Example Usage + +```typescript +import { ChatGenerationParamsPluginModeration } from "@openrouter/sdk/models"; + +let value: ChatGenerationParamsPluginModeration = { + id: "moderation", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/chatgenerationparamspluginunion.md b/docs/models/chatgenerationparamspluginunion.md new file mode 100644 index 00000000..2791d6a5 --- /dev/null +++ b/docs/models/chatgenerationparamspluginunion.md @@ -0,0 +1,29 @@ +# ChatGenerationParamsPluginUnion + + +## Supported Types + +### `models.ChatGenerationParamsPluginModeration` + +```typescript +const value: models.ChatGenerationParamsPluginModeration = { + id: "moderation", +}; +``` + +### `models.ChatGenerationParamsPluginWeb` + +```typescript +const value: models.ChatGenerationParamsPluginWeb = { + id: "web", +}; +``` + +### `models.ChatGenerationParamsPluginFileParser` + +```typescript +const value: models.ChatGenerationParamsPluginFileParser = { + id: "file-parser", +}; +``` + diff --git a/docs/models/chatgenerationparamspluginweb.md b/docs/models/chatgenerationparamspluginweb.md new file mode 100644 index 00000000..e9f1f457 --- /dev/null +++ b/docs/models/chatgenerationparamspluginweb.md @@ -0,0 +1,20 @@ +# ChatGenerationParamsPluginWeb + +## Example Usage + +```typescript +import { ChatGenerationParamsPluginWeb } from "@openrouter/sdk/models"; + +let value: ChatGenerationParamsPluginWeb = { + id: "web", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | N/A | +| `maxResults` | *number* | :heavy_minus_sign: | N/A | +| `searchPrompt` | *string* | :heavy_minus_sign: | N/A | +| `engine` | [models.ChatGenerationParamsEngine](../models/chatgenerationparamsengine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/chatgenerationparamsprovider.md b/docs/models/chatgenerationparamsprovider.md new file mode 100644 index 00000000..67174fb3 --- /dev/null +++ b/docs/models/chatgenerationparamsprovider.md @@ -0,0 +1,25 @@ +# ChatGenerationParamsProvider + +## Example Usage + +```typescript +import { ChatGenerationParamsProvider } from "@openrouter/sdk/models"; + +let value: ChatGenerationParamsProvider = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `allowFallbacks` | *boolean* | :heavy_minus_sign: | Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
| +| `requireParameters` | *boolean* | :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. | +| `dataCollection` | [models.ChatGenerationParamsDataCollection](../models/chatgenerationparamsdatacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it

- deny: use only providers which do not collect user data. | +| `zdr` | *boolean* | :heavy_minus_sign: | N/A | +| `enforceDistillableText` | *boolean* | :heavy_minus_sign: | N/A | +| `order` | *models.Schema0*[] | :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` | *models.Schema0*[] | :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` | *models.Schema0*[] | :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` | [models.ChatGenerationParamsQuantizations](../models/chatgenerationparamsquantizations.md)[] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | +| `sort` | [models.ChatGenerationParamsSort](../models/chatgenerationparamssort.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | +| `maxPrice` | [models.ChatGenerationParamsMaxPrice](../models/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. | \ No newline at end of file diff --git a/docs/models/chatgenerationparamsquantizations.md b/docs/models/chatgenerationparamsquantizations.md new file mode 100644 index 00000000..b23324b2 --- /dev/null +++ b/docs/models/chatgenerationparamsquantizations.md @@ -0,0 +1,17 @@ +# ChatGenerationParamsQuantizations + +## Example Usage + +```typescript +import { ChatGenerationParamsQuantizations } from "@openrouter/sdk/models"; + +let value: ChatGenerationParamsQuantizations = "fp6"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"int4" | "int8" | "fp4" | "fp6" | "fp8" | "fp16" | "bf16" | "fp32" | "unknown" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/sort.md b/docs/models/chatgenerationparamssort.md similarity index 52% rename from docs/models/operations/sort.md rename to docs/models/chatgenerationparamssort.md index 46237bad..db470b0e 100644 --- a/docs/models/operations/sort.md +++ b/docs/models/chatgenerationparamssort.md @@ -1,13 +1,11 @@ -# Sort - -The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. +# ChatGenerationParamsSort ## Example Usage ```typescript -import { Sort } from "@openrouter/sdk/models/operations"; +import { ChatGenerationParamsSort } from "@openrouter/sdk/models"; -let value: Sort = "price"; +let value: ChatGenerationParamsSort = "throughput"; ``` ## Values diff --git a/docs/models/chatmessagecontentitem.md b/docs/models/chatmessagecontentitem.md index 273f186d..da9d3c15 100644 --- a/docs/models/chatmessagecontentitem.md +++ b/docs/models/chatmessagecontentitem.md @@ -18,7 +18,7 @@ const value: models.ChatMessageContentItemText = { const value: models.ChatMessageContentItemImage = { type: "image_url", imageUrl: { - url: "https://better-nephew.com/", + url: "https://pretty-reservation.org", }, }; ``` @@ -39,9 +39,20 @@ const value: models.ChatMessageContentItemAudio = { ```typescript const value: models.ChatMessageContentItemVideo = { - type: "input_video", + type: "video_url", videoUrl: { - url: "https://imaginative-mousse.org", + url: "https://palatable-subexpression.com/", + }, +}; +``` + +### `models.ChatMessageContentItemVideo` + +```typescript +const value: models.ChatMessageContentItemVideo = { + type: "video_url", + videoUrl: { + url: "https://palatable-subexpression.com/", }, }; ``` diff --git a/docs/models/chatmessagecontentitemimage.md b/docs/models/chatmessagecontentitemimage.md index 7341c287..aa9882d5 100644 --- a/docs/models/chatmessagecontentitemimage.md +++ b/docs/models/chatmessagecontentitemimage.md @@ -8,7 +8,7 @@ import { ChatMessageContentItemImage } from "@openrouter/sdk/models"; let value: ChatMessageContentItemImage = { type: "image_url", imageUrl: { - url: "https://better-nephew.com/", + url: "https://pretty-reservation.org", }, }; ``` diff --git a/docs/models/chatmessagecontentitemvideo.md b/docs/models/chatmessagecontentitemvideo.md index 96ac2105..8bcb8beb 100644 --- a/docs/models/chatmessagecontentitemvideo.md +++ b/docs/models/chatmessagecontentitemvideo.md @@ -1,21 +1,27 @@ # ChatMessageContentItemVideo -## Example Usage -```typescript -import { ChatMessageContentItemVideo } from "@openrouter/sdk/models"; +## Supported Types + +### `models.ChatMessageContentItemVideoInputVideo` -let value: ChatMessageContentItemVideo = { +```typescript +const value: models.ChatMessageContentItemVideoInputVideo = { type: "input_video", videoUrl: { - url: "https://imaginative-mousse.org", + url: "https://salty-diversity.biz", }, }; ``` -## Fields +### `models.ChatMessageContentItemVideoVideoURL` + +```typescript +const value: models.ChatMessageContentItemVideoVideoURL = { + type: "video_url", + videoUrl: { + url: "https://palatable-subexpression.com/", + }, +}; +``` -| Field | Type | Required | Description | -| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | -| `type` | *string* | :heavy_check_mark: | N/A | -| `videoUrl` | [models.VideoUrl](../models/videourl.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/chatmessagecontentitemvideoinputvideo.md b/docs/models/chatmessagecontentitemvideoinputvideo.md new file mode 100644 index 00000000..80afbbc9 --- /dev/null +++ b/docs/models/chatmessagecontentitemvideoinputvideo.md @@ -0,0 +1,21 @@ +# ChatMessageContentItemVideoInputVideo + +## Example Usage + +```typescript +import { ChatMessageContentItemVideoInputVideo } from "@openrouter/sdk/models"; + +let value: ChatMessageContentItemVideoInputVideo = { + type: "input_video", + videoUrl: { + url: "https://salty-diversity.biz", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `type` | *string* | :heavy_check_mark: | N/A | +| `videoUrl` | [models.VideoUrl1](../models/videourl1.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/chatmessagecontentitemvideovideourl.md b/docs/models/chatmessagecontentitemvideovideourl.md new file mode 100644 index 00000000..8c4afb4c --- /dev/null +++ b/docs/models/chatmessagecontentitemvideovideourl.md @@ -0,0 +1,21 @@ +# ChatMessageContentItemVideoVideoURL + +## Example Usage + +```typescript +import { ChatMessageContentItemVideoVideoURL } from "@openrouter/sdk/models"; + +let value: ChatMessageContentItemVideoVideoURL = { + type: "video_url", + videoUrl: { + url: "https://palatable-subexpression.com/", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `type` | *string* | :heavy_check_mark: | N/A | +| `videoUrl` | [models.VideoUrl2](../models/videourl2.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/chatresponsechoice.md b/docs/models/chatresponsechoice.md index 58451f44..d86e9fe7 100644 --- a/docs/models/chatresponsechoice.md +++ b/docs/models/chatresponsechoice.md @@ -6,8 +6,8 @@ import { ChatResponseChoice } from "@openrouter/sdk/models"; let value: ChatResponseChoice = { - finishReason: "stop", - index: 2823.76, + finishReason: [], + index: 3961.54, message: { role: "assistant", }, @@ -16,9 +16,9 @@ let value: ChatResponseChoice = { ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `finishReason` | [models.ChatCompletionFinishReason](../models/chatcompletionfinishreason.md) | :heavy_check_mark: | N/A | -| `index` | *number* | :heavy_check_mark: | N/A | -| `message` | [models.AssistantMessage](../models/assistantmessage.md) | :heavy_check_mark: | N/A | -| `logprobs` | [models.ChatMessageTokenLogprobs](../models/chatmessagetokenlogprobs.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `finishReason` | *models.Schema0*[] | :heavy_check_mark: | N/A | +| `index` | *number* | :heavy_check_mark: | N/A | +| `message` | [models.AssistantMessage](../models/assistantmessage.md) | :heavy_check_mark: | N/A | +| `logprobs` | [models.ChatMessageTokenLogprobs](../models/chatmessagetokenlogprobs.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/chatstreamingchoice.md b/docs/models/chatstreamingchoice.md index 8751bd5a..a6ade6f6 100644 --- a/docs/models/chatstreamingchoice.md +++ b/docs/models/chatstreamingchoice.md @@ -7,16 +7,18 @@ import { ChatStreamingChoice } from "@openrouter/sdk/models"; let value: ChatStreamingChoice = { delta: {}, - finishReason: "error", + finishReason: [ + "", + ], index: 3511.86, }; ``` ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `delta` | [models.ChatStreamingMessageChunk](../models/chatstreamingmessagechunk.md) | :heavy_check_mark: | N/A | -| `finishReason` | [models.ChatCompletionFinishReason](../models/chatcompletionfinishreason.md) | :heavy_check_mark: | N/A | -| `index` | *number* | :heavy_check_mark: | N/A | -| `logprobs` | [models.ChatMessageTokenLogprobs](../models/chatmessagetokenlogprobs.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `delta` | [models.ChatStreamingMessageChunk](../models/chatstreamingmessagechunk.md) | :heavy_check_mark: | N/A | +| `finishReason` | *models.Schema0*[] | :heavy_check_mark: | N/A | +| `index` | *number* | :heavy_check_mark: | N/A | +| `logprobs` | [models.ChatMessageTokenLogprobs](../models/chatmessagetokenlogprobs.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/chatstreamingresponsechunk.md b/docs/models/chatstreamingresponsechunk.md index 21f49bbb..5a167d15 100644 --- a/docs/models/chatstreamingresponsechunk.md +++ b/docs/models/chatstreamingresponsechunk.md @@ -11,7 +11,9 @@ let value: ChatStreamingResponseChunk = { choices: [ { delta: {}, - finishReason: "error", + finishReason: [ + "", + ], index: 3793.72, }, ], diff --git a/docs/models/completioncreateparams.md b/docs/models/completioncreateparams.md index e0cc9880..84dd1ed8 100644 --- a/docs/models/completioncreateparams.md +++ b/docs/models/completioncreateparams.md @@ -12,26 +12,28 @@ let value: CompletionCreateParams = { ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -| `model` | *string* | :heavy_minus_sign: | N/A | -| `models` | *string*[] | :heavy_minus_sign: | N/A | -| `prompt` | *models.Prompt* | :heavy_check_mark: | N/A | -| `bestOf` | *number* | :heavy_minus_sign: | N/A | -| `echo` | *boolean* | :heavy_minus_sign: | N/A | -| `frequencyPenalty` | *number* | :heavy_minus_sign: | N/A | -| `logitBias` | Record | :heavy_minus_sign: | N/A | -| `logprobs` | *number* | :heavy_minus_sign: | N/A | -| `maxTokens` | *number* | :heavy_minus_sign: | N/A | -| `n` | *number* | :heavy_minus_sign: | N/A | -| `presencePenalty` | *number* | :heavy_minus_sign: | N/A | -| `seed` | *number* | :heavy_minus_sign: | N/A | -| `stop` | *models.CompletionCreateParamsStop* | :heavy_minus_sign: | N/A | -| `stream` | *boolean* | :heavy_minus_sign: | N/A | -| `streamOptions` | [models.StreamOptions](../models/streamoptions.md) | :heavy_minus_sign: | N/A | -| `suffix` | *string* | :heavy_minus_sign: | N/A | -| `temperature` | *number* | :heavy_minus_sign: | N/A | -| `topP` | *number* | :heavy_minus_sign: | N/A | -| `user` | *string* | :heavy_minus_sign: | N/A | -| `metadata` | Record | :heavy_minus_sign: | N/A | -| `responseFormat` | *models.CompletionCreateParamsResponseFormatUnion* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `model` | *string* | :heavy_minus_sign: | N/A | +| `models` | *string*[] | :heavy_minus_sign: | N/A | +| `plugins` | *models.CompletionCreateParamsPluginUnion*[] | :heavy_minus_sign: | N/A | +| `provider` | [models.CompletionCreateParamsProvider](../models/completioncreateparamsprovider.md) | :heavy_minus_sign: | N/A | +| `prompt` | *models.Prompt* | :heavy_check_mark: | N/A | +| `bestOf` | *number* | :heavy_minus_sign: | N/A | +| `echo` | *boolean* | :heavy_minus_sign: | N/A | +| `frequencyPenalty` | *number* | :heavy_minus_sign: | N/A | +| `logitBias` | Record | :heavy_minus_sign: | N/A | +| `logprobs` | *number* | :heavy_minus_sign: | N/A | +| `maxTokens` | *number* | :heavy_minus_sign: | N/A | +| `n` | *number* | :heavy_minus_sign: | N/A | +| `presencePenalty` | *number* | :heavy_minus_sign: | N/A | +| `seed` | *number* | :heavy_minus_sign: | N/A | +| `stop` | *models.CompletionCreateParamsStop* | :heavy_minus_sign: | N/A | +| `stream` | *boolean* | :heavy_minus_sign: | N/A | +| `streamOptions` | [models.StreamOptions](../models/streamoptions.md) | :heavy_minus_sign: | N/A | +| `suffix` | *string* | :heavy_minus_sign: | N/A | +| `temperature` | *number* | :heavy_minus_sign: | N/A | +| `topP` | *number* | :heavy_minus_sign: | N/A | +| `user` | *string* | :heavy_minus_sign: | N/A | +| `metadata` | Record | :heavy_minus_sign: | N/A | +| `responseFormat` | *models.CompletionCreateParamsResponseFormatUnion* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/completioncreateparamsdatacollection.md b/docs/models/completioncreateparamsdatacollection.md new file mode 100644 index 00000000..7bf196a8 --- /dev/null +++ b/docs/models/completioncreateparamsdatacollection.md @@ -0,0 +1,17 @@ +# CompletionCreateParamsDataCollection + +## Example Usage + +```typescript +import { CompletionCreateParamsDataCollection } from "@openrouter/sdk/models"; + +let value: CompletionCreateParamsDataCollection = "allow"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"deny" | "allow" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/completioncreateparamsengine.md b/docs/models/completioncreateparamsengine.md new file mode 100644 index 00000000..c6fa7d3d --- /dev/null +++ b/docs/models/completioncreateparamsengine.md @@ -0,0 +1,17 @@ +# CompletionCreateParamsEngine + +## Example Usage + +```typescript +import { CompletionCreateParamsEngine } from "@openrouter/sdk/models"; + +let value: CompletionCreateParamsEngine = "native"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"native" | "exa" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/completioncreateparamsmaxprice.md b/docs/models/completioncreateparamsmaxprice.md new file mode 100644 index 00000000..92ec17c4 --- /dev/null +++ b/docs/models/completioncreateparamsmaxprice.md @@ -0,0 +1,21 @@ +# CompletionCreateParamsMaxPrice + +The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + +## Example Usage + +```typescript +import { CompletionCreateParamsMaxPrice } from "@openrouter/sdk/models"; + +let value: CompletionCreateParamsMaxPrice = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `prompt` | *any* | :heavy_minus_sign: | N/A | +| `completion` | *any* | :heavy_minus_sign: | N/A | +| `image` | *any* | :heavy_minus_sign: | N/A | +| `audio` | *any* | :heavy_minus_sign: | N/A | +| `request` | *any* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/completioncreateparamspdf.md b/docs/models/completioncreateparamspdf.md new file mode 100644 index 00000000..d6351226 --- /dev/null +++ b/docs/models/completioncreateparamspdf.md @@ -0,0 +1,15 @@ +# CompletionCreateParamsPdf + +## Example Usage + +```typescript +import { CompletionCreateParamsPdf } from "@openrouter/sdk/models"; + +let value: CompletionCreateParamsPdf = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `engine` | [models.CompletionCreateParamsPdfEngine](../models/completioncreateparamspdfengine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/completioncreateparamspdfengine.md b/docs/models/completioncreateparamspdfengine.md new file mode 100644 index 00000000..b769ec13 --- /dev/null +++ b/docs/models/completioncreateparamspdfengine.md @@ -0,0 +1,17 @@ +# CompletionCreateParamsPdfEngine + +## Example Usage + +```typescript +import { CompletionCreateParamsPdfEngine } from "@openrouter/sdk/models"; + +let value: CompletionCreateParamsPdfEngine = "mistral-ocr"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"mistral-ocr" | "pdf-text" | "native" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/completioncreateparamspluginfileparser.md b/docs/models/completioncreateparamspluginfileparser.md new file mode 100644 index 00000000..b72c8dde --- /dev/null +++ b/docs/models/completioncreateparamspluginfileparser.md @@ -0,0 +1,19 @@ +# CompletionCreateParamsPluginFileParser + +## Example Usage + +```typescript +import { CompletionCreateParamsPluginFileParser } from "@openrouter/sdk/models"; + +let value: CompletionCreateParamsPluginFileParser = { + id: "file-parser", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | N/A | +| `maxFiles` | *number* | :heavy_minus_sign: | N/A | +| `pdf` | [models.CompletionCreateParamsPdf](../models/completioncreateparamspdf.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/completioncreateparamspluginmoderation.md b/docs/models/completioncreateparamspluginmoderation.md new file mode 100644 index 00000000..4129d8a7 --- /dev/null +++ b/docs/models/completioncreateparamspluginmoderation.md @@ -0,0 +1,17 @@ +# CompletionCreateParamsPluginModeration + +## Example Usage + +```typescript +import { CompletionCreateParamsPluginModeration } from "@openrouter/sdk/models"; + +let value: CompletionCreateParamsPluginModeration = { + id: "moderation", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/completioncreateparamspluginunion.md b/docs/models/completioncreateparamspluginunion.md new file mode 100644 index 00000000..65af590e --- /dev/null +++ b/docs/models/completioncreateparamspluginunion.md @@ -0,0 +1,29 @@ +# CompletionCreateParamsPluginUnion + + +## Supported Types + +### `models.CompletionCreateParamsPluginModeration` + +```typescript +const value: models.CompletionCreateParamsPluginModeration = { + id: "moderation", +}; +``` + +### `models.CompletionCreateParamsPluginWeb` + +```typescript +const value: models.CompletionCreateParamsPluginWeb = { + id: "web", +}; +``` + +### `models.CompletionCreateParamsPluginFileParser` + +```typescript +const value: models.CompletionCreateParamsPluginFileParser = { + id: "file-parser", +}; +``` + diff --git a/docs/models/completioncreateparamspluginweb.md b/docs/models/completioncreateparamspluginweb.md new file mode 100644 index 00000000..14f70fcf --- /dev/null +++ b/docs/models/completioncreateparamspluginweb.md @@ -0,0 +1,20 @@ +# CompletionCreateParamsPluginWeb + +## Example Usage + +```typescript +import { CompletionCreateParamsPluginWeb } from "@openrouter/sdk/models"; + +let value: CompletionCreateParamsPluginWeb = { + id: "web", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | N/A | +| `maxResults` | *number* | :heavy_minus_sign: | N/A | +| `searchPrompt` | *string* | :heavy_minus_sign: | N/A | +| `engine` | [models.CompletionCreateParamsEngine](../models/completioncreateparamsengine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/completioncreateparamsprovider.md b/docs/models/completioncreateparamsprovider.md new file mode 100644 index 00000000..1b7def40 --- /dev/null +++ b/docs/models/completioncreateparamsprovider.md @@ -0,0 +1,25 @@ +# CompletionCreateParamsProvider + +## Example Usage + +```typescript +import { CompletionCreateParamsProvider } from "@openrouter/sdk/models"; + +let value: CompletionCreateParamsProvider = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `allowFallbacks` | *boolean* | :heavy_minus_sign: | Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
| +| `requireParameters` | *boolean* | :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. | +| `dataCollection` | [models.CompletionCreateParamsDataCollection](../models/completioncreateparamsdatacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it

- deny: use only providers which do not collect user data. | +| `zdr` | *boolean* | :heavy_minus_sign: | N/A | +| `enforceDistillableText` | *boolean* | :heavy_minus_sign: | N/A | +| `order` | *models.Schema0*[] | :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` | *models.Schema0*[] | :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` | *models.Schema0*[] | :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` | [models.CompletionCreateParamsQuantizations](../models/completioncreateparamsquantizations.md)[] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | +| `sort` | [models.CompletionCreateParamsSort](../models/completioncreateparamssort.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | +| `maxPrice` | [models.CompletionCreateParamsMaxPrice](../models/completioncreateparamsmaxprice.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. | \ No newline at end of file diff --git a/docs/models/completioncreateparamsquantizations.md b/docs/models/completioncreateparamsquantizations.md new file mode 100644 index 00000000..aedeb309 --- /dev/null +++ b/docs/models/completioncreateparamsquantizations.md @@ -0,0 +1,17 @@ +# CompletionCreateParamsQuantizations + +## Example Usage + +```typescript +import { CompletionCreateParamsQuantizations } from "@openrouter/sdk/models"; + +let value: CompletionCreateParamsQuantizations = "unknown"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"int4" | "int8" | "fp4" | "fp6" | "fp8" | "fp16" | "bf16" | "fp32" | "unknown" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/completioncreateparamssort.md b/docs/models/completioncreateparamssort.md new file mode 100644 index 00000000..e9f3d189 --- /dev/null +++ b/docs/models/completioncreateparamssort.md @@ -0,0 +1,17 @@ +# CompletionCreateParamsSort + +## Example Usage + +```typescript +import { CompletionCreateParamsSort } from "@openrouter/sdk/models"; + +let value: CompletionCreateParamsSort = "throughput"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"price" | "throughput" | "latency" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/datacollection.md b/docs/models/datacollection.md index 13d94c92..0fd355ae 100644 --- a/docs/models/datacollection.md +++ b/docs/models/datacollection.md @@ -2,15 +2,15 @@ Data collection setting. If no available model provider meets the requirement, your request will return an error. - allow: (default) allow providers which store user data non-transiently and may train on it -- deny: use only providers which do not collect user data. +- deny: use only providers which do not collect user data. ## Example Usage ```typescript import { DataCollection } from "@openrouter/sdk/models"; -let value: DataCollection = "deny"; +let value: DataCollection = "allow"; ``` ## Values diff --git a/docs/models/effort.md b/docs/models/effort.md index 32bb86d0..53018b3c 100644 --- a/docs/models/effort.md +++ b/docs/models/effort.md @@ -5,7 +5,7 @@ ```typescript import { Effort } from "@openrouter/sdk/models"; -let value: Effort = "low"; +let value: Effort = "minimal"; ``` ## Values @@ -13,5 +13,5 @@ let value: Effort = "low"; This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. ```typescript -"minimal" | "low" | "medium" | "high" | Unrecognized +"none" | "minimal" | "low" | "medium" | "high" | Unrecognized ``` \ No newline at end of file diff --git a/docs/models/ignore.md b/docs/models/ignore.md deleted file mode 100644 index de9c31d0..00000000 --- a/docs/models/ignore.md +++ /dev/null @@ -1,17 +0,0 @@ -# Ignore - - -## Supported Types - -### `models.ProviderName` - -```typescript -const value: models.ProviderName = "OpenAI"; -``` - -### `string` - -```typescript -const value: string = ""; -``` - diff --git a/docs/models/maxprice.md b/docs/models/maxprice.md deleted file mode 100644 index d2308276..00000000 --- a/docs/models/maxprice.md +++ /dev/null @@ -1,21 +0,0 @@ -# MaxPrice - -The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. - -## Example Usage - -```typescript -import { MaxPrice } from "@openrouter/sdk/models"; - -let value: MaxPrice = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | -| `prompt` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `completion` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `image` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `audio` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `request` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | \ No newline at end of file diff --git a/docs/models/openairesponsesreasoningeffort.md b/docs/models/openairesponsesreasoningeffort.md index 7e4499de..36b23502 100644 --- a/docs/models/openairesponsesreasoningeffort.md +++ b/docs/models/openairesponsesreasoningeffort.md @@ -13,5 +13,5 @@ let value: OpenAIResponsesReasoningEffort = "high"; This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. ```typescript -"high" | "medium" | "low" | "minimal" | Unrecognized +"high" | "medium" | "low" | "minimal" | "none" | Unrecognized ``` \ No newline at end of file diff --git a/docs/models/openresponsesreasoningformat.md b/docs/models/openresponsesreasoningformat.md index d276db03..3885ed10 100644 --- a/docs/models/openresponsesreasoningformat.md +++ b/docs/models/openresponsesreasoningformat.md @@ -13,5 +13,5 @@ let value: OpenResponsesReasoningFormat = "unknown"; This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. ```typescript -"unknown" | "openai-responses-v1" | "xai-responses-v1" | "anthropic-claude-v1" | Unrecognized +"unknown" | "openai-responses-v1" | "xai-responses-v1" | "anthropic-claude-v1" | "google-gemini-v1" | Unrecognized ``` \ No newline at end of file diff --git a/docs/models/openresponsesrequest.md b/docs/models/openresponsesrequest.md index 08bafb3e..a0bf208d 100644 --- a/docs/models/openresponsesrequest.md +++ b/docs/models/openresponsesrequest.md @@ -38,6 +38,6 @@ let value: OpenResponsesRequest = {}; | `serviceTier` | [models.ServiceTier](../models/servicetier.md) | :heavy_minus_sign: | N/A | auto | | `truncation` | [models.Truncation](../models/truncation.md) | :heavy_minus_sign: | N/A | auto | | `stream` | *boolean* | :heavy_minus_sign: | N/A | | -| `provider` | [models.Provider](../models/provider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | | -| `plugins` | *models.Plugin*[] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | | +| `provider` | [models.OpenResponsesRequestProvider](../models/openresponsesrequestprovider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | | +| `plugins` | *models.OpenResponsesRequestPluginUnion*[] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | | | `user` | *string* | :heavy_minus_sign: | A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. | | \ No newline at end of file diff --git a/docs/models/openresponsesrequestengine.md b/docs/models/openresponsesrequestengine.md new file mode 100644 index 00000000..7e49a7e0 --- /dev/null +++ b/docs/models/openresponsesrequestengine.md @@ -0,0 +1,17 @@ +# OpenResponsesRequestEngine + +## Example Usage + +```typescript +import { OpenResponsesRequestEngine } from "@openrouter/sdk/models"; + +let value: OpenResponsesRequestEngine = "native"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"native" | "exa" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/openresponsesrequestmaxprice.md b/docs/models/openresponsesrequestmaxprice.md new file mode 100644 index 00000000..f327cea1 --- /dev/null +++ b/docs/models/openresponsesrequestmaxprice.md @@ -0,0 +1,21 @@ +# OpenResponsesRequestMaxPrice + +The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + +## Example Usage + +```typescript +import { OpenResponsesRequestMaxPrice } from "@openrouter/sdk/models"; + +let value: OpenResponsesRequestMaxPrice = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `prompt` | *any* | :heavy_minus_sign: | N/A | +| `completion` | *any* | :heavy_minus_sign: | N/A | +| `image` | *any* | :heavy_minus_sign: | N/A | +| `audio` | *any* | :heavy_minus_sign: | N/A | +| `request` | *any* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/openresponsesrequestpdf.md b/docs/models/openresponsesrequestpdf.md new file mode 100644 index 00000000..cb33cc0e --- /dev/null +++ b/docs/models/openresponsesrequestpdf.md @@ -0,0 +1,15 @@ +# OpenResponsesRequestPdf + +## Example Usage + +```typescript +import { OpenResponsesRequestPdf } from "@openrouter/sdk/models"; + +let value: OpenResponsesRequestPdf = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `engine` | [models.OpenResponsesRequestPdfEngine](../models/openresponsesrequestpdfengine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/pdfengine.md b/docs/models/openresponsesrequestpdfengine.md similarity index 59% rename from docs/models/pdfengine.md rename to docs/models/openresponsesrequestpdfengine.md index 5781ce26..70d0f99a 100644 --- a/docs/models/pdfengine.md +++ b/docs/models/openresponsesrequestpdfengine.md @@ -1,11 +1,11 @@ -# PdfEngine +# OpenResponsesRequestPdfEngine ## Example Usage ```typescript -import { PdfEngine } from "@openrouter/sdk/models"; +import { OpenResponsesRequestPdfEngine } from "@openrouter/sdk/models"; -let value: PdfEngine = "pdf-text"; +let value: OpenResponsesRequestPdfEngine = "native"; ``` ## Values diff --git a/docs/models/openresponsesrequestpluginfileparser.md b/docs/models/openresponsesrequestpluginfileparser.md new file mode 100644 index 00000000..93beea9f --- /dev/null +++ b/docs/models/openresponsesrequestpluginfileparser.md @@ -0,0 +1,19 @@ +# OpenResponsesRequestPluginFileParser + +## Example Usage + +```typescript +import { OpenResponsesRequestPluginFileParser } from "@openrouter/sdk/models"; + +let value: OpenResponsesRequestPluginFileParser = { + id: "file-parser", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `id` | [models.IdFileParser](../models/idfileparser.md) | :heavy_check_mark: | N/A | +| `maxFiles` | *number* | :heavy_minus_sign: | N/A | +| `pdf` | [models.OpenResponsesRequestPdf](../models/openresponsesrequestpdf.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/pluginmoderation.md b/docs/models/openresponsesrequestpluginmoderation.md similarity index 80% rename from docs/models/pluginmoderation.md rename to docs/models/openresponsesrequestpluginmoderation.md index c5c4a8ab..bb77ae89 100644 --- a/docs/models/pluginmoderation.md +++ b/docs/models/openresponsesrequestpluginmoderation.md @@ -1,11 +1,11 @@ -# PluginModeration +# OpenResponsesRequestPluginModeration ## Example Usage ```typescript -import { PluginModeration } from "@openrouter/sdk/models"; +import { OpenResponsesRequestPluginModeration } from "@openrouter/sdk/models"; -let value: PluginModeration = { +let value: OpenResponsesRequestPluginModeration = { id: "moderation", }; ``` diff --git a/docs/models/openresponsesrequestpluginunion.md b/docs/models/openresponsesrequestpluginunion.md new file mode 100644 index 00000000..4ce3ce65 --- /dev/null +++ b/docs/models/openresponsesrequestpluginunion.md @@ -0,0 +1,29 @@ +# OpenResponsesRequestPluginUnion + + +## Supported Types + +### `models.OpenResponsesRequestPluginModeration` + +```typescript +const value: models.OpenResponsesRequestPluginModeration = { + id: "moderation", +}; +``` + +### `models.OpenResponsesRequestPluginWeb` + +```typescript +const value: models.OpenResponsesRequestPluginWeb = { + id: "web", +}; +``` + +### `models.OpenResponsesRequestPluginFileParser` + +```typescript +const value: models.OpenResponsesRequestPluginFileParser = { + id: "file-parser", +}; +``` + diff --git a/docs/models/openresponsesrequestpluginweb.md b/docs/models/openresponsesrequestpluginweb.md new file mode 100644 index 00000000..fb2a92cc --- /dev/null +++ b/docs/models/openresponsesrequestpluginweb.md @@ -0,0 +1,20 @@ +# OpenResponsesRequestPluginWeb + +## Example Usage + +```typescript +import { OpenResponsesRequestPluginWeb } from "@openrouter/sdk/models"; + +let value: OpenResponsesRequestPluginWeb = { + id: "web", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `id` | [models.IdWeb](../models/idweb.md) | :heavy_check_mark: | N/A | +| `maxResults` | *number* | :heavy_minus_sign: | N/A | +| `searchPrompt` | *string* | :heavy_minus_sign: | N/A | +| `engine` | [models.OpenResponsesRequestEngine](../models/openresponsesrequestengine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/provider.md b/docs/models/openresponsesrequestprovider.md similarity index 93% rename from docs/models/provider.md rename to docs/models/openresponsesrequestprovider.md index a4c5d100..46f8d979 100644 --- a/docs/models/provider.md +++ b/docs/models/openresponsesrequestprovider.md @@ -1,13 +1,13 @@ -# Provider +# OpenResponsesRequestProvider When multiple model providers are available, optionally indicate your routing preference. ## Example Usage ```typescript -import { Provider } from "@openrouter/sdk/models"; +import { OpenResponsesRequestProvider } from "@openrouter/sdk/models"; -let value: Provider = {}; +let value: OpenResponsesRequestProvider = {}; ``` ## Fields @@ -16,12 +16,12 @@ let value: Provider = {}; | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `allowFallbacks` | *boolean* | :heavy_minus_sign: | Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
| | | `requireParameters` | *boolean* | :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. | | -| `dataCollection` | [models.DataCollection](../models/datacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it
- deny: use only providers which do not collect user data.
| deny | +| `dataCollection` | [models.DataCollection](../models/datacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it

- deny: use only providers which do not collect user data. | allow | | `zdr` | *boolean* | :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 | | `enforceDistillableText` | *boolean* | :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` | *models.Order*[] | :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` | *models.Only*[] | :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` | *models.Ignore*[] | :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. | | +| `order` | *string*[] | :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. | [
"OpenAI",
"Anthropic"
] | +| `only` | *string*[] | :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. | [
"OpenAI",
"Anthropic"
] | +| `ignore` | *string*[] | :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. | [
"OpenAI",
"Anthropic"
] | | `quantizations` | [models.Quantization](../models/quantization.md)[] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | | -| `sort` | [models.Sort](../models/sort.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | price | -| `maxPrice` | [models.MaxPrice](../models/maxprice.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. | | \ No newline at end of file +| `sort` | [models.ProviderSort](../models/providersort.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | price | +| `maxPrice` | [models.OpenResponsesRequestMaxPrice](../models/openresponsesrequestmaxprice.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. | | \ No newline at end of file diff --git a/docs/models/operations/content.md b/docs/models/operations/content.md new file mode 100644 index 00000000..cc911d27 --- /dev/null +++ b/docs/models/operations/content.md @@ -0,0 +1,25 @@ +# Content + + +## Supported Types + +### `operations.ContentText` + +```typescript +const value: operations.ContentText = { + type: "text", + text: "", +}; +``` + +### `operations.ContentImageURL` + +```typescript +const value: operations.ContentImageURL = { + type: "image_url", + imageUrl: { + url: "https://zealous-march.biz/", + }, +}; +``` + diff --git a/docs/models/operations/contentimageurl.md b/docs/models/operations/contentimageurl.md new file mode 100644 index 00000000..c59de439 --- /dev/null +++ b/docs/models/operations/contentimageurl.md @@ -0,0 +1,21 @@ +# ContentImageURL + +## Example Usage + +```typescript +import { ContentImageURL } from "@openrouter/sdk/models/operations"; + +let value: ContentImageURL = { + type: "image_url", + imageUrl: { + url: "https://zealous-march.biz/", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `type` | [operations.TypeImageURL](../../models/operations/typeimageurl.md) | :heavy_check_mark: | N/A | +| `imageUrl` | [operations.ImageUrl](../../models/operations/imageurl.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/contenttext.md b/docs/models/operations/contenttext.md new file mode 100644 index 00000000..c0343ca4 --- /dev/null +++ b/docs/models/operations/contenttext.md @@ -0,0 +1,19 @@ +# ContentText + +## Example Usage + +```typescript +import { ContentText } from "@openrouter/sdk/models/operations"; + +let value: ContentText = { + type: "text", + text: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `type` | [operations.TypeText](../../models/operations/typetext.md) | :heavy_check_mark: | N/A | +| `text` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createembeddingsprovider.md b/docs/models/operations/createembeddingsprovider.md index 6c95cf1c..bc6162ab 100644 --- a/docs/models/operations/createembeddingsprovider.md +++ b/docs/models/operations/createembeddingsprovider.md @@ -14,12 +14,12 @@ let value: CreateEmbeddingsProvider = {}; | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `allowFallbacks` | *boolean* | :heavy_minus_sign: | Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
| | | `requireParameters` | *boolean* | :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. | | -| `dataCollection` | [operations.DataCollection](../../models/operations/datacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it
- deny: use only providers which do not collect user data.
| deny | +| `dataCollection` | [models.DataCollection](../../models/datacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it

- deny: use only providers which do not collect user data. | allow | | `zdr` | *boolean* | :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 | | `enforceDistillableText` | *boolean* | :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` | *operations.Order*[] | :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` | *operations.Only*[] | :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` | *operations.Ignore*[] | :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. | | +| `order` | *string*[] | :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. | [
"OpenAI",
"Anthropic"
] | +| `only` | *string*[] | :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. | [
"OpenAI",
"Anthropic"
] | +| `ignore` | *string*[] | :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. | [
"OpenAI",
"Anthropic"
] | | `quantizations` | [models.Quantization](../../models/quantization.md)[] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | | -| `sort` | [operations.Sort](../../models/operations/sort.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | price | +| `sort` | [models.ProviderSort](../../models/providersort.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | price | | `maxPrice` | [operations.MaxPrice](../../models/operations/maxprice.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. | | \ No newline at end of file diff --git a/docs/models/operations/createembeddingsrequest.md b/docs/models/operations/createembeddingsrequest.md index 12705ca4..557bddfb 100644 --- a/docs/models/operations/createembeddingsrequest.md +++ b/docs/models/operations/createembeddingsrequest.md @@ -7,11 +7,13 @@ import { CreateEmbeddingsRequest } from "@openrouter/sdk/models/operations"; let value: CreateEmbeddingsRequest = { input: [ - 669.24, - 4968.43, - 3849.69, + [], + [ + 3849.69, + ], + [], ], - model: "Altima", + model: "Model Y", }; ``` @@ -19,8 +21,10 @@ let value: CreateEmbeddingsRequest = { | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `input` | *operations.Input* | :heavy_check_mark: | N/A | +| `input` | *operations.InputUnion* | :heavy_check_mark: | N/A | | `model` | *string* | :heavy_check_mark: | N/A | +| `encodingFormat` | [operations.EncodingFormat](../../models/operations/encodingformat.md) | :heavy_minus_sign: | N/A | +| `dimensions` | *number* | :heavy_minus_sign: | N/A | +| `user` | *string* | :heavy_minus_sign: | N/A | | `provider` | [operations.CreateEmbeddingsProvider](../../models/operations/createembeddingsprovider.md) | :heavy_minus_sign: | N/A | -| `encodingFormat` | *operations.EncodingFormat* | :heavy_minus_sign: | N/A | -| `user` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `inputType` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/datacollection.md b/docs/models/operations/datacollection.md deleted file mode 100644 index d832689f..00000000 --- a/docs/models/operations/datacollection.md +++ /dev/null @@ -1,22 +0,0 @@ -# DataCollection - -Data collection setting. If no available model provider meets the requirement, your request will return an error. -- allow: (default) allow providers which store user data non-transiently and may train on it -- deny: use only providers which do not collect user data. - - -## Example Usage - -```typescript -import { DataCollection } from "@openrouter/sdk/models/operations"; - -let value: DataCollection = "deny"; -``` - -## Values - -This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. - -```typescript -"deny" | "allow" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/operations/encodingformat.md b/docs/models/operations/encodingformat.md index 7b5f69a7..fe5ce9ab 100644 --- a/docs/models/operations/encodingformat.md +++ b/docs/models/operations/encodingformat.md @@ -1,17 +1,17 @@ # EncodingFormat - -## Supported Types - -### `operations.EncodingFormatFloat` +## Example Usage ```typescript -const value: operations.EncodingFormatFloat = "float"; +import { EncodingFormat } from "@openrouter/sdk/models/operations"; + +let value: EncodingFormat = "float"; ``` -### `operations.EncodingFormatBase64` +## Values -```typescript -const value: operations.EncodingFormatBase64 = "base64"; -``` +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. +```typescript +"float" | "base64" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/encodingformatbase64.md b/docs/models/operations/encodingformatbase64.md deleted file mode 100644 index 91c09f3a..00000000 --- a/docs/models/operations/encodingformatbase64.md +++ /dev/null @@ -1,15 +0,0 @@ -# EncodingFormatBase64 - -## Example Usage - -```typescript -import { EncodingFormatBase64 } from "@openrouter/sdk/models/operations"; - -let value: EncodingFormatBase64 = "base64"; -``` - -## Values - -```typescript -"base64" -``` \ No newline at end of file diff --git a/docs/models/operations/encodingformatfloat.md b/docs/models/operations/encodingformatfloat.md deleted file mode 100644 index 018279dd..00000000 --- a/docs/models/operations/encodingformatfloat.md +++ /dev/null @@ -1,15 +0,0 @@ -# EncodingFormatFloat - -## Example Usage - -```typescript -import { EncodingFormatFloat } from "@openrouter/sdk/models/operations"; - -let value: EncodingFormatFloat = "float"; -``` - -## Values - -```typescript -"float" -``` \ No newline at end of file diff --git a/docs/models/operations/getparametersprovider.md b/docs/models/operations/getparametersprovider.md index b2d88d5a..3000d45f 100644 --- a/docs/models/operations/getparametersprovider.md +++ b/docs/models/operations/getparametersprovider.md @@ -5,7 +5,7 @@ ```typescript import { GetParametersProvider } from "@openrouter/sdk/models/operations"; -let value: GetParametersProvider = "Hyperbolic"; +let value: GetParametersProvider = "Google AI Studio"; ``` ## Values @@ -13,5 +13,5 @@ let value: GetParametersProvider = "Hyperbolic"; This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. ```typescript -"AI21" | "AionLabs" | "Alibaba" | "Amazon Bedrock" | "Anthropic" | "AtlasCloud" | "Atoma" | "Avian" | "Azure" | "BaseTen" | "Cerebras" | "Chutes" | "Cirrascale" | "Clarifai" | "Cloudflare" | "Cohere" | "CrofAI" | "Crusoe" | "DeepInfra" | "DeepSeek" | "Enfer" | "Featherless" | "Fireworks" | "Friendli" | "GMICloud" | "Google" | "Google AI Studio" | "Groq" | "Hyperbolic" | "Inception" | "InferenceNet" | "Infermatic" | "Inflection" | "Kluster" | "Lambda" | "Liquid" | "Mancer 2" | "Meta" | "Minimax" | "ModelRun" | "Mistral" | "Modular" | "Moonshot AI" | "Morph" | "NCompass" | "Nebius" | "NextBit" | "Nineteen" | "Novita" | "Nvidia" | "OpenAI" | "OpenInference" | "Parasail" | "Perplexity" | "Phala" | "Relace" | "SambaNova" | "SiliconFlow" | "Stealth" | "Switchpoint" | "Targon" | "Together" | "Ubicloud" | "Venice" | "WandB" | "xAI" | "Z.AI" | "FakeProvider" | Unrecognized +"AI21" | "AionLabs" | "Alibaba" | "Amazon Bedrock" | "Anthropic" | "Arcee" | "AtlasCloud" | "Avian" | "Azure" | "BaseTen" | "Black Forest Labs" | "Cerebras" | "Chutes" | "Cirrascale" | "Clarifai" | "Cloudflare" | "Cohere" | "Crusoe" | "DeepInfra" | "DeepSeek" | "Featherless" | "Fireworks" | "Friendli" | "GMICloud" | "Google" | "Google AI Studio" | "Groq" | "Hyperbolic" | "Inception" | "InferenceNet" | "Infermatic" | "Inflection" | "Liquid" | "Mancer 2" | "Minimax" | "ModelRun" | "Mistral" | "Modular" | "Moonshot AI" | "Morph" | "NCompass" | "Nebius" | "NextBit" | "Novita" | "Nvidia" | "OpenAI" | "OpenInference" | "Parasail" | "Perplexity" | "Phala" | "Relace" | "SambaNova" | "SiliconFlow" | "Stealth" | "Switchpoint" | "Targon" | "Together" | "Venice" | "WandB" | "xAI" | "Z.AI" | "FakeProvider" | Unrecognized ``` \ No newline at end of file diff --git a/docs/models/operations/ignore.md b/docs/models/operations/ignore.md deleted file mode 100644 index de9c31d0..00000000 --- a/docs/models/operations/ignore.md +++ /dev/null @@ -1,17 +0,0 @@ -# Ignore - - -## Supported Types - -### `models.ProviderName` - -```typescript -const value: models.ProviderName = "OpenAI"; -``` - -### `string` - -```typescript -const value: string = ""; -``` - diff --git a/docs/models/operations/imageurl.md b/docs/models/operations/imageurl.md new file mode 100644 index 00000000..1372d72e --- /dev/null +++ b/docs/models/operations/imageurl.md @@ -0,0 +1,17 @@ +# ImageUrl + +## Example Usage + +```typescript +import { ImageUrl } from "@openrouter/sdk/models/operations"; + +let value: ImageUrl = { + url: "https://sinful-meal.biz", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `url` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/input.md b/docs/models/operations/input.md index 56643938..de8968b2 100644 --- a/docs/models/operations/input.md +++ b/docs/models/operations/input.md @@ -1,47 +1,17 @@ # Input - -## Supported Types - -### `string` - -```typescript -const value: string = ""; -``` - -### `string[]` +## Example Usage ```typescript -const value: string[] = [ - "", - "", -]; -``` - -### `number[]` +import { Input } from "@openrouter/sdk/models/operations"; -```typescript -const value: number[] = [ - 3390.48, - 1336.21, - 9437.99, -]; +let value: Input = { + content: [], +}; ``` -### `number[][]` - -```typescript -const value: number[][] = [ - [ - 6206.15, - ], - [ - 8419.72, - 5863.71, - ], - [ - 2540.22, - ], -]; -``` +## Fields +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `content` | *operations.Content*[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/inputunion.md b/docs/models/operations/inputunion.md new file mode 100644 index 00000000..d9f8b763 --- /dev/null +++ b/docs/models/operations/inputunion.md @@ -0,0 +1,57 @@ +# InputUnion + + +## Supported Types + +### `string` + +```typescript +const value: string = ""; +``` + +### `string[]` + +```typescript +const value: string[] = [ + "", + "", +]; +``` + +### `number[]` + +```typescript +const value: number[] = [ + 3390.48, + 1336.21, + 9437.99, +]; +``` + +### `number[][]` + +```typescript +const value: number[][] = [ + [ + 6206.15, + ], + [ + 8419.72, + 5863.71, + ], + [ + 2540.22, + ], +]; +``` + +### `operations.Input[]` + +```typescript +const value: operations.Input[] = [ + { + content: [], + }, +]; +``` + diff --git a/docs/models/operations/maxprice.md b/docs/models/operations/maxprice.md index d54dfb5c..69c1b700 100644 --- a/docs/models/operations/maxprice.md +++ b/docs/models/operations/maxprice.md @@ -12,10 +12,10 @@ let value: MaxPrice = {}; ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | -| `prompt` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `completion` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `image` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `audio` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `request` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `prompt` | *any* | :heavy_minus_sign: | N/A | +| `completion` | *any* | :heavy_minus_sign: | N/A | +| `image` | *any* | :heavy_minus_sign: | N/A | +| `audio` | *any* | :heavy_minus_sign: | N/A | +| `request` | *any* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/only.md b/docs/models/operations/only.md deleted file mode 100644 index c4202205..00000000 --- a/docs/models/operations/only.md +++ /dev/null @@ -1,17 +0,0 @@ -# Only - - -## Supported Types - -### `models.ProviderName` - -```typescript -const value: models.ProviderName = "OpenAI"; -``` - -### `string` - -```typescript -const value: string = ""; -``` - diff --git a/docs/models/operations/order.md b/docs/models/operations/order.md deleted file mode 100644 index 8a2f0898..00000000 --- a/docs/models/operations/order.md +++ /dev/null @@ -1,17 +0,0 @@ -# Order - - -## Supported Types - -### `models.ProviderName` - -```typescript -const value: models.ProviderName = "OpenAI"; -``` - -### `string` - -```typescript -const value: string = ""; -``` - diff --git a/docs/models/operations/typeimageurl.md b/docs/models/operations/typeimageurl.md new file mode 100644 index 00000000..1bbb306d --- /dev/null +++ b/docs/models/operations/typeimageurl.md @@ -0,0 +1,15 @@ +# TypeImageURL + +## Example Usage + +```typescript +import { TypeImageURL } from "@openrouter/sdk/models/operations"; + +let value: TypeImageURL = "image_url"; +``` + +## Values + +```typescript +"image_url" +``` \ No newline at end of file diff --git a/docs/models/operations/typetext.md b/docs/models/operations/typetext.md new file mode 100644 index 00000000..fa9f96fe --- /dev/null +++ b/docs/models/operations/typetext.md @@ -0,0 +1,15 @@ +# TypeText + +## Example Usage + +```typescript +import { TypeText } from "@openrouter/sdk/models/operations"; + +let value: TypeText = "text"; +``` + +## Values + +```typescript +"text" +``` \ No newline at end of file diff --git a/docs/models/order.md b/docs/models/order.md deleted file mode 100644 index 8a2f0898..00000000 --- a/docs/models/order.md +++ /dev/null @@ -1,17 +0,0 @@ -# Order - - -## Supported Types - -### `models.ProviderName` - -```typescript -const value: models.ProviderName = "OpenAI"; -``` - -### `string` - -```typescript -const value: string = ""; -``` - diff --git a/docs/models/pdf.md b/docs/models/pdf.md deleted file mode 100644 index 67850913..00000000 --- a/docs/models/pdf.md +++ /dev/null @@ -1,15 +0,0 @@ -# Pdf - -## Example Usage - -```typescript -import { Pdf } from "@openrouter/sdk/models"; - -let value: Pdf = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| `engine` | [models.PdfEngine](../models/pdfengine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/plugin.md b/docs/models/plugin.md deleted file mode 100644 index a7b20a73..00000000 --- a/docs/models/plugin.md +++ /dev/null @@ -1,29 +0,0 @@ -# Plugin - - -## Supported Types - -### `models.PluginModeration` - -```typescript -const value: models.PluginModeration = { - id: "moderation", -}; -``` - -### `models.PluginWeb` - -```typescript -const value: models.PluginWeb = { - id: "web", -}; -``` - -### `models.PluginFileParser` - -```typescript -const value: models.PluginFileParser = { - id: "file-parser", -}; -``` - diff --git a/docs/models/pluginfileparser.md b/docs/models/pluginfileparser.md deleted file mode 100644 index 22035248..00000000 --- a/docs/models/pluginfileparser.md +++ /dev/null @@ -1,19 +0,0 @@ -# PluginFileParser - -## Example Usage - -```typescript -import { PluginFileParser } from "@openrouter/sdk/models"; - -let value: PluginFileParser = { - id: "file-parser", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | -| `id` | [models.IdFileParser](../models/idfileparser.md) | :heavy_check_mark: | N/A | -| `maxFiles` | *number* | :heavy_minus_sign: | N/A | -| `pdf` | [models.Pdf](../models/pdf.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/pluginweb.md b/docs/models/pluginweb.md deleted file mode 100644 index 5cfb0228..00000000 --- a/docs/models/pluginweb.md +++ /dev/null @@ -1,20 +0,0 @@ -# PluginWeb - -## Example Usage - -```typescript -import { PluginWeb } from "@openrouter/sdk/models"; - -let value: PluginWeb = { - id: "web", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `id` | [models.IdWeb](../models/idweb.md) | :heavy_check_mark: | N/A | -| `maxResults` | *number* | :heavy_minus_sign: | N/A | -| `searchPrompt` | *string* | :heavy_minus_sign: | N/A | -| `engine` | [models.Engine](../models/engine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/pricing.md b/docs/models/pricing.md index 84e797d7..6e2a1bb1 100644 --- a/docs/models/pricing.md +++ b/docs/models/pricing.md @@ -7,23 +7,24 @@ import { Pricing } from "@openrouter/sdk/models"; let value: Pricing = { prompt: 1000, - completion: "1000", + completion: "", }; ``` ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | -| `prompt` | *any* | :heavy_check_mark: | A value in string or number format that is a large number | -| `completion` | *any* | :heavy_check_mark: | A value in string or number format that is a large number | -| `request` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `image` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `imageOutput` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `audio` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `inputAudioCache` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `webSearch` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `internalReasoning` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `inputCacheRead` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `inputCacheWrite` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `discount` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------- | ------------------- | ------------------- | ------------------- | +| `prompt` | *any* | :heavy_check_mark: | N/A | +| `completion` | *any* | :heavy_check_mark: | N/A | +| `request` | *any* | :heavy_minus_sign: | N/A | +| `image` | *any* | :heavy_minus_sign: | N/A | +| `imageToken` | *any* | :heavy_minus_sign: | N/A | +| `imageOutput` | *any* | :heavy_minus_sign: | N/A | +| `audio` | *any* | :heavy_minus_sign: | N/A | +| `inputAudioCache` | *any* | :heavy_minus_sign: | N/A | +| `webSearch` | *any* | :heavy_minus_sign: | N/A | +| `internalReasoning` | *any* | :heavy_minus_sign: | N/A | +| `inputCacheRead` | *any* | :heavy_minus_sign: | N/A | +| `inputCacheWrite` | *any* | :heavy_minus_sign: | N/A | +| `discount` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/providername.md b/docs/models/providername.md index 0dfb43fa..01c9fc45 100644 --- a/docs/models/providername.md +++ b/docs/models/providername.md @@ -13,5 +13,5 @@ let value: ProviderName = "OpenAI"; This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. ```typescript -"AnyScale" | "Cent-ML" | "HuggingFace" | "Hyperbolic 2" | "Lepton" | "Lynn 2" | "Lynn" | "Mancer" | "Modal" | "OctoAI" | "Recursal" | "Reflection" | "Replicate" | "SambaNova 2" | "SF Compute" | "Together 2" | "01.AI" | "AI21" | "AionLabs" | "Alibaba" | "Amazon Bedrock" | "Anthropic" | "AtlasCloud" | "Atoma" | "Avian" | "Azure" | "BaseTen" | "Cerebras" | "Chutes" | "Cirrascale" | "Clarifai" | "Cloudflare" | "Cohere" | "CrofAI" | "Crusoe" | "DeepInfra" | "DeepSeek" | "Enfer" | "Featherless" | "Fireworks" | "Friendli" | "GMICloud" | "Google" | "Google AI Studio" | "Groq" | "Hyperbolic" | "Inception" | "InferenceNet" | "Infermatic" | "Inflection" | "InoCloud" | "Kluster" | "Lambda" | "Liquid" | "Mancer 2" | "Meta" | "Minimax" | "ModelRun" | "Mistral" | "Modular" | "Moonshot AI" | "Morph" | "NCompass" | "Nebius" | "NextBit" | "Nineteen" | "Novita" | "Nvidia" | "OpenAI" | "OpenInference" | "Parasail" | "Perplexity" | "Phala" | "Relace" | "SambaNova" | "SiliconFlow" | "Stealth" | "Switchpoint" | "Targon" | "Together" | "Ubicloud" | "Venice" | "WandB" | "xAI" | "Z.AI" | "FakeProvider" | Unrecognized +"AI21" | "AionLabs" | "Alibaba" | "Amazon Bedrock" | "Anthropic" | "Arcee" | "AtlasCloud" | "Avian" | "Azure" | "BaseTen" | "Black Forest Labs" | "Cerebras" | "Chutes" | "Cirrascale" | "Clarifai" | "Cloudflare" | "Cohere" | "Crusoe" | "DeepInfra" | "DeepSeek" | "Featherless" | "Fireworks" | "Friendli" | "GMICloud" | "Google" | "Google AI Studio" | "Groq" | "Hyperbolic" | "Inception" | "InferenceNet" | "Infermatic" | "Inflection" | "Liquid" | "Mancer 2" | "Minimax" | "ModelRun" | "Mistral" | "Modular" | "Moonshot AI" | "Morph" | "NCompass" | "Nebius" | "NextBit" | "Novita" | "Nvidia" | "OpenAI" | "OpenInference" | "Parasail" | "Perplexity" | "Phala" | "Relace" | "SambaNova" | "SiliconFlow" | "Stealth" | "Switchpoint" | "Targon" | "Together" | "Venice" | "WandB" | "xAI" | "Z.AI" | "FakeProvider" | Unrecognized ``` \ No newline at end of file diff --git a/docs/models/sort.md b/docs/models/providersort.md similarity index 76% rename from docs/models/sort.md rename to docs/models/providersort.md index 7267328d..ff5658b5 100644 --- a/docs/models/sort.md +++ b/docs/models/providersort.md @@ -1,13 +1,13 @@ -# Sort +# ProviderSort The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. ## Example Usage ```typescript -import { Sort } from "@openrouter/sdk/models"; +import { ProviderSort } from "@openrouter/sdk/models"; -let value: Sort = "price"; +let value: ProviderSort = "price"; ``` ## Values diff --git a/docs/models/publicpricing.md b/docs/models/publicpricing.md index 8fd536ae..25fbdc9e 100644 --- a/docs/models/publicpricing.md +++ b/docs/models/publicpricing.md @@ -15,17 +15,18 @@ let value: PublicPricing = { ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | -| `prompt` | *any* | :heavy_check_mark: | A value in string or number format that is a large number | -| `completion` | *any* | :heavy_check_mark: | A value in string or number format that is a large number | -| `request` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `image` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `imageOutput` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `audio` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `inputAudioCache` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `webSearch` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `internalReasoning` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `inputCacheRead` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `inputCacheWrite` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `discount` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------- | ------------------- | ------------------- | ------------------- | +| `prompt` | *any* | :heavy_check_mark: | N/A | +| `completion` | *any* | :heavy_check_mark: | N/A | +| `request` | *any* | :heavy_minus_sign: | N/A | +| `image` | *any* | :heavy_minus_sign: | N/A | +| `imageToken` | *any* | :heavy_minus_sign: | N/A | +| `imageOutput` | *any* | :heavy_minus_sign: | N/A | +| `audio` | *any* | :heavy_minus_sign: | N/A | +| `inputAudioCache` | *any* | :heavy_minus_sign: | N/A | +| `webSearch` | *any* | :heavy_minus_sign: | N/A | +| `internalReasoning` | *any* | :heavy_minus_sign: | N/A | +| `inputCacheRead` | *any* | :heavy_minus_sign: | N/A | +| `inputCacheWrite` | *any* | :heavy_minus_sign: | N/A | +| `discount` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/only.md b/docs/models/schema0.md similarity index 57% rename from docs/models/only.md rename to docs/models/schema0.md index c4202205..c6058f73 100644 --- a/docs/models/only.md +++ b/docs/models/schema0.md @@ -1,12 +1,12 @@ -# Only +# Schema0 ## Supported Types -### `models.ProviderName` +### `models.Schema0Enum` ```typescript -const value: models.ProviderName = "OpenAI"; +const value: models.Schema0Enum = "Alibaba"; ``` ### `string` diff --git a/docs/models/schema0enum.md b/docs/models/schema0enum.md new file mode 100644 index 00000000..db00b191 --- /dev/null +++ b/docs/models/schema0enum.md @@ -0,0 +1,17 @@ +# Schema0Enum + +## Example Usage + +```typescript +import { Schema0Enum } from "@openrouter/sdk/models"; + +let value: Schema0Enum = "Venice"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"AI21" | "AionLabs" | "Alibaba" | "Amazon Bedrock" | "Anthropic" | "Arcee" | "AtlasCloud" | "Avian" | "Azure" | "BaseTen" | "Black Forest Labs" | "Cerebras" | "Chutes" | "Cirrascale" | "Clarifai" | "Cloudflare" | "Cohere" | "Crusoe" | "DeepInfra" | "DeepSeek" | "Featherless" | "Fireworks" | "Friendli" | "GMICloud" | "Google" | "Google AI Studio" | "Groq" | "Hyperbolic" | "Inception" | "InferenceNet" | "Infermatic" | "Inflection" | "Liquid" | "Mancer 2" | "Minimax" | "ModelRun" | "Mistral" | "Modular" | "Moonshot AI" | "Morph" | "NCompass" | "Nebius" | "NextBit" | "Novita" | "Nvidia" | "OpenAI" | "OpenInference" | "Parasail" | "Perplexity" | "Phala" | "Relace" | "SambaNova" | "SiliconFlow" | "Stealth" | "Switchpoint" | "Targon" | "Together" | "Venice" | "WandB" | "xAI" | "Z.AI" | "FakeProvider" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/toolresponsemessagecontent.md b/docs/models/toolresponsemessagecontent.md index d3caea71..7926f5c3 100644 --- a/docs/models/toolresponsemessagecontent.md +++ b/docs/models/toolresponsemessagecontent.md @@ -14,8 +14,10 @@ const value: string = ""; ```typescript const value: models.ChatMessageContentItem[] = [ { - type: "text", - text: "", + type: "image_url", + imageUrl: { + url: "https://pretty-reservation.org", + }, }, ]; ``` diff --git a/docs/models/usermessagecontent.md b/docs/models/usermessagecontent.md index 8e4cbf88..69eeecaf 100644 --- a/docs/models/usermessagecontent.md +++ b/docs/models/usermessagecontent.md @@ -14,8 +14,10 @@ const value: string = ""; ```typescript const value: models.ChatMessageContentItem[] = [ { - type: "text", - text: "", + type: "image_url", + imageUrl: { + url: "https://pretty-reservation.org", + }, }, ]; ``` diff --git a/docs/models/videourl1.md b/docs/models/videourl1.md new file mode 100644 index 00000000..aa61751a --- /dev/null +++ b/docs/models/videourl1.md @@ -0,0 +1,17 @@ +# VideoUrl1 + +## Example Usage + +```typescript +import { VideoUrl1 } from "@openrouter/sdk/models"; + +let value: VideoUrl1 = { + url: "https://colorless-milestone.net/", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `url` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/videourl.md b/docs/models/videourl2.md similarity index 70% rename from docs/models/videourl.md rename to docs/models/videourl2.md index 99f2f67d..0ec1780e 100644 --- a/docs/models/videourl.md +++ b/docs/models/videourl2.md @@ -1,12 +1,12 @@ -# VideoUrl +# VideoUrl2 ## Example Usage ```typescript -import { VideoUrl } from "@openrouter/sdk/models"; +import { VideoUrl2 } from "@openrouter/sdk/models"; -let value: VideoUrl = { - url: "https://tangible-extent.net/", +let value: VideoUrl2 = { + url: "https://triangular-soup.info", }; ``` diff --git a/jsr.json b/jsr.json index b75bb7a0..96ec6b3f 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "0.1.11", + "version": "0.1.12", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 074b4c02..64d55f13 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@openrouter/sdk", - "version": "0.1.11", + "version": "0.1.12", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@openrouter/sdk", - "version": "0.1.11", + "version": "0.1.12", "license": "Apache-2.0", "dependencies": { "zod": "^3.25.0 || ^4.0.0" diff --git a/package.json b/package.json index c4ff254d..caa11dca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "0.1.11", + "version": "0.1.12", "author": "OpenRouter", "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.", "keywords": [ diff --git a/src/lib/config.ts b/src/lib/config.ts index 516c1e42..203c0f4b 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -59,7 +59,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0.0", - sdkVersion: "0.1.11", - genVersion: "2.750.0", - userAgent: "speakeasy-sdk/typescript 0.1.11 2.750.0 1.0.0 @openrouter/sdk", + sdkVersion: "0.1.12", + genVersion: "2.755.9", + userAgent: "speakeasy-sdk/typescript 0.1.12 2.755.9 1.0.0 @openrouter/sdk", } as const; diff --git a/src/models/chatcompletionfinishreason.ts b/src/models/chatcompletionfinishreason.ts deleted file mode 100644 index 57f8af17..00000000 --- a/src/models/chatcompletionfinishreason.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v4"; -import * as openEnums from "../types/enums.js"; -import { OpenEnum } from "../types/enums.js"; - -export const ChatCompletionFinishReason = { - ToolCalls: "tool_calls", - Stop: "stop", - Length: "length", - ContentFilter: "content_filter", - Error: "error", -} as const; -export type ChatCompletionFinishReason = OpenEnum< - typeof ChatCompletionFinishReason ->; - -/** @internal */ -export const ChatCompletionFinishReason$inboundSchema: z.ZodType< - ChatCompletionFinishReason, - unknown -> = openEnums.inboundSchema(ChatCompletionFinishReason); diff --git a/src/models/chatgenerationparams.ts b/src/models/chatgenerationparams.ts index 5ee5ae84..023aca23 100644 --- a/src/models/chatgenerationparams.ts +++ b/src/models/chatgenerationparams.ts @@ -30,13 +30,155 @@ import { ResponseFormatTextGrammar$Outbound, ResponseFormatTextGrammar$outboundSchema, } from "./responseformattextgrammar.js"; +import { + Schema0, + Schema0$Outbound, + Schema0$outboundSchema, +} from "./schema0.js"; import { ToolDefinitionJson, ToolDefinitionJson$Outbound, ToolDefinitionJson$outboundSchema, } from "./tooldefinitionjson.js"; +export const ChatGenerationParamsPdfEngine = { + MistralOcr: "mistral-ocr", + PdfText: "pdf-text", + Native: "native", +} as const; +export type ChatGenerationParamsPdfEngine = OpenEnum< + typeof ChatGenerationParamsPdfEngine +>; + +export type ChatGenerationParamsPdf = { + engine?: ChatGenerationParamsPdfEngine | undefined; +}; + +export type ChatGenerationParamsPluginFileParser = { + id: "file-parser"; + maxFiles?: number | undefined; + pdf?: ChatGenerationParamsPdf | undefined; +}; + +export const ChatGenerationParamsEngine = { + Native: "native", + Exa: "exa", +} as const; +export type ChatGenerationParamsEngine = OpenEnum< + typeof ChatGenerationParamsEngine +>; + +export type ChatGenerationParamsPluginWeb = { + id: "web"; + maxResults?: number | undefined; + searchPrompt?: string | undefined; + engine?: ChatGenerationParamsEngine | undefined; +}; + +export type ChatGenerationParamsPluginModeration = { + id: "moderation"; +}; + +export type ChatGenerationParamsPluginUnion = + | ChatGenerationParamsPluginModeration + | ChatGenerationParamsPluginWeb + | ChatGenerationParamsPluginFileParser; + +export const ChatGenerationParamsDataCollection = { + Deny: "deny", + Allow: "allow", +} as const; +export type ChatGenerationParamsDataCollection = OpenEnum< + typeof ChatGenerationParamsDataCollection +>; + +export const ChatGenerationParamsQuantizations = { + Int4: "int4", + Int8: "int8", + Fp4: "fp4", + Fp6: "fp6", + Fp8: "fp8", + Fp16: "fp16", + Bf16: "bf16", + Fp32: "fp32", + Unknown: "unknown", +} as const; +export type ChatGenerationParamsQuantizations = OpenEnum< + typeof ChatGenerationParamsQuantizations +>; + +export const ChatGenerationParamsSort = { + Price: "price", + Throughput: "throughput", + Latency: "latency", +} as const; +export type ChatGenerationParamsSort = OpenEnum< + typeof ChatGenerationParamsSort +>; + +/** + * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + */ +export type ChatGenerationParamsMaxPrice = { + prompt?: any | undefined; + completion?: any | undefined; + image?: any | undefined; + audio?: any | undefined; + request?: any | undefined; +}; + +export type ChatGenerationParamsProvider = { + /** + * Whether to allow backup providers to serve requests + * + * @remarks + * - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. + * - false: use only the primary/custom provider, and return the upstream error if it's unavailable. + */ + allowFallbacks?: boolean | null | undefined; + /** + * 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. + */ + requireParameters?: boolean | null | undefined; + /** + * Data collection setting. If no available model provider meets the requirement, your request will return an error. + * + * @remarks + * - allow: (default) allow providers which store user data non-transiently and may train on it + * + * - deny: use only providers which do not collect user data. + */ + dataCollection?: ChatGenerationParamsDataCollection | null | undefined; + zdr?: boolean | null | undefined; + enforceDistillableText?: boolean | null | undefined; + /** + * 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. + */ + order?: Array | null | undefined; + /** + * List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. + */ + only?: Array | null | undefined; + /** + * List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. + */ + ignore?: Array | null | undefined; + /** + * A list of quantization levels to filter the provider by. + */ + quantizations?: Array | null | undefined; + /** + * The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. + */ + sort?: ChatGenerationParamsSort | null | undefined; + /** + * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + */ + maxPrice?: ChatGenerationParamsMaxPrice | undefined; +}; + export const Effort = { + None: "none", Minimal: "minimal", Low: "low", Medium: "medium", @@ -71,6 +213,14 @@ export type ChatGenerationParamsResponseFormatUnion = export type ChatGenerationParamsStop = string | Array; export type ChatGenerationParams = { + plugins?: + | Array< + | ChatGenerationParamsPluginModeration + | ChatGenerationParamsPluginWeb + | ChatGenerationParamsPluginFileParser + > + | undefined; + provider?: ChatGenerationParamsProvider | null | undefined; messages: Array; model?: string | undefined; models?: Array | undefined; @@ -101,6 +251,257 @@ export type ChatGenerationParams = { user?: string | undefined; }; +/** @internal */ +export const ChatGenerationParamsPdfEngine$outboundSchema: z.ZodType< + string, + ChatGenerationParamsPdfEngine +> = openEnums.outboundSchema(ChatGenerationParamsPdfEngine); + +/** @internal */ +export type ChatGenerationParamsPdf$Outbound = { + engine?: string | undefined; +}; + +/** @internal */ +export const ChatGenerationParamsPdf$outboundSchema: z.ZodType< + ChatGenerationParamsPdf$Outbound, + ChatGenerationParamsPdf +> = z.object({ + engine: ChatGenerationParamsPdfEngine$outboundSchema.optional(), +}); + +export function chatGenerationParamsPdfToJSON( + chatGenerationParamsPdf: ChatGenerationParamsPdf, +): string { + return JSON.stringify( + ChatGenerationParamsPdf$outboundSchema.parse(chatGenerationParamsPdf), + ); +} + +/** @internal */ +export type ChatGenerationParamsPluginFileParser$Outbound = { + id: "file-parser"; + max_files?: number | undefined; + pdf?: ChatGenerationParamsPdf$Outbound | undefined; +}; + +/** @internal */ +export const ChatGenerationParamsPluginFileParser$outboundSchema: z.ZodType< + ChatGenerationParamsPluginFileParser$Outbound, + ChatGenerationParamsPluginFileParser +> = z.object({ + id: z.literal("file-parser"), + maxFiles: z.number().optional(), + pdf: z.lazy(() => ChatGenerationParamsPdf$outboundSchema).optional(), +}).transform((v) => { + return remap$(v, { + maxFiles: "max_files", + }); +}); + +export function chatGenerationParamsPluginFileParserToJSON( + chatGenerationParamsPluginFileParser: ChatGenerationParamsPluginFileParser, +): string { + return JSON.stringify( + ChatGenerationParamsPluginFileParser$outboundSchema.parse( + chatGenerationParamsPluginFileParser, + ), + ); +} + +/** @internal */ +export const ChatGenerationParamsEngine$outboundSchema: z.ZodType< + string, + ChatGenerationParamsEngine +> = openEnums.outboundSchema(ChatGenerationParamsEngine); + +/** @internal */ +export type ChatGenerationParamsPluginWeb$Outbound = { + id: "web"; + max_results?: number | undefined; + search_prompt?: string | undefined; + engine?: string | undefined; +}; + +/** @internal */ +export const ChatGenerationParamsPluginWeb$outboundSchema: z.ZodType< + ChatGenerationParamsPluginWeb$Outbound, + ChatGenerationParamsPluginWeb +> = z.object({ + id: z.literal("web"), + maxResults: z.number().optional(), + searchPrompt: z.string().optional(), + engine: ChatGenerationParamsEngine$outboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + maxResults: "max_results", + searchPrompt: "search_prompt", + }); +}); + +export function chatGenerationParamsPluginWebToJSON( + chatGenerationParamsPluginWeb: ChatGenerationParamsPluginWeb, +): string { + return JSON.stringify( + ChatGenerationParamsPluginWeb$outboundSchema.parse( + chatGenerationParamsPluginWeb, + ), + ); +} + +/** @internal */ +export type ChatGenerationParamsPluginModeration$Outbound = { + id: "moderation"; +}; + +/** @internal */ +export const ChatGenerationParamsPluginModeration$outboundSchema: z.ZodType< + ChatGenerationParamsPluginModeration$Outbound, + ChatGenerationParamsPluginModeration +> = z.object({ + id: z.literal("moderation"), +}); + +export function chatGenerationParamsPluginModerationToJSON( + chatGenerationParamsPluginModeration: ChatGenerationParamsPluginModeration, +): string { + return JSON.stringify( + ChatGenerationParamsPluginModeration$outboundSchema.parse( + chatGenerationParamsPluginModeration, + ), + ); +} + +/** @internal */ +export type ChatGenerationParamsPluginUnion$Outbound = + | ChatGenerationParamsPluginModeration$Outbound + | ChatGenerationParamsPluginWeb$Outbound + | ChatGenerationParamsPluginFileParser$Outbound; + +/** @internal */ +export const ChatGenerationParamsPluginUnion$outboundSchema: z.ZodType< + ChatGenerationParamsPluginUnion$Outbound, + ChatGenerationParamsPluginUnion +> = z.union([ + z.lazy(() => ChatGenerationParamsPluginModeration$outboundSchema), + z.lazy(() => ChatGenerationParamsPluginWeb$outboundSchema), + z.lazy(() => ChatGenerationParamsPluginFileParser$outboundSchema), +]); + +export function chatGenerationParamsPluginUnionToJSON( + chatGenerationParamsPluginUnion: ChatGenerationParamsPluginUnion, +): string { + return JSON.stringify( + ChatGenerationParamsPluginUnion$outboundSchema.parse( + chatGenerationParamsPluginUnion, + ), + ); +} + +/** @internal */ +export const ChatGenerationParamsDataCollection$outboundSchema: z.ZodType< + string, + ChatGenerationParamsDataCollection +> = openEnums.outboundSchema(ChatGenerationParamsDataCollection); + +/** @internal */ +export const ChatGenerationParamsQuantizations$outboundSchema: z.ZodType< + string, + ChatGenerationParamsQuantizations +> = openEnums.outboundSchema(ChatGenerationParamsQuantizations); + +/** @internal */ +export const ChatGenerationParamsSort$outboundSchema: z.ZodType< + string, + ChatGenerationParamsSort +> = openEnums.outboundSchema(ChatGenerationParamsSort); + +/** @internal */ +export type ChatGenerationParamsMaxPrice$Outbound = { + prompt?: any | undefined; + completion?: any | undefined; + image?: any | undefined; + audio?: any | undefined; + request?: any | undefined; +}; + +/** @internal */ +export const ChatGenerationParamsMaxPrice$outboundSchema: z.ZodType< + ChatGenerationParamsMaxPrice$Outbound, + ChatGenerationParamsMaxPrice +> = z.object({ + prompt: z.any().optional(), + completion: z.any().optional(), + image: z.any().optional(), + audio: z.any().optional(), + request: z.any().optional(), +}); + +export function chatGenerationParamsMaxPriceToJSON( + chatGenerationParamsMaxPrice: ChatGenerationParamsMaxPrice, +): string { + return JSON.stringify( + ChatGenerationParamsMaxPrice$outboundSchema.parse( + chatGenerationParamsMaxPrice, + ), + ); +} + +/** @internal */ +export type ChatGenerationParamsProvider$Outbound = { + allow_fallbacks?: boolean | null | undefined; + require_parameters?: boolean | null | undefined; + data_collection?: string | null | undefined; + zdr?: boolean | null | undefined; + enforce_distillable_text?: boolean | null | undefined; + order?: Array | null | undefined; + only?: Array | null | undefined; + ignore?: Array | null | undefined; + quantizations?: Array | null | undefined; + sort?: string | null | undefined; + max_price?: ChatGenerationParamsMaxPrice$Outbound | undefined; +}; + +/** @internal */ +export const ChatGenerationParamsProvider$outboundSchema: z.ZodType< + ChatGenerationParamsProvider$Outbound, + ChatGenerationParamsProvider +> = z.object({ + allowFallbacks: z.nullable(z.boolean()).optional(), + requireParameters: z.nullable(z.boolean()).optional(), + dataCollection: z.nullable(ChatGenerationParamsDataCollection$outboundSchema) + .optional(), + zdr: z.nullable(z.boolean()).optional(), + enforceDistillableText: z.nullable(z.boolean()).optional(), + order: z.nullable(z.array(Schema0$outboundSchema)).optional(), + only: z.nullable(z.array(Schema0$outboundSchema)).optional(), + ignore: z.nullable(z.array(Schema0$outboundSchema)).optional(), + quantizations: z.nullable( + z.array(ChatGenerationParamsQuantizations$outboundSchema), + ).optional(), + sort: z.nullable(ChatGenerationParamsSort$outboundSchema).optional(), + maxPrice: z.lazy(() => ChatGenerationParamsMaxPrice$outboundSchema) + .optional(), +}).transform((v) => { + return remap$(v, { + allowFallbacks: "allow_fallbacks", + requireParameters: "require_parameters", + dataCollection: "data_collection", + enforceDistillableText: "enforce_distillable_text", + maxPrice: "max_price", + }); +}); + +export function chatGenerationParamsProviderToJSON( + chatGenerationParamsProvider: ChatGenerationParamsProvider, +): string { + return JSON.stringify( + ChatGenerationParamsProvider$outboundSchema.parse( + chatGenerationParamsProvider, + ), + ); +} + /** @internal */ export const Effort$outboundSchema: z.ZodType = openEnums .outboundSchema(Effort); @@ -247,6 +648,14 @@ export function chatGenerationParamsStopToJSON( /** @internal */ export type ChatGenerationParams$Outbound = { + plugins?: + | Array< + | ChatGenerationParamsPluginModeration$Outbound + | ChatGenerationParamsPluginWeb$Outbound + | ChatGenerationParamsPluginFileParser$Outbound + > + | undefined; + provider?: ChatGenerationParamsProvider$Outbound | null | undefined; messages: Array; model?: string | undefined; models?: Array | undefined; @@ -282,6 +691,16 @@ export const ChatGenerationParams$outboundSchema: z.ZodType< ChatGenerationParams$Outbound, ChatGenerationParams > = z.object({ + plugins: z.array( + z.union([ + z.lazy(() => ChatGenerationParamsPluginModeration$outboundSchema), + z.lazy(() => ChatGenerationParamsPluginWeb$outboundSchema), + z.lazy(() => ChatGenerationParamsPluginFileParser$outboundSchema), + ]), + ).optional(), + provider: z.nullable( + z.lazy(() => ChatGenerationParamsProvider$outboundSchema), + ).optional(), messages: z.array(Message$outboundSchema), model: z.string().optional(), models: z.array(z.string()).optional(), diff --git a/src/models/chatmessagecontentitem.ts b/src/models/chatmessagecontentitem.ts index f762f382..fabd198e 100644 --- a/src/models/chatmessagecontentitem.ts +++ b/src/models/chatmessagecontentitem.ts @@ -35,7 +35,8 @@ export type ChatMessageContentItem = | (ChatMessageContentItemText & { type: "text" }) | (ChatMessageContentItemImage & { type: "image_url" }) | (ChatMessageContentItemAudio & { type: "input_audio" }) - | (ChatMessageContentItemVideo & { type: "input_video" }); + | (ChatMessageContentItemVideo & { type: "input_video" }) + | (ChatMessageContentItemVideo & { type: "video_url" }); /** @internal */ export const ChatMessageContentItem$inboundSchema: z.ZodType< @@ -54,13 +55,17 @@ export const ChatMessageContentItem$inboundSchema: z.ZodType< ChatMessageContentItemVideo$inboundSchema.and( z.object({ type: z.literal("input_video") }), ), + z.lazy(() => ChatMessageContentItemVideo$inboundSchema).and( + z.object({ type: z.literal("video_url") }), + ), ]); /** @internal */ export type ChatMessageContentItem$Outbound = | (ChatMessageContentItemText$Outbound & { type: "text" }) | (ChatMessageContentItemImage$Outbound & { type: "image_url" }) | (ChatMessageContentItemAudio$Outbound & { type: "input_audio" }) - | (ChatMessageContentItemVideo$Outbound & { type: "input_video" }); + | (ChatMessageContentItemVideo$Outbound & { type: "input_video" }) + | (ChatMessageContentItemVideo$Outbound & { type: "video_url" }); /** @internal */ export const ChatMessageContentItem$outboundSchema: z.ZodType< @@ -79,6 +84,9 @@ export const ChatMessageContentItem$outboundSchema: z.ZodType< ChatMessageContentItemVideo$outboundSchema.and( z.object({ type: z.literal("input_video") }), ), + z.lazy(() => ChatMessageContentItemVideo$outboundSchema).and( + z.object({ type: z.literal("video_url") }), + ), ]); export function chatMessageContentItemToJSON( diff --git a/src/models/chatmessagecontentitemvideo.ts b/src/models/chatmessagecontentitemvideo.ts index f1d8316e..d4d3f3f3 100644 --- a/src/models/chatmessagecontentitemvideo.ts +++ b/src/models/chatmessagecontentitemvideo.ts @@ -8,74 +8,212 @@ import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; -export type VideoUrl = { +export type VideoUrl2 = { url: string; }; -export type ChatMessageContentItemVideo = { +export type ChatMessageContentItemVideoVideoURL = { + type: "video_url"; + videoUrl: VideoUrl2; +}; + +export type VideoUrl1 = { + url: string; +}; + +export type ChatMessageContentItemVideoInputVideo = { type: "input_video"; - videoUrl: VideoUrl; + videoUrl: VideoUrl1; }; +export type ChatMessageContentItemVideo = + | ChatMessageContentItemVideoInputVideo + | ChatMessageContentItemVideoVideoURL; + /** @internal */ -export const VideoUrl$inboundSchema: z.ZodType = z.object({ +export const VideoUrl2$inboundSchema: z.ZodType = z.object({ url: z.string(), }); /** @internal */ -export type VideoUrl$Outbound = { +export type VideoUrl2$Outbound = { url: string; }; /** @internal */ -export const VideoUrl$outboundSchema: z.ZodType = z - .object({ - url: z.string(), +export const VideoUrl2$outboundSchema: z.ZodType< + VideoUrl2$Outbound, + VideoUrl2 +> = z.object({ + url: z.string(), +}); + +export function videoUrl2ToJSON(videoUrl2: VideoUrl2): string { + return JSON.stringify(VideoUrl2$outboundSchema.parse(videoUrl2)); +} +export function videoUrl2FromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => VideoUrl2$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'VideoUrl2' from JSON`, + ); +} + +/** @internal */ +export const ChatMessageContentItemVideoVideoURL$inboundSchema: z.ZodType< + ChatMessageContentItemVideoVideoURL, + unknown +> = z.object({ + type: z.literal("video_url"), + video_url: z.lazy(() => VideoUrl2$inboundSchema), +}).transform((v) => { + return remap$(v, { + "video_url": "videoUrl", + }); +}); +/** @internal */ +export type ChatMessageContentItemVideoVideoURL$Outbound = { + type: "video_url"; + video_url: VideoUrl2$Outbound; +}; + +/** @internal */ +export const ChatMessageContentItemVideoVideoURL$outboundSchema: z.ZodType< + ChatMessageContentItemVideoVideoURL$Outbound, + ChatMessageContentItemVideoVideoURL +> = z.object({ + type: z.literal("video_url"), + videoUrl: z.lazy(() => VideoUrl2$outboundSchema), +}).transform((v) => { + return remap$(v, { + videoUrl: "video_url", }); +}); -export function videoUrlToJSON(videoUrl: VideoUrl): string { - return JSON.stringify(VideoUrl$outboundSchema.parse(videoUrl)); +export function chatMessageContentItemVideoVideoURLToJSON( + chatMessageContentItemVideoVideoURL: ChatMessageContentItemVideoVideoURL, +): string { + return JSON.stringify( + ChatMessageContentItemVideoVideoURL$outboundSchema.parse( + chatMessageContentItemVideoVideoURL, + ), + ); } -export function videoUrlFromJSON( +export function chatMessageContentItemVideoVideoURLFromJSON( jsonString: string, -): SafeParseResult { +): SafeParseResult { return safeParse( jsonString, - (x) => VideoUrl$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'VideoUrl' from JSON`, + (x) => + ChatMessageContentItemVideoVideoURL$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ChatMessageContentItemVideoVideoURL' from JSON`, ); } /** @internal */ -export const ChatMessageContentItemVideo$inboundSchema: z.ZodType< - ChatMessageContentItemVideo, +export const VideoUrl1$inboundSchema: z.ZodType = z.object({ + url: z.string(), +}); +/** @internal */ +export type VideoUrl1$Outbound = { + url: string; +}; + +/** @internal */ +export const VideoUrl1$outboundSchema: z.ZodType< + VideoUrl1$Outbound, + VideoUrl1 +> = z.object({ + url: z.string(), +}); + +export function videoUrl1ToJSON(videoUrl1: VideoUrl1): string { + return JSON.stringify(VideoUrl1$outboundSchema.parse(videoUrl1)); +} +export function videoUrl1FromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => VideoUrl1$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'VideoUrl1' from JSON`, + ); +} + +/** @internal */ +export const ChatMessageContentItemVideoInputVideo$inboundSchema: z.ZodType< + ChatMessageContentItemVideoInputVideo, unknown > = z.object({ type: z.literal("input_video"), - video_url: z.lazy(() => VideoUrl$inboundSchema), + video_url: z.lazy(() => VideoUrl1$inboundSchema), }).transform((v) => { return remap$(v, { "video_url": "videoUrl", }); }); /** @internal */ -export type ChatMessageContentItemVideo$Outbound = { +export type ChatMessageContentItemVideoInputVideo$Outbound = { type: "input_video"; - video_url: VideoUrl$Outbound; + video_url: VideoUrl1$Outbound; }; /** @internal */ -export const ChatMessageContentItemVideo$outboundSchema: z.ZodType< - ChatMessageContentItemVideo$Outbound, - ChatMessageContentItemVideo +export const ChatMessageContentItemVideoInputVideo$outboundSchema: z.ZodType< + ChatMessageContentItemVideoInputVideo$Outbound, + ChatMessageContentItemVideoInputVideo > = z.object({ type: z.literal("input_video"), - videoUrl: z.lazy(() => VideoUrl$outboundSchema), + videoUrl: z.lazy(() => VideoUrl1$outboundSchema), }).transform((v) => { return remap$(v, { videoUrl: "video_url", }); }); +export function chatMessageContentItemVideoInputVideoToJSON( + chatMessageContentItemVideoInputVideo: ChatMessageContentItemVideoInputVideo, +): string { + return JSON.stringify( + ChatMessageContentItemVideoInputVideo$outboundSchema.parse( + chatMessageContentItemVideoInputVideo, + ), + ); +} +export function chatMessageContentItemVideoInputVideoFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + ChatMessageContentItemVideoInputVideo$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ChatMessageContentItemVideoInputVideo' from JSON`, + ); +} + +/** @internal */ +export const ChatMessageContentItemVideo$inboundSchema: z.ZodType< + ChatMessageContentItemVideo, + unknown +> = z.union([ + z.lazy(() => ChatMessageContentItemVideoInputVideo$inboundSchema), + z.lazy(() => ChatMessageContentItemVideoVideoURL$inboundSchema), +]); +/** @internal */ +export type ChatMessageContentItemVideo$Outbound = + | ChatMessageContentItemVideoInputVideo$Outbound + | ChatMessageContentItemVideoVideoURL$Outbound; + +/** @internal */ +export const ChatMessageContentItemVideo$outboundSchema: z.ZodType< + ChatMessageContentItemVideo$Outbound, + ChatMessageContentItemVideo +> = z.union([ + z.lazy(() => ChatMessageContentItemVideoInputVideo$outboundSchema), + z.lazy(() => ChatMessageContentItemVideoVideoURL$outboundSchema), +]); + export function chatMessageContentItemVideoToJSON( chatMessageContentItemVideo: ChatMessageContentItemVideo, ): string { diff --git a/src/models/chatresponsechoice.ts b/src/models/chatresponsechoice.ts index d48b6d72..edfd7495 100644 --- a/src/models/chatresponsechoice.ts +++ b/src/models/chatresponsechoice.ts @@ -10,18 +10,15 @@ import { AssistantMessage, AssistantMessage$inboundSchema, } from "./assistantmessage.js"; -import { - ChatCompletionFinishReason, - ChatCompletionFinishReason$inboundSchema, -} from "./chatcompletionfinishreason.js"; import { ChatMessageTokenLogprobs, ChatMessageTokenLogprobs$inboundSchema, } from "./chatmessagetokenlogprobs.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { Schema0, Schema0$inboundSchema } from "./schema0.js"; export type ChatResponseChoice = { - finishReason: ChatCompletionFinishReason | null; + finishReason: Array; index: number; message: AssistantMessage; logprobs?: ChatMessageTokenLogprobs | null | undefined; @@ -32,7 +29,7 @@ export const ChatResponseChoice$inboundSchema: z.ZodType< ChatResponseChoice, unknown > = z.object({ - finish_reason: z.nullable(ChatCompletionFinishReason$inboundSchema), + finish_reason: z.array(Schema0$inboundSchema), index: z.number(), message: AssistantMessage$inboundSchema, logprobs: z.nullable(ChatMessageTokenLogprobs$inboundSchema).optional(), diff --git a/src/models/chatstreamingchoice.ts b/src/models/chatstreamingchoice.ts index c1a817ce..62ef0d86 100644 --- a/src/models/chatstreamingchoice.ts +++ b/src/models/chatstreamingchoice.ts @@ -6,10 +6,6 @@ import * as z from "zod/v4"; import { remap as remap$ } from "../lib/primitives.js"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; -import { - ChatCompletionFinishReason, - ChatCompletionFinishReason$inboundSchema, -} from "./chatcompletionfinishreason.js"; import { ChatMessageTokenLogprobs, ChatMessageTokenLogprobs$inboundSchema, @@ -19,10 +15,11 @@ import { ChatStreamingMessageChunk$inboundSchema, } from "./chatstreamingmessagechunk.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { Schema0, Schema0$inboundSchema } from "./schema0.js"; export type ChatStreamingChoice = { delta: ChatStreamingMessageChunk; - finishReason: ChatCompletionFinishReason | null; + finishReason: Array; index: number; logprobs?: ChatMessageTokenLogprobs | null | undefined; }; @@ -33,7 +30,7 @@ export const ChatStreamingChoice$inboundSchema: z.ZodType< unknown > = z.object({ delta: ChatStreamingMessageChunk$inboundSchema, - finish_reason: z.nullable(ChatCompletionFinishReason$inboundSchema), + finish_reason: z.array(Schema0$inboundSchema), index: z.number(), logprobs: z.nullable(ChatMessageTokenLogprobs$inboundSchema).optional(), }).transform((v) => { diff --git a/src/models/completioncreateparams.ts b/src/models/completioncreateparams.ts index 3227fb77..1c7a8a49 100644 --- a/src/models/completioncreateparams.ts +++ b/src/models/completioncreateparams.ts @@ -4,6 +4,8 @@ import * as z from "zod/v4"; import { remap as remap$ } from "../lib/primitives.js"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; import { ResponseFormatJSONSchema, ResponseFormatJSONSchema$Outbound, @@ -14,6 +16,147 @@ import { ResponseFormatTextGrammar$Outbound, ResponseFormatTextGrammar$outboundSchema, } from "./responseformattextgrammar.js"; +import { + Schema0, + Schema0$Outbound, + Schema0$outboundSchema, +} from "./schema0.js"; + +export const CompletionCreateParamsPdfEngine = { + MistralOcr: "mistral-ocr", + PdfText: "pdf-text", + Native: "native", +} as const; +export type CompletionCreateParamsPdfEngine = OpenEnum< + typeof CompletionCreateParamsPdfEngine +>; + +export type CompletionCreateParamsPdf = { + engine?: CompletionCreateParamsPdfEngine | undefined; +}; + +export type CompletionCreateParamsPluginFileParser = { + id: "file-parser"; + maxFiles?: number | undefined; + pdf?: CompletionCreateParamsPdf | undefined; +}; + +export const CompletionCreateParamsEngine = { + Native: "native", + Exa: "exa", +} as const; +export type CompletionCreateParamsEngine = OpenEnum< + typeof CompletionCreateParamsEngine +>; + +export type CompletionCreateParamsPluginWeb = { + id: "web"; + maxResults?: number | undefined; + searchPrompt?: string | undefined; + engine?: CompletionCreateParamsEngine | undefined; +}; + +export type CompletionCreateParamsPluginModeration = { + id: "moderation"; +}; + +export type CompletionCreateParamsPluginUnion = + | CompletionCreateParamsPluginModeration + | CompletionCreateParamsPluginWeb + | CompletionCreateParamsPluginFileParser; + +export const CompletionCreateParamsDataCollection = { + Deny: "deny", + Allow: "allow", +} as const; +export type CompletionCreateParamsDataCollection = OpenEnum< + typeof CompletionCreateParamsDataCollection +>; + +export const CompletionCreateParamsQuantizations = { + Int4: "int4", + Int8: "int8", + Fp4: "fp4", + Fp6: "fp6", + Fp8: "fp8", + Fp16: "fp16", + Bf16: "bf16", + Fp32: "fp32", + Unknown: "unknown", +} as const; +export type CompletionCreateParamsQuantizations = OpenEnum< + typeof CompletionCreateParamsQuantizations +>; + +export const CompletionCreateParamsSort = { + Price: "price", + Throughput: "throughput", + Latency: "latency", +} as const; +export type CompletionCreateParamsSort = OpenEnum< + typeof CompletionCreateParamsSort +>; + +/** + * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + */ +export type CompletionCreateParamsMaxPrice = { + prompt?: any | undefined; + completion?: any | undefined; + image?: any | undefined; + audio?: any | undefined; + request?: any | undefined; +}; + +export type CompletionCreateParamsProvider = { + /** + * Whether to allow backup providers to serve requests + * + * @remarks + * - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. + * - false: use only the primary/custom provider, and return the upstream error if it's unavailable. + */ + allowFallbacks?: boolean | null | undefined; + /** + * 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. + */ + requireParameters?: boolean | null | undefined; + /** + * Data collection setting. If no available model provider meets the requirement, your request will return an error. + * + * @remarks + * - allow: (default) allow providers which store user data non-transiently and may train on it + * + * - deny: use only providers which do not collect user data. + */ + dataCollection?: CompletionCreateParamsDataCollection | null | undefined; + zdr?: boolean | null | undefined; + enforceDistillableText?: boolean | null | undefined; + /** + * 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. + */ + order?: Array | null | undefined; + /** + * List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. + */ + only?: Array | null | undefined; + /** + * List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. + */ + ignore?: Array | null | undefined; + /** + * A list of quantization levels to filter the provider by. + */ + quantizations?: Array | null | undefined; + /** + * The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. + */ + sort?: CompletionCreateParamsSort | null | undefined; + /** + * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + */ + maxPrice?: CompletionCreateParamsMaxPrice | undefined; +}; export type Prompt = | string @@ -49,6 +192,14 @@ export type CompletionCreateParamsResponseFormatUnion = export type CompletionCreateParams = { model?: string | undefined; models?: Array | undefined; + plugins?: + | Array< + | CompletionCreateParamsPluginModeration + | CompletionCreateParamsPluginWeb + | CompletionCreateParamsPluginFileParser + > + | undefined; + provider?: CompletionCreateParamsProvider | null | undefined; prompt: string | Array | Array | Array>; bestOf?: number | null | undefined; echo?: boolean | null | undefined; @@ -77,6 +228,260 @@ export type CompletionCreateParams = { | undefined; }; +/** @internal */ +export const CompletionCreateParamsPdfEngine$outboundSchema: z.ZodType< + string, + CompletionCreateParamsPdfEngine +> = openEnums.outboundSchema(CompletionCreateParamsPdfEngine); + +/** @internal */ +export type CompletionCreateParamsPdf$Outbound = { + engine?: string | undefined; +}; + +/** @internal */ +export const CompletionCreateParamsPdf$outboundSchema: z.ZodType< + CompletionCreateParamsPdf$Outbound, + CompletionCreateParamsPdf +> = z.object({ + engine: CompletionCreateParamsPdfEngine$outboundSchema.optional(), +}); + +export function completionCreateParamsPdfToJSON( + completionCreateParamsPdf: CompletionCreateParamsPdf, +): string { + return JSON.stringify( + CompletionCreateParamsPdf$outboundSchema.parse(completionCreateParamsPdf), + ); +} + +/** @internal */ +export type CompletionCreateParamsPluginFileParser$Outbound = { + id: "file-parser"; + max_files?: number | undefined; + pdf?: CompletionCreateParamsPdf$Outbound | undefined; +}; + +/** @internal */ +export const CompletionCreateParamsPluginFileParser$outboundSchema: z.ZodType< + CompletionCreateParamsPluginFileParser$Outbound, + CompletionCreateParamsPluginFileParser +> = z.object({ + id: z.literal("file-parser"), + maxFiles: z.number().optional(), + pdf: z.lazy(() => CompletionCreateParamsPdf$outboundSchema).optional(), +}).transform((v) => { + return remap$(v, { + maxFiles: "max_files", + }); +}); + +export function completionCreateParamsPluginFileParserToJSON( + completionCreateParamsPluginFileParser: + CompletionCreateParamsPluginFileParser, +): string { + return JSON.stringify( + CompletionCreateParamsPluginFileParser$outboundSchema.parse( + completionCreateParamsPluginFileParser, + ), + ); +} + +/** @internal */ +export const CompletionCreateParamsEngine$outboundSchema: z.ZodType< + string, + CompletionCreateParamsEngine +> = openEnums.outboundSchema(CompletionCreateParamsEngine); + +/** @internal */ +export type CompletionCreateParamsPluginWeb$Outbound = { + id: "web"; + max_results?: number | undefined; + search_prompt?: string | undefined; + engine?: string | undefined; +}; + +/** @internal */ +export const CompletionCreateParamsPluginWeb$outboundSchema: z.ZodType< + CompletionCreateParamsPluginWeb$Outbound, + CompletionCreateParamsPluginWeb +> = z.object({ + id: z.literal("web"), + maxResults: z.number().optional(), + searchPrompt: z.string().optional(), + engine: CompletionCreateParamsEngine$outboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + maxResults: "max_results", + searchPrompt: "search_prompt", + }); +}); + +export function completionCreateParamsPluginWebToJSON( + completionCreateParamsPluginWeb: CompletionCreateParamsPluginWeb, +): string { + return JSON.stringify( + CompletionCreateParamsPluginWeb$outboundSchema.parse( + completionCreateParamsPluginWeb, + ), + ); +} + +/** @internal */ +export type CompletionCreateParamsPluginModeration$Outbound = { + id: "moderation"; +}; + +/** @internal */ +export const CompletionCreateParamsPluginModeration$outboundSchema: z.ZodType< + CompletionCreateParamsPluginModeration$Outbound, + CompletionCreateParamsPluginModeration +> = z.object({ + id: z.literal("moderation"), +}); + +export function completionCreateParamsPluginModerationToJSON( + completionCreateParamsPluginModeration: + CompletionCreateParamsPluginModeration, +): string { + return JSON.stringify( + CompletionCreateParamsPluginModeration$outboundSchema.parse( + completionCreateParamsPluginModeration, + ), + ); +} + +/** @internal */ +export type CompletionCreateParamsPluginUnion$Outbound = + | CompletionCreateParamsPluginModeration$Outbound + | CompletionCreateParamsPluginWeb$Outbound + | CompletionCreateParamsPluginFileParser$Outbound; + +/** @internal */ +export const CompletionCreateParamsPluginUnion$outboundSchema: z.ZodType< + CompletionCreateParamsPluginUnion$Outbound, + CompletionCreateParamsPluginUnion +> = z.union([ + z.lazy(() => CompletionCreateParamsPluginModeration$outboundSchema), + z.lazy(() => CompletionCreateParamsPluginWeb$outboundSchema), + z.lazy(() => CompletionCreateParamsPluginFileParser$outboundSchema), +]); + +export function completionCreateParamsPluginUnionToJSON( + completionCreateParamsPluginUnion: CompletionCreateParamsPluginUnion, +): string { + return JSON.stringify( + CompletionCreateParamsPluginUnion$outboundSchema.parse( + completionCreateParamsPluginUnion, + ), + ); +} + +/** @internal */ +export const CompletionCreateParamsDataCollection$outboundSchema: z.ZodType< + string, + CompletionCreateParamsDataCollection +> = openEnums.outboundSchema(CompletionCreateParamsDataCollection); + +/** @internal */ +export const CompletionCreateParamsQuantizations$outboundSchema: z.ZodType< + string, + CompletionCreateParamsQuantizations +> = openEnums.outboundSchema(CompletionCreateParamsQuantizations); + +/** @internal */ +export const CompletionCreateParamsSort$outboundSchema: z.ZodType< + string, + CompletionCreateParamsSort +> = openEnums.outboundSchema(CompletionCreateParamsSort); + +/** @internal */ +export type CompletionCreateParamsMaxPrice$Outbound = { + prompt?: any | undefined; + completion?: any | undefined; + image?: any | undefined; + audio?: any | undefined; + request?: any | undefined; +}; + +/** @internal */ +export const CompletionCreateParamsMaxPrice$outboundSchema: z.ZodType< + CompletionCreateParamsMaxPrice$Outbound, + CompletionCreateParamsMaxPrice +> = z.object({ + prompt: z.any().optional(), + completion: z.any().optional(), + image: z.any().optional(), + audio: z.any().optional(), + request: z.any().optional(), +}); + +export function completionCreateParamsMaxPriceToJSON( + completionCreateParamsMaxPrice: CompletionCreateParamsMaxPrice, +): string { + return JSON.stringify( + CompletionCreateParamsMaxPrice$outboundSchema.parse( + completionCreateParamsMaxPrice, + ), + ); +} + +/** @internal */ +export type CompletionCreateParamsProvider$Outbound = { + allow_fallbacks?: boolean | null | undefined; + require_parameters?: boolean | null | undefined; + data_collection?: string | null | undefined; + zdr?: boolean | null | undefined; + enforce_distillable_text?: boolean | null | undefined; + order?: Array | null | undefined; + only?: Array | null | undefined; + ignore?: Array | null | undefined; + quantizations?: Array | null | undefined; + sort?: string | null | undefined; + max_price?: CompletionCreateParamsMaxPrice$Outbound | undefined; +}; + +/** @internal */ +export const CompletionCreateParamsProvider$outboundSchema: z.ZodType< + CompletionCreateParamsProvider$Outbound, + CompletionCreateParamsProvider +> = z.object({ + allowFallbacks: z.nullable(z.boolean()).optional(), + requireParameters: z.nullable(z.boolean()).optional(), + dataCollection: z.nullable( + CompletionCreateParamsDataCollection$outboundSchema, + ).optional(), + zdr: z.nullable(z.boolean()).optional(), + enforceDistillableText: z.nullable(z.boolean()).optional(), + order: z.nullable(z.array(Schema0$outboundSchema)).optional(), + only: z.nullable(z.array(Schema0$outboundSchema)).optional(), + ignore: z.nullable(z.array(Schema0$outboundSchema)).optional(), + quantizations: z.nullable( + z.array(CompletionCreateParamsQuantizations$outboundSchema), + ).optional(), + sort: z.nullable(CompletionCreateParamsSort$outboundSchema).optional(), + maxPrice: z.lazy(() => CompletionCreateParamsMaxPrice$outboundSchema) + .optional(), +}).transform((v) => { + return remap$(v, { + allowFallbacks: "allow_fallbacks", + requireParameters: "require_parameters", + dataCollection: "data_collection", + enforceDistillableText: "enforce_distillable_text", + maxPrice: "max_price", + }); +}); + +export function completionCreateParamsProviderToJSON( + completionCreateParamsProvider: CompletionCreateParamsProvider, +): string { + return JSON.stringify( + CompletionCreateParamsProvider$outboundSchema.parse( + completionCreateParamsProvider, + ), + ); +} + /** @internal */ export type Prompt$Outbound = | string @@ -245,6 +650,14 @@ export function completionCreateParamsResponseFormatUnionToJSON( export type CompletionCreateParams$Outbound = { model?: string | undefined; models?: Array | undefined; + plugins?: + | Array< + | CompletionCreateParamsPluginModeration$Outbound + | CompletionCreateParamsPluginWeb$Outbound + | CompletionCreateParamsPluginFileParser$Outbound + > + | undefined; + provider?: CompletionCreateParamsProvider$Outbound | null | undefined; prompt: string | Array | Array | Array>; best_of?: number | null | undefined; echo?: boolean | null | undefined; @@ -280,6 +693,16 @@ export const CompletionCreateParams$outboundSchema: z.ZodType< > = z.object({ model: z.string().optional(), models: z.array(z.string()).optional(), + plugins: z.array( + z.union([ + z.lazy(() => CompletionCreateParamsPluginModeration$outboundSchema), + z.lazy(() => CompletionCreateParamsPluginWeb$outboundSchema), + z.lazy(() => CompletionCreateParamsPluginFileParser$outboundSchema), + ]), + ).optional(), + provider: z.nullable( + z.lazy(() => CompletionCreateParamsProvider$outboundSchema), + ).optional(), prompt: z.union([ z.string(), z.array(z.string()), diff --git a/src/models/datacollection.ts b/src/models/datacollection.ts new file mode 100644 index 00000000..d2dfe960 --- /dev/null +++ b/src/models/datacollection.ts @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; + +/** + * Data collection setting. If no available model provider meets the requirement, your request will return an error. + * + * @remarks + * - allow: (default) allow providers which store user data non-transiently and may train on it + * + * - deny: use only providers which do not collect user data. + */ +export const DataCollection = { + Deny: "deny", + Allow: "allow", +} as const; +/** + * Data collection setting. If no available model provider meets the requirement, your request will return an error. + * + * @remarks + * - allow: (default) allow providers which store user data non-transiently and may train on it + * + * - deny: use only providers which do not collect user data. + */ +export type DataCollection = OpenEnum; + +/** @internal */ +export const DataCollection$outboundSchema: z.ZodType = + openEnums.outboundSchema(DataCollection); diff --git a/src/models/index.ts b/src/models/index.ts index 0eb2e7af..33adad0d 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -6,7 +6,6 @@ export * from "./activityitem.js"; export * from "./assistantmessage.js"; export * from "./badgatewayresponseerrordata.js"; export * from "./badrequestresponseerrordata.js"; -export * from "./chatcompletionfinishreason.js"; export * from "./chaterror.js"; export * from "./chatgenerationparams.js"; export * from "./chatgenerationtokenusage.js"; @@ -31,6 +30,7 @@ export * from "./completionlogprobs.js"; export * from "./completionresponse.js"; export * from "./completionusage.js"; export * from "./createchargerequest.js"; +export * from "./datacollection.js"; export * from "./defaultparameters.js"; export * from "./edgenetworktimeoutresponseerrordata.js"; export * from "./endpointstatus.js"; @@ -100,6 +100,7 @@ export * from "./paymentrequiredresponseerrordata.js"; export * from "./perrequestlimits.js"; export * from "./providername.js"; export * from "./provideroverloadedresponseerrordata.js"; +export * from "./providersort.js"; export * from "./publicendpoint.js"; export * from "./publicpricing.js"; export * from "./quantization.js"; @@ -129,6 +130,7 @@ export * from "./responsessearchcontextsize.js"; export * from "./responseswebsearchcalloutput.js"; export * from "./responseswebsearchuserlocation.js"; export * from "./responsetextconfig.js"; +export * from "./schema0.js"; export * from "./security.js"; export * from "./serviceunavailableresponseerrordata.js"; export * from "./systemmessage.js"; diff --git a/src/models/openairesponsesreasoningeffort.ts b/src/models/openairesponsesreasoningeffort.ts index 7d496e1d..b191cefb 100644 --- a/src/models/openairesponsesreasoningeffort.ts +++ b/src/models/openairesponsesreasoningeffort.ts @@ -11,6 +11,7 @@ export const OpenAIResponsesReasoningEffort = { Medium: "medium", Low: "low", Minimal: "minimal", + None: "none", } as const; export type OpenAIResponsesReasoningEffort = OpenEnum< typeof OpenAIResponsesReasoningEffort diff --git a/src/models/openresponsesreasoning.ts b/src/models/openresponsesreasoning.ts index 1d038dd8..22ec11c4 100644 --- a/src/models/openresponsesreasoning.ts +++ b/src/models/openresponsesreasoning.ts @@ -55,6 +55,7 @@ export const OpenResponsesReasoningFormat = { OpenaiResponsesV1: "openai-responses-v1", XaiResponsesV1: "xai-responses-v1", AnthropicClaudeV1: "anthropic-claude-v1", + GoogleGeminiV1: "google-gemini-v1", } as const; export type OpenResponsesReasoningFormat = OpenEnum< typeof OpenResponsesReasoningFormat diff --git a/src/models/openresponsesrequest.ts b/src/models/openresponsesrequest.ts index 9cea8d0c..bba724bd 100644 --- a/src/models/openresponsesrequest.ts +++ b/src/models/openresponsesrequest.ts @@ -6,6 +6,10 @@ import * as z from "zod/v4"; import { remap as remap$ } from "../lib/primitives.js"; import * as openEnums from "../types/enums.js"; import { ClosedEnum, OpenEnum } from "../types/enums.js"; +import { + DataCollection, + DataCollection$outboundSchema, +} from "./datacollection.js"; import { OpenAIResponsesIncludable, OpenAIResponsesIncludable$outboundSchema, @@ -55,7 +59,7 @@ import { OpenResponsesWebSearchTool$Outbound, OpenResponsesWebSearchTool$outboundSchema, } from "./openresponseswebsearchtool.js"; -import { ProviderName, ProviderName$outboundSchema } from "./providername.js"; +import { ProviderSort, ProviderSort$outboundSchema } from "./providersort.js"; import { Quantization, Quantization$outboundSchema } from "./quantization.js"; export const OpenResponsesRequestType = { @@ -98,75 +102,21 @@ export const Truncation = { } as const; export type Truncation = OpenEnum; -/** - * Data collection setting. If no available model provider meets the requirement, your request will return an error. - * - * @remarks - * - allow: (default) allow providers which store user data non-transiently and may train on it - * - deny: use only providers which do not collect user data. - */ -export const DataCollection = { - Deny: "deny", - Allow: "allow", -} as const; -/** - * Data collection setting. If no available model provider meets the requirement, your request will return an error. - * - * @remarks - * - allow: (default) allow providers which store user data non-transiently and may train on it - * - deny: use only providers which do not collect user data. - */ -export type DataCollection = OpenEnum; - -export type Order = ProviderName | string; - -export type Only = ProviderName | string; - -export type Ignore = ProviderName | string; - -/** - * The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. - */ -export const Sort = { - Price: "price", - Throughput: "throughput", - Latency: "latency", -} as const; -/** - * The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. - */ -export type Sort = OpenEnum; - /** * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. */ -export type MaxPrice = { - /** - * A value in string or number format that is a large number - */ +export type OpenResponsesRequestMaxPrice = { prompt?: any | undefined; - /** - * A value in string or number format that is a large number - */ completion?: any | undefined; - /** - * A value in string or number format that is a large number - */ image?: any | undefined; - /** - * A value in string or number format that is a large number - */ audio?: any | undefined; - /** - * A value in string or number format that is a large number - */ request?: any | undefined; }; /** * When multiple model providers are available, optionally indicate your routing preference. */ -export type Provider = { +export type OpenResponsesRequestProvider = { /** * Whether to allow backup providers to serve requests * @@ -184,6 +134,7 @@ export type Provider = { * * @remarks * - allow: (default) allow providers which store user data non-transiently and may train on it + * * - deny: use only providers which do not collect user data. */ dataCollection?: DataCollection | null | undefined; @@ -198,15 +149,15 @@ export type Provider = { /** * 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. */ - order?: Array | null | undefined; + order?: Array | undefined; /** * List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. */ - only?: Array | null | undefined; + only?: Array | undefined; /** * List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. */ - ignore?: Array | null | undefined; + ignore?: Array | undefined; /** * A list of quantization levels to filter the provider by. */ @@ -214,11 +165,11 @@ export type Provider = { /** * The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. */ - sort?: Sort | null | undefined; + sort?: ProviderSort | null | undefined; /** * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. */ - maxPrice?: MaxPrice | undefined; + maxPrice?: OpenResponsesRequestMaxPrice | undefined; }; export const IdFileParser = { @@ -226,21 +177,23 @@ export const IdFileParser = { } as const; export type IdFileParser = ClosedEnum; -export const PdfEngine = { +export const OpenResponsesRequestPdfEngine = { MistralOcr: "mistral-ocr", PdfText: "pdf-text", Native: "native", } as const; -export type PdfEngine = OpenEnum; +export type OpenResponsesRequestPdfEngine = OpenEnum< + typeof OpenResponsesRequestPdfEngine +>; -export type Pdf = { - engine?: PdfEngine | undefined; +export type OpenResponsesRequestPdf = { + engine?: OpenResponsesRequestPdfEngine | undefined; }; -export type PluginFileParser = { +export type OpenResponsesRequestPluginFileParser = { id: IdFileParser; maxFiles?: number | undefined; - pdf?: Pdf | undefined; + pdf?: OpenResponsesRequestPdf | undefined; }; export const IdWeb = { @@ -248,17 +201,19 @@ export const IdWeb = { } as const; export type IdWeb = ClosedEnum; -export const Engine = { +export const OpenResponsesRequestEngine = { Native: "native", Exa: "exa", } as const; -export type Engine = OpenEnum; +export type OpenResponsesRequestEngine = OpenEnum< + typeof OpenResponsesRequestEngine +>; -export type PluginWeb = { +export type OpenResponsesRequestPluginWeb = { id: IdWeb; maxResults?: number | undefined; searchPrompt?: string | undefined; - engine?: Engine | undefined; + engine?: OpenResponsesRequestEngine | undefined; }; export const IdModeration = { @@ -266,11 +221,14 @@ export const IdModeration = { } as const; export type IdModeration = ClosedEnum; -export type PluginModeration = { +export type OpenResponsesRequestPluginModeration = { id: IdModeration; }; -export type Plugin = PluginModeration | PluginWeb | PluginFileParser; +export type OpenResponsesRequestPluginUnion = + | OpenResponsesRequestPluginModeration + | OpenResponsesRequestPluginWeb + | OpenResponsesRequestPluginFileParser; /** * Request schema for Responses endpoint @@ -323,11 +281,17 @@ export type OpenResponsesRequest = { /** * When multiple model providers are available, optionally indicate your routing preference. */ - provider?: Provider | null | undefined; + provider?: OpenResponsesRequestProvider | null | undefined; /** * Plugins you want to enable for this request, including their settings. */ - plugins?: Array | undefined; + plugins?: + | Array< + | OpenResponsesRequestPluginModeration + | OpenResponsesRequestPluginWeb + | OpenResponsesRequestPluginFileParser + > + | undefined; /** * A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. */ @@ -409,52 +373,7 @@ export const Truncation$outboundSchema: z.ZodType = openEnums.outboundSchema(Truncation); /** @internal */ -export const DataCollection$outboundSchema: z.ZodType = - openEnums.outboundSchema(DataCollection); - -/** @internal */ -export type Order$Outbound = string | string; - -/** @internal */ -export const Order$outboundSchema: z.ZodType = z.union([ - ProviderName$outboundSchema, - z.string(), -]); - -export function orderToJSON(order: Order): string { - return JSON.stringify(Order$outboundSchema.parse(order)); -} - -/** @internal */ -export type Only$Outbound = string | string; - -/** @internal */ -export const Only$outboundSchema: z.ZodType = z.union([ - ProviderName$outboundSchema, - z.string(), -]); - -export function onlyToJSON(only: Only): string { - return JSON.stringify(Only$outboundSchema.parse(only)); -} - -/** @internal */ -export type Ignore$Outbound = string | string; - -/** @internal */ -export const Ignore$outboundSchema: z.ZodType = z - .union([ProviderName$outboundSchema, z.string()]); - -export function ignoreToJSON(ignore: Ignore): string { - return JSON.stringify(Ignore$outboundSchema.parse(ignore)); -} - -/** @internal */ -export const Sort$outboundSchema: z.ZodType = openEnums - .outboundSchema(Sort); - -/** @internal */ -export type MaxPrice$Outbound = { +export type OpenResponsesRequestMaxPrice$Outbound = { prompt?: any | undefined; completion?: any | undefined; image?: any | undefined; @@ -463,66 +382,77 @@ export type MaxPrice$Outbound = { }; /** @internal */ -export const MaxPrice$outboundSchema: z.ZodType = z - .object({ - prompt: z.any().optional(), - completion: z.any().optional(), - image: z.any().optional(), - audio: z.any().optional(), - request: z.any().optional(), - }); +export const OpenResponsesRequestMaxPrice$outboundSchema: z.ZodType< + OpenResponsesRequestMaxPrice$Outbound, + OpenResponsesRequestMaxPrice +> = z.object({ + prompt: z.any().optional(), + completion: z.any().optional(), + image: z.any().optional(), + audio: z.any().optional(), + request: z.any().optional(), +}); -export function maxPriceToJSON(maxPrice: MaxPrice): string { - return JSON.stringify(MaxPrice$outboundSchema.parse(maxPrice)); +export function openResponsesRequestMaxPriceToJSON( + openResponsesRequestMaxPrice: OpenResponsesRequestMaxPrice, +): string { + return JSON.stringify( + OpenResponsesRequestMaxPrice$outboundSchema.parse( + openResponsesRequestMaxPrice, + ), + ); } /** @internal */ -export type Provider$Outbound = { +export type OpenResponsesRequestProvider$Outbound = { allow_fallbacks?: boolean | null | undefined; require_parameters?: boolean | null | undefined; data_collection?: string | null | undefined; zdr?: boolean | null | undefined; enforce_distillable_text?: boolean | null | undefined; - order?: Array | null | undefined; - only?: Array | null | undefined; - ignore?: Array | null | undefined; + order?: Array | undefined; + only?: Array | undefined; + ignore?: Array | undefined; quantizations?: Array | null | undefined; sort?: string | null | undefined; - max_price?: MaxPrice$Outbound | undefined; + max_price?: OpenResponsesRequestMaxPrice$Outbound | undefined; }; /** @internal */ -export const Provider$outboundSchema: z.ZodType = z - .object({ - allowFallbacks: z.nullable(z.boolean()).optional(), - requireParameters: z.nullable(z.boolean()).optional(), - dataCollection: z.nullable(DataCollection$outboundSchema).optional(), - zdr: z.nullable(z.boolean()).optional(), - enforceDistillableText: z.nullable(z.boolean()).optional(), - order: z.nullable( - z.array(z.union([ProviderName$outboundSchema, z.string()])), - ).optional(), - only: z.nullable( - z.array(z.union([ProviderName$outboundSchema, z.string()])), - ).optional(), - ignore: z.nullable( - z.array(z.union([ProviderName$outboundSchema, z.string()])), - ).optional(), - quantizations: z.nullable(z.array(Quantization$outboundSchema)).optional(), - sort: z.nullable(Sort$outboundSchema).optional(), - maxPrice: z.lazy(() => MaxPrice$outboundSchema).optional(), - }).transform((v) => { - return remap$(v, { - allowFallbacks: "allow_fallbacks", - requireParameters: "require_parameters", - dataCollection: "data_collection", - enforceDistillableText: "enforce_distillable_text", - maxPrice: "max_price", - }); +export const OpenResponsesRequestProvider$outboundSchema: z.ZodType< + OpenResponsesRequestProvider$Outbound, + OpenResponsesRequestProvider +> = z.object({ + allowFallbacks: z.nullable(z.boolean()).optional(), + requireParameters: z.nullable(z.boolean()).optional(), + dataCollection: z.nullable(DataCollection$outboundSchema).optional(), + zdr: z.nullable(z.boolean()).optional(), + enforceDistillableText: z.nullable(z.boolean()).optional(), + order: z.array(z.string()).optional(), + only: z.array(z.string()).optional(), + ignore: z.array(z.string()).optional(), + quantizations: z.nullable(z.array(Quantization$outboundSchema)).optional(), + sort: z.nullable(ProviderSort$outboundSchema).optional(), + maxPrice: z.lazy(() => OpenResponsesRequestMaxPrice$outboundSchema) + .optional(), +}).transform((v) => { + return remap$(v, { + allowFallbacks: "allow_fallbacks", + requireParameters: "require_parameters", + dataCollection: "data_collection", + enforceDistillableText: "enforce_distillable_text", + maxPrice: "max_price", }); +}); -export function providerToJSON(provider: Provider): string { - return JSON.stringify(Provider$outboundSchema.parse(provider)); +export function openResponsesRequestProviderToJSON( + openResponsesRequestProvider: OpenResponsesRequestProvider, +): string { + return JSON.stringify( + OpenResponsesRequestProvider$outboundSchema.parse( + openResponsesRequestProvider, + ), + ); } /** @internal */ @@ -530,49 +460,60 @@ export const IdFileParser$outboundSchema: z.ZodEnum = z .enum(IdFileParser); /** @internal */ -export const PdfEngine$outboundSchema: z.ZodType = openEnums - .outboundSchema(PdfEngine); +export const OpenResponsesRequestPdfEngine$outboundSchema: z.ZodType< + string, + OpenResponsesRequestPdfEngine +> = openEnums.outboundSchema(OpenResponsesRequestPdfEngine); /** @internal */ -export type Pdf$Outbound = { +export type OpenResponsesRequestPdf$Outbound = { engine?: string | undefined; }; /** @internal */ -export const Pdf$outboundSchema: z.ZodType = z.object({ - engine: PdfEngine$outboundSchema.optional(), +export const OpenResponsesRequestPdf$outboundSchema: z.ZodType< + OpenResponsesRequestPdf$Outbound, + OpenResponsesRequestPdf +> = z.object({ + engine: OpenResponsesRequestPdfEngine$outboundSchema.optional(), }); -export function pdfToJSON(pdf: Pdf): string { - return JSON.stringify(Pdf$outboundSchema.parse(pdf)); +export function openResponsesRequestPdfToJSON( + openResponsesRequestPdf: OpenResponsesRequestPdf, +): string { + return JSON.stringify( + OpenResponsesRequestPdf$outboundSchema.parse(openResponsesRequestPdf), + ); } /** @internal */ -export type PluginFileParser$Outbound = { +export type OpenResponsesRequestPluginFileParser$Outbound = { id: string; max_files?: number | undefined; - pdf?: Pdf$Outbound | undefined; + pdf?: OpenResponsesRequestPdf$Outbound | undefined; }; /** @internal */ -export const PluginFileParser$outboundSchema: z.ZodType< - PluginFileParser$Outbound, - PluginFileParser +export const OpenResponsesRequestPluginFileParser$outboundSchema: z.ZodType< + OpenResponsesRequestPluginFileParser$Outbound, + OpenResponsesRequestPluginFileParser > = z.object({ id: IdFileParser$outboundSchema, maxFiles: z.number().optional(), - pdf: z.lazy(() => Pdf$outboundSchema).optional(), + pdf: z.lazy(() => OpenResponsesRequestPdf$outboundSchema).optional(), }).transform((v) => { return remap$(v, { maxFiles: "max_files", }); }); -export function pluginFileParserToJSON( - pluginFileParser: PluginFileParser, +export function openResponsesRequestPluginFileParserToJSON( + openResponsesRequestPluginFileParser: OpenResponsesRequestPluginFileParser, ): string { return JSON.stringify( - PluginFileParser$outboundSchema.parse(pluginFileParser), + OpenResponsesRequestPluginFileParser$outboundSchema.parse( + openResponsesRequestPluginFileParser, + ), ); } @@ -580,11 +521,13 @@ export function pluginFileParserToJSON( export const IdWeb$outboundSchema: z.ZodEnum = z.enum(IdWeb); /** @internal */ -export const Engine$outboundSchema: z.ZodType = openEnums - .outboundSchema(Engine); +export const OpenResponsesRequestEngine$outboundSchema: z.ZodType< + string, + OpenResponsesRequestEngine +> = openEnums.outboundSchema(OpenResponsesRequestEngine); /** @internal */ -export type PluginWeb$Outbound = { +export type OpenResponsesRequestPluginWeb$Outbound = { id: string; max_results?: number | undefined; search_prompt?: string | undefined; @@ -592,14 +535,14 @@ export type PluginWeb$Outbound = { }; /** @internal */ -export const PluginWeb$outboundSchema: z.ZodType< - PluginWeb$Outbound, - PluginWeb +export const OpenResponsesRequestPluginWeb$outboundSchema: z.ZodType< + OpenResponsesRequestPluginWeb$Outbound, + OpenResponsesRequestPluginWeb > = z.object({ id: IdWeb$outboundSchema, maxResults: z.number().optional(), searchPrompt: z.string().optional(), - engine: Engine$outboundSchema.optional(), + engine: OpenResponsesRequestEngine$outboundSchema.optional(), }).transform((v) => { return remap$(v, { maxResults: "max_results", @@ -607,8 +550,14 @@ export const PluginWeb$outboundSchema: z.ZodType< }); }); -export function pluginWebToJSON(pluginWeb: PluginWeb): string { - return JSON.stringify(PluginWeb$outboundSchema.parse(pluginWeb)); +export function openResponsesRequestPluginWebToJSON( + openResponsesRequestPluginWeb: OpenResponsesRequestPluginWeb, +): string { + return JSON.stringify( + OpenResponsesRequestPluginWeb$outboundSchema.parse( + openResponsesRequestPluginWeb, + ), + ); } /** @internal */ @@ -616,42 +565,52 @@ export const IdModeration$outboundSchema: z.ZodEnum = z .enum(IdModeration); /** @internal */ -export type PluginModeration$Outbound = { +export type OpenResponsesRequestPluginModeration$Outbound = { id: string; }; /** @internal */ -export const PluginModeration$outboundSchema: z.ZodType< - PluginModeration$Outbound, - PluginModeration +export const OpenResponsesRequestPluginModeration$outboundSchema: z.ZodType< + OpenResponsesRequestPluginModeration$Outbound, + OpenResponsesRequestPluginModeration > = z.object({ id: IdModeration$outboundSchema, }); -export function pluginModerationToJSON( - pluginModeration: PluginModeration, +export function openResponsesRequestPluginModerationToJSON( + openResponsesRequestPluginModeration: OpenResponsesRequestPluginModeration, ): string { return JSON.stringify( - PluginModeration$outboundSchema.parse(pluginModeration), + OpenResponsesRequestPluginModeration$outboundSchema.parse( + openResponsesRequestPluginModeration, + ), ); } /** @internal */ -export type Plugin$Outbound = - | PluginModeration$Outbound - | PluginWeb$Outbound - | PluginFileParser$Outbound; +export type OpenResponsesRequestPluginUnion$Outbound = + | OpenResponsesRequestPluginModeration$Outbound + | OpenResponsesRequestPluginWeb$Outbound + | OpenResponsesRequestPluginFileParser$Outbound; /** @internal */ -export const Plugin$outboundSchema: z.ZodType = z - .union([ - z.lazy(() => PluginModeration$outboundSchema), - z.lazy(() => PluginWeb$outboundSchema), - z.lazy(() => PluginFileParser$outboundSchema), - ]); - -export function pluginToJSON(plugin: Plugin): string { - return JSON.stringify(Plugin$outboundSchema.parse(plugin)); +export const OpenResponsesRequestPluginUnion$outboundSchema: z.ZodType< + OpenResponsesRequestPluginUnion$Outbound, + OpenResponsesRequestPluginUnion +> = z.union([ + z.lazy(() => OpenResponsesRequestPluginModeration$outboundSchema), + z.lazy(() => OpenResponsesRequestPluginWeb$outboundSchema), + z.lazy(() => OpenResponsesRequestPluginFileParser$outboundSchema), +]); + +export function openResponsesRequestPluginUnionToJSON( + openResponsesRequestPluginUnion: OpenResponsesRequestPluginUnion, +): string { + return JSON.stringify( + OpenResponsesRequestPluginUnion$outboundSchema.parse( + openResponsesRequestPluginUnion, + ), + ); } /** @internal */ @@ -688,10 +647,12 @@ export type OpenResponsesRequest$Outbound = { service_tier?: string | null | undefined; truncation?: string | null | undefined; stream: boolean; - provider?: Provider$Outbound | null | undefined; + provider?: OpenResponsesRequestProvider$Outbound | null | undefined; plugins?: | Array< - PluginModeration$Outbound | PluginWeb$Outbound | PluginFileParser$Outbound + | OpenResponsesRequestPluginModeration$Outbound + | OpenResponsesRequestPluginWeb$Outbound + | OpenResponsesRequestPluginFileParser$Outbound > | undefined; user?: string | undefined; @@ -735,12 +696,14 @@ export const OpenResponsesRequest$outboundSchema: z.ZodType< serviceTier: z.nullable(ServiceTier$outboundSchema).optional(), truncation: z.nullable(Truncation$outboundSchema).optional(), stream: z.boolean().default(false), - provider: z.nullable(z.lazy(() => Provider$outboundSchema)).optional(), + provider: z.nullable( + z.lazy(() => OpenResponsesRequestProvider$outboundSchema), + ).optional(), plugins: z.array( z.union([ - z.lazy(() => PluginModeration$outboundSchema), - z.lazy(() => PluginWeb$outboundSchema), - z.lazy(() => PluginFileParser$outboundSchema), + z.lazy(() => OpenResponsesRequestPluginModeration$outboundSchema), + z.lazy(() => OpenResponsesRequestPluginWeb$outboundSchema), + z.lazy(() => OpenResponsesRequestPluginFileParser$outboundSchema), ]), ).optional(), user: z.string().optional(), diff --git a/src/models/operations/createembeddings.ts b/src/models/operations/createembeddings.ts index f5bbe852..14b8df88 100644 --- a/src/models/operations/createembeddings.ts +++ b/src/models/operations/createembeddings.ts @@ -11,74 +11,57 @@ import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import * as models from "../index.js"; -export type Input = - | string - | Array - | Array - | Array>; +export const TypeImageURL = { + ImageUrl: "image_url", +} as const; +export type TypeImageURL = ClosedEnum; -/** - * Data collection setting. If no available model provider meets the requirement, your request will return an error. - * - * @remarks - * - allow: (default) allow providers which store user data non-transiently and may train on it - * - deny: use only providers which do not collect user data. - */ -export const DataCollection = { - Deny: "deny", - Allow: "allow", +export type ImageUrl = { + url: string; +}; + +export type ContentImageURL = { + type: TypeImageURL; + imageUrl: ImageUrl; +}; + +export const TypeText = { + Text: "text", } as const; -/** - * Data collection setting. If no available model provider meets the requirement, your request will return an error. - * - * @remarks - * - allow: (default) allow providers which store user data non-transiently and may train on it - * - deny: use only providers which do not collect user data. - */ -export type DataCollection = OpenEnum; +export type TypeText = ClosedEnum; -export type Order = models.ProviderName | string; +export type ContentText = { + type: TypeText; + text: string; +}; -export type Only = models.ProviderName | string; +export type Content = ContentText | ContentImageURL; -export type Ignore = models.ProviderName | string; +export type Input = { + content: Array; +}; -/** - * The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. - */ -export const Sort = { - Price: "price", - Throughput: "throughput", - Latency: "latency", +export type InputUnion = + | string + | Array + | Array + | Array> + | Array; + +export const EncodingFormat = { + Float: "float", + Base64: "base64", } as const; -/** - * The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. - */ -export type Sort = OpenEnum; +export type EncodingFormat = OpenEnum; /** * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. */ export type MaxPrice = { - /** - * A value in string or number format that is a large number - */ prompt?: any | undefined; - /** - * A value in string or number format that is a large number - */ completion?: any | undefined; - /** - * A value in string or number format that is a large number - */ image?: any | undefined; - /** - * A value in string or number format that is a large number - */ audio?: any | undefined; - /** - * A value in string or number format that is a large number - */ request?: any | undefined; }; @@ -100,9 +83,10 @@ export type CreateEmbeddingsProvider = { * * @remarks * - allow: (default) allow providers which store user data non-transiently and may train on it + * * - deny: use only providers which do not collect user data. */ - dataCollection?: DataCollection | null | undefined; + dataCollection?: models.DataCollection | null | undefined; /** * Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. */ @@ -114,15 +98,15 @@ export type CreateEmbeddingsProvider = { /** * 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. */ - order?: Array | null | undefined; + order?: Array | undefined; /** * List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. */ - only?: Array | null | undefined; + only?: Array | undefined; /** * List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. */ - ignore?: Array | null | undefined; + ignore?: Array | undefined; /** * A list of quantization levels to filter the provider by. */ @@ -130,31 +114,26 @@ export type CreateEmbeddingsProvider = { /** * The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. */ - sort?: Sort | null | undefined; + sort?: models.ProviderSort | null | undefined; /** * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. */ maxPrice?: MaxPrice | undefined; }; -export const EncodingFormatBase64 = { - Base64: "base64", -} as const; -export type EncodingFormatBase64 = ClosedEnum; - -export const EncodingFormatFloat = { - Float: "float", -} as const; -export type EncodingFormatFloat = ClosedEnum; - -export type EncodingFormat = EncodingFormatFloat | EncodingFormatBase64; - export type CreateEmbeddingsRequest = { - input: string | Array | Array | Array>; + input: + | string + | Array + | Array + | Array> + | Array; model: string; - provider?: CreateEmbeddingsProvider | undefined; - encodingFormat?: EncodingFormatFloat | EncodingFormatBase64 | undefined; + encodingFormat?: EncodingFormat | undefined; + dimensions?: number | undefined; user?: string | undefined; + provider?: CreateEmbeddingsProvider | undefined; + inputType?: string | undefined; }; export const ObjectT = { @@ -195,68 +174,133 @@ export type CreateEmbeddingsResponseBody = { export type CreateEmbeddingsResponse = CreateEmbeddingsResponseBody | string; /** @internal */ -export type Input$Outbound = - | string - | Array - | Array - | Array>; +export const TypeImageURL$outboundSchema: z.ZodEnum = z + .enum(TypeImageURL); /** @internal */ -export const Input$outboundSchema: z.ZodType = z.union([ - z.string(), - z.array(z.string()), - z.array(z.number()), - z.array(z.array(z.number())), -]); +export type ImageUrl$Outbound = { + url: string; +}; -export function inputToJSON(input: Input): string { - return JSON.stringify(Input$outboundSchema.parse(input)); +/** @internal */ +export const ImageUrl$outboundSchema: z.ZodType = z + .object({ + url: z.string(), + }); + +export function imageUrlToJSON(imageUrl: ImageUrl): string { + return JSON.stringify(ImageUrl$outboundSchema.parse(imageUrl)); } /** @internal */ -export const DataCollection$outboundSchema: z.ZodType = - openEnums.outboundSchema(DataCollection); +export type ContentImageURL$Outbound = { + type: string; + image_url: ImageUrl$Outbound; +}; /** @internal */ -export type Order$Outbound = string | string; +export const ContentImageURL$outboundSchema: z.ZodType< + ContentImageURL$Outbound, + ContentImageURL +> = z.object({ + type: TypeImageURL$outboundSchema, + imageUrl: z.lazy(() => ImageUrl$outboundSchema), +}).transform((v) => { + return remap$(v, { + imageUrl: "image_url", + }); +}); + +export function contentImageURLToJSON( + contentImageURL: ContentImageURL, +): string { + return JSON.stringify(ContentImageURL$outboundSchema.parse(contentImageURL)); +} /** @internal */ -export const Order$outboundSchema: z.ZodType = z.union([ - models.ProviderName$outboundSchema, - z.string(), -]); +export const TypeText$outboundSchema: z.ZodEnum = z.enum( + TypeText, +); + +/** @internal */ +export type ContentText$Outbound = { + type: string; + text: string; +}; -export function orderToJSON(order: Order): string { - return JSON.stringify(Order$outboundSchema.parse(order)); +/** @internal */ +export const ContentText$outboundSchema: z.ZodType< + ContentText$Outbound, + ContentText +> = z.object({ + type: TypeText$outboundSchema, + text: z.string(), +}); + +export function contentTextToJSON(contentText: ContentText): string { + return JSON.stringify(ContentText$outboundSchema.parse(contentText)); } /** @internal */ -export type Only$Outbound = string | string; +export type Content$Outbound = ContentText$Outbound | ContentImageURL$Outbound; /** @internal */ -export const Only$outboundSchema: z.ZodType = z.union([ - models.ProviderName$outboundSchema, - z.string(), -]); +export const Content$outboundSchema: z.ZodType = z + .union([ + z.lazy(() => ContentText$outboundSchema), + z.lazy(() => ContentImageURL$outboundSchema), + ]); + +export function contentToJSON(content: Content): string { + return JSON.stringify(Content$outboundSchema.parse(content)); +} + +/** @internal */ +export type Input$Outbound = { + content: Array; +}; + +/** @internal */ +export const Input$outboundSchema: z.ZodType = z.object({ + content: z.array( + z.union([ + z.lazy(() => ContentText$outboundSchema), + z.lazy(() => ContentImageURL$outboundSchema), + ]), + ), +}); -export function onlyToJSON(only: Only): string { - return JSON.stringify(Only$outboundSchema.parse(only)); +export function inputToJSON(input: Input): string { + return JSON.stringify(Input$outboundSchema.parse(input)); } /** @internal */ -export type Ignore$Outbound = string | string; +export type InputUnion$Outbound = + | string + | Array + | Array + | Array> + | Array; /** @internal */ -export const Ignore$outboundSchema: z.ZodType = z - .union([models.ProviderName$outboundSchema, z.string()]); +export const InputUnion$outboundSchema: z.ZodType< + InputUnion$Outbound, + InputUnion +> = z.union([ + z.string(), + z.array(z.string()), + z.array(z.number()), + z.array(z.array(z.number())), + z.array(z.lazy(() => Input$outboundSchema)), +]); -export function ignoreToJSON(ignore: Ignore): string { - return JSON.stringify(Ignore$outboundSchema.parse(ignore)); +export function inputUnionToJSON(inputUnion: InputUnion): string { + return JSON.stringify(InputUnion$outboundSchema.parse(inputUnion)); } /** @internal */ -export const Sort$outboundSchema: z.ZodType = openEnums - .outboundSchema(Sort); +export const EncodingFormat$outboundSchema: z.ZodType = + openEnums.outboundSchema(EncodingFormat); /** @internal */ export type MaxPrice$Outbound = { @@ -288,9 +332,9 @@ export type CreateEmbeddingsProvider$Outbound = { data_collection?: string | null | undefined; zdr?: boolean | null | undefined; enforce_distillable_text?: boolean | null | undefined; - order?: Array | null | undefined; - only?: Array | null | undefined; - ignore?: Array | null | undefined; + order?: Array | undefined; + only?: Array | undefined; + ignore?: Array | undefined; quantizations?: Array | null | undefined; sort?: string | null | undefined; max_price?: MaxPrice$Outbound | undefined; @@ -303,21 +347,15 @@ export const CreateEmbeddingsProvider$outboundSchema: z.ZodType< > = z.object({ allowFallbacks: z.nullable(z.boolean()).optional(), requireParameters: z.nullable(z.boolean()).optional(), - dataCollection: z.nullable(DataCollection$outboundSchema).optional(), + dataCollection: z.nullable(models.DataCollection$outboundSchema).optional(), zdr: z.nullable(z.boolean()).optional(), enforceDistillableText: z.nullable(z.boolean()).optional(), - order: z.nullable( - z.array(z.union([models.ProviderName$outboundSchema, z.string()])), - ).optional(), - only: z.nullable( - z.array(z.union([models.ProviderName$outboundSchema, z.string()])), - ).optional(), - ignore: z.nullable( - z.array(z.union([models.ProviderName$outboundSchema, z.string()])), - ).optional(), + order: z.array(z.string()).optional(), + only: z.array(z.string()).optional(), + ignore: z.array(z.string()).optional(), quantizations: z.nullable(z.array(models.Quantization$outboundSchema)) .optional(), - sort: z.nullable(Sort$outboundSchema).optional(), + sort: z.nullable(models.ProviderSort$outboundSchema).optional(), maxPrice: z.lazy(() => MaxPrice$outboundSchema).optional(), }).transform((v) => { return remap$(v, { @@ -337,39 +375,20 @@ export function createEmbeddingsProviderToJSON( ); } -/** @internal */ -export const EncodingFormatBase64$outboundSchema: z.ZodEnum< - typeof EncodingFormatBase64 -> = z.enum(EncodingFormatBase64); - -/** @internal */ -export const EncodingFormatFloat$outboundSchema: z.ZodEnum< - typeof EncodingFormatFloat -> = z.enum(EncodingFormatFloat); - -/** @internal */ -export type EncodingFormat$Outbound = string | string; - -/** @internal */ -export const EncodingFormat$outboundSchema: z.ZodType< - EncodingFormat$Outbound, - EncodingFormat -> = z.union([ - EncodingFormatFloat$outboundSchema, - EncodingFormatBase64$outboundSchema, -]); - -export function encodingFormatToJSON(encodingFormat: EncodingFormat): string { - return JSON.stringify(EncodingFormat$outboundSchema.parse(encodingFormat)); -} - /** @internal */ export type CreateEmbeddingsRequest$Outbound = { - input: string | Array | Array | Array>; + input: + | string + | Array + | Array + | Array> + | Array; model: string; - provider?: CreateEmbeddingsProvider$Outbound | undefined; - encoding_format?: string | string | undefined; + encoding_format?: string | undefined; + dimensions?: number | undefined; user?: string | undefined; + provider?: CreateEmbeddingsProvider$Outbound | undefined; + input_type?: string | undefined; }; /** @internal */ @@ -382,17 +401,18 @@ export const CreateEmbeddingsRequest$outboundSchema: z.ZodType< z.array(z.string()), z.array(z.number()), z.array(z.array(z.number())), + z.array(z.lazy(() => Input$outboundSchema)), ]), model: z.string(), - provider: z.lazy(() => CreateEmbeddingsProvider$outboundSchema).optional(), - encodingFormat: z.union([ - EncodingFormatFloat$outboundSchema, - EncodingFormatBase64$outboundSchema, - ]).optional(), + encodingFormat: EncodingFormat$outboundSchema.optional(), + dimensions: z.int().optional(), user: z.string().optional(), + provider: z.lazy(() => CreateEmbeddingsProvider$outboundSchema).optional(), + inputType: z.string().optional(), }).transform((v) => { return remap$(v, { encodingFormat: "encoding_format", + inputType: "input_type", }); }); diff --git a/src/models/operations/createkeys.ts b/src/models/operations/createkeys.ts index 5bb6789b..da22a19b 100644 --- a/src/models/operations/createkeys.ts +++ b/src/models/operations/createkeys.ts @@ -205,7 +205,7 @@ export const CreateKeysData$inboundSchema: z.ZodType = created_at: z.string(), updated_at: z.nullable(z.string()), expires_at: z.nullable( - z.string().datetime({ offset: true }).transform(v => new Date(v)), + z.iso.datetime({ offset: true }).transform(v => new Date(v)), ).optional(), }).transform((v) => { return remap$(v, { diff --git a/src/models/operations/getcurrentkey.ts b/src/models/operations/getcurrentkey.ts index 0b96d6d1..9a1a8dab 100644 --- a/src/models/operations/getcurrentkey.ts +++ b/src/models/operations/getcurrentkey.ts @@ -152,7 +152,7 @@ export const GetCurrentKeyData$inboundSchema: z.ZodType< limit_reset: z.nullable(z.string()), include_byok_in_limit: z.boolean(), expires_at: z.nullable( - z.string().datetime({ offset: true }).transform(v => new Date(v)), + z.iso.datetime({ offset: true }).transform(v => new Date(v)), ).optional(), rate_limit: z.lazy(() => RateLimit$inboundSchema), }).transform((v) => { diff --git a/src/models/operations/getkey.ts b/src/models/operations/getkey.ts index 3cd44876..ecef0560 100644 --- a/src/models/operations/getkey.ts +++ b/src/models/operations/getkey.ts @@ -146,7 +146,7 @@ export const GetKeyData$inboundSchema: z.ZodType = z created_at: z.string(), updated_at: z.nullable(z.string()), expires_at: z.nullable( - z.string().datetime({ offset: true }).transform(v => new Date(v)), + z.iso.datetime({ offset: true }).transform(v => new Date(v)), ).optional(), }).transform((v) => { return remap$(v, { diff --git a/src/models/operations/getparameters.ts b/src/models/operations/getparameters.ts index ffda79fe..0a287de5 100644 --- a/src/models/operations/getparameters.ts +++ b/src/models/operations/getparameters.ts @@ -20,22 +20,21 @@ export const GetParametersProvider = { Alibaba: "Alibaba", AmazonBedrock: "Amazon Bedrock", Anthropic: "Anthropic", + Arcee: "Arcee", AtlasCloud: "AtlasCloud", - Atoma: "Atoma", Avian: "Avian", Azure: "Azure", BaseTen: "BaseTen", + BlackForestLabs: "Black Forest Labs", Cerebras: "Cerebras", Chutes: "Chutes", Cirrascale: "Cirrascale", Clarifai: "Clarifai", Cloudflare: "Cloudflare", Cohere: "Cohere", - CrofAI: "CrofAI", Crusoe: "Crusoe", DeepInfra: "DeepInfra", DeepSeek: "DeepSeek", - Enfer: "Enfer", Featherless: "Featherless", Fireworks: "Fireworks", Friendli: "Friendli", @@ -48,11 +47,8 @@ export const GetParametersProvider = { InferenceNet: "InferenceNet", Infermatic: "Infermatic", Inflection: "Inflection", - Kluster: "Kluster", - Lambda: "Lambda", Liquid: "Liquid", Mancer2: "Mancer 2", - Meta: "Meta", Minimax: "Minimax", ModelRun: "ModelRun", Mistral: "Mistral", @@ -62,7 +58,6 @@ export const GetParametersProvider = { NCompass: "NCompass", Nebius: "Nebius", NextBit: "NextBit", - Nineteen: "Nineteen", Novita: "Novita", Nvidia: "Nvidia", OpenAI: "OpenAI", @@ -77,7 +72,6 @@ export const GetParametersProvider = { Switchpoint: "Switchpoint", Targon: "Targon", Together: "Together", - Ubicloud: "Ubicloud", Venice: "Venice", WandB: "WandB", XAI: "xAI", diff --git a/src/models/operations/list.ts b/src/models/operations/list.ts index 80a97b43..2d056b0e 100644 --- a/src/models/operations/list.ts +++ b/src/models/operations/list.ts @@ -152,7 +152,7 @@ export const ListData$inboundSchema: z.ZodType = z.object({ created_at: z.string(), updated_at: z.nullable(z.string()), expires_at: z.nullable( - z.string().datetime({ offset: true }).transform(v => new Date(v)), + z.iso.datetime({ offset: true }).transform(v => new Date(v)), ).optional(), }).transform((v) => { return remap$(v, { diff --git a/src/models/operations/updatekeys.ts b/src/models/operations/updatekeys.ts index 3cf2c3a2..61095dfa 100644 --- a/src/models/operations/updatekeys.ts +++ b/src/models/operations/updatekeys.ts @@ -235,7 +235,7 @@ export const UpdateKeysData$inboundSchema: z.ZodType = created_at: z.string(), updated_at: z.nullable(z.string()), expires_at: z.nullable( - z.string().datetime({ offset: true }).transform(v => new Date(v)), + z.iso.datetime({ offset: true }).transform(v => new Date(v)), ).optional(), }).transform((v) => { return remap$(v, { diff --git a/src/models/providername.ts b/src/models/providername.ts index 544177a1..7b1a6798 100644 --- a/src/models/providername.ts +++ b/src/models/providername.ts @@ -7,44 +7,26 @@ import * as openEnums from "../types/enums.js"; import { OpenEnum } from "../types/enums.js"; export const ProviderName = { - AnyScale: "AnyScale", - CentML: "Cent-ML", - HuggingFace: "HuggingFace", - Hyperbolic2: "Hyperbolic 2", - Lepton: "Lepton", - Lynn2: "Lynn 2", - Lynn: "Lynn", - Mancer: "Mancer", - Modal: "Modal", - OctoAI: "OctoAI", - Recursal: "Recursal", - Reflection: "Reflection", - Replicate: "Replicate", - SambaNova2: "SambaNova 2", - SFCompute: "SF Compute", - Together2: "Together 2", - OneDotAI: "01.AI", Ai21: "AI21", AionLabs: "AionLabs", Alibaba: "Alibaba", AmazonBedrock: "Amazon Bedrock", Anthropic: "Anthropic", + Arcee: "Arcee", AtlasCloud: "AtlasCloud", - Atoma: "Atoma", Avian: "Avian", Azure: "Azure", BaseTen: "BaseTen", + BlackForestLabs: "Black Forest Labs", Cerebras: "Cerebras", Chutes: "Chutes", Cirrascale: "Cirrascale", Clarifai: "Clarifai", Cloudflare: "Cloudflare", Cohere: "Cohere", - CrofAI: "CrofAI", Crusoe: "Crusoe", DeepInfra: "DeepInfra", DeepSeek: "DeepSeek", - Enfer: "Enfer", Featherless: "Featherless", Fireworks: "Fireworks", Friendli: "Friendli", @@ -57,12 +39,8 @@ export const ProviderName = { InferenceNet: "InferenceNet", Infermatic: "Infermatic", Inflection: "Inflection", - InoCloud: "InoCloud", - Kluster: "Kluster", - Lambda: "Lambda", Liquid: "Liquid", Mancer2: "Mancer 2", - Meta: "Meta", Minimax: "Minimax", ModelRun: "ModelRun", Mistral: "Mistral", @@ -72,7 +50,6 @@ export const ProviderName = { NCompass: "NCompass", Nebius: "Nebius", NextBit: "NextBit", - Nineteen: "Nineteen", Novita: "Novita", Nvidia: "Nvidia", OpenAI: "OpenAI", @@ -87,7 +64,6 @@ export const ProviderName = { Switchpoint: "Switchpoint", Targon: "Targon", Together: "Together", - Ubicloud: "Ubicloud", Venice: "Venice", WandB: "WandB", XAI: "xAI", @@ -99,6 +75,3 @@ export type ProviderName = OpenEnum; /** @internal */ export const ProviderName$inboundSchema: z.ZodType = openEnums.inboundSchema(ProviderName); -/** @internal */ -export const ProviderName$outboundSchema: z.ZodType = - openEnums.outboundSchema(ProviderName); diff --git a/src/models/providersort.ts b/src/models/providersort.ts new file mode 100644 index 00000000..74a9a5cb --- /dev/null +++ b/src/models/providersort.ts @@ -0,0 +1,24 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; + +/** + * The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. + */ +export const ProviderSort = { + Price: "price", + Throughput: "throughput", + Latency: "latency", +} as const; +/** + * The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. + */ +export type ProviderSort = OpenEnum; + +/** @internal */ +export const ProviderSort$outboundSchema: z.ZodType = + openEnums.outboundSchema(ProviderSort); diff --git a/src/models/publicendpoint.ts b/src/models/publicendpoint.ts index d0d14ff5..e60805b4 100644 --- a/src/models/publicendpoint.ts +++ b/src/models/publicendpoint.ts @@ -17,49 +17,17 @@ import { Parameter, Parameter$inboundSchema } from "./parameter.js"; import { ProviderName, ProviderName$inboundSchema } from "./providername.js"; export type Pricing = { - /** - * A value in string or number format that is a large number - */ prompt?: any | undefined; - /** - * A value in string or number format that is a large number - */ completion?: any | undefined; - /** - * A value in string or number format that is a large number - */ request?: any | undefined; - /** - * A value in string or number format that is a large number - */ image?: any | undefined; - /** - * A value in string or number format that is a large number - */ + imageToken?: any | undefined; imageOutput?: any | undefined; - /** - * A value in string or number format that is a large number - */ audio?: any | undefined; - /** - * A value in string or number format that is a large number - */ inputAudioCache?: any | undefined; - /** - * A value in string or number format that is a large number - */ webSearch?: any | undefined; - /** - * A value in string or number format that is a large number - */ internalReasoning?: any | undefined; - /** - * A value in string or number format that is a large number - */ inputCacheRead?: any | undefined; - /** - * A value in string or number format that is a large number - */ inputCacheWrite?: any | undefined; discount?: number | undefined; }; @@ -104,6 +72,7 @@ export const Pricing$inboundSchema: z.ZodType = z.object({ completion: z.any().optional(), request: z.any().optional(), image: z.any().optional(), + image_token: z.any().optional(), image_output: z.any().optional(), audio: z.any().optional(), input_audio_cache: z.any().optional(), @@ -114,6 +83,7 @@ export const Pricing$inboundSchema: z.ZodType = z.object({ discount: z.number().optional(), }).transform((v) => { return remap$(v, { + "image_token": "imageToken", "image_output": "imageOutput", "input_audio_cache": "inputAudioCache", "web_search": "webSearch", diff --git a/src/models/publicpricing.ts b/src/models/publicpricing.ts index 80e79e80..7c0811c5 100644 --- a/src/models/publicpricing.ts +++ b/src/models/publicpricing.ts @@ -12,49 +12,17 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js"; * Pricing information for the model */ export type PublicPricing = { - /** - * A value in string or number format that is a large number - */ prompt?: any | undefined; - /** - * A value in string or number format that is a large number - */ completion?: any | undefined; - /** - * A value in string or number format that is a large number - */ request?: any | undefined; - /** - * A value in string or number format that is a large number - */ image?: any | undefined; - /** - * A value in string or number format that is a large number - */ + imageToken?: any | undefined; imageOutput?: any | undefined; - /** - * A value in string or number format that is a large number - */ audio?: any | undefined; - /** - * A value in string or number format that is a large number - */ inputAudioCache?: any | undefined; - /** - * A value in string or number format that is a large number - */ webSearch?: any | undefined; - /** - * A value in string or number format that is a large number - */ internalReasoning?: any | undefined; - /** - * A value in string or number format that is a large number - */ inputCacheRead?: any | undefined; - /** - * A value in string or number format that is a large number - */ inputCacheWrite?: any | undefined; discount?: number | undefined; }; @@ -66,6 +34,7 @@ export const PublicPricing$inboundSchema: z.ZodType = z completion: z.any().optional(), request: z.any().optional(), image: z.any().optional(), + image_token: z.any().optional(), image_output: z.any().optional(), audio: z.any().optional(), input_audio_cache: z.any().optional(), @@ -76,6 +45,7 @@ export const PublicPricing$inboundSchema: z.ZodType = z discount: z.number().optional(), }).transform((v) => { return remap$(v, { + "image_token": "imageToken", "image_output": "imageOutput", "input_audio_cache": "inputAudioCache", "web_search": "webSearch", diff --git a/src/models/schema0.ts b/src/models/schema0.ts new file mode 100644 index 00000000..66e7c873 --- /dev/null +++ b/src/models/schema0.ts @@ -0,0 +1,110 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4"; +import { safeParse } from "../lib/schemas.js"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export const Schema0Enum = { + Ai21: "AI21", + AionLabs: "AionLabs", + Alibaba: "Alibaba", + AmazonBedrock: "Amazon Bedrock", + Anthropic: "Anthropic", + Arcee: "Arcee", + AtlasCloud: "AtlasCloud", + Avian: "Avian", + Azure: "Azure", + BaseTen: "BaseTen", + BlackForestLabs: "Black Forest Labs", + Cerebras: "Cerebras", + Chutes: "Chutes", + Cirrascale: "Cirrascale", + Clarifai: "Clarifai", + Cloudflare: "Cloudflare", + Cohere: "Cohere", + Crusoe: "Crusoe", + DeepInfra: "DeepInfra", + DeepSeek: "DeepSeek", + Featherless: "Featherless", + Fireworks: "Fireworks", + Friendli: "Friendli", + GMICloud: "GMICloud", + Google: "Google", + GoogleAIStudio: "Google AI Studio", + Groq: "Groq", + Hyperbolic: "Hyperbolic", + Inception: "Inception", + InferenceNet: "InferenceNet", + Infermatic: "Infermatic", + Inflection: "Inflection", + Liquid: "Liquid", + Mancer2: "Mancer 2", + Minimax: "Minimax", + ModelRun: "ModelRun", + Mistral: "Mistral", + Modular: "Modular", + MoonshotAI: "Moonshot AI", + Morph: "Morph", + NCompass: "NCompass", + Nebius: "Nebius", + NextBit: "NextBit", + Novita: "Novita", + Nvidia: "Nvidia", + OpenAI: "OpenAI", + OpenInference: "OpenInference", + Parasail: "Parasail", + Perplexity: "Perplexity", + Phala: "Phala", + Relace: "Relace", + SambaNova: "SambaNova", + SiliconFlow: "SiliconFlow", + Stealth: "Stealth", + Switchpoint: "Switchpoint", + Targon: "Targon", + Together: "Together", + Venice: "Venice", + WandB: "WandB", + XAI: "xAI", + ZAi: "Z.AI", + FakeProvider: "FakeProvider", +} as const; +export type Schema0Enum = OpenEnum; + +export type Schema0 = Schema0Enum | string; + +/** @internal */ +export const Schema0Enum$inboundSchema: z.ZodType = + openEnums.inboundSchema(Schema0Enum); +/** @internal */ +export const Schema0Enum$outboundSchema: z.ZodType = + openEnums.outboundSchema(Schema0Enum); + +/** @internal */ +export const Schema0$inboundSchema: z.ZodType = z.union([ + Schema0Enum$inboundSchema, + z.string(), +]); +/** @internal */ +export type Schema0$Outbound = string | string; + +/** @internal */ +export const Schema0$outboundSchema: z.ZodType = z + .union([Schema0Enum$outboundSchema, z.string()]); + +export function schema0ToJSON(schema0: Schema0): string { + return JSON.stringify(Schema0$outboundSchema.parse(schema0)); +} +export function schema0FromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Schema0$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Schema0' from JSON`, + ); +} From ce74f7253f90add33708b441d16d8ee4d2b0bdda Mon Sep 17 00:00:00 2001 From: Matt Apperson Date: Tue, 18 Nov 2025 13:49:08 -0500 Subject: [PATCH 2/2] fix --- .speakeasy/gen.lock | 59 +- .speakeasy/gen.yaml | 2 +- .speakeasy/in.openapi.yaml | 924 ++++-------------- .speakeasy/out.openapi.yaml | 902 ++++------------- .speakeasy/workflow.lock | 10 +- docs/models/chatcompletionfinishreason.md | 17 + docs/models/chatgenerationparams.md | 50 +- .../chatgenerationparamsdatacollection.md | 17 - docs/models/chatgenerationparamsengine.md | 17 - docs/models/chatgenerationparamsmaxprice.md | 21 - docs/models/chatgenerationparamspdf.md | 15 - docs/models/chatgenerationparamspdfengine.md | 17 - .../chatgenerationparamspluginfileparser.md | 19 - .../chatgenerationparamspluginmoderation.md | 17 - .../models/chatgenerationparamspluginunion.md | 29 - docs/models/chatgenerationparamspluginweb.md | 20 - docs/models/chatgenerationparamsprovider.md | 25 - .../chatgenerationparamsquantizations.md | 17 - docs/models/chatgenerationparamssort.md | 17 - docs/models/chatresponsechoice.md | 16 +- docs/models/chatstreamingchoice.md | 16 +- docs/models/chatstreamingresponsechunk.md | 4 +- docs/models/completioncreateparams.md | 48 +- .../completioncreateparamsdatacollection.md | 17 - docs/models/completioncreateparamsengine.md | 17 - docs/models/completioncreateparamsmaxprice.md | 21 - docs/models/completioncreateparamspdf.md | 15 - .../models/completioncreateparamspdfengine.md | 17 - .../completioncreateparamspluginfileparser.md | 19 - .../completioncreateparamspluginmoderation.md | 17 - .../completioncreateparamspluginunion.md | 29 - .../models/completioncreateparamspluginweb.md | 20 - docs/models/completioncreateparamsprovider.md | 25 - .../completioncreateparamsquantizations.md | 17 - docs/models/completioncreateparamssort.md | 17 - ...penresponsesrequestengine.md => engine.md} | 6 +- docs/models/{schema0.md => ignore.md} | 6 +- docs/models/maxprice.md | 21 + docs/models/only.md | 17 + docs/models/openresponsesrequest.md | 4 +- docs/models/openresponsesrequestmaxprice.md | 21 - docs/models/openresponsesrequestpdf.md | 15 - .../openresponsesrequestpluginfileparser.md | 19 - .../models/openresponsesrequestpluginunion.md | 29 - docs/models/openresponsesrequestpluginweb.md | 20 - .../operations/createembeddingsprovider.md | 6 +- docs/models/operations/ignore.md | 17 + docs/models/operations/maxprice.md | 14 +- docs/models/operations/only.md | 17 + docs/models/operations/order.md | 17 + docs/models/order.md | 17 + docs/models/pdf.md | 15 + ...ponsesrequestpdfengine.md => pdfengine.md} | 6 +- docs/models/plugin.md | 29 + docs/models/pluginfileparser.md | 19 + ...luginmoderation.md => pluginmoderation.md} | 6 +- docs/models/pluginweb.md | 20 + docs/models/pricing.md | 32 +- ...esponsesrequestprovider.md => provider.md} | 14 +- docs/models/publicpricing.md | 30 +- docs/models/schema0enum.md | 17 - jsr.json | 2 +- package-lock.json | 4 +- package.json | 2 +- src/lib/config.ts | 4 +- src/models/chatgenerationparams.ts | 418 -------- src/models/chatresponsechoice.ts | 60 +- src/models/chatstreamingchoice.ts | 50 - src/models/chatstreamingresponsechunk.ts | 2 +- src/models/completioncreateparams.ts | 423 -------- src/models/index.ts | 2 - src/models/openresponsesrequest.ts | 348 +++---- src/models/operations/createembeddings.ts | 82 +- src/models/providername.ts | 3 + src/models/publicendpoint.ts | 36 + src/models/publicpricing.ts | 36 + src/models/schema0.ts | 110 --- tests/e2e/chat.test.ts | 3 +- 78 files changed, 1112 insertions(+), 3417 deletions(-) create mode 100644 docs/models/chatcompletionfinishreason.md delete mode 100644 docs/models/chatgenerationparamsdatacollection.md delete mode 100644 docs/models/chatgenerationparamsengine.md delete mode 100644 docs/models/chatgenerationparamsmaxprice.md delete mode 100644 docs/models/chatgenerationparamspdf.md delete mode 100644 docs/models/chatgenerationparamspdfengine.md delete mode 100644 docs/models/chatgenerationparamspluginfileparser.md delete mode 100644 docs/models/chatgenerationparamspluginmoderation.md delete mode 100644 docs/models/chatgenerationparamspluginunion.md delete mode 100644 docs/models/chatgenerationparamspluginweb.md delete mode 100644 docs/models/chatgenerationparamsprovider.md delete mode 100644 docs/models/chatgenerationparamsquantizations.md delete mode 100644 docs/models/chatgenerationparamssort.md delete mode 100644 docs/models/completioncreateparamsdatacollection.md delete mode 100644 docs/models/completioncreateparamsengine.md delete mode 100644 docs/models/completioncreateparamsmaxprice.md delete mode 100644 docs/models/completioncreateparamspdf.md delete mode 100644 docs/models/completioncreateparamspdfengine.md delete mode 100644 docs/models/completioncreateparamspluginfileparser.md delete mode 100644 docs/models/completioncreateparamspluginmoderation.md delete mode 100644 docs/models/completioncreateparamspluginunion.md delete mode 100644 docs/models/completioncreateparamspluginweb.md delete mode 100644 docs/models/completioncreateparamsprovider.md delete mode 100644 docs/models/completioncreateparamsquantizations.md delete mode 100644 docs/models/completioncreateparamssort.md rename docs/models/{openresponsesrequestengine.md => engine.md} (58%) rename docs/models/{schema0.md => ignore.md} (57%) create mode 100644 docs/models/maxprice.md create mode 100644 docs/models/only.md delete mode 100644 docs/models/openresponsesrequestmaxprice.md delete mode 100644 docs/models/openresponsesrequestpdf.md delete mode 100644 docs/models/openresponsesrequestpluginfileparser.md delete mode 100644 docs/models/openresponsesrequestpluginunion.md delete mode 100644 docs/models/openresponsesrequestpluginweb.md create mode 100644 docs/models/operations/ignore.md create mode 100644 docs/models/operations/only.md create mode 100644 docs/models/operations/order.md create mode 100644 docs/models/order.md create mode 100644 docs/models/pdf.md rename docs/models/{openresponsesrequestpdfengine.md => pdfengine.md} (59%) create mode 100644 docs/models/plugin.md create mode 100644 docs/models/pluginfileparser.md rename docs/models/{openresponsesrequestpluginmoderation.md => pluginmoderation.md} (80%) create mode 100644 docs/models/pluginweb.md rename docs/models/{openresponsesrequestprovider.md => provider.md} (95%) delete mode 100644 docs/models/schema0enum.md delete mode 100644 src/models/chatstreamingchoice.ts delete mode 100644 src/models/schema0.ts diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index cee1ab6a..35c723be 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 8b6cd71c-ea04-44da-af45-e43968b5928d management: - docChecksum: 44cd1f9d56cdf4f436acedb547101641 + docChecksum: 06c725cfe764dbed9c3f85ff06857003 docVersion: 1.0.0 speakeasyVersion: 1.658.2 generationVersion: 2.755.9 - releaseVersion: 0.1.12 - configChecksum: 58991a7987fc75734e6147cc87d5e7fd + releaseVersion: 0.1.13 + configChecksum: 1bbbf76f0f625fbac8a29bd3ed9222e1 repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true @@ -57,24 +57,13 @@ generatedFiles: - docs/models/badgatewayresponseerrordata.md - docs/models/badrequestresponseerrordata.md - docs/models/chainid.md + - docs/models/chatcompletionfinishreason.md - docs/models/chaterrorerror.md - docs/models/chatgenerationparams.md - - docs/models/chatgenerationparamsdatacollection.md - - docs/models/chatgenerationparamsengine.md - - docs/models/chatgenerationparamsmaxprice.md - - docs/models/chatgenerationparamspdf.md - - docs/models/chatgenerationparamspdfengine.md - - docs/models/chatgenerationparamspluginfileparser.md - - docs/models/chatgenerationparamspluginmoderation.md - - docs/models/chatgenerationparamspluginunion.md - - docs/models/chatgenerationparamspluginweb.md - - docs/models/chatgenerationparamsprovider.md - - docs/models/chatgenerationparamsquantizations.md - docs/models/chatgenerationparamsresponseformatjsonobject.md - docs/models/chatgenerationparamsresponseformatpython.md - docs/models/chatgenerationparamsresponseformattext.md - docs/models/chatgenerationparamsresponseformatunion.md - - docs/models/chatgenerationparamssort.md - docs/models/chatgenerationparamsstop.md - docs/models/chatgenerationtokenusage.md - docs/models/chatmessagecontentitem.md @@ -106,22 +95,10 @@ generatedFiles: - docs/models/codeenum.md - docs/models/completionchoice.md - docs/models/completioncreateparams.md - - docs/models/completioncreateparamsdatacollection.md - - docs/models/completioncreateparamsengine.md - - docs/models/completioncreateparamsmaxprice.md - - docs/models/completioncreateparamspdf.md - - docs/models/completioncreateparamspdfengine.md - - docs/models/completioncreateparamspluginfileparser.md - - docs/models/completioncreateparamspluginmoderation.md - - docs/models/completioncreateparamspluginunion.md - - docs/models/completioncreateparamspluginweb.md - - docs/models/completioncreateparamsprovider.md - - docs/models/completioncreateparamsquantizations.md - docs/models/completioncreateparamsresponseformatjsonobject.md - docs/models/completioncreateparamsresponseformatpython.md - docs/models/completioncreateparamsresponseformattext.md - docs/models/completioncreateparamsresponseformatunion.md - - docs/models/completioncreateparamssort.md - docs/models/completioncreateparamsstop.md - docs/models/completionfinishreason.md - docs/models/completionlogprobs.md @@ -135,6 +112,7 @@ generatedFiles: - docs/models/edgenetworktimeoutresponseerrordata.md - docs/models/effort.md - docs/models/endpointstatus.md + - docs/models/engine.md - docs/models/errors/badgatewayresponseerror.md - docs/models/errors/badrequestresponseerror.md - docs/models/errors/chaterror.md @@ -158,6 +136,7 @@ generatedFiles: - docs/models/idfileparser.md - docs/models/idmoderation.md - docs/models/idweb.md + - docs/models/ignore.md - docs/models/imagegenerationstatus.md - docs/models/imageurl.md - docs/models/inputmodality.md @@ -166,6 +145,7 @@ generatedFiles: - docs/models/internalserverresponseerrordata.md - docs/models/jsonschemaconfig.md - docs/models/listendpointsresponse.md + - docs/models/maxprice.md - docs/models/message.md - docs/models/messagecontent.md - docs/models/messagedeveloper.md @@ -180,6 +160,7 @@ generatedFiles: - docs/models/namedtoolchoicefunction.md - docs/models/notfoundresponseerrordata.md - docs/models/objectt.md + - docs/models/only.md - docs/models/openairesponsesannotation.md - docs/models/openairesponsesincludable.md - docs/models/openairesponsesincompletedetails.md @@ -278,15 +259,6 @@ generatedFiles: - docs/models/openresponsesreasoningsummarytextdoneeventtype.md - docs/models/openresponsesreasoningtype.md - docs/models/openresponsesrequest.md - - docs/models/openresponsesrequestengine.md - - docs/models/openresponsesrequestmaxprice.md - - docs/models/openresponsesrequestpdf.md - - docs/models/openresponsesrequestpdfengine.md - - docs/models/openresponsesrequestpluginfileparser.md - - docs/models/openresponsesrequestpluginmoderation.md - - docs/models/openresponsesrequestpluginunion.md - - docs/models/openresponsesrequestpluginweb.md - - docs/models/openresponsesrequestprovider.md - docs/models/openresponsesrequesttoolfunction.md - docs/models/openresponsesrequesttoolunion.md - docs/models/openresponsesrequesttype.md @@ -369,6 +341,7 @@ generatedFiles: - docs/models/operations/getparameterssecurity.md - docs/models/operations/getuseractivityrequest.md - docs/models/operations/getuseractivityresponse.md + - docs/models/operations/ignore.md - docs/models/operations/imageurl.md - docs/models/operations/input.md - docs/models/operations/inputunion.md @@ -385,6 +358,8 @@ generatedFiles: - docs/models/operations/metadata.md - docs/models/operations/objectembedding.md - docs/models/operations/objectt.md + - docs/models/operations/only.md + - docs/models/operations/order.md - docs/models/operations/ratelimit.md - docs/models/operations/sendchatcompletionrequestresponse.md - docs/models/operations/supportedparameter.md @@ -398,6 +373,7 @@ generatedFiles: - docs/models/operations/updatekeysresponse.md - docs/models/operations/usage.md - docs/models/operations/web3data.md + - docs/models/order.md - docs/models/outputitemimagegenerationcall.md - docs/models/outputitemimagegenerationcalltype.md - docs/models/outputmessage.md @@ -415,10 +391,17 @@ generatedFiles: - docs/models/part2.md - docs/models/payloadtoolargeresponseerrordata.md - docs/models/paymentrequiredresponseerrordata.md + - docs/models/pdf.md + - docs/models/pdfengine.md - docs/models/perrequestlimits.md + - docs/models/plugin.md + - docs/models/pluginfileparser.md + - docs/models/pluginmoderation.md + - docs/models/pluginweb.md - docs/models/pricing.md - docs/models/prompt.md - docs/models/prompttokensdetails.md + - docs/models/provider.md - docs/models/providername.md - docs/models/provideroverloadedresponseerrordata.md - docs/models/providersort.md @@ -489,8 +472,6 @@ generatedFiles: - docs/models/responseswebsearchuserlocationtype.md - docs/models/responsetextconfig.md - docs/models/responsetextconfigverbosity.md - - docs/models/schema0.md - - docs/models/schema0enum.md - docs/models/security.md - docs/models/servicetier.md - docs/models/serviceunavailableresponseerrordata.md @@ -620,7 +601,6 @@ generatedFiles: - src/models/chatmessagetoolcall.ts - src/models/chatresponse.ts - src/models/chatresponsechoice.ts - - src/models/chatstreamingchoice.ts - src/models/chatstreamingmessagechunk.ts - src/models/chatstreamingmessagetoolcall.ts - src/models/chatstreamingresponsechunk.ts @@ -775,7 +755,6 @@ generatedFiles: - src/models/responseswebsearchcalloutput.ts - src/models/responseswebsearchuserlocation.ts - src/models/responsetextconfig.ts - - src/models/schema0.ts - src/models/security.ts - src/models/serviceunavailableresponseerrordata.ts - src/models/systemmessage.ts diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 92245f09..7a05cf81 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -30,7 +30,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: false typescript: - version: 0.1.12 + version: 0.1.13 acceptHeaderEnum: false additionalDependencies: dependencies: {} diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml index 282166ba..82b30d29 100644 --- a/.speakeasy/in.openapi.yaml +++ b/.speakeasy/in.openapi.yaml @@ -3440,6 +3440,72 @@ components: - deny: use only providers which do not collect user data. example: allow + ProviderName: + type: string + enum: + - AI21 + - AionLabs + - Alibaba + - Amazon Bedrock + - Anthropic + - Arcee + - AtlasCloud + - Avian + - Azure + - BaseTen + - Black Forest Labs + - Cerebras + - Chutes + - Cirrascale + - Clarifai + - Cloudflare + - Cohere + - Crusoe + - DeepInfra + - DeepSeek + - Featherless + - Fireworks + - Friendli + - GMICloud + - Google + - Google AI Studio + - Groq + - Hyperbolic + - Inception + - InferenceNet + - Infermatic + - Inflection + - Liquid + - Mancer 2 + - Minimax + - ModelRun + - Mistral + - Modular + - Moonshot AI + - Morph + - NCompass + - Nebius + - NextBit + - Novita + - Nvidia + - OpenAI + - OpenInference + - Parasail + - Perplexity + - Phala + - Relace + - SambaNova + - SiliconFlow + - Stealth + - Switchpoint + - Targon + - Together + - Venice + - WandB + - xAI + - Z.AI + - FakeProvider + example: OpenAI Quantization: type: string enum: @@ -3464,6 +3530,14 @@ components: The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. example: price + BigNumberUnion: + anyOf: + - type: number + - type: string + - type: number + example: 1000 + description: A value in string or number format that is a large number + example: 1000 OpenResponsesRequest: type: object properties: @@ -3611,35 +3685,35 @@ components: example: true order: type: array + nullable: true items: - type: string + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string description: >- An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. - example: - - OpenAI - - Anthropic only: type: array + nullable: true items: - type: string + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string description: >- List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. - example: - - OpenAI - - Anthropic ignore: type: array + nullable: true items: - type: string + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string description: >- List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. - example: - - OpenAI - - Anthropic quantizations: type: array nullable: true @@ -3652,40 +3726,15 @@ components: type: object properties: prompt: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' completion: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' image: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' audio: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' request: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' additionalProperties: false description: >- The object specifying the maximum price you want to pay for this request. USD price per million tokens, @@ -3897,89 +3946,29 @@ components: type: object properties: prompt: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' completion: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' request: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' image: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' image_token: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' image_output: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' audio: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' input_audio_cache: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' web_search: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' internal_reasoning: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' input_cache_read: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' input_cache_write: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' discount: type: number required: @@ -4373,72 +4362,6 @@ components: - qwq - qwen3 description: Instruction format type - ProviderName: - type: string - enum: - - AI21 - - AionLabs - - Alibaba - - Amazon Bedrock - - Anthropic - - Arcee - - AtlasCloud - - Avian - - Azure - - BaseTen - - Black Forest Labs - - Cerebras - - Chutes - - Cirrascale - - Clarifai - - Cloudflare - - Cohere - - Crusoe - - DeepInfra - - DeepSeek - - Featherless - - Fireworks - - Friendli - - GMICloud - - Google - - Google AI Studio - - Groq - - Hyperbolic - - Inception - - InferenceNet - - Infermatic - - Inflection - - Liquid - - Mancer 2 - - Minimax - - ModelRun - - Mistral - - Modular - - Moonshot AI - - Morph - - NCompass - - Nebius - - NextBit - - Novita - - Nvidia - - OpenAI - - OpenInference - - Parasail - - Perplexity - - Phala - - Relace - - SambaNova - - SiliconFlow - - Stealth - - Switchpoint - - Targon - - Together - - Venice - - WandB - - xAI - - Z.AI - - FakeProvider - example: OpenAI EndpointStatus: type: integer enum: @@ -4462,89 +4385,29 @@ components: type: object properties: prompt: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' completion: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' request: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' image: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' image_token: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' image_output: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' audio: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' input_audio_cache: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' web_search: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' internal_reasoning: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' input_cache_read: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' input_cache_write: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' discount: type: number required: @@ -4671,125 +4534,49 @@ components: $ref: '#/components/schemas/PublicEndpoint' description: List of available endpoints for this model required: - - id - - name - - created - - description - - architecture - - endpoints - description: List of available endpoints for a model - example: - id: openai/gpt-4 - name: GPT-4 - created: 1692901234 - description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. - architecture: - tokenizer: GPT - instruct_type: chatml - modality: text->text - input_modalities: - - text - output_modalities: - - text - endpoints: - - name: 'OpenAI: GPT-4' - model_name: GPT-4 - context_length: 8192 - pricing: - prompt: '0.00003' - completion: '0.00006' - request: '0' - image: '0' - provider_name: OpenAI - tag: openai - quantization: fp16 - max_completion_tokens: 4096 - max_prompt_tokens: 8192 - supported_parameters: - - temperature - - top_p - - max_tokens - - frequency_penalty - - presence_penalty - status: default - uptime_last_30m: 99.5 - supports_implicit_caching: true - __schema0: - type: array - items: - anyOf: - - type: string - enum: - - AI21 - - AionLabs - - Alibaba - - Amazon Bedrock - - Anthropic - - Arcee - - AtlasCloud - - Avian - - Azure - - BaseTen - - Black Forest Labs - - Cerebras - - Chutes - - Cirrascale - - Clarifai - - Cloudflare - - Cohere - - Crusoe - - DeepInfra - - DeepSeek - - Featherless - - Fireworks - - Friendli - - GMICloud - - Google - - Google AI Studio - - Groq - - Hyperbolic - - Inception - - InferenceNet - - Infermatic - - Inflection - - Liquid - - Mancer 2 - - Minimax - - ModelRun - - Mistral - - Modular - - Moonshot AI - - Morph - - NCompass - - Nebius - - NextBit - - Novita - - Nvidia - - OpenAI - - OpenInference - - Parasail - - Perplexity - - Phala - - Relace - - SambaNova - - SiliconFlow - - Stealth - - Switchpoint - - Targon - - Together - - Venice - - WandB - - xAI - - Z.AI - - FakeProvider - - type: string - __schema1: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + - id + - name + - created + - description + - architecture + - endpoints + description: List of available endpoints for a model + example: + id: openai/gpt-4 + name: GPT-4 + created: 1692901234 + description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. + architecture: + tokenizer: GPT + instruct_type: chatml + modality: text->text + input_modalities: + - text + output_modalities: + - text + endpoints: + - name: 'OpenAI: GPT-4' + model_name: GPT-4 + context_length: 8192 + pricing: + prompt: '0.00003' + completion: '0.00006' + request: '0' + image: '0' + provider_name: OpenAI + tag: openai + quantization: fp16 + max_completion_tokens: 4096 + max_prompt_tokens: 8192 + supported_parameters: + - temperature + - top_p + - max_tokens + - frequency_penalty + - presence_penalty + status: default + uptime_last_30m: 99.5 + supports_implicit_caching: true ModelName: type: string ChatMessageContentItemText: @@ -5022,6 +4809,16 @@ components: - completion_tokens - prompt_tokens - total_tokens + ChatCompletionFinishReason: + anyOf: + - type: string + enum: + - tool_calls + - stop + - length + - content_filter + - error + - type: 'null' JSONSchemaConfig: type: object properties: @@ -5229,167 +5026,6 @@ components: ChatGenerationParams: type: object properties: - plugins: - type: array - items: - oneOf: - - type: object - properties: - id: - type: string - const: moderation - required: - - id - - type: object - properties: - id: - type: string - const: web - max_results: - type: number - search_prompt: - type: string - engine: - type: string - enum: - - native - - exa - required: - - id - - type: object - properties: - id: - type: string - const: file-parser - max_files: - type: number - pdf: - type: object - properties: - engine: - type: string - enum: - - mistral-ocr - - pdf-text - - native - required: - - id - type: object - provider: - anyOf: - - type: object - properties: - allow_fallbacks: - description: > - Whether to allow backup providers to serve requests - - - true: (default) when the primary provider (or your custom providers in "order") is unavailable, - use the next best provider. - - - false: use only the primary/custom provider, and return the upstream error if it's unavailable. - anyOf: - - type: boolean - - type: 'null' - require_parameters: - description: >- - Whether to filter providers to only those that support the parameters you've provided. If this - setting is omitted or set to false, then providers will receive only the parameters they support, - and ignore the rest. - anyOf: - - type: boolean - - type: 'null' - data_collection: - description: >- - Data collection setting. If no available model provider meets the requirement, your request will - return an error. - - - allow: (default) allow providers which store user data non-transiently and may train on it - - - - deny: use only providers which do not collect user data. - anyOf: - - type: string - enum: - - deny - - allow - - type: 'null' - zdr: - anyOf: - - type: boolean - - type: 'null' - enforce_distillable_text: - anyOf: - - type: boolean - - type: 'null' - order: - description: >- - An ordered list of provider slugs. The router will attempt to use the first provider in the subset - of this list that supports your requested model, and fall back to the next if it is unavailable. If - no providers are available, the request will fail with an error message. - anyOf: - - $ref: '#/components/schemas/__schema0' - - type: 'null' - only: - description: >- - List of provider slugs to allow. If provided, this list is merged with your account-wide allowed - provider settings for this request. - anyOf: - - $ref: '#/components/schemas/__schema0' - - type: 'null' - ignore: - description: >- - List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored - provider settings for this request. - anyOf: - - $ref: '#/components/schemas/__schema0' - - type: 'null' - quantizations: - description: A list of quantization levels to filter the provider by. - anyOf: - - type: array - items: - type: string - enum: - - int4 - - int8 - - fp4 - - fp6 - - fp8 - - fp16 - - bf16 - - fp32 - - unknown - - type: 'null' - sort: - description: >- - The sorting strategy to use for this request, if "order" is not specified. When set, no load - balancing is performed. - anyOf: - - type: string - enum: - - price - - throughput - - latency - - type: 'null' - max_price: - description: >- - The object specifying the maximum price you want to pay for this request. USD price per million - tokens, for prompt and completion. - type: object - properties: - prompt: - $ref: '#/components/schemas/__schema1' - completion: - $ref: '#/components/schemas/__schema1' - image: - $ref: '#/components/schemas/__schema1' - audio: - $ref: '#/components/schemas/__schema1' - request: - $ref: '#/components/schemas/__schema1' - additionalProperties: false - additionalProperties: false - - type: 'null' messages: minItems: 1 type: array @@ -5540,7 +5176,7 @@ components: type: object properties: finish_reason: - $ref: '#/components/schemas/__schema0' + $ref: '#/components/schemas/ChatCompletionFinishReason' index: type: number message: @@ -5601,7 +5237,7 @@ components: delta: $ref: '#/components/schemas/ChatStreamingMessageChunk' finish_reason: - $ref: '#/components/schemas/__schema0' + $ref: '#/components/schemas/ChatCompletionFinishReason' index: type: number logprobs: @@ -5776,167 +5412,6 @@ components: type: array items: $ref: '#/components/schemas/ModelName' - plugins: - type: array - items: - oneOf: - - type: object - properties: - id: - type: string - const: moderation - required: - - id - - type: object - properties: - id: - type: string - const: web - max_results: - type: number - search_prompt: - type: string - engine: - type: string - enum: - - native - - exa - required: - - id - - type: object - properties: - id: - type: string - const: file-parser - max_files: - type: number - pdf: - type: object - properties: - engine: - type: string - enum: - - mistral-ocr - - pdf-text - - native - required: - - id - type: object - provider: - anyOf: - - type: object - properties: - allow_fallbacks: - description: > - Whether to allow backup providers to serve requests - - - true: (default) when the primary provider (or your custom providers in "order") is unavailable, - use the next best provider. - - - false: use only the primary/custom provider, and return the upstream error if it's unavailable. - anyOf: - - type: boolean - - type: 'null' - require_parameters: - description: >- - Whether to filter providers to only those that support the parameters you've provided. If this - setting is omitted or set to false, then providers will receive only the parameters they support, - and ignore the rest. - anyOf: - - type: boolean - - type: 'null' - data_collection: - description: >- - Data collection setting. If no available model provider meets the requirement, your request will - return an error. - - - allow: (default) allow providers which store user data non-transiently and may train on it - - - - deny: use only providers which do not collect user data. - anyOf: - - type: string - enum: - - deny - - allow - - type: 'null' - zdr: - anyOf: - - type: boolean - - type: 'null' - enforce_distillable_text: - anyOf: - - type: boolean - - type: 'null' - order: - description: >- - An ordered list of provider slugs. The router will attempt to use the first provider in the subset - of this list that supports your requested model, and fall back to the next if it is unavailable. If - no providers are available, the request will fail with an error message. - anyOf: - - $ref: '#/components/schemas/__schema0' - - type: 'null' - only: - description: >- - List of provider slugs to allow. If provided, this list is merged with your account-wide allowed - provider settings for this request. - anyOf: - - $ref: '#/components/schemas/__schema0' - - type: 'null' - ignore: - description: >- - List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored - provider settings for this request. - anyOf: - - $ref: '#/components/schemas/__schema0' - - type: 'null' - quantizations: - description: A list of quantization levels to filter the provider by. - anyOf: - - type: array - items: - type: string - enum: - - int4 - - int8 - - fp4 - - fp6 - - fp8 - - fp16 - - bf16 - - fp32 - - unknown - - type: 'null' - sort: - description: >- - The sorting strategy to use for this request, if "order" is not specified. When set, no load - balancing is performed. - anyOf: - - type: string - enum: - - price - - throughput - - latency - - type: 'null' - max_price: - description: >- - The object specifying the maximum price you want to pay for this request. USD price per million - tokens, for prompt and completion. - type: object - properties: - prompt: - $ref: '#/components/schemas/__schema1' - completion: - $ref: '#/components/schemas/__schema1' - image: - $ref: '#/components/schemas/__schema1' - audio: - $ref: '#/components/schemas/__schema1' - request: - $ref: '#/components/schemas/__schema1' - additionalProperties: false - additionalProperties: false - - type: 'null' prompt: anyOf: - type: string @@ -6590,35 +6065,35 @@ paths: example: true order: type: array + nullable: true items: - type: string + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string description: >- An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. - example: - - OpenAI - - Anthropic only: type: array + nullable: true items: - type: string + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string description: >- List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. - example: - - OpenAI - - Anthropic ignore: type: array + nullable: true items: - type: string + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string description: >- List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. - example: - - OpenAI - - Anthropic quantizations: type: array nullable: true @@ -6631,40 +6106,15 @@ paths: type: object properties: prompt: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' completion: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' image: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' audio: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' request: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' additionalProperties: false description: >- The object specifying the maximum price you want to pay for this request. USD price per million diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 93d67d5a..438627b1 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -3457,6 +3457,73 @@ components: - deny: use only providers which do not collect user data. example: allow x-speakeasy-unknown-values: allow + ProviderName: + type: string + enum: + - AI21 + - AionLabs + - Alibaba + - Amazon Bedrock + - Anthropic + - Arcee + - AtlasCloud + - Avian + - Azure + - BaseTen + - Black Forest Labs + - Cerebras + - Chutes + - Cirrascale + - Clarifai + - Cloudflare + - Cohere + - Crusoe + - DeepInfra + - DeepSeek + - Featherless + - Fireworks + - Friendli + - GMICloud + - Google + - Google AI Studio + - Groq + - Hyperbolic + - Inception + - InferenceNet + - Infermatic + - Inflection + - Liquid + - Mancer 2 + - Minimax + - ModelRun + - Mistral + - Modular + - Moonshot AI + - Morph + - NCompass + - Nebius + - NextBit + - Novita + - Nvidia + - OpenAI + - OpenInference + - Parasail + - Perplexity + - Phala + - Relace + - SambaNova + - SiliconFlow + - Stealth + - Switchpoint + - Targon + - Together + - Venice + - WandB + - xAI + - Z.AI + - FakeProvider + example: OpenAI + x-speakeasy-unknown-values: allow Quantization: type: string enum: @@ -3482,6 +3549,14 @@ components: The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. example: price x-speakeasy-unknown-values: allow + BigNumberUnion: + anyOf: + - type: number + - type: string + - type: number + example: 1000 + description: A value in string or number format that is a large number + example: 1000 OpenResponsesRequest: type: object properties: @@ -3627,31 +3702,31 @@ components: example: true order: type: array + nullable: true items: - type: string + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string description: >- An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. - example: - - OpenAI - - Anthropic only: type: array + nullable: true items: - type: string + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string description: >- List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. - example: - - OpenAI - - Anthropic ignore: type: array + nullable: true items: - type: string + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string description: >- List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. - example: - - OpenAI - - Anthropic quantizations: type: array nullable: true @@ -3664,40 +3739,15 @@ components: type: object properties: prompt: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' completion: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' image: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' audio: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' request: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' additionalProperties: false description: >- The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. @@ -3909,89 +3959,29 @@ components: type: object properties: prompt: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' completion: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' request: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' image: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' image_token: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' image_output: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' audio: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' input_audio_cache: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' web_search: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' internal_reasoning: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' input_cache_read: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' input_cache_write: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' discount: type: number required: @@ -4391,73 +4381,6 @@ components: - qwen3 description: Instruction format type x-speakeasy-unknown-values: allow - ProviderName: - type: string - enum: - - AI21 - - AionLabs - - Alibaba - - Amazon Bedrock - - Anthropic - - Arcee - - AtlasCloud - - Avian - - Azure - - BaseTen - - Black Forest Labs - - Cerebras - - Chutes - - Cirrascale - - Clarifai - - Cloudflare - - Cohere - - Crusoe - - DeepInfra - - DeepSeek - - Featherless - - Fireworks - - Friendli - - GMICloud - - Google - - Google AI Studio - - Groq - - Hyperbolic - - Inception - - InferenceNet - - Infermatic - - Inflection - - Liquid - - Mancer 2 - - Minimax - - ModelRun - - Mistral - - Modular - - Moonshot AI - - Morph - - NCompass - - Nebius - - NextBit - - Novita - - Nvidia - - OpenAI - - OpenInference - - Parasail - - Perplexity - - Phala - - Relace - - SambaNova - - SiliconFlow - - Stealth - - Switchpoint - - Targon - - Together - - Venice - - WandB - - xAI - - Z.AI - - FakeProvider - example: OpenAI - x-speakeasy-unknown-values: allow EndpointStatus: type: integer enum: @@ -4482,89 +4405,29 @@ components: type: object properties: prompt: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' completion: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' request: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' image: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' image_token: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' image_output: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' audio: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' input_audio_cache: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' web_search: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' internal_reasoning: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' input_cache_read: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' input_cache_write: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' discount: type: number required: @@ -4700,117 +4563,40 @@ components: description: List of available endpoints for a model example: id: openai/gpt-4 - name: GPT-4 - created: 1692901234 - description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. - architecture: - tokenizer: GPT - instruct_type: chatml - modality: text->text - input_modalities: - - text - output_modalities: - - text - endpoints: - - name: 'OpenAI: GPT-4' - model_name: GPT-4 - context_length: 8192 - pricing: - prompt: '0.00003' - completion: '0.00006' - request: '0' - image: '0' - provider_name: OpenAI - tag: openai - quantization: fp16 - max_completion_tokens: 4096 - max_prompt_tokens: 8192 - supported_parameters: - - temperature - - top_p - - max_tokens - - frequency_penalty - - presence_penalty - status: default - uptime_last_30m: 99.5 - supports_implicit_caching: true - __schema0: - type: array - items: - anyOf: - - type: string - enum: - - AI21 - - AionLabs - - Alibaba - - Amazon Bedrock - - Anthropic - - Arcee - - AtlasCloud - - Avian - - Azure - - BaseTen - - Black Forest Labs - - Cerebras - - Chutes - - Cirrascale - - Clarifai - - Cloudflare - - Cohere - - Crusoe - - DeepInfra - - DeepSeek - - Featherless - - Fireworks - - Friendli - - GMICloud - - Google - - Google AI Studio - - Groq - - Hyperbolic - - Inception - - InferenceNet - - Infermatic - - Inflection - - Liquid - - Mancer 2 - - Minimax - - ModelRun - - Mistral - - Modular - - Moonshot AI - - Morph - - NCompass - - Nebius - - NextBit - - Novita - - Nvidia - - OpenAI - - OpenInference - - Parasail - - Perplexity - - Phala - - Relace - - SambaNova - - SiliconFlow - - Stealth - - Switchpoint - - Targon - - Together - - Venice - - WandB - - xAI - - Z.AI - - FakeProvider - x-speakeasy-unknown-values: allow - - type: string - __schema1: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + name: GPT-4 + created: 1692901234 + description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy. + architecture: + tokenizer: GPT + instruct_type: chatml + modality: text->text + input_modalities: + - text + output_modalities: + - text + endpoints: + - name: 'OpenAI: GPT-4' + model_name: GPT-4 + context_length: 8192 + pricing: + prompt: '0.00003' + completion: '0.00006' + request: '0' + image: '0' + provider_name: OpenAI + tag: openai + quantization: fp16 + max_completion_tokens: 4096 + max_prompt_tokens: 8192 + supported_parameters: + - temperature + - top_p + - max_tokens + - frequency_penalty + - presence_penalty + status: default + uptime_last_30m: 99.5 + supports_implicit_caching: true ModelName: type: string ChatMessageContentItemText: @@ -5045,6 +4831,17 @@ components: - completion_tokens - prompt_tokens - total_tokens + ChatCompletionFinishReason: + anyOf: + - type: string + enum: + - tool_calls + - stop + - length + - content_filter + - error + x-speakeasy-unknown-values: allow + - type: 'null' JSONSchemaConfig: type: object properties: @@ -5252,163 +5049,6 @@ components: ChatGenerationParams: type: object properties: - plugins: - type: array - items: - oneOf: - - type: object - properties: - id: - type: string - const: moderation - required: - - id - - type: object - properties: - id: - type: string - const: web - max_results: - type: number - search_prompt: - type: string - engine: - type: string - enum: - - native - - exa - x-speakeasy-unknown-values: allow - required: - - id - - type: object - properties: - id: - type: string - const: file-parser - max_files: - type: number - pdf: - type: object - properties: - engine: - type: string - enum: - - mistral-ocr - - pdf-text - - native - x-speakeasy-unknown-values: allow - required: - - id - type: object - provider: - anyOf: - - type: object - properties: - allow_fallbacks: - description: > - Whether to allow backup providers to serve requests - - - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. - - - false: use only the primary/custom provider, and return the upstream error if it's unavailable. - - anyOf: - - type: boolean - - type: 'null' - require_parameters: - description: >- - Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. - anyOf: - - type: boolean - - type: 'null' - data_collection: - description: >- - Data collection setting. If no available model provider meets the requirement, your request will return an error. - - - allow: (default) allow providers which store user data non-transiently and may train on it - - - - deny: use only providers which do not collect user data. - anyOf: - - type: string - enum: - - deny - - allow - x-speakeasy-unknown-values: allow - - type: 'null' - zdr: - anyOf: - - type: boolean - - type: 'null' - enforce_distillable_text: - anyOf: - - type: boolean - - type: 'null' - order: - description: >- - An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. - anyOf: - - $ref: '#/components/schemas/__schema0' - - type: 'null' - only: - description: >- - List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. - anyOf: - - $ref: '#/components/schemas/__schema0' - - type: 'null' - ignore: - description: >- - List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. - anyOf: - - $ref: '#/components/schemas/__schema0' - - type: 'null' - quantizations: - description: A list of quantization levels to filter the provider by. - anyOf: - - type: array - items: - type: string - enum: - - int4 - - int8 - - fp4 - - fp6 - - fp8 - - fp16 - - bf16 - - fp32 - - unknown - x-speakeasy-unknown-values: allow - - type: 'null' - sort: - description: >- - The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. - anyOf: - - type: string - enum: - - price - - throughput - - latency - x-speakeasy-unknown-values: allow - - type: 'null' - max_price: - description: >- - The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. - type: object - properties: - prompt: - $ref: '#/components/schemas/__schema1' - completion: - $ref: '#/components/schemas/__schema1' - image: - $ref: '#/components/schemas/__schema1' - audio: - $ref: '#/components/schemas/__schema1' - request: - $ref: '#/components/schemas/__schema1' - additionalProperties: false - additionalProperties: false - - type: 'null' messages: minItems: 1 type: array @@ -5560,7 +5200,7 @@ components: type: object properties: finish_reason: - $ref: '#/components/schemas/__schema0' + $ref: '#/components/schemas/ChatCompletionFinishReason' index: type: number message: @@ -5621,7 +5261,7 @@ components: delta: $ref: '#/components/schemas/ChatStreamingMessageChunk' finish_reason: - $ref: '#/components/schemas/__schema0' + $ref: '#/components/schemas/ChatCompletionFinishReason' index: type: number logprobs: @@ -5797,163 +5437,6 @@ components: type: array items: $ref: '#/components/schemas/ModelName' - plugins: - type: array - items: - oneOf: - - type: object - properties: - id: - type: string - const: moderation - required: - - id - - type: object - properties: - id: - type: string - const: web - max_results: - type: number - search_prompt: - type: string - engine: - type: string - enum: - - native - - exa - x-speakeasy-unknown-values: allow - required: - - id - - type: object - properties: - id: - type: string - const: file-parser - max_files: - type: number - pdf: - type: object - properties: - engine: - type: string - enum: - - mistral-ocr - - pdf-text - - native - x-speakeasy-unknown-values: allow - required: - - id - type: object - provider: - anyOf: - - type: object - properties: - allow_fallbacks: - description: > - Whether to allow backup providers to serve requests - - - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. - - - false: use only the primary/custom provider, and return the upstream error if it's unavailable. - - anyOf: - - type: boolean - - type: 'null' - require_parameters: - description: >- - Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. - anyOf: - - type: boolean - - type: 'null' - data_collection: - description: >- - Data collection setting. If no available model provider meets the requirement, your request will return an error. - - - allow: (default) allow providers which store user data non-transiently and may train on it - - - - deny: use only providers which do not collect user data. - anyOf: - - type: string - enum: - - deny - - allow - x-speakeasy-unknown-values: allow - - type: 'null' - zdr: - anyOf: - - type: boolean - - type: 'null' - enforce_distillable_text: - anyOf: - - type: boolean - - type: 'null' - order: - description: >- - An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. - anyOf: - - $ref: '#/components/schemas/__schema0' - - type: 'null' - only: - description: >- - List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. - anyOf: - - $ref: '#/components/schemas/__schema0' - - type: 'null' - ignore: - description: >- - List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. - anyOf: - - $ref: '#/components/schemas/__schema0' - - type: 'null' - quantizations: - description: A list of quantization levels to filter the provider by. - anyOf: - - type: array - items: - type: string - enum: - - int4 - - int8 - - fp4 - - fp6 - - fp8 - - fp16 - - bf16 - - fp32 - - unknown - x-speakeasy-unknown-values: allow - - type: 'null' - sort: - description: >- - The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. - anyOf: - - type: string - enum: - - price - - throughput - - latency - x-speakeasy-unknown-values: allow - - type: 'null' - max_price: - description: >- - The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. - type: object - properties: - prompt: - $ref: '#/components/schemas/__schema1' - completion: - $ref: '#/components/schemas/__schema1' - image: - $ref: '#/components/schemas/__schema1' - audio: - $ref: '#/components/schemas/__schema1' - request: - $ref: '#/components/schemas/__schema1' - additionalProperties: false - additionalProperties: false - - type: 'null' prompt: anyOf: - type: string @@ -6603,31 +6086,31 @@ paths: example: true order: type: array + nullable: true items: - type: string + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string description: >- An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. - example: - - OpenAI - - Anthropic only: type: array + nullable: true items: - type: string + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string description: >- List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. - example: - - OpenAI - - Anthropic ignore: type: array + nullable: true items: - type: string + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string description: >- List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. - example: - - OpenAI - - Anthropic quantizations: type: array nullable: true @@ -6640,40 +6123,15 @@ paths: type: object properties: prompt: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' completion: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' image: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' audio: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' request: - anyOf: - - type: number - - type: string - - type: number - description: A value in string or number format that is a large number - example: 1000 + $ref: '#/components/schemas/BigNumberUnion' additionalProperties: false description: >- The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 6b025ad0..11d30cc3 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.658.2 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:d5e646fa1ab83c0de6aee470767c6da299dedfd6a046af541d2dfe1a525d40fc - sourceBlobDigest: sha256:bec13842f0ec9fa68088c85ce94481a48d27f1aa8e778af57819856e0ccc4679 + sourceRevisionDigest: sha256:fc0c90dc8ebb69ef4a571e4e63dcd7f8f33c3254c17ad2583b628fbbf3d1ac05 + sourceBlobDigest: sha256:635d63fd18db468c1dcc23700382af788de76594ba3b8292fae9b14c0e5c22c4 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:d5e646fa1ab83c0de6aee470767c6da299dedfd6a046af541d2dfe1a525d40fc - sourceBlobDigest: sha256:bec13842f0ec9fa68088c85ce94481a48d27f1aa8e778af57819856e0ccc4679 + sourceRevisionDigest: sha256:fc0c90dc8ebb69ef4a571e4e63dcd7f8f33c3254c17ad2583b628fbbf3d1ac05 + sourceBlobDigest: sha256:635d63fd18db468c1dcc23700382af788de76594ba3b8292fae9b14c0e5c22c4 codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:e039767b6d5864ba682401614405cad3b78e5ff1374a9c696ad835a795695470 + codeSamplesRevisionDigest: sha256:bc8ca65272c07cd10a6fa41d591e264cc50d05d154c91c00678028f2977ff124 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/docs/models/chatcompletionfinishreason.md b/docs/models/chatcompletionfinishreason.md new file mode 100644 index 00000000..b1301308 --- /dev/null +++ b/docs/models/chatcompletionfinishreason.md @@ -0,0 +1,17 @@ +# ChatCompletionFinishReason + +## Example Usage + +```typescript +import { ChatCompletionFinishReason } from "@openrouter/sdk/models"; + +let value: ChatCompletionFinishReason = "error"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"tool_calls" | "stop" | "length" | "content_filter" | "error" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/chatgenerationparams.md b/docs/models/chatgenerationparams.md index dbc037cf..c5ec4b35 100644 --- a/docs/models/chatgenerationparams.md +++ b/docs/models/chatgenerationparams.md @@ -17,29 +17,27 @@ let value: ChatGenerationParams = { ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `plugins` | *models.ChatGenerationParamsPluginUnion*[] | :heavy_minus_sign: | N/A | -| `provider` | [models.ChatGenerationParamsProvider](../models/chatgenerationparamsprovider.md) | :heavy_minus_sign: | N/A | -| `messages` | *models.Message*[] | :heavy_check_mark: | N/A | -| `model` | *string* | :heavy_minus_sign: | N/A | -| `models` | *string*[] | :heavy_minus_sign: | N/A | -| `frequencyPenalty` | *number* | :heavy_minus_sign: | N/A | -| `logitBias` | Record | :heavy_minus_sign: | N/A | -| `logprobs` | *boolean* | :heavy_minus_sign: | N/A | -| `topLogprobs` | *number* | :heavy_minus_sign: | N/A | -| `maxCompletionTokens` | *number* | :heavy_minus_sign: | N/A | -| `maxTokens` | *number* | :heavy_minus_sign: | N/A | -| `metadata` | Record | :heavy_minus_sign: | N/A | -| `presencePenalty` | *number* | :heavy_minus_sign: | N/A | -| `reasoning` | [models.Reasoning](../models/reasoning.md) | :heavy_minus_sign: | N/A | -| `responseFormat` | *models.ChatGenerationParamsResponseFormatUnion* | :heavy_minus_sign: | N/A | -| `seed` | *number* | :heavy_minus_sign: | N/A | -| `stop` | *models.ChatGenerationParamsStop* | :heavy_minus_sign: | N/A | -| `stream` | *boolean* | :heavy_minus_sign: | N/A | -| `streamOptions` | [models.ChatStreamOptions](../models/chatstreamoptions.md) | :heavy_minus_sign: | N/A | -| `temperature` | *number* | :heavy_minus_sign: | N/A | -| `toolChoice` | *any* | :heavy_minus_sign: | N/A | -| `tools` | [models.ToolDefinitionJson](../models/tooldefinitionjson.md)[] | :heavy_minus_sign: | N/A | -| `topP` | *number* | :heavy_minus_sign: | N/A | -| `user` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `messages` | *models.Message*[] | :heavy_check_mark: | N/A | +| `model` | *string* | :heavy_minus_sign: | N/A | +| `models` | *string*[] | :heavy_minus_sign: | N/A | +| `frequencyPenalty` | *number* | :heavy_minus_sign: | N/A | +| `logitBias` | Record | :heavy_minus_sign: | N/A | +| `logprobs` | *boolean* | :heavy_minus_sign: | N/A | +| `topLogprobs` | *number* | :heavy_minus_sign: | N/A | +| `maxCompletionTokens` | *number* | :heavy_minus_sign: | N/A | +| `maxTokens` | *number* | :heavy_minus_sign: | N/A | +| `metadata` | Record | :heavy_minus_sign: | N/A | +| `presencePenalty` | *number* | :heavy_minus_sign: | N/A | +| `reasoning` | [models.Reasoning](../models/reasoning.md) | :heavy_minus_sign: | N/A | +| `responseFormat` | *models.ChatGenerationParamsResponseFormatUnion* | :heavy_minus_sign: | N/A | +| `seed` | *number* | :heavy_minus_sign: | N/A | +| `stop` | *models.ChatGenerationParamsStop* | :heavy_minus_sign: | N/A | +| `stream` | *boolean* | :heavy_minus_sign: | N/A | +| `streamOptions` | [models.ChatStreamOptions](../models/chatstreamoptions.md) | :heavy_minus_sign: | N/A | +| `temperature` | *number* | :heavy_minus_sign: | N/A | +| `toolChoice` | *any* | :heavy_minus_sign: | N/A | +| `tools` | [models.ToolDefinitionJson](../models/tooldefinitionjson.md)[] | :heavy_minus_sign: | N/A | +| `topP` | *number* | :heavy_minus_sign: | N/A | +| `user` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/chatgenerationparamsdatacollection.md b/docs/models/chatgenerationparamsdatacollection.md deleted file mode 100644 index 3718bbe5..00000000 --- a/docs/models/chatgenerationparamsdatacollection.md +++ /dev/null @@ -1,17 +0,0 @@ -# ChatGenerationParamsDataCollection - -## Example Usage - -```typescript -import { ChatGenerationParamsDataCollection } from "@openrouter/sdk/models"; - -let value: ChatGenerationParamsDataCollection = "allow"; -``` - -## Values - -This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. - -```typescript -"deny" | "allow" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/chatgenerationparamsengine.md b/docs/models/chatgenerationparamsengine.md deleted file mode 100644 index 10ac475c..00000000 --- a/docs/models/chatgenerationparamsengine.md +++ /dev/null @@ -1,17 +0,0 @@ -# ChatGenerationParamsEngine - -## Example Usage - -```typescript -import { ChatGenerationParamsEngine } from "@openrouter/sdk/models"; - -let value: ChatGenerationParamsEngine = "native"; -``` - -## Values - -This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. - -```typescript -"native" | "exa" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/chatgenerationparamsmaxprice.md b/docs/models/chatgenerationparamsmaxprice.md deleted file mode 100644 index 48f41213..00000000 --- a/docs/models/chatgenerationparamsmaxprice.md +++ /dev/null @@ -1,21 +0,0 @@ -# ChatGenerationParamsMaxPrice - -The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. - -## Example Usage - -```typescript -import { ChatGenerationParamsMaxPrice } from "@openrouter/sdk/models"; - -let value: ChatGenerationParamsMaxPrice = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `prompt` | *any* | :heavy_minus_sign: | N/A | -| `completion` | *any* | :heavy_minus_sign: | N/A | -| `image` | *any* | :heavy_minus_sign: | N/A | -| `audio` | *any* | :heavy_minus_sign: | N/A | -| `request` | *any* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/chatgenerationparamspdf.md b/docs/models/chatgenerationparamspdf.md deleted file mode 100644 index 99e71e2e..00000000 --- a/docs/models/chatgenerationparamspdf.md +++ /dev/null @@ -1,15 +0,0 @@ -# ChatGenerationParamsPdf - -## Example Usage - -```typescript -import { ChatGenerationParamsPdf } from "@openrouter/sdk/models"; - -let value: ChatGenerationParamsPdf = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `engine` | [models.ChatGenerationParamsPdfEngine](../models/chatgenerationparamspdfengine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/chatgenerationparamspdfengine.md b/docs/models/chatgenerationparamspdfengine.md deleted file mode 100644 index 75faf193..00000000 --- a/docs/models/chatgenerationparamspdfengine.md +++ /dev/null @@ -1,17 +0,0 @@ -# ChatGenerationParamsPdfEngine - -## Example Usage - -```typescript -import { ChatGenerationParamsPdfEngine } from "@openrouter/sdk/models"; - -let value: ChatGenerationParamsPdfEngine = "mistral-ocr"; -``` - -## Values - -This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. - -```typescript -"mistral-ocr" | "pdf-text" | "native" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/chatgenerationparamspluginfileparser.md b/docs/models/chatgenerationparamspluginfileparser.md deleted file mode 100644 index 8b4bf7ee..00000000 --- a/docs/models/chatgenerationparamspluginfileparser.md +++ /dev/null @@ -1,19 +0,0 @@ -# ChatGenerationParamsPluginFileParser - -## Example Usage - -```typescript -import { ChatGenerationParamsPluginFileParser } from "@openrouter/sdk/models"; - -let value: ChatGenerationParamsPluginFileParser = { - id: "file-parser", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | N/A | -| `maxFiles` | *number* | :heavy_minus_sign: | N/A | -| `pdf` | [models.ChatGenerationParamsPdf](../models/chatgenerationparamspdf.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/chatgenerationparamspluginmoderation.md b/docs/models/chatgenerationparamspluginmoderation.md deleted file mode 100644 index 2ad767f2..00000000 --- a/docs/models/chatgenerationparamspluginmoderation.md +++ /dev/null @@ -1,17 +0,0 @@ -# ChatGenerationParamsPluginModeration - -## Example Usage - -```typescript -import { ChatGenerationParamsPluginModeration } from "@openrouter/sdk/models"; - -let value: ChatGenerationParamsPluginModeration = { - id: "moderation", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `id` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/chatgenerationparamspluginunion.md b/docs/models/chatgenerationparamspluginunion.md deleted file mode 100644 index 2791d6a5..00000000 --- a/docs/models/chatgenerationparamspluginunion.md +++ /dev/null @@ -1,29 +0,0 @@ -# ChatGenerationParamsPluginUnion - - -## Supported Types - -### `models.ChatGenerationParamsPluginModeration` - -```typescript -const value: models.ChatGenerationParamsPluginModeration = { - id: "moderation", -}; -``` - -### `models.ChatGenerationParamsPluginWeb` - -```typescript -const value: models.ChatGenerationParamsPluginWeb = { - id: "web", -}; -``` - -### `models.ChatGenerationParamsPluginFileParser` - -```typescript -const value: models.ChatGenerationParamsPluginFileParser = { - id: "file-parser", -}; -``` - diff --git a/docs/models/chatgenerationparamspluginweb.md b/docs/models/chatgenerationparamspluginweb.md deleted file mode 100644 index e9f1f457..00000000 --- a/docs/models/chatgenerationparamspluginweb.md +++ /dev/null @@ -1,20 +0,0 @@ -# ChatGenerationParamsPluginWeb - -## Example Usage - -```typescript -import { ChatGenerationParamsPluginWeb } from "@openrouter/sdk/models"; - -let value: ChatGenerationParamsPluginWeb = { - id: "web", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | N/A | -| `maxResults` | *number* | :heavy_minus_sign: | N/A | -| `searchPrompt` | *string* | :heavy_minus_sign: | N/A | -| `engine` | [models.ChatGenerationParamsEngine](../models/chatgenerationparamsengine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/chatgenerationparamsprovider.md b/docs/models/chatgenerationparamsprovider.md deleted file mode 100644 index 67174fb3..00000000 --- a/docs/models/chatgenerationparamsprovider.md +++ /dev/null @@ -1,25 +0,0 @@ -# ChatGenerationParamsProvider - -## Example Usage - -```typescript -import { ChatGenerationParamsProvider } from "@openrouter/sdk/models"; - -let value: ChatGenerationParamsProvider = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `allowFallbacks` | *boolean* | :heavy_minus_sign: | Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
| -| `requireParameters` | *boolean* | :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. | -| `dataCollection` | [models.ChatGenerationParamsDataCollection](../models/chatgenerationparamsdatacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it

- deny: use only providers which do not collect user data. | -| `zdr` | *boolean* | :heavy_minus_sign: | N/A | -| `enforceDistillableText` | *boolean* | :heavy_minus_sign: | N/A | -| `order` | *models.Schema0*[] | :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` | *models.Schema0*[] | :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` | *models.Schema0*[] | :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` | [models.ChatGenerationParamsQuantizations](../models/chatgenerationparamsquantizations.md)[] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | -| `sort` | [models.ChatGenerationParamsSort](../models/chatgenerationparamssort.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | -| `maxPrice` | [models.ChatGenerationParamsMaxPrice](../models/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. | \ No newline at end of file diff --git a/docs/models/chatgenerationparamsquantizations.md b/docs/models/chatgenerationparamsquantizations.md deleted file mode 100644 index b23324b2..00000000 --- a/docs/models/chatgenerationparamsquantizations.md +++ /dev/null @@ -1,17 +0,0 @@ -# ChatGenerationParamsQuantizations - -## Example Usage - -```typescript -import { ChatGenerationParamsQuantizations } from "@openrouter/sdk/models"; - -let value: ChatGenerationParamsQuantizations = "fp6"; -``` - -## Values - -This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. - -```typescript -"int4" | "int8" | "fp4" | "fp6" | "fp8" | "fp16" | "bf16" | "fp32" | "unknown" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/chatgenerationparamssort.md b/docs/models/chatgenerationparamssort.md deleted file mode 100644 index db470b0e..00000000 --- a/docs/models/chatgenerationparamssort.md +++ /dev/null @@ -1,17 +0,0 @@ -# ChatGenerationParamsSort - -## Example Usage - -```typescript -import { ChatGenerationParamsSort } from "@openrouter/sdk/models"; - -let value: ChatGenerationParamsSort = "throughput"; -``` - -## Values - -This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. - -```typescript -"price" | "throughput" | "latency" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/chatresponsechoice.md b/docs/models/chatresponsechoice.md index d86e9fe7..58451f44 100644 --- a/docs/models/chatresponsechoice.md +++ b/docs/models/chatresponsechoice.md @@ -6,8 +6,8 @@ import { ChatResponseChoice } from "@openrouter/sdk/models"; let value: ChatResponseChoice = { - finishReason: [], - index: 3961.54, + finishReason: "stop", + index: 2823.76, message: { role: "assistant", }, @@ -16,9 +16,9 @@ let value: ChatResponseChoice = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | -| `finishReason` | *models.Schema0*[] | :heavy_check_mark: | N/A | -| `index` | *number* | :heavy_check_mark: | N/A | -| `message` | [models.AssistantMessage](../models/assistantmessage.md) | :heavy_check_mark: | N/A | -| `logprobs` | [models.ChatMessageTokenLogprobs](../models/chatmessagetokenlogprobs.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `finishReason` | [models.ChatCompletionFinishReason](../models/chatcompletionfinishreason.md) | :heavy_check_mark: | N/A | +| `index` | *number* | :heavy_check_mark: | N/A | +| `message` | [models.AssistantMessage](../models/assistantmessage.md) | :heavy_check_mark: | N/A | +| `logprobs` | [models.ChatMessageTokenLogprobs](../models/chatmessagetokenlogprobs.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/chatstreamingchoice.md b/docs/models/chatstreamingchoice.md index a6ade6f6..8751bd5a 100644 --- a/docs/models/chatstreamingchoice.md +++ b/docs/models/chatstreamingchoice.md @@ -7,18 +7,16 @@ import { ChatStreamingChoice } from "@openrouter/sdk/models"; let value: ChatStreamingChoice = { delta: {}, - finishReason: [ - "", - ], + finishReason: "error", index: 3511.86, }; ``` ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `delta` | [models.ChatStreamingMessageChunk](../models/chatstreamingmessagechunk.md) | :heavy_check_mark: | N/A | -| `finishReason` | *models.Schema0*[] | :heavy_check_mark: | N/A | -| `index` | *number* | :heavy_check_mark: | N/A | -| `logprobs` | [models.ChatMessageTokenLogprobs](../models/chatmessagetokenlogprobs.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `delta` | [models.ChatStreamingMessageChunk](../models/chatstreamingmessagechunk.md) | :heavy_check_mark: | N/A | +| `finishReason` | [models.ChatCompletionFinishReason](../models/chatcompletionfinishreason.md) | :heavy_check_mark: | N/A | +| `index` | *number* | :heavy_check_mark: | N/A | +| `logprobs` | [models.ChatMessageTokenLogprobs](../models/chatmessagetokenlogprobs.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/chatstreamingresponsechunk.md b/docs/models/chatstreamingresponsechunk.md index 5a167d15..21f49bbb 100644 --- a/docs/models/chatstreamingresponsechunk.md +++ b/docs/models/chatstreamingresponsechunk.md @@ -11,9 +11,7 @@ let value: ChatStreamingResponseChunk = { choices: [ { delta: {}, - finishReason: [ - "", - ], + finishReason: "error", index: 3793.72, }, ], diff --git a/docs/models/completioncreateparams.md b/docs/models/completioncreateparams.md index 84dd1ed8..e0cc9880 100644 --- a/docs/models/completioncreateparams.md +++ b/docs/models/completioncreateparams.md @@ -12,28 +12,26 @@ let value: CompletionCreateParams = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `model` | *string* | :heavy_minus_sign: | N/A | -| `models` | *string*[] | :heavy_minus_sign: | N/A | -| `plugins` | *models.CompletionCreateParamsPluginUnion*[] | :heavy_minus_sign: | N/A | -| `provider` | [models.CompletionCreateParamsProvider](../models/completioncreateparamsprovider.md) | :heavy_minus_sign: | N/A | -| `prompt` | *models.Prompt* | :heavy_check_mark: | N/A | -| `bestOf` | *number* | :heavy_minus_sign: | N/A | -| `echo` | *boolean* | :heavy_minus_sign: | N/A | -| `frequencyPenalty` | *number* | :heavy_minus_sign: | N/A | -| `logitBias` | Record | :heavy_minus_sign: | N/A | -| `logprobs` | *number* | :heavy_minus_sign: | N/A | -| `maxTokens` | *number* | :heavy_minus_sign: | N/A | -| `n` | *number* | :heavy_minus_sign: | N/A | -| `presencePenalty` | *number* | :heavy_minus_sign: | N/A | -| `seed` | *number* | :heavy_minus_sign: | N/A | -| `stop` | *models.CompletionCreateParamsStop* | :heavy_minus_sign: | N/A | -| `stream` | *boolean* | :heavy_minus_sign: | N/A | -| `streamOptions` | [models.StreamOptions](../models/streamoptions.md) | :heavy_minus_sign: | N/A | -| `suffix` | *string* | :heavy_minus_sign: | N/A | -| `temperature` | *number* | :heavy_minus_sign: | N/A | -| `topP` | *number* | :heavy_minus_sign: | N/A | -| `user` | *string* | :heavy_minus_sign: | N/A | -| `metadata` | Record | :heavy_minus_sign: | N/A | -| `responseFormat` | *models.CompletionCreateParamsResponseFormatUnion* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `model` | *string* | :heavy_minus_sign: | N/A | +| `models` | *string*[] | :heavy_minus_sign: | N/A | +| `prompt` | *models.Prompt* | :heavy_check_mark: | N/A | +| `bestOf` | *number* | :heavy_minus_sign: | N/A | +| `echo` | *boolean* | :heavy_minus_sign: | N/A | +| `frequencyPenalty` | *number* | :heavy_minus_sign: | N/A | +| `logitBias` | Record | :heavy_minus_sign: | N/A | +| `logprobs` | *number* | :heavy_minus_sign: | N/A | +| `maxTokens` | *number* | :heavy_minus_sign: | N/A | +| `n` | *number* | :heavy_minus_sign: | N/A | +| `presencePenalty` | *number* | :heavy_minus_sign: | N/A | +| `seed` | *number* | :heavy_minus_sign: | N/A | +| `stop` | *models.CompletionCreateParamsStop* | :heavy_minus_sign: | N/A | +| `stream` | *boolean* | :heavy_minus_sign: | N/A | +| `streamOptions` | [models.StreamOptions](../models/streamoptions.md) | :heavy_minus_sign: | N/A | +| `suffix` | *string* | :heavy_minus_sign: | N/A | +| `temperature` | *number* | :heavy_minus_sign: | N/A | +| `topP` | *number* | :heavy_minus_sign: | N/A | +| `user` | *string* | :heavy_minus_sign: | N/A | +| `metadata` | Record | :heavy_minus_sign: | N/A | +| `responseFormat` | *models.CompletionCreateParamsResponseFormatUnion* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/completioncreateparamsdatacollection.md b/docs/models/completioncreateparamsdatacollection.md deleted file mode 100644 index 7bf196a8..00000000 --- a/docs/models/completioncreateparamsdatacollection.md +++ /dev/null @@ -1,17 +0,0 @@ -# CompletionCreateParamsDataCollection - -## Example Usage - -```typescript -import { CompletionCreateParamsDataCollection } from "@openrouter/sdk/models"; - -let value: CompletionCreateParamsDataCollection = "allow"; -``` - -## Values - -This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. - -```typescript -"deny" | "allow" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/completioncreateparamsengine.md b/docs/models/completioncreateparamsengine.md deleted file mode 100644 index c6fa7d3d..00000000 --- a/docs/models/completioncreateparamsengine.md +++ /dev/null @@ -1,17 +0,0 @@ -# CompletionCreateParamsEngine - -## Example Usage - -```typescript -import { CompletionCreateParamsEngine } from "@openrouter/sdk/models"; - -let value: CompletionCreateParamsEngine = "native"; -``` - -## Values - -This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. - -```typescript -"native" | "exa" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/completioncreateparamsmaxprice.md b/docs/models/completioncreateparamsmaxprice.md deleted file mode 100644 index 92ec17c4..00000000 --- a/docs/models/completioncreateparamsmaxprice.md +++ /dev/null @@ -1,21 +0,0 @@ -# CompletionCreateParamsMaxPrice - -The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. - -## Example Usage - -```typescript -import { CompletionCreateParamsMaxPrice } from "@openrouter/sdk/models"; - -let value: CompletionCreateParamsMaxPrice = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `prompt` | *any* | :heavy_minus_sign: | N/A | -| `completion` | *any* | :heavy_minus_sign: | N/A | -| `image` | *any* | :heavy_minus_sign: | N/A | -| `audio` | *any* | :heavy_minus_sign: | N/A | -| `request` | *any* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/completioncreateparamspdf.md b/docs/models/completioncreateparamspdf.md deleted file mode 100644 index d6351226..00000000 --- a/docs/models/completioncreateparamspdf.md +++ /dev/null @@ -1,15 +0,0 @@ -# CompletionCreateParamsPdf - -## Example Usage - -```typescript -import { CompletionCreateParamsPdf } from "@openrouter/sdk/models"; - -let value: CompletionCreateParamsPdf = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `engine` | [models.CompletionCreateParamsPdfEngine](../models/completioncreateparamspdfengine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/completioncreateparamspdfengine.md b/docs/models/completioncreateparamspdfengine.md deleted file mode 100644 index b769ec13..00000000 --- a/docs/models/completioncreateparamspdfengine.md +++ /dev/null @@ -1,17 +0,0 @@ -# CompletionCreateParamsPdfEngine - -## Example Usage - -```typescript -import { CompletionCreateParamsPdfEngine } from "@openrouter/sdk/models"; - -let value: CompletionCreateParamsPdfEngine = "mistral-ocr"; -``` - -## Values - -This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. - -```typescript -"mistral-ocr" | "pdf-text" | "native" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/completioncreateparamspluginfileparser.md b/docs/models/completioncreateparamspluginfileparser.md deleted file mode 100644 index b72c8dde..00000000 --- a/docs/models/completioncreateparamspluginfileparser.md +++ /dev/null @@ -1,19 +0,0 @@ -# CompletionCreateParamsPluginFileParser - -## Example Usage - -```typescript -import { CompletionCreateParamsPluginFileParser } from "@openrouter/sdk/models"; - -let value: CompletionCreateParamsPluginFileParser = { - id: "file-parser", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | N/A | -| `maxFiles` | *number* | :heavy_minus_sign: | N/A | -| `pdf` | [models.CompletionCreateParamsPdf](../models/completioncreateparamspdf.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/completioncreateparamspluginmoderation.md b/docs/models/completioncreateparamspluginmoderation.md deleted file mode 100644 index 4129d8a7..00000000 --- a/docs/models/completioncreateparamspluginmoderation.md +++ /dev/null @@ -1,17 +0,0 @@ -# CompletionCreateParamsPluginModeration - -## Example Usage - -```typescript -import { CompletionCreateParamsPluginModeration } from "@openrouter/sdk/models"; - -let value: CompletionCreateParamsPluginModeration = { - id: "moderation", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `id` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/completioncreateparamspluginunion.md b/docs/models/completioncreateparamspluginunion.md deleted file mode 100644 index 65af590e..00000000 --- a/docs/models/completioncreateparamspluginunion.md +++ /dev/null @@ -1,29 +0,0 @@ -# CompletionCreateParamsPluginUnion - - -## Supported Types - -### `models.CompletionCreateParamsPluginModeration` - -```typescript -const value: models.CompletionCreateParamsPluginModeration = { - id: "moderation", -}; -``` - -### `models.CompletionCreateParamsPluginWeb` - -```typescript -const value: models.CompletionCreateParamsPluginWeb = { - id: "web", -}; -``` - -### `models.CompletionCreateParamsPluginFileParser` - -```typescript -const value: models.CompletionCreateParamsPluginFileParser = { - id: "file-parser", -}; -``` - diff --git a/docs/models/completioncreateparamspluginweb.md b/docs/models/completioncreateparamspluginweb.md deleted file mode 100644 index 14f70fcf..00000000 --- a/docs/models/completioncreateparamspluginweb.md +++ /dev/null @@ -1,20 +0,0 @@ -# CompletionCreateParamsPluginWeb - -## Example Usage - -```typescript -import { CompletionCreateParamsPluginWeb } from "@openrouter/sdk/models"; - -let value: CompletionCreateParamsPluginWeb = { - id: "web", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | N/A | -| `maxResults` | *number* | :heavy_minus_sign: | N/A | -| `searchPrompt` | *string* | :heavy_minus_sign: | N/A | -| `engine` | [models.CompletionCreateParamsEngine](../models/completioncreateparamsengine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/completioncreateparamsprovider.md b/docs/models/completioncreateparamsprovider.md deleted file mode 100644 index 1b7def40..00000000 --- a/docs/models/completioncreateparamsprovider.md +++ /dev/null @@ -1,25 +0,0 @@ -# CompletionCreateParamsProvider - -## Example Usage - -```typescript -import { CompletionCreateParamsProvider } from "@openrouter/sdk/models"; - -let value: CompletionCreateParamsProvider = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `allowFallbacks` | *boolean* | :heavy_minus_sign: | Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
| -| `requireParameters` | *boolean* | :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. | -| `dataCollection` | [models.CompletionCreateParamsDataCollection](../models/completioncreateparamsdatacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it

- deny: use only providers which do not collect user data. | -| `zdr` | *boolean* | :heavy_minus_sign: | N/A | -| `enforceDistillableText` | *boolean* | :heavy_minus_sign: | N/A | -| `order` | *models.Schema0*[] | :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` | *models.Schema0*[] | :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` | *models.Schema0*[] | :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` | [models.CompletionCreateParamsQuantizations](../models/completioncreateparamsquantizations.md)[] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | -| `sort` | [models.CompletionCreateParamsSort](../models/completioncreateparamssort.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | -| `maxPrice` | [models.CompletionCreateParamsMaxPrice](../models/completioncreateparamsmaxprice.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. | \ No newline at end of file diff --git a/docs/models/completioncreateparamsquantizations.md b/docs/models/completioncreateparamsquantizations.md deleted file mode 100644 index aedeb309..00000000 --- a/docs/models/completioncreateparamsquantizations.md +++ /dev/null @@ -1,17 +0,0 @@ -# CompletionCreateParamsQuantizations - -## Example Usage - -```typescript -import { CompletionCreateParamsQuantizations } from "@openrouter/sdk/models"; - -let value: CompletionCreateParamsQuantizations = "unknown"; -``` - -## Values - -This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. - -```typescript -"int4" | "int8" | "fp4" | "fp6" | "fp8" | "fp16" | "bf16" | "fp32" | "unknown" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/completioncreateparamssort.md b/docs/models/completioncreateparamssort.md deleted file mode 100644 index e9f3d189..00000000 --- a/docs/models/completioncreateparamssort.md +++ /dev/null @@ -1,17 +0,0 @@ -# CompletionCreateParamsSort - -## Example Usage - -```typescript -import { CompletionCreateParamsSort } from "@openrouter/sdk/models"; - -let value: CompletionCreateParamsSort = "throughput"; -``` - -## Values - -This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. - -```typescript -"price" | "throughput" | "latency" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/openresponsesrequestengine.md b/docs/models/engine.md similarity index 58% rename from docs/models/openresponsesrequestengine.md rename to docs/models/engine.md index 7e49a7e0..0c80b2fb 100644 --- a/docs/models/openresponsesrequestengine.md +++ b/docs/models/engine.md @@ -1,11 +1,11 @@ -# OpenResponsesRequestEngine +# Engine ## Example Usage ```typescript -import { OpenResponsesRequestEngine } from "@openrouter/sdk/models"; +import { Engine } from "@openrouter/sdk/models"; -let value: OpenResponsesRequestEngine = "native"; +let value: Engine = "exa"; ``` ## Values diff --git a/docs/models/schema0.md b/docs/models/ignore.md similarity index 57% rename from docs/models/schema0.md rename to docs/models/ignore.md index c6058f73..de9c31d0 100644 --- a/docs/models/schema0.md +++ b/docs/models/ignore.md @@ -1,12 +1,12 @@ -# Schema0 +# Ignore ## Supported Types -### `models.Schema0Enum` +### `models.ProviderName` ```typescript -const value: models.Schema0Enum = "Alibaba"; +const value: models.ProviderName = "OpenAI"; ``` ### `string` diff --git a/docs/models/maxprice.md b/docs/models/maxprice.md new file mode 100644 index 00000000..d2308276 --- /dev/null +++ b/docs/models/maxprice.md @@ -0,0 +1,21 @@ +# MaxPrice + +The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + +## Example Usage + +```typescript +import { MaxPrice } from "@openrouter/sdk/models"; + +let value: MaxPrice = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `prompt` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `completion` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `image` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `audio` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `request` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | \ No newline at end of file diff --git a/docs/models/only.md b/docs/models/only.md new file mode 100644 index 00000000..c4202205 --- /dev/null +++ b/docs/models/only.md @@ -0,0 +1,17 @@ +# Only + + +## Supported Types + +### `models.ProviderName` + +```typescript +const value: models.ProviderName = "OpenAI"; +``` + +### `string` + +```typescript +const value: string = ""; +``` + diff --git a/docs/models/openresponsesrequest.md b/docs/models/openresponsesrequest.md index a0bf208d..08bafb3e 100644 --- a/docs/models/openresponsesrequest.md +++ b/docs/models/openresponsesrequest.md @@ -38,6 +38,6 @@ let value: OpenResponsesRequest = {}; | `serviceTier` | [models.ServiceTier](../models/servicetier.md) | :heavy_minus_sign: | N/A | auto | | `truncation` | [models.Truncation](../models/truncation.md) | :heavy_minus_sign: | N/A | auto | | `stream` | *boolean* | :heavy_minus_sign: | N/A | | -| `provider` | [models.OpenResponsesRequestProvider](../models/openresponsesrequestprovider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | | -| `plugins` | *models.OpenResponsesRequestPluginUnion*[] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | | +| `provider` | [models.Provider](../models/provider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | | +| `plugins` | *models.Plugin*[] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | | | `user` | *string* | :heavy_minus_sign: | A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. | | \ No newline at end of file diff --git a/docs/models/openresponsesrequestmaxprice.md b/docs/models/openresponsesrequestmaxprice.md deleted file mode 100644 index f327cea1..00000000 --- a/docs/models/openresponsesrequestmaxprice.md +++ /dev/null @@ -1,21 +0,0 @@ -# OpenResponsesRequestMaxPrice - -The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. - -## Example Usage - -```typescript -import { OpenResponsesRequestMaxPrice } from "@openrouter/sdk/models"; - -let value: OpenResponsesRequestMaxPrice = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `prompt` | *any* | :heavy_minus_sign: | N/A | -| `completion` | *any* | :heavy_minus_sign: | N/A | -| `image` | *any* | :heavy_minus_sign: | N/A | -| `audio` | *any* | :heavy_minus_sign: | N/A | -| `request` | *any* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/openresponsesrequestpdf.md b/docs/models/openresponsesrequestpdf.md deleted file mode 100644 index cb33cc0e..00000000 --- a/docs/models/openresponsesrequestpdf.md +++ /dev/null @@ -1,15 +0,0 @@ -# OpenResponsesRequestPdf - -## Example Usage - -```typescript -import { OpenResponsesRequestPdf } from "@openrouter/sdk/models"; - -let value: OpenResponsesRequestPdf = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `engine` | [models.OpenResponsesRequestPdfEngine](../models/openresponsesrequestpdfengine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/openresponsesrequestpluginfileparser.md b/docs/models/openresponsesrequestpluginfileparser.md deleted file mode 100644 index 93beea9f..00000000 --- a/docs/models/openresponsesrequestpluginfileparser.md +++ /dev/null @@ -1,19 +0,0 @@ -# OpenResponsesRequestPluginFileParser - -## Example Usage - -```typescript -import { OpenResponsesRequestPluginFileParser } from "@openrouter/sdk/models"; - -let value: OpenResponsesRequestPluginFileParser = { - id: "file-parser", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `id` | [models.IdFileParser](../models/idfileparser.md) | :heavy_check_mark: | N/A | -| `maxFiles` | *number* | :heavy_minus_sign: | N/A | -| `pdf` | [models.OpenResponsesRequestPdf](../models/openresponsesrequestpdf.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/openresponsesrequestpluginunion.md b/docs/models/openresponsesrequestpluginunion.md deleted file mode 100644 index 4ce3ce65..00000000 --- a/docs/models/openresponsesrequestpluginunion.md +++ /dev/null @@ -1,29 +0,0 @@ -# OpenResponsesRequestPluginUnion - - -## Supported Types - -### `models.OpenResponsesRequestPluginModeration` - -```typescript -const value: models.OpenResponsesRequestPluginModeration = { - id: "moderation", -}; -``` - -### `models.OpenResponsesRequestPluginWeb` - -```typescript -const value: models.OpenResponsesRequestPluginWeb = { - id: "web", -}; -``` - -### `models.OpenResponsesRequestPluginFileParser` - -```typescript -const value: models.OpenResponsesRequestPluginFileParser = { - id: "file-parser", -}; -``` - diff --git a/docs/models/openresponsesrequestpluginweb.md b/docs/models/openresponsesrequestpluginweb.md deleted file mode 100644 index fb2a92cc..00000000 --- a/docs/models/openresponsesrequestpluginweb.md +++ /dev/null @@ -1,20 +0,0 @@ -# OpenResponsesRequestPluginWeb - -## Example Usage - -```typescript -import { OpenResponsesRequestPluginWeb } from "@openrouter/sdk/models"; - -let value: OpenResponsesRequestPluginWeb = { - id: "web", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `id` | [models.IdWeb](../models/idweb.md) | :heavy_check_mark: | N/A | -| `maxResults` | *number* | :heavy_minus_sign: | N/A | -| `searchPrompt` | *string* | :heavy_minus_sign: | N/A | -| `engine` | [models.OpenResponsesRequestEngine](../models/openresponsesrequestengine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createembeddingsprovider.md b/docs/models/operations/createembeddingsprovider.md index bc6162ab..ec0ee2bd 100644 --- a/docs/models/operations/createembeddingsprovider.md +++ b/docs/models/operations/createembeddingsprovider.md @@ -17,9 +17,9 @@ let value: CreateEmbeddingsProvider = {}; | `dataCollection` | [models.DataCollection](../../models/datacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it

- deny: use only providers which do not collect user data. | allow | | `zdr` | *boolean* | :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 | | `enforceDistillableText` | *boolean* | :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` | *string*[] | :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. | [
"OpenAI",
"Anthropic"
] | -| `only` | *string*[] | :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. | [
"OpenAI",
"Anthropic"
] | -| `ignore` | *string*[] | :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. | [
"OpenAI",
"Anthropic"
] | +| `order` | *operations.Order*[] | :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` | *operations.Only*[] | :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` | *operations.Ignore*[] | :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` | [models.Quantization](../../models/quantization.md)[] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | | | `sort` | [models.ProviderSort](../../models/providersort.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | price | | `maxPrice` | [operations.MaxPrice](../../models/operations/maxprice.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. | | \ No newline at end of file diff --git a/docs/models/operations/ignore.md b/docs/models/operations/ignore.md new file mode 100644 index 00000000..de9c31d0 --- /dev/null +++ b/docs/models/operations/ignore.md @@ -0,0 +1,17 @@ +# Ignore + + +## Supported Types + +### `models.ProviderName` + +```typescript +const value: models.ProviderName = "OpenAI"; +``` + +### `string` + +```typescript +const value: string = ""; +``` + diff --git a/docs/models/operations/maxprice.md b/docs/models/operations/maxprice.md index 69c1b700..d54dfb5c 100644 --- a/docs/models/operations/maxprice.md +++ b/docs/models/operations/maxprice.md @@ -12,10 +12,10 @@ let value: MaxPrice = {}; ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `prompt` | *any* | :heavy_minus_sign: | N/A | -| `completion` | *any* | :heavy_minus_sign: | N/A | -| `image` | *any* | :heavy_minus_sign: | N/A | -| `audio` | *any* | :heavy_minus_sign: | N/A | -| `request` | *any* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `prompt` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `completion` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `image` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `audio` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `request` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | \ No newline at end of file diff --git a/docs/models/operations/only.md b/docs/models/operations/only.md new file mode 100644 index 00000000..c4202205 --- /dev/null +++ b/docs/models/operations/only.md @@ -0,0 +1,17 @@ +# Only + + +## Supported Types + +### `models.ProviderName` + +```typescript +const value: models.ProviderName = "OpenAI"; +``` + +### `string` + +```typescript +const value: string = ""; +``` + diff --git a/docs/models/operations/order.md b/docs/models/operations/order.md new file mode 100644 index 00000000..8a2f0898 --- /dev/null +++ b/docs/models/operations/order.md @@ -0,0 +1,17 @@ +# Order + + +## Supported Types + +### `models.ProviderName` + +```typescript +const value: models.ProviderName = "OpenAI"; +``` + +### `string` + +```typescript +const value: string = ""; +``` + diff --git a/docs/models/order.md b/docs/models/order.md new file mode 100644 index 00000000..8a2f0898 --- /dev/null +++ b/docs/models/order.md @@ -0,0 +1,17 @@ +# Order + + +## Supported Types + +### `models.ProviderName` + +```typescript +const value: models.ProviderName = "OpenAI"; +``` + +### `string` + +```typescript +const value: string = ""; +``` + diff --git a/docs/models/pdf.md b/docs/models/pdf.md new file mode 100644 index 00000000..67850913 --- /dev/null +++ b/docs/models/pdf.md @@ -0,0 +1,15 @@ +# Pdf + +## Example Usage + +```typescript +import { Pdf } from "@openrouter/sdk/models"; + +let value: Pdf = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `engine` | [models.PdfEngine](../models/pdfengine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/openresponsesrequestpdfengine.md b/docs/models/pdfengine.md similarity index 59% rename from docs/models/openresponsesrequestpdfengine.md rename to docs/models/pdfengine.md index 70d0f99a..5781ce26 100644 --- a/docs/models/openresponsesrequestpdfengine.md +++ b/docs/models/pdfengine.md @@ -1,11 +1,11 @@ -# OpenResponsesRequestPdfEngine +# PdfEngine ## Example Usage ```typescript -import { OpenResponsesRequestPdfEngine } from "@openrouter/sdk/models"; +import { PdfEngine } from "@openrouter/sdk/models"; -let value: OpenResponsesRequestPdfEngine = "native"; +let value: PdfEngine = "pdf-text"; ``` ## Values diff --git a/docs/models/plugin.md b/docs/models/plugin.md new file mode 100644 index 00000000..a7b20a73 --- /dev/null +++ b/docs/models/plugin.md @@ -0,0 +1,29 @@ +# Plugin + + +## Supported Types + +### `models.PluginModeration` + +```typescript +const value: models.PluginModeration = { + id: "moderation", +}; +``` + +### `models.PluginWeb` + +```typescript +const value: models.PluginWeb = { + id: "web", +}; +``` + +### `models.PluginFileParser` + +```typescript +const value: models.PluginFileParser = { + id: "file-parser", +}; +``` + diff --git a/docs/models/pluginfileparser.md b/docs/models/pluginfileparser.md new file mode 100644 index 00000000..22035248 --- /dev/null +++ b/docs/models/pluginfileparser.md @@ -0,0 +1,19 @@ +# PluginFileParser + +## Example Usage + +```typescript +import { PluginFileParser } from "@openrouter/sdk/models"; + +let value: PluginFileParser = { + id: "file-parser", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `id` | [models.IdFileParser](../models/idfileparser.md) | :heavy_check_mark: | N/A | +| `maxFiles` | *number* | :heavy_minus_sign: | N/A | +| `pdf` | [models.Pdf](../models/pdf.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/openresponsesrequestpluginmoderation.md b/docs/models/pluginmoderation.md similarity index 80% rename from docs/models/openresponsesrequestpluginmoderation.md rename to docs/models/pluginmoderation.md index bb77ae89..c5c4a8ab 100644 --- a/docs/models/openresponsesrequestpluginmoderation.md +++ b/docs/models/pluginmoderation.md @@ -1,11 +1,11 @@ -# OpenResponsesRequestPluginModeration +# PluginModeration ## Example Usage ```typescript -import { OpenResponsesRequestPluginModeration } from "@openrouter/sdk/models"; +import { PluginModeration } from "@openrouter/sdk/models"; -let value: OpenResponsesRequestPluginModeration = { +let value: PluginModeration = { id: "moderation", }; ``` diff --git a/docs/models/pluginweb.md b/docs/models/pluginweb.md new file mode 100644 index 00000000..5cfb0228 --- /dev/null +++ b/docs/models/pluginweb.md @@ -0,0 +1,20 @@ +# PluginWeb + +## Example Usage + +```typescript +import { PluginWeb } from "@openrouter/sdk/models"; + +let value: PluginWeb = { + id: "web", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `id` | [models.IdWeb](../models/idweb.md) | :heavy_check_mark: | N/A | +| `maxResults` | *number* | :heavy_minus_sign: | N/A | +| `searchPrompt` | *string* | :heavy_minus_sign: | N/A | +| `engine` | [models.Engine](../models/engine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/pricing.md b/docs/models/pricing.md index 6e2a1bb1..97324713 100644 --- a/docs/models/pricing.md +++ b/docs/models/pricing.md @@ -7,24 +7,24 @@ import { Pricing } from "@openrouter/sdk/models"; let value: Pricing = { prompt: 1000, - completion: "", + completion: "1000", }; ``` ## Fields -| Field | Type | Required | Description | -| ------------------- | ------------------- | ------------------- | ------------------- | -| `prompt` | *any* | :heavy_check_mark: | N/A | -| `completion` | *any* | :heavy_check_mark: | N/A | -| `request` | *any* | :heavy_minus_sign: | N/A | -| `image` | *any* | :heavy_minus_sign: | N/A | -| `imageToken` | *any* | :heavy_minus_sign: | N/A | -| `imageOutput` | *any* | :heavy_minus_sign: | N/A | -| `audio` | *any* | :heavy_minus_sign: | N/A | -| `inputAudioCache` | *any* | :heavy_minus_sign: | N/A | -| `webSearch` | *any* | :heavy_minus_sign: | N/A | -| `internalReasoning` | *any* | :heavy_minus_sign: | N/A | -| `inputCacheRead` | *any* | :heavy_minus_sign: | N/A | -| `inputCacheWrite` | *any* | :heavy_minus_sign: | N/A | -| `discount` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `prompt` | *any* | :heavy_check_mark: | A value in string or number format that is a large number | +| `completion` | *any* | :heavy_check_mark: | A value in string or number format that is a large number | +| `request` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `image` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `imageToken` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `imageOutput` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `audio` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `inputAudioCache` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `webSearch` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `internalReasoning` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `inputCacheRead` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `inputCacheWrite` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `discount` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/openresponsesrequestprovider.md b/docs/models/provider.md similarity index 95% rename from docs/models/openresponsesrequestprovider.md rename to docs/models/provider.md index 46f8d979..6f276ca2 100644 --- a/docs/models/openresponsesrequestprovider.md +++ b/docs/models/provider.md @@ -1,13 +1,13 @@ -# OpenResponsesRequestProvider +# Provider When multiple model providers are available, optionally indicate your routing preference. ## Example Usage ```typescript -import { OpenResponsesRequestProvider } from "@openrouter/sdk/models"; +import { Provider } from "@openrouter/sdk/models"; -let value: OpenResponsesRequestProvider = {}; +let value: Provider = {}; ``` ## Fields @@ -19,9 +19,9 @@ let value: OpenResponsesRequestProvider = {}; | `dataCollection` | [models.DataCollection](../models/datacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it

- deny: use only providers which do not collect user data. | allow | | `zdr` | *boolean* | :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 | | `enforceDistillableText` | *boolean* | :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` | *string*[] | :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. | [
"OpenAI",
"Anthropic"
] | -| `only` | *string*[] | :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. | [
"OpenAI",
"Anthropic"
] | -| `ignore` | *string*[] | :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. | [
"OpenAI",
"Anthropic"
] | +| `order` | *models.Order*[] | :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` | *models.Only*[] | :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` | *models.Ignore*[] | :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` | [models.Quantization](../models/quantization.md)[] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | | | `sort` | [models.ProviderSort](../models/providersort.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | price | -| `maxPrice` | [models.OpenResponsesRequestMaxPrice](../models/openresponsesrequestmaxprice.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. | | \ No newline at end of file +| `maxPrice` | [models.MaxPrice](../models/maxprice.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. | | \ No newline at end of file diff --git a/docs/models/publicpricing.md b/docs/models/publicpricing.md index 25fbdc9e..db3016aa 100644 --- a/docs/models/publicpricing.md +++ b/docs/models/publicpricing.md @@ -15,18 +15,18 @@ let value: PublicPricing = { ## Fields -| Field | Type | Required | Description | -| ------------------- | ------------------- | ------------------- | ------------------- | -| `prompt` | *any* | :heavy_check_mark: | N/A | -| `completion` | *any* | :heavy_check_mark: | N/A | -| `request` | *any* | :heavy_minus_sign: | N/A | -| `image` | *any* | :heavy_minus_sign: | N/A | -| `imageToken` | *any* | :heavy_minus_sign: | N/A | -| `imageOutput` | *any* | :heavy_minus_sign: | N/A | -| `audio` | *any* | :heavy_minus_sign: | N/A | -| `inputAudioCache` | *any* | :heavy_minus_sign: | N/A | -| `webSearch` | *any* | :heavy_minus_sign: | N/A | -| `internalReasoning` | *any* | :heavy_minus_sign: | N/A | -| `inputCacheRead` | *any* | :heavy_minus_sign: | N/A | -| `inputCacheWrite` | *any* | :heavy_minus_sign: | N/A | -| `discount` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `prompt` | *any* | :heavy_check_mark: | A value in string or number format that is a large number | +| `completion` | *any* | :heavy_check_mark: | A value in string or number format that is a large number | +| `request` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `image` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `imageToken` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `imageOutput` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `audio` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `inputAudioCache` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `webSearch` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `internalReasoning` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `inputCacheRead` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `inputCacheWrite` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | +| `discount` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/schema0enum.md b/docs/models/schema0enum.md deleted file mode 100644 index db00b191..00000000 --- a/docs/models/schema0enum.md +++ /dev/null @@ -1,17 +0,0 @@ -# Schema0Enum - -## Example Usage - -```typescript -import { Schema0Enum } from "@openrouter/sdk/models"; - -let value: Schema0Enum = "Venice"; -``` - -## Values - -This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. - -```typescript -"AI21" | "AionLabs" | "Alibaba" | "Amazon Bedrock" | "Anthropic" | "Arcee" | "AtlasCloud" | "Avian" | "Azure" | "BaseTen" | "Black Forest Labs" | "Cerebras" | "Chutes" | "Cirrascale" | "Clarifai" | "Cloudflare" | "Cohere" | "Crusoe" | "DeepInfra" | "DeepSeek" | "Featherless" | "Fireworks" | "Friendli" | "GMICloud" | "Google" | "Google AI Studio" | "Groq" | "Hyperbolic" | "Inception" | "InferenceNet" | "Infermatic" | "Inflection" | "Liquid" | "Mancer 2" | "Minimax" | "ModelRun" | "Mistral" | "Modular" | "Moonshot AI" | "Morph" | "NCompass" | "Nebius" | "NextBit" | "Novita" | "Nvidia" | "OpenAI" | "OpenInference" | "Parasail" | "Perplexity" | "Phala" | "Relace" | "SambaNova" | "SiliconFlow" | "Stealth" | "Switchpoint" | "Targon" | "Together" | "Venice" | "WandB" | "xAI" | "Z.AI" | "FakeProvider" | Unrecognized -``` \ No newline at end of file diff --git a/jsr.json b/jsr.json index 96ec6b3f..bc61e2dd 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "0.1.12", + "version": "0.1.13", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 64d55f13..a5810514 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@openrouter/sdk", - "version": "0.1.12", + "version": "0.1.13", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@openrouter/sdk", - "version": "0.1.12", + "version": "0.1.13", "license": "Apache-2.0", "dependencies": { "zod": "^3.25.0 || ^4.0.0" diff --git a/package.json b/package.json index caa11dca..7c7b4a28 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "0.1.12", + "version": "0.1.13", "author": "OpenRouter", "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.", "keywords": [ diff --git a/src/lib/config.ts b/src/lib/config.ts index 203c0f4b..f273f901 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -59,7 +59,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0.0", - sdkVersion: "0.1.12", + sdkVersion: "0.1.13", genVersion: "2.755.9", - userAgent: "speakeasy-sdk/typescript 0.1.12 2.755.9 1.0.0 @openrouter/sdk", + userAgent: "speakeasy-sdk/typescript 0.1.13 2.755.9 1.0.0 @openrouter/sdk", } as const; diff --git a/src/models/chatgenerationparams.ts b/src/models/chatgenerationparams.ts index 023aca23..b50b2dac 100644 --- a/src/models/chatgenerationparams.ts +++ b/src/models/chatgenerationparams.ts @@ -30,153 +30,12 @@ import { ResponseFormatTextGrammar$Outbound, ResponseFormatTextGrammar$outboundSchema, } from "./responseformattextgrammar.js"; -import { - Schema0, - Schema0$Outbound, - Schema0$outboundSchema, -} from "./schema0.js"; import { ToolDefinitionJson, ToolDefinitionJson$Outbound, ToolDefinitionJson$outboundSchema, } from "./tooldefinitionjson.js"; -export const ChatGenerationParamsPdfEngine = { - MistralOcr: "mistral-ocr", - PdfText: "pdf-text", - Native: "native", -} as const; -export type ChatGenerationParamsPdfEngine = OpenEnum< - typeof ChatGenerationParamsPdfEngine ->; - -export type ChatGenerationParamsPdf = { - engine?: ChatGenerationParamsPdfEngine | undefined; -}; - -export type ChatGenerationParamsPluginFileParser = { - id: "file-parser"; - maxFiles?: number | undefined; - pdf?: ChatGenerationParamsPdf | undefined; -}; - -export const ChatGenerationParamsEngine = { - Native: "native", - Exa: "exa", -} as const; -export type ChatGenerationParamsEngine = OpenEnum< - typeof ChatGenerationParamsEngine ->; - -export type ChatGenerationParamsPluginWeb = { - id: "web"; - maxResults?: number | undefined; - searchPrompt?: string | undefined; - engine?: ChatGenerationParamsEngine | undefined; -}; - -export type ChatGenerationParamsPluginModeration = { - id: "moderation"; -}; - -export type ChatGenerationParamsPluginUnion = - | ChatGenerationParamsPluginModeration - | ChatGenerationParamsPluginWeb - | ChatGenerationParamsPluginFileParser; - -export const ChatGenerationParamsDataCollection = { - Deny: "deny", - Allow: "allow", -} as const; -export type ChatGenerationParamsDataCollection = OpenEnum< - typeof ChatGenerationParamsDataCollection ->; - -export const ChatGenerationParamsQuantizations = { - Int4: "int4", - Int8: "int8", - Fp4: "fp4", - Fp6: "fp6", - Fp8: "fp8", - Fp16: "fp16", - Bf16: "bf16", - Fp32: "fp32", - Unknown: "unknown", -} as const; -export type ChatGenerationParamsQuantizations = OpenEnum< - typeof ChatGenerationParamsQuantizations ->; - -export const ChatGenerationParamsSort = { - Price: "price", - Throughput: "throughput", - Latency: "latency", -} as const; -export type ChatGenerationParamsSort = OpenEnum< - typeof ChatGenerationParamsSort ->; - -/** - * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. - */ -export type ChatGenerationParamsMaxPrice = { - prompt?: any | undefined; - completion?: any | undefined; - image?: any | undefined; - audio?: any | undefined; - request?: any | undefined; -}; - -export type ChatGenerationParamsProvider = { - /** - * Whether to allow backup providers to serve requests - * - * @remarks - * - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. - * - false: use only the primary/custom provider, and return the upstream error if it's unavailable. - */ - allowFallbacks?: boolean | null | undefined; - /** - * 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. - */ - requireParameters?: boolean | null | undefined; - /** - * Data collection setting. If no available model provider meets the requirement, your request will return an error. - * - * @remarks - * - allow: (default) allow providers which store user data non-transiently and may train on it - * - * - deny: use only providers which do not collect user data. - */ - dataCollection?: ChatGenerationParamsDataCollection | null | undefined; - zdr?: boolean | null | undefined; - enforceDistillableText?: boolean | null | undefined; - /** - * 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. - */ - order?: Array | null | undefined; - /** - * List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. - */ - only?: Array | null | undefined; - /** - * List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. - */ - ignore?: Array | null | undefined; - /** - * A list of quantization levels to filter the provider by. - */ - quantizations?: Array | null | undefined; - /** - * The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. - */ - sort?: ChatGenerationParamsSort | null | undefined; - /** - * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. - */ - maxPrice?: ChatGenerationParamsMaxPrice | undefined; -}; - export const Effort = { None: "none", Minimal: "minimal", @@ -213,14 +72,6 @@ export type ChatGenerationParamsResponseFormatUnion = export type ChatGenerationParamsStop = string | Array; export type ChatGenerationParams = { - plugins?: - | Array< - | ChatGenerationParamsPluginModeration - | ChatGenerationParamsPluginWeb - | ChatGenerationParamsPluginFileParser - > - | undefined; - provider?: ChatGenerationParamsProvider | null | undefined; messages: Array; model?: string | undefined; models?: Array | undefined; @@ -251,257 +102,6 @@ export type ChatGenerationParams = { user?: string | undefined; }; -/** @internal */ -export const ChatGenerationParamsPdfEngine$outboundSchema: z.ZodType< - string, - ChatGenerationParamsPdfEngine -> = openEnums.outboundSchema(ChatGenerationParamsPdfEngine); - -/** @internal */ -export type ChatGenerationParamsPdf$Outbound = { - engine?: string | undefined; -}; - -/** @internal */ -export const ChatGenerationParamsPdf$outboundSchema: z.ZodType< - ChatGenerationParamsPdf$Outbound, - ChatGenerationParamsPdf -> = z.object({ - engine: ChatGenerationParamsPdfEngine$outboundSchema.optional(), -}); - -export function chatGenerationParamsPdfToJSON( - chatGenerationParamsPdf: ChatGenerationParamsPdf, -): string { - return JSON.stringify( - ChatGenerationParamsPdf$outboundSchema.parse(chatGenerationParamsPdf), - ); -} - -/** @internal */ -export type ChatGenerationParamsPluginFileParser$Outbound = { - id: "file-parser"; - max_files?: number | undefined; - pdf?: ChatGenerationParamsPdf$Outbound | undefined; -}; - -/** @internal */ -export const ChatGenerationParamsPluginFileParser$outboundSchema: z.ZodType< - ChatGenerationParamsPluginFileParser$Outbound, - ChatGenerationParamsPluginFileParser -> = z.object({ - id: z.literal("file-parser"), - maxFiles: z.number().optional(), - pdf: z.lazy(() => ChatGenerationParamsPdf$outboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - maxFiles: "max_files", - }); -}); - -export function chatGenerationParamsPluginFileParserToJSON( - chatGenerationParamsPluginFileParser: ChatGenerationParamsPluginFileParser, -): string { - return JSON.stringify( - ChatGenerationParamsPluginFileParser$outboundSchema.parse( - chatGenerationParamsPluginFileParser, - ), - ); -} - -/** @internal */ -export const ChatGenerationParamsEngine$outboundSchema: z.ZodType< - string, - ChatGenerationParamsEngine -> = openEnums.outboundSchema(ChatGenerationParamsEngine); - -/** @internal */ -export type ChatGenerationParamsPluginWeb$Outbound = { - id: "web"; - max_results?: number | undefined; - search_prompt?: string | undefined; - engine?: string | undefined; -}; - -/** @internal */ -export const ChatGenerationParamsPluginWeb$outboundSchema: z.ZodType< - ChatGenerationParamsPluginWeb$Outbound, - ChatGenerationParamsPluginWeb -> = z.object({ - id: z.literal("web"), - maxResults: z.number().optional(), - searchPrompt: z.string().optional(), - engine: ChatGenerationParamsEngine$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - maxResults: "max_results", - searchPrompt: "search_prompt", - }); -}); - -export function chatGenerationParamsPluginWebToJSON( - chatGenerationParamsPluginWeb: ChatGenerationParamsPluginWeb, -): string { - return JSON.stringify( - ChatGenerationParamsPluginWeb$outboundSchema.parse( - chatGenerationParamsPluginWeb, - ), - ); -} - -/** @internal */ -export type ChatGenerationParamsPluginModeration$Outbound = { - id: "moderation"; -}; - -/** @internal */ -export const ChatGenerationParamsPluginModeration$outboundSchema: z.ZodType< - ChatGenerationParamsPluginModeration$Outbound, - ChatGenerationParamsPluginModeration -> = z.object({ - id: z.literal("moderation"), -}); - -export function chatGenerationParamsPluginModerationToJSON( - chatGenerationParamsPluginModeration: ChatGenerationParamsPluginModeration, -): string { - return JSON.stringify( - ChatGenerationParamsPluginModeration$outboundSchema.parse( - chatGenerationParamsPluginModeration, - ), - ); -} - -/** @internal */ -export type ChatGenerationParamsPluginUnion$Outbound = - | ChatGenerationParamsPluginModeration$Outbound - | ChatGenerationParamsPluginWeb$Outbound - | ChatGenerationParamsPluginFileParser$Outbound; - -/** @internal */ -export const ChatGenerationParamsPluginUnion$outboundSchema: z.ZodType< - ChatGenerationParamsPluginUnion$Outbound, - ChatGenerationParamsPluginUnion -> = z.union([ - z.lazy(() => ChatGenerationParamsPluginModeration$outboundSchema), - z.lazy(() => ChatGenerationParamsPluginWeb$outboundSchema), - z.lazy(() => ChatGenerationParamsPluginFileParser$outboundSchema), -]); - -export function chatGenerationParamsPluginUnionToJSON( - chatGenerationParamsPluginUnion: ChatGenerationParamsPluginUnion, -): string { - return JSON.stringify( - ChatGenerationParamsPluginUnion$outboundSchema.parse( - chatGenerationParamsPluginUnion, - ), - ); -} - -/** @internal */ -export const ChatGenerationParamsDataCollection$outboundSchema: z.ZodType< - string, - ChatGenerationParamsDataCollection -> = openEnums.outboundSchema(ChatGenerationParamsDataCollection); - -/** @internal */ -export const ChatGenerationParamsQuantizations$outboundSchema: z.ZodType< - string, - ChatGenerationParamsQuantizations -> = openEnums.outboundSchema(ChatGenerationParamsQuantizations); - -/** @internal */ -export const ChatGenerationParamsSort$outboundSchema: z.ZodType< - string, - ChatGenerationParamsSort -> = openEnums.outboundSchema(ChatGenerationParamsSort); - -/** @internal */ -export type ChatGenerationParamsMaxPrice$Outbound = { - prompt?: any | undefined; - completion?: any | undefined; - image?: any | undefined; - audio?: any | undefined; - request?: any | undefined; -}; - -/** @internal */ -export const ChatGenerationParamsMaxPrice$outboundSchema: z.ZodType< - ChatGenerationParamsMaxPrice$Outbound, - ChatGenerationParamsMaxPrice -> = z.object({ - prompt: z.any().optional(), - completion: z.any().optional(), - image: z.any().optional(), - audio: z.any().optional(), - request: z.any().optional(), -}); - -export function chatGenerationParamsMaxPriceToJSON( - chatGenerationParamsMaxPrice: ChatGenerationParamsMaxPrice, -): string { - return JSON.stringify( - ChatGenerationParamsMaxPrice$outboundSchema.parse( - chatGenerationParamsMaxPrice, - ), - ); -} - -/** @internal */ -export type ChatGenerationParamsProvider$Outbound = { - allow_fallbacks?: boolean | null | undefined; - require_parameters?: boolean | null | undefined; - data_collection?: string | null | undefined; - zdr?: boolean | null | undefined; - enforce_distillable_text?: boolean | null | undefined; - order?: Array | null | undefined; - only?: Array | null | undefined; - ignore?: Array | null | undefined; - quantizations?: Array | null | undefined; - sort?: string | null | undefined; - max_price?: ChatGenerationParamsMaxPrice$Outbound | undefined; -}; - -/** @internal */ -export const ChatGenerationParamsProvider$outboundSchema: z.ZodType< - ChatGenerationParamsProvider$Outbound, - ChatGenerationParamsProvider -> = z.object({ - allowFallbacks: z.nullable(z.boolean()).optional(), - requireParameters: z.nullable(z.boolean()).optional(), - dataCollection: z.nullable(ChatGenerationParamsDataCollection$outboundSchema) - .optional(), - zdr: z.nullable(z.boolean()).optional(), - enforceDistillableText: z.nullable(z.boolean()).optional(), - order: z.nullable(z.array(Schema0$outboundSchema)).optional(), - only: z.nullable(z.array(Schema0$outboundSchema)).optional(), - ignore: z.nullable(z.array(Schema0$outboundSchema)).optional(), - quantizations: z.nullable( - z.array(ChatGenerationParamsQuantizations$outboundSchema), - ).optional(), - sort: z.nullable(ChatGenerationParamsSort$outboundSchema).optional(), - maxPrice: z.lazy(() => ChatGenerationParamsMaxPrice$outboundSchema) - .optional(), -}).transform((v) => { - return remap$(v, { - allowFallbacks: "allow_fallbacks", - requireParameters: "require_parameters", - dataCollection: "data_collection", - enforceDistillableText: "enforce_distillable_text", - maxPrice: "max_price", - }); -}); - -export function chatGenerationParamsProviderToJSON( - chatGenerationParamsProvider: ChatGenerationParamsProvider, -): string { - return JSON.stringify( - ChatGenerationParamsProvider$outboundSchema.parse( - chatGenerationParamsProvider, - ), - ); -} - /** @internal */ export const Effort$outboundSchema: z.ZodType = openEnums .outboundSchema(Effort); @@ -648,14 +248,6 @@ export function chatGenerationParamsStopToJSON( /** @internal */ export type ChatGenerationParams$Outbound = { - plugins?: - | Array< - | ChatGenerationParamsPluginModeration$Outbound - | ChatGenerationParamsPluginWeb$Outbound - | ChatGenerationParamsPluginFileParser$Outbound - > - | undefined; - provider?: ChatGenerationParamsProvider$Outbound | null | undefined; messages: Array; model?: string | undefined; models?: Array | undefined; @@ -691,16 +283,6 @@ export const ChatGenerationParams$outboundSchema: z.ZodType< ChatGenerationParams$Outbound, ChatGenerationParams > = z.object({ - plugins: z.array( - z.union([ - z.lazy(() => ChatGenerationParamsPluginModeration$outboundSchema), - z.lazy(() => ChatGenerationParamsPluginWeb$outboundSchema), - z.lazy(() => ChatGenerationParamsPluginFileParser$outboundSchema), - ]), - ).optional(), - provider: z.nullable( - z.lazy(() => ChatGenerationParamsProvider$outboundSchema), - ).optional(), messages: z.array(Message$outboundSchema), model: z.string().optional(), models: z.array(z.string()).optional(), diff --git a/src/models/chatresponsechoice.ts b/src/models/chatresponsechoice.ts index edfd7495..6b604438 100644 --- a/src/models/chatresponsechoice.ts +++ b/src/models/chatresponsechoice.ts @@ -5,6 +5,8 @@ import * as z from "zod/v4"; import { remap as remap$ } from "../lib/primitives.js"; import { safeParse } from "../lib/schemas.js"; +import * as openEnums from "../types/enums.js"; +import { OpenEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { AssistantMessage, @@ -14,22 +16,49 @@ import { ChatMessageTokenLogprobs, ChatMessageTokenLogprobs$inboundSchema, } from "./chatmessagetokenlogprobs.js"; +import { + ChatStreamingMessageChunk, + ChatStreamingMessageChunk$inboundSchema, +} from "./chatstreamingmessagechunk.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; -import { Schema0, Schema0$inboundSchema } from "./schema0.js"; + +export const ChatCompletionFinishReason = { + ToolCalls: "tool_calls", + Stop: "stop", + Length: "length", + ContentFilter: "content_filter", + Error: "error", +} as const; +export type ChatCompletionFinishReason = OpenEnum< + typeof ChatCompletionFinishReason +>; export type ChatResponseChoice = { - finishReason: Array; + finishReason: ChatCompletionFinishReason | null; index: number; message: AssistantMessage; logprobs?: ChatMessageTokenLogprobs | null | undefined; }; +export type ChatStreamingChoice = { + delta: ChatStreamingMessageChunk; + finishReason: ChatCompletionFinishReason | null; + index: number; + logprobs?: ChatMessageTokenLogprobs | null | undefined; +}; + +/** @internal */ +export const ChatCompletionFinishReason$inboundSchema: z.ZodType< + ChatCompletionFinishReason, + unknown +> = openEnums.inboundSchema(ChatCompletionFinishReason); + /** @internal */ export const ChatResponseChoice$inboundSchema: z.ZodType< ChatResponseChoice, unknown > = z.object({ - finish_reason: z.array(Schema0$inboundSchema), + finish_reason: z.nullable(ChatCompletionFinishReason$inboundSchema), index: z.number(), message: AssistantMessage$inboundSchema, logprobs: z.nullable(ChatMessageTokenLogprobs$inboundSchema).optional(), @@ -48,3 +77,28 @@ export function chatResponseChoiceFromJSON( `Failed to parse 'ChatResponseChoice' from JSON`, ); } + +/** @internal */ +export const ChatStreamingChoice$inboundSchema: z.ZodType< + ChatStreamingChoice, + unknown +> = z.object({ + delta: ChatStreamingMessageChunk$inboundSchema, + finish_reason: z.nullable(ChatCompletionFinishReason$inboundSchema), + index: z.number(), + logprobs: z.nullable(ChatMessageTokenLogprobs$inboundSchema).optional(), +}).transform((v) => { + return remap$(v, { + "finish_reason": "finishReason", + }); +}); + +export function chatStreamingChoiceFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ChatStreamingChoice$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ChatStreamingChoice' from JSON`, + ); +} diff --git a/src/models/chatstreamingchoice.ts b/src/models/chatstreamingchoice.ts deleted file mode 100644 index 62ef0d86..00000000 --- a/src/models/chatstreamingchoice.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { - ChatMessageTokenLogprobs, - ChatMessageTokenLogprobs$inboundSchema, -} from "./chatmessagetokenlogprobs.js"; -import { - ChatStreamingMessageChunk, - ChatStreamingMessageChunk$inboundSchema, -} from "./chatstreamingmessagechunk.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; -import { Schema0, Schema0$inboundSchema } from "./schema0.js"; - -export type ChatStreamingChoice = { - delta: ChatStreamingMessageChunk; - finishReason: Array; - index: number; - logprobs?: ChatMessageTokenLogprobs | null | undefined; -}; - -/** @internal */ -export const ChatStreamingChoice$inboundSchema: z.ZodType< - ChatStreamingChoice, - unknown -> = z.object({ - delta: ChatStreamingMessageChunk$inboundSchema, - finish_reason: z.array(Schema0$inboundSchema), - index: z.number(), - logprobs: z.nullable(ChatMessageTokenLogprobs$inboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - "finish_reason": "finishReason", - }); -}); - -export function chatStreamingChoiceFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ChatStreamingChoice$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ChatStreamingChoice' from JSON`, - ); -} diff --git a/src/models/chatstreamingresponsechunk.ts b/src/models/chatstreamingresponsechunk.ts index 80030608..b9892447 100644 --- a/src/models/chatstreamingresponsechunk.ts +++ b/src/models/chatstreamingresponsechunk.ts @@ -13,7 +13,7 @@ import { import { ChatStreamingChoice, ChatStreamingChoice$inboundSchema, -} from "./chatstreamingchoice.js"; +} from "./chatresponsechoice.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; export type ChatStreamingResponseChunkError = { diff --git a/src/models/completioncreateparams.ts b/src/models/completioncreateparams.ts index 1c7a8a49..3227fb77 100644 --- a/src/models/completioncreateparams.ts +++ b/src/models/completioncreateparams.ts @@ -4,8 +4,6 @@ import * as z from "zod/v4"; import { remap as remap$ } from "../lib/primitives.js"; -import * as openEnums from "../types/enums.js"; -import { OpenEnum } from "../types/enums.js"; import { ResponseFormatJSONSchema, ResponseFormatJSONSchema$Outbound, @@ -16,147 +14,6 @@ import { ResponseFormatTextGrammar$Outbound, ResponseFormatTextGrammar$outboundSchema, } from "./responseformattextgrammar.js"; -import { - Schema0, - Schema0$Outbound, - Schema0$outboundSchema, -} from "./schema0.js"; - -export const CompletionCreateParamsPdfEngine = { - MistralOcr: "mistral-ocr", - PdfText: "pdf-text", - Native: "native", -} as const; -export type CompletionCreateParamsPdfEngine = OpenEnum< - typeof CompletionCreateParamsPdfEngine ->; - -export type CompletionCreateParamsPdf = { - engine?: CompletionCreateParamsPdfEngine | undefined; -}; - -export type CompletionCreateParamsPluginFileParser = { - id: "file-parser"; - maxFiles?: number | undefined; - pdf?: CompletionCreateParamsPdf | undefined; -}; - -export const CompletionCreateParamsEngine = { - Native: "native", - Exa: "exa", -} as const; -export type CompletionCreateParamsEngine = OpenEnum< - typeof CompletionCreateParamsEngine ->; - -export type CompletionCreateParamsPluginWeb = { - id: "web"; - maxResults?: number | undefined; - searchPrompt?: string | undefined; - engine?: CompletionCreateParamsEngine | undefined; -}; - -export type CompletionCreateParamsPluginModeration = { - id: "moderation"; -}; - -export type CompletionCreateParamsPluginUnion = - | CompletionCreateParamsPluginModeration - | CompletionCreateParamsPluginWeb - | CompletionCreateParamsPluginFileParser; - -export const CompletionCreateParamsDataCollection = { - Deny: "deny", - Allow: "allow", -} as const; -export type CompletionCreateParamsDataCollection = OpenEnum< - typeof CompletionCreateParamsDataCollection ->; - -export const CompletionCreateParamsQuantizations = { - Int4: "int4", - Int8: "int8", - Fp4: "fp4", - Fp6: "fp6", - Fp8: "fp8", - Fp16: "fp16", - Bf16: "bf16", - Fp32: "fp32", - Unknown: "unknown", -} as const; -export type CompletionCreateParamsQuantizations = OpenEnum< - typeof CompletionCreateParamsQuantizations ->; - -export const CompletionCreateParamsSort = { - Price: "price", - Throughput: "throughput", - Latency: "latency", -} as const; -export type CompletionCreateParamsSort = OpenEnum< - typeof CompletionCreateParamsSort ->; - -/** - * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. - */ -export type CompletionCreateParamsMaxPrice = { - prompt?: any | undefined; - completion?: any | undefined; - image?: any | undefined; - audio?: any | undefined; - request?: any | undefined; -}; - -export type CompletionCreateParamsProvider = { - /** - * Whether to allow backup providers to serve requests - * - * @remarks - * - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. - * - false: use only the primary/custom provider, and return the upstream error if it's unavailable. - */ - allowFallbacks?: boolean | null | undefined; - /** - * 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. - */ - requireParameters?: boolean | null | undefined; - /** - * Data collection setting. If no available model provider meets the requirement, your request will return an error. - * - * @remarks - * - allow: (default) allow providers which store user data non-transiently and may train on it - * - * - deny: use only providers which do not collect user data. - */ - dataCollection?: CompletionCreateParamsDataCollection | null | undefined; - zdr?: boolean | null | undefined; - enforceDistillableText?: boolean | null | undefined; - /** - * 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. - */ - order?: Array | null | undefined; - /** - * List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. - */ - only?: Array | null | undefined; - /** - * List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. - */ - ignore?: Array | null | undefined; - /** - * A list of quantization levels to filter the provider by. - */ - quantizations?: Array | null | undefined; - /** - * The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. - */ - sort?: CompletionCreateParamsSort | null | undefined; - /** - * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. - */ - maxPrice?: CompletionCreateParamsMaxPrice | undefined; -}; export type Prompt = | string @@ -192,14 +49,6 @@ export type CompletionCreateParamsResponseFormatUnion = export type CompletionCreateParams = { model?: string | undefined; models?: Array | undefined; - plugins?: - | Array< - | CompletionCreateParamsPluginModeration - | CompletionCreateParamsPluginWeb - | CompletionCreateParamsPluginFileParser - > - | undefined; - provider?: CompletionCreateParamsProvider | null | undefined; prompt: string | Array | Array | Array>; bestOf?: number | null | undefined; echo?: boolean | null | undefined; @@ -228,260 +77,6 @@ export type CompletionCreateParams = { | undefined; }; -/** @internal */ -export const CompletionCreateParamsPdfEngine$outboundSchema: z.ZodType< - string, - CompletionCreateParamsPdfEngine -> = openEnums.outboundSchema(CompletionCreateParamsPdfEngine); - -/** @internal */ -export type CompletionCreateParamsPdf$Outbound = { - engine?: string | undefined; -}; - -/** @internal */ -export const CompletionCreateParamsPdf$outboundSchema: z.ZodType< - CompletionCreateParamsPdf$Outbound, - CompletionCreateParamsPdf -> = z.object({ - engine: CompletionCreateParamsPdfEngine$outboundSchema.optional(), -}); - -export function completionCreateParamsPdfToJSON( - completionCreateParamsPdf: CompletionCreateParamsPdf, -): string { - return JSON.stringify( - CompletionCreateParamsPdf$outboundSchema.parse(completionCreateParamsPdf), - ); -} - -/** @internal */ -export type CompletionCreateParamsPluginFileParser$Outbound = { - id: "file-parser"; - max_files?: number | undefined; - pdf?: CompletionCreateParamsPdf$Outbound | undefined; -}; - -/** @internal */ -export const CompletionCreateParamsPluginFileParser$outboundSchema: z.ZodType< - CompletionCreateParamsPluginFileParser$Outbound, - CompletionCreateParamsPluginFileParser -> = z.object({ - id: z.literal("file-parser"), - maxFiles: z.number().optional(), - pdf: z.lazy(() => CompletionCreateParamsPdf$outboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - maxFiles: "max_files", - }); -}); - -export function completionCreateParamsPluginFileParserToJSON( - completionCreateParamsPluginFileParser: - CompletionCreateParamsPluginFileParser, -): string { - return JSON.stringify( - CompletionCreateParamsPluginFileParser$outboundSchema.parse( - completionCreateParamsPluginFileParser, - ), - ); -} - -/** @internal */ -export const CompletionCreateParamsEngine$outboundSchema: z.ZodType< - string, - CompletionCreateParamsEngine -> = openEnums.outboundSchema(CompletionCreateParamsEngine); - -/** @internal */ -export type CompletionCreateParamsPluginWeb$Outbound = { - id: "web"; - max_results?: number | undefined; - search_prompt?: string | undefined; - engine?: string | undefined; -}; - -/** @internal */ -export const CompletionCreateParamsPluginWeb$outboundSchema: z.ZodType< - CompletionCreateParamsPluginWeb$Outbound, - CompletionCreateParamsPluginWeb -> = z.object({ - id: z.literal("web"), - maxResults: z.number().optional(), - searchPrompt: z.string().optional(), - engine: CompletionCreateParamsEngine$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - maxResults: "max_results", - searchPrompt: "search_prompt", - }); -}); - -export function completionCreateParamsPluginWebToJSON( - completionCreateParamsPluginWeb: CompletionCreateParamsPluginWeb, -): string { - return JSON.stringify( - CompletionCreateParamsPluginWeb$outboundSchema.parse( - completionCreateParamsPluginWeb, - ), - ); -} - -/** @internal */ -export type CompletionCreateParamsPluginModeration$Outbound = { - id: "moderation"; -}; - -/** @internal */ -export const CompletionCreateParamsPluginModeration$outboundSchema: z.ZodType< - CompletionCreateParamsPluginModeration$Outbound, - CompletionCreateParamsPluginModeration -> = z.object({ - id: z.literal("moderation"), -}); - -export function completionCreateParamsPluginModerationToJSON( - completionCreateParamsPluginModeration: - CompletionCreateParamsPluginModeration, -): string { - return JSON.stringify( - CompletionCreateParamsPluginModeration$outboundSchema.parse( - completionCreateParamsPluginModeration, - ), - ); -} - -/** @internal */ -export type CompletionCreateParamsPluginUnion$Outbound = - | CompletionCreateParamsPluginModeration$Outbound - | CompletionCreateParamsPluginWeb$Outbound - | CompletionCreateParamsPluginFileParser$Outbound; - -/** @internal */ -export const CompletionCreateParamsPluginUnion$outboundSchema: z.ZodType< - CompletionCreateParamsPluginUnion$Outbound, - CompletionCreateParamsPluginUnion -> = z.union([ - z.lazy(() => CompletionCreateParamsPluginModeration$outboundSchema), - z.lazy(() => CompletionCreateParamsPluginWeb$outboundSchema), - z.lazy(() => CompletionCreateParamsPluginFileParser$outboundSchema), -]); - -export function completionCreateParamsPluginUnionToJSON( - completionCreateParamsPluginUnion: CompletionCreateParamsPluginUnion, -): string { - return JSON.stringify( - CompletionCreateParamsPluginUnion$outboundSchema.parse( - completionCreateParamsPluginUnion, - ), - ); -} - -/** @internal */ -export const CompletionCreateParamsDataCollection$outboundSchema: z.ZodType< - string, - CompletionCreateParamsDataCollection -> = openEnums.outboundSchema(CompletionCreateParamsDataCollection); - -/** @internal */ -export const CompletionCreateParamsQuantizations$outboundSchema: z.ZodType< - string, - CompletionCreateParamsQuantizations -> = openEnums.outboundSchema(CompletionCreateParamsQuantizations); - -/** @internal */ -export const CompletionCreateParamsSort$outboundSchema: z.ZodType< - string, - CompletionCreateParamsSort -> = openEnums.outboundSchema(CompletionCreateParamsSort); - -/** @internal */ -export type CompletionCreateParamsMaxPrice$Outbound = { - prompt?: any | undefined; - completion?: any | undefined; - image?: any | undefined; - audio?: any | undefined; - request?: any | undefined; -}; - -/** @internal */ -export const CompletionCreateParamsMaxPrice$outboundSchema: z.ZodType< - CompletionCreateParamsMaxPrice$Outbound, - CompletionCreateParamsMaxPrice -> = z.object({ - prompt: z.any().optional(), - completion: z.any().optional(), - image: z.any().optional(), - audio: z.any().optional(), - request: z.any().optional(), -}); - -export function completionCreateParamsMaxPriceToJSON( - completionCreateParamsMaxPrice: CompletionCreateParamsMaxPrice, -): string { - return JSON.stringify( - CompletionCreateParamsMaxPrice$outboundSchema.parse( - completionCreateParamsMaxPrice, - ), - ); -} - -/** @internal */ -export type CompletionCreateParamsProvider$Outbound = { - allow_fallbacks?: boolean | null | undefined; - require_parameters?: boolean | null | undefined; - data_collection?: string | null | undefined; - zdr?: boolean | null | undefined; - enforce_distillable_text?: boolean | null | undefined; - order?: Array | null | undefined; - only?: Array | null | undefined; - ignore?: Array | null | undefined; - quantizations?: Array | null | undefined; - sort?: string | null | undefined; - max_price?: CompletionCreateParamsMaxPrice$Outbound | undefined; -}; - -/** @internal */ -export const CompletionCreateParamsProvider$outboundSchema: z.ZodType< - CompletionCreateParamsProvider$Outbound, - CompletionCreateParamsProvider -> = z.object({ - allowFallbacks: z.nullable(z.boolean()).optional(), - requireParameters: z.nullable(z.boolean()).optional(), - dataCollection: z.nullable( - CompletionCreateParamsDataCollection$outboundSchema, - ).optional(), - zdr: z.nullable(z.boolean()).optional(), - enforceDistillableText: z.nullable(z.boolean()).optional(), - order: z.nullable(z.array(Schema0$outboundSchema)).optional(), - only: z.nullable(z.array(Schema0$outboundSchema)).optional(), - ignore: z.nullable(z.array(Schema0$outboundSchema)).optional(), - quantizations: z.nullable( - z.array(CompletionCreateParamsQuantizations$outboundSchema), - ).optional(), - sort: z.nullable(CompletionCreateParamsSort$outboundSchema).optional(), - maxPrice: z.lazy(() => CompletionCreateParamsMaxPrice$outboundSchema) - .optional(), -}).transform((v) => { - return remap$(v, { - allowFallbacks: "allow_fallbacks", - requireParameters: "require_parameters", - dataCollection: "data_collection", - enforceDistillableText: "enforce_distillable_text", - maxPrice: "max_price", - }); -}); - -export function completionCreateParamsProviderToJSON( - completionCreateParamsProvider: CompletionCreateParamsProvider, -): string { - return JSON.stringify( - CompletionCreateParamsProvider$outboundSchema.parse( - completionCreateParamsProvider, - ), - ); -} - /** @internal */ export type Prompt$Outbound = | string @@ -650,14 +245,6 @@ export function completionCreateParamsResponseFormatUnionToJSON( export type CompletionCreateParams$Outbound = { model?: string | undefined; models?: Array | undefined; - plugins?: - | Array< - | CompletionCreateParamsPluginModeration$Outbound - | CompletionCreateParamsPluginWeb$Outbound - | CompletionCreateParamsPluginFileParser$Outbound - > - | undefined; - provider?: CompletionCreateParamsProvider$Outbound | null | undefined; prompt: string | Array | Array | Array>; best_of?: number | null | undefined; echo?: boolean | null | undefined; @@ -693,16 +280,6 @@ export const CompletionCreateParams$outboundSchema: z.ZodType< > = z.object({ model: z.string().optional(), models: z.array(z.string()).optional(), - plugins: z.array( - z.union([ - z.lazy(() => CompletionCreateParamsPluginModeration$outboundSchema), - z.lazy(() => CompletionCreateParamsPluginWeb$outboundSchema), - z.lazy(() => CompletionCreateParamsPluginFileParser$outboundSchema), - ]), - ).optional(), - provider: z.nullable( - z.lazy(() => CompletionCreateParamsProvider$outboundSchema), - ).optional(), prompt: z.union([ z.string(), z.array(z.string()), diff --git a/src/models/index.ts b/src/models/index.ts index 33adad0d..f926df3b 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -19,7 +19,6 @@ export * from "./chatmessagetokenlogprobs.js"; export * from "./chatmessagetoolcall.js"; export * from "./chatresponse.js"; export * from "./chatresponsechoice.js"; -export * from "./chatstreamingchoice.js"; export * from "./chatstreamingmessagechunk.js"; export * from "./chatstreamingmessagetoolcall.js"; export * from "./chatstreamingresponsechunk.js"; @@ -130,7 +129,6 @@ export * from "./responsessearchcontextsize.js"; export * from "./responseswebsearchcalloutput.js"; export * from "./responseswebsearchuserlocation.js"; export * from "./responsetextconfig.js"; -export * from "./schema0.js"; export * from "./security.js"; export * from "./serviceunavailableresponseerrordata.js"; export * from "./systemmessage.js"; diff --git a/src/models/openresponsesrequest.ts b/src/models/openresponsesrequest.ts index bba724bd..142399b9 100644 --- a/src/models/openresponsesrequest.ts +++ b/src/models/openresponsesrequest.ts @@ -59,6 +59,7 @@ import { OpenResponsesWebSearchTool$Outbound, OpenResponsesWebSearchTool$outboundSchema, } from "./openresponseswebsearchtool.js"; +import { ProviderName, ProviderName$outboundSchema } from "./providername.js"; import { ProviderSort, ProviderSort$outboundSchema } from "./providersort.js"; import { Quantization, Quantization$outboundSchema } from "./quantization.js"; @@ -102,21 +103,42 @@ export const Truncation = { } as const; export type Truncation = OpenEnum; +export type Order = ProviderName | string; + +export type Only = ProviderName | string; + +export type Ignore = ProviderName | string; + /** * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. */ -export type OpenResponsesRequestMaxPrice = { +export type MaxPrice = { + /** + * A value in string or number format that is a large number + */ prompt?: any | undefined; + /** + * A value in string or number format that is a large number + */ completion?: any | undefined; + /** + * A value in string or number format that is a large number + */ image?: any | undefined; + /** + * A value in string or number format that is a large number + */ audio?: any | undefined; + /** + * A value in string or number format that is a large number + */ request?: any | undefined; }; /** * When multiple model providers are available, optionally indicate your routing preference. */ -export type OpenResponsesRequestProvider = { +export type Provider = { /** * Whether to allow backup providers to serve requests * @@ -149,15 +171,15 @@ export type OpenResponsesRequestProvider = { /** * 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. */ - order?: Array | undefined; + order?: Array | null | undefined; /** * List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. */ - only?: Array | undefined; + only?: Array | null | undefined; /** * List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. */ - ignore?: Array | undefined; + ignore?: Array | null | undefined; /** * A list of quantization levels to filter the provider by. */ @@ -169,7 +191,7 @@ export type OpenResponsesRequestProvider = { /** * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. */ - maxPrice?: OpenResponsesRequestMaxPrice | undefined; + maxPrice?: MaxPrice | undefined; }; export const IdFileParser = { @@ -177,23 +199,21 @@ export const IdFileParser = { } as const; export type IdFileParser = ClosedEnum; -export const OpenResponsesRequestPdfEngine = { +export const PdfEngine = { MistralOcr: "mistral-ocr", PdfText: "pdf-text", Native: "native", } as const; -export type OpenResponsesRequestPdfEngine = OpenEnum< - typeof OpenResponsesRequestPdfEngine ->; +export type PdfEngine = OpenEnum; -export type OpenResponsesRequestPdf = { - engine?: OpenResponsesRequestPdfEngine | undefined; +export type Pdf = { + engine?: PdfEngine | undefined; }; -export type OpenResponsesRequestPluginFileParser = { +export type PluginFileParser = { id: IdFileParser; maxFiles?: number | undefined; - pdf?: OpenResponsesRequestPdf | undefined; + pdf?: Pdf | undefined; }; export const IdWeb = { @@ -201,19 +221,17 @@ export const IdWeb = { } as const; export type IdWeb = ClosedEnum; -export const OpenResponsesRequestEngine = { +export const Engine = { Native: "native", Exa: "exa", } as const; -export type OpenResponsesRequestEngine = OpenEnum< - typeof OpenResponsesRequestEngine ->; +export type Engine = OpenEnum; -export type OpenResponsesRequestPluginWeb = { +export type PluginWeb = { id: IdWeb; maxResults?: number | undefined; searchPrompt?: string | undefined; - engine?: OpenResponsesRequestEngine | undefined; + engine?: Engine | undefined; }; export const IdModeration = { @@ -221,14 +239,11 @@ export const IdModeration = { } as const; export type IdModeration = ClosedEnum; -export type OpenResponsesRequestPluginModeration = { +export type PluginModeration = { id: IdModeration; }; -export type OpenResponsesRequestPluginUnion = - | OpenResponsesRequestPluginModeration - | OpenResponsesRequestPluginWeb - | OpenResponsesRequestPluginFileParser; +export type Plugin = PluginModeration | PluginWeb | PluginFileParser; /** * Request schema for Responses endpoint @@ -281,17 +296,11 @@ export type OpenResponsesRequest = { /** * When multiple model providers are available, optionally indicate your routing preference. */ - provider?: OpenResponsesRequestProvider | null | undefined; + provider?: Provider | null | undefined; /** * Plugins you want to enable for this request, including their settings. */ - plugins?: - | Array< - | OpenResponsesRequestPluginModeration - | OpenResponsesRequestPluginWeb - | OpenResponsesRequestPluginFileParser - > - | undefined; + plugins?: Array | undefined; /** * A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. */ @@ -373,7 +382,44 @@ export const Truncation$outboundSchema: z.ZodType = openEnums.outboundSchema(Truncation); /** @internal */ -export type OpenResponsesRequestMaxPrice$Outbound = { +export type Order$Outbound = string | string; + +/** @internal */ +export const Order$outboundSchema: z.ZodType = z.union([ + ProviderName$outboundSchema, + z.string(), +]); + +export function orderToJSON(order: Order): string { + return JSON.stringify(Order$outboundSchema.parse(order)); +} + +/** @internal */ +export type Only$Outbound = string | string; + +/** @internal */ +export const Only$outboundSchema: z.ZodType = z.union([ + ProviderName$outboundSchema, + z.string(), +]); + +export function onlyToJSON(only: Only): string { + return JSON.stringify(Only$outboundSchema.parse(only)); +} + +/** @internal */ +export type Ignore$Outbound = string | string; + +/** @internal */ +export const Ignore$outboundSchema: z.ZodType = z + .union([ProviderName$outboundSchema, z.string()]); + +export function ignoreToJSON(ignore: Ignore): string { + return JSON.stringify(Ignore$outboundSchema.parse(ignore)); +} + +/** @internal */ +export type MaxPrice$Outbound = { prompt?: any | undefined; completion?: any | undefined; image?: any | undefined; @@ -382,77 +428,66 @@ export type OpenResponsesRequestMaxPrice$Outbound = { }; /** @internal */ -export const OpenResponsesRequestMaxPrice$outboundSchema: z.ZodType< - OpenResponsesRequestMaxPrice$Outbound, - OpenResponsesRequestMaxPrice -> = z.object({ - prompt: z.any().optional(), - completion: z.any().optional(), - image: z.any().optional(), - audio: z.any().optional(), - request: z.any().optional(), -}); +export const MaxPrice$outboundSchema: z.ZodType = z + .object({ + prompt: z.any().optional(), + completion: z.any().optional(), + image: z.any().optional(), + audio: z.any().optional(), + request: z.any().optional(), + }); -export function openResponsesRequestMaxPriceToJSON( - openResponsesRequestMaxPrice: OpenResponsesRequestMaxPrice, -): string { - return JSON.stringify( - OpenResponsesRequestMaxPrice$outboundSchema.parse( - openResponsesRequestMaxPrice, - ), - ); +export function maxPriceToJSON(maxPrice: MaxPrice): string { + return JSON.stringify(MaxPrice$outboundSchema.parse(maxPrice)); } /** @internal */ -export type OpenResponsesRequestProvider$Outbound = { +export type Provider$Outbound = { allow_fallbacks?: boolean | null | undefined; require_parameters?: boolean | null | undefined; data_collection?: string | null | undefined; zdr?: boolean | null | undefined; enforce_distillable_text?: boolean | null | undefined; - order?: Array | undefined; - only?: Array | undefined; - ignore?: Array | undefined; + order?: Array | null | undefined; + only?: Array | null | undefined; + ignore?: Array | null | undefined; quantizations?: Array | null | undefined; sort?: string | null | undefined; - max_price?: OpenResponsesRequestMaxPrice$Outbound | undefined; + max_price?: MaxPrice$Outbound | undefined; }; /** @internal */ -export const OpenResponsesRequestProvider$outboundSchema: z.ZodType< - OpenResponsesRequestProvider$Outbound, - OpenResponsesRequestProvider -> = z.object({ - allowFallbacks: z.nullable(z.boolean()).optional(), - requireParameters: z.nullable(z.boolean()).optional(), - dataCollection: z.nullable(DataCollection$outboundSchema).optional(), - zdr: z.nullable(z.boolean()).optional(), - enforceDistillableText: z.nullable(z.boolean()).optional(), - order: z.array(z.string()).optional(), - only: z.array(z.string()).optional(), - ignore: z.array(z.string()).optional(), - quantizations: z.nullable(z.array(Quantization$outboundSchema)).optional(), - sort: z.nullable(ProviderSort$outboundSchema).optional(), - maxPrice: z.lazy(() => OpenResponsesRequestMaxPrice$outboundSchema) - .optional(), -}).transform((v) => { - return remap$(v, { - allowFallbacks: "allow_fallbacks", - requireParameters: "require_parameters", - dataCollection: "data_collection", - enforceDistillableText: "enforce_distillable_text", - maxPrice: "max_price", +export const Provider$outboundSchema: z.ZodType = z + .object({ + allowFallbacks: z.nullable(z.boolean()).optional(), + requireParameters: z.nullable(z.boolean()).optional(), + dataCollection: z.nullable(DataCollection$outboundSchema).optional(), + zdr: z.nullable(z.boolean()).optional(), + enforceDistillableText: z.nullable(z.boolean()).optional(), + order: z.nullable( + z.array(z.union([ProviderName$outboundSchema, z.string()])), + ).optional(), + only: z.nullable( + z.array(z.union([ProviderName$outboundSchema, z.string()])), + ).optional(), + ignore: z.nullable( + z.array(z.union([ProviderName$outboundSchema, z.string()])), + ).optional(), + quantizations: z.nullable(z.array(Quantization$outboundSchema)).optional(), + sort: z.nullable(ProviderSort$outboundSchema).optional(), + maxPrice: z.lazy(() => MaxPrice$outboundSchema).optional(), + }).transform((v) => { + return remap$(v, { + allowFallbacks: "allow_fallbacks", + requireParameters: "require_parameters", + dataCollection: "data_collection", + enforceDistillableText: "enforce_distillable_text", + maxPrice: "max_price", + }); }); -}); -export function openResponsesRequestProviderToJSON( - openResponsesRequestProvider: OpenResponsesRequestProvider, -): string { - return JSON.stringify( - OpenResponsesRequestProvider$outboundSchema.parse( - openResponsesRequestProvider, - ), - ); +export function providerToJSON(provider: Provider): string { + return JSON.stringify(Provider$outboundSchema.parse(provider)); } /** @internal */ @@ -460,60 +495,49 @@ export const IdFileParser$outboundSchema: z.ZodEnum = z .enum(IdFileParser); /** @internal */ -export const OpenResponsesRequestPdfEngine$outboundSchema: z.ZodType< - string, - OpenResponsesRequestPdfEngine -> = openEnums.outboundSchema(OpenResponsesRequestPdfEngine); +export const PdfEngine$outboundSchema: z.ZodType = openEnums + .outboundSchema(PdfEngine); /** @internal */ -export type OpenResponsesRequestPdf$Outbound = { +export type Pdf$Outbound = { engine?: string | undefined; }; /** @internal */ -export const OpenResponsesRequestPdf$outboundSchema: z.ZodType< - OpenResponsesRequestPdf$Outbound, - OpenResponsesRequestPdf -> = z.object({ - engine: OpenResponsesRequestPdfEngine$outboundSchema.optional(), +export const Pdf$outboundSchema: z.ZodType = z.object({ + engine: PdfEngine$outboundSchema.optional(), }); -export function openResponsesRequestPdfToJSON( - openResponsesRequestPdf: OpenResponsesRequestPdf, -): string { - return JSON.stringify( - OpenResponsesRequestPdf$outboundSchema.parse(openResponsesRequestPdf), - ); +export function pdfToJSON(pdf: Pdf): string { + return JSON.stringify(Pdf$outboundSchema.parse(pdf)); } /** @internal */ -export type OpenResponsesRequestPluginFileParser$Outbound = { +export type PluginFileParser$Outbound = { id: string; max_files?: number | undefined; - pdf?: OpenResponsesRequestPdf$Outbound | undefined; + pdf?: Pdf$Outbound | undefined; }; /** @internal */ -export const OpenResponsesRequestPluginFileParser$outboundSchema: z.ZodType< - OpenResponsesRequestPluginFileParser$Outbound, - OpenResponsesRequestPluginFileParser +export const PluginFileParser$outboundSchema: z.ZodType< + PluginFileParser$Outbound, + PluginFileParser > = z.object({ id: IdFileParser$outboundSchema, maxFiles: z.number().optional(), - pdf: z.lazy(() => OpenResponsesRequestPdf$outboundSchema).optional(), + pdf: z.lazy(() => Pdf$outboundSchema).optional(), }).transform((v) => { return remap$(v, { maxFiles: "max_files", }); }); -export function openResponsesRequestPluginFileParserToJSON( - openResponsesRequestPluginFileParser: OpenResponsesRequestPluginFileParser, +export function pluginFileParserToJSON( + pluginFileParser: PluginFileParser, ): string { return JSON.stringify( - OpenResponsesRequestPluginFileParser$outboundSchema.parse( - openResponsesRequestPluginFileParser, - ), + PluginFileParser$outboundSchema.parse(pluginFileParser), ); } @@ -521,13 +545,11 @@ export function openResponsesRequestPluginFileParserToJSON( export const IdWeb$outboundSchema: z.ZodEnum = z.enum(IdWeb); /** @internal */ -export const OpenResponsesRequestEngine$outboundSchema: z.ZodType< - string, - OpenResponsesRequestEngine -> = openEnums.outboundSchema(OpenResponsesRequestEngine); +export const Engine$outboundSchema: z.ZodType = openEnums + .outboundSchema(Engine); /** @internal */ -export type OpenResponsesRequestPluginWeb$Outbound = { +export type PluginWeb$Outbound = { id: string; max_results?: number | undefined; search_prompt?: string | undefined; @@ -535,14 +557,14 @@ export type OpenResponsesRequestPluginWeb$Outbound = { }; /** @internal */ -export const OpenResponsesRequestPluginWeb$outboundSchema: z.ZodType< - OpenResponsesRequestPluginWeb$Outbound, - OpenResponsesRequestPluginWeb +export const PluginWeb$outboundSchema: z.ZodType< + PluginWeb$Outbound, + PluginWeb > = z.object({ id: IdWeb$outboundSchema, maxResults: z.number().optional(), searchPrompt: z.string().optional(), - engine: OpenResponsesRequestEngine$outboundSchema.optional(), + engine: Engine$outboundSchema.optional(), }).transform((v) => { return remap$(v, { maxResults: "max_results", @@ -550,14 +572,8 @@ export const OpenResponsesRequestPluginWeb$outboundSchema: z.ZodType< }); }); -export function openResponsesRequestPluginWebToJSON( - openResponsesRequestPluginWeb: OpenResponsesRequestPluginWeb, -): string { - return JSON.stringify( - OpenResponsesRequestPluginWeb$outboundSchema.parse( - openResponsesRequestPluginWeb, - ), - ); +export function pluginWebToJSON(pluginWeb: PluginWeb): string { + return JSON.stringify(PluginWeb$outboundSchema.parse(pluginWeb)); } /** @internal */ @@ -565,52 +581,42 @@ export const IdModeration$outboundSchema: z.ZodEnum = z .enum(IdModeration); /** @internal */ -export type OpenResponsesRequestPluginModeration$Outbound = { +export type PluginModeration$Outbound = { id: string; }; /** @internal */ -export const OpenResponsesRequestPluginModeration$outboundSchema: z.ZodType< - OpenResponsesRequestPluginModeration$Outbound, - OpenResponsesRequestPluginModeration +export const PluginModeration$outboundSchema: z.ZodType< + PluginModeration$Outbound, + PluginModeration > = z.object({ id: IdModeration$outboundSchema, }); -export function openResponsesRequestPluginModerationToJSON( - openResponsesRequestPluginModeration: OpenResponsesRequestPluginModeration, +export function pluginModerationToJSON( + pluginModeration: PluginModeration, ): string { return JSON.stringify( - OpenResponsesRequestPluginModeration$outboundSchema.parse( - openResponsesRequestPluginModeration, - ), + PluginModeration$outboundSchema.parse(pluginModeration), ); } /** @internal */ -export type OpenResponsesRequestPluginUnion$Outbound = - | OpenResponsesRequestPluginModeration$Outbound - | OpenResponsesRequestPluginWeb$Outbound - | OpenResponsesRequestPluginFileParser$Outbound; +export type Plugin$Outbound = + | PluginModeration$Outbound + | PluginWeb$Outbound + | PluginFileParser$Outbound; /** @internal */ -export const OpenResponsesRequestPluginUnion$outboundSchema: z.ZodType< - OpenResponsesRequestPluginUnion$Outbound, - OpenResponsesRequestPluginUnion -> = z.union([ - z.lazy(() => OpenResponsesRequestPluginModeration$outboundSchema), - z.lazy(() => OpenResponsesRequestPluginWeb$outboundSchema), - z.lazy(() => OpenResponsesRequestPluginFileParser$outboundSchema), -]); - -export function openResponsesRequestPluginUnionToJSON( - openResponsesRequestPluginUnion: OpenResponsesRequestPluginUnion, -): string { - return JSON.stringify( - OpenResponsesRequestPluginUnion$outboundSchema.parse( - openResponsesRequestPluginUnion, - ), - ); +export const Plugin$outboundSchema: z.ZodType = z + .union([ + z.lazy(() => PluginModeration$outboundSchema), + z.lazy(() => PluginWeb$outboundSchema), + z.lazy(() => PluginFileParser$outboundSchema), + ]); + +export function pluginToJSON(plugin: Plugin): string { + return JSON.stringify(Plugin$outboundSchema.parse(plugin)); } /** @internal */ @@ -647,12 +653,10 @@ export type OpenResponsesRequest$Outbound = { service_tier?: string | null | undefined; truncation?: string | null | undefined; stream: boolean; - provider?: OpenResponsesRequestProvider$Outbound | null | undefined; + provider?: Provider$Outbound | null | undefined; plugins?: | Array< - | OpenResponsesRequestPluginModeration$Outbound - | OpenResponsesRequestPluginWeb$Outbound - | OpenResponsesRequestPluginFileParser$Outbound + PluginModeration$Outbound | PluginWeb$Outbound | PluginFileParser$Outbound > | undefined; user?: string | undefined; @@ -696,14 +700,12 @@ export const OpenResponsesRequest$outboundSchema: z.ZodType< serviceTier: z.nullable(ServiceTier$outboundSchema).optional(), truncation: z.nullable(Truncation$outboundSchema).optional(), stream: z.boolean().default(false), - provider: z.nullable( - z.lazy(() => OpenResponsesRequestProvider$outboundSchema), - ).optional(), + provider: z.nullable(z.lazy(() => Provider$outboundSchema)).optional(), plugins: z.array( z.union([ - z.lazy(() => OpenResponsesRequestPluginModeration$outboundSchema), - z.lazy(() => OpenResponsesRequestPluginWeb$outboundSchema), - z.lazy(() => OpenResponsesRequestPluginFileParser$outboundSchema), + z.lazy(() => PluginModeration$outboundSchema), + z.lazy(() => PluginWeb$outboundSchema), + z.lazy(() => PluginFileParser$outboundSchema), ]), ).optional(), user: z.string().optional(), diff --git a/src/models/operations/createembeddings.ts b/src/models/operations/createembeddings.ts index 14b8df88..9b438cc4 100644 --- a/src/models/operations/createembeddings.ts +++ b/src/models/operations/createembeddings.ts @@ -54,14 +54,35 @@ export const EncodingFormat = { } as const; export type EncodingFormat = OpenEnum; +export type Order = models.ProviderName | string; + +export type Only = models.ProviderName | string; + +export type Ignore = models.ProviderName | string; + /** * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. */ export type MaxPrice = { + /** + * A value in string or number format that is a large number + */ prompt?: any | undefined; + /** + * A value in string or number format that is a large number + */ completion?: any | undefined; + /** + * A value in string or number format that is a large number + */ image?: any | undefined; + /** + * A value in string or number format that is a large number + */ audio?: any | undefined; + /** + * A value in string or number format that is a large number + */ request?: any | undefined; }; @@ -98,15 +119,15 @@ export type CreateEmbeddingsProvider = { /** * 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. */ - order?: Array | undefined; + order?: Array | null | undefined; /** * List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. */ - only?: Array | undefined; + only?: Array | null | undefined; /** * List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. */ - ignore?: Array | undefined; + ignore?: Array | null | undefined; /** * A list of quantization levels to filter the provider by. */ @@ -302,6 +323,43 @@ export function inputUnionToJSON(inputUnion: InputUnion): string { export const EncodingFormat$outboundSchema: z.ZodType = openEnums.outboundSchema(EncodingFormat); +/** @internal */ +export type Order$Outbound = string | string; + +/** @internal */ +export const Order$outboundSchema: z.ZodType = z.union([ + models.ProviderName$outboundSchema, + z.string(), +]); + +export function orderToJSON(order: Order): string { + return JSON.stringify(Order$outboundSchema.parse(order)); +} + +/** @internal */ +export type Only$Outbound = string | string; + +/** @internal */ +export const Only$outboundSchema: z.ZodType = z.union([ + models.ProviderName$outboundSchema, + z.string(), +]); + +export function onlyToJSON(only: Only): string { + return JSON.stringify(Only$outboundSchema.parse(only)); +} + +/** @internal */ +export type Ignore$Outbound = string | string; + +/** @internal */ +export const Ignore$outboundSchema: z.ZodType = z + .union([models.ProviderName$outboundSchema, z.string()]); + +export function ignoreToJSON(ignore: Ignore): string { + return JSON.stringify(Ignore$outboundSchema.parse(ignore)); +} + /** @internal */ export type MaxPrice$Outbound = { prompt?: any | undefined; @@ -332,9 +390,9 @@ export type CreateEmbeddingsProvider$Outbound = { data_collection?: string | null | undefined; zdr?: boolean | null | undefined; enforce_distillable_text?: boolean | null | undefined; - order?: Array | undefined; - only?: Array | undefined; - ignore?: Array | undefined; + order?: Array | null | undefined; + only?: Array | null | undefined; + ignore?: Array | null | undefined; quantizations?: Array | null | undefined; sort?: string | null | undefined; max_price?: MaxPrice$Outbound | undefined; @@ -350,9 +408,15 @@ export const CreateEmbeddingsProvider$outboundSchema: z.ZodType< dataCollection: z.nullable(models.DataCollection$outboundSchema).optional(), zdr: z.nullable(z.boolean()).optional(), enforceDistillableText: z.nullable(z.boolean()).optional(), - order: z.array(z.string()).optional(), - only: z.array(z.string()).optional(), - ignore: z.array(z.string()).optional(), + order: z.nullable( + z.array(z.union([models.ProviderName$outboundSchema, z.string()])), + ).optional(), + only: z.nullable( + z.array(z.union([models.ProviderName$outboundSchema, z.string()])), + ).optional(), + ignore: z.nullable( + z.array(z.union([models.ProviderName$outboundSchema, z.string()])), + ).optional(), quantizations: z.nullable(z.array(models.Quantization$outboundSchema)) .optional(), sort: z.nullable(models.ProviderSort$outboundSchema).optional(), diff --git a/src/models/providername.ts b/src/models/providername.ts index 7b1a6798..484fdb81 100644 --- a/src/models/providername.ts +++ b/src/models/providername.ts @@ -75,3 +75,6 @@ export type ProviderName = OpenEnum; /** @internal */ export const ProviderName$inboundSchema: z.ZodType = openEnums.inboundSchema(ProviderName); +/** @internal */ +export const ProviderName$outboundSchema: z.ZodType = + openEnums.outboundSchema(ProviderName); diff --git a/src/models/publicendpoint.ts b/src/models/publicendpoint.ts index e60805b4..dcf76d88 100644 --- a/src/models/publicendpoint.ts +++ b/src/models/publicendpoint.ts @@ -17,17 +17,53 @@ import { Parameter, Parameter$inboundSchema } from "./parameter.js"; import { ProviderName, ProviderName$inboundSchema } from "./providername.js"; export type Pricing = { + /** + * A value in string or number format that is a large number + */ prompt?: any | undefined; + /** + * A value in string or number format that is a large number + */ completion?: any | undefined; + /** + * A value in string or number format that is a large number + */ request?: any | undefined; + /** + * A value in string or number format that is a large number + */ image?: any | undefined; + /** + * A value in string or number format that is a large number + */ imageToken?: any | undefined; + /** + * A value in string or number format that is a large number + */ imageOutput?: any | undefined; + /** + * A value in string or number format that is a large number + */ audio?: any | undefined; + /** + * A value in string or number format that is a large number + */ inputAudioCache?: any | undefined; + /** + * A value in string or number format that is a large number + */ webSearch?: any | undefined; + /** + * A value in string or number format that is a large number + */ internalReasoning?: any | undefined; + /** + * A value in string or number format that is a large number + */ inputCacheRead?: any | undefined; + /** + * A value in string or number format that is a large number + */ inputCacheWrite?: any | undefined; discount?: number | undefined; }; diff --git a/src/models/publicpricing.ts b/src/models/publicpricing.ts index 7c0811c5..831812c2 100644 --- a/src/models/publicpricing.ts +++ b/src/models/publicpricing.ts @@ -12,17 +12,53 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js"; * Pricing information for the model */ export type PublicPricing = { + /** + * A value in string or number format that is a large number + */ prompt?: any | undefined; + /** + * A value in string or number format that is a large number + */ completion?: any | undefined; + /** + * A value in string or number format that is a large number + */ request?: any | undefined; + /** + * A value in string or number format that is a large number + */ image?: any | undefined; + /** + * A value in string or number format that is a large number + */ imageToken?: any | undefined; + /** + * A value in string or number format that is a large number + */ imageOutput?: any | undefined; + /** + * A value in string or number format that is a large number + */ audio?: any | undefined; + /** + * A value in string or number format that is a large number + */ inputAudioCache?: any | undefined; + /** + * A value in string or number format that is a large number + */ webSearch?: any | undefined; + /** + * A value in string or number format that is a large number + */ internalReasoning?: any | undefined; + /** + * A value in string or number format that is a large number + */ inputCacheRead?: any | undefined; + /** + * A value in string or number format that is a large number + */ inputCacheWrite?: any | undefined; discount?: number | undefined; }; diff --git a/src/models/schema0.ts b/src/models/schema0.ts deleted file mode 100644 index 66e7c873..00000000 --- a/src/models/schema0.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v4"; -import { safeParse } from "../lib/schemas.js"; -import * as openEnums from "../types/enums.js"; -import { OpenEnum } from "../types/enums.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; - -export const Schema0Enum = { - Ai21: "AI21", - AionLabs: "AionLabs", - Alibaba: "Alibaba", - AmazonBedrock: "Amazon Bedrock", - Anthropic: "Anthropic", - Arcee: "Arcee", - AtlasCloud: "AtlasCloud", - Avian: "Avian", - Azure: "Azure", - BaseTen: "BaseTen", - BlackForestLabs: "Black Forest Labs", - Cerebras: "Cerebras", - Chutes: "Chutes", - Cirrascale: "Cirrascale", - Clarifai: "Clarifai", - Cloudflare: "Cloudflare", - Cohere: "Cohere", - Crusoe: "Crusoe", - DeepInfra: "DeepInfra", - DeepSeek: "DeepSeek", - Featherless: "Featherless", - Fireworks: "Fireworks", - Friendli: "Friendli", - GMICloud: "GMICloud", - Google: "Google", - GoogleAIStudio: "Google AI Studio", - Groq: "Groq", - Hyperbolic: "Hyperbolic", - Inception: "Inception", - InferenceNet: "InferenceNet", - Infermatic: "Infermatic", - Inflection: "Inflection", - Liquid: "Liquid", - Mancer2: "Mancer 2", - Minimax: "Minimax", - ModelRun: "ModelRun", - Mistral: "Mistral", - Modular: "Modular", - MoonshotAI: "Moonshot AI", - Morph: "Morph", - NCompass: "NCompass", - Nebius: "Nebius", - NextBit: "NextBit", - Novita: "Novita", - Nvidia: "Nvidia", - OpenAI: "OpenAI", - OpenInference: "OpenInference", - Parasail: "Parasail", - Perplexity: "Perplexity", - Phala: "Phala", - Relace: "Relace", - SambaNova: "SambaNova", - SiliconFlow: "SiliconFlow", - Stealth: "Stealth", - Switchpoint: "Switchpoint", - Targon: "Targon", - Together: "Together", - Venice: "Venice", - WandB: "WandB", - XAI: "xAI", - ZAi: "Z.AI", - FakeProvider: "FakeProvider", -} as const; -export type Schema0Enum = OpenEnum; - -export type Schema0 = Schema0Enum | string; - -/** @internal */ -export const Schema0Enum$inboundSchema: z.ZodType = - openEnums.inboundSchema(Schema0Enum); -/** @internal */ -export const Schema0Enum$outboundSchema: z.ZodType = - openEnums.outboundSchema(Schema0Enum); - -/** @internal */ -export const Schema0$inboundSchema: z.ZodType = z.union([ - Schema0Enum$inboundSchema, - z.string(), -]); -/** @internal */ -export type Schema0$Outbound = string | string; - -/** @internal */ -export const Schema0$outboundSchema: z.ZodType = z - .union([Schema0Enum$outboundSchema, z.string()]); - -export function schema0ToJSON(schema0: Schema0): string { - return JSON.stringify(Schema0$outboundSchema.parse(schema0)); -} -export function schema0FromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Schema0$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Schema0' from JSON`, - ); -} diff --git a/tests/e2e/chat.test.ts b/tests/e2e/chat.test.ts index 9061eff7..2de98443 100644 --- a/tests/e2e/chat.test.ts +++ b/tests/e2e/chat.test.ts @@ -1,5 +1,6 @@ import { beforeAll, describe, expect, it } from "vitest"; import { OpenRouter } from "../../src/sdk/sdk.js"; +import { ChatStreamingResponseChunkData } from "../../src/models/chatstreamingresponsechunk.js"; describe("Chat E2E Tests", () => { let client: OpenRouter; @@ -111,7 +112,7 @@ describe("Chat E2E Tests", () => { expect(response).toBeDefined(); - const chunks: any[] = []; + const chunks: ChatStreamingResponseChunkData[] = []; for await (const chunk of response) { expect(chunk).toBeDefined();