diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 1b17979c..2acf41ce 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: a2e5a2be1d22dd040c38a200a2963429 + docChecksum: 3810bb959aba463025335b25d590ba30 docVersion: 1.0.0 speakeasyVersion: 1.803.2 generationVersion: 2.950.13 - releaseVersion: 1.3.99 - configChecksum: 9ed0222f7a3d88e1351cf0e350a79906 + releaseVersion: 1.3.100 + configChecksum: 57f22e4b4f4a78469b00dc2ee6f5f47d repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 3157cf67-1160-4d58-b202-cb61f7faee05 - pristine_commit_hash: 0abe812ac3818a2756704695ed1666d518f96f86 - pristine_tree_hash: cff55510f05b2013f7d6f82edcf4019bbeb6bf09 + generation_id: 63b97cf4-7a29-4adc-899c-cf4272e2127e + pristine_commit_hash: f7b36f02f2c6eba97fc0b2e0af03c236a2e528b0 + pristine_tree_hash: 32a63e85f6ae10fcd36471b8bf27173d026185b0 features: python: acceptHeaders: 3.0.0 @@ -8878,6 +8878,10 @@ trackedFiles: id: bf2b4d539ad0 last_write_checksum: sha1:e85f7cb32b6cf92a993f1fb472f71bf5593a0aee pristine_git_object: 91ffad70186d34bf8103f1988bdbdd258e1cfbfb + docs/operations/client.mdx: + id: 915aebbe62cb + last_write_checksum: sha1:107eddce0e7ba4fff1b8a6f6c2f883ceba729e06 + pristine_git_object: b02404ab4ec68c12902657c9b800502ce9080669 docs/operations/content.mdx: id: 6f64feb2d798 last_write_checksum: sha1:329d9719c9e25478666963df7b79710aa626d988 @@ -10028,8 +10032,8 @@ trackedFiles: pristine_git_object: b6ff4ac617c15b9ce560d8f7be1f2813ac73b696 docs/operations/listmodelsuserrequest.mdx: id: 01537864056e - last_write_checksum: sha1:3146f4b0c24817d751f37a2311e6d8f5a58af264 - pristine_git_object: 726529934461d810f02545bbbd274e1e2db562de + last_write_checksum: sha1:896fe646a05a136a8ad8df99f22d81ad4aaffa3c + pristine_git_object: 950838658eb536e8845c06819580ff6c24d1d47a docs/operations/listmodelsuserresponse.mdx: id: 34f7a1648ceb last_write_checksum: sha1:2ba3da93b8dd5a76d5f1acf0a080bc45ced552b6 @@ -10656,8 +10660,8 @@ trackedFiles: pristine_git_object: fa46dc09c893aadcb2c56921b973a019603010e1 docs/sdks/models/README.mdx: id: 58f1ca464e0b - last_write_checksum: sha1:38f37d2391b43875af1434037061826f9f00d10c - pristine_git_object: 88a7166c4a3faa1c083fe1fb7d8ccb312f62d892 + last_write_checksum: sha1:1f2d511b36a2e070a4279bf1d0dc824611709b23 + pristine_git_object: 790d5a2786e11410827317ea1a55bf48d34571f3 docs/sdks/oauth/README.mdx: id: 42b5079343d2 last_write_checksum: sha1:4a2d77d0749b9430de95a6a1d323367cf5c27151 @@ -10732,8 +10736,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:12f5b363fe1bde3db1bc563b34aeaf4f0d6a34c0 - pristine_git_object: de523996c7b050a198a351f1cf322a39ee5b3842 + last_write_checksum: sha1:2f924759fc5fd5193d32c0915b8c2a6ff69819db + pristine_git_object: 47295f170deb1dc65c2f3b1930b9196b59d85790 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -10760,8 +10764,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:8c472349c53e12f03c9174198791e9018ce703c4 - pristine_git_object: dadc3297e0de0c290f14b3635f2290b54959af37 + last_write_checksum: sha1:492ecd3ae0fae43fd53c40b02b82bca5b734d025 + pristine_git_object: 7b6327c667d32c6b7b3e3917351f15475aa0ddb4 src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:80cc0f39649445431cc2247ed0e0765438467766 @@ -14488,8 +14492,8 @@ trackedFiles: pristine_git_object: 5b741456655ff48919d17ffd552a6410f0587966 src/openrouter/models_.py: id: 4e1ae1fe5b98 - last_write_checksum: sha1:988ec8ceacdd596451165a662a9f9c15d32b08e5 - pristine_git_object: 0e5a416145a4ad17419518975c284d2ba7f74bc3 + last_write_checksum: sha1:c90581a6d3d68eb2769c9de0d9725a01342fff14 + pristine_git_object: f983b7ea893ccfee590e6b2055d0e5b43dd09f08 src/openrouter/oauth.py: id: 1948ce27255b last_write_checksum: sha1:d6470de6325431db64b08ff4468fb2d8ea781c6f @@ -14500,8 +14504,8 @@ trackedFiles: pristine_git_object: 4a35ede011d09dddab042e2c00413ce4f6be655e src/openrouter/operations/__init__.py: id: 9afcea1e7161 - last_write_checksum: sha1:4e959ebb759123c93e000899931b130d2bc42ad8 - pristine_git_object: b84b6753e694b04ce63fce0e34c7c3cfa5f12658 + last_write_checksum: sha1:65c7067945cdfa8d1d786cb025055b719bc53611 + pristine_git_object: cd182637308e7104b2eac4488000b9bc8eabceab src/openrouter/operations/activateprivateendpoint.py: id: 3b39eec5d66f last_write_checksum: sha1:9406e6b3d38c82895fd795f637702ef579cc6d36 @@ -14928,8 +14932,8 @@ trackedFiles: pristine_git_object: cdde733b97c9b409d550fd58f9d49184d1647f4d src/openrouter/operations/listmodelsuser.py: id: 16eb5946cf60 - last_write_checksum: sha1:1f455b856b8c143fd5e96893bdd2f72aacf98da2 - pristine_git_object: 0d87be124c12ceb8cd1f93b7eeca51e9d404a8b9 + last_write_checksum: sha1:b5eafbaa22689a89bc7d91e55abb46b5122cded1 + pristine_git_object: a934e44d774549b3d4b8cbdba9bebd07d252a9dc src/openrouter/operations/listoauthjwks.py: id: 329ac9d6fa76 last_write_checksum: sha1:8d6b08b6637a0ff49f88313a9f1bed03349655f1 @@ -19780,3 +19784,6 @@ examples: "529": application/json: {"error": {"code": 529, "message": "Provider returned error"}} examplesVersion: 1.0.2 +releaseNotes: | + ## Python SDK Changes: + * `open_router.models.list_for_user()`: `request.client` **Added** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index a0de8196..0759e6ef 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.99 + version: 1.3.100 additionalDependencies: dev: pytest: '>=8.3' diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index f98c237a..2f571be2 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -47126,6 +47126,19 @@ paths: example: 'newest' type: 'string' x-speakeasy-unknown-values: allow + - description: 'Filter models and presets by the named harness''s eligibility policy: tool calling is required, and when one of your guardrails sets `enforce_first_party_harness_models`, only the harness vendor''s own models remain (OpenAI for codex, Anthropic for claude_code and claude_desktop). This filter doesn''t apply the harness''s ranking, caps or Claude Desktop model ID aliases, so returned IDs stay routable. One of: claude_code, claude_desktop, codex. Omit it to get every model you can use.' + in: 'query' + name: 'client' + required: false + schema: + description: 'Filter models and presets by the named harness''s eligibility policy: tool calling is required, and when one of your guardrails sets `enforce_first_party_harness_models`, only the harness vendor''s own models remain (OpenAI for codex, Anthropic for claude_code and claude_desktop). This filter doesn''t apply the harness''s ranking, caps or Claude Desktop model ID aliases, so returned IDs stay routable. One of: claude_code, claude_desktop, codex. Omit it to get every model you can use.' + enum: + - 'claude_code' + - 'claude_desktop' + - 'codex' + example: 'codex' + type: 'string' + x-speakeasy-unknown-values: allow responses: '200': content: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index b624bca7..30999cd2 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.803.2 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:97afbcb776214521284823795623e95d346af49e78a9d5cb9f3e5f9c800cafb7 - sourceBlobDigest: sha256:c68ad003e9bee0f9cde9d2cfeddbaa1eb052d2dd8d26de5fe942dfa716f2a78e + sourceRevisionDigest: sha256:32ea4c71d1cc026c47909f3a7dbeba5a8aaa058da5221ad57628e0a8f6f3e73f + sourceBlobDigest: sha256:f6c865e0940b6265b0c93868d059dceddc83a136c5f915316ae231ae6ef4b092 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:97afbcb776214521284823795623e95d346af49e78a9d5cb9f3e5f9c800cafb7 - sourceBlobDigest: sha256:c68ad003e9bee0f9cde9d2cfeddbaa1eb052d2dd8d26de5fe942dfa716f2a78e + sourceRevisionDigest: sha256:32ea4c71d1cc026c47909f3a7dbeba5a8aaa058da5221ad57628e0a8f6f3e73f + sourceBlobDigest: sha256:f6c865e0940b6265b0c93868d059dceddc83a136c5f915316ae231ae6ef4b092 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:6499925dcb8cbc81f32f79a93fa64c48c0d8d9635b354b2fe4f82670bb37376d + codeSamplesRevisionDigest: sha256:72935df278582f5ec42dc61a75d11ce8c7e14328cf699618aa49649e7ac37e12 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.803.2 diff --git a/RELEASES.md b/RELEASES.md index 19efc6da..c310980d 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -3759,4 +3759,14 @@ Based on: ### Generated - [python v1.3.99] . ### Releases -- [PyPI v1.3.99] https://pypi.org/project/openrouter/1.3.99 - . \ No newline at end of file +- [PyPI v1.3.99] https://pypi.org/project/openrouter/1.3.99 - . + +## 2026-10-30 03:49:05 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.100] . +### Releases +- [PyPI v1.3.100] https://pypi.org/project/openrouter/1.3.100 - . \ No newline at end of file diff --git a/docs/operations/client.mdx b/docs/operations/client.mdx new file mode 100644 index 00000000..b02404ab --- /dev/null +++ b/docs/operations/client.mdx @@ -0,0 +1,23 @@ +--- +title: "Client" +--- + +Filter models and presets by the named harness's eligibility policy: tool calling is required, and when one of your guardrails sets `enforce_first_party_harness_models`, only the harness vendor's own models remain (OpenAI for codex, Anthropic for claude_code and claude_desktop). This filter doesn't apply the harness's ranking, caps or Claude Desktop model ID aliases, so returned IDs stay routable. One of: claude_code, claude_desktop, codex. Omit it to get every model you can use. + +## Example Usage + +```python +from openrouter.operations import Client + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: Client = "claude_code" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"claude_code"` +- `"claude_desktop"` +- `"codex"` diff --git a/docs/operations/listmodelsuserrequest.mdx b/docs/operations/listmodelsuserrequest.mdx index 72652993..95083865 100644 --- a/docs/operations/listmodelsuserrequest.mdx +++ b/docs/operations/listmodelsuserrequest.mdx @@ -12,4 +12,5 @@ title: "ListModelsUserRequest" | `offset` | *OptionalNullable[int]* | ➖ | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | | `limit` | *Optional[int]* | ➖ | Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned | 500 | | `output_modalities` | *Optional[str]* | ➖ | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, embeddings, audio, video, rerank, decisions, speech, transcription) or "all" to include all models. Defaults to "text". | text | -| `sort` | [Optional[operations.ListModelsUserSort]](../operations/listmodelsusersort.mdx) | ➖ | Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved. | newest | \ No newline at end of file +| `sort` | [Optional[operations.ListModelsUserSort]](../operations/listmodelsusersort.mdx) | ➖ | Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved. | newest | +| `client` | [Optional[operations.Client]](../operations/client.mdx) | ➖ | Filter models and presets by the named harness's eligibility policy: tool calling is required, and when one of your guardrails sets `enforce_first_party_harness_models`, only the harness vendor's own models remain (OpenAI for codex, Anthropic for claude_code and claude_desktop). This filter doesn't apply the harness's ranking, caps or Claude Desktop model ID aliases, so returned IDs stay routable. One of: claude_code, claude_desktop, codex. Omit it to get every model you can use. | codex | \ No newline at end of file diff --git a/docs/sdks/models/README.mdx b/docs/sdks/models/README.mdx index 88a7166c..790d5a27 100644 --- a/docs/sdks/models/README.mdx +++ b/docs/sdks/models/README.mdx @@ -235,6 +235,7 @@ with OpenRouter( | `limit` | *Optional[int]* | ➖ | Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned | 500 | | `output_modalities` | *Optional[str]* | ➖ | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, embeddings, audio, video, rerank, decisions, speech, transcription) or "all" to include all models. Defaults to "text". | text | | `sort` | [Optional[operations.ListModelsUserSort]](../../operations/listmodelsusersort.mdx) | ➖ | Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved. | newest | +| `client` | [Optional[operations.Client]](../../operations/client.mdx) | ➖ | Filter models and presets by the named harness's eligibility policy: tool calling is required, and when one of your guardrails sets `enforce_first_party_harness_models`, only the harness vendor's own models remain (OpenAI for codex, Anthropic for claude_code and claude_desktop). This filter doesn't apply the harness's ranking, caps or Claude Desktop model ID aliases, so returned IDs stay routable. One of: claude_code, claude_desktop, codex. Omit it to get every model you can use. | codex | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/pyproject.toml b/pyproject.toml index de523996..47295f17 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.99" +version = "1.3.100" 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 dadc3297..7b6327c6 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.99" +__version__: str = "1.3.100" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.950.13" -__user_agent__: str = "speakeasy-sdk/python 1.3.99 2.950.13 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.100 2.950.13 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/models_.py b/src/openrouter/models_.py index 0e5a4161..f983b7ea 100644 --- a/src/openrouter/models_.py +++ b/src/openrouter/models_.py @@ -1138,6 +1138,7 @@ def list_for_user( limit: Optional[int] = 500, output_modalities: Optional[str] = None, sort: Optional[operations.ListModelsUserSort] = None, + client: Optional[operations.Client] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1159,6 +1160,7 @@ def list_for_user( :param limit: Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned :param output_modalities: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, embeddings, audio, video, rerank, decisions, speech, transcription) or \"all\" to include all models. Defaults to \"text\". :param sort: Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved. + :param client: Filter models and presets by the named harness's eligibility policy: tool calling is required, and when one of your guardrails sets `enforce_first_party_harness_models`, only the harness vendor's own models remain (OpenAI for codex, Anthropic for claude_code and claude_desktop). This filter doesn't apply the harness's ranking, caps or Claude Desktop model ID aliases, so returned IDs stay routable. One of: claude_code, claude_desktop, codex. Omit it to get every model you can use. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -1182,6 +1184,7 @@ def list_for_user( limit=limit, output_modalities=output_modalities, sort=sort, + client=client, ) req = self._build_request( @@ -1259,6 +1262,7 @@ def next_func() -> Optional[operations.ListModelsUserResponse]: limit=limit, output_modalities=output_modalities, sort=sort, + client=client, retries=retries, server_url=server_url, timeout_ms=timeout_ms, @@ -1338,6 +1342,7 @@ async def list_for_user_async( limit: Optional[int] = 500, output_modalities: Optional[str] = None, sort: Optional[operations.ListModelsUserSort] = None, + client: Optional[operations.Client] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1359,6 +1364,7 @@ async def list_for_user_async( :param limit: Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned :param output_modalities: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, embeddings, audio, video, rerank, decisions, speech, transcription) or \"all\" to include all models. Defaults to \"text\". :param sort: Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved. + :param client: Filter models and presets by the named harness's eligibility policy: tool calling is required, and when one of your guardrails sets `enforce_first_party_harness_models`, only the harness vendor's own models remain (OpenAI for codex, Anthropic for claude_code and claude_desktop). This filter doesn't apply the harness's ranking, caps or Claude Desktop model ID aliases, so returned IDs stay routable. One of: claude_code, claude_desktop, codex. Omit it to get every model you can use. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -1382,6 +1388,7 @@ async def list_for_user_async( limit=limit, output_modalities=output_modalities, sort=sort, + client=client, ) req = self._build_request_async( @@ -1462,6 +1469,7 @@ async def empty_result(): limit=limit, output_modalities=output_modalities, sort=sort, + client=client, retries=retries, server_url=server_url, timeout_ms=timeout_ms, diff --git a/src/openrouter/operations/__init__.py b/src/openrouter/operations/__init__.py index b84b6753..cd182637 100644 --- a/src/openrouter/operations/__init__.py +++ b/src/openrouter/operations/__init__.py @@ -833,6 +833,7 @@ ListModelsCountRequestTypedDict, ) from .listmodelsuser import ( + Client, ListModelsUserGlobals, ListModelsUserGlobalsTypedDict, ListModelsUserRequest, @@ -1179,6 +1180,7 @@ "ClassifierDimensionsTypedDict", "ClassifierFilters", "ClassifierFiltersTypedDict", + "Client", "Content", "ContentImageURL", "ContentImageURLTypedDict", @@ -2603,6 +2605,7 @@ "ListModelsCountGlobalsTypedDict": ".listmodelscount", "ListModelsCountRequest": ".listmodelscount", "ListModelsCountRequestTypedDict": ".listmodelscount", + "Client": ".listmodelsuser", "ListModelsUserGlobals": ".listmodelsuser", "ListModelsUserGlobalsTypedDict": ".listmodelsuser", "ListModelsUserRequest": ".listmodelsuser", diff --git a/src/openrouter/operations/listmodelsuser.py b/src/openrouter/operations/listmodelsuser.py index 0d87be12..a934e44d 100644 --- a/src/openrouter/operations/listmodelsuser.py +++ b/src/openrouter/operations/listmodelsuser.py @@ -123,6 +123,17 @@ class ListModelsUserSecurity(BaseModel): r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.""" +Client = Union[ + Literal[ + "claude_code", + "claude_desktop", + "codex", + ], + UnrecognizedStr, +] +r"""Filter models and presets by the named harness's eligibility policy: tool calling is required, and when one of your guardrails sets `enforce_first_party_harness_models`, only the harness vendor's own models remain (OpenAI for codex, Anthropic for claude_code and claude_desktop). This filter doesn't apply the harness's ranking, caps or Claude Desktop model ID aliases, so returned IDs stay routable. One of: claude_code, claude_desktop, codex. Omit it to get every model you can use.""" + + class ListModelsUserRequestTypedDict(TypedDict): http_referer: NotRequired[str] r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. @@ -145,6 +156,8 @@ class ListModelsUserRequestTypedDict(TypedDict): r"""Filter models by output modality. Accepts a comma-separated list of modalities (text, image, embeddings, audio, video, rerank, decisions, speech, transcription) or \"all\" to include all models. Defaults to \"text\".""" sort: NotRequired[ListModelsUserSort] r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.""" + client: NotRequired[Client] + r"""Filter models and presets by the named harness's eligibility policy: tool calling is required, and when one of your guardrails sets `enforce_first_party_harness_models`, only the harness vendor's own models remain (OpenAI for codex, Anthropic for claude_code and claude_desktop). This filter doesn't apply the harness's ranking, caps or Claude Desktop model ID aliases, so returned IDs stay routable. One of: claude_code, claude_desktop, codex. Omit it to get every model you can use.""" class ListModelsUserRequest(BaseModel): @@ -200,6 +213,12 @@ class ListModelsUserRequest(BaseModel): ] = None r"""Sort the returned models server-side. Prefer this over fetching the full list and sorting client-side. Options: pricing-low-to-high, pricing-high-to-low (average prompt/completion price), context-high-to-low (context length), throughput-high-to-low, latency-low-to-high (recent median performance), most-popular, top-weekly (tokens processed in the last week), newest (creation date), intelligence-high-to-low, coding-high-to-low, agentic-high-to-low (Artificial Analysis indices), design-arena-elo-high-to-low (best Design Arena ELO across arenas). Models without a score for the chosen benchmark are placed last. When omitted, the existing default ordering is preserved.""" + client: Annotated[ + Optional[Client], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Filter models and presets by the named harness's eligibility policy: tool calling is required, and when one of your guardrails sets `enforce_first_party_harness_models`, only the harness vendor's own models remain (OpenAI for codex, Anthropic for claude_code and claude_desktop). This filter doesn't apply the harness's ranking, caps or Claude Desktop model ID aliases, so returned IDs stay routable. One of: claude_code, claude_desktop, codex. Omit it to get every model you can use.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -211,6 +230,7 @@ def serialize_model(self, handler): "limit", "output_modalities", "sort", + "client", ] ) nullable_fields = set(["offset"]) diff --git a/uv.lock b/uv.lock index 022050f7..1cf4b6b8 100644 --- a/uv.lock +++ b/uv.lock @@ -231,7 +231,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.99" +version = "1.3.100" source = { editable = "." } dependencies = [ { name = "httpcore" },