diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index b9719e13..0e995ce2 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: 6744cfb86ad76e6d95b4060306cd70e6 + docChecksum: 4a99bfedbb9bb40c4d653c9c16842cf8 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.1.102 - configChecksum: 48a6ea214c561b8b936aa85e761b1941 + releaseVersion: 1.1.103 + configChecksum: aaaa97703db9edfbe9a1009a84779fe6 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 8f644851-91ce-495a-8810-9a0c4a7ac021 - pristine_commit_hash: ba5831be2704654a0e5652987013dedb961f4c60 - pristine_tree_hash: c2f45d5eeeb83ac7b3e0dd0c94227f2cd2f1b20a + generation_id: 5af8de57-dc0b-40ea-b57a-fb261e626bf5 + pristine_commit_hash: b626705a10083ce0eb67987e44393351f50d63a2 + pristine_tree_hash: 58bb9ba91c9012d9e7d657331a73ccc1bc5471cb features: python: acceptHeaders: 3.0.0 @@ -6842,8 +6842,8 @@ trackedFiles: pristine_git_object: f0a800135df0c6e4799128a4fbc901c576c8c6ce docs/operations/listmodelsuserrequest.mdx: id: 01537864056e - last_write_checksum: sha1:860605a95a465af148f71c6a1bd3de135092dd95 - pristine_git_object: 5e2917bd45a55ce6eea3bf36be5ebd33e9d6ea17 + last_write_checksum: sha1:fe26690258f59a6c3659838734f2b63965159c16 + pristine_git_object: b0cc0a75f1476c2abc9f14e2053a27fb1db46d68 docs/operations/listmodelsuserresponse.mdx: id: 34f7a1648ceb last_write_checksum: sha1:bf1ee4a9b2ad707ff1c39ea8680e72e5d0c27b9a @@ -7342,8 +7342,8 @@ trackedFiles: pristine_git_object: 6ee346c73844495c95009346a1242ed6f37d58b5 docs/sdks/models/README.mdx: id: 58f1ca464e0b - last_write_checksum: sha1:34535ca4139b5892da3c9beaa5636cd9d362399b - pristine_git_object: 273eaea4035f1dfdd97cae5f676245d6a28edbf7 + last_write_checksum: sha1:1fb21d0d43aaa689a1773ae66e277abcf3e2dbd3 + pristine_git_object: c23025f4fcf605d83b7ba9abb839e88a173fe3ff docs/sdks/oauth/README.mdx: id: 42b5079343d2 last_write_checksum: sha1:60ecae1338bc4487fbb050b6044ddc08dd7d1685 @@ -7398,8 +7398,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:981a937fa5fe6cf5bd7a0935efcb2d5ca8bf3763 - pristine_git_object: c4f5ad6da93b0c93863b66c2f39bd0a883fa5e87 + last_write_checksum: sha1:c94585f39aa006a1e154f0af4f6dcbbb38094609 + pristine_git_object: 5bc1bd724f64b40ad4f24b6294ef6593faab9333 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -7426,8 +7426,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:fa2c3f145b1f759f3dbbf3d5e02842be26df0860 - pristine_git_object: 484b67eee98df80ec3310e0cdb0846acbd89a3ae + last_write_checksum: sha1:fcde4c9b6814c1b3d2b08b92ef9b1fed14650d65 + pristine_git_object: 939a6dd5a4d81df72fe5231f8f9c44a05352234e src/openrouter/analytics.py: id: cb406b5aaabb last_write_checksum: sha1:1e0004d8d1d5d797e2b54cd1cabeb7f9489d08e9 @@ -10078,8 +10078,8 @@ trackedFiles: pristine_git_object: 5b741456655ff48919d17ffd552a6410f0587966 src/openrouter/models_.py: id: 4e1ae1fe5b98 - last_write_checksum: sha1:46bf70462d029118eb7bed05e0a563ff8542468b - pristine_git_object: 7b5ef610a5536d64903205b859608d7be6076d4d + last_write_checksum: sha1:fa6b119034b3695e9ee6260445f1ec2ee3220015 + pristine_git_object: f0c6429a86afd1fe013547737bebc22daf5d5cc9 src/openrouter/oauth.py: id: 1948ce27255b last_write_checksum: sha1:8d6ba30594d5674164f045d6655914b801268f72 @@ -10394,8 +10394,8 @@ trackedFiles: pristine_git_object: 797af26e7d4985305600eb79b3ede8e78379d13a src/openrouter/operations/listmodelsuser.py: id: 16eb5946cf60 - last_write_checksum: sha1:0cbbd011e6a5b332eefbed8e9ede96287fdd9a40 - pristine_git_object: 8a540289e07f888ba77baab1ebe1259b8221a3d4 + last_write_checksum: sha1:701d966be65bd4fbfba54c107aa24b4ae554875c + pristine_git_object: 614eed41948fb478762db3846d82a08f0709e5cd src/openrouter/operations/listobservabilitydestinations.py: id: 40d2ffa975ee last_write_checksum: sha1:81c37a18a7326ddbe95a22d2f43a178cd6a58a93 @@ -12473,4 +12473,6 @@ examples: "503": application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}} examplesVersion: 1.0.2 -releaseNotes: "## Python SDK Changes:\n* `open_router.tts.create_speech()`: \n * `request.provider.options.cosine` **Added**\n* `open_router.stt.create_transcription()`: \n * `request.provider.options.cosine` **Added**\n* `open_router.byok.list()`: \n * `request.provider` **Changed**\n * `response.data[].provider.enum(cosine)` **Added**\n* `open_router.byok.create()`: \n * `request.provider.enum(cosine)` **Added**\n * `response.data.provider.enum(cosine)` **Added**\n* `open_router.byok.get()`: `response.data.provider.enum(cosine)` **Added**\n* `open_router.byok.update()`: `response.data.provider.enum(cosine)` **Added**\n* `open_router.chat.send()`: \n * `request.provider.ignore[].union(ProviderName).enum(cosine)` **Added**\n* `open_router.embeddings.generate()`: \n * `request.provider.ignore[].union(ProviderName).enum(cosine)` **Added**\n* `open_router.endpoints.list_zdr_endpoints()`: `response.data[].provider_name.enum(cosine)` **Added**\n* `open_router.endpoints.list()`: `response.data.endpoints[].provider_name.enum(cosine)` **Added**\n* `open_router.generations.get_generation()`: `response.data.provider_responses[].provider_name.enum(cosine)` **Added**\n* `open_router.images.generate()`: `request.provider` **Changed**\n* `open_router.presets.create_presets_chat_completions()`: \n * `request.provider.ignore[].union(ProviderName).enum(cosine)` **Added**\n* `open_router.presets.create_presets_messages()`: \n * `request.provider.ignore[].union(ProviderName).enum(cosine)` **Added**\n* `open_router.presets.create_presets_responses()`: \n * `request.provider.ignore[].union(ProviderName).enum(cosine)` **Added**\n* `open_router.rerank.rerank()`: \n * `request.provider.ignore[].union(ProviderName).enum(cosine)` **Added**\n* `open_router.responses.send()`: \n * `request.provider.ignore[].union(ProviderName).enum(cosine)` **Added**\n* `open_router.beta.responses.send()`: \n * `request.provider.ignore[].union(ProviderName).enum(cosine)` **Added**\n* `open_router.video_generation.generate()`: \n * `request.provider.options.cosine` **Added**\n" +releaseNotes: | + ## Python SDK Changes: + * `open_router.models.list_for_user()`: `request.output_modalities` **Added** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 9a3b05c3..34bef3bb 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.1.102 + version: 1.1.103 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 3db14e2b..6301475e 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -36048,7 +36048,7 @@ paths: - $ref: "#/components/parameters/AppCategories" /models/user: get: - description: 'List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through a regional hostname, the results will be filtered to models that satisfy in-region routing for that region.' + description: 'List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). Returns text-output models by default; pass `output_modalities` (e.g. `image,audio,embeddings` or `all`) to include other modalities. If requesting through a regional hostname, the results will be filtered to models that satisfy in-region routing for that region.' operationId: 'listModelsUser' parameters: - description: 'Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned' @@ -36075,6 +36075,14 @@ paths: maximum: 1000 minimum: 1 type: 'integer' + - description: 'Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text".' + in: 'query' + name: 'output_modalities' + required: false + schema: + description: 'Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text".' + example: 'text' + type: 'string' responses: '200': content: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index f1405c59..c0811365 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:a99e59861080291ca3bfe843adfa5748bd26542ac1552abc5c0ceb32180e4f1c - sourceBlobDigest: sha256:e783ca62e795d47da3b9baf10a4abf2f52d83a924a85d231721a7e9ac54d8586 + sourceRevisionDigest: sha256:0942b4e18ff30f8424ba64e3c3b2624f5469d4b36bff4b95a764233041ebbc9d + sourceBlobDigest: sha256:e4a0ea6b81d119b6a7dafc24bd80d38ede2b4e820755575d0b07ff4ecb434234 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:a99e59861080291ca3bfe843adfa5748bd26542ac1552abc5c0ceb32180e4f1c - sourceBlobDigest: sha256:e783ca62e795d47da3b9baf10a4abf2f52d83a924a85d231721a7e9ac54d8586 + sourceRevisionDigest: sha256:0942b4e18ff30f8424ba64e3c3b2624f5469d4b36bff4b95a764233041ebbc9d + sourceBlobDigest: sha256:e4a0ea6b81d119b6a7dafc24bd80d38ede2b4e820755575d0b07ff4ecb434234 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:7341a9aaacdd9178a3614b909dffc04edb74fa1f81e25f46ee155826c3f25a6c + codeSamplesRevisionDigest: sha256:e65200767bc077ad2e18b2a8b06f61b15a2c3eb9c12b5ab51f26bca7802c4045 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index 48c45544..d5ac5fd8 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1809,4 +1809,14 @@ Based on: ### Generated - [python v1.1.102] . ### Releases -- [PyPI v1.1.102] https://pypi.org/project/openrouter/1.1.102 - . \ No newline at end of file +- [PyPI v1.1.102] https://pypi.org/project/openrouter/1.1.102 - . + +## 2026-08-28 19:50:28 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.1.103] . +### Releases +- [PyPI v1.1.103] https://pypi.org/project/openrouter/1.1.103 - . \ No newline at end of file diff --git a/docs/operations/listmodelsuserrequest.mdx b/docs/operations/listmodelsuserrequest.mdx index 5e2917bd..b0cc0a75 100644 --- a/docs/operations/listmodelsuserrequest.mdx +++ b/docs/operations/listmodelsuserrequest.mdx @@ -4,10 +4,11 @@ title: "ListModelsUserRequest" ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `offset` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | -| `limit` | *Optional[int]* | :heavy_minus_sign: | Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned | 500 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `offset` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | +| `limit` | *Optional[int]* | :heavy_minus_sign: | 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]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text | \ No newline at end of file diff --git a/docs/sdks/models/README.mdx b/docs/sdks/models/README.mdx index 273eaea4..c23025f4 100644 --- a/docs/sdks/models/README.mdx +++ b/docs/sdks/models/README.mdx @@ -191,7 +191,7 @@ with OpenRouter( ## list_for_user -List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through a regional hostname, the results will be filtered to models that satisfy in-region routing for that region. +List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). Returns text-output models by default; pass `output_modalities` (e.g. `image,audio,embeddings` or `all`) to include other modalities. If requesting through a regional hostname, the results will be filtered to models that satisfy in-region routing for that region. ### Example Usage @@ -219,15 +219,16 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `security` | [operations.ListModelsUserSecurity](../../operations/listmodelsusersecurity.mdx) | :heavy_check_mark: | N/A | | -| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `offset` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | -| `limit` | *Optional[int]* | :heavy_minus_sign: | Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned | 500 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `security` | [operations.ListModelsUserSecurity](../../operations/listmodelsusersecurity.mdx) | :heavy_check_mark: | N/A | | +| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | +| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `offset` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned | 0 | +| `limit` | *Optional[int]* | :heavy_minus_sign: | 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]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/pyproject.toml b/pyproject.toml index c4f5ad6d..5bc1bd72 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.1.102" +version = "1.1.103" 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 484b67ee..939a6dd5 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.102" +__version__: str = "1.1.103" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.1.102 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.1.103 2.914.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/models_.py b/src/openrouter/models_.py index 7b5ef610..f0c6429a 100644 --- a/src/openrouter/models_.py +++ b/src/openrouter/models_.py @@ -1076,6 +1076,7 @@ def list_for_user( x_open_router_categories: Optional[str] = None, offset: OptionalNullable[int] = 0, limit: Optional[int] = 500, + output_modalities: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1083,7 +1084,7 @@ def list_for_user( ) -> Optional[operations.ListModelsUserResponse]: r"""List models filtered by user provider preferences, privacy settings, and guardrails - List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through a regional hostname, the results will be filtered to models that satisfy in-region routing for that region. + List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). Returns text-output models by default; pass `output_modalities` (e.g. `image,audio,embeddings` or `all`) to include other modalities. If requesting through a regional hostname, the results will be filtered to models that satisfy in-region routing for that region. :param security: :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. @@ -1095,6 +1096,7 @@ def list_for_user( :param offset: Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned :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, audio, embeddings) or \"all\" to include all models. Defaults to \"text\". :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 @@ -1116,6 +1118,7 @@ def list_for_user( x_open_router_categories=x_open_router_categories, offset=offset, limit=limit, + output_modalities=output_modalities, ) req = self._build_request( @@ -1191,6 +1194,7 @@ def next_func() -> Optional[operations.ListModelsUserResponse]: x_open_router_categories=x_open_router_categories, offset=next_offset, limit=limit, + output_modalities=output_modalities, retries=retries, server_url=server_url, timeout_ms=timeout_ms, @@ -1248,6 +1252,7 @@ async def list_for_user_async( x_open_router_categories: Optional[str] = None, offset: OptionalNullable[int] = 0, limit: Optional[int] = 500, + output_modalities: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1255,7 +1260,7 @@ async def list_for_user_async( ) -> Optional[operations.ListModelsUserResponse]: r"""List models filtered by user provider preferences, privacy settings, and guardrails - List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through a regional hostname, the results will be filtered to models that satisfy in-region routing for that region. + List models filtered by user provider preferences, [privacy settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and [guardrails](https://openrouter.ai/docs/guides/features/guardrails). Returns text-output models by default; pass `output_modalities` (e.g. `image,audio,embeddings` or `all`) to include other modalities. If requesting through a regional hostname, the results will be filtered to models that satisfy in-region routing for that region. :param security: :param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings. @@ -1267,6 +1272,7 @@ async def list_for_user_async( :param offset: Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned :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, audio, embeddings) or \"all\" to include all models. Defaults to \"text\". :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 @@ -1288,6 +1294,7 @@ async def list_for_user_async( x_open_router_categories=x_open_router_categories, offset=offset, limit=limit, + output_modalities=output_modalities, ) req = self._build_request_async( @@ -1366,6 +1373,7 @@ async def empty_result(): x_open_router_categories=x_open_router_categories, offset=next_offset, limit=limit, + output_modalities=output_modalities, retries=retries, server_url=server_url, timeout_ms=timeout_ms, diff --git a/src/openrouter/operations/listmodelsuser.py b/src/openrouter/operations/listmodelsuser.py index 8a540289..614eed41 100644 --- a/src/openrouter/operations/listmodelsuser.py +++ b/src/openrouter/operations/listmodelsuser.py @@ -115,6 +115,8 @@ class ListModelsUserRequestTypedDict(TypedDict): r"""Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned""" limit: NotRequired[int] r"""Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned""" + output_modalities: NotRequired[str] + r"""Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\".""" class ListModelsUserRequest(BaseModel): @@ -158,6 +160,12 @@ class ListModelsUserRequest(BaseModel): ] = 500 r"""Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned""" + output_modalities: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\".""" + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( @@ -167,6 +175,7 @@ def serialize_model(self, handler): "X-OpenRouter-Categories", "offset", "limit", + "output_modalities", ] ) nullable_fields = set(["offset"]) diff --git a/uv.lock b/uv.lock index 1dddb90f..6422036e 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.1.102" +version = "1.1.103" source = { editable = "." } dependencies = [ { name = "httpcore" },