diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 7ffccf792..c45450d0a 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: 0757b19ad4945cb53518a7b8c704e3d9 + docChecksum: ead11b051c18143a784363a4a717c7b1 docVersion: 1.0.0 speakeasyVersion: 1.803.2 generationVersion: 2.950.13 - releaseVersion: 1.3.191 - configChecksum: 77ffe7400092550305f5f5e6a67abe82 + releaseVersion: 1.3.192 + configChecksum: 17c5c557633967b50b31eea2d529c969 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: dc212f4f-2d93-45d7-8c6c-7d1068544357 - pristine_commit_hash: f8744635ad4d01c48172043961f11b0a86329837 - pristine_tree_hash: 827ba748328ecd25f113afae7c1c0c7e447438c4 + generation_id: 56b5e38b-fe7c-419c-890d-b59e2c9fef76 + pristine_commit_hash: 008e6346fa3d33d765149fde12d2f7512e181d16 + pristine_tree_hash: 6dffda3745f76e910e188bbc1bd059193c6f380c features: python: acceptHeaders: 3.0.0 @@ -2892,8 +2892,8 @@ trackedFiles: pristine_git_object: 560595f84a8136a4605af8cc09ae21f9f616512a docs/components/createworkspacerequest.mdx: id: ea85d6684017 - last_write_checksum: sha1:205142f845afe202be22f4950e2044dbc2bb983b - pristine_git_object: de336461692eb191c98e0d2283de2ce7cffc7211 + last_write_checksum: sha1:482adf949f456ef110f8ed145091aa800c5927af + pristine_git_object: 9628ac78e8ff6e11222c8b25fb6f3494b82ca0ae docs/components/createworkspacerequestdisabledservertool.mdx: id: 19a533b200f9 last_write_checksum: sha1:0480179ef9ed1e1a8a3cfe744d479129be225e50 @@ -4392,8 +4392,8 @@ trackedFiles: pristine_git_object: bccd158982dba4b4ed810b98b5f7d4a6c04afaa7 docs/components/imagegenerationrequest.mdx: id: b093cb0f5e81 - last_write_checksum: sha1:8caaa86fe03a06cb7d2c457a21bbd0b9ef382fa1 - pristine_git_object: 2800926d2b35fff6f1285b32d5f40a7da3fbf141 + last_write_checksum: sha1:30fbee66a3e0fd9946beee7177dfcf80132586f0 + pristine_git_object: db92a380f3efccb3a1749fa8c76b6e5dabc2af40 docs/components/imagegenerationrequestaspectratio.mdx: id: bda89377f32d last_write_checksum: sha1:291771c6756771aabfadcee9b78e2aca504e7697 @@ -4422,18 +4422,22 @@ trackedFiles: id: 5dcb01b22e48 last_write_checksum: sha1:e9988b6c6bb828aa024a766e8d78f98f825b2ddc pristine_git_object: af076aee50627f2a3229b2c57c64f22d2e6c22a1 + docs/components/imagegenerationrequestresponseformat.mdx: + id: 0f01278942b1 + last_write_checksum: sha1:0e6a7f4ea11674596b5a6b209a80b530e228ce2c + pristine_git_object: b398569046c84079aebfca4cce91afd316aebed7 docs/components/imagegenerationrequesttype.mdx: id: bdfd99eea1bc last_write_checksum: sha1:40a7f3f0638e9a52fc358dff16834c1cd3871f11 pristine_git_object: cf889aea249ef88ede12f570f17d89d138645a2b docs/components/imagegenerationresponse.mdx: id: 094e477544e9 - last_write_checksum: sha1:504f7c03629153c61d508d997c079dcf843694f9 - pristine_git_object: 82ea0ef2f042092163584589dfe1bafdb684361d + last_write_checksum: sha1:61287cf0ee0010b06026a99bb1c8239f5b4eaa3f + pristine_git_object: 27aa4d05f57760a0528c773d00ce70239508943e docs/components/imagegenerationresponsedata.mdx: id: 1afc55d56268 - last_write_checksum: sha1:96cd9afa714deff6f2ff8318e6e748df474efb3d - pristine_git_object: 3b470b255b9172acb2a60152ae372306245b7254 + last_write_checksum: sha1:771df0375f4d4444acfd4190b0d4a5d86c71dc1b + pristine_git_object: 7382ece520557698a8acb249a048ae763f46cbfc docs/components/imagegenerationservertool.mdx: id: "299013078656" last_write_checksum: sha1:a92538e6ebce9431f7ea9976cd678437cbcd00c2 @@ -9072,8 +9076,8 @@ trackedFiles: pristine_git_object: cb179a3f96b2cb7d07d094a1503b97e87bbf4aa1 docs/components/updateworkspacerequest.mdx: id: 9870d016bf28 - last_write_checksum: sha1:05f4113c5bdb7b9b0d2c2efb956103742d909a35 - pristine_git_object: ca9883c31b38178f8072b251c59433d1d1d06bb8 + last_write_checksum: sha1:7c01c6568de95c8dcaaf324b97ec26e13d0f7dcc + pristine_git_object: 7b17a64e658feaf629b5dacb8d82e41126135d57 docs/components/updateworkspacerequestdisabledservertool.mdx: id: 47cabb4adf1a last_write_checksum: sha1:6e1590e629a17f91e9a91844a8e54ea5deec5da1 @@ -11612,8 +11616,8 @@ trackedFiles: pristine_git_object: 3f96698736d6078dfb33689dd2fdca320bac0a03 docs/sdks/images/README.mdx: id: 534a6c102c4f - last_write_checksum: sha1:079630beece943bdc653184e6d6448df72a62bd5 - pristine_git_object: d45846d4514d25a84fbd8cd439a6bd5c37e75946 + last_write_checksum: sha1:2e5532a4a851671d06693d38d67884e64ca112df + pristine_git_object: 931e40f773c106a8ae654c501164ce4c5674385d docs/sdks/models/README.mdx: id: 58f1ca464e0b last_write_checksum: sha1:2e89247b7ad63c2bdcf9da989ac4f2e758eee729 @@ -11656,8 +11660,8 @@ trackedFiles: pristine_git_object: 65eb984d913d1196f223e1c2f8004891d1a53058 docs/sdks/scim/README.mdx: id: fd6d8a91a053 - last_write_checksum: sha1:28c02b55a629845b4912e9eac168cfc0cb7eb785 - pristine_git_object: 53a88c2bffdd205f6bcf846482092cee286e8f33 + last_write_checksum: sha1:e6b58a1fabf91f5250a84f696203e2756a66a9ea + pristine_git_object: 6b829448efce633995225efd4cb68ab138381afb docs/sdks/stt/README.mdx: id: 190b0dc9a5d1 last_write_checksum: sha1:0e88efab8bed1237da03a0c5164c363da96ff806 @@ -11684,16 +11688,16 @@ trackedFiles: pristine_git_object: 94f9c0c08b2942b9a2e809a82bb435995e94e74e docs/sdks/workspaces/README.mdx: id: 0c75d023ef6b - last_write_checksum: sha1:9d42934e7e99f371d3f0bbff2d2af8c4b9061b50 - pristine_git_object: 2a9dd00413ea096b8740ddf6316bcb806c297af7 + last_write_checksum: sha1:f1a5581dd5ff695670551986daa785199adcd9f1 + pristine_git_object: ca8360ed689ae203d9dd89c034ab728fed5d68ea py.typed: id: 258c3ed47ae4 last_write_checksum: sha1:8efc425ffe830805ffcc0f3055871bdcdc542c60 pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:9d7f793798655e4b3b5a4637046a59146096e720 - pristine_git_object: 98e4968a2b8cca32c51531a378f8961eb2f9e09d + last_write_checksum: sha1:e8efbc16e299586cb4aab6d1538689d0dfdf0dd8 + pristine_git_object: 5ef9b9036f0f8c5809098b91e62cd184ea9c465b scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -11720,8 +11724,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:b6223a11e70c47051e3b7932ec4e3943e74de0fe - pristine_git_object: e17a622767c3f9f68cdcaa60b22ff71f8fbe0cb1 + last_write_checksum: sha1:31599a151d812c7c9a96890cf80683200443f68b + pristine_git_object: 1ffdf5e6ff880ab126e742878bd9cf3dba824e8d src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:80cc0f39649445431cc2247ed0e0765438467766 @@ -11768,8 +11772,8 @@ trackedFiles: pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:085379c69ae3ac2d55f8e812046986c648936293 - pristine_git_object: 63c91de662a590176a6c124a5de542adf74c596a + last_write_checksum: sha1:07b08d642682f126555eab11a3c87b956e80348f + pristine_git_object: a3ca8f5cb158649ab5214cba5f03b0c1af501329 src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:08125e1d60df82793e11e8aed6e3c9fdb7512ebb @@ -13004,8 +13008,8 @@ trackedFiles: pristine_git_object: 3a03248b4aa36f469420c5602df4f5d21a36dd68 src/openrouter/components/createworkspacerequest.py: id: 3785d9b207c2 - last_write_checksum: sha1:bece1b1b48561fe5c8f5f67cfe8b0fe62f159db6 - pristine_git_object: f4bccf4ce5035b60d0b99dc9d44ce4702c0f0594 + last_write_checksum: sha1:d7bfd1848fe4e078e2577eb26926fd8f999a8e72 + pristine_git_object: 886866347cc3f54e62588178b69ddd17dcada984 src/openrouter/components/createworkspaceresponse.py: id: 986d9ff993c1 last_write_checksum: sha1:7e9028b437a9e33a7541ba222cf01e6629f5c74d @@ -13616,12 +13620,12 @@ trackedFiles: pristine_git_object: c61d96ac1725cf966408790eecad814eb1086ade src/openrouter/components/imagegenerationrequest.py: id: f8291a7be9a0 - last_write_checksum: sha1:b5a0451d85f0f64de10999d53003ec2ae012311d - pristine_git_object: 8457fb8478ecec520da1808ffbb30a19dacf775c + last_write_checksum: sha1:7449f9a3a475266fd856c4e4b84cc7cc0aa1c229 + pristine_git_object: 846c731060295668189182f6abee541c03fd7f32 src/openrouter/components/imagegenerationresponse.py: id: 53354cd0cbfc - last_write_checksum: sha1:579cb046c956dbe27b82aa58e42277b33902b651 - pristine_git_object: 3f2061536222d2b88913bca039f434e25194f566 + last_write_checksum: sha1:3fa255f2a2c362b63d45a017a2909b4d3b6c4b7f + pristine_git_object: c2dd55dca7807819416e2df1d039d97beb0aa2fe src/openrouter/components/imagegenerationservertool.py: id: 9c95bc975f2e last_write_checksum: sha1:808635f6a028797cd87918e3a3353d6c3bf00226 @@ -15436,8 +15440,8 @@ trackedFiles: pristine_git_object: 2f110211bb0a6889bb6455a7a3901e0be260b170 src/openrouter/components/updateworkspacerequest.py: id: 78d86b3b0a63 - last_write_checksum: sha1:05668f8c41f24a2a92fc7b7ad4ab1344efc2ed75 - pristine_git_object: 3a9f3e0d6411c617bbdd689616a270d15bd197ac + last_write_checksum: sha1:ef37587d15a42b515231fae74625e4aac1c5941d + pristine_git_object: f3a672362af4a9cbae11129c2ceaf38a427f313f src/openrouter/components/updateworkspaceresponse.py: id: 46253fa9690a last_write_checksum: sha1:4708e7e4cbfddc34ffc9ed4808a88bb5b4a61ebf @@ -15788,8 +15792,8 @@ trackedFiles: pristine_git_object: 89560b566073785535643e694c112bedbd3db13d src/openrouter/images.py: id: c4d7adf63ae0 - last_write_checksum: sha1:8a6318b7628bcb6e6cc7791b34c2b538906ab5d3 - pristine_git_object: 2edc66d821a3220612311e6fe920521da26400db + last_write_checksum: sha1:edcdb20be2cc46c3134eb31e6c4056d8bb4a054f + pristine_git_object: a5056565f1d5f054fc29b08864ad0975e4d3e4c4 src/openrouter/models/__init__.py: id: ed73b93abb3f last_write_checksum: sha1:932a790ae66ccd7d7022b39c659bcf72a664ebea @@ -16524,8 +16528,8 @@ trackedFiles: pristine_git_object: 6583a0b59f3ede8c72897bb922c1f85de280e8e0 src/openrouter/scim.py: id: 351afd6b616e - last_write_checksum: sha1:4c9a81e177e1dbc246e0955e90365d653d2ba876 - pristine_git_object: 6bc5fe5e691f5136f59e018dac5998ac36700e10 + last_write_checksum: sha1:82ff1258584f0d018e5d0ccf75387c2464d5de1b + pristine_git_object: 3ad8fa3fcac805a3ef5b0b63cf21386a03f2488a src/openrouter/sdk.py: id: ee9846c4c9c5 last_write_checksum: sha1:e2ac234f50cf2fa57417f0be1c9222dc8cfcf947 @@ -16648,8 +16652,8 @@ trackedFiles: pristine_git_object: ad510dfd4cbcb4544239161053d0c5fe4a824b71 src/openrouter/workspaces.py: id: cd6c533b1802 - last_write_checksum: sha1:8f0231785c533c9076eb9520bb7574620d18136c - pristine_git_object: cbb3c4a401346312a035f35305f1007b5eec9eff + last_write_checksum: sha1:7d0ee430f2cb8024c2824eb2f8ec6841907d62ba + pristine_git_object: b622e931604c25c149a2ba5665c0dc2831de455f examples: createResponses: speakeasy-default-create-responses: @@ -18381,7 +18385,7 @@ examples: application/json: {"model": "bytedance-seed/seedream-4.5", "prompt": "a red panda astronaut floating in space, studio lighting"} responses: "200": - application/json: {"created": 1748372400, "data": [{"b64_json": ""}]} + application/json: {"created": 1748372400, "data": [{}]} "400": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "401": @@ -21743,4 +21747,9 @@ examples: "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 -releaseNotes: "## Python SDK Changes:\n* `open_router.private_endpoints.create()`: \n * `request.settings.prompt_caching` **Added**\n* `open_router.private_endpoints.get()`: `response.data.settings.prompt_caching` **Added**\n* `open_router.private_endpoints.update()`: \n * `request.settings.prompt_caching` **Added**\n * `response.data.settings.prompt_caching` **Added**\n" +releaseNotes: | + ## Python SDK Changes: + * `open_router.scim.create()`: **Deprecated** + * `open_router.scim.delete()`: **Deprecated** + * `open_router.scim.update()`: **Deprecated** + * `open_router.scim.create_sync_job()`: **Deprecated** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 2d752fb6f..c69480478 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.191 + version: 1.3.192 additionalDependencies: dev: pytest: '>=8.3' diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 9e96aa140..fb47e1479 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -11580,7 +11580,7 @@ components: - 'array' - 'null' io_logging_api_key_ids: - description: 'Optional array of API key IDs to filter I/O logging' + description: 'Optional array of API key IDs to filter I/O logging. Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard.' example: null items: type: 'integer' @@ -11588,20 +11588,20 @@ components: - 'array' - 'null' io_logging_sampling_rate: - description: 'Sampling rate for I/O logging (0.0001-1)' + description: 'Sampling rate for I/O logging (0.0001-1). Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard.' example: 1 format: 'double' type: 'number' is_data_discount_logging_enabled: - description: 'Whether data discount logging is enabled. Enabling it requires the account to allow workspace data-discount logging; otherwise the request returns 403.' - example: true + description: 'Whether data discount logging is enabled. Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard.' + example: false type: 'boolean' is_observability_broadcast_enabled: description: 'Whether broadcast is enabled' example: false type: 'boolean' is_observability_io_logging_enabled: - description: 'Whether private logging is enabled' + description: 'Whether private logging is enabled. Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard.' example: false type: 'boolean' name: @@ -17273,6 +17273,14 @@ components: example: '2K' type: 'string' x-speakeasy-unknown-values: allow + response_format: + description: '`b64_json` (default) returns the image bytes inline. `url` stores each output in OpenRouter storage and returns a signed download URL in place of the bytes. The URL is a bearer link: anyone holding it can download the image until it expires, up to 24 hours after the image was stored (use `expires_at`); the stored copy is deleted by the storage lifecycle within the following day. The response falls back to `b64_json` when a URL cannot be issued: streaming responses, zero-data-retention requests (account settings, guardrails or `provider.zdr`) or endpoints, or storage being unavailable.' + enum: + - 'b64_json' + - 'url' + example: 'b64_json' + type: 'string' + x-speakeasy-unknown-values: allow seed: description: 'If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers.' type: 'integer' @@ -17320,7 +17328,7 @@ components: items: properties: b64_json: - description: 'Base64-encoded image bytes' + description: 'Base64-encoded image bytes. Present unless the request asked for `response_format: "url"` and `url` was issued.' type: 'string' layer: $ref: '#/components/schemas/ImageGenerationLayer' @@ -17328,10 +17336,16 @@ components: description: 'Media type (MIME type) of the image, e.g. `image/png`, `image/jpeg`, `image/webp`, `image/svg+xml`. May be omitted if the format could not be determined.' example: 'image/png' type: 'string' - required: - - 'b64_json' + url: + description: 'Signed download URL for the image bytes, issued for `response_format: "url"` requests. Valid until `expires_at`. Absent when the response fell back to `b64_json`.' + example: 'https://storage.googleapis.com/openrouter-generated-media-us/v1/...' + type: 'string' type: 'object' type: 'array' + expires_at: + description: 'Unix timestamp (seconds) of the earliest expiry among the `url`s in `data`; treat every URL as expired after it. Present only when URLs were issued.' + example: 1748458800 + type: 'integer' usage: $ref: '#/components/schemas/ImageGenerationUsage' required: @@ -37964,7 +37978,7 @@ components: - 'array' - 'null' io_logging_api_key_ids: - description: 'Optional array of API key IDs to filter I/O logging' + description: 'Optional array of API key IDs to filter I/O logging. Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard.' example: null items: type: 'integer' @@ -37972,20 +37986,20 @@ components: - 'array' - 'null' io_logging_sampling_rate: - description: 'Sampling rate for I/O logging (0.0001-1)' + description: 'Sampling rate for I/O logging (0.0001-1). Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard.' example: 1 format: 'double' type: 'number' is_data_discount_logging_enabled: - description: 'Whether data discount logging is enabled. Enabling it requires the account to allow workspace data-discount logging; otherwise the request returns 403.' - example: true + description: 'Whether data discount logging is enabled. Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard.' + example: false type: 'boolean' is_observability_broadcast_enabled: description: 'Whether broadcast is enabled' example: false type: 'boolean' is_observability_io_logging_enabled: - description: 'Whether private logging is enabled' + description: 'Whether private logging is enabled. Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard.' example: false type: 'boolean' name: @@ -58855,7 +58869,8 @@ paths: results: '$.data' type: 'offsetLimit' post: - description: 'Create a SCIM group-to-workspace role mapping. Creating a mapping that already exists with the same role succeeds and re-applies the mapping to the group members. Requesting a different role for an existing mapping returns 409. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + deprecated: true + description: 'Create a SCIM group-to-workspace role mapping. Disabled: no API key can perform this write, including management keys. Use the organization settings in the dashboard, which require step-up verification. A valid management key for an organization with SCIM access receives 403; an invalid key still receives 401 and an organization without SCIM access receives 404.' operationId: 'createScimGroupMapping' requestBody: content: @@ -58869,7 +58884,7 @@ paths: application/json: schema: $ref: '#/components/schemas/CreateScimGroupMappingResponse' - description: 'SCIM group mapping created' + description: 'SCIM group mapping created. Not returned: this operation is disabled. The schema is kept for SDK compatibility.' '400': content: application/json: @@ -58896,10 +58911,10 @@ paths: example: error: code: 403 - message: 'Only management keys can perform this operation' + message: 'Management keys cannot change SCIM group mappings or start syncs. Use the organization settings in the dashboard.' schema: $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' + description: 'Forbidden - SCIM writes are dashboard-only' '404': content: application/json: @@ -58940,7 +58955,8 @@ paths: - $ref: "#/components/parameters/AppCategories" /scim/group-mappings/{id}: delete: - description: 'Delete a SCIM group-to-workspace mapping. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + deprecated: true + description: 'Delete a SCIM group-to-workspace mapping. Disabled: no API key can perform this write, including management keys. Use the organization settings in the dashboard, which require step-up verification. A valid management key for an organization with SCIM access receives 403; an invalid key still receives 401 and an organization without SCIM access receives 404.' operationId: 'deleteScimGroupMapping' parameters: - in: 'path' @@ -58969,7 +58985,7 @@ paths: application/json: schema: $ref: '#/components/schemas/DeleteScimGroupMappingResponse' - description: 'SCIM group mapping deleted' + description: 'SCIM group mapping deleted. Not returned: this operation is disabled. The schema is kept for SDK compatibility.' '400': content: application/json: @@ -58996,10 +59012,10 @@ paths: example: error: code: 403 - message: 'Only management keys can perform this operation' + message: 'Management keys cannot change SCIM group mappings or start syncs. Use the organization settings in the dashboard.' schema: $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' + description: 'Forbidden - SCIM writes are dashboard-only' '404': content: application/json: @@ -59086,7 +59102,8 @@ paths: - 'SCIM' x-speakeasy-name-override: 'read' patch: - description: 'Update a SCIM group mapping role. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + deprecated: true + description: 'Update a SCIM group mapping role. Disabled: no API key can perform this write, including management keys. Use the organization settings in the dashboard, which require step-up verification. A valid management key for an organization with SCIM access receives 403; an invalid key still receives 401 and an organization without SCIM access receives 404.' operationId: 'updateScimGroupMapping' parameters: - in: 'path' @@ -59107,7 +59124,7 @@ paths: application/json: schema: $ref: '#/components/schemas/UpdateScimGroupMappingResponse' - description: 'SCIM group mapping updated' + description: 'SCIM group mapping updated. Not returned: this operation is disabled. The schema is kept for SDK compatibility.' '400': content: application/json: @@ -59134,10 +59151,10 @@ paths: example: error: code: 403 - message: 'Only management keys can perform this operation' + message: 'Management keys cannot change SCIM group mappings or start syncs. Use the organization settings in the dashboard.' schema: $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' + description: 'Forbidden - SCIM writes are dashboard-only' '404': content: application/json: @@ -59279,7 +59296,8 @@ paths: - $ref: "#/components/parameters/AppCategories" /scim/sync-jobs: post: - description: 'Start a SCIM directory sync. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + deprecated: true + description: 'Start a SCIM directory sync. Disabled: no API key can perform this write, including management keys. Use the organization settings in the dashboard, which require step-up verification. A valid management key for an organization with SCIM access receives 403; an invalid key still receives 401 and an organization without SCIM access receives 404.' operationId: 'createScimSyncJob' responses: '202': @@ -59287,7 +59305,7 @@ paths: application/json: schema: $ref: '#/components/schemas/CreateScimSyncJobResponse' - description: 'SCIM directory sync job queued' + description: 'SCIM directory sync job queued. Not returned: this operation is disabled. The schema is kept for SDK compatibility.' headers: Location: description: 'Poll URL for the created sync job.' @@ -59311,10 +59329,10 @@ paths: example: error: code: 403 - message: 'Only management keys can perform this operation' + message: 'Management keys cannot change SCIM group mappings or start syncs. Use the organization settings in the dashboard.' schema: $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' + description: 'Forbidden - SCIM writes are dashboard-only' '404': content: application/json: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index da7e4a7bb..c4eba1176 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:0e8fc65b5edd30387f64d4f89b3b749769b1e1a6c469a027e4749dba278261e2 - sourceBlobDigest: sha256:7f0db687134bc4af9b4691ef2f86e70c436f8ffda7a420e9e9e0d248888a76d5 + sourceRevisionDigest: sha256:0019b75a637881369f36b45f666e0fc45a1e7f0ee9ecf23d552a4607c52805c9 + sourceBlobDigest: sha256:bfe1f21785f5e82dac1a07e9cc63a088f7a6d38fa3b1d67810dcf0bc320f10e3 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:0e8fc65b5edd30387f64d4f89b3b749769b1e1a6c469a027e4749dba278261e2 - sourceBlobDigest: sha256:7f0db687134bc4af9b4691ef2f86e70c436f8ffda7a420e9e9e0d248888a76d5 + sourceRevisionDigest: sha256:0019b75a637881369f36b45f666e0fc45a1e7f0ee9ecf23d552a4607c52805c9 + sourceBlobDigest: sha256:bfe1f21785f5e82dac1a07e9cc63a088f7a6d38fa3b1d67810dcf0bc320f10e3 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:7c253f4501836d372987b5968da43deb82cb26eb08d44a4c31cd242e254fda34 + codeSamplesRevisionDigest: sha256:fcdb80bc7b3d3729505a4b54415d9eb3c2e34ac3d8689aebc29722571dab728e workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.803.2 diff --git a/RELEASES.md b/RELEASES.md index 023c59d2f..f97c6c194 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -4679,4 +4679,14 @@ Based on: ### Generated - [python v1.3.191] . ### Releases -- [PyPI v1.3.191] https://pypi.org/project/openrouter/1.3.191 - . \ No newline at end of file +- [PyPI v1.3.191] https://pypi.org/project/openrouter/1.3.191 - . + +## 2026-11-19 04:13:24 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.192] . +### Releases +- [PyPI v1.3.192] https://pypi.org/project/openrouter/1.3.192 - . \ No newline at end of file diff --git a/docs/components/createworkspacerequest.mdx b/docs/components/createworkspacerequest.mdx index de3364616..9628ac78e 100644 --- a/docs/components/createworkspacerequest.mdx +++ b/docs/components/createworkspacerequest.mdx @@ -4,17 +4,17 @@ title: "CreateWorkspaceRequest" ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `default_image_model` | *OptionalNullable[str]* | ➖ | Default image model for this workspace | openai/dall-e-3 | -| `default_provider_sort` | *OptionalNullable[str]* | ➖ | Default provider sort preference (price, throughput, latency, exacto) | price | -| `default_text_model` | *OptionalNullable[str]* | ➖ | Default text model for this workspace | openai/gpt-4o | -| `description` | *OptionalNullable[str]* | ➖ | Description of the workspace | Production environment workspace | -| `disabled_server_tools` | List[[components.CreateWorkspaceRequestDisabledServerTool](../components/createworkspacerequestdisabledservertool.mdx)] | ➖ | OpenRouter server tools that requests in this workspace may not invoke. Requests naming a disabled tool are rejected with 403. An empty array or null clears the list. | [
"openrouter:web_search",
"openrouter:bash"
] | -| `io_logging_api_key_ids` | List[*int*] | ➖ | Optional array of API key IDs to filter I/O logging | null | -| `io_logging_sampling_rate` | *Optional[float]* | ➖ | Sampling rate for I/O logging (0.0001-1) | 1 | -| `is_data_discount_logging_enabled` | *Optional[bool]* | ➖ | Whether data discount logging is enabled. Enabling it requires the account to allow workspace data-discount logging; otherwise the request returns 403. | true | -| `is_observability_broadcast_enabled` | *Optional[bool]* | ➖ | Whether broadcast is enabled | false | -| `is_observability_io_logging_enabled` | *Optional[bool]* | ➖ | Whether private logging is enabled | false | -| `name` | *str* | ✔️ | Name for the new workspace | Production | -| `slug` | *str* | ✔️ | URL-friendly slug (lowercase alphanumeric segments separated by single hyphens, no leading/trailing hyphens) | production | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `default_image_model` | *OptionalNullable[str]* | ➖ | Default image model for this workspace | openai/dall-e-3 | +| `default_provider_sort` | *OptionalNullable[str]* | ➖ | Default provider sort preference (price, throughput, latency, exacto) | price | +| `default_text_model` | *OptionalNullable[str]* | ➖ | Default text model for this workspace | openai/gpt-4o | +| `description` | *OptionalNullable[str]* | ➖ | Description of the workspace | Production environment workspace | +| `disabled_server_tools` | List[[components.CreateWorkspaceRequestDisabledServerTool](../components/createworkspacerequestdisabledservertool.mdx)] | ➖ | OpenRouter server tools that requests in this workspace may not invoke. Requests naming a disabled tool are rejected with 403. An empty array or null clears the list. | [
"openrouter:web_search",
"openrouter:bash"
] | +| `io_logging_api_key_ids` | List[*int*] | ➖ | Optional array of API key IDs to filter I/O logging. Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard. | null | +| `io_logging_sampling_rate` | *Optional[float]* | ➖ | Sampling rate for I/O logging (0.0001-1). Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard. | 1 | +| `is_data_discount_logging_enabled` | *Optional[bool]* | ➖ | Whether data discount logging is enabled. Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard. | false | +| `is_observability_broadcast_enabled` | *Optional[bool]* | ➖ | Whether broadcast is enabled | false | +| `is_observability_io_logging_enabled` | *Optional[bool]* | ➖ | Whether private logging is enabled. Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard. | false | +| `name` | *str* | ✔️ | Name for the new workspace | Production | +| `slug` | *str* | ✔️ | URL-friendly slug (lowercase alphanumeric segments separated by single hyphens, no leading/trailing hyphens) | production | \ No newline at end of file diff --git a/docs/components/imagegenerationrequest.mdx b/docs/components/imagegenerationrequest.mdx index 2800926d2..db92a380f 100644 --- a/docs/components/imagegenerationrequest.mdx +++ b/docs/components/imagegenerationrequest.mdx @@ -23,6 +23,7 @@ Image generation request input | `provider` | [Optional[components.ImageGenerationProviderPreferences]](../components/imagegenerationproviderpreferences.mdx) | ➖ | Provider routing preferences and provider-specific passthrough configuration. | \{
"allow_fallbacks": false,
"only": [
"google-ai-studio"
]
} | | `quality` | [Optional[components.ImageGenerationRequestQuality]](../components/imagegenerationrequestquality.mdx) | ➖ | Rendering quality. Providers without a quality knob ignore this. | high | | `resolution` | [Optional[components.ImageGenerationRequestResolution]](../components/imagegenerationrequestresolution.mdx) | ➖ | Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. | 2K | +| `response_format` | [Optional[components.ImageGenerationRequestResponseFormat]](../components/imagegenerationrequestresponseformat.mdx) | ➖ | `b64_json` (default) returns the image bytes inline. `url` stores each output in OpenRouter storage and returns a signed download URL in place of the bytes. The URL is a bearer link: anyone holding it can download the image until it expires, up to 24 hours after the image was stored (use `expires_at`); the stored copy is deleted by the storage lifecycle within the following day. The response falls back to `b64_json` when a URL cannot be issued: streaming responses, zero-data-retention requests (account settings, guardrails or `provider.zdr`) or endpoints, or storage being unavailable. | b64_json | | `seed` | *Optional[int]* | ➖ | If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. | | | `session_id` | *Optional[str]* | ➖ | A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. | session-1234 | | `size` | *Optional[str]* | ➖ | Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`. | 2K | diff --git a/docs/components/imagegenerationrequestresponseformat.mdx b/docs/components/imagegenerationrequestresponseformat.mdx new file mode 100644 index 000000000..b39856904 --- /dev/null +++ b/docs/components/imagegenerationrequestresponseformat.mdx @@ -0,0 +1,22 @@ +--- +title: "ImageGenerationRequestResponseFormat" +--- + +`b64_json` (default) returns the image bytes inline. `url` stores each output in OpenRouter storage and returns a signed download URL in place of the bytes. The URL is a bearer link: anyone holding it can download the image until it expires, up to 24 hours after the image was stored (use `expires_at`); the stored copy is deleted by the storage lifecycle within the following day. The response falls back to `b64_json` when a URL cannot be issued: streaming responses, zero-data-retention requests (account settings, guardrails or `provider.zdr`) or endpoints, or storage being unavailable. + +## Example Usage + +```python +from openrouter.components import ImageGenerationRequestResponseFormat + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: ImageGenerationRequestResponseFormat = "b64_json" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"b64_json"` +- `"url"` diff --git a/docs/components/imagegenerationresponse.mdx b/docs/components/imagegenerationresponse.mdx index 82ea0ef2f..27aa4d05f 100644 --- a/docs/components/imagegenerationresponse.mdx +++ b/docs/components/imagegenerationresponse.mdx @@ -7,8 +7,9 @@ Image generation response ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `created` | *int* | ✔️ | Unix timestamp (seconds) when the image was generated | 1748372400 | -| `data` | List[[components.ImageGenerationResponseData](../components/imagegenerationresponsedata.mdx)] | ✔️ | Generated images | | -| `usage` | [Optional[components.ImageGenerationUsage]](../components/imagegenerationusage.mdx) | ➖ | Token and cost usage for the image generation request, when available | \{
"completion_tokens": 4175,
"cost": 0.04,
"prompt_tokens": 0,
"total_tokens": 4175
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| `created` | *int* | ✔️ | Unix timestamp (seconds) when the image was generated | 1748372400 | +| `data` | List[[components.ImageGenerationResponseData](../components/imagegenerationresponsedata.mdx)] | ✔️ | Generated images | | +| `expires_at` | *Optional[int]* | ➖ | Unix timestamp (seconds) of the earliest expiry among the `url`s in `data`; treat every URL as expired after it. Present only when URLs were issued. | 1748458800 | +| `usage` | [Optional[components.ImageGenerationUsage]](../components/imagegenerationusage.mdx) | ➖ | Token and cost usage for the image generation request, when available | \{
"completion_tokens": 4175,
"cost": 0.04,
"prompt_tokens": 0,
"total_tokens": 4175
} | \ No newline at end of file diff --git a/docs/components/imagegenerationresponsedata.mdx b/docs/components/imagegenerationresponsedata.mdx index 3b470b255..7382ece52 100644 --- a/docs/components/imagegenerationresponsedata.mdx +++ b/docs/components/imagegenerationresponsedata.mdx @@ -6,6 +6,7 @@ title: "ImageGenerationResponseData" | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `b64_json` | *str* | ✔️ | Base64-encoded image bytes | | +| `b64_json` | *Optional[str]* | ➖ | Base64-encoded image bytes. Present unless the request asked for `response_format: "url"` and `url` was issued. | | | `layer` | [Optional[components.ImageGenerationLayer]](../components/imagegenerationlayer.mdx) | ➖ | Layer metadata, present when the request asked the provider to split the image into layers (Seedream: `provider.options.seed.layer_decomposition: true` with the required `layer_decomposition_options.max_images`, 2 to 16). Decomposition requires `n` to be 1 or omitted; the response returns up to `max_images` images (the base image plus its layers). | \{
"background": "transparent",
"bounding_box": \{
"absolute": [
238,
124,
786,
673
],
"normalized": [
232,
121,
768,
657
]
},
"description": "A solid red circle",
"name": "Red circle",
"z_index": 1
} | -| `media_type` | *Optional[str]* | ➖ | Media type (MIME type) of the image, e.g. `image/png`, `image/jpeg`, `image/webp`, `image/svg+xml`. May be omitted if the format could not be determined. | image/png | \ No newline at end of file +| `media_type` | *Optional[str]* | ➖ | Media type (MIME type) of the image, e.g. `image/png`, `image/jpeg`, `image/webp`, `image/svg+xml`. May be omitted if the format could not be determined. | image/png | +| `url` | *Optional[str]* | ➖ | Signed download URL for the image bytes, issued for `response_format: "url"` requests. Valid until `expires_at`. Absent when the response fell back to `b64_json`. | https://storage.googleapis.com/openrouter-generated-media-us/v1/... | \ No newline at end of file diff --git a/docs/components/updateworkspacerequest.mdx b/docs/components/updateworkspacerequest.mdx index ca9883c31..7b17a64e6 100644 --- a/docs/components/updateworkspacerequest.mdx +++ b/docs/components/updateworkspacerequest.mdx @@ -4,17 +4,17 @@ title: "UpdateWorkspaceRequest" ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `default_image_model` | *OptionalNullable[str]* | ➖ | Default image model for this workspace | openai/dall-e-3 | -| `default_provider_sort` | *OptionalNullable[str]* | ➖ | Default provider sort preference (price, throughput, latency, exacto) | price | -| `default_text_model` | *OptionalNullable[str]* | ➖ | Default text model for this workspace | openai/gpt-4o | -| `description` | *OptionalNullable[str]* | ➖ | New description for the workspace | Updated description | -| `disabled_server_tools` | List[[components.UpdateWorkspaceRequestDisabledServerTool](../components/updateworkspacerequestdisabledservertool.mdx)] | ➖ | OpenRouter server tools that requests in this workspace may not invoke. Requests naming a disabled tool are rejected with 403. An empty array or null clears the list. | [
"openrouter:web_search",
"openrouter:bash"
] | -| `io_logging_api_key_ids` | List[*int*] | ➖ | Optional array of API key IDs to filter I/O logging | null | -| `io_logging_sampling_rate` | *Optional[float]* | ➖ | Sampling rate for I/O logging (0.0001-1) | 1 | -| `is_data_discount_logging_enabled` | *Optional[bool]* | ➖ | Whether data discount logging is enabled. Enabling it requires the account to allow workspace data-discount logging; otherwise the request returns 403. | true | -| `is_observability_broadcast_enabled` | *Optional[bool]* | ➖ | Whether broadcast is enabled | false | -| `is_observability_io_logging_enabled` | *Optional[bool]* | ➖ | Whether private logging is enabled | false | -| `name` | *Optional[str]* | ➖ | New name for the workspace | Updated Workspace | -| `slug` | *Optional[str]* | ➖ | New URL-friendly slug (lowercase alphanumeric segments separated by single hyphens, no leading/trailing hyphens) | updated-workspace | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `default_image_model` | *OptionalNullable[str]* | ➖ | Default image model for this workspace | openai/dall-e-3 | +| `default_provider_sort` | *OptionalNullable[str]* | ➖ | Default provider sort preference (price, throughput, latency, exacto) | price | +| `default_text_model` | *OptionalNullable[str]* | ➖ | Default text model for this workspace | openai/gpt-4o | +| `description` | *OptionalNullable[str]* | ➖ | New description for the workspace | Updated description | +| `disabled_server_tools` | List[[components.UpdateWorkspaceRequestDisabledServerTool](../components/updateworkspacerequestdisabledservertool.mdx)] | ➖ | OpenRouter server tools that requests in this workspace may not invoke. Requests naming a disabled tool are rejected with 403. An empty array or null clears the list. | [
"openrouter:web_search",
"openrouter:bash"
] | +| `io_logging_api_key_ids` | List[*int*] | ➖ | Optional array of API key IDs to filter I/O logging. Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard. | null | +| `io_logging_sampling_rate` | *Optional[float]* | ➖ | Sampling rate for I/O logging (0.0001-1). Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard. | 1 | +| `is_data_discount_logging_enabled` | *Optional[bool]* | ➖ | Whether data discount logging is enabled. Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard. | false | +| `is_observability_broadcast_enabled` | *Optional[bool]* | ➖ | Whether broadcast is enabled | false | +| `is_observability_io_logging_enabled` | *Optional[bool]* | ➖ | Whether private logging is enabled. Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard. | false | +| `name` | *Optional[str]* | ➖ | New name for the workspace | Updated Workspace | +| `slug` | *Optional[str]* | ➖ | New URL-friendly slug (lowercase alphanumeric segments separated by single hyphens, no leading/trailing hyphens) | updated-workspace | \ No newline at end of file diff --git a/docs/sdks/images/README.mdx b/docs/sdks/images/README.mdx index d45846d45..931e40f77 100644 --- a/docs/sdks/images/README.mdx +++ b/docs/sdks/images/README.mdx @@ -61,6 +61,7 @@ with OpenRouter( | `provider` | [Optional[components.ImageGenerationProviderPreferences]](../../components/imagegenerationproviderpreferences.mdx) | ➖ | Provider routing preferences and provider-specific passthrough configuration. | \{
"allow_fallbacks": false,
"only": [
"google-ai-studio"
]
} | | `quality` | [Optional[components.ImageGenerationRequestQuality]](../../components/imagegenerationrequestquality.mdx) | ➖ | Rendering quality. Providers without a quality knob ignore this. | high | | `resolution` | [Optional[components.ImageGenerationRequestResolution]](../../components/imagegenerationrequestresolution.mdx) | ➖ | Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. | 2K | +| `response_format` | [Optional[components.ImageGenerationRequestResponseFormat]](../../components/imagegenerationrequestresponseformat.mdx) | ➖ | `b64_json` (default) returns the image bytes inline. `url` stores each output in OpenRouter storage and returns a signed download URL in place of the bytes. The URL is a bearer link: anyone holding it can download the image until it expires, up to 24 hours after the image was stored (use `expires_at`); the stored copy is deleted by the storage lifecycle within the following day. The response falls back to `b64_json` when a URL cannot be issued: streaming responses, zero-data-retention requests (account settings, guardrails or `provider.zdr`) or endpoints, or storage being unavailable. | b64_json | | `seed` | *Optional[int]* | ➖ | If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. | | | `session_id` | *Optional[str]* | ➖ | A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. | session-1234 | | `size` | *Optional[str]* | ➖ | Optional. A convenience shorthand for output dimensions — pass a tier ("2K", "4K") or explicit pixels ("2048x2048"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`. | 2K | diff --git a/docs/sdks/scim/README.mdx b/docs/sdks/scim/README.mdx index 53a88c2bf..6b829448e 100644 --- a/docs/sdks/scim/README.mdx +++ b/docs/sdks/scim/README.mdx @@ -10,12 +10,12 @@ Management endpoints for SCIM group-to-workspace mappings, authenticated with a ### Available Operations * [list_mappings](#list_mappings) - List SCIM group mappings -* [create](#create) - Create a SCIM group mapping -* [delete](#delete) - Delete a SCIM group mapping +* [~~create~~](#create) - Create a SCIM group mapping ⚠️ **Deprecated** +* [~~delete~~](#delete) - Delete a SCIM group mapping ⚠️ **Deprecated** * [read](#read) - Get a SCIM group mapping -* [update](#update) - Update a SCIM group mapping +* [~~update~~](#update) - Update a SCIM group mapping ⚠️ **Deprecated** * [list_groups](#list_groups) - List SCIM groups -* [create_sync_job](#create_sync_job) - Start a SCIM directory sync +* [~~create_sync_job~~](#create_sync_job) - Start a SCIM directory sync ⚠️ **Deprecated** * [get_sync_job](#get_sync_job) - Get SCIM directory sync status ## list_mappings @@ -70,9 +70,11 @@ with OpenRouter( | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | -## create +## ~~create~~ -Create a SCIM group-to-workspace role mapping. Creating a mapping that already exists with the same role succeeds and re-applies the mapping to the group members. Requesting a different role for an existing mapping returns 409. [Management key](/docs/guides/overview/auth/management-api-keys) required. +Create a SCIM group-to-workspace role mapping. Disabled: no API key can perform this write, including management keys. Use the organization settings in the dashboard, which require step-up verification. A valid management key for an organization with SCIM access receives 403; an invalid key still receives 401 and an organization without SCIM access receives 404. + +> ⚠️ **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. ### Example Usage @@ -123,9 +125,11 @@ with OpenRouter( | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | -## delete +## ~~delete~~ + +Delete a SCIM group-to-workspace mapping. Disabled: no API key can perform this write, including management keys. Use the organization settings in the dashboard, which require step-up verification. A valid management key for an organization with SCIM access receives 403; an invalid key still receives 401 and an organization without SCIM access receives 404. -Delete a SCIM group-to-workspace mapping. [Management key](/docs/guides/overview/auth/management-api-keys) required. +> ⚠️ **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. ### Example Usage @@ -223,9 +227,11 @@ with OpenRouter( | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | -## update +## ~~update~~ -Update a SCIM group mapping role. [Management key](/docs/guides/overview/auth/management-api-keys) required. +Update a SCIM group mapping role. Disabled: no API key can perform this write, including management keys. Use the organization settings in the dashboard, which require step-up verification. A valid management key for an organization with SCIM access receives 403; an invalid key still receives 401 and an organization without SCIM access receives 404. + +> ⚠️ **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. ### Example Usage @@ -328,9 +334,11 @@ with OpenRouter( | errors.InternalServerResponseError | 500 | application/json | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | -## create_sync_job +## ~~create_sync_job~~ + +Start a SCIM directory sync. Disabled: no API key can perform this write, including management keys. Use the organization settings in the dashboard, which require step-up verification. A valid management key for an organization with SCIM access receives 403; an invalid key still receives 401 and an organization without SCIM access receives 404. -Start a SCIM directory sync. [Management key](/docs/guides/overview/auth/management-api-keys) required. +> ⚠️ **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. ### Example Usage diff --git a/docs/sdks/workspaces/README.mdx b/docs/sdks/workspaces/README.mdx index 2a9dd0041..ca8360ed6 100644 --- a/docs/sdks/workspaces/README.mdx +++ b/docs/sdks/workspaces/README.mdx @@ -100,24 +100,24 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | *str* | ✔️ | Name for the new workspace | Production | -| `slug` | *str* | ✔️ | URL-friendly slug (lowercase alphanumeric segments separated by single hyphens, no leading/trailing hyphens) | production | -| `http_referer` | *Optional[str]* | ➖ | 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]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `default_image_model` | *OptionalNullable[str]* | ➖ | Default image model for this workspace | openai/dall-e-3 | -| `default_provider_sort` | *OptionalNullable[str]* | ➖ | Default provider sort preference (price, throughput, latency, exacto) | price | -| `default_text_model` | *OptionalNullable[str]* | ➖ | Default text model for this workspace | openai/gpt-4o | -| `description` | *OptionalNullable[str]* | ➖ | Description of the workspace | Production environment workspace | -| `disabled_server_tools` | List[[components.CreateWorkspaceRequestDisabledServerTool](../../components/createworkspacerequestdisabledservertool.mdx)] | ➖ | OpenRouter server tools that requests in this workspace may not invoke. Requests naming a disabled tool are rejected with 403. An empty array or null clears the list. | [
"openrouter:web_search",
"openrouter:bash"
] | -| `io_logging_api_key_ids` | List[*int*] | ➖ | Optional array of API key IDs to filter I/O logging | null | -| `io_logging_sampling_rate` | *Optional[float]* | ➖ | Sampling rate for I/O logging (0.0001-1) | 1 | -| `is_data_discount_logging_enabled` | *Optional[bool]* | ➖ | Whether data discount logging is enabled. Enabling it requires the account to allow workspace data-discount logging; otherwise the request returns 403. | true | -| `is_observability_broadcast_enabled` | *Optional[bool]* | ➖ | Whether broadcast is enabled | false | -| `is_observability_io_logging_enabled` | *Optional[bool]* | ➖ | Whether private logging is enabled | false | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `name` | *str* | ✔️ | Name for the new workspace | Production | +| `slug` | *str* | ✔️ | URL-friendly slug (lowercase alphanumeric segments separated by single hyphens, no leading/trailing hyphens) | production | +| `http_referer` | *Optional[str]* | ➖ | 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]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `default_image_model` | *OptionalNullable[str]* | ➖ | Default image model for this workspace | openai/dall-e-3 | +| `default_provider_sort` | *OptionalNullable[str]* | ➖ | Default provider sort preference (price, throughput, latency, exacto) | price | +| `default_text_model` | *OptionalNullable[str]* | ➖ | Default text model for this workspace | openai/gpt-4o | +| `description` | *OptionalNullable[str]* | ➖ | Description of the workspace | Production environment workspace | +| `disabled_server_tools` | List[[components.CreateWorkspaceRequestDisabledServerTool](../../components/createworkspacerequestdisabledservertool.mdx)] | ➖ | OpenRouter server tools that requests in this workspace may not invoke. Requests naming a disabled tool are rejected with 403. An empty array or null clears the list. | [
"openrouter:web_search",
"openrouter:bash"
] | +| `io_logging_api_key_ids` | List[*int*] | ➖ | Optional array of API key IDs to filter I/O logging. Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard. | null | +| `io_logging_sampling_rate` | *Optional[float]* | ➖ | Sampling rate for I/O logging (0.0001-1). Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard. | 1 | +| `is_data_discount_logging_enabled` | *Optional[bool]* | ➖ | Whether data discount logging is enabled. Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard. | false | +| `is_observability_broadcast_enabled` | *Optional[bool]* | ➖ | Whether broadcast is enabled | false | +| `is_observability_io_logging_enabled` | *Optional[bool]* | ➖ | Whether private logging is enabled. Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard. | false | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | ### Response @@ -260,25 +260,25 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | ✔️ | The workspace ID (UUID) or slug | production | -| `http_referer` | *Optional[str]* | ➖ | 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]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `default_image_model` | *OptionalNullable[str]* | ➖ | Default image model for this workspace | openai/dall-e-3 | -| `default_provider_sort` | *OptionalNullable[str]* | ➖ | Default provider sort preference (price, throughput, latency, exacto) | price | -| `default_text_model` | *OptionalNullable[str]* | ➖ | Default text model for this workspace | openai/gpt-4o | -| `description` | *OptionalNullable[str]* | ➖ | New description for the workspace | Updated description | -| `disabled_server_tools` | List[[components.UpdateWorkspaceRequestDisabledServerTool](../../components/updateworkspacerequestdisabledservertool.mdx)] | ➖ | OpenRouter server tools that requests in this workspace may not invoke. Requests naming a disabled tool are rejected with 403. An empty array or null clears the list. | [
"openrouter:web_search",
"openrouter:bash"
] | -| `io_logging_api_key_ids` | List[*int*] | ➖ | Optional array of API key IDs to filter I/O logging | null | -| `io_logging_sampling_rate` | *Optional[float]* | ➖ | Sampling rate for I/O logging (0.0001-1) | 1 | -| `is_data_discount_logging_enabled` | *Optional[bool]* | ➖ | Whether data discount logging is enabled. Enabling it requires the account to allow workspace data-discount logging; otherwise the request returns 403. | true | -| `is_observability_broadcast_enabled` | *Optional[bool]* | ➖ | Whether broadcast is enabled | false | -| `is_observability_io_logging_enabled` | *Optional[bool]* | ➖ | Whether private logging is enabled | false | -| `name` | *Optional[str]* | ➖ | New name for the workspace | Updated Workspace | -| `slug` | *Optional[str]* | ➖ | New URL-friendly slug (lowercase alphanumeric segments separated by single hyphens, no leading/trailing hyphens) | updated-workspace | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | ✔️ | The workspace ID (UUID) or slug | production | +| `http_referer` | *Optional[str]* | ➖ | 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]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | +| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | +| `default_image_model` | *OptionalNullable[str]* | ➖ | Default image model for this workspace | openai/dall-e-3 | +| `default_provider_sort` | *OptionalNullable[str]* | ➖ | Default provider sort preference (price, throughput, latency, exacto) | price | +| `default_text_model` | *OptionalNullable[str]* | ➖ | Default text model for this workspace | openai/gpt-4o | +| `description` | *OptionalNullable[str]* | ➖ | New description for the workspace | Updated description | +| `disabled_server_tools` | List[[components.UpdateWorkspaceRequestDisabledServerTool](../../components/updateworkspacerequestdisabledservertool.mdx)] | ➖ | OpenRouter server tools that requests in this workspace may not invoke. Requests naming a disabled tool are rejected with 403. An empty array or null clears the list. | [
"openrouter:web_search",
"openrouter:bash"
] | +| `io_logging_api_key_ids` | List[*int*] | ➖ | Optional array of API key IDs to filter I/O logging. Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard. | null | +| `io_logging_sampling_rate` | *Optional[float]* | ➖ | Sampling rate for I/O logging (0.0001-1). Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard. | 1 | +| `is_data_discount_logging_enabled` | *Optional[bool]* | ➖ | Whether data discount logging is enabled. Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard. | false | +| `is_observability_broadcast_enabled` | *Optional[bool]* | ➖ | Whether broadcast is enabled | false | +| `is_observability_io_logging_enabled` | *Optional[bool]* | ➖ | Whether private logging is enabled. Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard. | false | +| `name` | *Optional[str]* | ➖ | New name for the workspace | Updated Workspace | +| `slug` | *Optional[str]* | ➖ | New URL-friendly slug (lowercase alphanumeric segments separated by single hyphens, no leading/trailing hyphens) | updated-workspace | +| `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 98e4968a2..5ef9b9036 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.191" +version = "1.3.192" 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 e17a62276..1ffdf5e6f 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.191" +__version__: str = "1.3.192" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.950.13" -__user_agent__: str = "speakeasy-sdk/python 1.3.191 2.950.13 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.192 2.950.13 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/components/__init__.py b/src/openrouter/components/__init__.py index 63c91de66..a3ca8f5cb 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -2513,6 +2513,7 @@ ImageGenerationRequestOutputFormat, ImageGenerationRequestQuality, ImageGenerationRequestResolution, + ImageGenerationRequestResponseFormat, ImageGenerationRequestType, ImageGenerationRequestTypedDict, Markup, @@ -6887,6 +6888,7 @@ "ImageGenerationRequestOutputFormat", "ImageGenerationRequestQuality", "ImageGenerationRequestResolution", + "ImageGenerationRequestResponseFormat", "ImageGenerationRequestType", "ImageGenerationRequestTypedDict", "ImageGenerationResponse", @@ -10692,6 +10694,7 @@ "ImageGenerationRequestOutputFormat": ".imagegenerationrequest", "ImageGenerationRequestQuality": ".imagegenerationrequest", "ImageGenerationRequestResolution": ".imagegenerationrequest", + "ImageGenerationRequestResponseFormat": ".imagegenerationrequest", "ImageGenerationRequestType": ".imagegenerationrequest", "ImageGenerationRequestTypedDict": ".imagegenerationrequest", "Markup": ".imagegenerationrequest", diff --git a/src/openrouter/components/createworkspacerequest.py b/src/openrouter/components/createworkspacerequest.py index f4bccf4ce..886866347 100644 --- a/src/openrouter/components/createworkspacerequest.py +++ b/src/openrouter/components/createworkspacerequest.py @@ -52,15 +52,15 @@ class CreateWorkspaceRequestTypedDict(TypedDict): ] r"""OpenRouter server tools that requests in this workspace may not invoke. Requests naming a disabled tool are rejected with 403. An empty array or null clears the list.""" io_logging_api_key_ids: NotRequired[Nullable[List[int]]] - r"""Optional array of API key IDs to filter I/O logging""" + r"""Optional array of API key IDs to filter I/O logging. Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard.""" io_logging_sampling_rate: NotRequired[float] - r"""Sampling rate for I/O logging (0.0001-1)""" + r"""Sampling rate for I/O logging (0.0001-1). Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard.""" is_data_discount_logging_enabled: NotRequired[bool] - r"""Whether data discount logging is enabled. Enabling it requires the account to allow workspace data-discount logging; otherwise the request returns 403.""" + r"""Whether data discount logging is enabled. Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard.""" is_observability_broadcast_enabled: NotRequired[bool] r"""Whether broadcast is enabled""" is_observability_io_logging_enabled: NotRequired[bool] - r"""Whether private logging is enabled""" + r"""Whether private logging is enabled. Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard.""" class CreateWorkspaceRequest(BaseModel): @@ -88,19 +88,19 @@ class CreateWorkspaceRequest(BaseModel): r"""OpenRouter server tools that requests in this workspace may not invoke. Requests naming a disabled tool are rejected with 403. An empty array or null clears the list.""" io_logging_api_key_ids: OptionalNullable[List[int]] = UNSET - r"""Optional array of API key IDs to filter I/O logging""" + r"""Optional array of API key IDs to filter I/O logging. Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard.""" io_logging_sampling_rate: Optional[float] = None - r"""Sampling rate for I/O logging (0.0001-1)""" + r"""Sampling rate for I/O logging (0.0001-1). Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard.""" is_data_discount_logging_enabled: Optional[bool] = None - r"""Whether data discount logging is enabled. Enabling it requires the account to allow workspace data-discount logging; otherwise the request returns 403.""" + r"""Whether data discount logging is enabled. Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard.""" is_observability_broadcast_enabled: Optional[bool] = None r"""Whether broadcast is enabled""" is_observability_io_logging_enabled: Optional[bool] = None - r"""Whether private logging is enabled""" + r"""Whether private logging is enabled. Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/openrouter/components/imagegenerationrequest.py b/src/openrouter/components/imagegenerationrequest.py index 8457fb847..846c73106 100644 --- a/src/openrouter/components/imagegenerationrequest.py +++ b/src/openrouter/components/imagegenerationrequest.py @@ -127,6 +127,16 @@ class Markup(BaseModel): r"""Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.""" +ImageGenerationRequestResponseFormat = Union[ + Literal[ + "b64_json", + "url", + ], + UnrecognizedStr, +] +r"""`b64_json` (default) returns the image bytes inline. `url` stores each output in OpenRouter storage and returns a signed download URL in place of the bytes. The URL is a bearer link: anyone holding it can download the image until it expires, up to 24 hours after the image was stored (use `expires_at`); the stored copy is deleted by the storage lifecycle within the following day. The response falls back to `b64_json` when a URL cannot be issued: streaming responses, zero-data-retention requests (account settings, guardrails or `provider.zdr`) or endpoints, or storage being unavailable.""" + + class ImageGenerationRequestTypedDict(TypedDict): r"""Image generation request input""" @@ -158,6 +168,8 @@ class ImageGenerationRequestTypedDict(TypedDict): r"""Rendering quality. Providers without a quality knob ignore this.""" resolution: NotRequired[ImageGenerationRequestResolution] r"""Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.""" + response_format: NotRequired[ImageGenerationRequestResponseFormat] + r"""`b64_json` (default) returns the image bytes inline. `url` stores each output in OpenRouter storage and returns a signed download URL in place of the bytes. The URL is a bearer link: anyone holding it can download the image until it expires, up to 24 hours after the image was stored (use `expires_at`); the stored copy is deleted by the storage lifecycle within the following day. The response falls back to `b64_json` when a URL cannot be issued: streaming responses, zero-data-retention requests (account settings, guardrails or `provider.zdr`) or endpoints, or storage being unavailable.""" seed: NotRequired[int] r"""If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers.""" session_id: NotRequired[str] @@ -217,6 +229,9 @@ class ImageGenerationRequest(BaseModel): resolution: Optional[ImageGenerationRequestResolution] = None r"""Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider.""" + response_format: Optional[ImageGenerationRequestResponseFormat] = None + r"""`b64_json` (default) returns the image bytes inline. `url` stores each output in OpenRouter storage and returns a signed download URL in place of the bytes. The URL is a bearer link: anyone holding it can download the image until it expires, up to 24 hours after the image was stored (use `expires_at`); the stored copy is deleted by the storage lifecycle within the following day. The response falls back to `b64_json` when a URL cannot be issued: streaming responses, zero-data-retention requests (account settings, guardrails or `provider.zdr`) or endpoints, or storage being unavailable.""" + seed: Optional[int] = None r"""If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers.""" @@ -251,6 +266,7 @@ def serialize_model(self, handler): "provider", "quality", "resolution", + "response_format", "seed", "session_id", "size", diff --git a/src/openrouter/components/imagegenerationresponse.py b/src/openrouter/components/imagegenerationresponse.py index 3f2061536..c2dd55dca 100644 --- a/src/openrouter/components/imagegenerationresponse.py +++ b/src/openrouter/components/imagegenerationresponse.py @@ -10,17 +10,19 @@ class ImageGenerationResponseDataTypedDict(TypedDict): - b64_json: str - r"""Base64-encoded image bytes""" + b64_json: NotRequired[str] + r"""Base64-encoded image bytes. Present unless the request asked for `response_format: \"url\"` and `url` was issued.""" layer: NotRequired[ImageGenerationLayerTypedDict] r"""Layer metadata, present when the request asked the provider to split the image into layers (Seedream: `provider.options.seed.layer_decomposition: true` with the required `layer_decomposition_options.max_images`, 2 to 16). Decomposition requires `n` to be 1 or omitted; the response returns up to `max_images` images (the base image plus its layers).""" media_type: NotRequired[str] r"""Media type (MIME type) of the image, e.g. `image/png`, `image/jpeg`, `image/webp`, `image/svg+xml`. May be omitted if the format could not be determined.""" + url: NotRequired[str] + r"""Signed download URL for the image bytes, issued for `response_format: \"url\"` requests. Valid until `expires_at`. Absent when the response fell back to `b64_json`.""" class ImageGenerationResponseData(BaseModel): - b64_json: str - r"""Base64-encoded image bytes""" + b64_json: Optional[str] = None + r"""Base64-encoded image bytes. Present unless the request asked for `response_format: \"url\"` and `url` was issued.""" layer: Optional[ImageGenerationLayer] = None r"""Layer metadata, present when the request asked the provider to split the image into layers (Seedream: `provider.options.seed.layer_decomposition: true` with the required `layer_decomposition_options.max_images`, 2 to 16). Decomposition requires `n` to be 1 or omitted; the response returns up to `max_images` images (the base image plus its layers).""" @@ -28,9 +30,12 @@ class ImageGenerationResponseData(BaseModel): media_type: Optional[str] = None r"""Media type (MIME type) of the image, e.g. `image/png`, `image/jpeg`, `image/webp`, `image/svg+xml`. May be omitted if the format could not be determined.""" + url: Optional[str] = None + r"""Signed download URL for the image bytes, issued for `response_format: \"url\"` requests. Valid until `expires_at`. Absent when the response fell back to `b64_json`.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["layer", "media_type"]) + optional_fields = set(["b64_json", "layer", "media_type", "url"]) serialized = handler(self) m = {} @@ -52,6 +57,8 @@ class ImageGenerationResponseTypedDict(TypedDict): r"""Unix timestamp (seconds) when the image was generated""" data: List[ImageGenerationResponseDataTypedDict] r"""Generated images""" + expires_at: NotRequired[int] + r"""Unix timestamp (seconds) of the earliest expiry among the `url`s in `data`; treat every URL as expired after it. Present only when URLs were issued.""" usage: NotRequired[ImageGenerationUsageTypedDict] r"""Token and cost usage for the image generation request, when available""" @@ -65,12 +72,15 @@ class ImageGenerationResponse(BaseModel): data: List[ImageGenerationResponseData] r"""Generated images""" + expires_at: Optional[int] = None + r"""Unix timestamp (seconds) of the earliest expiry among the `url`s in `data`; treat every URL as expired after it. Present only when URLs were issued.""" + usage: Optional[ImageGenerationUsage] = None r"""Token and cost usage for the image generation request, when available""" @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["usage"]) + optional_fields = set(["expires_at", "usage"]) serialized = handler(self) m = {} diff --git a/src/openrouter/components/updateworkspacerequest.py b/src/openrouter/components/updateworkspacerequest.py index 3a9f3e0d6..f3a672362 100644 --- a/src/openrouter/components/updateworkspacerequest.py +++ b/src/openrouter/components/updateworkspacerequest.py @@ -48,15 +48,15 @@ class UpdateWorkspaceRequestTypedDict(TypedDict): ] r"""OpenRouter server tools that requests in this workspace may not invoke. Requests naming a disabled tool are rejected with 403. An empty array or null clears the list.""" io_logging_api_key_ids: NotRequired[Nullable[List[int]]] - r"""Optional array of API key IDs to filter I/O logging""" + r"""Optional array of API key IDs to filter I/O logging. Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard.""" io_logging_sampling_rate: NotRequired[float] - r"""Sampling rate for I/O logging (0.0001-1)""" + r"""Sampling rate for I/O logging (0.0001-1). Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard.""" is_data_discount_logging_enabled: NotRequired[bool] - r"""Whether data discount logging is enabled. Enabling it requires the account to allow workspace data-discount logging; otherwise the request returns 403.""" + r"""Whether data discount logging is enabled. Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard.""" is_observability_broadcast_enabled: NotRequired[bool] r"""Whether broadcast is enabled""" is_observability_io_logging_enabled: NotRequired[bool] - r"""Whether private logging is enabled""" + r"""Whether private logging is enabled. Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard.""" name: NotRequired[str] r"""New name for the workspace""" slug: NotRequired[str] @@ -82,19 +82,19 @@ class UpdateWorkspaceRequest(BaseModel): r"""OpenRouter server tools that requests in this workspace may not invoke. Requests naming a disabled tool are rejected with 403. An empty array or null clears the list.""" io_logging_api_key_ids: OptionalNullable[List[int]] = UNSET - r"""Optional array of API key IDs to filter I/O logging""" + r"""Optional array of API key IDs to filter I/O logging. Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard.""" io_logging_sampling_rate: Optional[float] = None - r"""Sampling rate for I/O logging (0.0001-1)""" + r"""Sampling rate for I/O logging (0.0001-1). Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard.""" is_data_discount_logging_enabled: Optional[bool] = None - r"""Whether data discount logging is enabled. Enabling it requires the account to allow workspace data-discount logging; otherwise the request returns 403.""" + r"""Whether data discount logging is enabled. Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard.""" is_observability_broadcast_enabled: Optional[bool] = None r"""Whether broadcast is enabled""" is_observability_io_logging_enabled: Optional[bool] = None - r"""Whether private logging is enabled""" + r"""Whether private logging is enabled. Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard.""" name: Optional[str] = None r"""New name for the workspace""" diff --git a/src/openrouter/images.py b/src/openrouter/images.py index 2edc66d82..a5056565f 100644 --- a/src/openrouter/images.py +++ b/src/openrouter/images.py @@ -43,6 +43,9 @@ def generate( ] = None, quality: Optional[components.ImageGenerationRequestQuality] = None, resolution: Optional[components.ImageGenerationRequestResolution] = None, + response_format: Optional[ + components.ImageGenerationRequestResponseFormat + ] = None, seed: Optional[int] = None, session_id: Optional[str] = None, size: Optional[str] = None, @@ -81,6 +84,7 @@ def generate( :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. + :param response_format: `b64_json` (default) returns the image bytes inline. `url` stores each output in OpenRouter storage and returns a signed download URL in place of the bytes. The URL is a bearer link: anyone holding it can download the image until it expires, up to 24 hours after the image was stored (use `expires_at`); the stored copy is deleted by the storage lifecycle within the following day. The response falls back to `b64_json` when a URL cannot be issued: streaming responses, zero-data-retention requests (account settings, guardrails or `provider.zdr`) or endpoints, or storage being unavailable. :param seed: If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`. @@ -124,6 +128,9 @@ def generate( ] = None, quality: Optional[components.ImageGenerationRequestQuality] = None, resolution: Optional[components.ImageGenerationRequestResolution] = None, + response_format: Optional[ + components.ImageGenerationRequestResponseFormat + ] = None, seed: Optional[int] = None, session_id: Optional[str] = None, size: Optional[str] = None, @@ -162,6 +169,7 @@ def generate( :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. + :param response_format: `b64_json` (default) returns the image bytes inline. `url` stores each output in OpenRouter storage and returns a signed download URL in place of the bytes. The URL is a bearer link: anyone holding it can download the image until it expires, up to 24 hours after the image was stored (use `expires_at`); the stored copy is deleted by the storage lifecycle within the following day. The response falls back to `b64_json` when a URL cannot be issued: streaming responses, zero-data-retention requests (account settings, guardrails or `provider.zdr`) or endpoints, or storage being unavailable. :param seed: If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`. @@ -205,6 +213,9 @@ def generate( ] = None, quality: Optional[components.ImageGenerationRequestQuality] = None, resolution: Optional[components.ImageGenerationRequestResolution] = None, + response_format: Optional[ + components.ImageGenerationRequestResponseFormat + ] = None, seed: Optional[int] = None, session_id: Optional[str] = None, size: Optional[str] = None, @@ -246,6 +257,7 @@ def generate( :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. + :param response_format: `b64_json` (default) returns the image bytes inline. `url` stores each output in OpenRouter storage and returns a signed download URL in place of the bytes. The URL is a bearer link: anyone holding it can download the image until it expires, up to 24 hours after the image was stored (use `expires_at`); the stored copy is deleted by the storage lifecycle within the following day. The response falls back to `b64_json` when a URL cannot be issued: streaming responses, zero-data-retention requests (account settings, guardrails or `provider.zdr`) or endpoints, or storage being unavailable. :param seed: If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`. @@ -288,6 +300,9 @@ def generate( ] = None, quality: Optional[components.ImageGenerationRequestQuality] = None, resolution: Optional[components.ImageGenerationRequestResolution] = None, + response_format: Optional[ + components.ImageGenerationRequestResponseFormat + ] = None, seed: Optional[int] = None, session_id: Optional[str] = None, size: Optional[str] = None, @@ -329,6 +344,7 @@ def generate( :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. + :param response_format: `b64_json` (default) returns the image bytes inline. `url` stores each output in OpenRouter storage and returns a signed download URL in place of the bytes. The URL is a bearer link: anyone holding it can download the image until it expires, up to 24 hours after the image was stored (use `expires_at`); the stored copy is deleted by the storage lifecycle within the following day. The response falls back to `b64_json` when a URL cannot be issued: streaming responses, zero-data-retention requests (account settings, guardrails or `provider.zdr`) or endpoints, or storage being unavailable. :param seed: If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`. @@ -373,6 +389,7 @@ def generate( ), quality=quality, resolution=resolution, + response_format=response_format, seed=seed, session_id=session_id, size=size, @@ -585,6 +602,9 @@ async def generate_async( ] = None, quality: Optional[components.ImageGenerationRequestQuality] = None, resolution: Optional[components.ImageGenerationRequestResolution] = None, + response_format: Optional[ + components.ImageGenerationRequestResponseFormat + ] = None, seed: Optional[int] = None, session_id: Optional[str] = None, size: Optional[str] = None, @@ -623,6 +643,7 @@ async def generate_async( :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. + :param response_format: `b64_json` (default) returns the image bytes inline. `url` stores each output in OpenRouter storage and returns a signed download URL in place of the bytes. The URL is a bearer link: anyone holding it can download the image until it expires, up to 24 hours after the image was stored (use `expires_at`); the stored copy is deleted by the storage lifecycle within the following day. The response falls back to `b64_json` when a URL cannot be issued: streaming responses, zero-data-retention requests (account settings, guardrails or `provider.zdr`) or endpoints, or storage being unavailable. :param seed: If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`. @@ -666,6 +687,9 @@ async def generate_async( ] = None, quality: Optional[components.ImageGenerationRequestQuality] = None, resolution: Optional[components.ImageGenerationRequestResolution] = None, + response_format: Optional[ + components.ImageGenerationRequestResponseFormat + ] = None, seed: Optional[int] = None, session_id: Optional[str] = None, size: Optional[str] = None, @@ -704,6 +728,7 @@ async def generate_async( :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. + :param response_format: `b64_json` (default) returns the image bytes inline. `url` stores each output in OpenRouter storage and returns a signed download URL in place of the bytes. The URL is a bearer link: anyone holding it can download the image until it expires, up to 24 hours after the image was stored (use `expires_at`); the stored copy is deleted by the storage lifecycle within the following day. The response falls back to `b64_json` when a URL cannot be issued: streaming responses, zero-data-retention requests (account settings, guardrails or `provider.zdr`) or endpoints, or storage being unavailable. :param seed: If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`. @@ -747,6 +772,9 @@ async def generate_async( ] = None, quality: Optional[components.ImageGenerationRequestQuality] = None, resolution: Optional[components.ImageGenerationRequestResolution] = None, + response_format: Optional[ + components.ImageGenerationRequestResponseFormat + ] = None, seed: Optional[int] = None, session_id: Optional[str] = None, size: Optional[str] = None, @@ -788,6 +816,7 @@ async def generate_async( :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. + :param response_format: `b64_json` (default) returns the image bytes inline. `url` stores each output in OpenRouter storage and returns a signed download URL in place of the bytes. The URL is a bearer link: anyone holding it can download the image until it expires, up to 24 hours after the image was stored (use `expires_at`); the stored copy is deleted by the storage lifecycle within the following day. The response falls back to `b64_json` when a URL cannot be issued: streaming responses, zero-data-retention requests (account settings, guardrails or `provider.zdr`) or endpoints, or storage being unavailable. :param seed: If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`. @@ -830,6 +859,9 @@ async def generate_async( ] = None, quality: Optional[components.ImageGenerationRequestQuality] = None, resolution: Optional[components.ImageGenerationRequestResolution] = None, + response_format: Optional[ + components.ImageGenerationRequestResponseFormat + ] = None, seed: Optional[int] = None, session_id: Optional[str] = None, size: Optional[str] = None, @@ -871,6 +903,7 @@ async def generate_async( :param provider: Provider routing preferences and provider-specific passthrough configuration. :param quality: Rendering quality. Providers without a quality knob ignore this. :param resolution: Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. + :param response_format: `b64_json` (default) returns the image bytes inline. `url` stores each output in OpenRouter storage and returns a signed download URL in place of the bytes. The URL is a bearer link: anyone holding it can download the image until it expires, up to 24 hours after the image was stored (use `expires_at`); the stored copy is deleted by the storage lifecycle within the following day. The response falls back to `b64_json` when a URL cannot be issued: streaming responses, zero-data-retention requests (account settings, guardrails or `provider.zdr`) or endpoints, or storage being unavailable. :param seed: If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. :param size: Optional. A convenience shorthand for output dimensions — pass a tier (\"2K\", \"4K\") or explicit pixels (\"2048x2048\"). A tier size is equivalent to setting `resolution` and combines with `aspect_ratio`. Explicit pixel sizes are provider-dependent: providers that accept them treat the value as authoritative and reject a mismatched `resolution` or `aspect_ratio` alongside it with a 400. xAI and Sourceful V2/V2.5 reject explicit pixel sizes (use `resolution` and `aspect_ratio` there); Sourceful V2.6 supports them within its dimension limits and does not allow combining them with `resolution` or `aspect_ratio`. @@ -915,6 +948,7 @@ async def generate_async( ), quality=quality, resolution=resolution, + response_format=response_format, seed=seed, session_id=session_id, size=size, diff --git a/src/openrouter/scim.py b/src/openrouter/scim.py index 6bc5fe5e6..3ad8fa3fc 100644 --- a/src/openrouter/scim.py +++ b/src/openrouter/scim.py @@ -8,6 +8,7 @@ from openrouter.utils import get_security_from_env from openrouter.utils.unmarshal_json_response import unmarshal_json_response from typing import Any, Awaitable, Dict, List, Mapping, Optional, Union +from typing_extensions import deprecated class Scim(BaseSDK): @@ -354,6 +355,9 @@ async def empty_result(): raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + @deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ) def create( self, *, @@ -370,7 +374,7 @@ def create( ) -> components.CreateScimGroupMappingResponse: r"""Create a SCIM group mapping - Create a SCIM group-to-workspace role mapping. Creating a mapping that already exists with the same role succeeds and re-applies the mapping to the group members. Requesting a different role for an existing mapping returns 409. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Create a SCIM group-to-workspace role mapping. Disabled: no API key can perform this write, including management keys. Use the organization settings in the dashboard, which require step-up verification. A valid management key for an organization with SCIM access receives 403; an invalid key still receives 401 and an organization without SCIM access receives 404. :param role: :param scim_group_id: @@ -514,6 +518,9 @@ def create( raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + @deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ) async def create_async( self, *, @@ -530,7 +537,7 @@ async def create_async( ) -> components.CreateScimGroupMappingResponse: r"""Create a SCIM group mapping - Create a SCIM group-to-workspace role mapping. Creating a mapping that already exists with the same role succeeds and re-applies the mapping to the group members. Requesting a different role for an existing mapping returns 409. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Create a SCIM group-to-workspace role mapping. Disabled: no API key can perform this write, including management keys. Use the organization settings in the dashboard, which require step-up verification. A valid management key for an organization with SCIM access receives 403; an invalid key still receives 401 and an organization without SCIM access receives 404. :param role: :param scim_group_id: @@ -674,6 +681,9 @@ async def create_async( raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + @deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ) def delete( self, *, @@ -689,7 +699,7 @@ def delete( ) -> components.DeleteScimGroupMappingResponse: r"""Delete a SCIM group mapping - Delete a SCIM group-to-workspace mapping. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Delete a SCIM group-to-workspace mapping. Disabled: no API key can perform this write, including management keys. Use the organization settings in the dashboard, which require step-up verification. A valid management key for an organization with SCIM access receives 403; an invalid key still receives 401 and an organization without SCIM access receives 404. :param id: :param keep_members: Required. Whether to keep workspace members after deleting the mapping. `false` **removes** the members this mapping granted access to; `true` deletes the mapping while leaving membership intact as manually-managed. There is deliberately no default — omitting it returns `400` so the destructive path cannot be reached by accident. Mirrors the dashboard, whose `DeleteMappingSchema.keepMembers` is likewise required. @@ -817,6 +827,9 @@ def delete( raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + @deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ) async def delete_async( self, *, @@ -832,7 +845,7 @@ async def delete_async( ) -> components.DeleteScimGroupMappingResponse: r"""Delete a SCIM group mapping - Delete a SCIM group-to-workspace mapping. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Delete a SCIM group-to-workspace mapping. Disabled: no API key can perform this write, including management keys. Use the organization settings in the dashboard, which require step-up verification. A valid management key for an organization with SCIM access receives 403; an invalid key still receives 401 and an organization without SCIM access receives 404. :param id: :param keep_members: Required. Whether to keep workspace members after deleting the mapping. `false` **removes** the members this mapping granted access to; `true` deletes the mapping while leaving membership intact as manually-managed. There is deliberately no default — omitting it returns `400` so the destructive path cannot be reached by accident. Mirrors the dashboard, whose `DeleteMappingSchema.keepMembers` is likewise required. @@ -1230,6 +1243,9 @@ async def read_async( raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + @deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ) def update( self, *, @@ -1245,7 +1261,7 @@ def update( ) -> components.UpdateScimGroupMappingResponse: r"""Update a SCIM group mapping - Update a SCIM group mapping role. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Update a SCIM group mapping role. Disabled: no API key can perform this write, including management keys. Use the organization settings in the dashboard, which require step-up verification. A valid management key for an organization with SCIM access receives 403; an invalid key still receives 401 and an organization without SCIM access receives 404. :param id: :param role: @@ -1382,6 +1398,9 @@ def update( raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + @deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ) async def update_async( self, *, @@ -1397,7 +1416,7 @@ async def update_async( ) -> components.UpdateScimGroupMappingResponse: r"""Update a SCIM group mapping - Update a SCIM group mapping role. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Update a SCIM group mapping role. Disabled: no API key can perform this write, including management keys. Use the organization settings in the dashboard, which require step-up verification. A valid management key for an organization with SCIM access receives 403; an invalid key still receives 401 and an organization without SCIM access receives 404. :param id: :param role: @@ -1889,6 +1908,9 @@ async def empty_result(): raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + @deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ) def create_sync_job( self, *, @@ -1902,7 +1924,7 @@ def create_sync_job( ) -> operations.CreateScimSyncJobResponse: r"""Start a SCIM directory sync - Start a SCIM directory sync. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Start a SCIM directory sync. Disabled: no API key can perform this write, including management keys. Use the organization settings in the dashboard, which require step-up verification. A valid management key for an organization with SCIM access receives 403; an invalid key still receives 401 and an organization without SCIM access receives 404. :param http_referer: 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. @@ -2024,6 +2046,9 @@ def create_sync_job( raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + @deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ) async def create_sync_job_async( self, *, @@ -2037,7 +2062,7 @@ async def create_sync_job_async( ) -> operations.CreateScimSyncJobResponse: r"""Start a SCIM directory sync - Start a SCIM directory sync. [Management key](/docs/guides/overview/auth/management-api-keys) required. + Start a SCIM directory sync. Disabled: no API key can perform this write, including management keys. Use the organization settings in the dashboard, which require step-up verification. A valid management key for an organization with SCIM access receives 403; an invalid key still receives 401 and an organization without SCIM access receives 404. :param http_referer: 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. diff --git a/src/openrouter/workspaces.py b/src/openrouter/workspaces.py index cbb3c4a40..b622e9316 100644 --- a/src/openrouter/workspaces.py +++ b/src/openrouter/workspaces.py @@ -385,11 +385,11 @@ def create( :param default_text_model: Default text model for this workspace :param description: Description of the workspace :param disabled_server_tools: OpenRouter server tools that requests in this workspace may not invoke. Requests naming a disabled tool are rejected with 403. An empty array or null clears the list. - :param io_logging_api_key_ids: Optional array of API key IDs to filter I/O logging - :param io_logging_sampling_rate: Sampling rate for I/O logging (0.0001-1) - :param is_data_discount_logging_enabled: Whether data discount logging is enabled. Enabling it requires the account to allow workspace data-discount logging; otherwise the request returns 403. + :param io_logging_api_key_ids: Optional array of API key IDs to filter I/O logging. Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard. + :param io_logging_sampling_rate: Sampling rate for I/O logging (0.0001-1). Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard. + :param is_data_discount_logging_enabled: Whether data discount logging is enabled. Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard. :param is_observability_broadcast_enabled: Whether broadcast is enabled - :param is_observability_io_logging_enabled: Whether private logging is enabled + :param is_observability_io_logging_enabled: Whether private logging is enabled. Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard. :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 @@ -569,11 +569,11 @@ async def create_async( :param default_text_model: Default text model for this workspace :param description: Description of the workspace :param disabled_server_tools: OpenRouter server tools that requests in this workspace may not invoke. Requests naming a disabled tool are rejected with 403. An empty array or null clears the list. - :param io_logging_api_key_ids: Optional array of API key IDs to filter I/O logging - :param io_logging_sampling_rate: Sampling rate for I/O logging (0.0001-1) - :param is_data_discount_logging_enabled: Whether data discount logging is enabled. Enabling it requires the account to allow workspace data-discount logging; otherwise the request returns 403. + :param io_logging_api_key_ids: Optional array of API key IDs to filter I/O logging. Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard. + :param io_logging_sampling_rate: Sampling rate for I/O logging (0.0001-1). Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard. + :param is_data_discount_logging_enabled: Whether data discount logging is enabled. Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard. :param is_observability_broadcast_enabled: Whether broadcast is enabled - :param is_observability_io_logging_enabled: Whether private logging is enabled + :param is_observability_io_logging_enabled: Whether private logging is enabled. Read-only for management keys: any value other than the default returns 403. Change it in the OpenRouter dashboard. :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 @@ -1301,11 +1301,11 @@ def update( :param default_text_model: Default text model for this workspace :param description: New description for the workspace :param disabled_server_tools: OpenRouter server tools that requests in this workspace may not invoke. Requests naming a disabled tool are rejected with 403. An empty array or null clears the list. - :param io_logging_api_key_ids: Optional array of API key IDs to filter I/O logging - :param io_logging_sampling_rate: Sampling rate for I/O logging (0.0001-1) - :param is_data_discount_logging_enabled: Whether data discount logging is enabled. Enabling it requires the account to allow workspace data-discount logging; otherwise the request returns 403. + :param io_logging_api_key_ids: Optional array of API key IDs to filter I/O logging. Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard. + :param io_logging_sampling_rate: Sampling rate for I/O logging (0.0001-1). Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard. + :param is_data_discount_logging_enabled: Whether data discount logging is enabled. Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard. :param is_observability_broadcast_enabled: Whether broadcast is enabled - :param is_observability_io_logging_enabled: Whether private logging is enabled + :param is_observability_io_logging_enabled: Whether private logging is enabled. Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard. :param name: New name for the workspace :param slug: New URL-friendly slug (lowercase alphanumeric segments separated by single hyphens, no leading/trailing hyphens) :param retries: Override the default retry configuration for this method @@ -1493,11 +1493,11 @@ async def update_async( :param default_text_model: Default text model for this workspace :param description: New description for the workspace :param disabled_server_tools: OpenRouter server tools that requests in this workspace may not invoke. Requests naming a disabled tool are rejected with 403. An empty array or null clears the list. - :param io_logging_api_key_ids: Optional array of API key IDs to filter I/O logging - :param io_logging_sampling_rate: Sampling rate for I/O logging (0.0001-1) - :param is_data_discount_logging_enabled: Whether data discount logging is enabled. Enabling it requires the account to allow workspace data-discount logging; otherwise the request returns 403. + :param io_logging_api_key_ids: Optional array of API key IDs to filter I/O logging. Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard. + :param io_logging_sampling_rate: Sampling rate for I/O logging (0.0001-1). Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard. + :param is_data_discount_logging_enabled: Whether data discount logging is enabled. Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard. :param is_observability_broadcast_enabled: Whether broadcast is enabled - :param is_observability_io_logging_enabled: Whether private logging is enabled + :param is_observability_io_logging_enabled: Whether private logging is enabled. Read-only for management keys: any value other than the stored one returns 403. Change it in the OpenRouter dashboard. :param name: New name for the workspace :param slug: New URL-friendly slug (lowercase alphanumeric segments separated by single hyphens, no leading/trailing hyphens) :param retries: Override the default retry configuration for this method diff --git a/uv.lock b/uv.lock index db590f394..8a80b291f 100644 --- a/uv.lock +++ b/uv.lock @@ -231,7 +231,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.191" +version = "1.3.192" source = { editable = "." } dependencies = [ { name = "httpcore" },