diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 27524edd..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: bc2a17a8bdced4449c22e8cb27f02be5 + docChecksum: 06c725cfe764dbed9c3f85ff06857003 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.13 + configChecksum: 1bbbf76f0f625fbac8a29bd3ed9222e1 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 @@ -74,6 +74,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 @@ -294,6 +296,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 +317,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 @@ -340,7 +342,9 @@ generatedFiles: - 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 @@ -358,9 +362,10 @@ generatedFiles: - 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 @@ -399,6 +404,7 @@ generatedFiles: - 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 @@ -469,7 +475,6 @@ generatedFiles: - 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 +513,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 +588,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 @@ -596,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 @@ -607,6 +611,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 +725,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 diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index eadf15d5..7a05cf81 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.13 acceptHeaderEnum: false additionalDependencies: dependencies: {} diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml index 3923d43c..82b30d29 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,47 +3425,44 @@ components: - computer_call_output.output.image_url - reasoning.encrypted_content - code_interpreter_call.outputs + DataCollection: + type: string + nullable: true + enum: + - 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 ProviderName: type: string 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 + - Arcee - AtlasCloud - - Atoma - Avian - Azure - BaseTen + - Black Forest Labs - Cerebras - Chutes - Cirrascale - Clarifai - Cloudflare - Cohere - - CrofAI - Crusoe - DeepInfra - DeepSeek - - Enfer - Featherless - Fireworks - Friendli @@ -3476,12 +3475,8 @@ components: - InferenceNet - Infermatic - Inflection - - InoCloud - - Kluster - - Lambda - Liquid - Mancer 2 - - Meta - Minimax - ModelRun - Mistral @@ -3491,7 +3486,6 @@ components: - NCompass - Nebius - NextBit - - Nineteen - Novita - Nvidia - OpenAI @@ -3506,7 +3500,6 @@ components: - Switchpoint - Targon - Together - - Ubicloud - Venice - WandB - xAI @@ -3526,6 +3519,17 @@ components: - fp32 - unknown example: fp16 + 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 BigNumberUnion: anyOf: - type: number @@ -3664,19 +3668,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 @@ -3729,16 +3721,7 @@ 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: @@ -3970,6 +3953,8 @@ components: $ref: '#/components/schemas/BigNumberUnion' image: $ref: '#/components/schemas/BigNumberUnion' + image_token: + $ref: '#/components/schemas/BigNumberUnion' image_output: $ref: '#/components/schemas/BigNumberUnion' audio: @@ -4407,6 +4392,8 @@ components: $ref: '#/components/schemas/BigNumberUnion' image: $ref: '#/components/schemas/BigNumberUnion' + image_token: + $ref: '#/components/schemas/BigNumberUnion' image_output: $ref: '#/components/schemas/BigNumberUnion' audio: @@ -4590,10 +4577,6 @@ components: status: default uptime_last_30m: 99.5 supports_implicit_caching: true - __schema0: - anyOf: - - $ref: '#/components/schemas/ChatCompletionFinishReason' - - type: 'null' ModelName: type: string ChatMessageContentItemText: @@ -4657,21 +4640,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 +4686,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: @@ -4809,13 +4810,15 @@ components: - prompt_tokens - total_tokens ChatCompletionFinishReason: - type: string - enum: - - tool_calls - - stop - - length - - content_filter - - error + anyOf: + - type: string + enum: + - tool_calls + - stop + - length + - content_filter + - error + - type: 'null' JSONSchemaConfig: type: object properties: @@ -5087,6 +5090,7 @@ components: anyOf: - type: string enum: + - none - minimal - low - medium @@ -5172,7 +5176,7 @@ components: type: object properties: finish_reason: - $ref: '#/components/schemas/__schema0' + $ref: '#/components/schemas/ChatCompletionFinishReason' index: type: number message: @@ -5233,7 +5237,7 @@ components: delta: $ref: '#/components/schemas/ChatStreamingMessageChunk' finish_reason: - $ref: '#/components/schemas/__schema0' + $ref: '#/components/schemas/ChatCompletionFinishReason' index: type: number logprobs: @@ -5972,8 +5976,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 +6048,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 @@ -6061,16 +6101,7 @@ 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: @@ -6088,15 +6119,7 @@ paths: 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 +6727,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 +6754,8 @@ paths: - InferenceNet - Infermatic - Inflection - - Kluster - - Lambda - Liquid - Mancer 2 - - Meta - Minimax - ModelRun - Mistral @@ -6746,7 +6765,6 @@ paths: - NCompass - Nebius - NextBit - - Nineteen - Novita - Nvidia - OpenAI @@ -6761,7 +6779,6 @@ paths: - Switchpoint - Targon - Together - - Ubicloud - Venice - WandB - xAI diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index fdcaa293..438627b1 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,47 +3442,44 @@ components: - reasoning.encrypted_content - code_interpreter_call.outputs x-speakeasy-unknown-values: allow + DataCollection: + type: string + nullable: true + enum: + - 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 ProviderName: type: string 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 + - Arcee - AtlasCloud - - Atoma - Avian - Azure - BaseTen + - Black Forest Labs - Cerebras - Chutes - Cirrascale - Clarifai - Cloudflare - Cohere - - CrofAI - Crusoe - DeepInfra - DeepSeek - - Enfer - Featherless - Fireworks - Friendli @@ -3493,12 +3492,8 @@ components: - InferenceNet - Infermatic - Inflection - - InoCloud - - Kluster - - Lambda - Liquid - Mancer 2 - - Meta - Minimax - ModelRun - Mistral @@ -3508,7 +3503,6 @@ components: - NCompass - Nebius - NextBit - - Nineteen - Novita - Nvidia - OpenAI @@ -3523,7 +3517,6 @@ components: - Switchpoint - Targon - Together - - Ubicloud - Venice - WandB - xAI @@ -3545,6 +3538,17 @@ components: - unknown example: fp16 x-speakeasy-unknown-values: allow + 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 BigNumberUnion: anyOf: - type: number @@ -3683,20 +3687,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 @@ -3743,16 +3734,7 @@ 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: @@ -3984,6 +3966,8 @@ components: $ref: '#/components/schemas/BigNumberUnion' image: $ref: '#/components/schemas/BigNumberUnion' + image_token: + $ref: '#/components/schemas/BigNumberUnion' image_output: $ref: '#/components/schemas/BigNumberUnion' audio: @@ -4428,6 +4412,8 @@ components: $ref: '#/components/schemas/BigNumberUnion' image: $ref: '#/components/schemas/BigNumberUnion' + image_token: + $ref: '#/components/schemas/BigNumberUnion' image_output: $ref: '#/components/schemas/BigNumberUnion' audio: @@ -4611,10 +4597,6 @@ components: status: default uptime_last_30m: 99.5 supports_implicit_caching: true - __schema0: - anyOf: - - $ref: '#/components/schemas/ChatCompletionFinishReason' - - type: 'null' ModelName: type: string ChatMessageContentItemText: @@ -4680,21 +4662,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 +4708,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: @@ -4832,14 +4832,16 @@ components: - prompt_tokens - total_tokens ChatCompletionFinishReason: - type: string - enum: - - tool_calls - - stop - - length - - content_filter - - error - x-speakeasy-unknown-values: allow + anyOf: + - type: string + enum: + - tool_calls + - stop + - length + - content_filter + - error + x-speakeasy-unknown-values: allow + - type: 'null' JSONSchemaConfig: type: object properties: @@ -5111,6 +5113,7 @@ components: anyOf: - type: string enum: + - none - minimal - low - medium @@ -5197,7 +5200,7 @@ components: type: object properties: finish_reason: - $ref: '#/components/schemas/__schema0' + $ref: '#/components/schemas/ChatCompletionFinishReason' index: type: number message: @@ -5258,7 +5261,7 @@ components: delta: $ref: '#/components/schemas/ChatStreamingMessageChunk' finish_reason: - $ref: '#/components/schemas/__schema0' + $ref: '#/components/schemas/ChatCompletionFinishReason' index: type: number logprobs: @@ -5998,8 +6001,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 +6071,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 @@ -6079,16 +6118,7 @@ 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: @@ -6105,15 +6135,7 @@ paths: 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 +6731,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 +6758,8 @@ paths: - InferenceNet - Infermatic - Inflection - - Kluster - - Lambda - Liquid - Mancer 2 - - Meta - Minimax - ModelRun - Mistral @@ -6751,7 +6769,6 @@ paths: - NCompass - Nebius - NextBit - - Nineteen - Novita - Nvidia - OpenAI @@ -6766,7 +6783,6 @@ paths: - Switchpoint - Targon - Together - - Ubicloud - Venice - WandB - xAI diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 12bf61b6..11d30cc3 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:fc0c90dc8ebb69ef4a571e4e63dcd7f8f33c3254c17ad2583b628fbbf3d1ac05 + sourceBlobDigest: sha256:635d63fd18db468c1dcc23700382af788de76594ba3b8292fae9b14c0e5c22c4 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:fc0c90dc8ebb69ef4a571e4e63dcd7f8f33c3254c17ad2583b628fbbf3d1ac05 + sourceBlobDigest: sha256:635d63fd18db468c1dcc23700382af788de76594ba3b8292fae9b14c0e5c22c4 codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:e30bf4d24076522aaf92aa570cc8b7ba008d86e9a36336d815e99dbf154d3b47 + codeSamplesRevisionDigest: sha256:bc8ca65272c07cd10a6fa41d591e264cc50d05d154c91c00678028f2977ff124 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/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/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/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/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..ec0ee2bd 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. | | | `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/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/sort.md b/docs/models/operations/sort.md deleted file mode 100644 index 46237bad..00000000 --- a/docs/models/operations/sort.md +++ /dev/null @@ -1,19 +0,0 @@ -# Sort - -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/operations"; - -let value: Sort = "price"; -``` - -## 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/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/pricing.md b/docs/models/pricing.md index 84e797d7..97324713 100644 --- a/docs/models/pricing.md +++ b/docs/models/pricing.md @@ -19,6 +19,7 @@ let value: Pricing = { | `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 | diff --git a/docs/models/provider.md b/docs/models/provider.md index a4c5d100..6f276ca2 100644 --- a/docs/models/provider.md +++ b/docs/models/provider.md @@ -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. | | | `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 | +| `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.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/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..db3016aa 100644 --- a/docs/models/publicpricing.md +++ b/docs/models/publicpricing.md @@ -21,6 +21,7 @@ let value: PublicPricing = { | `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 | 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..bc61e2dd 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "0.1.11", + "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 074b4c02..a5810514 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@openrouter/sdk", - "version": "0.1.11", + "version": "0.1.13", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@openrouter/sdk", - "version": "0.1.11", + "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 c4ff254d..7c7b4a28 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "0.1.11", + "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 516c1e42..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.11", - genVersion: "2.750.0", - userAgent: "speakeasy-sdk/typescript 0.1.11 2.750.0 1.0.0 @openrouter/sdk", + sdkVersion: "0.1.13", + genVersion: "2.755.9", + userAgent: "speakeasy-sdk/typescript 0.1.13 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..b50b2dac 100644 --- a/src/models/chatgenerationparams.ts +++ b/src/models/chatgenerationparams.ts @@ -37,6 +37,7 @@ import { } from "./tooldefinitionjson.js"; export const Effort = { + None: "none", Minimal: "minimal", Low: "low", Medium: "medium", 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..6b604438 100644 --- a/src/models/chatresponsechoice.ts +++ b/src/models/chatresponsechoice.ts @@ -5,21 +5,34 @@ 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, AssistantMessage$inboundSchema, } from "./assistantmessage.js"; -import { - ChatCompletionFinishReason, - ChatCompletionFinishReason$inboundSchema, -} from "./chatcompletionfinishreason.js"; import { ChatMessageTokenLogprobs, ChatMessageTokenLogprobs$inboundSchema, } from "./chatmessagetokenlogprobs.js"; +import { + ChatStreamingMessageChunk, + ChatStreamingMessageChunk$inboundSchema, +} from "./chatstreamingmessagechunk.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.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: ChatCompletionFinishReason | null; index: number; @@ -27,6 +40,19 @@ export type ChatResponseChoice = { 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, @@ -51,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 c1a817ce..00000000 --- a/src/models/chatstreamingchoice.ts +++ /dev/null @@ -1,53 +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 { - ChatCompletionFinishReason, - ChatCompletionFinishReason$inboundSchema, -} from "./chatcompletionfinishreason.js"; -import { - ChatMessageTokenLogprobs, - ChatMessageTokenLogprobs$inboundSchema, -} from "./chatmessagetokenlogprobs.js"; -import { - ChatStreamingMessageChunk, - ChatStreamingMessageChunk$inboundSchema, -} from "./chatstreamingmessagechunk.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; - -export type ChatStreamingChoice = { - delta: ChatStreamingMessageChunk; - finishReason: ChatCompletionFinishReason | null; - index: number; - logprobs?: ChatMessageTokenLogprobs | null | undefined; -}; - -/** @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/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/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..f926df3b 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"; @@ -20,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"; @@ -31,6 +29,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 +99,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"; 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..142399b9 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, @@ -56,6 +60,7 @@ import { 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,45 +103,12 @@ 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. */ @@ -184,6 +156,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; @@ -214,7 +187,7 @@ 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. */ @@ -408,10 +381,6 @@ export const ServiceTier$outboundSchema: z.ZodType = 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; @@ -449,10 +418,6 @@ 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 = { prompt?: any | undefined; @@ -509,7 +474,7 @@ export const Provider$outboundSchema: z.ZodType = z z.array(z.union([ProviderName$outboundSchema, z.string()])), ).optional(), quantizations: z.nullable(z.array(Quantization$outboundSchema)).optional(), - sort: z.nullable(Sort$outboundSchema).optional(), + sort: z.nullable(ProviderSort$outboundSchema).optional(), maxPrice: z.lazy(() => MaxPrice$outboundSchema).optional(), }).transform((v) => { return remap$(v, { diff --git a/src/models/operations/createembeddings.ts b/src/models/operations/createembeddings.ts index f5bbe852..9b438cc4 100644 --- a/src/models/operations/createembeddings.ts +++ b/src/models/operations/createembeddings.ts @@ -11,31 +11,48 @@ import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import * as models from "../index.js"; -export type Input = +export const TypeImageURL = { + ImageUrl: "image_url", +} as const; +export type TypeImageURL = ClosedEnum; + +export type ImageUrl = { + url: string; +}; + +export type ContentImageURL = { + type: TypeImageURL; + imageUrl: ImageUrl; +}; + +export const TypeText = { + Text: "text", +} as const; +export type TypeText = ClosedEnum; + +export type ContentText = { + type: TypeText; + text: string; +}; + +export type Content = ContentText | ContentImageURL; + +export type Input = { + content: Array; +}; + +export type InputUnion = | string | Array | Array - | Array>; + | Array> + | Array; -/** - * 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 const EncodingFormat = { + Float: "float", + Base64: "base64", } 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 EncodingFormat = OpenEnum; export type Order = models.ProviderName | string; @@ -43,19 +60,6 @@ export type Only = models.ProviderName | string; export type Ignore = models.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. */ @@ -100,9 +104,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. */ @@ -130,31 +135,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,27 +195,133 @@ export type CreateEmbeddingsResponseBody = { export type CreateEmbeddingsResponse = CreateEmbeddingsResponseBody | string; /** @internal */ -export type Input$Outbound = +export const TypeImageURL$outboundSchema: z.ZodEnum = z + .enum(TypeImageURL); + +/** @internal */ +export type ImageUrl$Outbound = { + url: string; +}; + +/** @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 type ContentImageURL$Outbound = { + type: string; + image_url: ImageUrl$Outbound; +}; + +/** @internal */ +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 TypeText$outboundSchema: z.ZodEnum = z.enum( + TypeText, +); + +/** @internal */ +export type ContentText$Outbound = { + type: string; + text: string; +}; + +/** @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 Content$Outbound = ContentText$Outbound | ContentImageURL$Outbound; + +/** @internal */ +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 inputToJSON(input: Input): string { + return JSON.stringify(Input$outboundSchema.parse(input)); +} + +/** @internal */ +export type InputUnion$Outbound = | string | Array | Array - | Array>; + | Array> + | Array; /** @internal */ -export const Input$outboundSchema: z.ZodType = z.union([ +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 inputToJSON(input: Input): string { - return JSON.stringify(Input$outboundSchema.parse(input)); +export function inputUnionToJSON(inputUnion: InputUnion): string { + return JSON.stringify(InputUnion$outboundSchema.parse(inputUnion)); } /** @internal */ -export const DataCollection$outboundSchema: z.ZodType = - openEnums.outboundSchema(DataCollection); +export const EncodingFormat$outboundSchema: z.ZodType = + openEnums.outboundSchema(EncodingFormat); /** @internal */ export type Order$Outbound = string | string; @@ -254,10 +360,6 @@ 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 = { prompt?: any | undefined; @@ -303,7 +405,7 @@ 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( @@ -317,7 +419,7 @@ export const CreateEmbeddingsProvider$outboundSchema: z.ZodType< ).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 +439,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 +465,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..484fdb81 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", 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..dcf76d88 100644 --- a/src/models/publicendpoint.ts +++ b/src/models/publicendpoint.ts @@ -33,6 +33,10 @@ export type Pricing = { * 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 */ @@ -104,6 +108,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 +119,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..831812c2 100644 --- a/src/models/publicpricing.ts +++ b/src/models/publicpricing.ts @@ -28,6 +28,10 @@ export type PublicPricing = { * 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 */ @@ -66,6 +70,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 +81,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/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();