diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 80c63ae1..c490380e 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: 49621e9bf67482e01c2be5fffeb0c319 + docChecksum: 973d42c85e29be093122e32bf9e93222 docVersion: 1.0.0 - speakeasyVersion: 1.650.0 - generationVersion: 2.743.2 - releaseVersion: 0.1.3 - configChecksum: 63545a2e0664767bc4706b01fd016538 + speakeasyVersion: 1.651.0 + generationVersion: 2.745.2 + releaseVersion: 0.1.4 + configChecksum: 275f2f4f98e826740764856e6e029cc1 repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true @@ -126,7 +126,6 @@ generatedFiles: - docs/models/errors/toomanyrequestsresponseerror.md - docs/models/errors/unauthorizedresponseerror.md - docs/models/errors/unprocessableentityresponseerror.md - - docs/models/experimental.md - docs/models/filecitation.md - docs/models/filecitationtype.md - docs/models/filepath.md @@ -323,7 +322,6 @@ generatedFiles: - docs/models/operations/exchangeauthcodeforapikeycodechallengemethod.md - docs/models/operations/exchangeauthcodeforapikeyrequest.md - docs/models/operations/exchangeauthcodeforapikeyresponse.md - - docs/models/operations/experimental.md - docs/models/operations/getcreditsresponse.md - docs/models/operations/getcurrentkeydata.md - docs/models/operations/getcurrentkeyresponse.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 41509096..0e9d84ea 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -30,7 +30,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: false typescript: - version: 0.1.3 + version: 0.1.4 acceptHeaderEnum: false additionalDependencies: dependencies: {} diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml index b141c31d..0751a0a3 100644 --- a/.speakeasy/in.openapi.yaml +++ b/.speakeasy/in.openapi.yaml @@ -3712,6 +3712,13 @@ components: Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. example: true + enforce_distillable_text: + type: boolean + nullable: true + description: >- + Whether to restrict routing to only models that allow text distillation. When true, only models where + the author has allowed distillation will be used. + example: true order: type: array nullable: true @@ -3777,10 +3784,6 @@ components: description: >- The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. - experimental: - type: object - nullable: true - properties: {} additionalProperties: false description: When multiple model providers are available, optionally indicate your routing preference. plugins: @@ -4826,6 +4829,8 @@ components: type: number audio_tokens: type: number + video_tokens: + type: number - type: 'null' required: - completion_tokens @@ -6039,6 +6044,13 @@ paths: Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. example: true + enforce_distillable_text: + type: boolean + nullable: true + description: >- + Whether to restrict routing to only models that allow text distillation. When true, only models + where the author has allowed distillation will be used. + example: true order: type: array nullable: true @@ -6104,10 +6116,6 @@ paths: description: >- The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. - experimental: - type: object - nullable: true - properties: {} encoding_format: anyOf: - type: string diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 2897e797..cbd3c9a0 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -3731,6 +3731,12 @@ components: description: >- Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. example: true + enforce_distillable_text: + type: boolean + nullable: true + description: >- + Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. + example: true order: type: array nullable: true @@ -3791,10 +3797,6 @@ components: 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. - experimental: - type: object - nullable: true - properties: {} additionalProperties: false description: When multiple model providers are available, optionally indicate your routing preference. plugins: @@ -4850,6 +4852,8 @@ components: type: number audio_tokens: type: number + video_tokens: + type: number - type: 'null' required: - completion_tokens @@ -6063,6 +6067,12 @@ paths: description: >- Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. example: true + enforce_distillable_text: + type: boolean + nullable: true + description: >- + Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. + example: true order: type: array nullable: true @@ -6123,10 +6133,6 @@ paths: additionalProperties: false description: >- The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. - experimental: - type: object - nullable: true - properties: {} encoding_format: anyOf: - type: string diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 3a34c340..e96b202b 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.650.0 +speakeasyVersion: 1.651.0 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:602ebe32972d3a9f71ad7818b56e0fac7186a4e9daae697f9089ed2e6ddad8b5 - sourceBlobDigest: sha256:bef8a7311b8c8cd0a18ffff29b615130fbc50b538d7214727d72f188c6882daf + sourceRevisionDigest: sha256:73beb40e7db6cb1d1bfbc364fd655f9ebdf6f9d6b3f1a71836a3a851d07e5d80 + sourceBlobDigest: sha256:ab3d90309e030249c89844dba54d28dc758bee9c5749ddfd961e4bb844bc5128 tags: - latest - staging @@ -12,10 +12,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:602ebe32972d3a9f71ad7818b56e0fac7186a4e9daae697f9089ed2e6ddad8b5 - sourceBlobDigest: sha256:bef8a7311b8c8cd0a18ffff29b615130fbc50b538d7214727d72f188c6882daf + sourceRevisionDigest: sha256:73beb40e7db6cb1d1bfbc364fd655f9ebdf6f9d6b3f1a71836a3a851d07e5d80 + sourceBlobDigest: sha256:ab3d90309e030249c89844dba54d28dc758bee9c5749ddfd961e4bb844bc5128 codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:c28a52583bcb017b39fb134f0515aba9475dd31ba61c230ddd3b512b237b1e8f + codeSamplesRevisionDigest: sha256:91344e8fa83401c24be0aa398ba3b549d0e127e374c1d4de750127956cd78d75 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/docs/models/experimental.md b/docs/models/experimental.md deleted file mode 100644 index 19a275b7..00000000 --- a/docs/models/experimental.md +++ /dev/null @@ -1,14 +0,0 @@ -# Experimental - -## Example Usage - -```typescript -import { Experimental } from "@openrouter/sdk/models"; - -let value: Experimental = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/createembeddingsprovider.md b/docs/models/operations/createembeddingsprovider.md index 5e33a470..6c95cf1c 100644 --- a/docs/models/operations/createembeddingsprovider.md +++ b/docs/models/operations/createembeddingsprovider.md @@ -16,10 +16,10 @@ let value: CreateEmbeddingsProvider = {}; | `requireParameters` | *boolean* | :heavy_minus_sign: | Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. | | | `dataCollection` | [operations.DataCollection](../../models/operations/datacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it
- deny: use only providers which do not collect user data.
| deny | | `zdr` | *boolean* | :heavy_minus_sign: | Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. | true | +| `enforceDistillableText` | *boolean* | :heavy_minus_sign: | Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. | true | | `order` | *operations.Order*[] | :heavy_minus_sign: | An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. | | | `only` | *operations.Only*[] | :heavy_minus_sign: | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. | | | `ignore` | *operations.Ignore*[] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | | | `quantizations` | [models.Quantization](../../models/quantization.md)[] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | | | `sort` | [operations.Sort](../../models/operations/sort.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | price | -| `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. | | -| `experimental` | [operations.Experimental](../../models/operations/experimental.md) | :heavy_minus_sign: | N/A | | \ 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. | | \ No newline at end of file diff --git a/docs/models/operations/experimental.md b/docs/models/operations/experimental.md deleted file mode 100644 index b19b0ac5..00000000 --- a/docs/models/operations/experimental.md +++ /dev/null @@ -1,14 +0,0 @@ -# Experimental - -## Example Usage - -```typescript -import { Experimental } from "@openrouter/sdk/models/operations"; - -let value: Experimental = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/prompttokensdetails.md b/docs/models/prompttokensdetails.md index 88b1e3de..c01910fe 100644 --- a/docs/models/prompttokensdetails.md +++ b/docs/models/prompttokensdetails.md @@ -13,4 +13,5 @@ let value: PromptTokensDetails = {}; | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | | `cachedTokens` | *number* | :heavy_minus_sign: | N/A | -| `audioTokens` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `audioTokens` | *number* | :heavy_minus_sign: | N/A | +| `videoTokens` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/provider.md b/docs/models/provider.md index e38fcef8..a4c5d100 100644 --- a/docs/models/provider.md +++ b/docs/models/provider.md @@ -18,10 +18,10 @@ let value: Provider = {}; | `requireParameters` | *boolean* | :heavy_minus_sign: | Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. | | | `dataCollection` | [models.DataCollection](../models/datacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it
- deny: use only providers which do not collect user data.
| deny | | `zdr` | *boolean* | :heavy_minus_sign: | Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. | true | +| `enforceDistillableText` | *boolean* | :heavy_minus_sign: | Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. | true | | `order` | *models.Order*[] | :heavy_minus_sign: | An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. | | | `only` | *models.Only*[] | :heavy_minus_sign: | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. | | | `ignore` | *models.Ignore*[] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | | | `quantizations` | [models.Quantization](../models/quantization.md)[] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | | | `sort` | [models.Sort](../models/sort.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | price | -| `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. | | -| `experimental` | [models.Experimental](../models/experimental.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `maxPrice` | [models.MaxPrice](../models/maxprice.md) | :heavy_minus_sign: | The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. | | \ No newline at end of file diff --git a/examples/nextjs-example/package-lock.json b/examples/nextjs-example/package-lock.json index 045e0aad..77ab6ea0 100644 --- a/examples/nextjs-example/package-lock.json +++ b/examples/nextjs-example/package-lock.json @@ -36,7 +36,7 @@ }, "../..": { "name": "@openrouter/sdk", - "version": "0.1.3", + "version": "0.1.4", "dependencies": { "zod": "^3.25.0 || ^4.0.0" }, diff --git a/jsr.json b/jsr.json index 6b40889e..86431fbb 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "0.1.3", + "version": "0.1.4", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 4c336f98..3edc336d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@openrouter/sdk", - "version": "0.1.3", + "version": "0.1.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@openrouter/sdk", - "version": "0.1.3", + "version": "0.1.4", "dependencies": { "zod": "^3.25.0 || ^4.0.0" }, diff --git a/package.json b/package.json index 89b753cb..cdbe4624 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "0.1.3", + "version": "0.1.4", "author": "OpenRouter", "type": "module", "main": "./esm/index.js", diff --git a/src/lib/config.ts b/src/lib/config.ts index b7743b50..d449e1a8 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -59,7 +59,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0.0", - sdkVersion: "0.1.3", - genVersion: "2.743.2", - userAgent: "speakeasy-sdk/typescript 0.1.3 2.743.2 1.0.0 @openrouter/sdk", + sdkVersion: "0.1.4", + genVersion: "2.745.2", + userAgent: "speakeasy-sdk/typescript 0.1.4 2.745.2 1.0.0 @openrouter/sdk", } as const; diff --git a/src/models/chatgenerationtokenusage.ts b/src/models/chatgenerationtokenusage.ts index dd9b275a..e3658f5e 100644 --- a/src/models/chatgenerationtokenusage.ts +++ b/src/models/chatgenerationtokenusage.ts @@ -18,6 +18,7 @@ export type CompletionTokensDetails = { export type PromptTokensDetails = { cachedTokens?: number | undefined; audioTokens?: number | undefined; + videoTokens?: number | undefined; }; export type ChatGenerationTokenUsage = { @@ -63,10 +64,12 @@ export const PromptTokensDetails$inboundSchema: z.ZodType< > = z.object({ cached_tokens: z.number().optional(), audio_tokens: z.number().optional(), + video_tokens: z.number().optional(), }).transform((v) => { return remap$(v, { "cached_tokens": "cachedTokens", "audio_tokens": "audioTokens", + "video_tokens": "videoTokens", }); }); diff --git a/src/models/openresponsesrequest.ts b/src/models/openresponsesrequest.ts index 6c9befc2..c9e4e9c5 100644 --- a/src/models/openresponsesrequest.ts +++ b/src/models/openresponsesrequest.ts @@ -162,8 +162,6 @@ export type MaxPrice = { request?: any | undefined; }; -export type Experimental = {}; - /** * When multiple model providers are available, optionally indicate your routing preference. */ @@ -192,6 +190,10 @@ export type Provider = { * Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. */ zdr?: boolean | null | undefined; + /** + * Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. + */ + 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. */ @@ -216,7 +218,6 @@ 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; - experimental?: Experimental | null | undefined; }; export const IdFileParser = { @@ -487,32 +488,19 @@ export function maxPriceToJSON(maxPrice: MaxPrice): string { return JSON.stringify(MaxPrice$outboundSchema.parse(maxPrice)); } -/** @internal */ -export type Experimental$Outbound = {}; - -/** @internal */ -export const Experimental$outboundSchema: z.ZodType< - Experimental$Outbound, - Experimental -> = z.object({}); - -export function experimentalToJSON(experimental: Experimental): string { - return JSON.stringify(Experimental$outboundSchema.parse(experimental)); -} - /** @internal */ export type Provider$Outbound = { allow_fallbacks?: boolean | null | undefined; require_parameters?: boolean | null | undefined; data_collection?: string | null | undefined; zdr?: boolean | null | undefined; + enforce_distillable_text?: boolean | null | undefined; order?: Array | null | undefined; only?: Array | null | undefined; ignore?: Array | null | undefined; quantizations?: Array | null | undefined; sort?: string | null | undefined; max_price?: MaxPrice$Outbound | undefined; - experimental?: Experimental$Outbound | null | undefined; }; /** @internal */ @@ -522,6 +510,7 @@ export const Provider$outboundSchema: z.ZodType = z 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(), @@ -534,13 +523,12 @@ export const Provider$outboundSchema: z.ZodType = z quantizations: z.nullable(z.array(Quantization$outboundSchema)).optional(), sort: z.nullable(Sort$outboundSchema).optional(), maxPrice: z.lazy(() => MaxPrice$outboundSchema).optional(), - experimental: z.nullable(z.lazy(() => Experimental$outboundSchema)) - .optional(), }).transform((v) => { return remap$(v, { allowFallbacks: "allow_fallbacks", requireParameters: "require_parameters", dataCollection: "data_collection", + enforceDistillableText: "enforce_distillable_text", maxPrice: "max_price", }); }); diff --git a/src/models/operations/createembeddings.ts b/src/models/operations/createembeddings.ts index 3f777af1..706b0d97 100644 --- a/src/models/operations/createembeddings.ts +++ b/src/models/operations/createembeddings.ts @@ -81,8 +81,6 @@ export type MaxPrice = { request?: any | undefined; }; -export type Experimental = {}; - export type CreateEmbeddingsProvider = { /** * Whether to allow backup providers to serve requests @@ -108,6 +106,10 @@ export type CreateEmbeddingsProvider = { * Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. */ zdr?: boolean | null | undefined; + /** + * Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. + */ + 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. */ @@ -132,7 +134,6 @@ 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; - experimental?: Experimental | null | undefined; }; export const EncodingFormatBase64 = { @@ -286,32 +287,19 @@ export function maxPriceToJSON(maxPrice: MaxPrice): string { return JSON.stringify(MaxPrice$outboundSchema.parse(maxPrice)); } -/** @internal */ -export type Experimental$Outbound = {}; - -/** @internal */ -export const Experimental$outboundSchema: z.ZodType< - Experimental$Outbound, - Experimental -> = z.object({}); - -export function experimentalToJSON(experimental: Experimental): string { - return JSON.stringify(Experimental$outboundSchema.parse(experimental)); -} - /** @internal */ export type CreateEmbeddingsProvider$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?: MaxPrice$Outbound | undefined; - experimental?: Experimental$Outbound | null | undefined; }; /** @internal */ @@ -323,6 +311,7 @@ export const CreateEmbeddingsProvider$outboundSchema: z.ZodType< 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([models.ProviderName$outboundSchema, z.string()])), ).optional(), @@ -336,13 +325,12 @@ export const CreateEmbeddingsProvider$outboundSchema: z.ZodType< .optional(), sort: z.nullable(Sort$outboundSchema).optional(), maxPrice: z.lazy(() => MaxPrice$outboundSchema).optional(), - experimental: z.nullable(z.lazy(() => Experimental$outboundSchema)) - .optional(), }).transform((v) => { return remap$(v, { allowFallbacks: "allow_fallbacks", requireParameters: "require_parameters", dataCollection: "data_collection", + enforceDistillableText: "enforce_distillable_text", maxPrice: "max_price", }); });