diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock
index dd9b826cb..58ac703ff 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: 1840154f84c770bcfaac5d64913c1fd6
+ docChecksum: 74a9498efb41dcdc19f8858f4658169d
docVersion: 1.0.0
speakeasyVersion: 1.787.0
generationVersion: 2.914.0
- releaseVersion: 1.3.45
- configChecksum: c29e3485096466a2dffee9816463f33b
+ releaseVersion: 1.3.46
+ configChecksum: 141159e444382b0c125fa2b6a8fd798c
repoURL: https://github.com/OpenRouterTeam/python-sdk.git
installationURL: https://github.com/OpenRouterTeam/python-sdk.git
published: true
persistentEdits:
- generation_id: 4a832f93-aec4-4832-bed6-d4ff565b7347
- pristine_commit_hash: afca828bee1b526d94a954bf47f188c9ef49c6ce
- pristine_tree_hash: a4c1825fca598c3582dc3009bbb4e05778824cc6
+ generation_id: 404c369a-769d-4cce-be8f-4439f1911bbb
+ pristine_commit_hash: e265fdf99a06176f920163b2163367a75c10684c
+ pristine_tree_hash: 9572ea873592996bd1755d1f82ffe15d96dc2593
features:
python:
acceptHeaders: 3.0.0
@@ -2508,8 +2508,8 @@ trackedFiles:
pristine_git_object: 9d28e4c7e863cf97b10b6415b1525aa8871800e2
docs/components/createguardrailrequest.mdx:
id: c1a768f054c0
- last_write_checksum: sha1:d32d712d132971b34f6d81d28ff45d22d919f4ac
- pristine_git_object: 3930d118781a8fbb7efdc3e347f99773828097ca
+ last_write_checksum: sha1:cea8928fa2aa97f9d157a6c0fbee5b6d8a8ce29e
+ pristine_git_object: fbc52a249c5fe348cc05e7597bfe3e0fe77d89b4
docs/components/createguardrailresponse.mdx:
id: 1477eebdf505
last_write_checksum: sha1:76bb1fcafda689e9823bb21541c84e7d0bdb991d
@@ -3432,8 +3432,8 @@ trackedFiles:
pristine_git_object: 6e17644dffb3aef799758f46d5ac781114b58c1f
docs/components/guardrail.mdx:
id: 91791d4c83b6
- last_write_checksum: sha1:6f8af0e14ef12e99132304a903cc2e68adff68a0
- pristine_git_object: 884c23302a2aa375a053e84bd702aa3b9e76595d
+ last_write_checksum: sha1:9b469e162e9f0e8cece5ff0d328ac0c70b66506a
+ pristine_git_object: 2f0f384b3ed628f4f4d15f4e3cc461f6808b0d58
docs/components/guardraildataregion.mdx:
id: d3be2a48aa20
last_write_checksum: sha1:81f1c0b515e1c1c13432cae9910ce77cb9991507
@@ -6892,8 +6892,8 @@ trackedFiles:
pristine_git_object: 5d617cac37f7b364f4dd0640246e97c34351d824
docs/components/speechinput.mdx:
id: 663248d32888
- last_write_checksum: sha1:a8126cfb9764e1cd97fd896dedc4f40f7ab441bb
- pristine_git_object: 948ee8455aede1f95245b7bfe33d04c293576edd
+ last_write_checksum: sha1:3ac2a504a301aedde4842c0a76ea324871c6b1af
+ pristine_git_object: 45150512fd74a6d8fa935b9867c4877b1f0d5916
docs/components/speechinputreference.mdx:
id: eb5af16936c7
last_write_checksum: sha1:ab545b03da2161ae1ad449714b6861cd55ae66df
@@ -6932,8 +6932,8 @@ trackedFiles:
pristine_git_object: 34f4f07fb3008df83646fa3d88ce04009274246a
docs/components/speechrequest.mdx:
id: 06e81b0433f6
- last_write_checksum: sha1:ecac6988ab27bf129f774f3982e36744ec613218
- pristine_git_object: c538a0061028cbaae17210def2258da7316b07e7
+ last_write_checksum: sha1:c2a048132db0ccec0c3b5b59ab52a78a49e83e29
+ pristine_git_object: e87bc0ab286848af07a53d51097ccdb5088ead6c
docs/components/speechrequestdatacollection.mdx:
id: 6c5938568888
last_write_checksum: sha1:89a08b4c4de66c1ef7676792a38747e030ed6729
@@ -7696,8 +7696,8 @@ trackedFiles:
pristine_git_object: 72a1c5ade4703a295e533f6e12733f464a21ff65
docs/components/updateguardrailrequest.mdx:
id: 450912b18db6
- last_write_checksum: sha1:f0e2aaf8ecb96d8b53a02768ec260472490963cd
- pristine_git_object: e42e435d516b5fb62183b7e0a65e20bdbcf25f1b
+ last_write_checksum: sha1:4f48f8b6eca22b5e1ea96814aa9a642655589755
+ pristine_git_object: dfd991a99fdac0b0076405d3ba2233d9ecf3cc52
docs/components/updateguardrailresponse.mdx:
id: e00dc0a0c6e0
last_write_checksum: sha1:1be70185072640936151f861913c2b89a09d4bab
@@ -10088,8 +10088,8 @@ trackedFiles:
pristine_git_object: bc1a56cbb41c8f9114c81b547713632272184da6
docs/sdks/guardrails/README.mdx:
id: a0cd4218b8fa
- last_write_checksum: sha1:5d726806705c8c06aa1df8ecbebfa04a0214d8d4
- pristine_git_object: d419fd3ee53c199c96b5228f7b656fa8e732bd69
+ last_write_checksum: sha1:a5ca6ada43eb3b8cdb6c29ed2c1be2a8663a5600
+ pristine_git_object: 6fbf9985e512ede6ae14dedcfa421c5b5338ef4f
docs/sdks/images/README.mdx:
id: 534a6c102c4f
last_write_checksum: sha1:82a8bd22fb399fe419076afe29b9234950baf9f9
@@ -10152,8 +10152,8 @@ trackedFiles:
pristine_git_object: 1dd30f0b898f2a842d1bb585b03d887be90e7845
docs/sdks/tts/README.mdx:
id: cd1132543884
- last_write_checksum: sha1:cb9303bf791d8d9784be2815fae45f4b09f82221
- pristine_git_object: b96e9d3ee1f40340dcd002a717920f7576b9fe3f
+ last_write_checksum: sha1:baa3374d9c06310a87893eb14a25511de061f3dc
+ pristine_git_object: 7b3c78a7323028a4668d6ce8394c8cdd4c15b67d
docs/sdks/vault/README.mdx:
id: 3738c6722acd
last_write_checksum: sha1:12acdfed4c2a32488d98b6091fd8c392af516494
@@ -10172,8 +10172,8 @@ trackedFiles:
pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544
pyproject.toml:
id: 5d07e7d72637
- last_write_checksum: sha1:bfc195206e429a0afdf9b31b204291cd59cf2e3b
- pristine_git_object: 89e32936fd2dfc18e5348ea54d2b3de267258e85
+ last_write_checksum: sha1:3a7148e3325f6ae7604aec17d8cf09b6871117a2
+ pristine_git_object: 951c4e488ab00fa2ca68fd1226f382e44e225576
scripts/prepare_readme.py:
id: e0c5957a6035
last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54
@@ -10200,8 +10200,8 @@ trackedFiles:
pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137
src/openrouter/_version.py:
id: d8d15ad6c586
- last_write_checksum: sha1:b192be1c2491a7fb42f7092a4a00748ba1f8a9f4
- pristine_git_object: d1c45a6fa71a7a62db5c7e2bb68df374a7f61565
+ last_write_checksum: sha1:4bf11cf5cf55b3b9a3928b6ccbebc1bfb4b3cf67
+ pristine_git_object: 8022b124ae2919285f485ab56f62a5268b751705
src/openrouter/alpha.py:
id: 306c4d93308d
last_write_checksum: sha1:30f55a360f41376ab194b9ea725fe4e001a5ae1a
@@ -11308,8 +11308,8 @@ trackedFiles:
pristine_git_object: be0ce3784071a98e96fe996eb9da24455af72ac8
src/openrouter/components/createguardrailrequest.py:
id: 34d69149fb33
- last_write_checksum: sha1:af6fca661fed3b42e547333b14750448c46b43cf
- pristine_git_object: d3cb25c2acff7aa00ad2cd966e5aaeb62d6e531c
+ last_write_checksum: sha1:68757e5b5d1f5f2a5ff07d8dc460032321e49b21
+ pristine_git_object: 77ce30da985f3a890aaadca0cefdf7492d011074
src/openrouter/components/createguardrailresponse.py:
id: b4e1bdf1de5b
last_write_checksum: sha1:ae20a5e7425510c240e5697d847b1cae65940bd6
@@ -11740,8 +11740,8 @@ trackedFiles:
pristine_git_object: 1268e32c9058ed4feb7482458a64366c56201676
src/openrouter/components/guardrail.py:
id: 67ee78dd06e6
- last_write_checksum: sha1:a06d7d1d1aa75b2e1c27cfa10cc5347a88821e76
- pristine_git_object: c58c4908937be5ceb0414666315782ebb862e331
+ last_write_checksum: sha1:062a4f1c5ad066e1da29856f5dce1b5ba60b0c3c
+ pristine_git_object: 60bef2177a15cc42ade160dca9b4933ecdce6ecb
src/openrouter/components/guardraildataregion.py:
id: 16c31f1446b2
last_write_checksum: sha1:52b5622a7c93a30219108f033ab0e3fbb3a396f7
@@ -13156,8 +13156,8 @@ trackedFiles:
pristine_git_object: e44305da959380e177fcc2077d0e80ce4d522a57
src/openrouter/components/speechinput.py:
id: 14e46bea4b32
- last_write_checksum: sha1:4f2acbfbb0b8df5d8d2d3916f9a081a6143fdf45
- pristine_git_object: 676f38928a4745ddb215cb8275c401e6fb5ebc25
+ last_write_checksum: sha1:c6e320441ce7eaa95072d8796e97f082302bb326
+ pristine_git_object: e85b5d8efbe123f41f4006b0e74ee5894da3fdc2
src/openrouter/components/speechinputreference.py:
id: 8e2b63f83354
last_write_checksum: sha1:b2ebc68fae64644f8bfca9b555ca7d2a7b46c9e1
@@ -13184,8 +13184,8 @@ trackedFiles:
pristine_git_object: 4633e5d7658c500aa903ce8caa8ef86cc97b78eb
src/openrouter/components/speechrequest.py:
id: 2a9400167112
- last_write_checksum: sha1:49cbabd40418cc50b15e7eef19926ce55be23a4e
- pristine_git_object: ad116652ee8ead569fb0939c29c6966bb397717e
+ last_write_checksum: sha1:5bfcf28dde5e94e671165f5919e24b3b9de83853
+ pristine_git_object: ea07e4017cdd9b909f84129e83c0582c7effe10a
src/openrouter/components/speechturn.py:
id: 121e0a940f91
last_write_checksum: sha1:31bdba00e027b81de8a3872d48e694475cf02e7a
@@ -13456,8 +13456,8 @@ trackedFiles:
pristine_git_object: 0a8dcb3fb8d9c0c80159a622246dff4a3110bb1b
src/openrouter/components/updateguardrailrequest.py:
id: 6a557cd822a0
- last_write_checksum: sha1:0e5978b49b7a37f48931dd778caf1fc46657b881
- pristine_git_object: 21afa8a30b9688294c7c210ed45e23ea17109241
+ last_write_checksum: sha1:0894e7041ba0f23258b1234428049f20c4ea3500
+ pristine_git_object: 17311e522a8109c9c9c99808f0701da0df389ce5
src/openrouter/components/updateguardrailresponse.py:
id: 7b068d26ce31
last_write_checksum: sha1:2b63cbb90747f07f775d9a22e80f74c67221fea8
@@ -13824,8 +13824,8 @@ trackedFiles:
pristine_git_object: 5698c384a36929846530cae98f69ce83a0966217
src/openrouter/guardrails.py:
id: 705839f34e66
- last_write_checksum: sha1:1551845b6a9776480d99ef0fc1fca61e845f3de2
- pristine_git_object: 785964ad30a2043c9d70272f15d1a3fac9635b73
+ last_write_checksum: sha1:4771ac29e1010c57efa8bf7ead0a4bcef18552e6
+ pristine_git_object: f615049517074fbcc71b755e351efda8411810aa
src/openrouter/httpclient.py:
id: e9311185443d
last_write_checksum: sha1:5e55338d6ee9f01ab648cad4380201a8a3da7dd7
@@ -14520,8 +14520,8 @@ trackedFiles:
pristine_git_object: 701fa8597ff85f41a60736ade55fcb32f9ec7125
src/openrouter/tts.py:
id: 5055d4b95f1d
- last_write_checksum: sha1:9826552c18767897c4dc6c3cd8c2ce41da40a344
- pristine_git_object: 5b1bf2a61bfd3d476284465192603aa7d90adfd7
+ last_write_checksum: sha1:93fae27a87035c17b86c6e5353754c371c9c3faa
+ pristine_git_object: 001335f1dc471131bca2c942ea98c67825c7921f
src/openrouter/types/__init__.py:
id: 5eab536205b7
last_write_checksum: sha1:f9ad14217f832e74f594285960125add50324be9
@@ -18576,4 +18576,4 @@ examples:
"500":
application/json: {"error": {"code": 404, "message": "Intern not found"}}
examplesVersion: 1.0.2
-releaseNotes: "## Python SDK Changes:\n* `open_router.observability.list()`: `response.data[]` **Changed**\n* `open_router.observability.create()`: \n * `request.broadcast_generation_cost_allocation` **Added**\n * `response.data` **Changed**\n* `open_router.observability.get()`: `response.data` **Changed**\n* `open_router.observability.update()`: \n * `request.broadcast_generation_cost_allocation` **Added**\n * `response.data` **Changed**\n"
+releaseNotes: "## Python SDK Changes:\n* `open_router.guardrails.list()`: `response.data[].allow_safety_retention_google` **Added**\n* `open_router.guardrails.create()`: \n * `request.allow_safety_retention_google` **Added**\n * `response.data.allow_safety_retention_google` **Added**\n* `open_router.guardrails.get()`: `response.data.allow_safety_retention_google` **Added**\n* `open_router.guardrails.update()`: \n * `request.allow_safety_retention_google` **Added**\n * `response.data.allow_safety_retention_google` **Added**\n"
diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml
index c102eb1c6..3e9a3f02d 100644
--- a/.speakeasy/gen.yaml
+++ b/.speakeasy/gen.yaml
@@ -36,7 +36,7 @@ generation:
documentation: mintlify
preApplyUnionDiscriminators: true
python:
- version: 1.3.45
+ version: 1.3.46
additionalDependencies:
dev: {}
main: {}
diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml
index e34363de2..e681d8535 100644
--- a/.speakeasy/out.openapi.yaml
+++ b/.speakeasy/out.openapi.yaml
@@ -9470,6 +9470,12 @@ components:
name: 'My New Guardrail'
reset_interval: 'monthly'
properties:
+ allow_safety_retention_google:
+ description: 'Whether ZDR-only requests to google/* models may use endpoints that may retain prompts for safety monitoring. false allows only zero-retention endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided.'
+ example: true
+ type:
+ - 'boolean'
+ - 'null'
allowed_data_regions:
description: 'Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected.'
example:
@@ -13147,6 +13153,12 @@ components:
updated_at: '2025-08-24T15:45:00Z'
workspace_id: '0df9e665-d932-5740-b2c7-b52af166bc11'
properties:
+ allow_safety_retention_google:
+ description: 'Whether ZDR-only requests to google/* models may use endpoints that may retain prompts for safety monitoring. false allows only zero-retention endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided.'
+ example: true
+ type:
+ - 'boolean'
+ - 'null'
allowed_data_regions:
description: 'Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value.'
example:
@@ -29393,7 +29405,7 @@ components:
$ref: '#/components/schemas/SpeechTurn'
minItems: 1
type: 'array'
- description: 'Text to synthesize, or a list of turns for multi-speaker input. Each turn has its own text, voice, and instructions. Multi-speaker input is currently supported by Gemini TTS models only.'
+ description: 'Text to synthesize, or a list of turns for multi-speaker input. Each turn has its own text, voice, and instructions. Multi-speaker input is supported by Gemini TTS models and by Fish Audio models other than S1.'
example: 'Hello world'
SpeechInputReference:
description: 'Reference content part for stateless voice cloning or voice design'
@@ -29515,7 +29527,7 @@ components:
$ref: '#/components/schemas/SpeechInputReference'
type: 'array'
instructions:
- description: 'Delivery instructions for the whole request, such as tone, pacing, or emotion. Supported by OpenAI gpt-4o-mini-tts and Gemini TTS models. Ignored by other providers.'
+ description: 'Delivery instructions for the whole request, such as tone, pacing, or emotion. Supported by OpenAI gpt-4o-mini-tts, Gemini TTS, and Fish Audio models. Ignored by other providers.'
example: 'Speak in a warm and friendly tone.'
type: 'string'
model:
@@ -32011,6 +32023,12 @@ components:
name: 'Updated Guardrail Name'
reset_interval: 'weekly'
properties:
+ allow_safety_retention_google:
+ description: 'Whether ZDR-only requests to google/* models may use endpoints that may retain prompts for safety monitoring. false allows only zero-retention endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided.'
+ example: false
+ type:
+ - 'boolean'
+ - 'null'
allowed_data_regions:
description: 'Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected.'
example:
diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock
index c517c0c0b..f67178e96 100644
--- a/.speakeasy/workflow.lock
+++ b/.speakeasy/workflow.lock
@@ -2,8 +2,8 @@ speakeasyVersion: 1.787.0
sources:
OpenRouter API:
sourceNamespace: open-router-chat-completions-api
- sourceRevisionDigest: sha256:83dd501cffdaf07564432a2f54ad8c9fcfb9263e1d1cc5303a2415a8aa507013
- sourceBlobDigest: sha256:e9cd324070275762af8716aad68250a323479419f57ce6ce70cd1d74f9a27fe7
+ sourceRevisionDigest: sha256:de5eab99c6123c08b364e967487823545df9a1fe5c2a2ce0678ebf4e116abca9
+ sourceBlobDigest: sha256:11101d2d34fa1e9d2006637fab5215e8cd2c9d0917bde662bd78a7b5a4c75c44
tags:
- latest
- 1.0.0
@@ -11,10 +11,10 @@ targets:
open-router:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
- sourceRevisionDigest: sha256:83dd501cffdaf07564432a2f54ad8c9fcfb9263e1d1cc5303a2415a8aa507013
- sourceBlobDigest: sha256:e9cd324070275762af8716aad68250a323479419f57ce6ce70cd1d74f9a27fe7
+ sourceRevisionDigest: sha256:de5eab99c6123c08b364e967487823545df9a1fe5c2a2ce0678ebf4e116abca9
+ sourceBlobDigest: sha256:11101d2d34fa1e9d2006637fab5215e8cd2c9d0917bde662bd78a7b5a4c75c44
codeSamplesNamespace: open-router-python-code-samples
- codeSamplesRevisionDigest: sha256:15e4f11f490017daa064d07e157162165ff717b9f2b1b07dbbaa2526b1d576db
+ codeSamplesRevisionDigest: sha256:4f0e18ce320b7957dfa9ed66a7d40776302827786ef1dc369ddfc5be3c406ab1
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.787.0
diff --git a/RELEASES.md b/RELEASES.md
index 41d836a59..e1fb7d743 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -3219,4 +3219,14 @@ Based on:
### Generated
- [python v1.3.45] .
### Releases
-- [PyPI v1.3.45] https://pypi.org/project/openrouter/1.3.45 - .
\ No newline at end of file
+- [PyPI v1.3.45] https://pypi.org/project/openrouter/1.3.45 - .
+
+## 2026-10-13 19:32:42
+### Changes
+Based on:
+- OpenAPI Doc
+- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy
+### Generated
+- [python v1.3.46] .
+### Releases
+- [PyPI v1.3.46] https://pypi.org/project/openrouter/1.3.46 - .
\ No newline at end of file
diff --git a/docs/components/createguardrailrequest.mdx b/docs/components/createguardrailrequest.mdx
index 7724e0e55..0929d3f1a 100644
--- a/docs/components/createguardrailrequest.mdx
+++ b/docs/components/createguardrailrequest.mdx
@@ -6,6 +6,7 @@ title: "CreateGuardrailRequest"
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `allow_safety_retention_google` | *OptionalNullable[bool]* | ➖ | Whether ZDR-only requests to google/* models may use endpoints that may retain prompts for safety monitoring. false allows only zero-retention endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided. | true |
| `allowed_data_regions` | List[[components.GuardrailDataRegion](../components/guardraildataregion.mdx)] | ➖ | Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected. | [
"europe"
] |
| `allowed_models` | List[*str*] | ➖ | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] |
| `allowed_providers` | List[*str*] | ➖ | List of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] |
diff --git a/docs/components/guardrail.mdx b/docs/components/guardrail.mdx
index 655cfc1f7..f28b661d4 100644
--- a/docs/components/guardrail.mdx
+++ b/docs/components/guardrail.mdx
@@ -6,6 +6,7 @@ title: "Guardrail"
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| `allow_safety_retention_google` | *OptionalNullable[bool]* | ➖ | Whether ZDR-only requests to google/* models may use endpoints that may retain prompts for safety monitoring. false allows only zero-retention endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided. | true |
| `allowed_data_regions` | List[[components.GuardrailDataRegion](../components/guardraildataregion.mdx)] | ➖ | Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. | [
"europe"
] |
| `allowed_models` | List[*str*] | ➖ | Array of model canonical_slugs (immutable identifiers) | [
"openai/gpt-5.2-20251211",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] |
| `allowed_providers` | List[*str*] | ➖ | List of allowed provider IDs | [
"openai",
"anthropic",
"google"
] |
diff --git a/docs/components/speechinput.mdx b/docs/components/speechinput.mdx
index 948ee8455..45150512f 100644
--- a/docs/components/speechinput.mdx
+++ b/docs/components/speechinput.mdx
@@ -2,7 +2,7 @@
title: "SpeechInput"
---
-Text to synthesize, or a list of turns for multi-speaker input. Each turn has its own text, voice, and instructions. Multi-speaker input is currently supported by Gemini TTS models only.
+Text to synthesize, or a list of turns for multi-speaker input. Each turn has its own text, voice, and instructions. Multi-speaker input is supported by Gemini TTS models and by Fish Audio models other than S1.
## Supported Types
diff --git a/docs/components/speechrequest.mdx b/docs/components/speechrequest.mdx
index 67b7322c1..15e0eb0d5 100644
--- a/docs/components/speechrequest.mdx
+++ b/docs/components/speechrequest.mdx
@@ -9,9 +9,9 @@ Text-to-speech request input
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| `input` | [components.SpeechInput](../components/speechinput.mdx) | ✅ | Text to synthesize, or a list of turns for multi-speaker input. Each turn has its own text, voice, and instructions. Multi-speaker input is currently supported by Gemini TTS models only. | Hello world |
+| `input` | [components.SpeechInput](../components/speechinput.mdx) | ✅ | Text to synthesize, or a list of turns for multi-speaker input. Each turn has its own text, voice, and instructions. Multi-speaker input is supported by Gemini TTS models and by Fish Audio models other than S1. | Hello world |
| `input_references` | List[[components.SpeechInputReference](../components/speechinputreference.mdx)] | ➖ | Reference content for stateless voice cloning or voice design. Audio mode: one to three `input_audio` parts, each optionally paired with a `text` part carrying its transcript (a single clip accepts its transcript before or after it; with multiple clips each transcript immediately follows its clip); only routed to endpoints that support voice cloning (and multiple references when more than one part is sent). Image mode: exactly one `image_url` part; only routed to endpoints that support image references. The two modes cannot be mixed. An empty array is treated as no reference. | [
\{
"input_audio": \{
"data": "data:audio/wav;base64,UklGRuQXDABXQVZF..."
},
"type": "input_audio"
},
\{
"text": "I used to rule the world.",
"type": "text"
}
] |
-| `instructions` | *Optional[str]* | ➖ | Delivery instructions for the whole request, such as tone, pacing, or emotion. Supported by OpenAI gpt-4o-mini-tts and Gemini TTS models. Ignored by other providers. | Speak in a warm and friendly tone. |
+| `instructions` | *Optional[str]* | ➖ | Delivery instructions for the whole request, such as tone, pacing, or emotion. Supported by OpenAI gpt-4o-mini-tts, Gemini TTS, and Fish Audio models. Ignored by other providers. | Speak in a warm and friendly tone. |
| `model` | *str* | ✅ | TTS model identifier | mistralai/voxtral-mini-tts-2603 |
| `provider` | [Optional[components.SpeechRequestProvider]](../components/speechrequestprovider.mdx) | ➖ | Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options | |
| `response_format` | [Optional[components.SpeechRequestResponseFormat]](../components/speechrequestresponseformat.mdx) | ➖ | Audio output format | pcm |
diff --git a/docs/components/updateguardrailrequest.mdx b/docs/components/updateguardrailrequest.mdx
index 3bbb2b444..8b1df60e8 100644
--- a/docs/components/updateguardrailrequest.mdx
+++ b/docs/components/updateguardrailrequest.mdx
@@ -6,6 +6,7 @@ title: "UpdateGuardrailRequest"
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `allow_safety_retention_google` | *OptionalNullable[bool]* | ➖ | Whether ZDR-only requests to google/* models may use endpoints that may retain prompts for safety monitoring. false allows only zero-retention endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided. | false |
| `allowed_data_regions` | List[[components.GuardrailDataRegion](../components/guardraildataregion.mdx)] | ➖ | Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected. | [
"europe"
] |
| `allowed_models` | List[*str*] | ➖ | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2"
] |
| `allowed_providers` | List[*str*] | ➖ | New list of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] |
diff --git a/docs/sdks/guardrails/README.mdx b/docs/sdks/guardrails/README.mdx
index 1ad836577..7935369ff 100644
--- a/docs/sdks/guardrails/README.mdx
+++ b/docs/sdks/guardrails/README.mdx
@@ -114,6 +114,7 @@ with OpenRouter(
| `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.
| |
+| `allow_safety_retention_google` | *OptionalNullable[bool]* | ➖ | Whether ZDR-only requests to google/* models may use endpoints that may retain prompts for safety monitoring. false allows only zero-retention endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided. | true |
| `allowed_data_regions` | List[[components.GuardrailDataRegion](../../components/guardraildataregion.mdx)] | ➖ | Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected. | [
"europe"
] |
| `allowed_models` | List[*str*] | ➖ | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] |
| `allowed_providers` | List[*str*] | ➖ | List of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] |
@@ -280,6 +281,7 @@ with OpenRouter(
| `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.
| |
+| `allow_safety_retention_google` | *OptionalNullable[bool]* | ➖ | Whether ZDR-only requests to google/* models may use endpoints that may retain prompts for safety monitoring. false allows only zero-retention endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided. | false |
| `allowed_data_regions` | List[[components.GuardrailDataRegion](../../components/guardraildataregion.mdx)] | ➖ | Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected. | [
"europe"
] |
| `allowed_models` | List[*str*] | ➖ | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2"
] |
| `allowed_providers` | List[*str*] | ➖ | New list of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] |
diff --git a/docs/sdks/tts/README.mdx b/docs/sdks/tts/README.mdx
index f459eacfb..c0773b0b0 100644
--- a/docs/sdks/tts/README.mdx
+++ b/docs/sdks/tts/README.mdx
@@ -40,13 +40,13 @@ with OpenRouter(
| Parameter | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| `input` | [components.SpeechInput](../../components/speechinput.mdx) | ✅ | Text to synthesize, or a list of turns for multi-speaker input. Each turn has its own text, voice, and instructions. Multi-speaker input is currently supported by Gemini TTS models only. | Hello world |
+| `input` | [components.SpeechInput](../../components/speechinput.mdx) | ✅ | Text to synthesize, or a list of turns for multi-speaker input. Each turn has its own text, voice, and instructions. Multi-speaker input is supported by Gemini TTS models and by Fish Audio models other than S1. | Hello world |
| `model` | *str* | ✅ | TTS model identifier | mistralai/voxtral-mini-tts-2603 |
| `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.
| |
| `input_references` | List[[components.SpeechInputReference](../../components/speechinputreference.mdx)] | ➖ | Reference content for stateless voice cloning or voice design. Audio mode: one to three `input_audio` parts, each optionally paired with a `text` part carrying its transcript (a single clip accepts its transcript before or after it; with multiple clips each transcript immediately follows its clip); only routed to endpoints that support voice cloning (and multiple references when more than one part is sent). Image mode: exactly one `image_url` part; only routed to endpoints that support image references. The two modes cannot be mixed. An empty array is treated as no reference. | [
\{
"input_audio": \{
"data": "data:audio/wav;base64,UklGRuQXDABXQVZF..."
},
"type": "input_audio"
},
\{
"text": "I used to rule the world.",
"type": "text"
}
] |
-| `instructions` | *Optional[str]* | ➖ | Delivery instructions for the whole request, such as tone, pacing, or emotion. Supported by OpenAI gpt-4o-mini-tts and Gemini TTS models. Ignored by other providers. | Speak in a warm and friendly tone. |
+| `instructions` | *Optional[str]* | ➖ | Delivery instructions for the whole request, such as tone, pacing, or emotion. Supported by OpenAI gpt-4o-mini-tts, Gemini TTS, and Fish Audio models. Ignored by other providers. | Speak in a warm and friendly tone. |
| `provider` | [Optional[components.SpeechRequestProvider]](../../components/speechrequestprovider.mdx) | ➖ | Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options | |
| `response_format` | [Optional[components.SpeechRequestResponseFormat]](../../components/speechrequestresponseformat.mdx) | ➖ | Audio output format | pcm |
| `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 |
diff --git a/pyproject.toml b/pyproject.toml
index 89e32936f..951c4e488 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "openrouter"
-version = "1.3.45"
+version = "1.3.46"
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 d1c45a6fa..8022b124a 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.45"
+__version__: str = "1.3.46"
__openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.914.0"
-__user_agent__: str = "speakeasy-sdk/python 1.3.45 2.914.0 1.0.0 openrouter"
+__user_agent__: str = "speakeasy-sdk/python 1.3.46 2.914.0 1.0.0 openrouter"
try:
if __package__ is not None:
diff --git a/src/openrouter/components/createguardrailrequest.py b/src/openrouter/components/createguardrailrequest.py
index d3cb25c2a..77ce30da9 100644
--- a/src/openrouter/components/createguardrailrequest.py
+++ b/src/openrouter/components/createguardrailrequest.py
@@ -24,6 +24,8 @@
class CreateGuardrailRequestTypedDict(TypedDict):
name: str
r"""Name for the new guardrail"""
+ allow_safety_retention_google: NotRequired[Nullable[bool]]
+ r"""Whether ZDR-only requests to google/* models may use endpoints that may retain prompts for safety monitoring. false allows only zero-retention endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided."""
allowed_data_regions: NotRequired[Nullable[List[GuardrailDataRegion]]]
r"""Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected."""
allowed_models: NotRequired[Nullable[List[str]]]
@@ -74,6 +76,9 @@ class CreateGuardrailRequest(BaseModel):
name: str
r"""Name for the new guardrail"""
+ allow_safety_retention_google: OptionalNullable[bool] = UNSET
+ r"""Whether ZDR-only requests to google/* models may use endpoints that may retain prompts for safety monitoring. false allows only zero-retention endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided."""
+
allowed_data_regions: OptionalNullable[List[GuardrailDataRegion]] = UNSET
r"""Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected."""
@@ -148,6 +153,7 @@ class CreateGuardrailRequest(BaseModel):
def serialize_model(self, handler):
optional_fields = set(
[
+ "allow_safety_retention_google",
"allowed_data_regions",
"allowed_models",
"allowed_providers",
@@ -173,6 +179,7 @@ def serialize_model(self, handler):
)
nullable_fields = set(
[
+ "allow_safety_retention_google",
"allowed_data_regions",
"allowed_models",
"allowed_providers",
diff --git a/src/openrouter/components/guardrail.py b/src/openrouter/components/guardrail.py
index c58c49089..60bef2177 100644
--- a/src/openrouter/components/guardrail.py
+++ b/src/openrouter/components/guardrail.py
@@ -32,6 +32,8 @@ class GuardrailTypedDict(TypedDict):
r"""Name of the guardrail"""
workspace_id: Nullable[str]
r"""The workspace this guardrail belongs to, or `null` for an unscoped legacy guardrail predating workspaces. Workspace membership organizes the guardrail; it does not apply the guardrail to the workspace's traffic. A `null` value does not mean the default workspace, and does not apply the guardrail across every workspace."""
+ allow_safety_retention_google: NotRequired[Nullable[bool]]
+ r"""Whether ZDR-only requests to google/* models may use endpoints that may retain prompts for safety monitoring. false allows only zero-retention endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided."""
allowed_data_regions: NotRequired[Nullable[List[GuardrailDataRegion]]]
r"""Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value."""
allowed_models: NotRequired[Nullable[List[str]]]
@@ -92,6 +94,9 @@ class Guardrail(BaseModel):
workspace_id: Nullable[str]
r"""The workspace this guardrail belongs to, or `null` for an unscoped legacy guardrail predating workspaces. Workspace membership organizes the guardrail; it does not apply the guardrail to the workspace's traffic. A `null` value does not mean the default workspace, and does not apply the guardrail across every workspace."""
+ allow_safety_retention_google: OptionalNullable[bool] = UNSET
+ r"""Whether ZDR-only requests to google/* models may use endpoints that may retain prompts for safety monitoring. false allows only zero-retention endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided."""
+
allowed_data_regions: OptionalNullable[List[GuardrailDataRegion]] = UNSET
r"""Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value."""
@@ -161,6 +166,7 @@ class Guardrail(BaseModel):
def serialize_model(self, handler):
optional_fields = set(
[
+ "allow_safety_retention_google",
"allowed_data_regions",
"allowed_models",
"allowed_providers",
@@ -185,6 +191,7 @@ def serialize_model(self, handler):
)
nullable_fields = set(
[
+ "allow_safety_retention_google",
"allowed_data_regions",
"allowed_models",
"allowed_providers",
diff --git a/src/openrouter/components/speechinput.py b/src/openrouter/components/speechinput.py
index 676f38928..e85b5d8ef 100644
--- a/src/openrouter/components/speechinput.py
+++ b/src/openrouter/components/speechinput.py
@@ -9,8 +9,8 @@
SpeechInputTypedDict = TypeAliasType(
"SpeechInputTypedDict", Union[str, List[SpeechTurnTypedDict]]
)
-r"""Text to synthesize, or a list of turns for multi-speaker input. Each turn has its own text, voice, and instructions. Multi-speaker input is currently supported by Gemini TTS models only."""
+r"""Text to synthesize, or a list of turns for multi-speaker input. Each turn has its own text, voice, and instructions. Multi-speaker input is supported by Gemini TTS models and by Fish Audio models other than S1."""
SpeechInput = TypeAliasType("SpeechInput", Union[str, List[SpeechTurn]])
-r"""Text to synthesize, or a list of turns for multi-speaker input. Each turn has its own text, voice, and instructions. Multi-speaker input is currently supported by Gemini TTS models only."""
+r"""Text to synthesize, or a list of turns for multi-speaker input. Each turn has its own text, voice, and instructions. Multi-speaker input is supported by Gemini TTS models and by Fish Audio models other than S1."""
diff --git a/src/openrouter/components/speechrequest.py b/src/openrouter/components/speechrequest.py
index ad116652e..ea07e4017 100644
--- a/src/openrouter/components/speechrequest.py
+++ b/src/openrouter/components/speechrequest.py
@@ -103,13 +103,13 @@ class SpeechRequestTypedDict(TypedDict):
r"""Text-to-speech request input"""
input: SpeechInputTypedDict
- r"""Text to synthesize, or a list of turns for multi-speaker input. Each turn has its own text, voice, and instructions. Multi-speaker input is currently supported by Gemini TTS models only."""
+ r"""Text to synthesize, or a list of turns for multi-speaker input. Each turn has its own text, voice, and instructions. Multi-speaker input is supported by Gemini TTS models and by Fish Audio models other than S1."""
model: str
r"""TTS model identifier"""
input_references: NotRequired[List[SpeechInputReferenceTypedDict]]
r"""Reference content for stateless voice cloning or voice design. Audio mode: one to three `input_audio` parts, each optionally paired with a `text` part carrying its transcript (a single clip accepts its transcript before or after it; with multiple clips each transcript immediately follows its clip); only routed to endpoints that support voice cloning (and multiple references when more than one part is sent). Image mode: exactly one `image_url` part; only routed to endpoints that support image references. The two modes cannot be mixed. An empty array is treated as no reference."""
instructions: NotRequired[str]
- r"""Delivery instructions for the whole request, such as tone, pacing, or emotion. Supported by OpenAI gpt-4o-mini-tts and Gemini TTS models. Ignored by other providers."""
+ r"""Delivery instructions for the whole request, such as tone, pacing, or emotion. Supported by OpenAI gpt-4o-mini-tts, Gemini TTS, and Fish Audio models. Ignored by other providers."""
provider: NotRequired[SpeechRequestProviderTypedDict]
r"""Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options"""
response_format: NotRequired[SpeechRequestResponseFormat]
@@ -130,7 +130,7 @@ class SpeechRequest(BaseModel):
r"""Text-to-speech request input"""
input: SpeechInput
- r"""Text to synthesize, or a list of turns for multi-speaker input. Each turn has its own text, voice, and instructions. Multi-speaker input is currently supported by Gemini TTS models only."""
+ r"""Text to synthesize, or a list of turns for multi-speaker input. Each turn has its own text, voice, and instructions. Multi-speaker input is supported by Gemini TTS models and by Fish Audio models other than S1."""
model: str
r"""TTS model identifier"""
@@ -139,7 +139,7 @@ class SpeechRequest(BaseModel):
r"""Reference content for stateless voice cloning or voice design. Audio mode: one to three `input_audio` parts, each optionally paired with a `text` part carrying its transcript (a single clip accepts its transcript before or after it; with multiple clips each transcript immediately follows its clip); only routed to endpoints that support voice cloning (and multiple references when more than one part is sent). Image mode: exactly one `image_url` part; only routed to endpoints that support image references. The two modes cannot be mixed. An empty array is treated as no reference."""
instructions: Optional[str] = None
- r"""Delivery instructions for the whole request, such as tone, pacing, or emotion. Supported by OpenAI gpt-4o-mini-tts and Gemini TTS models. Ignored by other providers."""
+ r"""Delivery instructions for the whole request, such as tone, pacing, or emotion. Supported by OpenAI gpt-4o-mini-tts, Gemini TTS, and Fish Audio models. Ignored by other providers."""
provider: Optional[SpeechRequestProvider] = None
r"""Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options"""
diff --git a/src/openrouter/components/updateguardrailrequest.py b/src/openrouter/components/updateguardrailrequest.py
index 21afa8a30..17311e522 100644
--- a/src/openrouter/components/updateguardrailrequest.py
+++ b/src/openrouter/components/updateguardrailrequest.py
@@ -22,6 +22,8 @@
class UpdateGuardrailRequestTypedDict(TypedDict):
+ allow_safety_retention_google: NotRequired[Nullable[bool]]
+ r"""Whether ZDR-only requests to google/* models may use endpoints that may retain prompts for safety monitoring. false allows only zero-retention endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided."""
allowed_data_regions: NotRequired[Nullable[List[GuardrailDataRegion]]]
r"""Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected."""
allowed_models: NotRequired[Nullable[List[str]]]
@@ -69,6 +71,9 @@ class UpdateGuardrailRequestTypedDict(TypedDict):
class UpdateGuardrailRequest(BaseModel):
+ allow_safety_retention_google: OptionalNullable[bool] = UNSET
+ r"""Whether ZDR-only requests to google/* models may use endpoints that may retain prompts for safety monitoring. false allows only zero-retention endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided."""
+
allowed_data_regions: OptionalNullable[List[GuardrailDataRegion]] = UNSET
r"""Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected."""
@@ -143,6 +148,7 @@ class UpdateGuardrailRequest(BaseModel):
def serialize_model(self, handler):
optional_fields = set(
[
+ "allow_safety_retention_google",
"allowed_data_regions",
"allowed_models",
"allowed_providers",
@@ -168,6 +174,7 @@ def serialize_model(self, handler):
)
nullable_fields = set(
[
+ "allow_safety_retention_google",
"allowed_data_regions",
"allowed_models",
"allowed_providers",
diff --git a/src/openrouter/guardrails.py b/src/openrouter/guardrails.py
index 785964ad3..f61504951 100644
--- a/src/openrouter/guardrails.py
+++ b/src/openrouter/guardrails.py
@@ -357,6 +357,7 @@ def create(
http_referer: Optional[str] = None,
x_open_router_title: Optional[str] = None,
x_open_router_categories: Optional[str] = None,
+ allow_safety_retention_google: OptionalNullable[bool] = UNSET,
allowed_data_regions: OptionalNullable[
Iterable[components.GuardrailDataRegion]
] = UNSET,
@@ -407,6 +408,7 @@ def create(
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
+ :param allow_safety_retention_google: Whether ZDR-only requests to google/* models may use endpoints that may retain prompts for safety monitoring. false allows only zero-retention endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided.
:param allowed_data_regions: Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected.
:param allowed_models: Array of model identifiers (slug or canonical_slug accepted)
:param allowed_providers: List of allowed provider IDs
@@ -448,6 +450,7 @@ def create(
x_open_router_title=x_open_router_title,
x_open_router_categories=x_open_router_categories,
create_guardrail_request=components.CreateGuardrailRequest(
+ allow_safety_retention_google=allow_safety_retention_google,
allowed_data_regions=utils.unmarshal(
allowed_data_regions,
OptionalNullable[List[components.GuardrailDataRegion]],
@@ -591,6 +594,7 @@ async def create_async(
http_referer: Optional[str] = None,
x_open_router_title: Optional[str] = None,
x_open_router_categories: Optional[str] = None,
+ allow_safety_retention_google: OptionalNullable[bool] = UNSET,
allowed_data_regions: OptionalNullable[
Iterable[components.GuardrailDataRegion]
] = UNSET,
@@ -641,6 +645,7 @@ async def create_async(
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
+ :param allow_safety_retention_google: Whether ZDR-only requests to google/* models may use endpoints that may retain prompts for safety monitoring. false allows only zero-retention endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided.
:param allowed_data_regions: Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected.
:param allowed_models: Array of model identifiers (slug or canonical_slug accepted)
:param allowed_providers: List of allowed provider IDs
@@ -682,6 +687,7 @@ async def create_async(
x_open_router_title=x_open_router_title,
x_open_router_categories=x_open_router_categories,
create_guardrail_request=components.CreateGuardrailRequest(
+ allow_safety_retention_google=allow_safety_retention_google,
allowed_data_regions=utils.unmarshal(
allowed_data_regions,
OptionalNullable[List[components.GuardrailDataRegion]],
@@ -1337,6 +1343,7 @@ def update(
http_referer: Optional[str] = None,
x_open_router_title: Optional[str] = None,
x_open_router_categories: Optional[str] = None,
+ allow_safety_retention_google: OptionalNullable[bool] = UNSET,
allowed_data_regions: OptionalNullable[
Iterable[components.GuardrailDataRegion]
] = UNSET,
@@ -1387,6 +1394,7 @@ def update(
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
+ :param allow_safety_retention_google: Whether ZDR-only requests to google/* models may use endpoints that may retain prompts for safety monitoring. false allows only zero-retention endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided.
:param allowed_data_regions: Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected.
:param allowed_models: Array of model identifiers (slug or canonical_slug accepted)
:param allowed_providers: New list of allowed provider IDs
@@ -1429,6 +1437,7 @@ def update(
x_open_router_categories=x_open_router_categories,
id=id,
update_guardrail_request=components.UpdateGuardrailRequest(
+ allow_safety_retention_google=allow_safety_retention_google,
allowed_data_regions=utils.unmarshal(
allowed_data_regions,
OptionalNullable[List[components.GuardrailDataRegion]],
@@ -1581,6 +1590,7 @@ async def update_async(
http_referer: Optional[str] = None,
x_open_router_title: Optional[str] = None,
x_open_router_categories: Optional[str] = None,
+ allow_safety_retention_google: OptionalNullable[bool] = UNSET,
allowed_data_regions: OptionalNullable[
Iterable[components.GuardrailDataRegion]
] = UNSET,
@@ -1631,6 +1641,7 @@ async def update_async(
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
+ :param allow_safety_retention_google: Whether ZDR-only requests to google/* models may use endpoints that may retain prompts for safety monitoring. false allows only zero-retention endpoints. A guardrail can only be more restrictive than the account setting. Inherits the account setting when not provided.
:param allowed_data_regions: Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. An empty array is rejected.
:param allowed_models: Array of model identifiers (slug or canonical_slug accepted)
:param allowed_providers: New list of allowed provider IDs
@@ -1673,6 +1684,7 @@ async def update_async(
x_open_router_categories=x_open_router_categories,
id=id,
update_guardrail_request=components.UpdateGuardrailRequest(
+ allow_safety_retention_google=allow_safety_retention_google,
allowed_data_regions=utils.unmarshal(
allowed_data_regions,
OptionalNullable[List[components.GuardrailDataRegion]],
diff --git a/src/openrouter/tts.py b/src/openrouter/tts.py
index 5b1bf2a61..001335f1d 100644
--- a/src/openrouter/tts.py
+++ b/src/openrouter/tts.py
@@ -51,7 +51,7 @@ def create_speech(
Synthesizes audio from the input text. Returns a raw audio bytestream in the requested format (e.g. mp3, pcm, wav).
- :param input: Text to synthesize, or a list of turns for multi-speaker input. Each turn has its own text, voice, and instructions. Multi-speaker input is currently supported by Gemini TTS models only.
+ :param input: Text to synthesize, or a list of turns for multi-speaker input. Each turn has its own text, voice, and instructions. Multi-speaker input is supported by Gemini TTS models and by Fish Audio models other than S1.
:param model: TTS model identifier
: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.
@@ -61,7 +61,7 @@ def create_speech(
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
:param input_references: Reference content for stateless voice cloning or voice design. Audio mode: one to three `input_audio` parts, each optionally paired with a `text` part carrying its transcript (a single clip accepts its transcript before or after it; with multiple clips each transcript immediately follows its clip); only routed to endpoints that support voice cloning (and multiple references when more than one part is sent). Image mode: exactly one `image_url` part; only routed to endpoints that support image references. The two modes cannot be mixed. An empty array is treated as no reference.
- :param instructions: Delivery instructions for the whole request, such as tone, pacing, or emotion. Supported by OpenAI gpt-4o-mini-tts and Gemini TTS models. Ignored by other providers.
+ :param instructions: Delivery instructions for the whole request, such as tone, pacing, or emotion. Supported by OpenAI gpt-4o-mini-tts, Gemini TTS, and Fish Audio models. Ignored by other providers.
:param provider: Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options
:param response_format: Audio output format
: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.
@@ -307,7 +307,7 @@ async def create_speech_async(
Synthesizes audio from the input text. Returns a raw audio bytestream in the requested format (e.g. mp3, pcm, wav).
- :param input: Text to synthesize, or a list of turns for multi-speaker input. Each turn has its own text, voice, and instructions. Multi-speaker input is currently supported by Gemini TTS models only.
+ :param input: Text to synthesize, or a list of turns for multi-speaker input. Each turn has its own text, voice, and instructions. Multi-speaker input is supported by Gemini TTS models and by Fish Audio models other than S1.
:param model: TTS model identifier
: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.
@@ -317,7 +317,7 @@ async def create_speech_async(
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
:param input_references: Reference content for stateless voice cloning or voice design. Audio mode: one to three `input_audio` parts, each optionally paired with a `text` part carrying its transcript (a single clip accepts its transcript before or after it; with multiple clips each transcript immediately follows its clip); only routed to endpoints that support voice cloning (and multiple references when more than one part is sent). Image mode: exactly one `image_url` part; only routed to endpoints that support image references. The two modes cannot be mixed. An empty array is treated as no reference.
- :param instructions: Delivery instructions for the whole request, such as tone, pacing, or emotion. Supported by OpenAI gpt-4o-mini-tts and Gemini TTS models. Ignored by other providers.
+ :param instructions: Delivery instructions for the whole request, such as tone, pacing, or emotion. Supported by OpenAI gpt-4o-mini-tts, Gemini TTS, and Fish Audio models. Ignored by other providers.
:param provider: Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options
:param response_format: Audio output format
: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.
diff --git a/uv.lock b/uv.lock
index c43fa628e..bdc8fc920 100644
--- a/uv.lock
+++ b/uv.lock
@@ -213,7 +213,7 @@ wheels = [
[[package]]
name = "openrouter"
-version = "1.3.45"
+version = "1.3.46"
source = { editable = "." }
dependencies = [
{ name = "httpcore" },