diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 77da33bc..cddb72ef 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: 157312c7b959a008c5b97a61e81d7b20 + docChecksum: 4b995c3ae9d0d0264f71a9ed6e1dbe4e docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.3.4 - configChecksum: 6d3458d3bc1f63c5197abbbfacd0f546 + releaseVersion: 1.3.5 + configChecksum: b2ad70554941d940596d8806b84a3e06 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: be106d32-4d4e-479e-ad07-e4aa0101c6fe - pristine_commit_hash: 587fb5041b57f27cf7d4ea2a19dcbdcadc2cc1c6 - pristine_tree_hash: 37f7a2488d3b606ef14892f02dad55c0152eef43 + generation_id: 5ca86c1a-0e74-4c00-9ef7-8a296de5d7a6 + pristine_commit_hash: 9f828376ba0a862a7bb45adfddb62e8e6cb82154 + pristine_tree_hash: d044ff5478833490d5ee26ead314cea5763041ef features: python: acceptHeaders: 3.0.0 @@ -3956,8 +3956,8 @@ trackedFiles: pristine_git_object: 74c61e5f750e2df770862017b6b406065398ca9e docs/components/jevrouterplugin.mdx: id: 258aa7058bc5 - last_write_checksum: sha1:772786a50c96e16cfef4665a03f707e67ff26e7c - pristine_git_object: 332536f6765995a19ef9bc591a127eb8c1382049 + last_write_checksum: sha1:45f1965d11b2f7bf53d372bbb484a0c9593aaf5f + pristine_git_object: d28aba8cbf9d4b8ec5d5fa09e14af97217b3b443 docs/components/jevrouterpluginid.mdx: id: 30d920f53cde last_write_checksum: sha1:dfc1a3a7d9011c2a15b475b51eaf48ad78856ff3 @@ -9464,8 +9464,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:c2a0293505cf4856714ceb9dda1b3c8f44bd0e4d - pristine_git_object: dd8635e88fdd50fd837dc3eeb6a1712e871ccf98 + last_write_checksum: sha1:c605659c8eb3c334251d12b44a34c888d1b440ff + pristine_git_object: df47bedc608b76a01be2c40c8d4c1c00b4052ac8 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -9492,8 +9492,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:0560b44e32f6b1672056251e8ff85512d7d09594 - pristine_git_object: 85647b680d04b750ec7ad5ba355d2db5731c5a92 + last_write_checksum: sha1:bcd746841358a883683aaee5218212a4a643f4e0 + pristine_git_object: f99b6685971cc9b713494bc45236782fbef88d9c src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:30f55a360f41376ab194b9ea725fe4e001a5ae1a @@ -11232,8 +11232,8 @@ trackedFiles: pristine_git_object: b5a0bc16faa52f26d293eea18183e4d0b0bbb901 src/openrouter/components/jevrouterplugin.py: id: fcb6e65e2e08 - last_write_checksum: sha1:b616dfe462102792dd944877e043ba99e498bb3f - pristine_git_object: 6d55aa0ebee46e71aead739ad1a65f337d387c0c + last_write_checksum: sha1:95a6e53a9a1a6a9b46591c2e247ae3972e76d920 + pristine_git_object: 1ec82feebee87c8dfb05890b74de47d817ab847d src/openrouter/components/keyassignment.py: id: 07a64362e7fd last_write_checksum: sha1:4b47a6f1ab4992ec81d7236ca28dbf94d3a4fbaf @@ -17378,4 +17378,4 @@ examples: "504": application/json: {"error": {"code": 504, "message": "Vault request timed out"}} examplesVersion: 1.0.2 -releaseNotes: "## Python SDK Changes:\n* `open_router.chat.send()`: \n * `request.plugins[].union(jev-router)` **Added**\n* `open_router.presets.create_presets_chat_completions()`: \n * `request.plugins[].union(jev-router)` **Added**\n* `open_router.presets.create_presets_messages()`: \n * `request.plugins[].union(jev-router)` **Added**\n* `open_router.presets.create_presets_responses()`: \n * `request.plugins[].union(jev-router)` **Added**\n* `open_router.responses.send()`: \n * `request.plugins[].union(jev-router)` **Added**\n* `open_router.beta.responses.send()`: \n * `request.plugins[].union(jev-router)` **Added**\n" +releaseNotes: "## Python SDK Changes:\n* `open_router.chat.send()`: \n * `request.plugins[].union(jev-router).allowed_models` **Added**\n* `open_router.presets.create_presets_chat_completions()`: \n * `request.plugins[].union(jev-router).allowed_models` **Added**\n* `open_router.presets.create_presets_messages()`: \n * `request.plugins[].union(jev-router).allowed_models` **Added**\n* `open_router.presets.create_presets_responses()`: \n * `request.plugins[].union(jev-router).allowed_models` **Added**\n* `open_router.responses.send()`: \n * `request.plugins[].union(jev-router).allowed_models` **Added**\n* `open_router.beta.responses.send()`: \n * `request.plugins[].union(jev-router).allowed_models` **Added**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index a959c6b8..5e0f4887 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.4 + version: 1.3.5 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 885e5575..9ab41f00 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -14972,6 +14972,7 @@ components: - 'id' type: 'object' JevRouterPlugin: + additionalProperties: false example: excluded_models: - 'openai/gpt-6-astra' @@ -14980,8 +14981,17 @@ components: - 'anthropic/*' - 'openai/gpt-5.6-sol' properties: + allowed_models: + description: 'Alias of `models`, matching the auto-router field name. Entries from both fields are combined.' + example: + - 'anthropic/*' + items: + maxLength: 1024 + type: 'string' + maxItems: 1024 + type: 'array' excluded_models: - description: 'Remove these models from the router. Each entry is a model slug or a wildcard pattern (e.g. "xiaomi/*"). Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. Applied after `models`, so an excluded pattern always wins over an included one; excluding every pool model fails the request with 404 rather than routing to an excluded model.' + description: 'Remove these models from the router. Each entry is a model slug or a wildcard pattern (e.g. "xiaomi/*"). A `~author/family-latest` alias matches every revision of that family. Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. Applied after `models`, so an excluded pattern always wins over an included one; when the lists leave no model the request can use, it fails with 404 rather than routing outside them.' example: - 'openai/gpt-6-astra' - 'xiaomi/*' @@ -14995,7 +15005,7 @@ components: - 'jev-router' type: 'string' models: - description: 'Restrict the router to these models. Each entry is a model slug or a wildcard pattern (e.g. "anthropic/*"), matched against the current pool; models outside the pool are ignored. Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. When omitted or empty, every model in the pool is a candidate; when no pool model matches, the list is ignored and the whole pool is used (`excluded_models` still apply).' + description: 'Restrict the router to these models. Each entry is a model slug or a wildcard pattern (e.g. "anthropic/*"), matched against the current pool; models outside the pool are ignored. A `~author/family-latest` alias matches every revision of that family. Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. When omitted or empty, every model in the pool is a candidate; when no pool model matches, the list is ignored and the whole pool is used (`excluded_models` still apply). `allowed_models` is an alias; entries from both fields are combined.' example: - 'anthropic/*' - 'openai/gpt-5.6-sol' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 0981c667..659d618d 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:50fc549ec7810f15e96bc3caab0f272eac648edbdc5cf7b51a3785351fd5f21c - sourceBlobDigest: sha256:73f2116de241dc0914b0888e75b324cb7a0ce6e9188e7ad4a9d575cb0dc6bdfd + sourceRevisionDigest: sha256:a3666c04ea7f6d0bd1851a3961f51c8fef2cee3f8c6b1ded741777d1f2ebc088 + sourceBlobDigest: sha256:007c9b444c48e255ebb0cf0711d3c99659dee78aef07ec978d938635c05bd1cf tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:50fc549ec7810f15e96bc3caab0f272eac648edbdc5cf7b51a3785351fd5f21c - sourceBlobDigest: sha256:73f2116de241dc0914b0888e75b324cb7a0ce6e9188e7ad4a9d575cb0dc6bdfd + sourceRevisionDigest: sha256:a3666c04ea7f6d0bd1851a3961f51c8fef2cee3f8c6b1ded741777d1f2ebc088 + sourceBlobDigest: sha256:007c9b444c48e255ebb0cf0711d3c99659dee78aef07ec978d938635c05bd1cf codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:b989967bb870baa59b9c1fe69e3c7d0155f4743e4b47cee3d0343c4526182669 + codeSamplesRevisionDigest: sha256:2f4bce7e2782ef7bc1a43785675f95b624c865c6c6cbc4989ea78802b2371e83 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index 8e0f677c..bd7411e4 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -2809,4 +2809,14 @@ Based on: ### Generated - [python v1.3.4] . ### Releases -- [PyPI v1.3.4] https://pypi.org/project/openrouter/1.3.4 - . \ No newline at end of file +- [PyPI v1.3.4] https://pypi.org/project/openrouter/1.3.4 - . + +## 2026-09-29 17:19:42 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.5] . +### Releases +- [PyPI v1.3.5] https://pypi.org/project/openrouter/1.3.5 - . \ No newline at end of file diff --git a/docs/components/jevrouterplugin.mdx b/docs/components/jevrouterplugin.mdx index 332536f6..d28aba8c 100644 --- a/docs/components/jevrouterplugin.mdx +++ b/docs/components/jevrouterplugin.mdx @@ -4,8 +4,9 @@ title: "JevRouterPlugin" ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `excluded_models` | List[*str*] | :heavy_minus_sign: | Remove these models from the router. Each entry is a model slug or a wildcard pattern (e.g. "xiaomi/*"). Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. Applied after `models`, so an excluded pattern always wins over an included one; excluding every pool model fails the request with 404 rather than routing to an excluded model. | [
"openai/gpt-6-astra",
"xiaomi/*"
] | -| `id` | [components.JevRouterPluginID](../components/jevrouterpluginid.mdx) | :heavy_check_mark: | N/A | | -| `models` | List[*str*] | :heavy_minus_sign: | Restrict the router to these models. Each entry is a model slug or a wildcard pattern (e.g. "anthropic/*"), matched against the current pool; models outside the pool are ignored. Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. When omitted or empty, every model in the pool is a candidate; when no pool model matches, the list is ignored and the whole pool is used (`excluded_models` still apply). | [
"anthropic/*",
"openai/gpt-5.6-sol"
] | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `allowed_models` | List[*str*] | :heavy_minus_sign: | Alias of `models`, matching the auto-router field name. Entries from both fields are combined. | [
"anthropic/*"
] | +| `excluded_models` | List[*str*] | :heavy_minus_sign: | Remove these models from the router. Each entry is a model slug or a wildcard pattern (e.g. "xiaomi/*"). A `~author/family-latest` alias matches every revision of that family. Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. Applied after `models`, so an excluded pattern always wins over an included one; when the lists leave no model the request can use, it fails with 404 rather than routing outside them. | [
"openai/gpt-6-astra",
"xiaomi/*"
] | +| `id` | [components.JevRouterPluginID](../components/jevrouterpluginid.mdx) | :heavy_check_mark: | N/A | | +| `models` | List[*str*] | :heavy_minus_sign: | Restrict the router to these models. Each entry is a model slug or a wildcard pattern (e.g. "anthropic/*"), matched against the current pool; models outside the pool are ignored. A `~author/family-latest` alias matches every revision of that family. Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. When omitted or empty, every model in the pool is a candidate; when no pool model matches, the list is ignored and the whole pool is used (`excluded_models` still apply). `allowed_models` is an alias; entries from both fields are combined. | [
"anthropic/*",
"openai/gpt-5.6-sol"
] | \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index dd8635e8..df47bedc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.4" +version = "1.3.5" 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 85647b68..f99b6685 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "1.3.4" +__version__: str = "1.3.5" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.3.4 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.5 2.914.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/components/jevrouterplugin.py b/src/openrouter/components/jevrouterplugin.py index 6d55aa0e..1ec82fee 100644 --- a/src/openrouter/components/jevrouterplugin.py +++ b/src/openrouter/components/jevrouterplugin.py @@ -12,24 +12,29 @@ class JevRouterPluginTypedDict(TypedDict): id: JevRouterPluginID + allowed_models: NotRequired[List[str]] + r"""Alias of `models`, matching the auto-router field name. Entries from both fields are combined.""" excluded_models: NotRequired[List[str]] - r"""Remove these models from the router. Each entry is a model slug or a wildcard pattern (e.g. \"xiaomi/*\"). Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. Applied after `models`, so an excluded pattern always wins over an included one; excluding every pool model fails the request with 404 rather than routing to an excluded model.""" + r"""Remove these models from the router. Each entry is a model slug or a wildcard pattern (e.g. \"xiaomi/*\"). A `~author/family-latest` alias matches every revision of that family. Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. Applied after `models`, so an excluded pattern always wins over an included one; when the lists leave no model the request can use, it fails with 404 rather than routing outside them.""" models: NotRequired[List[str]] - r"""Restrict the router to these models. Each entry is a model slug or a wildcard pattern (e.g. \"anthropic/*\"), matched against the current pool; models outside the pool are ignored. Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. When omitted or empty, every model in the pool is a candidate; when no pool model matches, the list is ignored and the whole pool is used (`excluded_models` still apply).""" + r"""Restrict the router to these models. Each entry is a model slug or a wildcard pattern (e.g. \"anthropic/*\"), matched against the current pool; models outside the pool are ignored. A `~author/family-latest` alias matches every revision of that family. Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. When omitted or empty, every model in the pool is a candidate; when no pool model matches, the list is ignored and the whole pool is used (`excluded_models` still apply). `allowed_models` is an alias; entries from both fields are combined.""" class JevRouterPlugin(BaseModel): id: JevRouterPluginID + allowed_models: Optional[List[str]] = None + r"""Alias of `models`, matching the auto-router field name. Entries from both fields are combined.""" + excluded_models: Optional[List[str]] = None - r"""Remove these models from the router. Each entry is a model slug or a wildcard pattern (e.g. \"xiaomi/*\"). Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. Applied after `models`, so an excluded pattern always wins over an included one; excluding every pool model fails the request with 404 rather than routing to an excluded model.""" + r"""Remove these models from the router. Each entry is a model slug or a wildcard pattern (e.g. \"xiaomi/*\"). A `~author/family-latest` alias matches every revision of that family. Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. Applied after `models`, so an excluded pattern always wins over an included one; when the lists leave no model the request can use, it fails with 404 rather than routing outside them.""" models: Optional[List[str]] = None - r"""Restrict the router to these models. Each entry is a model slug or a wildcard pattern (e.g. \"anthropic/*\"), matched against the current pool; models outside the pool are ignored. Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. When omitted or empty, every model in the pool is a candidate; when no pool model matches, the list is ignored and the whole pool is used (`excluded_models` still apply).""" + r"""Restrict the router to these models. Each entry is a model slug or a wildcard pattern (e.g. \"anthropic/*\"), matched against the current pool; models outside the pool are ignored. A `~author/family-latest` alias matches every revision of that family. Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. When omitted or empty, every model in the pool is a candidate; when no pool model matches, the list is ignored and the whole pool is used (`excluded_models` still apply). `allowed_models` is an alias; entries from both fields are combined.""" @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["excluded_models", "models"]) + optional_fields = set(["allowed_models", "excluded_models", "models"]) serialized = handler(self) m = {} diff --git a/uv.lock b/uv.lock index 1019d15a..439e359a 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.4" +version = "1.3.5" source = { editable = "." } dependencies = [ { name = "httpcore" },