diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index b3edc423..c2713afd 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: 8e530fc8f007ea5179129b89d89ba958 + docChecksum: e929ecf569d79ab96a315332a4855566 docVersion: 1.0.0 speakeasyVersion: 1.666.0 generationVersion: 2.768.0 - releaseVersion: 0.2.9 - configChecksum: 12a255b210945a121402c22f63d8d8e5 + releaseVersion: 0.2.11 + configChecksum: e77ce69b2f427b72c26c9a5508fc1232 repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true @@ -59,10 +59,22 @@ generatedFiles: - docs/models/chatcompletionfinishreason.md - docs/models/chaterrorerror.md - docs/models/chatgenerationparams.md + - docs/models/chatgenerationparamsdatacollection.md + - docs/models/chatgenerationparamsengine.md + - docs/models/chatgenerationparamsmaxprice.md + - docs/models/chatgenerationparamspdf.md + - docs/models/chatgenerationparamspdfengine.md + - docs/models/chatgenerationparamspluginfileparser.md + - docs/models/chatgenerationparamspluginmoderation.md + - docs/models/chatgenerationparamspluginresponsehealing.md + - docs/models/chatgenerationparamspluginunion.md + - docs/models/chatgenerationparamspluginweb.md + - docs/models/chatgenerationparamsprovider.md - docs/models/chatgenerationparamsresponseformatjsonobject.md - docs/models/chatgenerationparamsresponseformatpython.md - docs/models/chatgenerationparamsresponseformattext.md - docs/models/chatgenerationparamsresponseformatunion.md + - docs/models/chatgenerationparamsroute.md - docs/models/chatgenerationparamsstop.md - docs/models/chatgenerationtokenusage.md - docs/models/chatmessagecontentitem.md @@ -112,7 +124,6 @@ generatedFiles: - docs/models/edgenetworktimeoutresponseerrordata.md - docs/models/effort.md - docs/models/endpointstatus.md - - docs/models/engine.md - docs/models/errors/badgatewayresponseerror.md - docs/models/errors/badrequestresponseerror.md - docs/models/errors/chaterror.md @@ -140,7 +151,6 @@ generatedFiles: - docs/models/internalserverresponseerrordata.md - docs/models/jsonschemaconfig.md - docs/models/listendpointsresponse.md - - docs/models/maxprice.md - docs/models/message.md - docs/models/messagecontent.md - docs/models/messagedeveloper.md @@ -242,6 +252,17 @@ generatedFiles: - docs/models/openresponsesreasoningsummarytextdoneevent.md - docs/models/openresponsesreasoningtype.md - docs/models/openresponsesrequest.md + - docs/models/openresponsesrequestengine.md + - docs/models/openresponsesrequestmaxprice.md + - docs/models/openresponsesrequestpdf.md + - docs/models/openresponsesrequestpdfengine.md + - docs/models/openresponsesrequestpluginfileparser.md + - docs/models/openresponsesrequestpluginmoderation.md + - docs/models/openresponsesrequestpluginresponsehealing.md + - docs/models/openresponsesrequestpluginunion.md + - docs/models/openresponsesrequestpluginweb.md + - docs/models/openresponsesrequestprovider.md + - docs/models/openresponsesrequestroute.md - docs/models/openresponsesrequesttoolfunction.md - docs/models/openresponsesrequesttoolunion.md - docs/models/openresponsesresponsetext.md @@ -288,6 +309,7 @@ generatedFiles: - docs/models/operations/createembeddingsprovider.md - docs/models/operations/createembeddingsrequest.md - docs/models/operations/createembeddingsresponse.md + - docs/models/operations/createembeddingsresponsebody.md - docs/models/operations/createkeysdata.md - docs/models/operations/createkeyslimitreset.md - docs/models/operations/createkeysrequest.md @@ -367,18 +389,10 @@ generatedFiles: - docs/models/part2.md - docs/models/payloadtoolargeresponseerrordata.md - docs/models/paymentrequiredresponseerrordata.md - - docs/models/pdf.md - - docs/models/pdfengine.md - docs/models/perrequestlimits.md - - docs/models/plugin.md - - docs/models/pluginfileparser.md - - docs/models/pluginmoderation.md - - docs/models/pluginresponsehealing.md - - docs/models/pluginweb.md - docs/models/pricing.md - docs/models/prompt.md - docs/models/prompttokensdetails.md - - docs/models/provider.md - docs/models/providername.md - docs/models/provideroverloadedresponseerrordata.md - docs/models/providersort.md @@ -386,6 +400,7 @@ generatedFiles: - docs/models/publicendpointquantization.md - docs/models/publicpricing.md - docs/models/quantization.md + - docs/models/quantizations.md - docs/models/reason.md - docs/models/reasoning.md - docs/models/reasoningsummarytext.md @@ -441,9 +456,12 @@ generatedFiles: - docs/models/responseswebsearchuserlocationtype.md - docs/models/responsetextconfig.md - docs/models/responsetextconfigverbosity.md + - docs/models/schema0.md + - docs/models/schema0enum.md - docs/models/security.md - docs/models/servicetier.md - docs/models/serviceunavailableresponseerrordata.md + - docs/models/sort.md - docs/models/streamoptions.md - docs/models/systemmessage.md - docs/models/systemmessagecontent.md @@ -710,6 +728,7 @@ generatedFiles: - src/models/responseswebsearchcalloutput.ts - src/models/responseswebsearchuserlocation.ts - src/models/responsetextconfig.ts + - src/models/schema0.ts - src/models/security.ts - src/models/serviceunavailableresponseerrordata.ts - src/models/systemmessage.ts @@ -1545,7 +1564,7 @@ examples: speakeasy-default-list-endpoints-zdr: responses: "200": - application/json: {"data": [{"name": "", "model_name": "", "context_length": 8891.09, "pricing": {"prompt": 1000, "completion": 1000}, "provider_name": "OpenAI", "tag": "", "quantization": "fp16", "max_completion_tokens": 4685.25, "max_prompt_tokens": 22.7, "supported_parameters": ["temperature"], "uptime_last_30m": 6060.66, "supports_implicit_caching": true}]} + application/json: {"data": [{"name": "", "model_name": "", "context_length": 8891.09, "pricing": {"prompt": "1000", "completion": "1000"}, "provider_name": "OpenAI", "tag": "", "quantization": "fp16", "max_completion_tokens": 4685.25, "max_prompt_tokens": 22.7, "supported_parameters": ["temperature"], "uptime_last_30m": 6060.66, "supports_implicit_caching": true}]} default: application/json: {"error": {"code": 400, "message": "Invalid request parameters", "metadata": {"field": "temperature", "reason": "Must be between 0 and 2"}}, "user_id": "user-abc123"} "500": diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 2548ae01..20adaa57 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -31,7 +31,7 @@ generation: skipResponseBodyAssertions: false preApplyUnionDiscriminators: true typescript: - version: 0.2.9 + version: 0.2.11 acceptHeaderEnum: false additionalDependencies: dependencies: {} diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml index b311b802..a5f339a6 100644 --- a/.speakeasy/in.openapi.yaml +++ b/.speakeasy/in.openapi.yaml @@ -1054,6 +1054,7 @@ components: type: string nullable: true enum: + - xhigh - high - medium - low @@ -3479,6 +3480,7 @@ components: - Infermatic - Inflection - Liquid + - Mara - Mancer 2 - Minimax - ModelRun @@ -3499,6 +3501,7 @@ components: - Relace - SambaNova - SiliconFlow + - Sourceful - Stealth - StreamLake - Switchpoint @@ -3506,6 +3509,7 @@ components: - Together - Venice - WandB + - Xiaomi - xAI - Z.AI - FakeProvider @@ -3535,12 +3539,8 @@ components: performed. example: price BigNumberUnion: - anyOf: - - type: number - - type: string - - type: number - example: 1000 - description: A value in string or number format that is a large number + type: string + description: A value in string format that is a large number example: 1000 OpenResponsesRequest: type: object @@ -3735,10 +3735,23 @@ components: $ref: '#/components/schemas/BigNumberUnion' request: $ref: '#/components/schemas/BigNumberUnion' - additionalProperties: false description: >- The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + min_throughput: + type: number + nullable: true + example: 100 + description: >- + The minimum throughput (in tokens per second) required for this request. Only providers serving the + model with at least this throughput will be used. + max_latency: + type: number + nullable: true + example: 5 + description: >- + The maximum latency (in seconds) allowed for this request. Only providers serving the model with better + than this latency will be used. additionalProperties: false description: When multiple model providers are available, optionally indicate your routing preference. plugins: @@ -3759,6 +3772,9 @@ components: type: string enum: - web + enabled: + type: boolean + description: Set to false to disable the web-search plugin for this request. Defaults to true. max_results: type: number search_prompt: @@ -3776,6 +3792,9 @@ components: type: string enum: - file-parser + enabled: + type: boolean + description: Set to false to disable the file-parser plugin for this request. Defaults to true. max_files: type: number pdf: @@ -3795,9 +3814,21 @@ components: type: string enum: - response-healing + enabled: + type: boolean + description: Set to false to disable the response-healing plugin for this request. Defaults to true. required: - id description: Plugins you want to enable for this request, including their settings. + route: + type: string + nullable: true + enum: + - fallback + - sort + description: >- + Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts + all endpoints together by routing criteria. user: type: string maxLength: 128 @@ -3805,6 +3836,13 @@ components: A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. + session_id: + type: string + maxLength: 128 + description: >- + A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for + observability. If provided in both the request body and the x-session-id header, the body value takes + precedence. Maximum of 128 characters. description: Request schema for Responses endpoint example: model: anthropic/claude-4.5-sonnet-20250929 @@ -4586,6 +4624,87 @@ components: uptime_last_30m: 99.5 supports_implicit_caching: true __schema0: + type: array + items: + anyOf: + - type: string + enum: + - AI21 + - AionLabs + - Alibaba + - Amazon Bedrock + - Amazon Nova + - Anthropic + - Arcee AI + - AtlasCloud + - Avian + - Azure + - BaseTen + - BytePlus + - Black Forest Labs + - Cerebras + - Chutes + - Cirrascale + - Clarifai + - Cloudflare + - Cohere + - Crusoe + - DeepInfra + - DeepSeek + - Featherless + - Fireworks + - Friendli + - GMICloud + - GoPomelo + - Google + - Google AI Studio + - Groq + - Hyperbolic + - Inception + - InferenceNet + - Infermatic + - Inflection + - Liquid + - Mara + - Mancer 2 + - Minimax + - ModelRun + - Mistral + - Modular + - Moonshot AI + - Morph + - NCompass + - Nebius + - NextBit + - Novita + - Nvidia + - OpenAI + - OpenInference + - Parasail + - Perplexity + - Phala + - Relace + - SambaNova + - SiliconFlow + - Sourceful + - Stealth + - StreamLake + - Switchpoint + - Targon + - Together + - Venice + - WandB + - Xiaomi + - xAI + - Z.AI + - FakeProvider + - type: string + __schema1: + anyOf: + - type: number + - type: string + - type: number + __schema2: anyOf: - $ref: '#/components/schemas/ChatCompletionFinishReason' - type: 'null' @@ -5043,6 +5162,214 @@ components: ChatGenerationParams: type: object properties: + provider: + description: When multiple model providers are available, optionally indicate your routing preference. + anyOf: + - type: object + properties: + allow_fallbacks: + description: > + Whether to allow backup providers to serve requests + + - true: (default) when the primary provider (or your custom providers in "order") is unavailable, + use the next best provider. + + - false: use only the primary/custom provider, and return the upstream error if it's unavailable. + anyOf: + - type: boolean + - type: 'null' + require_parameters: + description: >- + Whether to filter providers to only those that support the parameters you've provided. If this + setting is omitted or set to false, then providers will receive only the parameters they support, + and ignore the rest. + anyOf: + - type: boolean + - type: 'null' + data_collection: + description: >- + Data collection setting. If no available model provider meets the requirement, your request will + return an error. + + - allow: (default) allow providers which store user data non-transiently and may train on it + + + - deny: use only providers which do not collect user data. + anyOf: + - type: string + enum: + - deny + - allow + - type: 'null' + zdr: + anyOf: + - type: boolean + - type: 'null' + enforce_distillable_text: + anyOf: + - type: boolean + - type: 'null' + order: + description: >- + An ordered list of provider slugs. The router will attempt to use the first provider in the subset + of this list that supports your requested model, and fall back to the next if it is unavailable. If + no providers are available, the request will fail with an error message. + anyOf: + - $ref: '#/components/schemas/__schema0' + - type: 'null' + only: + description: >- + List of provider slugs to allow. If provided, this list is merged with your account-wide allowed + provider settings for this request. + anyOf: + - $ref: '#/components/schemas/__schema0' + - type: 'null' + ignore: + description: >- + List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored + provider settings for this request. + anyOf: + - $ref: '#/components/schemas/__schema0' + - type: 'null' + quantizations: + description: A list of quantization levels to filter the provider by. + anyOf: + - type: array + items: + type: string + enum: + - int4 + - int8 + - fp4 + - fp6 + - fp8 + - fp16 + - bf16 + - fp32 + - unknown + - type: 'null' + sort: + description: >- + The sorting strategy to use for this request, if "order" is not specified. When set, no load + balancing is performed. + anyOf: + - type: string + enum: + - price + - throughput + - latency + - type: 'null' + max_price: + description: >- + The object specifying the maximum price you want to pay for this request. USD price per million + tokens, for prompt and completion. + type: object + properties: + prompt: + $ref: '#/components/schemas/__schema1' + completion: + $ref: '#/components/schemas/__schema1' + image: + $ref: '#/components/schemas/__schema1' + audio: + $ref: '#/components/schemas/__schema1' + request: + $ref: '#/components/schemas/__schema1' + min_throughput: + description: >- + The minimum throughput (in tokens per second) required for this request. Only providers serving the + model with at least this throughput will be used. + anyOf: + - type: number + - type: 'null' + max_latency: + description: >- + The maximum latency (in seconds) allowed for this request. Only providers serving the model with + better than this latency will be used. + anyOf: + - type: number + - type: 'null' + additionalProperties: false + - type: 'null' + plugins: + description: Plugins you want to enable for this request, including their settings. + type: array + items: + oneOf: + - type: object + properties: + id: + type: string + const: moderation + required: + - id + - type: object + properties: + id: + type: string + const: web + enabled: + type: boolean + max_results: + type: number + search_prompt: + type: string + engine: + type: string + enum: + - native + - exa + required: + - id + - type: object + properties: + id: + type: string + const: file-parser + enabled: + type: boolean + max_files: + type: number + pdf: + type: object + properties: + engine: + type: string + enum: + - mistral-ocr + - pdf-text + - native + required: + - id + - type: object + properties: + id: + type: string + const: response-healing + enabled: + type: boolean + required: + - id + type: object + route: + description: >- + Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts + all endpoints together by routing criteria. + anyOf: + - type: string + enum: + - fallback + - sort + - type: 'null' + user: + type: string + session_id: + description: >- + A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for + observability. If provided in both the request body and the x-session-id header, the body value takes + precedence. Maximum of 128 characters. + type: string + maxLength: 128 messages: minItems: 1 type: array @@ -5112,6 +5439,7 @@ components: - low - medium - high + - xhigh - type: 'null' summary: anyOf: @@ -5185,8 +5513,6 @@ components: minimum: 0 maximum: 1 - type: 'null' - user: - type: string debug: type: object properties: @@ -5198,7 +5524,7 @@ components: type: object properties: finish_reason: - $ref: '#/components/schemas/__schema0' + $ref: '#/components/schemas/__schema2' index: type: number message: @@ -5259,7 +5585,7 @@ components: delta: $ref: '#/components/schemas/ChatStreamingMessageChunk' finish_reason: - $ref: '#/components/schemas/__schema0' + $ref: '#/components/schemas/__schema2' index: type: number logprobs: @@ -6165,10 +6491,23 @@ paths: $ref: '#/components/schemas/BigNumberUnion' request: $ref: '#/components/schemas/BigNumberUnion' - additionalProperties: false description: >- The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + min_throughput: + type: number + nullable: true + example: 100 + description: >- + The minimum throughput (in tokens per second) required for this request. Only providers serving + the model with at least this throughput will be used. + max_latency: + type: number + nullable: true + example: 5 + description: >- + The maximum latency (in seconds) allowed for this request. Only providers serving the model with + better than this latency will be used. input_type: type: string required: @@ -6227,6 +6566,11 @@ paths: - object - data - model + text/event-stream: + schema: + type: string + description: Not used for embeddings - embeddings do not support streaming + x-speakeasy-sse-sentinel: '[DONE]' '400': description: Bad Request - Invalid request parameters or malformed input content: @@ -6803,6 +7147,7 @@ paths: - Infermatic - Inflection - Liquid + - Mara - Mancer 2 - Minimax - ModelRun @@ -6823,6 +7168,7 @@ paths: - Relace - SambaNova - SiliconFlow + - Sourceful - Stealth - StreamLake - Switchpoint @@ -6830,6 +7176,7 @@ paths: - Together - Venice - WandB + - Xiaomi - xAI - Z.AI - FakeProvider diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index c87413a0..5506188d 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -1063,6 +1063,7 @@ components: type: string nullable: true enum: + - xhigh - high - medium - low @@ -3496,6 +3497,7 @@ components: - Infermatic - Inflection - Liquid + - Mara - Mancer 2 - Minimax - ModelRun @@ -3516,6 +3518,7 @@ components: - Relace - SambaNova - SiliconFlow + - Sourceful - Stealth - StreamLake - Switchpoint @@ -3523,6 +3526,7 @@ components: - Together - Venice - WandB + - Xiaomi - xAI - Z.AI - FakeProvider @@ -3554,12 +3558,8 @@ components: example: price x-speakeasy-unknown-values: allow BigNumberUnion: - anyOf: - - type: number - - type: string - - type: number - example: 1000 - description: A value in string or number format that is a large number + type: string + description: A value in string format that is a large number example: 1000 OpenResponsesRequest: type: object @@ -3747,9 +3747,20 @@ components: $ref: '#/components/schemas/BigNumberUnion' request: $ref: '#/components/schemas/BigNumberUnion' - additionalProperties: false description: >- The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + min_throughput: + type: number + nullable: true + example: 100 + description: >- + The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used. + max_latency: + type: number + nullable: true + example: 5 + description: >- + The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used. additionalProperties: false description: When multiple model providers are available, optionally indicate your routing preference. plugins: @@ -3770,6 +3781,9 @@ components: type: string enum: - web + enabled: + type: boolean + description: Set to false to disable the web-search plugin for this request. Defaults to true. max_results: type: number search_prompt: @@ -3788,6 +3802,9 @@ components: type: string enum: - file-parser + enabled: + type: boolean + description: Set to false to disable the file-parser plugin for this request. Defaults to true. max_files: type: number pdf: @@ -3808,14 +3825,31 @@ components: type: string enum: - response-healing + enabled: + type: boolean + description: Set to false to disable the response-healing plugin for this request. Defaults to true. required: - id description: Plugins you want to enable for this request, including their settings. + route: + type: string + nullable: true + enum: + - fallback + - sort + description: >- + Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts all endpoints together by routing criteria. + x-speakeasy-unknown-values: allow user: type: string maxLength: 128 description: >- A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. + session_id: + type: string + maxLength: 128 + description: >- + A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. description: Request schema for Responses endpoint example: model: anthropic/claude-4.5-sonnet-20250929 @@ -4605,6 +4639,88 @@ components: uptime_last_30m: 99.5 supports_implicit_caching: true __schema0: + type: array + items: + anyOf: + - type: string + enum: + - AI21 + - AionLabs + - Alibaba + - Amazon Bedrock + - Amazon Nova + - Anthropic + - Arcee AI + - AtlasCloud + - Avian + - Azure + - BaseTen + - BytePlus + - Black Forest Labs + - Cerebras + - Chutes + - Cirrascale + - Clarifai + - Cloudflare + - Cohere + - Crusoe + - DeepInfra + - DeepSeek + - Featherless + - Fireworks + - Friendli + - GMICloud + - GoPomelo + - Google + - Google AI Studio + - Groq + - Hyperbolic + - Inception + - InferenceNet + - Infermatic + - Inflection + - Liquid + - Mara + - Mancer 2 + - Minimax + - ModelRun + - Mistral + - Modular + - Moonshot AI + - Morph + - NCompass + - Nebius + - NextBit + - Novita + - Nvidia + - OpenAI + - OpenInference + - Parasail + - Perplexity + - Phala + - Relace + - SambaNova + - SiliconFlow + - Sourceful + - Stealth + - StreamLake + - Switchpoint + - Targon + - Together + - Venice + - WandB + - Xiaomi + - xAI + - Z.AI + - FakeProvider + x-speakeasy-unknown-values: allow + - type: string + __schema1: + anyOf: + - type: number + - type: string + - type: number + __schema2: anyOf: - $ref: '#/components/schemas/ChatCompletionFinishReason' - type: 'null' @@ -5065,6 +5181,206 @@ components: ChatGenerationParams: type: object properties: + provider: + description: When multiple model providers are available, optionally indicate your routing preference. + anyOf: + - type: object + properties: + allow_fallbacks: + description: > + Whether to allow backup providers to serve requests + + - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. + + - false: use only the primary/custom provider, and return the upstream error if it's unavailable. + + anyOf: + - type: boolean + - type: 'null' + require_parameters: + description: >- + Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. + anyOf: + - type: boolean + - type: 'null' + data_collection: + description: >- + Data collection setting. If no available model provider meets the requirement, your request will return an error. + + - allow: (default) allow providers which store user data non-transiently and may train on it + + + - deny: use only providers which do not collect user data. + anyOf: + - type: string + enum: + - deny + - allow + x-speakeasy-unknown-values: allow + - type: 'null' + zdr: + anyOf: + - type: boolean + - type: 'null' + enforce_distillable_text: + anyOf: + - type: boolean + - type: 'null' + order: + description: >- + An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. + anyOf: + - $ref: '#/components/schemas/__schema0' + - type: 'null' + only: + description: >- + List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. + anyOf: + - $ref: '#/components/schemas/__schema0' + - type: 'null' + ignore: + description: >- + List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. + anyOf: + - $ref: '#/components/schemas/__schema0' + - type: 'null' + quantizations: + description: A list of quantization levels to filter the provider by. + anyOf: + - type: array + items: + type: string + enum: + - int4 + - int8 + - fp4 + - fp6 + - fp8 + - fp16 + - bf16 + - fp32 + - unknown + x-speakeasy-unknown-values: allow + - type: 'null' + sort: + description: >- + The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. + anyOf: + - type: string + enum: + - price + - throughput + - latency + x-speakeasy-unknown-values: allow + - type: 'null' + max_price: + description: >- + The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + type: object + properties: + prompt: + $ref: '#/components/schemas/__schema1' + completion: + $ref: '#/components/schemas/__schema1' + image: + $ref: '#/components/schemas/__schema1' + audio: + $ref: '#/components/schemas/__schema1' + request: + $ref: '#/components/schemas/__schema1' + min_throughput: + description: >- + The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used. + anyOf: + - type: number + - type: 'null' + max_latency: + description: >- + The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used. + anyOf: + - type: number + - type: 'null' + additionalProperties: false + - type: 'null' + plugins: + description: Plugins you want to enable for this request, including their settings. + type: array + items: + oneOf: + - type: object + properties: + id: + type: string + const: moderation + required: + - id + - type: object + properties: + id: + type: string + const: web + enabled: + type: boolean + max_results: + type: number + search_prompt: + type: string + engine: + type: string + enum: + - native + - exa + x-speakeasy-unknown-values: allow + required: + - id + - type: object + properties: + id: + type: string + const: file-parser + enabled: + type: boolean + max_files: + type: number + pdf: + type: object + properties: + engine: + type: string + enum: + - mistral-ocr + - pdf-text + - native + x-speakeasy-unknown-values: allow + required: + - id + - type: object + properties: + id: + type: string + const: response-healing + enabled: + type: boolean + required: + - id + type: object + route: + description: >- + Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts all endpoints together by routing criteria. + anyOf: + - type: string + enum: + - fallback + - sort + x-speakeasy-unknown-values: allow + - type: 'null' + user: + type: string + session_id: + description: >- + A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. + type: string + maxLength: 128 messages: minItems: 1 type: array @@ -5134,6 +5450,7 @@ components: - low - medium - high + - xhigh x-speakeasy-unknown-values: allow - type: 'null' summary: @@ -5208,8 +5525,6 @@ components: minimum: 0 maximum: 1 - type: 'null' - user: - type: string debug: type: object properties: @@ -5221,7 +5536,7 @@ components: type: object properties: finish_reason: - $ref: '#/components/schemas/__schema0' + $ref: '#/components/schemas/__schema2' index: type: number message: @@ -5282,7 +5597,7 @@ components: delta: $ref: '#/components/schemas/ChatStreamingMessageChunk' finish_reason: - $ref: '#/components/schemas/__schema0' + $ref: '#/components/schemas/__schema2' index: type: number logprobs: @@ -6181,9 +6496,20 @@ paths: $ref: '#/components/schemas/BigNumberUnion' request: $ref: '#/components/schemas/BigNumberUnion' - additionalProperties: false description: >- The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + min_throughput: + type: number + nullable: true + example: 100 + description: >- + The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used. + max_latency: + type: number + nullable: true + example: 5 + description: >- + The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used. input_type: type: string required: @@ -6242,6 +6568,11 @@ paths: - object - data - model + text/event-stream: + schema: + type: string + description: Not used for embeddings - embeddings do not support streaming + x-speakeasy-sse-sentinel: '[DONE]' '400': description: Bad Request - Invalid request parameters or malformed input content: @@ -6806,6 +7137,7 @@ paths: - Infermatic - Inflection - Liquid + - Mara - Mancer 2 - Minimax - ModelRun @@ -6826,6 +7158,7 @@ paths: - Relace - SambaNova - SiliconFlow + - Sourceful - Stealth - StreamLake - Switchpoint @@ -6833,6 +7166,7 @@ paths: - Together - Venice - WandB + - Xiaomi - xAI - Z.AI - FakeProvider diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 6062d30f..52afebf4 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,20 +2,20 @@ speakeasyVersion: 1.666.0 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:697f956356ab0195b9a9b9a5106e4ac979caa551709b3614c723df972c661829 - sourceBlobDigest: sha256:a286a09ceced7f78a685731aef81d1498b89a6a46f3794219dc93fa2d822853b + sourceRevisionDigest: sha256:b128cdb6be96021e55feea5e2dcb6e7438de706138fcde4f871b14877885445b + sourceBlobDigest: sha256:8b15f72eaabbd77f4642be28a2861fd1cfd5d8cfe96e72fb8a76832387c64fab tags: - latest - - matt-fix-more-types + - matt-missing-provider-schema - 1.0.0 targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:697f956356ab0195b9a9b9a5106e4ac979caa551709b3614c723df972c661829 - sourceBlobDigest: sha256:a286a09ceced7f78a685731aef81d1498b89a6a46f3794219dc93fa2d822853b + sourceRevisionDigest: sha256:b128cdb6be96021e55feea5e2dcb6e7438de706138fcde4f871b14877885445b + sourceBlobDigest: sha256:8b15f72eaabbd77f4642be28a2861fd1cfd5d8cfe96e72fb8a76832387c64fab codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:753b0f6f2de1c2d4fec4823c0f552e084d3b4083591c998375074e2d11fc7d6d + codeSamplesRevisionDigest: sha256:da4836f90ab924cc1ec37989c2285b212ae4aac2c5d7832c148654746c3f501d workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.666.0 diff --git a/docs/models/chatgenerationparams.md b/docs/models/chatgenerationparams.md index 3b660d98..c8019e18 100644 --- a/docs/models/chatgenerationparams.md +++ b/docs/models/chatgenerationparams.md @@ -17,28 +17,32 @@ let value: ChatGenerationParams = { ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -| `messages` | *models.Message*[] | :heavy_check_mark: | N/A | -| `model` | *string* | :heavy_minus_sign: | N/A | -| `models` | *string*[] | :heavy_minus_sign: | N/A | -| `frequencyPenalty` | *number* | :heavy_minus_sign: | N/A | -| `logitBias` | Record | :heavy_minus_sign: | N/A | -| `logprobs` | *boolean* | :heavy_minus_sign: | N/A | -| `topLogprobs` | *number* | :heavy_minus_sign: | N/A | -| `maxCompletionTokens` | *number* | :heavy_minus_sign: | N/A | -| `maxTokens` | *number* | :heavy_minus_sign: | N/A | -| `metadata` | Record | :heavy_minus_sign: | N/A | -| `presencePenalty` | *number* | :heavy_minus_sign: | N/A | -| `reasoning` | [models.Reasoning](../models/reasoning.md) | :heavy_minus_sign: | N/A | -| `responseFormat` | *models.ChatGenerationParamsResponseFormatUnion* | :heavy_minus_sign: | N/A | -| `seed` | *number* | :heavy_minus_sign: | N/A | -| `stop` | *models.ChatGenerationParamsStop* | :heavy_minus_sign: | N/A | -| `stream` | *boolean* | :heavy_minus_sign: | N/A | -| `streamOptions` | [models.ChatStreamOptions](../models/chatstreamoptions.md) | :heavy_minus_sign: | N/A | -| `temperature` | *number* | :heavy_minus_sign: | N/A | -| `toolChoice` | *any* | :heavy_minus_sign: | N/A | -| `tools` | [models.ToolDefinitionJson](../models/tooldefinitionjson.md)[] | :heavy_minus_sign: | N/A | -| `topP` | *number* | :heavy_minus_sign: | N/A | -| `user` | *string* | :heavy_minus_sign: | N/A | -| `debug` | [models.Debug](../models/debug.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `provider` | [models.ChatGenerationParamsProvider](../models/chatgenerationparamsprovider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | +| `plugins` | *models.ChatGenerationParamsPluginUnion*[] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | +| `route` | [models.ChatGenerationParamsRoute](../models/chatgenerationparamsroute.md) | :heavy_minus_sign: | Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts all endpoints together by routing criteria. | +| `user` | *string* | :heavy_minus_sign: | N/A | +| `sessionId` | *string* | :heavy_minus_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. | +| `messages` | *models.Message*[] | :heavy_check_mark: | N/A | +| `model` | *string* | :heavy_minus_sign: | N/A | +| `models` | *string*[] | :heavy_minus_sign: | N/A | +| `frequencyPenalty` | *number* | :heavy_minus_sign: | N/A | +| `logitBias` | Record | :heavy_minus_sign: | N/A | +| `logprobs` | *boolean* | :heavy_minus_sign: | N/A | +| `topLogprobs` | *number* | :heavy_minus_sign: | N/A | +| `maxCompletionTokens` | *number* | :heavy_minus_sign: | N/A | +| `maxTokens` | *number* | :heavy_minus_sign: | N/A | +| `metadata` | Record | :heavy_minus_sign: | N/A | +| `presencePenalty` | *number* | :heavy_minus_sign: | N/A | +| `reasoning` | [models.Reasoning](../models/reasoning.md) | :heavy_minus_sign: | N/A | +| `responseFormat` | *models.ChatGenerationParamsResponseFormatUnion* | :heavy_minus_sign: | N/A | +| `seed` | *number* | :heavy_minus_sign: | N/A | +| `stop` | *models.ChatGenerationParamsStop* | :heavy_minus_sign: | N/A | +| `stream` | *boolean* | :heavy_minus_sign: | N/A | +| `streamOptions` | [models.ChatStreamOptions](../models/chatstreamoptions.md) | :heavy_minus_sign: | N/A | +| `temperature` | *number* | :heavy_minus_sign: | N/A | +| `toolChoice` | *any* | :heavy_minus_sign: | N/A | +| `tools` | [models.ToolDefinitionJson](../models/tooldefinitionjson.md)[] | :heavy_minus_sign: | N/A | +| `topP` | *number* | :heavy_minus_sign: | N/A | +| `debug` | [models.Debug](../models/debug.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/chatgenerationparamsdatacollection.md b/docs/models/chatgenerationparamsdatacollection.md new file mode 100644 index 00000000..3718bbe5 --- /dev/null +++ b/docs/models/chatgenerationparamsdatacollection.md @@ -0,0 +1,17 @@ +# ChatGenerationParamsDataCollection + +## Example Usage + +```typescript +import { ChatGenerationParamsDataCollection } from "@openrouter/sdk/models"; + +let value: ChatGenerationParamsDataCollection = "allow"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"deny" | "allow" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/engine.md b/docs/models/chatgenerationparamsengine.md similarity index 58% rename from docs/models/engine.md rename to docs/models/chatgenerationparamsengine.md index 0c80b2fb..10ac475c 100644 --- a/docs/models/engine.md +++ b/docs/models/chatgenerationparamsengine.md @@ -1,11 +1,11 @@ -# Engine +# ChatGenerationParamsEngine ## Example Usage ```typescript -import { Engine } from "@openrouter/sdk/models"; +import { ChatGenerationParamsEngine } from "@openrouter/sdk/models"; -let value: Engine = "exa"; +let value: ChatGenerationParamsEngine = "native"; ``` ## Values diff --git a/docs/models/chatgenerationparamsmaxprice.md b/docs/models/chatgenerationparamsmaxprice.md new file mode 100644 index 00000000..48f41213 --- /dev/null +++ b/docs/models/chatgenerationparamsmaxprice.md @@ -0,0 +1,21 @@ +# ChatGenerationParamsMaxPrice + +The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + +## Example Usage + +```typescript +import { ChatGenerationParamsMaxPrice } from "@openrouter/sdk/models"; + +let value: ChatGenerationParamsMaxPrice = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `prompt` | *any* | :heavy_minus_sign: | N/A | +| `completion` | *any* | :heavy_minus_sign: | N/A | +| `image` | *any* | :heavy_minus_sign: | N/A | +| `audio` | *any* | :heavy_minus_sign: | N/A | +| `request` | *any* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/chatgenerationparamspdf.md b/docs/models/chatgenerationparamspdf.md new file mode 100644 index 00000000..99e71e2e --- /dev/null +++ b/docs/models/chatgenerationparamspdf.md @@ -0,0 +1,15 @@ +# ChatGenerationParamsPdf + +## Example Usage + +```typescript +import { ChatGenerationParamsPdf } from "@openrouter/sdk/models"; + +let value: ChatGenerationParamsPdf = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `engine` | [models.ChatGenerationParamsPdfEngine](../models/chatgenerationparamspdfengine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/chatgenerationparamspdfengine.md b/docs/models/chatgenerationparamspdfengine.md new file mode 100644 index 00000000..75faf193 --- /dev/null +++ b/docs/models/chatgenerationparamspdfengine.md @@ -0,0 +1,17 @@ +# ChatGenerationParamsPdfEngine + +## Example Usage + +```typescript +import { ChatGenerationParamsPdfEngine } from "@openrouter/sdk/models"; + +let value: ChatGenerationParamsPdfEngine = "mistral-ocr"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"mistral-ocr" | "pdf-text" | "native" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/chatgenerationparamspluginfileparser.md b/docs/models/chatgenerationparamspluginfileparser.md new file mode 100644 index 00000000..281b95e2 --- /dev/null +++ b/docs/models/chatgenerationparamspluginfileparser.md @@ -0,0 +1,20 @@ +# ChatGenerationParamsPluginFileParser + +## Example Usage + +```typescript +import { ChatGenerationParamsPluginFileParser } from "@openrouter/sdk/models"; + +let value: ChatGenerationParamsPluginFileParser = { + id: "file-parser", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `id` | *"file-parser"* | :heavy_check_mark: | N/A | +| `enabled` | *boolean* | :heavy_minus_sign: | N/A | +| `maxFiles` | *number* | :heavy_minus_sign: | N/A | +| `pdf` | [models.ChatGenerationParamsPdf](../models/chatgenerationparamspdf.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/pluginmoderation.md b/docs/models/chatgenerationparamspluginmoderation.md similarity index 66% rename from docs/models/pluginmoderation.md rename to docs/models/chatgenerationparamspluginmoderation.md index 69a9dba0..651179b6 100644 --- a/docs/models/pluginmoderation.md +++ b/docs/models/chatgenerationparamspluginmoderation.md @@ -1,11 +1,11 @@ -# PluginModeration +# ChatGenerationParamsPluginModeration ## Example Usage ```typescript -import { PluginModeration } from "@openrouter/sdk/models"; +import { ChatGenerationParamsPluginModeration } from "@openrouter/sdk/models"; -let value: PluginModeration = { +let value: ChatGenerationParamsPluginModeration = { id: "moderation", }; ``` diff --git a/docs/models/pluginresponsehealing.md b/docs/models/chatgenerationparamspluginresponsehealing.md similarity index 51% rename from docs/models/pluginresponsehealing.md rename to docs/models/chatgenerationparamspluginresponsehealing.md index e331d5dd..5a6bbab9 100644 --- a/docs/models/pluginresponsehealing.md +++ b/docs/models/chatgenerationparamspluginresponsehealing.md @@ -1,11 +1,11 @@ -# PluginResponseHealing +# ChatGenerationParamsPluginResponseHealing ## Example Usage ```typescript -import { PluginResponseHealing } from "@openrouter/sdk/models"; +import { ChatGenerationParamsPluginResponseHealing } from "@openrouter/sdk/models"; -let value: PluginResponseHealing = { +let value: ChatGenerationParamsPluginResponseHealing = { id: "response-healing", }; ``` @@ -14,4 +14,5 @@ let value: PluginResponseHealing = { | Field | Type | Required | Description | | -------------------- | -------------------- | -------------------- | -------------------- | -| `id` | *"response-healing"* | :heavy_check_mark: | N/A | \ No newline at end of file +| `id` | *"response-healing"* | :heavy_check_mark: | N/A | +| `enabled` | *boolean* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/chatgenerationparamspluginunion.md b/docs/models/chatgenerationparamspluginunion.md new file mode 100644 index 00000000..22f32f28 --- /dev/null +++ b/docs/models/chatgenerationparamspluginunion.md @@ -0,0 +1,37 @@ +# ChatGenerationParamsPluginUnion + + +## Supported Types + +### `models.ChatGenerationParamsPluginModeration` + +```typescript +const value: models.ChatGenerationParamsPluginModeration = { + id: "moderation", +}; +``` + +### `models.ChatGenerationParamsPluginWeb` + +```typescript +const value: models.ChatGenerationParamsPluginWeb = { + id: "web", +}; +``` + +### `models.ChatGenerationParamsPluginFileParser` + +```typescript +const value: models.ChatGenerationParamsPluginFileParser = { + id: "file-parser", +}; +``` + +### `models.ChatGenerationParamsPluginResponseHealing` + +```typescript +const value: models.ChatGenerationParamsPluginResponseHealing = { + id: "response-healing", +}; +``` + diff --git a/docs/models/chatgenerationparamspluginweb.md b/docs/models/chatgenerationparamspluginweb.md new file mode 100644 index 00000000..e22d9d2f --- /dev/null +++ b/docs/models/chatgenerationparamspluginweb.md @@ -0,0 +1,21 @@ +# ChatGenerationParamsPluginWeb + +## Example Usage + +```typescript +import { ChatGenerationParamsPluginWeb } from "@openrouter/sdk/models"; + +let value: ChatGenerationParamsPluginWeb = { + id: "web", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `id` | *"web"* | :heavy_check_mark: | N/A | +| `enabled` | *boolean* | :heavy_minus_sign: | N/A | +| `maxResults` | *number* | :heavy_minus_sign: | N/A | +| `searchPrompt` | *string* | :heavy_minus_sign: | N/A | +| `engine` | [models.ChatGenerationParamsEngine](../models/chatgenerationparamsengine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/chatgenerationparamsprovider.md b/docs/models/chatgenerationparamsprovider.md new file mode 100644 index 00000000..51f21fd4 --- /dev/null +++ b/docs/models/chatgenerationparamsprovider.md @@ -0,0 +1,27 @@ +# ChatGenerationParamsProvider + +## Example Usage + +```typescript +import { ChatGenerationParamsProvider } from "@openrouter/sdk/models"; + +let value: ChatGenerationParamsProvider = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `allowFallbacks` | *boolean* | :heavy_minus_sign: | Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
| +| `requireParameters` | *boolean* | :heavy_minus_sign: | Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. | +| `dataCollection` | [models.ChatGenerationParamsDataCollection](../models/chatgenerationparamsdatacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it

- deny: use only providers which do not collect user data. | +| `zdr` | *boolean* | :heavy_minus_sign: | N/A | +| `enforceDistillableText` | *boolean* | :heavy_minus_sign: | N/A | +| `order` | *models.Schema0*[] | :heavy_minus_sign: | An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. | +| `only` | *models.Schema0*[] | :heavy_minus_sign: | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. | +| `ignore` | *models.Schema0*[] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | +| `quantizations` | [models.Quantizations](../models/quantizations.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. | +| `maxPrice` | [models.ChatGenerationParamsMaxPrice](../models/chatgenerationparamsmaxprice.md) | :heavy_minus_sign: | The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. | +| `minThroughput` | *number* | :heavy_minus_sign: | The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used. | +| `maxLatency` | *number* | :heavy_minus_sign: | The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used. | \ No newline at end of file diff --git a/docs/models/chatgenerationparamsroute.md b/docs/models/chatgenerationparamsroute.md new file mode 100644 index 00000000..c6db54d1 --- /dev/null +++ b/docs/models/chatgenerationparamsroute.md @@ -0,0 +1,17 @@ +# ChatGenerationParamsRoute + +## Example Usage + +```typescript +import { ChatGenerationParamsRoute } from "@openrouter/sdk/models"; + +let value: ChatGenerationParamsRoute = "sort"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"fallback" | "sort" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/effort.md b/docs/models/effort.md index 53018b3c..274fb326 100644 --- a/docs/models/effort.md +++ b/docs/models/effort.md @@ -13,5 +13,5 @@ let value: Effort = "minimal"; This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. ```typescript -"none" | "minimal" | "low" | "medium" | "high" | Unrecognized +"none" | "minimal" | "low" | "medium" | "high" | "xhigh" | Unrecognized ``` \ No newline at end of file diff --git a/docs/models/maxprice.md b/docs/models/maxprice.md deleted file mode 100644 index d2308276..00000000 --- a/docs/models/maxprice.md +++ /dev/null @@ -1,21 +0,0 @@ -# MaxPrice - -The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. - -## Example Usage - -```typescript -import { MaxPrice } from "@openrouter/sdk/models"; - -let value: MaxPrice = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | -| `prompt` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `completion` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `image` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `audio` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `request` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | \ No newline at end of file diff --git a/docs/models/openairesponsesreasoningeffort.md b/docs/models/openairesponsesreasoningeffort.md index 36b23502..89a07af9 100644 --- a/docs/models/openairesponsesreasoningeffort.md +++ b/docs/models/openairesponsesreasoningeffort.md @@ -5,7 +5,7 @@ ```typescript import { OpenAIResponsesReasoningEffort } from "@openrouter/sdk/models"; -let value: OpenAIResponsesReasoningEffort = "high"; +let value: OpenAIResponsesReasoningEffort = "xhigh"; ``` ## Values @@ -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" | "none" | Unrecognized +"xhigh" | "high" | "medium" | "low" | "minimal" | "none" | Unrecognized ``` \ No newline at end of file diff --git a/docs/models/openresponsesrequest.md b/docs/models/openresponsesrequest.md index 236be0bb..5120d85e 100644 --- a/docs/models/openresponsesrequest.md +++ b/docs/models/openresponsesrequest.md @@ -38,6 +38,8 @@ let value: OpenResponsesRequest = {}; | `serviceTier` | [models.ServiceTier](../models/servicetier.md) | :heavy_minus_sign: | N/A | | | `truncation` | [models.Truncation](../models/truncation.md) | :heavy_minus_sign: | N/A | auto | | `stream` | *boolean* | :heavy_minus_sign: | N/A | | -| `provider` | [models.Provider](../models/provider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | | -| `plugins` | *models.Plugin*[] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | | -| `user` | *string* | :heavy_minus_sign: | A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. | | \ No newline at end of file +| `provider` | [models.OpenResponsesRequestProvider](../models/openresponsesrequestprovider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | | +| `plugins` | *models.OpenResponsesRequestPluginUnion*[] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | | +| `route` | [models.OpenResponsesRequestRoute](../models/openresponsesrequestroute.md) | :heavy_minus_sign: | Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts all endpoints together by routing criteria. | | +| `user` | *string* | :heavy_minus_sign: | A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. | | +| `sessionId` | *string* | :heavy_minus_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. | | \ No newline at end of file diff --git a/docs/models/openresponsesrequestengine.md b/docs/models/openresponsesrequestengine.md new file mode 100644 index 00000000..7e49a7e0 --- /dev/null +++ b/docs/models/openresponsesrequestengine.md @@ -0,0 +1,17 @@ +# OpenResponsesRequestEngine + +## Example Usage + +```typescript +import { OpenResponsesRequestEngine } from "@openrouter/sdk/models"; + +let value: OpenResponsesRequestEngine = "native"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"native" | "exa" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/openresponsesrequestmaxprice.md b/docs/models/openresponsesrequestmaxprice.md new file mode 100644 index 00000000..5696d677 --- /dev/null +++ b/docs/models/openresponsesrequestmaxprice.md @@ -0,0 +1,21 @@ +# OpenResponsesRequestMaxPrice + +The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + +## Example Usage + +```typescript +import { OpenResponsesRequestMaxPrice } from "@openrouter/sdk/models"; + +let value: OpenResponsesRequestMaxPrice = {}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `prompt` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `completion` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `image` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `audio` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `request` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | \ No newline at end of file diff --git a/docs/models/openresponsesrequestpdf.md b/docs/models/openresponsesrequestpdf.md new file mode 100644 index 00000000..cb33cc0e --- /dev/null +++ b/docs/models/openresponsesrequestpdf.md @@ -0,0 +1,15 @@ +# OpenResponsesRequestPdf + +## Example Usage + +```typescript +import { OpenResponsesRequestPdf } from "@openrouter/sdk/models"; + +let value: OpenResponsesRequestPdf = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `engine` | [models.OpenResponsesRequestPdfEngine](../models/openresponsesrequestpdfengine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/pdfengine.md b/docs/models/openresponsesrequestpdfengine.md similarity index 59% rename from docs/models/pdfengine.md rename to docs/models/openresponsesrequestpdfengine.md index 5781ce26..70d0f99a 100644 --- a/docs/models/pdfengine.md +++ b/docs/models/openresponsesrequestpdfengine.md @@ -1,11 +1,11 @@ -# PdfEngine +# OpenResponsesRequestPdfEngine ## Example Usage ```typescript -import { PdfEngine } from "@openrouter/sdk/models"; +import { OpenResponsesRequestPdfEngine } from "@openrouter/sdk/models"; -let value: PdfEngine = "pdf-text"; +let value: OpenResponsesRequestPdfEngine = "native"; ``` ## Values diff --git a/docs/models/openresponsesrequestpluginfileparser.md b/docs/models/openresponsesrequestpluginfileparser.md new file mode 100644 index 00000000..2181ab51 --- /dev/null +++ b/docs/models/openresponsesrequestpluginfileparser.md @@ -0,0 +1,20 @@ +# OpenResponsesRequestPluginFileParser + +## Example Usage + +```typescript +import { OpenResponsesRequestPluginFileParser } from "@openrouter/sdk/models"; + +let value: OpenResponsesRequestPluginFileParser = { + id: "file-parser", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `id` | *"file-parser"* | :heavy_check_mark: | N/A | +| `enabled` | *boolean* | :heavy_minus_sign: | Set to false to disable the file-parser plugin for this request. Defaults to true. | +| `maxFiles` | *number* | :heavy_minus_sign: | N/A | +| `pdf` | [models.OpenResponsesRequestPdf](../models/openresponsesrequestpdf.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/openresponsesrequestpluginmoderation.md b/docs/models/openresponsesrequestpluginmoderation.md new file mode 100644 index 00000000..f0117c5f --- /dev/null +++ b/docs/models/openresponsesrequestpluginmoderation.md @@ -0,0 +1,17 @@ +# OpenResponsesRequestPluginModeration + +## Example Usage + +```typescript +import { OpenResponsesRequestPluginModeration } from "@openrouter/sdk/models"; + +let value: OpenResponsesRequestPluginModeration = { + id: "moderation", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *"moderation"* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/openresponsesrequestpluginresponsehealing.md b/docs/models/openresponsesrequestpluginresponsehealing.md new file mode 100644 index 00000000..91584751 --- /dev/null +++ b/docs/models/openresponsesrequestpluginresponsehealing.md @@ -0,0 +1,18 @@ +# OpenResponsesRequestPluginResponseHealing + +## Example Usage + +```typescript +import { OpenResponsesRequestPluginResponseHealing } from "@openrouter/sdk/models"; + +let value: OpenResponsesRequestPluginResponseHealing = { + id: "response-healing", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `id` | *"response-healing"* | :heavy_check_mark: | N/A | +| `enabled` | *boolean* | :heavy_minus_sign: | Set to false to disable the response-healing plugin for this request. Defaults to true. | \ No newline at end of file diff --git a/docs/models/openresponsesrequestpluginunion.md b/docs/models/openresponsesrequestpluginunion.md new file mode 100644 index 00000000..48232ce3 --- /dev/null +++ b/docs/models/openresponsesrequestpluginunion.md @@ -0,0 +1,37 @@ +# OpenResponsesRequestPluginUnion + + +## Supported Types + +### `models.OpenResponsesRequestPluginModeration` + +```typescript +const value: models.OpenResponsesRequestPluginModeration = { + id: "moderation", +}; +``` + +### `models.OpenResponsesRequestPluginWeb` + +```typescript +const value: models.OpenResponsesRequestPluginWeb = { + id: "web", +}; +``` + +### `models.OpenResponsesRequestPluginFileParser` + +```typescript +const value: models.OpenResponsesRequestPluginFileParser = { + id: "file-parser", +}; +``` + +### `models.OpenResponsesRequestPluginResponseHealing` + +```typescript +const value: models.OpenResponsesRequestPluginResponseHealing = { + id: "response-healing", +}; +``` + diff --git a/docs/models/openresponsesrequestpluginweb.md b/docs/models/openresponsesrequestpluginweb.md new file mode 100644 index 00000000..e005ca61 --- /dev/null +++ b/docs/models/openresponsesrequestpluginweb.md @@ -0,0 +1,21 @@ +# OpenResponsesRequestPluginWeb + +## Example Usage + +```typescript +import { OpenResponsesRequestPluginWeb } from "@openrouter/sdk/models"; + +let value: OpenResponsesRequestPluginWeb = { + id: "web", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `id` | *"web"* | :heavy_check_mark: | N/A | +| `enabled` | *boolean* | :heavy_minus_sign: | Set to false to disable the web-search plugin for this request. Defaults to true. | +| `maxResults` | *number* | :heavy_minus_sign: | N/A | +| `searchPrompt` | *string* | :heavy_minus_sign: | N/A | +| `engine` | [models.OpenResponsesRequestEngine](../models/openresponsesrequestengine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/provider.md b/docs/models/openresponsesrequestprovider.md similarity index 85% rename from docs/models/provider.md rename to docs/models/openresponsesrequestprovider.md index 6f276ca2..aa6c009f 100644 --- a/docs/models/provider.md +++ b/docs/models/openresponsesrequestprovider.md @@ -1,13 +1,13 @@ -# Provider +# OpenResponsesRequestProvider When multiple model providers are available, optionally indicate your routing preference. ## Example Usage ```typescript -import { Provider } from "@openrouter/sdk/models"; +import { OpenResponsesRequestProvider } from "@openrouter/sdk/models"; -let value: Provider = {}; +let value: OpenResponsesRequestProvider = {}; ``` ## Fields @@ -24,4 +24,6 @@ let value: Provider = {}; | `ignore` | *models.Ignore*[] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | | | `quantizations` | [models.Quantization](../models/quantization.md)[] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | | | `sort` | [models.ProviderSort](../models/providersort.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | price | -| `maxPrice` | [models.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 +| `maxPrice` | [models.OpenResponsesRequestMaxPrice](../models/openresponsesrequestmaxprice.md) | :heavy_minus_sign: | The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. | | +| `minThroughput` | *number* | :heavy_minus_sign: | The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used. | 100 | +| `maxLatency` | *number* | :heavy_minus_sign: | The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used. | 5 | \ No newline at end of file diff --git a/docs/models/openresponsesrequestroute.md b/docs/models/openresponsesrequestroute.md new file mode 100644 index 00000000..f5123d20 --- /dev/null +++ b/docs/models/openresponsesrequestroute.md @@ -0,0 +1,19 @@ +# OpenResponsesRequestRoute + +Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts all endpoints together by routing criteria. + +## Example Usage + +```typescript +import { OpenResponsesRequestRoute } from "@openrouter/sdk/models"; + +let value: OpenResponsesRequestRoute = "fallback"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"fallback" | "sort" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/operations/createembeddingsprovider.md b/docs/models/operations/createembeddingsprovider.md index ec0ee2bd..0f825978 100644 --- a/docs/models/operations/createembeddingsprovider.md +++ b/docs/models/operations/createembeddingsprovider.md @@ -22,4 +22,6 @@ let value: CreateEmbeddingsProvider = {}; | `ignore` | *operations.Ignore*[] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | | | `quantizations` | [models.Quantization](../../models/quantization.md)[] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | | | `sort` | [models.ProviderSort](../../models/providersort.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | price | -| `maxPrice` | [operations.MaxPrice](../../models/operations/maxprice.md) | :heavy_minus_sign: | The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. | | \ No newline at end of file +| `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. | | +| `minThroughput` | *number* | :heavy_minus_sign: | The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used. | 100 | +| `maxLatency` | *number* | :heavy_minus_sign: | The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used. | 5 | \ No newline at end of file diff --git a/docs/models/operations/createembeddingsresponse.md b/docs/models/operations/createembeddingsresponse.md index c5ec2221..cfc7f402 100644 --- a/docs/models/operations/createembeddingsresponse.md +++ b/docs/models/operations/createembeddingsresponse.md @@ -1,30 +1,21 @@ # CreateEmbeddingsResponse -Embedding response -## Example Usage +## Supported Types -```typescript -import { CreateEmbeddingsResponse } from "@openrouter/sdk/models/operations"; +### `operations.CreateEmbeddingsResponseBody` -let value: CreateEmbeddingsResponse = { +```typescript +const value: operations.CreateEmbeddingsResponseBody = { object: "list", - data: [ - { - object: "embedding", - embedding: "", - }, - ], - model: "Mustang", + data: [], + model: "Focus", }; ``` -## Fields +### `string` + +```typescript +const value: string = ""; +``` -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `id` | *string* | :heavy_minus_sign: | N/A | -| `object` | [operations.ObjectT](../../models/operations/objectt.md) | :heavy_check_mark: | N/A | -| `data` | [operations.CreateEmbeddingsData](../../models/operations/createembeddingsdata.md)[] | :heavy_check_mark: | N/A | -| `model` | *string* | :heavy_check_mark: | N/A | -| `usage` | [operations.Usage](../../models/operations/usage.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createembeddingsresponsebody.md b/docs/models/operations/createembeddingsresponsebody.md new file mode 100644 index 00000000..18423c1d --- /dev/null +++ b/docs/models/operations/createembeddingsresponsebody.md @@ -0,0 +1,25 @@ +# CreateEmbeddingsResponseBody + +Embedding response + +## Example Usage + +```typescript +import { CreateEmbeddingsResponseBody } from "@openrouter/sdk/models/operations"; + +let value: CreateEmbeddingsResponseBody = { + object: "list", + data: [], + model: "Focus", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `id` | *string* | :heavy_minus_sign: | N/A | +| `object` | [operations.ObjectT](../../models/operations/objectt.md) | :heavy_check_mark: | N/A | +| `data` | [operations.CreateEmbeddingsData](../../models/operations/createembeddingsdata.md)[] | :heavy_check_mark: | N/A | +| `model` | *string* | :heavy_check_mark: | N/A | +| `usage` | [operations.Usage](../../models/operations/usage.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getparametersprovider.md b/docs/models/operations/getparametersprovider.md index 2e686954..681997c2 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 = "Google"; +let value: GetParametersProvider = "Google AI Studio"; ``` ## Values @@ -13,5 +13,5 @@ let value: GetParametersProvider = "Google"; This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. ```typescript -"AI21" | "AionLabs" | "Alibaba" | "Amazon Bedrock" | "Amazon Nova" | "Anthropic" | "Arcee AI" | "AtlasCloud" | "Avian" | "Azure" | "BaseTen" | "BytePlus" | "Black Forest Labs" | "Cerebras" | "Chutes" | "Cirrascale" | "Clarifai" | "Cloudflare" | "Cohere" | "Crusoe" | "DeepInfra" | "DeepSeek" | "Featherless" | "Fireworks" | "Friendli" | "GMICloud" | "GoPomelo" | "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" | "StreamLake" | "Switchpoint" | "Targon" | "Together" | "Venice" | "WandB" | "xAI" | "Z.AI" | "FakeProvider" | Unrecognized +"AI21" | "AionLabs" | "Alibaba" | "Amazon Bedrock" | "Amazon Nova" | "Anthropic" | "Arcee AI" | "AtlasCloud" | "Avian" | "Azure" | "BaseTen" | "BytePlus" | "Black Forest Labs" | "Cerebras" | "Chutes" | "Cirrascale" | "Clarifai" | "Cloudflare" | "Cohere" | "Crusoe" | "DeepInfra" | "DeepSeek" | "Featherless" | "Fireworks" | "Friendli" | "GMICloud" | "GoPomelo" | "Google" | "Google AI Studio" | "Groq" | "Hyperbolic" | "Inception" | "InferenceNet" | "Infermatic" | "Inflection" | "Liquid" | "Mara" | "Mancer 2" | "Minimax" | "ModelRun" | "Mistral" | "Modular" | "Moonshot AI" | "Morph" | "NCompass" | "Nebius" | "NextBit" | "Novita" | "Nvidia" | "OpenAI" | "OpenInference" | "Parasail" | "Perplexity" | "Phala" | "Relace" | "SambaNova" | "SiliconFlow" | "Sourceful" | "Stealth" | "StreamLake" | "Switchpoint" | "Targon" | "Together" | "Venice" | "WandB" | "Xiaomi" | "xAI" | "Z.AI" | "FakeProvider" | Unrecognized ``` \ No newline at end of file diff --git a/docs/models/operations/maxprice.md b/docs/models/operations/maxprice.md index d54dfb5c..be877823 100644 --- a/docs/models/operations/maxprice.md +++ b/docs/models/operations/maxprice.md @@ -12,10 +12,10 @@ let value: MaxPrice = {}; ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | -| `prompt` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `completion` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `image` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `audio` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `request` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `prompt` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `completion` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `image` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `audio` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `request` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | \ No newline at end of file diff --git a/docs/models/pdf.md b/docs/models/pdf.md deleted file mode 100644 index 67850913..00000000 --- a/docs/models/pdf.md +++ /dev/null @@ -1,15 +0,0 @@ -# Pdf - -## Example Usage - -```typescript -import { Pdf } from "@openrouter/sdk/models"; - -let value: Pdf = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| `engine` | [models.PdfEngine](../models/pdfengine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/plugin.md b/docs/models/plugin.md deleted file mode 100644 index 97fae341..00000000 --- a/docs/models/plugin.md +++ /dev/null @@ -1,37 +0,0 @@ -# Plugin - - -## Supported Types - -### `models.PluginModeration` - -```typescript -const value: models.PluginModeration = { - id: "moderation", -}; -``` - -### `models.PluginWeb` - -```typescript -const value: models.PluginWeb = { - id: "web", -}; -``` - -### `models.PluginFileParser` - -```typescript -const value: models.PluginFileParser = { - id: "file-parser", -}; -``` - -### `models.PluginResponseHealing` - -```typescript -const value: models.PluginResponseHealing = { - id: "response-healing", -}; -``` - diff --git a/docs/models/pluginfileparser.md b/docs/models/pluginfileparser.md deleted file mode 100644 index 942b84c1..00000000 --- a/docs/models/pluginfileparser.md +++ /dev/null @@ -1,19 +0,0 @@ -# PluginFileParser - -## Example Usage - -```typescript -import { PluginFileParser } from "@openrouter/sdk/models"; - -let value: PluginFileParser = { - id: "file-parser", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | -| `id` | *"file-parser"* | :heavy_check_mark: | N/A | -| `maxFiles` | *number* | :heavy_minus_sign: | N/A | -| `pdf` | [models.Pdf](../models/pdf.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/pluginweb.md b/docs/models/pluginweb.md deleted file mode 100644 index 673a5fd6..00000000 --- a/docs/models/pluginweb.md +++ /dev/null @@ -1,20 +0,0 @@ -# PluginWeb - -## Example Usage - -```typescript -import { PluginWeb } from "@openrouter/sdk/models"; - -let value: PluginWeb = { - id: "web", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `id` | *"web"* | :heavy_check_mark: | N/A | -| `maxResults` | *number* | :heavy_minus_sign: | N/A | -| `searchPrompt` | *string* | :heavy_minus_sign: | N/A | -| `engine` | [models.Engine](../models/engine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/pricing.md b/docs/models/pricing.md index 97324713..5e8e5ef2 100644 --- a/docs/models/pricing.md +++ b/docs/models/pricing.md @@ -6,25 +6,25 @@ import { Pricing } from "@openrouter/sdk/models"; let value: Pricing = { - prompt: 1000, + prompt: "1000", completion: "1000", }; ``` ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | -| `prompt` | *any* | :heavy_check_mark: | A value in string or number format that is a large number | -| `completion` | *any* | :heavy_check_mark: | A value in string or number format that is a large number | -| `request` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `image` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `imageToken` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `imageOutput` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `audio` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `inputAudioCache` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `webSearch` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `internalReasoning` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `inputCacheRead` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `inputCacheWrite` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `discount` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `prompt` | *string* | :heavy_check_mark: | A value in string format that is a large number | 1000 | +| `completion` | *string* | :heavy_check_mark: | A value in string format that is a large number | 1000 | +| `request` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `image` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `imageToken` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `imageOutput` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `audio` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `inputAudioCache` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `webSearch` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `internalReasoning` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `inputCacheRead` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `inputCacheWrite` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `discount` | *number* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/providername.md b/docs/models/providername.md index 6d238928..ec7473ac 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 -"AI21" | "AionLabs" | "Alibaba" | "Amazon Bedrock" | "Amazon Nova" | "Anthropic" | "Arcee AI" | "AtlasCloud" | "Avian" | "Azure" | "BaseTen" | "BytePlus" | "Black Forest Labs" | "Cerebras" | "Chutes" | "Cirrascale" | "Clarifai" | "Cloudflare" | "Cohere" | "Crusoe" | "DeepInfra" | "DeepSeek" | "Featherless" | "Fireworks" | "Friendli" | "GMICloud" | "GoPomelo" | "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" | "StreamLake" | "Switchpoint" | "Targon" | "Together" | "Venice" | "WandB" | "xAI" | "Z.AI" | "FakeProvider" | Unrecognized +"AI21" | "AionLabs" | "Alibaba" | "Amazon Bedrock" | "Amazon Nova" | "Anthropic" | "Arcee AI" | "AtlasCloud" | "Avian" | "Azure" | "BaseTen" | "BytePlus" | "Black Forest Labs" | "Cerebras" | "Chutes" | "Cirrascale" | "Clarifai" | "Cloudflare" | "Cohere" | "Crusoe" | "DeepInfra" | "DeepSeek" | "Featherless" | "Fireworks" | "Friendli" | "GMICloud" | "GoPomelo" | "Google" | "Google AI Studio" | "Groq" | "Hyperbolic" | "Inception" | "InferenceNet" | "Infermatic" | "Inflection" | "Liquid" | "Mara" | "Mancer 2" | "Minimax" | "ModelRun" | "Mistral" | "Modular" | "Moonshot AI" | "Morph" | "NCompass" | "Nebius" | "NextBit" | "Novita" | "Nvidia" | "OpenAI" | "OpenInference" | "Parasail" | "Perplexity" | "Phala" | "Relace" | "SambaNova" | "SiliconFlow" | "Sourceful" | "Stealth" | "StreamLake" | "Switchpoint" | "Targon" | "Together" | "Venice" | "WandB" | "Xiaomi" | "xAI" | "Z.AI" | "FakeProvider" | Unrecognized ``` \ No newline at end of file diff --git a/docs/models/publicpricing.md b/docs/models/publicpricing.md index db3016aa..e36aa780 100644 --- a/docs/models/publicpricing.md +++ b/docs/models/publicpricing.md @@ -15,18 +15,18 @@ let value: PublicPricing = { ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | -| `prompt` | *any* | :heavy_check_mark: | A value in string or number format that is a large number | -| `completion` | *any* | :heavy_check_mark: | A value in string or number format that is a large number | -| `request` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `image` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `imageToken` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `imageOutput` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `audio` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `inputAudioCache` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `webSearch` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `internalReasoning` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `inputCacheRead` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `inputCacheWrite` | *any* | :heavy_minus_sign: | A value in string or number format that is a large number | -| `discount` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `prompt` | *string* | :heavy_check_mark: | A value in string format that is a large number | 1000 | +| `completion` | *string* | :heavy_check_mark: | A value in string format that is a large number | 1000 | +| `request` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `image` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `imageToken` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `imageOutput` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `audio` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `inputAudioCache` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `webSearch` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `internalReasoning` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `inputCacheRead` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `inputCacheWrite` | *string* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `discount` | *number* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/quantizations.md b/docs/models/quantizations.md new file mode 100644 index 00000000..b7a65e3b --- /dev/null +++ b/docs/models/quantizations.md @@ -0,0 +1,17 @@ +# Quantizations + +## Example Usage + +```typescript +import { Quantizations } from "@openrouter/sdk/models"; + +let value: Quantizations = "fp4"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"int4" | "int8" | "fp4" | "fp6" | "fp8" | "fp16" | "bf16" | "fp32" | "unknown" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/schema0.md b/docs/models/schema0.md new file mode 100644 index 00000000..c6058f73 --- /dev/null +++ b/docs/models/schema0.md @@ -0,0 +1,17 @@ +# Schema0 + + +## Supported Types + +### `models.Schema0Enum` + +```typescript +const value: models.Schema0Enum = "Alibaba"; +``` + +### `string` + +```typescript +const value: string = ""; +``` + diff --git a/docs/models/schema0enum.md b/docs/models/schema0enum.md new file mode 100644 index 00000000..2cf06689 --- /dev/null +++ b/docs/models/schema0enum.md @@ -0,0 +1,17 @@ +# Schema0Enum + +## Example Usage + +```typescript +import { Schema0Enum } from "@openrouter/sdk/models"; + +let value: Schema0Enum = "WandB"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"AI21" | "AionLabs" | "Alibaba" | "Amazon Bedrock" | "Amazon Nova" | "Anthropic" | "Arcee AI" | "AtlasCloud" | "Avian" | "Azure" | "BaseTen" | "BytePlus" | "Black Forest Labs" | "Cerebras" | "Chutes" | "Cirrascale" | "Clarifai" | "Cloudflare" | "Cohere" | "Crusoe" | "DeepInfra" | "DeepSeek" | "Featherless" | "Fireworks" | "Friendli" | "GMICloud" | "GoPomelo" | "Google" | "Google AI Studio" | "Groq" | "Hyperbolic" | "Inception" | "InferenceNet" | "Infermatic" | "Inflection" | "Liquid" | "Mara" | "Mancer 2" | "Minimax" | "ModelRun" | "Mistral" | "Modular" | "Moonshot AI" | "Morph" | "NCompass" | "Nebius" | "NextBit" | "Novita" | "Nvidia" | "OpenAI" | "OpenInference" | "Parasail" | "Perplexity" | "Phala" | "Relace" | "SambaNova" | "SiliconFlow" | "Sourceful" | "Stealth" | "StreamLake" | "Switchpoint" | "Targon" | "Together" | "Venice" | "WandB" | "Xiaomi" | "xAI" | "Z.AI" | "FakeProvider" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/sort.md b/docs/models/sort.md new file mode 100644 index 00000000..73fb6fa3 --- /dev/null +++ b/docs/models/sort.md @@ -0,0 +1,17 @@ +# Sort + +## Example Usage + +```typescript +import { Sort } from "@openrouter/sdk/models"; + +let value: Sort = "throughput"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"price" | "throughput" | "latency" | Unrecognized +``` \ No newline at end of file diff --git a/jsr.json b/jsr.json index ed244595..12698201 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "0.2.9", + "version": "0.2.11", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package.json b/package.json index fbe5e31f..8e1152aa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "0.2.9", + "version": "0.2.11", "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/funcs/embeddingsGenerate.ts b/src/funcs/embeddingsGenerate.ts index 694c08cd..998f5969 100644 --- a/src/funcs/embeddingsGenerate.ts +++ b/src/funcs/embeddingsGenerate.ts @@ -110,7 +110,7 @@ async function $do( const headers = new Headers(compactMap({ "Content-Type": "application/json", - Accept: "application/json", + Accept: "application/json;q=1, text/event-stream;q=0", })); const secConfig = await extractSecurity(client._options.apiKey); @@ -197,6 +197,9 @@ async function $do( | SDKValidationError >( M.json(200, operations.CreateEmbeddingsResponse$inboundSchema), + M.text(200, operations.CreateEmbeddingsResponse$inboundSchema, { + ctype: "text/event-stream", + }), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(402, errors.PaymentRequiredResponseError$inboundSchema), diff --git a/src/lib/config.ts b/src/lib/config.ts index b5bfa6da..4465a07f 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -69,7 +69,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0.0", - sdkVersion: "0.2.9", + sdkVersion: "0.2.11", genVersion: "2.768.0", - userAgent: "speakeasy-sdk/typescript 0.2.9 2.768.0 1.0.0 @openrouter/sdk", + userAgent: "speakeasy-sdk/typescript 0.2.11 2.768.0 1.0.0 @openrouter/sdk", } as const; diff --git a/src/models/chatgenerationparams.ts b/src/models/chatgenerationparams.ts index a31df171..5c13ea9f 100644 --- a/src/models/chatgenerationparams.ts +++ b/src/models/chatgenerationparams.ts @@ -30,18 +30,180 @@ import { ResponseFormatTextGrammar$Outbound, ResponseFormatTextGrammar$outboundSchema, } from "./responseformattextgrammar.js"; +import { + Schema0, + Schema0$Outbound, + Schema0$outboundSchema, +} from "./schema0.js"; import { ToolDefinitionJson, ToolDefinitionJson$Outbound, ToolDefinitionJson$outboundSchema, } from "./tooldefinitionjson.js"; +export const ChatGenerationParamsDataCollection = { + Deny: "deny", + Allow: "allow", +} as const; +export type ChatGenerationParamsDataCollection = OpenEnum< + typeof ChatGenerationParamsDataCollection +>; + +export const Quantizations = { + Int4: "int4", + Int8: "int8", + Fp4: "fp4", + Fp6: "fp6", + Fp8: "fp8", + Fp16: "fp16", + Bf16: "bf16", + Fp32: "fp32", + Unknown: "unknown", +} as const; +export type Quantizations = OpenEnum; + +export const Sort = { + Price: "price", + Throughput: "throughput", + Latency: "latency", +} as const; +export type Sort = OpenEnum; + +/** + * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + */ +export type ChatGenerationParamsMaxPrice = { + prompt?: any | undefined; + completion?: any | undefined; + image?: any | undefined; + audio?: any | undefined; + request?: any | undefined; +}; + +export type ChatGenerationParamsProvider = { + /** + * Whether to allow backup providers to serve requests + * + * @remarks + * - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. + * - false: use only the primary/custom provider, and return the upstream error if it's unavailable. + */ + allowFallbacks?: boolean | null | undefined; + /** + * Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. + */ + requireParameters?: boolean | null | undefined; + /** + * Data collection setting. If no available model provider meets the requirement, your request will return an error. + * + * @remarks + * - allow: (default) allow providers which store user data non-transiently and may train on it + * + * - deny: use only providers which do not collect user data. + */ + dataCollection?: ChatGenerationParamsDataCollection | null | undefined; + zdr?: boolean | null | undefined; + enforceDistillableText?: boolean | null | undefined; + /** + * An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. + */ + order?: Array | null | undefined; + /** + * List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. + */ + only?: Array | null | undefined; + /** + * List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. + */ + ignore?: Array | null | undefined; + /** + * A list of quantization levels to filter the provider by. + */ + quantizations?: Array | null | undefined; + /** + * The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. + */ + sort?: Sort | null | undefined; + /** + * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + */ + maxPrice?: ChatGenerationParamsMaxPrice | undefined; + /** + * The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used. + */ + minThroughput?: number | null | undefined; + /** + * The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used. + */ + maxLatency?: number | null | undefined; +}; + +export type ChatGenerationParamsPluginResponseHealing = { + id: "response-healing"; + enabled?: boolean | undefined; +}; + +export const ChatGenerationParamsPdfEngine = { + MistralOcr: "mistral-ocr", + PdfText: "pdf-text", + Native: "native", +} as const; +export type ChatGenerationParamsPdfEngine = OpenEnum< + typeof ChatGenerationParamsPdfEngine +>; + +export type ChatGenerationParamsPdf = { + engine?: ChatGenerationParamsPdfEngine | undefined; +}; + +export type ChatGenerationParamsPluginFileParser = { + id: "file-parser"; + enabled?: boolean | undefined; + maxFiles?: number | undefined; + pdf?: ChatGenerationParamsPdf | undefined; +}; + +export const ChatGenerationParamsEngine = { + Native: "native", + Exa: "exa", +} as const; +export type ChatGenerationParamsEngine = OpenEnum< + typeof ChatGenerationParamsEngine +>; + +export type ChatGenerationParamsPluginWeb = { + id: "web"; + enabled?: boolean | undefined; + maxResults?: number | undefined; + searchPrompt?: string | undefined; + engine?: ChatGenerationParamsEngine | undefined; +}; + +export type ChatGenerationParamsPluginModeration = { + id: "moderation"; +}; + +export type ChatGenerationParamsPluginUnion = + | ChatGenerationParamsPluginModeration + | ChatGenerationParamsPluginWeb + | ChatGenerationParamsPluginFileParser + | ChatGenerationParamsPluginResponseHealing; + +export const ChatGenerationParamsRoute = { + Fallback: "fallback", + Sort: "sort", +} as const; +export type ChatGenerationParamsRoute = OpenEnum< + typeof ChatGenerationParamsRoute +>; + export const Effort = { None: "none", Minimal: "minimal", Low: "low", Medium: "medium", High: "high", + Xhigh: "xhigh", } as const; export type Effort = OpenEnum; @@ -76,6 +238,30 @@ export type Debug = { }; export type ChatGenerationParams = { + /** + * When multiple model providers are available, optionally indicate your routing preference. + */ + provider?: ChatGenerationParamsProvider | null | undefined; + /** + * Plugins you want to enable for this request, including their settings. + */ + plugins?: + | Array< + | ChatGenerationParamsPluginModeration + | ChatGenerationParamsPluginWeb + | ChatGenerationParamsPluginFileParser + | ChatGenerationParamsPluginResponseHealing + > + | undefined; + /** + * Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts all endpoints together by routing criteria. + */ + route?: ChatGenerationParamsRoute | null | undefined; + user?: string | undefined; + /** + * A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. + */ + sessionId?: string | undefined; messages: Array; model?: string | undefined; models?: Array | undefined; @@ -103,10 +289,299 @@ export type ChatGenerationParams = { toolChoice?: any | undefined; tools?: Array | undefined; topP?: number | null | undefined; - user?: string | undefined; debug?: Debug | undefined; }; +/** @internal */ +export const ChatGenerationParamsDataCollection$outboundSchema: z.ZodType< + string, + ChatGenerationParamsDataCollection +> = openEnums.outboundSchema(ChatGenerationParamsDataCollection); + +/** @internal */ +export const Quantizations$outboundSchema: z.ZodType = + openEnums.outboundSchema(Quantizations); + +/** @internal */ +export const Sort$outboundSchema: z.ZodType = openEnums + .outboundSchema(Sort); + +/** @internal */ +export type ChatGenerationParamsMaxPrice$Outbound = { + prompt?: any | undefined; + completion?: any | undefined; + image?: any | undefined; + audio?: any | undefined; + request?: any | undefined; +}; + +/** @internal */ +export const ChatGenerationParamsMaxPrice$outboundSchema: z.ZodType< + ChatGenerationParamsMaxPrice$Outbound, + ChatGenerationParamsMaxPrice +> = z.object({ + prompt: z.any().optional(), + completion: z.any().optional(), + image: z.any().optional(), + audio: z.any().optional(), + request: z.any().optional(), +}); + +export function chatGenerationParamsMaxPriceToJSON( + chatGenerationParamsMaxPrice: ChatGenerationParamsMaxPrice, +): string { + return JSON.stringify( + ChatGenerationParamsMaxPrice$outboundSchema.parse( + chatGenerationParamsMaxPrice, + ), + ); +} + +/** @internal */ +export type ChatGenerationParamsProvider$Outbound = { + allow_fallbacks?: boolean | null | undefined; + require_parameters?: boolean | null | undefined; + data_collection?: string | null | undefined; + zdr?: boolean | null | undefined; + enforce_distillable_text?: boolean | null | undefined; + order?: Array | null | undefined; + only?: Array | null | undefined; + ignore?: Array | null | undefined; + quantizations?: Array | null | undefined; + sort?: string | null | undefined; + max_price?: ChatGenerationParamsMaxPrice$Outbound | undefined; + min_throughput?: number | null | undefined; + max_latency?: number | null | undefined; +}; + +/** @internal */ +export const ChatGenerationParamsProvider$outboundSchema: z.ZodType< + ChatGenerationParamsProvider$Outbound, + ChatGenerationParamsProvider +> = z.object({ + allowFallbacks: z.nullable(z.boolean()).optional(), + requireParameters: z.nullable(z.boolean()).optional(), + dataCollection: z.nullable(ChatGenerationParamsDataCollection$outboundSchema) + .optional(), + zdr: z.nullable(z.boolean()).optional(), + enforceDistillableText: z.nullable(z.boolean()).optional(), + order: z.nullable(z.array(Schema0$outboundSchema)).optional(), + only: z.nullable(z.array(Schema0$outboundSchema)).optional(), + ignore: z.nullable(z.array(Schema0$outboundSchema)).optional(), + quantizations: z.nullable(z.array(Quantizations$outboundSchema)).optional(), + sort: z.nullable(Sort$outboundSchema).optional(), + maxPrice: z.lazy(() => ChatGenerationParamsMaxPrice$outboundSchema) + .optional(), + minThroughput: z.nullable(z.number()).optional(), + maxLatency: z.nullable(z.number()).optional(), +}).transform((v) => { + return remap$(v, { + allowFallbacks: "allow_fallbacks", + requireParameters: "require_parameters", + dataCollection: "data_collection", + enforceDistillableText: "enforce_distillable_text", + maxPrice: "max_price", + minThroughput: "min_throughput", + maxLatency: "max_latency", + }); +}); + +export function chatGenerationParamsProviderToJSON( + chatGenerationParamsProvider: ChatGenerationParamsProvider, +): string { + return JSON.stringify( + ChatGenerationParamsProvider$outboundSchema.parse( + chatGenerationParamsProvider, + ), + ); +} + +/** @internal */ +export type ChatGenerationParamsPluginResponseHealing$Outbound = { + id: "response-healing"; + enabled?: boolean | undefined; +}; + +/** @internal */ +export const ChatGenerationParamsPluginResponseHealing$outboundSchema: + z.ZodType< + ChatGenerationParamsPluginResponseHealing$Outbound, + ChatGenerationParamsPluginResponseHealing + > = z.object({ + id: z.literal("response-healing"), + enabled: z.boolean().optional(), + }); + +export function chatGenerationParamsPluginResponseHealingToJSON( + chatGenerationParamsPluginResponseHealing: + ChatGenerationParamsPluginResponseHealing, +): string { + return JSON.stringify( + ChatGenerationParamsPluginResponseHealing$outboundSchema.parse( + chatGenerationParamsPluginResponseHealing, + ), + ); +} + +/** @internal */ +export const ChatGenerationParamsPdfEngine$outboundSchema: z.ZodType< + string, + ChatGenerationParamsPdfEngine +> = openEnums.outboundSchema(ChatGenerationParamsPdfEngine); + +/** @internal */ +export type ChatGenerationParamsPdf$Outbound = { + engine?: string | undefined; +}; + +/** @internal */ +export const ChatGenerationParamsPdf$outboundSchema: z.ZodType< + ChatGenerationParamsPdf$Outbound, + ChatGenerationParamsPdf +> = z.object({ + engine: ChatGenerationParamsPdfEngine$outboundSchema.optional(), +}); + +export function chatGenerationParamsPdfToJSON( + chatGenerationParamsPdf: ChatGenerationParamsPdf, +): string { + return JSON.stringify( + ChatGenerationParamsPdf$outboundSchema.parse(chatGenerationParamsPdf), + ); +} + +/** @internal */ +export type ChatGenerationParamsPluginFileParser$Outbound = { + id: "file-parser"; + enabled?: boolean | undefined; + max_files?: number | undefined; + pdf?: ChatGenerationParamsPdf$Outbound | undefined; +}; + +/** @internal */ +export const ChatGenerationParamsPluginFileParser$outboundSchema: z.ZodType< + ChatGenerationParamsPluginFileParser$Outbound, + ChatGenerationParamsPluginFileParser +> = z.object({ + id: z.literal("file-parser"), + enabled: z.boolean().optional(), + maxFiles: z.number().optional(), + pdf: z.lazy(() => ChatGenerationParamsPdf$outboundSchema).optional(), +}).transform((v) => { + return remap$(v, { + maxFiles: "max_files", + }); +}); + +export function chatGenerationParamsPluginFileParserToJSON( + chatGenerationParamsPluginFileParser: ChatGenerationParamsPluginFileParser, +): string { + return JSON.stringify( + ChatGenerationParamsPluginFileParser$outboundSchema.parse( + chatGenerationParamsPluginFileParser, + ), + ); +} + +/** @internal */ +export const ChatGenerationParamsEngine$outboundSchema: z.ZodType< + string, + ChatGenerationParamsEngine +> = openEnums.outboundSchema(ChatGenerationParamsEngine); + +/** @internal */ +export type ChatGenerationParamsPluginWeb$Outbound = { + id: "web"; + enabled?: boolean | undefined; + max_results?: number | undefined; + search_prompt?: string | undefined; + engine?: string | undefined; +}; + +/** @internal */ +export const ChatGenerationParamsPluginWeb$outboundSchema: z.ZodType< + ChatGenerationParamsPluginWeb$Outbound, + ChatGenerationParamsPluginWeb +> = z.object({ + id: z.literal("web"), + enabled: z.boolean().optional(), + maxResults: z.number().optional(), + searchPrompt: z.string().optional(), + engine: ChatGenerationParamsEngine$outboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + maxResults: "max_results", + searchPrompt: "search_prompt", + }); +}); + +export function chatGenerationParamsPluginWebToJSON( + chatGenerationParamsPluginWeb: ChatGenerationParamsPluginWeb, +): string { + return JSON.stringify( + ChatGenerationParamsPluginWeb$outboundSchema.parse( + chatGenerationParamsPluginWeb, + ), + ); +} + +/** @internal */ +export type ChatGenerationParamsPluginModeration$Outbound = { + id: "moderation"; +}; + +/** @internal */ +export const ChatGenerationParamsPluginModeration$outboundSchema: z.ZodType< + ChatGenerationParamsPluginModeration$Outbound, + ChatGenerationParamsPluginModeration +> = z.object({ + id: z.literal("moderation"), +}); + +export function chatGenerationParamsPluginModerationToJSON( + chatGenerationParamsPluginModeration: ChatGenerationParamsPluginModeration, +): string { + return JSON.stringify( + ChatGenerationParamsPluginModeration$outboundSchema.parse( + chatGenerationParamsPluginModeration, + ), + ); +} + +/** @internal */ +export type ChatGenerationParamsPluginUnion$Outbound = + | ChatGenerationParamsPluginModeration$Outbound + | ChatGenerationParamsPluginWeb$Outbound + | ChatGenerationParamsPluginFileParser$Outbound + | ChatGenerationParamsPluginResponseHealing$Outbound; + +/** @internal */ +export const ChatGenerationParamsPluginUnion$outboundSchema: z.ZodType< + ChatGenerationParamsPluginUnion$Outbound, + ChatGenerationParamsPluginUnion +> = z.union([ + z.lazy(() => ChatGenerationParamsPluginModeration$outboundSchema), + z.lazy(() => ChatGenerationParamsPluginWeb$outboundSchema), + z.lazy(() => ChatGenerationParamsPluginFileParser$outboundSchema), + z.lazy(() => ChatGenerationParamsPluginResponseHealing$outboundSchema), +]); + +export function chatGenerationParamsPluginUnionToJSON( + chatGenerationParamsPluginUnion: ChatGenerationParamsPluginUnion, +): string { + return JSON.stringify( + ChatGenerationParamsPluginUnion$outboundSchema.parse( + chatGenerationParamsPluginUnion, + ), + ); +} + +/** @internal */ +export const ChatGenerationParamsRoute$outboundSchema: z.ZodType< + string, + ChatGenerationParamsRoute +> = openEnums.outboundSchema(ChatGenerationParamsRoute); + /** @internal */ export const Effort$outboundSchema: z.ZodType = openEnums .outboundSchema(Effort); @@ -271,6 +746,18 @@ export function debugToJSON(debug: Debug): string { /** @internal */ export type ChatGenerationParams$Outbound = { + provider?: ChatGenerationParamsProvider$Outbound | null | undefined; + plugins?: + | Array< + | ChatGenerationParamsPluginModeration$Outbound + | ChatGenerationParamsPluginWeb$Outbound + | ChatGenerationParamsPluginFileParser$Outbound + | ChatGenerationParamsPluginResponseHealing$Outbound + > + | undefined; + route?: string | null | undefined; + user?: string | undefined; + session_id?: string | undefined; messages: Array; model?: string | undefined; models?: Array | undefined; @@ -298,7 +785,6 @@ export type ChatGenerationParams$Outbound = { tool_choice?: any | undefined; tools?: Array | undefined; top_p?: number | null | undefined; - user?: string | undefined; debug?: Debug$Outbound | undefined; }; @@ -307,6 +793,20 @@ export const ChatGenerationParams$outboundSchema: z.ZodType< ChatGenerationParams$Outbound, ChatGenerationParams > = z.object({ + provider: z.nullable( + z.lazy(() => ChatGenerationParamsProvider$outboundSchema), + ).optional(), + plugins: z.array( + z.union([ + z.lazy(() => ChatGenerationParamsPluginModeration$outboundSchema), + z.lazy(() => ChatGenerationParamsPluginWeb$outboundSchema), + z.lazy(() => ChatGenerationParamsPluginFileParser$outboundSchema), + z.lazy(() => ChatGenerationParamsPluginResponseHealing$outboundSchema), + ]), + ).optional(), + route: z.nullable(ChatGenerationParamsRoute$outboundSchema).optional(), + user: z.string().optional(), + sessionId: z.string().optional(), messages: z.array(Message$outboundSchema), model: z.string().optional(), models: z.array(z.string()).optional(), @@ -334,10 +834,10 @@ export const ChatGenerationParams$outboundSchema: z.ZodType< toolChoice: z.any().optional(), tools: z.array(ToolDefinitionJson$outboundSchema).optional(), topP: z.nullable(z.number()).optional(), - user: z.string().optional(), debug: z.lazy(() => Debug$outboundSchema).optional(), }).transform((v) => { return remap$(v, { + sessionId: "session_id", frequencyPenalty: "frequency_penalty", logitBias: "logit_bias", topLogprobs: "top_logprobs", diff --git a/src/models/index.ts b/src/models/index.ts index 29a24c1f..43c69cc1 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -132,6 +132,7 @@ export * from "./responsessearchcontextsize.js"; export * from "./responseswebsearchcalloutput.js"; export * from "./responseswebsearchuserlocation.js"; export * from "./responsetextconfig.js"; +export * from "./schema0.js"; export * from "./security.js"; export * from "./serviceunavailableresponseerrordata.js"; export * from "./systemmessage.js"; diff --git a/src/models/openairesponsesreasoningeffort.ts b/src/models/openairesponsesreasoningeffort.ts index b191cefb..97d8746d 100644 --- a/src/models/openairesponsesreasoningeffort.ts +++ b/src/models/openairesponsesreasoningeffort.ts @@ -7,6 +7,7 @@ import * as openEnums from "../types/enums.js"; import { OpenEnum } from "../types/enums.js"; export const OpenAIResponsesReasoningEffort = { + Xhigh: "xhigh", High: "high", Medium: "medium", Low: "low", diff --git a/src/models/openresponsesrequest.ts b/src/models/openresponsesrequest.ts index 88b4583b..439ce04a 100644 --- a/src/models/openresponsesrequest.ts +++ b/src/models/openresponsesrequest.ts @@ -101,33 +101,33 @@ export type Ignore = ProviderName | string; /** * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. */ -export type MaxPrice = { +export type OpenResponsesRequestMaxPrice = { /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - prompt?: any | undefined; + prompt?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - completion?: any | undefined; + completion?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - image?: any | undefined; + image?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - audio?: any | undefined; + audio?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - request?: any | undefined; + request?: string | undefined; }; /** * When multiple model providers are available, optionally indicate your routing preference. */ -export type Provider = { +export type OpenResponsesRequestProvider = { /** * Whether to allow backup providers to serve requests * @@ -180,52 +180,90 @@ export type Provider = { /** * The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. */ - maxPrice?: MaxPrice | undefined; + maxPrice?: OpenResponsesRequestMaxPrice | undefined; + /** + * The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used. + */ + minThroughput?: number | null | undefined; + /** + * The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used. + */ + maxLatency?: number | null | undefined; }; -export type PluginResponseHealing = { +export type OpenResponsesRequestPluginResponseHealing = { id: "response-healing"; + /** + * Set to false to disable the response-healing plugin for this request. Defaults to true. + */ + enabled?: boolean | undefined; }; -export const PdfEngine = { +export const OpenResponsesRequestPdfEngine = { MistralOcr: "mistral-ocr", PdfText: "pdf-text", Native: "native", } as const; -export type PdfEngine = OpenEnum; +export type OpenResponsesRequestPdfEngine = OpenEnum< + typeof OpenResponsesRequestPdfEngine +>; -export type Pdf = { - engine?: PdfEngine | undefined; +export type OpenResponsesRequestPdf = { + engine?: OpenResponsesRequestPdfEngine | undefined; }; -export type PluginFileParser = { +export type OpenResponsesRequestPluginFileParser = { id: "file-parser"; + /** + * Set to false to disable the file-parser plugin for this request. Defaults to true. + */ + enabled?: boolean | undefined; maxFiles?: number | undefined; - pdf?: Pdf | undefined; + pdf?: OpenResponsesRequestPdf | undefined; }; -export const Engine = { +export const OpenResponsesRequestEngine = { Native: "native", Exa: "exa", } as const; -export type Engine = OpenEnum; +export type OpenResponsesRequestEngine = OpenEnum< + typeof OpenResponsesRequestEngine +>; -export type PluginWeb = { +export type OpenResponsesRequestPluginWeb = { id: "web"; + /** + * Set to false to disable the web-search plugin for this request. Defaults to true. + */ + enabled?: boolean | undefined; maxResults?: number | undefined; searchPrompt?: string | undefined; - engine?: Engine | undefined; + engine?: OpenResponsesRequestEngine | undefined; }; -export type PluginModeration = { +export type OpenResponsesRequestPluginModeration = { id: "moderation"; }; -export type Plugin = - | PluginModeration - | PluginWeb - | PluginFileParser - | PluginResponseHealing; +export type OpenResponsesRequestPluginUnion = + | OpenResponsesRequestPluginModeration + | OpenResponsesRequestPluginWeb + | OpenResponsesRequestPluginFileParser + | OpenResponsesRequestPluginResponseHealing; + +/** + * Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts all endpoints together by routing criteria. + */ +export const OpenResponsesRequestRoute = { + Fallback: "fallback", + Sort: "sort", +} as const; +/** + * Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts all endpoints together by routing criteria. + */ +export type OpenResponsesRequestRoute = OpenEnum< + typeof OpenResponsesRequestRoute +>; /** * Request schema for Responses endpoint @@ -278,19 +316,30 @@ export type OpenResponsesRequest = { /** * When multiple model providers are available, optionally indicate your routing preference. */ - provider?: Provider | null | undefined; + provider?: OpenResponsesRequestProvider | null | undefined; /** * Plugins you want to enable for this request, including their settings. */ plugins?: | Array< - PluginModeration | PluginWeb | PluginFileParser | PluginResponseHealing + | OpenResponsesRequestPluginModeration + | OpenResponsesRequestPluginWeb + | OpenResponsesRequestPluginFileParser + | OpenResponsesRequestPluginResponseHealing > | undefined; + /** + * Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts all endpoints together by routing criteria. + */ + route?: OpenResponsesRequestRoute | null | undefined; /** * A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. */ user?: string | undefined; + /** + * A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. + */ + sessionId?: string | undefined; }; /** @internal */ @@ -401,30 +450,38 @@ export function ignoreToJSON(ignore: Ignore): string { } /** @internal */ -export type MaxPrice$Outbound = { - prompt?: any | undefined; - completion?: any | undefined; - image?: any | undefined; - audio?: any | undefined; - request?: any | undefined; +export type OpenResponsesRequestMaxPrice$Outbound = { + prompt?: string | undefined; + completion?: string | undefined; + image?: string | undefined; + audio?: string | undefined; + request?: string | undefined; }; /** @internal */ -export const MaxPrice$outboundSchema: z.ZodType = z - .object({ - prompt: z.any().optional(), - completion: z.any().optional(), - image: z.any().optional(), - audio: z.any().optional(), - request: z.any().optional(), - }); +export const OpenResponsesRequestMaxPrice$outboundSchema: z.ZodType< + OpenResponsesRequestMaxPrice$Outbound, + OpenResponsesRequestMaxPrice +> = z.object({ + prompt: z.string().optional(), + completion: z.string().optional(), + image: z.string().optional(), + audio: z.string().optional(), + request: z.string().optional(), +}); -export function maxPriceToJSON(maxPrice: MaxPrice): string { - return JSON.stringify(MaxPrice$outboundSchema.parse(maxPrice)); +export function openResponsesRequestMaxPriceToJSON( + openResponsesRequestMaxPrice: OpenResponsesRequestMaxPrice, +): string { + return JSON.stringify( + OpenResponsesRequestMaxPrice$outboundSchema.parse( + openResponsesRequestMaxPrice, + ), + ); } /** @internal */ -export type Provider$Outbound = { +export type OpenResponsesRequestProvider$Outbound = { allow_fallbacks?: boolean | null | undefined; require_parameters?: boolean | null | undefined; data_collection?: string | null | undefined; @@ -435,132 +492,168 @@ export type Provider$Outbound = { ignore?: Array | null | undefined; quantizations?: Array | null | undefined; sort?: string | null | undefined; - max_price?: MaxPrice$Outbound | undefined; + max_price?: OpenResponsesRequestMaxPrice$Outbound | undefined; + min_throughput?: number | null | undefined; + max_latency?: number | null | undefined; }; /** @internal */ -export const Provider$outboundSchema: z.ZodType = z - .object({ - allowFallbacks: z.nullable(z.boolean()).optional(), - requireParameters: z.nullable(z.boolean()).optional(), - dataCollection: z.nullable(DataCollection$outboundSchema).optional(), - zdr: z.nullable(z.boolean()).optional(), - enforceDistillableText: z.nullable(z.boolean()).optional(), - order: z.nullable( - z.array(z.union([ProviderName$outboundSchema, z.string()])), - ).optional(), - only: z.nullable( - z.array(z.union([ProviderName$outboundSchema, z.string()])), - ).optional(), - ignore: z.nullable( - z.array(z.union([ProviderName$outboundSchema, z.string()])), - ).optional(), - quantizations: z.nullable(z.array(Quantization$outboundSchema)).optional(), - sort: z.nullable(ProviderSort$outboundSchema).optional(), - maxPrice: z.lazy(() => MaxPrice$outboundSchema).optional(), - }).transform((v) => { - return remap$(v, { - allowFallbacks: "allow_fallbacks", - requireParameters: "require_parameters", - dataCollection: "data_collection", - enforceDistillableText: "enforce_distillable_text", - maxPrice: "max_price", - }); +export const OpenResponsesRequestProvider$outboundSchema: z.ZodType< + OpenResponsesRequestProvider$Outbound, + OpenResponsesRequestProvider +> = z.object({ + allowFallbacks: z.nullable(z.boolean()).optional(), + requireParameters: z.nullable(z.boolean()).optional(), + dataCollection: z.nullable(DataCollection$outboundSchema).optional(), + zdr: z.nullable(z.boolean()).optional(), + enforceDistillableText: z.nullable(z.boolean()).optional(), + order: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()]))) + .optional(), + only: z.nullable(z.array(z.union([ProviderName$outboundSchema, z.string()]))) + .optional(), + ignore: z.nullable( + z.array(z.union([ProviderName$outboundSchema, z.string()])), + ).optional(), + quantizations: z.nullable(z.array(Quantization$outboundSchema)).optional(), + sort: z.nullable(ProviderSort$outboundSchema).optional(), + maxPrice: z.lazy(() => OpenResponsesRequestMaxPrice$outboundSchema) + .optional(), + minThroughput: z.nullable(z.number()).optional(), + maxLatency: z.nullable(z.number()).optional(), +}).transform((v) => { + return remap$(v, { + allowFallbacks: "allow_fallbacks", + requireParameters: "require_parameters", + dataCollection: "data_collection", + enforceDistillableText: "enforce_distillable_text", + maxPrice: "max_price", + minThroughput: "min_throughput", + maxLatency: "max_latency", }); +}); -export function providerToJSON(provider: Provider): string { - return JSON.stringify(Provider$outboundSchema.parse(provider)); +export function openResponsesRequestProviderToJSON( + openResponsesRequestProvider: OpenResponsesRequestProvider, +): string { + return JSON.stringify( + OpenResponsesRequestProvider$outboundSchema.parse( + openResponsesRequestProvider, + ), + ); } /** @internal */ -export type PluginResponseHealing$Outbound = { +export type OpenResponsesRequestPluginResponseHealing$Outbound = { id: "response-healing"; + enabled?: boolean | undefined; }; /** @internal */ -export const PluginResponseHealing$outboundSchema: z.ZodType< - PluginResponseHealing$Outbound, - PluginResponseHealing -> = z.object({ - id: z.literal("response-healing"), -}); +export const OpenResponsesRequestPluginResponseHealing$outboundSchema: + z.ZodType< + OpenResponsesRequestPluginResponseHealing$Outbound, + OpenResponsesRequestPluginResponseHealing + > = z.object({ + id: z.literal("response-healing"), + enabled: z.boolean().optional(), + }); -export function pluginResponseHealingToJSON( - pluginResponseHealing: PluginResponseHealing, +export function openResponsesRequestPluginResponseHealingToJSON( + openResponsesRequestPluginResponseHealing: + OpenResponsesRequestPluginResponseHealing, ): string { return JSON.stringify( - PluginResponseHealing$outboundSchema.parse(pluginResponseHealing), + OpenResponsesRequestPluginResponseHealing$outboundSchema.parse( + openResponsesRequestPluginResponseHealing, + ), ); } /** @internal */ -export const PdfEngine$outboundSchema: z.ZodType = openEnums - .outboundSchema(PdfEngine); +export const OpenResponsesRequestPdfEngine$outboundSchema: z.ZodType< + string, + OpenResponsesRequestPdfEngine +> = openEnums.outboundSchema(OpenResponsesRequestPdfEngine); /** @internal */ -export type Pdf$Outbound = { +export type OpenResponsesRequestPdf$Outbound = { engine?: string | undefined; }; /** @internal */ -export const Pdf$outboundSchema: z.ZodType = z.object({ - engine: PdfEngine$outboundSchema.optional(), +export const OpenResponsesRequestPdf$outboundSchema: z.ZodType< + OpenResponsesRequestPdf$Outbound, + OpenResponsesRequestPdf +> = z.object({ + engine: OpenResponsesRequestPdfEngine$outboundSchema.optional(), }); -export function pdfToJSON(pdf: Pdf): string { - return JSON.stringify(Pdf$outboundSchema.parse(pdf)); +export function openResponsesRequestPdfToJSON( + openResponsesRequestPdf: OpenResponsesRequestPdf, +): string { + return JSON.stringify( + OpenResponsesRequestPdf$outboundSchema.parse(openResponsesRequestPdf), + ); } /** @internal */ -export type PluginFileParser$Outbound = { +export type OpenResponsesRequestPluginFileParser$Outbound = { id: "file-parser"; + enabled?: boolean | undefined; max_files?: number | undefined; - pdf?: Pdf$Outbound | undefined; + pdf?: OpenResponsesRequestPdf$Outbound | undefined; }; /** @internal */ -export const PluginFileParser$outboundSchema: z.ZodType< - PluginFileParser$Outbound, - PluginFileParser +export const OpenResponsesRequestPluginFileParser$outboundSchema: z.ZodType< + OpenResponsesRequestPluginFileParser$Outbound, + OpenResponsesRequestPluginFileParser > = z.object({ id: z.literal("file-parser"), + enabled: z.boolean().optional(), maxFiles: z.number().optional(), - pdf: z.lazy(() => Pdf$outboundSchema).optional(), + pdf: z.lazy(() => OpenResponsesRequestPdf$outboundSchema).optional(), }).transform((v) => { return remap$(v, { maxFiles: "max_files", }); }); -export function pluginFileParserToJSON( - pluginFileParser: PluginFileParser, +export function openResponsesRequestPluginFileParserToJSON( + openResponsesRequestPluginFileParser: OpenResponsesRequestPluginFileParser, ): string { return JSON.stringify( - PluginFileParser$outboundSchema.parse(pluginFileParser), + OpenResponsesRequestPluginFileParser$outboundSchema.parse( + openResponsesRequestPluginFileParser, + ), ); } /** @internal */ -export const Engine$outboundSchema: z.ZodType = openEnums - .outboundSchema(Engine); +export const OpenResponsesRequestEngine$outboundSchema: z.ZodType< + string, + OpenResponsesRequestEngine +> = openEnums.outboundSchema(OpenResponsesRequestEngine); /** @internal */ -export type PluginWeb$Outbound = { +export type OpenResponsesRequestPluginWeb$Outbound = { id: "web"; + enabled?: boolean | undefined; max_results?: number | undefined; search_prompt?: string | undefined; engine?: string | undefined; }; /** @internal */ -export const PluginWeb$outboundSchema: z.ZodType< - PluginWeb$Outbound, - PluginWeb +export const OpenResponsesRequestPluginWeb$outboundSchema: z.ZodType< + OpenResponsesRequestPluginWeb$Outbound, + OpenResponsesRequestPluginWeb > = z.object({ id: z.literal("web"), + enabled: z.boolean().optional(), maxResults: z.number().optional(), searchPrompt: z.string().optional(), - engine: Engine$outboundSchema.optional(), + engine: OpenResponsesRequestEngine$outboundSchema.optional(), }).transform((v) => { return remap$(v, { maxResults: "max_results", @@ -568,51 +661,73 @@ export const PluginWeb$outboundSchema: z.ZodType< }); }); -export function pluginWebToJSON(pluginWeb: PluginWeb): string { - return JSON.stringify(PluginWeb$outboundSchema.parse(pluginWeb)); +export function openResponsesRequestPluginWebToJSON( + openResponsesRequestPluginWeb: OpenResponsesRequestPluginWeb, +): string { + return JSON.stringify( + OpenResponsesRequestPluginWeb$outboundSchema.parse( + openResponsesRequestPluginWeb, + ), + ); } /** @internal */ -export type PluginModeration$Outbound = { +export type OpenResponsesRequestPluginModeration$Outbound = { id: "moderation"; }; /** @internal */ -export const PluginModeration$outboundSchema: z.ZodType< - PluginModeration$Outbound, - PluginModeration +export const OpenResponsesRequestPluginModeration$outboundSchema: z.ZodType< + OpenResponsesRequestPluginModeration$Outbound, + OpenResponsesRequestPluginModeration > = z.object({ id: z.literal("moderation"), }); -export function pluginModerationToJSON( - pluginModeration: PluginModeration, +export function openResponsesRequestPluginModerationToJSON( + openResponsesRequestPluginModeration: OpenResponsesRequestPluginModeration, ): string { return JSON.stringify( - PluginModeration$outboundSchema.parse(pluginModeration), + OpenResponsesRequestPluginModeration$outboundSchema.parse( + openResponsesRequestPluginModeration, + ), ); } /** @internal */ -export type Plugin$Outbound = - | PluginModeration$Outbound - | PluginWeb$Outbound - | PluginFileParser$Outbound - | PluginResponseHealing$Outbound; +export type OpenResponsesRequestPluginUnion$Outbound = + | OpenResponsesRequestPluginModeration$Outbound + | OpenResponsesRequestPluginWeb$Outbound + | OpenResponsesRequestPluginFileParser$Outbound + | OpenResponsesRequestPluginResponseHealing$Outbound; /** @internal */ -export const Plugin$outboundSchema: z.ZodType = z - .union([ - z.lazy(() => PluginModeration$outboundSchema), - z.lazy(() => PluginWeb$outboundSchema), - z.lazy(() => PluginFileParser$outboundSchema), - z.lazy(() => PluginResponseHealing$outboundSchema), - ]); +export const OpenResponsesRequestPluginUnion$outboundSchema: z.ZodType< + OpenResponsesRequestPluginUnion$Outbound, + OpenResponsesRequestPluginUnion +> = z.union([ + z.lazy(() => OpenResponsesRequestPluginModeration$outboundSchema), + z.lazy(() => OpenResponsesRequestPluginWeb$outboundSchema), + z.lazy(() => OpenResponsesRequestPluginFileParser$outboundSchema), + z.lazy(() => OpenResponsesRequestPluginResponseHealing$outboundSchema), +]); -export function pluginToJSON(plugin: Plugin): string { - return JSON.stringify(Plugin$outboundSchema.parse(plugin)); +export function openResponsesRequestPluginUnionToJSON( + openResponsesRequestPluginUnion: OpenResponsesRequestPluginUnion, +): string { + return JSON.stringify( + OpenResponsesRequestPluginUnion$outboundSchema.parse( + openResponsesRequestPluginUnion, + ), + ); } +/** @internal */ +export const OpenResponsesRequestRoute$outboundSchema: z.ZodType< + string, + OpenResponsesRequestRoute +> = openEnums.outboundSchema(OpenResponsesRequestRoute); + /** @internal */ export type OpenResponsesRequest$Outbound = { input?: OpenResponsesInput$Outbound | undefined; @@ -647,16 +762,18 @@ export type OpenResponsesRequest$Outbound = { service_tier: string; truncation?: string | null | undefined; stream: boolean; - provider?: Provider$Outbound | null | undefined; + provider?: OpenResponsesRequestProvider$Outbound | null | undefined; plugins?: | Array< - | PluginModeration$Outbound - | PluginWeb$Outbound - | PluginFileParser$Outbound - | PluginResponseHealing$Outbound + | OpenResponsesRequestPluginModeration$Outbound + | OpenResponsesRequestPluginWeb$Outbound + | OpenResponsesRequestPluginFileParser$Outbound + | OpenResponsesRequestPluginResponseHealing$Outbound > | undefined; + route?: string | null | undefined; user?: string | undefined; + session_id?: string | undefined; }; /** @internal */ @@ -697,16 +814,20 @@ export const OpenResponsesRequest$outboundSchema: z.ZodType< serviceTier: ServiceTier$outboundSchema.default("auto"), truncation: z.nullable(Truncation$outboundSchema).optional(), stream: z.boolean().default(false), - provider: z.nullable(z.lazy(() => Provider$outboundSchema)).optional(), + provider: z.nullable( + z.lazy(() => OpenResponsesRequestProvider$outboundSchema), + ).optional(), plugins: z.array( z.union([ - z.lazy(() => PluginModeration$outboundSchema), - z.lazy(() => PluginWeb$outboundSchema), - z.lazy(() => PluginFileParser$outboundSchema), - z.lazy(() => PluginResponseHealing$outboundSchema), + z.lazy(() => OpenResponsesRequestPluginModeration$outboundSchema), + z.lazy(() => OpenResponsesRequestPluginWeb$outboundSchema), + z.lazy(() => OpenResponsesRequestPluginFileParser$outboundSchema), + z.lazy(() => OpenResponsesRequestPluginResponseHealing$outboundSchema), ]), ).optional(), + route: z.nullable(OpenResponsesRequestRoute$outboundSchema).optional(), user: z.string().optional(), + sessionId: z.string().optional(), }).transform((v) => { return remap$(v, { toolChoice: "tool_choice", @@ -718,6 +839,7 @@ export const OpenResponsesRequest$outboundSchema: z.ZodType< previousResponseId: "previous_response_id", safetyIdentifier: "safety_identifier", serviceTier: "service_tier", + sessionId: "session_id", }); }); diff --git a/src/models/operations/createembeddings.ts b/src/models/operations/createembeddings.ts index 422746eb..6075f50d 100644 --- a/src/models/operations/createembeddings.ts +++ b/src/models/operations/createembeddings.ts @@ -55,25 +55,25 @@ export type Ignore = models.ProviderName | string; */ export type MaxPrice = { /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - prompt?: any | undefined; + prompt?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - completion?: any | undefined; + completion?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - image?: any | undefined; + image?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - audio?: any | undefined; + audio?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - request?: any | undefined; + request?: string | undefined; }; export type CreateEmbeddingsProvider = { @@ -130,6 +130,14 @@ export type CreateEmbeddingsProvider = { * 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; + /** + * The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used. + */ + minThroughput?: number | null | undefined; + /** + * The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used. + */ + maxLatency?: number | null | undefined; }; export type CreateEmbeddingsRequest = { @@ -174,7 +182,7 @@ export type Usage = { /** * Embedding response */ -export type CreateEmbeddingsResponse = { +export type CreateEmbeddingsResponseBody = { id?: string | undefined; object: ObjectT; data: Array; @@ -182,6 +190,8 @@ export type CreateEmbeddingsResponse = { usage?: Usage | undefined; }; +export type CreateEmbeddingsResponse = CreateEmbeddingsResponseBody | string; + /** @internal */ export type ImageUrl$Outbound = { url: string; @@ -341,21 +351,21 @@ export function ignoreToJSON(ignore: Ignore): string { /** @internal */ export type MaxPrice$Outbound = { - prompt?: any | undefined; - completion?: any | undefined; - image?: any | undefined; - audio?: any | undefined; - request?: any | undefined; + prompt?: string | undefined; + completion?: string | undefined; + image?: string | undefined; + audio?: string | undefined; + request?: string | undefined; }; /** @internal */ export const MaxPrice$outboundSchema: z.ZodType = z .object({ - prompt: z.any().optional(), - completion: z.any().optional(), - image: z.any().optional(), - audio: z.any().optional(), - request: z.any().optional(), + prompt: z.string().optional(), + completion: z.string().optional(), + image: z.string().optional(), + audio: z.string().optional(), + request: z.string().optional(), }); export function maxPriceToJSON(maxPrice: MaxPrice): string { @@ -375,6 +385,8 @@ export type CreateEmbeddingsProvider$Outbound = { quantizations?: Array | null | undefined; sort?: string | null | undefined; max_price?: MaxPrice$Outbound | undefined; + min_throughput?: number | null | undefined; + max_latency?: number | null | undefined; }; /** @internal */ @@ -400,6 +412,8 @@ export const CreateEmbeddingsProvider$outboundSchema: z.ZodType< .optional(), sort: z.nullable(models.ProviderSort$outboundSchema).optional(), maxPrice: z.lazy(() => MaxPrice$outboundSchema).optional(), + minThroughput: z.nullable(z.number()).optional(), + maxLatency: z.nullable(z.number()).optional(), }).transform((v) => { return remap$(v, { allowFallbacks: "allow_fallbacks", @@ -407,6 +421,8 @@ export const CreateEmbeddingsProvider$outboundSchema: z.ZodType< dataCollection: "data_collection", enforceDistillableText: "enforce_distillable_text", maxPrice: "max_price", + minThroughput: "min_throughput", + maxLatency: "max_latency", }); }); @@ -533,8 +549,8 @@ export function usageFromJSON( } /** @internal */ -export const CreateEmbeddingsResponse$inboundSchema: z.ZodType< - CreateEmbeddingsResponse, +export const CreateEmbeddingsResponseBody$inboundSchema: z.ZodType< + CreateEmbeddingsResponseBody, unknown > = z.object({ id: z.string().optional(), @@ -544,6 +560,25 @@ export const CreateEmbeddingsResponse$inboundSchema: z.ZodType< usage: z.lazy(() => Usage$inboundSchema).optional(), }); +export function createEmbeddingsResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreateEmbeddingsResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateEmbeddingsResponseBody' from JSON`, + ); +} + +/** @internal */ +export const CreateEmbeddingsResponse$inboundSchema: z.ZodType< + CreateEmbeddingsResponse, + unknown +> = z.union([ + z.lazy(() => CreateEmbeddingsResponseBody$inboundSchema), + z.string(), +]); + export function createEmbeddingsResponseFromJSON( jsonString: string, ): SafeParseResult { diff --git a/src/models/operations/getparameters.ts b/src/models/operations/getparameters.ts index a9ce83a4..63268d09 100644 --- a/src/models/operations/getparameters.ts +++ b/src/models/operations/getparameters.ts @@ -51,6 +51,7 @@ export const GetParametersProvider = { Infermatic: "Infermatic", Inflection: "Inflection", Liquid: "Liquid", + Mara: "Mara", Mancer2: "Mancer 2", Minimax: "Minimax", ModelRun: "ModelRun", @@ -71,6 +72,7 @@ export const GetParametersProvider = { Relace: "Relace", SambaNova: "SambaNova", SiliconFlow: "SiliconFlow", + Sourceful: "Sourceful", Stealth: "Stealth", StreamLake: "StreamLake", Switchpoint: "Switchpoint", @@ -78,6 +80,7 @@ export const GetParametersProvider = { Together: "Together", Venice: "Venice", WandB: "WandB", + Xiaomi: "Xiaomi", XAI: "xAI", ZAi: "Z.AI", FakeProvider: "FakeProvider", diff --git a/src/models/providername.ts b/src/models/providername.ts index dd49404a..0999cb10 100644 --- a/src/models/providername.ts +++ b/src/models/providername.ts @@ -43,6 +43,7 @@ export const ProviderName = { Infermatic: "Infermatic", Inflection: "Inflection", Liquid: "Liquid", + Mara: "Mara", Mancer2: "Mancer 2", Minimax: "Minimax", ModelRun: "ModelRun", @@ -63,6 +64,7 @@ export const ProviderName = { Relace: "Relace", SambaNova: "SambaNova", SiliconFlow: "SiliconFlow", + Sourceful: "Sourceful", Stealth: "Stealth", StreamLake: "StreamLake", Switchpoint: "Switchpoint", @@ -70,6 +72,7 @@ export const ProviderName = { Together: "Together", Venice: "Venice", WandB: "WandB", + Xiaomi: "Xiaomi", XAI: "xAI", ZAi: "Z.AI", FakeProvider: "FakeProvider", diff --git a/src/models/publicendpoint.ts b/src/models/publicendpoint.ts index dcf76d88..4580d344 100644 --- a/src/models/publicendpoint.ts +++ b/src/models/publicendpoint.ts @@ -18,53 +18,53 @@ import { ProviderName, ProviderName$inboundSchema } from "./providername.js"; export type Pricing = { /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - prompt?: any | undefined; + prompt: string; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - completion?: any | undefined; + completion: string; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - request?: any | undefined; + request?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - image?: any | undefined; + image?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - imageToken?: any | undefined; + imageToken?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - imageOutput?: any | undefined; + imageOutput?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - audio?: any | undefined; + audio?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - inputAudioCache?: any | undefined; + inputAudioCache?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - webSearch?: any | undefined; + webSearch?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - internalReasoning?: any | undefined; + internalReasoning?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - inputCacheRead?: any | undefined; + inputCacheRead?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - inputCacheWrite?: any | undefined; + inputCacheWrite?: string | undefined; discount?: number | undefined; }; @@ -104,18 +104,18 @@ export type PublicEndpoint = { /** @internal */ export const Pricing$inboundSchema: z.ZodType = z.object({ - prompt: z.any().optional(), - 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(), - web_search: z.any().optional(), - internal_reasoning: z.any().optional(), - input_cache_read: z.any().optional(), - input_cache_write: z.any().optional(), + prompt: z.string(), + completion: z.string(), + request: z.string().optional(), + image: z.string().optional(), + image_token: z.string().optional(), + image_output: z.string().optional(), + audio: z.string().optional(), + input_audio_cache: z.string().optional(), + web_search: z.string().optional(), + internal_reasoning: z.string().optional(), + input_cache_read: z.string().optional(), + input_cache_write: z.string().optional(), discount: z.number().optional(), }).transform((v) => { return remap$(v, { diff --git a/src/models/publicpricing.ts b/src/models/publicpricing.ts index 831812c2..22d325a4 100644 --- a/src/models/publicpricing.ts +++ b/src/models/publicpricing.ts @@ -13,71 +13,71 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js"; */ export type PublicPricing = { /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - prompt?: any | undefined; + prompt: string; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - completion?: any | undefined; + completion: string; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - request?: any | undefined; + request?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - image?: any | undefined; + image?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - imageToken?: any | undefined; + imageToken?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - imageOutput?: any | undefined; + imageOutput?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - audio?: any | undefined; + audio?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - inputAudioCache?: any | undefined; + inputAudioCache?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - webSearch?: any | undefined; + webSearch?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - internalReasoning?: any | undefined; + internalReasoning?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - inputCacheRead?: any | undefined; + inputCacheRead?: string | undefined; /** - * A value in string or number format that is a large number + * A value in string format that is a large number */ - inputCacheWrite?: any | undefined; + inputCacheWrite?: string | undefined; discount?: number | undefined; }; /** @internal */ export const PublicPricing$inboundSchema: z.ZodType = z .object({ - prompt: z.any().optional(), - 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(), - web_search: z.any().optional(), - internal_reasoning: z.any().optional(), - input_cache_read: z.any().optional(), - input_cache_write: z.any().optional(), + prompt: z.string(), + completion: z.string(), + request: z.string().optional(), + image: z.string().optional(), + image_token: z.string().optional(), + image_output: z.string().optional(), + audio: z.string().optional(), + input_audio_cache: z.string().optional(), + web_search: z.string().optional(), + internal_reasoning: z.string().optional(), + input_cache_read: z.string().optional(), + input_cache_write: z.string().optional(), discount: z.number().optional(), }).transform((v) => { return remap$(v, { diff --git a/src/models/schema0.ts b/src/models/schema0.ts new file mode 100644 index 00000000..7d8a4383 --- /dev/null +++ b/src/models/schema0.ts @@ -0,0 +1,97 @@ +/* + * 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 Schema0Enum = { + Ai21: "AI21", + AionLabs: "AionLabs", + Alibaba: "Alibaba", + AmazonBedrock: "Amazon Bedrock", + AmazonNova: "Amazon Nova", + Anthropic: "Anthropic", + ArceeAI: "Arcee AI", + AtlasCloud: "AtlasCloud", + Avian: "Avian", + Azure: "Azure", + BaseTen: "BaseTen", + BytePlus: "BytePlus", + BlackForestLabs: "Black Forest Labs", + Cerebras: "Cerebras", + Chutes: "Chutes", + Cirrascale: "Cirrascale", + Clarifai: "Clarifai", + Cloudflare: "Cloudflare", + Cohere: "Cohere", + Crusoe: "Crusoe", + DeepInfra: "DeepInfra", + DeepSeek: "DeepSeek", + Featherless: "Featherless", + Fireworks: "Fireworks", + Friendli: "Friendli", + GMICloud: "GMICloud", + GoPomelo: "GoPomelo", + Google: "Google", + GoogleAIStudio: "Google AI Studio", + Groq: "Groq", + Hyperbolic: "Hyperbolic", + Inception: "Inception", + InferenceNet: "InferenceNet", + Infermatic: "Infermatic", + Inflection: "Inflection", + Liquid: "Liquid", + Mara: "Mara", + Mancer2: "Mancer 2", + Minimax: "Minimax", + ModelRun: "ModelRun", + Mistral: "Mistral", + Modular: "Modular", + MoonshotAI: "Moonshot AI", + Morph: "Morph", + NCompass: "NCompass", + Nebius: "Nebius", + NextBit: "NextBit", + Novita: "Novita", + Nvidia: "Nvidia", + OpenAI: "OpenAI", + OpenInference: "OpenInference", + Parasail: "Parasail", + Perplexity: "Perplexity", + Phala: "Phala", + Relace: "Relace", + SambaNova: "SambaNova", + SiliconFlow: "SiliconFlow", + Sourceful: "Sourceful", + Stealth: "Stealth", + StreamLake: "StreamLake", + Switchpoint: "Switchpoint", + Targon: "Targon", + Together: "Together", + Venice: "Venice", + WandB: "WandB", + Xiaomi: "Xiaomi", + XAI: "xAI", + ZAi: "Z.AI", + FakeProvider: "FakeProvider", +} as const; +export type Schema0Enum = OpenEnum; + +export type Schema0 = Schema0Enum | string; + +/** @internal */ +export const Schema0Enum$outboundSchema: z.ZodType = + openEnums.outboundSchema(Schema0Enum); + +/** @internal */ +export type Schema0$Outbound = string | string; + +/** @internal */ +export const Schema0$outboundSchema: z.ZodType = z + .union([Schema0Enum$outboundSchema, z.string()]); + +export function schema0ToJSON(schema0: Schema0): string { + return JSON.stringify(Schema0$outboundSchema.parse(schema0)); +}