From 2135f0a2d9d76f4c3923aeeae0c149e5c006dd35 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Mon, 10 Aug 2026 15:21:28 +0000 Subject: [PATCH 1/2] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.787.0 --- .speakeasy/gen.lock | 44 +++++++++---------- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 18 ++++---- .speakeasy/workflow.lock | 10 ++--- RELEASES.md | 12 ++++- docs/components/autobetarouterplugin.mdx | 16 +++---- .../autobetarouterplugincosttier.mdx | 2 +- docs/components/autorouterplugin.mdx | 18 ++++---- docs/components/autorouterplugincosttier.mdx | 2 +- pyproject.toml | 2 +- src/openrouter/_version.py | 4 +- .../components/autobetarouterplugin.py | 14 +++--- src/openrouter/components/autorouterplugin.py | 14 +++--- uv.lock | 2 +- 14 files changed, 85 insertions(+), 75 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 82c155dc..b2f33b20 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: c48cf606-fb42-4a45-9c23-8f0555307828 management: - docChecksum: cf4f2577fb6aa3e9b6c9749ea7a11b7a + docChecksum: 8ede64aad6d17e4f87c4b39ce933ada2 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.1.38 - configChecksum: 852b26b5c60d1a2e7881165023644389 + releaseVersion: 1.1.39 + configChecksum: 7f9824cc3197d73cf65c172ce031d036 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 68678169-ef2a-428f-be67-92b8f3fd798d - pristine_commit_hash: 516d29e2b74ee99293e1396768864268fe069aed - pristine_tree_hash: c10e55b58ee70ce7d19bfc7581098cd04d82f7b2 + generation_id: 48616d01-e54c-4095-8f95-f422376258d5 + pristine_commit_hash: 7ac7061ac11b14ce0a8b53e9cf88dbf29c3a4727 + pristine_tree_hash: e3f44e92e87d7b7bddc0a758a6e35aaedf9a2bfb features: python: acceptHeaders: 3.0.0 @@ -650,24 +650,24 @@ trackedFiles: pristine_git_object: ef98b1de499df79940ccacaf5da0be2d635b104e docs/components/autobetarouterplugin.mdx: id: 036f0e51d7c9 - last_write_checksum: sha1:f69a1c5c8d69de1c36b710fca3b5f34e7d2ddbf4 - pristine_git_object: 0ad5b6f463784919f5b9b1d0946de05e02a91ab1 + last_write_checksum: sha1:94f02925c23cb90fe0b3532357c8d706d99388fb + pristine_git_object: dd8c11875eb91ee521e3c8dbd01351c88b462501 docs/components/autobetarouterplugincosttier.mdx: id: b56ac3529805 - last_write_checksum: sha1:f5e869ca0629601f0367ca1e5614bb1d1f58f70f - pristine_git_object: b2e319282c4ebbb4eb7eb01115c54021916e287e + last_write_checksum: sha1:6c9910aa8bbd3d32206e3a30baa0a9d1d7d78844 + pristine_git_object: 201351d70b5c298e8e64f52048b89ad0bd261cd7 docs/components/autobetarouterpluginid.mdx: id: 619eb7d92a83 last_write_checksum: sha1:47b80552a64dbc3dc37421630fddf931ffe5c795 pristine_git_object: 800b8e4a3fd07f10592e3ee8f9c15c7e57398d4c docs/components/autorouterplugin.mdx: id: 4d62f9b36bc2 - last_write_checksum: sha1:1e62c64377f4f961f678ef7da29d14cb80f0bb48 - pristine_git_object: 5e2e372cdebdae0ce6f6758ed7656517b15a173d + last_write_checksum: sha1:7197e6355a37b1a44e5baa9a3a3d76a72e6ae648 + pristine_git_object: f128f4a8af060555106cf2c1b9e3e98c67ef629b docs/components/autorouterplugincosttier.mdx: id: 72049c1ccaf4 - last_write_checksum: sha1:88c357901d1b51ef575f21ee957f6aa16bba7b83 - pristine_git_object: 77c913f91b03aefe7f6997bb588080a84960b777 + last_write_checksum: sha1:e39aa2557889658bd06007f9731c277e9b537e12 + pristine_git_object: b06654b8292488471ec316b3f2aceec6eacf5db8 docs/components/autorouterpluginid.mdx: id: ea9862a88ce8 last_write_checksum: sha1:51d6cd6296501209ebc8b721adb3feadeb798f9a @@ -7106,8 +7106,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:9bdd842ddb4463c974aecfd9be8c46c99bb68480 - pristine_git_object: 7bcca3ad227ca6e5cc80284e4b3aec20164c90a3 + last_write_checksum: sha1:d8d63f40b234f19da09326afcde5a467253c45d9 + pristine_git_object: ce5d9656dcb74b9b09f66619f39bd0cf58bff036 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -7134,8 +7134,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:cccf07809887714e342029e1df6ec25d54eb19e9 - pristine_git_object: 590bde78735894705b30be7be589833ac3180a39 + last_write_checksum: sha1:c4d146d77cb18189d6d83253caee92c73bad220b + pristine_git_object: 682398c0d1af843933d8a689c8bdeaac7d10e421 src/openrouter/analytics.py: id: cb406b5aaabb last_write_checksum: sha1:3ea0f1c73fb9c101b7bc5719da4dd7bf62ff469a @@ -7446,12 +7446,12 @@ trackedFiles: pristine_git_object: 2ccc3d9be586133e5d5138c77eacefa243987fb5 src/openrouter/components/autobetarouterplugin.py: id: bb4119e5d4dc - last_write_checksum: sha1:9a7b53ebff8cffc9c9bb0e91380c7bf450978ad5 - pristine_git_object: e1ae76a7b02d866e99ec3a58dbd8d01d786b65dd + last_write_checksum: sha1:92887f17869e070ae3940b9a7d8356598c56b05a + pristine_git_object: 65885e4d922d989d42799f52e98b7132d0eee5d4 src/openrouter/components/autorouterplugin.py: id: cf49add5d1ae - last_write_checksum: sha1:63f3397389da14c253bdda100e1984c4f5556efb - pristine_git_object: 414a9ca4bcd0783e976ca6834132d002a696d5d6 + last_write_checksum: sha1:65289971dae58e7b3acd8a7763b5ad98d87b9ea4 + pristine_git_object: 85caa0a03eb4b855a0e12f88b8b94efd5355ccf9 src/openrouter/components/badgatewayresponseerrordata.py: id: f7a33d30d269 last_write_checksum: sha1:d85ab25a06594703cb353767f07f4e1d44e0181c diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 40e1f788..37e59711 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.1.38 + version: 1.1.39 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index d53c9413..c7333049 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -2980,7 +2980,7 @@ components: id: 'auto-beta-router' properties: allowed_models: - description: 'List of model patterns to filter which models the auto-beta-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, uses the default supported models list.' + description: 'List of model patterns to filter which models the auto-beta-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, every model ranked for the classified task type is a candidate, falling back to a default model set when rankings are unavailable.' example: - 'anthropic/*' - 'openai/gpt-4o' @@ -2990,13 +2990,13 @@ components: type: 'array' cost_quality_tradeoff: deprecated: true - description: 'Deprecated: Use cost_tier instead. Balances routing between cost and quality on a 0-10 scale. The auto-beta-router ranks models for the classified task type by community spend share, then filters candidates by their average cost per generation for that task. Higher values favor cheaper models: 10 keeps only models around the cheapest 10th percentile, while 0 permits models up to the 90th percentile for cost. Defaults to 9. Numeric cost_quality_tradeoff remains supported, retains ceiling behavior, and takes precedence over cost_tier when both are provided.' + description: 'Deprecated: Use cost_tier instead. Balances routing between cost and quality on a 0-10 scale. The auto-beta-router ranks models for the classified task type by community spend share, then filters candidates by their average cost per generation for that task. Higher values favor cheaper models: 10 keeps only models around the cheapest 10th percentile, while 0 permits models up to the 90th percentile for cost. Defaults to 9 when no cost setting is provided. It remains supported and retains ceiling behavior, but cost_tier takes precedence when both are provided.' example: 9 maximum: 10 minimum: 0 type: 'integer' cost_tier: - description: 'Named cost/quality setting. For auto-beta-router, tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Numeric cost_quality_tradeoff takes precedence and retains ceiling behavior.' + description: 'Named cost/quality setting. For auto-beta-router, tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Takes precedence over the deprecated numeric cost_quality_tradeoff when both are provided.' enum: - 'low' - 'medium' @@ -3029,7 +3029,7 @@ components: allowed_models: - 'anthropic/*' - 'openai/*' - cost_tier: 'medium' + cost_tier: 'low' enabled: true excluded_models: - 'openai/gpt-4o' @@ -3037,7 +3037,7 @@ components: pin_model: false properties: allowed_models: - description: 'List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, uses the default supported models list.' + description: 'List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, every model ranked for the classified task type is a candidate, falling back to a default model set when rankings are unavailable.' example: - 'anthropic/*' - 'openai/gpt-4o' @@ -3047,20 +3047,20 @@ components: type: 'array' cost_quality_tradeoff: deprecated: true - description: 'Deprecated: Use cost_tier instead. Controls cost vs. quality routing tradeoff (0–10). 0 = pure quality (best model regardless of cost), 10 = maximize for cost (cheapest model wins). Intermediate values blend quality and cost signals continuously. Defaults to 7. Numeric cost_quality_tradeoff remains supported and takes precedence over cost_tier when both are provided.' - example: 7 + description: 'Deprecated: Use cost_tier instead. Balances routing between cost and quality on a 0-10 scale. The auto-router ranks models for the classified task type by community spend share, then filters candidates by their average cost per generation for that task. Higher values favor cheaper models: 10 keeps only models around the cheapest 10th percentile, while 0 permits models up to the 90th percentile for cost. Defaults to 9 when no cost setting is provided. It remains supported and retains ceiling behavior, but cost_tier takes precedence when both are provided.' + example: 9 maximum: 10 minimum: 0 type: 'integer' cost_tier: - description: 'Shorthand for cost_quality_tradeoff. Higher tiers spend more on better models: low = 9, medium = 7, high = 5, xhigh = 3, and max = 1. Numeric cost_quality_tradeoff takes precedence when both are provided.' + description: 'Named cost/quality setting. Tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Takes precedence over the deprecated numeric cost_quality_tradeoff when both are provided.' enum: - 'low' - 'medium' - 'high' - 'xhigh' - 'max' - example: 'medium' + example: 'low' type: 'string' x-speakeasy-unknown-values: allow enabled: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index d3298f75..756fe8db 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.787.0 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:ba591e9a42e8b6408d22788658dcdc0fd4d75c65985beed024f52e116587ef4b - sourceBlobDigest: sha256:920f108528fa073be18dea836b219bd2fcadb26e3e70f1dd7fe3701152ea7b77 + sourceRevisionDigest: sha256:6849054eae332165a01616dd2091d05f0a57a524efac24db416762aef06f8a21 + sourceBlobDigest: sha256:4d5de277c3c9e905f111de416fc5de6f4a0a5d795933f5b1d4726acd5ebdea58 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:ba591e9a42e8b6408d22788658dcdc0fd4d75c65985beed024f52e116587ef4b - sourceBlobDigest: sha256:920f108528fa073be18dea836b219bd2fcadb26e3e70f1dd7fe3701152ea7b77 + sourceRevisionDigest: sha256:6849054eae332165a01616dd2091d05f0a57a524efac24db416762aef06f8a21 + sourceBlobDigest: sha256:4d5de277c3c9e905f111de416fc5de6f4a0a5d795933f5b1d4726acd5ebdea58 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:f4ed1d1626d5bec0fec777705eb14e798019d4402eb028fb51dfebd4481411a3 + codeSamplesRevisionDigest: sha256:2366bc5b32aa50e28b3d02521973ce550603c24d4079d8ea94ac81326bfa5754 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index 1f1d5bba..d1c1b6fb 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1169,4 +1169,14 @@ Based on: ### Generated - [python v1.1.38] . ### Releases -- [PyPI v1.1.38] https://pypi.org/project/openrouter/1.1.38 - . \ No newline at end of file +- [PyPI v1.1.38] https://pypi.org/project/openrouter/1.1.38 - . + +## 2026-08-10 15:19:21 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.1.39] . +### Releases +- [PyPI v1.1.39] https://pypi.org/project/openrouter/1.1.39 - . \ No newline at end of file diff --git a/docs/components/autobetarouterplugin.mdx b/docs/components/autobetarouterplugin.mdx index 0ad5b6f4..dd8c1187 100644 --- a/docs/components/autobetarouterplugin.mdx +++ b/docs/components/autobetarouterplugin.mdx @@ -4,11 +4,11 @@ title: "AutoBetaRouterPlugin" ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `allowed_models` | List[*str*] | :heavy_minus_sign: | List of model patterns to filter which models the auto-beta-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, uses the default supported models list. | [
"anthropic/*",
"openai/gpt-4o",
"google/*"
] | -| ~~`cost_quality_tradeoff`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated: Use cost_tier instead. Balances routing between cost and quality on a 0-10 scale. The auto-beta-router ranks models for the classified task type by community spend share, then filters candidates by their average cost per generation for that task. Higher values favor cheaper models: 10 keeps only models around the cheapest 10th percentile, while 0 permits models up to the 90th percentile for cost. Defaults to 9. Numeric cost_quality_tradeoff remains supported, retains ceiling behavior, and takes precedence over cost_tier when both are provided. | 9 | -| `cost_tier` | [Optional[components.AutoBetaRouterPluginCostTier]](../components/autobetarouterplugincosttier.mdx) | :heavy_minus_sign: | Named cost/quality setting. For auto-beta-router, tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Numeric cost_quality_tradeoff takes precedence and retains ceiling behavior. | low | -| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the auto-beta-router plugin for this request. Defaults to true. | | -| `excluded_models` | List[*str*] | :heavy_minus_sign: | List of model patterns to exclude from auto-beta-router selection. Supports wildcards (e.g., "meta-llama/*" excludes all Llama models). Applied after allowed_models, so an excluded pattern always wins over an allowed one. | [
"openai/gpt-4o",
"meta-llama/*"
] | -| `id` | [components.AutoBetaRouterPluginID](../components/autobetarouterpluginid.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `allowed_models` | List[*str*] | :heavy_minus_sign: | List of model patterns to filter which models the auto-beta-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, every model ranked for the classified task type is a candidate, falling back to a default model set when rankings are unavailable. | [
"anthropic/*",
"openai/gpt-4o",
"google/*"
] | +| ~~`cost_quality_tradeoff`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated: Use cost_tier instead. Balances routing between cost and quality on a 0-10 scale. The auto-beta-router ranks models for the classified task type by community spend share, then filters candidates by their average cost per generation for that task. Higher values favor cheaper models: 10 keeps only models around the cheapest 10th percentile, while 0 permits models up to the 90th percentile for cost. Defaults to 9 when no cost setting is provided. It remains supported and retains ceiling behavior, but cost_tier takes precedence when both are provided. | 9 | +| `cost_tier` | [Optional[components.AutoBetaRouterPluginCostTier]](../components/autobetarouterplugincosttier.mdx) | :heavy_minus_sign: | Named cost/quality setting. For auto-beta-router, tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Takes precedence over the deprecated numeric cost_quality_tradeoff when both are provided. | low | +| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the auto-beta-router plugin for this request. Defaults to true. | | +| `excluded_models` | List[*str*] | :heavy_minus_sign: | List of model patterns to exclude from auto-beta-router selection. Supports wildcards (e.g., "meta-llama/*" excludes all Llama models). Applied after allowed_models, so an excluded pattern always wins over an allowed one. | [
"openai/gpt-4o",
"meta-llama/*"
] | +| `id` | [components.AutoBetaRouterPluginID](../components/autobetarouterpluginid.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/autobetarouterplugincosttier.mdx b/docs/components/autobetarouterplugincosttier.mdx index b2e31928..201351d7 100644 --- a/docs/components/autobetarouterplugincosttier.mdx +++ b/docs/components/autobetarouterplugincosttier.mdx @@ -2,7 +2,7 @@ title: "AutoBetaRouterPluginCostTier" --- -Named cost/quality setting. For auto-beta-router, tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Numeric cost_quality_tradeoff takes precedence and retains ceiling behavior. +Named cost/quality setting. For auto-beta-router, tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Takes precedence over the deprecated numeric cost_quality_tradeoff when both are provided. ## Example Usage diff --git a/docs/components/autorouterplugin.mdx b/docs/components/autorouterplugin.mdx index 5e2e372c..f128f4a8 100644 --- a/docs/components/autorouterplugin.mdx +++ b/docs/components/autorouterplugin.mdx @@ -4,12 +4,12 @@ title: "AutoRouterPlugin" ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `allowed_models` | List[*str*] | :heavy_minus_sign: | List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, uses the default supported models list. | [
"anthropic/*",
"openai/gpt-4o",
"google/*"
] | -| ~~`cost_quality_tradeoff`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated: Use cost_tier instead. Controls cost vs. quality routing tradeoff (0–10). 0 = pure quality (best model regardless of cost), 10 = maximize for cost (cheapest model wins). Intermediate values blend quality and cost signals continuously. Defaults to 7. Numeric cost_quality_tradeoff remains supported and takes precedence over cost_tier when both are provided. | 7 | -| `cost_tier` | [Optional[components.AutoRouterPluginCostTier]](../components/autorouterplugincosttier.mdx) | :heavy_minus_sign: | Shorthand for cost_quality_tradeoff. Higher tiers spend more on better models: low = 9, medium = 7, high = 5, xhigh = 3, and max = 1. Numeric cost_quality_tradeoff takes precedence when both are provided. | medium | -| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the auto-router plugin for this request. Defaults to true. | | -| `excluded_models` | List[*str*] | :heavy_minus_sign: | List of model patterns to exclude from auto-router selection. Supports wildcards (e.g., "meta-llama/*" excludes all Llama models). Applied after allowed_models, so an excluded pattern always wins over an allowed one. | [
"openai/gpt-4o",
"meta-llama/*"
] | -| `id` | [components.AutoRouterPluginID](../components/autorouterpluginid.mdx) | :heavy_check_mark: | N/A | | -| `pin_model` | *Optional[bool]* | :heavy_minus_sign: | When true, reuses the model from the most recent assistant message's `model` attribute for subsequent turns. Defaults to false. | false | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `allowed_models` | List[*str*] | :heavy_minus_sign: | List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, every model ranked for the classified task type is a candidate, falling back to a default model set when rankings are unavailable. | [
"anthropic/*",
"openai/gpt-4o",
"google/*"
] | +| ~~`cost_quality_tradeoff`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated: Use cost_tier instead. Balances routing between cost and quality on a 0-10 scale. The auto-router ranks models for the classified task type by community spend share, then filters candidates by their average cost per generation for that task. Higher values favor cheaper models: 10 keeps only models around the cheapest 10th percentile, while 0 permits models up to the 90th percentile for cost. Defaults to 9 when no cost setting is provided. It remains supported and retains ceiling behavior, but cost_tier takes precedence when both are provided. | 9 | +| `cost_tier` | [Optional[components.AutoRouterPluginCostTier]](../components/autorouterplugincosttier.mdx) | :heavy_minus_sign: | Named cost/quality setting. Tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Takes precedence over the deprecated numeric cost_quality_tradeoff when both are provided. | low | +| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the auto-router plugin for this request. Defaults to true. | | +| `excluded_models` | List[*str*] | :heavy_minus_sign: | List of model patterns to exclude from auto-router selection. Supports wildcards (e.g., "meta-llama/*" excludes all Llama models). Applied after allowed_models, so an excluded pattern always wins over an allowed one. | [
"openai/gpt-4o",
"meta-llama/*"
] | +| `id` | [components.AutoRouterPluginID](../components/autorouterpluginid.mdx) | :heavy_check_mark: | N/A | | +| `pin_model` | *Optional[bool]* | :heavy_minus_sign: | When true, reuses the model from the most recent assistant message's `model` attribute for subsequent turns. Defaults to false. | false | \ No newline at end of file diff --git a/docs/components/autorouterplugincosttier.mdx b/docs/components/autorouterplugincosttier.mdx index 77c913f9..b06654b8 100644 --- a/docs/components/autorouterplugincosttier.mdx +++ b/docs/components/autorouterplugincosttier.mdx @@ -2,7 +2,7 @@ title: "AutoRouterPluginCostTier" --- -Shorthand for cost_quality_tradeoff. Higher tiers spend more on better models: low = 9, medium = 7, high = 5, xhigh = 3, and max = 1. Numeric cost_quality_tradeoff takes precedence when both are provided. +Named cost/quality setting. Tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Takes precedence over the deprecated numeric cost_quality_tradeoff when both are provided. ## Example Usage diff --git a/pyproject.toml b/pyproject.toml index 7bcca3ad..ce5d9656 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.1.38" +version = "1.1.39" description = "Official Python Client SDK for OpenRouter." authors = [{ name = "OpenRouter" },] readme = "README-PYPI.md" diff --git a/src/openrouter/_version.py b/src/openrouter/_version.py index 590bde78..682398c0 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "1.1.38" +__version__: str = "1.1.39" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.1.38 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.1.39 2.914.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/components/autobetarouterplugin.py b/src/openrouter/components/autobetarouterplugin.py index e1ae76a7..65885e4d 100644 --- a/src/openrouter/components/autobetarouterplugin.py +++ b/src/openrouter/components/autobetarouterplugin.py @@ -18,7 +18,7 @@ ], UnrecognizedStr, ] -r"""Named cost/quality setting. For auto-beta-router, tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Numeric cost_quality_tradeoff takes precedence and retains ceiling behavior.""" +r"""Named cost/quality setting. For auto-beta-router, tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Takes precedence over the deprecated numeric cost_quality_tradeoff when both are provided.""" AutoBetaRouterPluginID = Literal["auto-beta-router",] @@ -27,11 +27,11 @@ class AutoBetaRouterPluginTypedDict(TypedDict): id: AutoBetaRouterPluginID allowed_models: NotRequired[List[str]] - r"""List of model patterns to filter which models the auto-beta-router can route between. Supports wildcards (e.g., \"anthropic/*\" matches all Anthropic models). When not specified, uses the default supported models list.""" + r"""List of model patterns to filter which models the auto-beta-router can route between. Supports wildcards (e.g., \"anthropic/*\" matches all Anthropic models). When not specified, every model ranked for the classified task type is a candidate, falling back to a default model set when rankings are unavailable.""" cost_quality_tradeoff: NotRequired[int] - r"""Deprecated: Use cost_tier instead. Balances routing between cost and quality on a 0-10 scale. The auto-beta-router ranks models for the classified task type by community spend share, then filters candidates by their average cost per generation for that task. Higher values favor cheaper models: 10 keeps only models around the cheapest 10th percentile, while 0 permits models up to the 90th percentile for cost. Defaults to 9. Numeric cost_quality_tradeoff remains supported, retains ceiling behavior, and takes precedence over cost_tier when both are provided.""" + r"""Deprecated: Use cost_tier instead. Balances routing between cost and quality on a 0-10 scale. The auto-beta-router ranks models for the classified task type by community spend share, then filters candidates by their average cost per generation for that task. Higher values favor cheaper models: 10 keeps only models around the cheapest 10th percentile, while 0 permits models up to the 90th percentile for cost. Defaults to 9 when no cost setting is provided. It remains supported and retains ceiling behavior, but cost_tier takes precedence when both are provided.""" cost_tier: NotRequired[AutoBetaRouterPluginCostTier] - r"""Named cost/quality setting. For auto-beta-router, tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Numeric cost_quality_tradeoff takes precedence and retains ceiling behavior.""" + r"""Named cost/quality setting. For auto-beta-router, tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Takes precedence over the deprecated numeric cost_quality_tradeoff when both are provided.""" enabled: NotRequired[bool] r"""Set to false to disable the auto-beta-router plugin for this request. Defaults to true.""" excluded_models: NotRequired[List[str]] @@ -42,7 +42,7 @@ class AutoBetaRouterPlugin(BaseModel): id: AutoBetaRouterPluginID allowed_models: Optional[List[str]] = None - r"""List of model patterns to filter which models the auto-beta-router can route between. Supports wildcards (e.g., \"anthropic/*\" matches all Anthropic models). When not specified, uses the default supported models list.""" + r"""List of model patterns to filter which models the auto-beta-router can route between. Supports wildcards (e.g., \"anthropic/*\" matches all Anthropic models). When not specified, every model ranked for the classified task type is a candidate, falling back to a default model set when rankings are unavailable.""" cost_quality_tradeoff: Annotated[ Optional[int], @@ -50,10 +50,10 @@ class AutoBetaRouterPlugin(BaseModel): deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." ), ] = None - r"""Deprecated: Use cost_tier instead. Balances routing between cost and quality on a 0-10 scale. The auto-beta-router ranks models for the classified task type by community spend share, then filters candidates by their average cost per generation for that task. Higher values favor cheaper models: 10 keeps only models around the cheapest 10th percentile, while 0 permits models up to the 90th percentile for cost. Defaults to 9. Numeric cost_quality_tradeoff remains supported, retains ceiling behavior, and takes precedence over cost_tier when both are provided.""" + r"""Deprecated: Use cost_tier instead. Balances routing between cost and quality on a 0-10 scale. The auto-beta-router ranks models for the classified task type by community spend share, then filters candidates by their average cost per generation for that task. Higher values favor cheaper models: 10 keeps only models around the cheapest 10th percentile, while 0 permits models up to the 90th percentile for cost. Defaults to 9 when no cost setting is provided. It remains supported and retains ceiling behavior, but cost_tier takes precedence when both are provided.""" cost_tier: Optional[AutoBetaRouterPluginCostTier] = None - r"""Named cost/quality setting. For auto-beta-router, tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Numeric cost_quality_tradeoff takes precedence and retains ceiling behavior.""" + r"""Named cost/quality setting. For auto-beta-router, tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Takes precedence over the deprecated numeric cost_quality_tradeoff when both are provided.""" enabled: Optional[bool] = None r"""Set to false to disable the auto-beta-router plugin for this request. Defaults to true.""" diff --git a/src/openrouter/components/autorouterplugin.py b/src/openrouter/components/autorouterplugin.py index 414a9ca4..85caa0a0 100644 --- a/src/openrouter/components/autorouterplugin.py +++ b/src/openrouter/components/autorouterplugin.py @@ -18,7 +18,7 @@ ], UnrecognizedStr, ] -r"""Shorthand for cost_quality_tradeoff. Higher tiers spend more on better models: low = 9, medium = 7, high = 5, xhigh = 3, and max = 1. Numeric cost_quality_tradeoff takes precedence when both are provided.""" +r"""Named cost/quality setting. Tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Takes precedence over the deprecated numeric cost_quality_tradeoff when both are provided.""" AutoRouterPluginID = Literal["auto-router",] @@ -27,11 +27,11 @@ class AutoRouterPluginTypedDict(TypedDict): id: AutoRouterPluginID allowed_models: NotRequired[List[str]] - r"""List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., \"anthropic/*\" matches all Anthropic models). When not specified, uses the default supported models list.""" + r"""List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., \"anthropic/*\" matches all Anthropic models). When not specified, every model ranked for the classified task type is a candidate, falling back to a default model set when rankings are unavailable.""" cost_quality_tradeoff: NotRequired[int] - r"""Deprecated: Use cost_tier instead. Controls cost vs. quality routing tradeoff (0–10). 0 = pure quality (best model regardless of cost), 10 = maximize for cost (cheapest model wins). Intermediate values blend quality and cost signals continuously. Defaults to 7. Numeric cost_quality_tradeoff remains supported and takes precedence over cost_tier when both are provided.""" + r"""Deprecated: Use cost_tier instead. Balances routing between cost and quality on a 0-10 scale. The auto-router ranks models for the classified task type by community spend share, then filters candidates by their average cost per generation for that task. Higher values favor cheaper models: 10 keeps only models around the cheapest 10th percentile, while 0 permits models up to the 90th percentile for cost. Defaults to 9 when no cost setting is provided. It remains supported and retains ceiling behavior, but cost_tier takes precedence when both are provided.""" cost_tier: NotRequired[AutoRouterPluginCostTier] - r"""Shorthand for cost_quality_tradeoff. Higher tiers spend more on better models: low = 9, medium = 7, high = 5, xhigh = 3, and max = 1. Numeric cost_quality_tradeoff takes precedence when both are provided.""" + r"""Named cost/quality setting. Tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Takes precedence over the deprecated numeric cost_quality_tradeoff when both are provided.""" enabled: NotRequired[bool] r"""Set to false to disable the auto-router plugin for this request. Defaults to true.""" excluded_models: NotRequired[List[str]] @@ -44,7 +44,7 @@ class AutoRouterPlugin(BaseModel): id: AutoRouterPluginID allowed_models: Optional[List[str]] = None - r"""List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., \"anthropic/*\" matches all Anthropic models). When not specified, uses the default supported models list.""" + r"""List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., \"anthropic/*\" matches all Anthropic models). When not specified, every model ranked for the classified task type is a candidate, falling back to a default model set when rankings are unavailable.""" cost_quality_tradeoff: Annotated[ Optional[int], @@ -52,10 +52,10 @@ class AutoRouterPlugin(BaseModel): deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." ), ] = None - r"""Deprecated: Use cost_tier instead. Controls cost vs. quality routing tradeoff (0–10). 0 = pure quality (best model regardless of cost), 10 = maximize for cost (cheapest model wins). Intermediate values blend quality and cost signals continuously. Defaults to 7. Numeric cost_quality_tradeoff remains supported and takes precedence over cost_tier when both are provided.""" + r"""Deprecated: Use cost_tier instead. Balances routing between cost and quality on a 0-10 scale. The auto-router ranks models for the classified task type by community spend share, then filters candidates by their average cost per generation for that task. Higher values favor cheaper models: 10 keeps only models around the cheapest 10th percentile, while 0 permits models up to the 90th percentile for cost. Defaults to 9 when no cost setting is provided. It remains supported and retains ceiling behavior, but cost_tier takes precedence when both are provided.""" cost_tier: Optional[AutoRouterPluginCostTier] = None - r"""Shorthand for cost_quality_tradeoff. Higher tiers spend more on better models: low = 9, medium = 7, high = 5, xhigh = 3, and max = 1. Numeric cost_quality_tradeoff takes precedence when both are provided.""" + r"""Named cost/quality setting. Tiers select cost-percentile bands: low = [0, 20), medium = [20, 40), high = [40, 60), xhigh = [60, 80), and max = [80, 100]. Takes precedence over the deprecated numeric cost_quality_tradeoff when both are provided.""" enabled: Optional[bool] = None r"""Set to false to disable the auto-router plugin for this request. Defaults to true.""" diff --git a/uv.lock b/uv.lock index c7dec4e8..1eb62572 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.1.38" +version = "1.1.39" source = { editable = "." } dependencies = [ { name = "httpcore" }, From a4f2de32c03e5bb18d8ff5fde7bbca66a5b897bc Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Mon, 10 Aug 2026 15:21:35 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow