diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock
index 2ab206ea..e71da49f 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: 1af36a386677e5c72d1d6e612ff746a8
+ docChecksum: c96eb05f8fa38a969d8b8e37bf2b7f92
docVersion: 1.0.0
speakeasyVersion: 1.803.2
generationVersion: 2.950.13
- releaseVersion: 1.3.118
- configChecksum: b8a96c694f87028e65fa90ce871b1bd4
+ releaseVersion: 1.3.119
+ configChecksum: 58bcf45d3e1e0911fd269902962fd390
repoURL: https://github.com/OpenRouterTeam/python-sdk.git
installationURL: https://github.com/OpenRouterTeam/python-sdk.git
published: true
persistentEdits:
- generation_id: 8de6f91a-f314-428f-b36c-2b72ed1a92f7
- pristine_commit_hash: a277af25a0ef90ae0672fcac0b5355f7a76c1c43
- pristine_tree_hash: 8411439dcb096246671b5a7f2edc1d19e26e9657
+ generation_id: 03f5c8f4-ae2c-47ce-b913-65f8c0eae22a
+ pristine_commit_hash: 10867ef33c8902a0b1285bd03ad547d511fdeed2
+ pristine_tree_hash: 6c29fbc47d447931827314914f6d087540652cf7
features:
python:
acceptHeaders: 3.0.0
@@ -2954,18 +2954,26 @@ trackedFiles:
id: ed026ac2ad26
last_write_checksum: sha1:f8f63455cb8c018ef1082bc60125f62af7c46f42
pristine_git_object: 66d2e59cbdc4c920b5be4970c130b11a737d53cd
+ docs/components/decisionsrefusalanswer.mdx:
+ id: 2a35ff326a02
+ last_write_checksum: sha1:e10bfafd03e5b003598c8fd536245a4835d7c9e4
+ pristine_git_object: f02718af0f6005ba82002ad8fd51342304b2de46
+ docs/components/decisionsrefusalanswertype.mdx:
+ id: 7dbc18258118
+ last_write_checksum: sha1:df06b2bb22e32d1c0025ff622727e34e56dc800c
+ pristine_git_object: ce9bd3645f67e4c8521c138a31e3408c25742787
docs/components/decisionsrequest.mdx:
id: "910490840961"
last_write_checksum: sha1:b28a14b1e588f2ad987f21cf4fc966554e4622fc
pristine_git_object: c0deb3a1bbf5d2d4347993ccf40cbcb38e85a734
docs/components/decisionsresponse.mdx:
id: 5c77b727e5dc
- last_write_checksum: sha1:018dc1dfbaefe2589a3f89b0baf65e9946ec29e7
- pristine_git_object: 8ebd49f4e9be29988efff99b53a1310857177e9b
+ last_write_checksum: sha1:3b62d8f146439de971e50d71f13507bfebb1c136
+ pristine_git_object: 754c6e549adf45e12f399b3f79f2a231d3295f3b
docs/components/decisionsresponseanswers.mdx:
id: 1a49d5f960ce
- last_write_checksum: sha1:298ba679b1c38494e4b5d610e9949397450ced46
- pristine_git_object: 0aa4353ad48b79986a1b903e69894b35f52b440b
+ last_write_checksum: sha1:b2aad00207d979ed526503446ff9e1aefa79f09f
+ pristine_git_object: 48ba476c6d114d79e5d5f7bd90db06c60a90239e
docs/components/decisionsresponseusage.mdx:
id: ab10cb1b5675
last_write_checksum: sha1:2697cbd759d71c445358dd1bdf1edc1d1c278ecd
@@ -2990,6 +2998,18 @@ trackedFiles:
id: 1585ec8ed6cd
last_write_checksum: sha1:692e2a7f68f6992eb2efa02107b467034acaf275
pristine_git_object: a805b4c8fe3b93198c785cfeac5a2cab9fff4319
+ docs/components/decisionsurlcitationannotation.mdx:
+ id: d43af016a84f
+ last_write_checksum: sha1:540f54383493daf6bc61f85f6a405b697af72e57
+ pristine_git_object: d69c176a7f0493b4b6d14d8bdb7fca488b6d0808
+ docs/components/decisionsurlcitationannotationtype.mdx:
+ id: bee7c9177051
+ last_write_checksum: sha1:66623588bd8fd1e8451574a5eb4a079d0ff444a8
+ pristine_git_object: 01a5fcfafaedf3fb43459411bfc01d3d1d84d37d
+ docs/components/decisionsurlcitationannotationurlcitation.mdx:
+ id: 7bea7857a4ee
+ last_write_checksum: sha1:3c07ecf56cda7b6676c57594b73e329a6c33bfa8
+ pristine_git_object: 14722dc2db748fac704cbf62a5450e7017ef402c
docs/components/decisionsusageinputtokensdetails.mdx:
id: e891a0a6dc46
last_write_checksum: sha1:83962f8dc7c6f9567577688291f9e05ac4b16c9a
@@ -7592,16 +7612,28 @@ trackedFiles:
pristine_git_object: 34f4f07fb3008df83646fa3d88ce04009274246a
docs/components/speechrequest.mdx:
id: 06e81b0433f6
- last_write_checksum: sha1:4d140934d8d3d38c4ac5cb937f5ba730a7d5c1fe
- pristine_git_object: f559f1154c69cee9769a2489a4975951ddd5c977
+ last_write_checksum: sha1:8e39bc6283f8a3fb641472f589b9c37d2634e044
+ pristine_git_object: f336273bc7b4e7e335ed52b966b7904a58055133
docs/components/speechrequestdatacollection.mdx:
id: 6c5938568888
last_write_checksum: sha1:89a08b4c4de66c1ef7676792a38747e030ed6729
pristine_git_object: 01f84221304dd8b2ff9c1ad99b796177b7ba84d1
+ docs/components/speechrequestignore.mdx:
+ id: f7d851063736
+ last_write_checksum: sha1:46ebcc6ddc4e04f02f52949a3d6e7b3c57fb9f9b
+ pristine_git_object: f8c411cf67fc8887b41c50c9d24d5acd42dc7a9e
+ docs/components/speechrequestonly.mdx:
+ id: d7bf906a710e
+ last_write_checksum: sha1:d4b26cc2e16fb43f28ae040e13409c8a68325aae
+ pristine_git_object: 3f833504469f935ffb0ddb3cc9d99519eb6ad8f4
+ docs/components/speechrequestorder.mdx:
+ id: 3f90b0c6e8a7
+ last_write_checksum: sha1:4111f5e08efc6dae0bf296572b933c81ae1ca976
+ pristine_git_object: d519ecc051bffb1e94c0ffcbdb7b3a5616233abc
docs/components/speechrequestprovider.mdx:
id: 4f78ed0394c4
- last_write_checksum: sha1:7c3a1cd5a55359aa488407a0d3e5cea5a5893045
- pristine_git_object: f2348328e11abb2a241b92513643ac1b45333c07
+ last_write_checksum: sha1:f9a691631f19f61ef4dd7bcecbbd47fce0cf80b4
+ pristine_git_object: bd91e8ae980d60e10df4aeb9db617cbf3fd20e43
docs/components/speechrequestresponseformat.mdx:
id: bd09f77a4a90
last_write_checksum: sha1:1b87242f33c6d22a08dd085d0ef41335ec2e9b0c
@@ -7740,16 +7772,28 @@ trackedFiles:
pristine_git_object: 45d1eef7be13575aac15391f23c310480852abf8
docs/components/sttrequest.mdx:
id: 6a5e33cf6dbe
- last_write_checksum: sha1:081781ff8c7cc710776d682ba02a75bc858338e6
- pristine_git_object: c250e39021a37f0fc12894ef776dc092421dd377
+ last_write_checksum: sha1:c76e3b7840564aff121bd08d2b07b1a58e1e5cfa
+ pristine_git_object: b2794f52672cb6cc93db342094b7cf56016144af
docs/components/sttrequestdatacollection.mdx:
id: d8523e72c962
last_write_checksum: sha1:485caf2a759a45e6666f611663eea23924032df6
pristine_git_object: 293a4f1162a245b3945674974fa399b1c0cae9b4
+ docs/components/sttrequestignore.mdx:
+ id: 32ca62e85878
+ last_write_checksum: sha1:399d148fc02858b2b744e8d9b1997e062a6899d2
+ pristine_git_object: bbad38dd7ec6310131f6563242764b5ce7e68f2e
+ docs/components/sttrequestonly.mdx:
+ id: 9dce40c8511a
+ last_write_checksum: sha1:b9e514ee226c7d071784aaab6b50dd399e65be82
+ pristine_git_object: 8098851b27eb6a04872b2c713306bfb08696f7f9
+ docs/components/sttrequestorder.mdx:
+ id: 838cf001c866
+ last_write_checksum: sha1:03eb5c40b7a0d21da86a38ae80e0053b90ca0ee6
+ pristine_git_object: 48950a7e3195f22d3e5f3d0866cf18b2c2e7693e
docs/components/sttrequestprovider.mdx:
id: d8b1bac8e745
- last_write_checksum: sha1:26931ab932d70dd81bc18329dbc1c8564d082565
- pristine_git_object: 36887cf24fa6db86627a0dd45171c35aa13a3dba
+ last_write_checksum: sha1:68880785086fb686d34210b56dabe4ddad203dc4
+ pristine_git_object: 52987a537026c0107c1edc317909b2f2cafe6ec9
docs/components/sttrequestresponseformat.mdx:
id: ab58b1666609
last_write_checksum: sha1:f0cbf9b5b35d8ef8c049a3b84c47f6c43778a00a
@@ -10840,8 +10884,8 @@ trackedFiles:
pristine_git_object: 53a88c2bffdd205f6bcf846482092cee286e8f33
docs/sdks/stt/README.mdx:
id: 190b0dc9a5d1
- last_write_checksum: sha1:6e187da015a0ee093bf1bf587259828acea448e4
- pristine_git_object: 5ed45eda77a20a236f1e6dfe4ab39fde2579e320
+ last_write_checksum: sha1:0e88efab8bed1237da03a0c5164c363da96ff806
+ pristine_git_object: 0133c3a1ebae62a3581bc0503b6dbf61343e6470
docs/sdks/systemone/README.mdx:
id: 55c317c71f3d
last_write_checksum: sha1:b2c7fa64183a73b951c0c05ca68156bee092c2b4
@@ -10852,8 +10896,8 @@ trackedFiles:
pristine_git_object: bcbe30fccceb97caa3a0e170038245dcc7f1e540
docs/sdks/tts/README.mdx:
id: cd1132543884
- last_write_checksum: sha1:2c3dd4ecfd1c3bbaf1e8f0776d0e6ff081f08836
- pristine_git_object: 7a8a90fa57464364c2072ee857fe7070b4a62ba7
+ last_write_checksum: sha1:cbe5111012fe5ad15d4051f1565ddac4de4f1715
+ pristine_git_object: 656a52a762ab722119de80461800e1ddf06fca5d
docs/sdks/vault/README.mdx:
id: 3738c6722acd
last_write_checksum: sha1:290b439ff730b9eabf4a6ef93737d1c61006b0fa
@@ -10872,8 +10916,8 @@ trackedFiles:
pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544
pyproject.toml:
id: 5d07e7d72637
- last_write_checksum: sha1:680e877a4cdb4892da46e863332a5caffde4c4d5
- pristine_git_object: 605c91f8dd70d28c9a5e9be1db7bd35e26e724e8
+ last_write_checksum: sha1:536c24162fd1ef11307a17eadef620e9dc30d5c5
+ pristine_git_object: 46dcc28ae56f5b08c61b875d1221dc854bf3c6e2
scripts/prepare_readme.py:
id: e0c5957a6035
last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54
@@ -10900,8 +10944,8 @@ trackedFiles:
pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137
src/openrouter/_version.py:
id: d8d15ad6c586
- last_write_checksum: sha1:9fdacd1bf55f7da2d765c053729c1398cd8dbfbd
- pristine_git_object: 1d94cdc5f0b7f2b08660fbbbad8a23357a06e554
+ last_write_checksum: sha1:5383a50dd6d41003a2b5c8fc0a0d4804af596a47
+ pristine_git_object: 3dd25ead883100f11b3e84e1072b97146e3be81a
src/openrouter/alpha.py:
id: 306c4d93308d
last_write_checksum: sha1:80cc0f39649445431cc2247ed0e0765438467766
@@ -10948,8 +10992,8 @@ trackedFiles:
pristine_git_object: 192786c7ca69fff87f3683fc28b4d71baf28fc3d
src/openrouter/components/__init__.py:
id: 81754e97b3f4
- last_write_checksum: sha1:56d03bbfa24ce5151333ffe76b35c6b52c95767e
- pristine_git_object: a1b3836b0f0cf0083e60ccb823a2b7a56bcfcb45
+ last_write_checksum: sha1:da8eae506cefd3a50cb35d29cddc26db0219d568
+ pristine_git_object: dbb7fcac680ddc56952faf5795f4c2ec2c6d41bb
src/openrouter/components/aabenchmarkentry.py:
id: e2e0f0b48c82
last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c
@@ -12182,14 +12226,18 @@ trackedFiles:
id: a04589349064
last_write_checksum: sha1:3434eb7616fe1df0479dfa0e89ba55a0f3874759
pristine_git_object: d6b2551a31bc9c7d8e2ed96913c097dc127c8311
+ src/openrouter/components/decisionsrefusalanswer.py:
+ id: cbd72b2ed78b
+ last_write_checksum: sha1:f05e3d738d7cd4b10506c7132e70861d1e53c2b3
+ pristine_git_object: e556e20adf0b85f26257827ef9910c9282a51f8d
src/openrouter/components/decisionsrequest.py:
id: 5df43fede21b
last_write_checksum: sha1:93d08cdb310264d400123ee9924f27b4502a6f30
pristine_git_object: c3f32b631b40f5eca0a0b3c71c2fd543058cf52a
src/openrouter/components/decisionsresponse.py:
id: b91b81c2cf95
- last_write_checksum: sha1:22414d0d1e3bae24af548ec76a9589da3efb341a
- pristine_git_object: 15c3083b9547e76a10b5eddd3e19fef7bdce498f
+ last_write_checksum: sha1:d127c853bcff3272489b94131f7e09209e708faf
+ pristine_git_object: 49dfac713420e388ff707bbe6cd8973bbba2e69f
src/openrouter/components/decisionsscoreanswer.py:
id: af8597465725
last_write_checksum: sha1:e12a52051ccd6f841e0238d789b816a05156d299
@@ -12198,6 +12246,10 @@ trackedFiles:
id: 2c10723569c6
last_write_checksum: sha1:eb600123dc7156e5e5f2bf9a06ed022746ba680b
pristine_git_object: a5abe8e608aaaa6c4dc2a55e38bd6d6b23b8f970
+ src/openrouter/components/decisionsurlcitationannotation.py:
+ id: 3cb7751301d1
+ last_write_checksum: sha1:bde39324eafb1d87fbea5936a4eb24415a939337
+ pristine_git_object: 840940e68a3d075a233ef75587fb0bbb6a31a6f0
src/openrouter/components/decisionsusageinputtokensdetails.py:
id: 20c4da7495ab
last_write_checksum: sha1:335ed55eb277549873421b543887c6b1c243bb7f
@@ -14024,8 +14076,8 @@ trackedFiles:
pristine_git_object: 4633e5d7658c500aa903ce8caa8ef86cc97b78eb
src/openrouter/components/speechrequest.py:
id: 2a9400167112
- last_write_checksum: sha1:828b683cc88253fb686a6d1218c8940cd034ae85
- pristine_git_object: ab487196464676f482be6af140ab966ab025d084
+ last_write_checksum: sha1:7d0605185e060b9eff5dc0cd8cbcd3d246d22658
+ pristine_git_object: 76ecc5375d4c843c8585cb8cc829203cdc57404c
src/openrouter/components/speechturn.py:
id: 121e0a940f91
last_write_checksum: sha1:31bdba00e027b81de8a3872d48e694475cf02e7a
@@ -14108,8 +14160,8 @@ trackedFiles:
pristine_git_object: 75281f477b0ce85cd1032ed4b0c949a30a51b7f9
src/openrouter/components/sttrequest.py:
id: 5fb1d469e16e
- last_write_checksum: sha1:76de6caec130ddddcf32ecd66231fb5d52cfec91
- pristine_git_object: e19d9381e0b3a45ea873006cd89c2fb871055086
+ last_write_checksum: sha1:9fc09c624a8f623eadbc2fda5263711b2fd08fa6
+ pristine_git_object: 7bb4e08db69c27a195cc9b4637677e8bfae4d52d
src/openrouter/components/sttresponse.py:
id: 2dc8eb8daaca
last_write_checksum: sha1:420c65736ba0db3da84592d5639b41b81b6f87c4
@@ -15344,8 +15396,8 @@ trackedFiles:
pristine_git_object: 26433165a0b1c25d7bd3115b9b129b18f2dc9387
src/openrouter/stt.py:
id: fc0c2f669423
- last_write_checksum: sha1:33a6a6f9973fd1578d6c98720dcde1c17e428f5e
- pristine_git_object: 9787a43efe6fbf7233ffcc14a340a29663e61a01
+ last_write_checksum: sha1:99ebb0748e169ba4a19d5c9f56bc08dcd625d7f0
+ pristine_git_object: b1ca52f0b8add09f9e24547584775e84373b738d
src/openrouter/systemone.py:
id: 7e0a0e237bb1
last_write_checksum: sha1:550af693684424feec5e4f8e044f8243b74daeb0
@@ -15356,8 +15408,8 @@ trackedFiles:
pristine_git_object: 701fa8597ff85f41a60736ade55fcb32f9ec7125
src/openrouter/tts.py:
id: 5055d4b95f1d
- last_write_checksum: sha1:a2b5c587bacc54e9255a15130318926d762b9a8b
- pristine_git_object: 7f6f87ca20d750478ba987112d95be0550725472
+ last_write_checksum: sha1:551dba8562cfb948243002fc9be70cfb18171bb4
+ pristine_git_object: 3abf119a9ffc8e4c92e9faef7fa63399fed34abf
src/openrouter/types/__init__.py:
id: 5eab536205b7
last_write_checksum: sha1:f9ad14217f832e74f594285960125add50324be9
@@ -20026,4 +20078,7 @@ examples:
examplesVersion: 1.0.2
releaseNotes: |
## Python SDK Changes:
- * `open_router.providers.list_provider_endpoints()`: **Added**
+ * `open_router.alpha.decisions.create()`: `response` **Changed**
+ * `open_router.tts.create_speech()`: `request.provider` **Changed**
+ * `open_router.stt.create_transcription()`: `request.provider` **Changed**
+ * `open_router.system_one.create()`: `response` **Changed**
diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml
index 7598aa0c..ce8b83c5 100644
--- a/.speakeasy/gen.yaml
+++ b/.speakeasy/gen.yaml
@@ -37,7 +37,7 @@ generation:
documentation: mintlify
preApplyUnionDiscriminators: true
python:
- version: 1.3.118
+ version: 1.3.119
additionalDependencies:
dev:
pytest: '>=8.3'
diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml
index b14862bf..370124c6 100644
--- a/.speakeasy/out.openapi.yaml
+++ b/.speakeasy/out.openapi.yaml
@@ -11200,6 +11200,16 @@ components:
- 'type'
- 'instructions'
type: 'object'
+ DecisionsRefusalAnswer:
+ description: 'The provider declined to answer this question; no value or probabilities are returned. Other questions in the same request can still have answers.'
+ properties:
+ type:
+ enum:
+ - 'refusal'
+ type: 'string'
+ required:
+ - 'type'
+ type: 'object'
DecisionsRequest:
properties:
assets:
@@ -11254,14 +11264,20 @@ components:
type: 'object'
DecisionsResponse:
properties:
+ annotations:
+ description: 'Sources for the request as a whole, when the provider returns them. Not attributed to individual answers.'
+ items:
+ $ref: '#/components/schemas/DecisionsUrlCitationAnnotation'
+ type: 'array'
answers:
additionalProperties:
- description: 'A Decisions answer using a boolean, choice, score, or image bounding-box evaluation.'
+ description: 'A Decisions answer using a boolean, choice, score, or image bounding-box evaluation, or a refusal of that question.'
discriminator:
mapping:
box: '#/components/schemas/DecisionsBoxAnswer'
choice: '#/components/schemas/DecisionsChoiceAnswer'
noul: '#/components/schemas/DecisionsNoulAnswer'
+ refusal: '#/components/schemas/DecisionsRefusalAnswer'
score: '#/components/schemas/DecisionsScoreAnswer'
propertyName: 'type'
oneOf:
@@ -11269,6 +11285,7 @@ components:
- $ref: '#/components/schemas/DecisionsChoiceAnswer'
- $ref: '#/components/schemas/DecisionsScoreAnswer'
- $ref: '#/components/schemas/DecisionsBoxAnswer'
+ - $ref: '#/components/schemas/DecisionsRefusalAnswer'
type: 'object'
id:
type: 'string'
@@ -11357,6 +11374,28 @@ components:
- 'instructions'
- 'criteria'
type: 'object'
+ DecisionsUrlCitationAnnotation:
+ description: 'A web source the provider used for this request. Applies to the whole request, not to a specific answer.'
+ properties:
+ type:
+ enum:
+ - 'url_citation'
+ type: 'string'
+ url_citation:
+ properties:
+ content:
+ type: 'string'
+ title:
+ type: 'string'
+ url:
+ type: 'string'
+ required:
+ - 'url'
+ type: 'object'
+ required:
+ - 'type'
+ - 'url_citation'
+ type: 'object'
DecisionsUsageInputTokensDetails:
description: 'Of `input_tokens`, those the provider served from its prompt cache.'
properties:
@@ -31587,8 +31626,13 @@ components:
example: 'mistralai/voxtral-mini-tts-2603'
type: 'string'
provider:
- description: 'Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options'
+ description: 'Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options'
properties:
+ allow_fallbacks:
+ description: "Whether to allow backup providers to serve requests\n- true: (default) when the primary provider (or your custom providers in \"order\") is unavailable, use the next best provider.\n- false: use only the primary/custom provider, and return the upstream error if it's unavailable.\n"
+ type:
+ - 'boolean'
+ - 'null'
data_collection:
description: "Data collection setting. If no available model provider meets the requirement, your request will return an error.\n- allow: (default) allow providers which store user data non-transiently and may train on it\n\n- deny: use only providers which do not collect user data."
enum:
@@ -31601,8 +31645,44 @@ components:
- 'string'
- 'null'
x-speakeasy-unknown-values: allow
+ ignore:
+ description: 'List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.'
+ example:
+ - 'openai'
+ - 'anthropic'
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/ProviderName'
+ - type: 'string'
+ type:
+ - 'array'
+ - 'null'
+ only:
+ description: 'List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.'
+ example:
+ - 'openai'
+ - 'anthropic'
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/ProviderName'
+ - type: 'string'
+ type:
+ - 'array'
+ - 'null'
options:
$ref: '#/components/schemas/ProviderOptions'
+ order:
+ description: 'An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.'
+ example:
+ - 'openai'
+ - 'anthropic'
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/ProviderName'
+ - type: 'string'
+ type:
+ - 'array'
+ - 'null'
zdr:
description: 'Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used.'
example: true
@@ -32200,8 +32280,13 @@ components:
example: 'openai/whisper-large-v3'
type: 'string'
provider:
- description: 'Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options'
+ description: 'Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options'
properties:
+ allow_fallbacks:
+ description: "Whether to allow backup providers to serve requests\n- true: (default) when the primary provider (or your custom providers in \"order\") is unavailable, use the next best provider.\n- false: use only the primary/custom provider, and return the upstream error if it's unavailable.\n"
+ type:
+ - 'boolean'
+ - 'null'
data_collection:
description: "Data collection setting. If no available model provider meets the requirement, your request will return an error.\n- allow: (default) allow providers which store user data non-transiently and may train on it\n\n- deny: use only providers which do not collect user data."
enum:
@@ -32214,8 +32299,44 @@ components:
- 'string'
- 'null'
x-speakeasy-unknown-values: allow
+ ignore:
+ description: 'List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.'
+ example:
+ - 'openai'
+ - 'anthropic'
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/ProviderName'
+ - type: 'string'
+ type:
+ - 'array'
+ - 'null'
+ only:
+ description: 'List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.'
+ example:
+ - 'openai'
+ - 'anthropic'
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/ProviderName'
+ - type: 'string'
+ type:
+ - 'array'
+ - 'null'
options:
$ref: '#/components/schemas/ProviderOptions'
+ order:
+ description: 'An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.'
+ example:
+ - 'openai'
+ - 'anthropic'
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/ProviderName'
+ - type: 'string'
+ type:
+ - 'array'
+ - 'null'
zdr:
description: 'Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used.'
example: true
diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock
index 4a530d87..25731d0a 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:270fc87d246d3c0aae8ed0dc177f71a2ac5ab6d8a9d159374587dd7f47b71843
- sourceBlobDigest: sha256:b2e03dfdbedaa98c8829f3895d84615b1bfae6f3eb6dde39dde7d6e51648d1e1
+ sourceRevisionDigest: sha256:263bfe509d827a14df7d6fd4751900eaac8a6862d1c19fe8b51ec447e4a61d34
+ sourceBlobDigest: sha256:e52279af6226c0914fb502f1843badb6c37eed9d359af170c5de580a14d7ab1c
tags:
- latest
- 1.0.0
@@ -11,10 +11,10 @@ targets:
open-router:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
- sourceRevisionDigest: sha256:270fc87d246d3c0aae8ed0dc177f71a2ac5ab6d8a9d159374587dd7f47b71843
- sourceBlobDigest: sha256:b2e03dfdbedaa98c8829f3895d84615b1bfae6f3eb6dde39dde7d6e51648d1e1
+ sourceRevisionDigest: sha256:263bfe509d827a14df7d6fd4751900eaac8a6862d1c19fe8b51ec447e4a61d34
+ sourceBlobDigest: sha256:e52279af6226c0914fb502f1843badb6c37eed9d359af170c5de580a14d7ab1c
codeSamplesNamespace: open-router-python-code-samples
- codeSamplesRevisionDigest: sha256:4da37ce693bd87fea87c9e730f88fae9a3a55b038b2b9b99d96dfefa1b63396a
+ codeSamplesRevisionDigest: sha256:54631d79160710b2a2a6917f6a32aaf2231d8f815e622559df9945381e9e47c1
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.803.2
diff --git a/RELEASES.md b/RELEASES.md
index 37b54415..66c3323b 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -3949,4 +3949,14 @@ Based on:
### Generated
- [python v1.3.118] .
### Releases
-- [PyPI v1.3.118] https://pypi.org/project/openrouter/1.3.118 - .
\ No newline at end of file
+- [PyPI v1.3.118] https://pypi.org/project/openrouter/1.3.118 - .
+
+## 2026-11-04 20:32:29
+### Changes
+Based on:
+- OpenAPI Doc
+- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy
+### Generated
+- [python v1.3.119] .
+### Releases
+- [PyPI v1.3.119] https://pypi.org/project/openrouter/1.3.119 - .
\ No newline at end of file
diff --git a/docs/components/decisionsrefusalanswer.mdx b/docs/components/decisionsrefusalanswer.mdx
new file mode 100644
index 00000000..f02718af
--- /dev/null
+++ b/docs/components/decisionsrefusalanswer.mdx
@@ -0,0 +1,12 @@
+---
+title: "DecisionsRefusalAnswer"
+---
+
+The provider declined to answer this question; no value or probabilities are returned. Other questions in the same request can still have answers.
+
+
+## Fields
+
+| Field | Type | Required | Description |
+| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
+| `type` | [components.DecisionsRefusalAnswerType](../components/decisionsrefusalanswertype.mdx) | ✔️ | N/A |
\ No newline at end of file
diff --git a/docs/components/decisionsrefusalanswertype.mdx b/docs/components/decisionsrefusalanswertype.mdx
new file mode 100644
index 00000000..ce9bd364
--- /dev/null
+++ b/docs/components/decisionsrefusalanswertype.mdx
@@ -0,0 +1,15 @@
+---
+title: "DecisionsRefusalAnswerType"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import DecisionsRefusalAnswerType
+value: DecisionsRefusalAnswerType = "refusal"
+```
+
+
+## Values
+
+- `"refusal"`
diff --git a/docs/components/decisionsresponse.mdx b/docs/components/decisionsresponse.mdx
index 8ebd49f4..754c6e54 100644
--- a/docs/components/decisionsresponse.mdx
+++ b/docs/components/decisionsresponse.mdx
@@ -4,10 +4,11 @@ title: "DecisionsResponse"
## Fields
-| Field | Type | Required | Description |
-| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
-| `answers` | Dict[str, [components.DecisionsResponseAnswers](../components/decisionsresponseanswers.mdx)] | ✔️ | N/A |
-| `id` | *Optional[str]* | ➖ | N/A |
-| `model` | *str* | ✔️ | N/A |
-| `provider` | *Optional[str]* | ➖ | N/A |
-| `usage` | [components.DecisionsResponseUsage](../components/decisionsresponseusage.mdx) | ✔️ | N/A |
\ No newline at end of file
+| Field | Type | Required | Description |
+| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
+| `annotations` | List[[components.DecisionsURLCitationAnnotation](../components/decisionsurlcitationannotation.mdx)] | ➖ | Sources for the request as a whole, when the provider returns them. Not attributed to individual answers. |
+| `answers` | Dict[str, [components.DecisionsResponseAnswers](../components/decisionsresponseanswers.mdx)] | ✔️ | N/A |
+| `id` | *Optional[str]* | ➖ | N/A |
+| `model` | *str* | ✔️ | N/A |
+| `provider` | *Optional[str]* | ➖ | N/A |
+| `usage` | [components.DecisionsResponseUsage](../components/decisionsresponseusage.mdx) | ✔️ | N/A |
\ No newline at end of file
diff --git a/docs/components/decisionsresponseanswers.mdx b/docs/components/decisionsresponseanswers.mdx
index 0aa4353a..48ba476c 100644
--- a/docs/components/decisionsresponseanswers.mdx
+++ b/docs/components/decisionsresponseanswers.mdx
@@ -2,7 +2,7 @@
title: "DecisionsResponseAnswers"
---
-A Decisions answer using a boolean, choice, score, or image bounding-box evaluation.
+A Decisions answer using a boolean, choice, score, or image bounding-box evaluation, or a refusal of that question.
## Supported Types
@@ -25,6 +25,12 @@ value: components.DecisionsChoiceAnswer = /* values here */
value: components.DecisionsNoulAnswer = /* values here */
```
+### `components.DecisionsRefusalAnswer`
+
+```python
+value: components.DecisionsRefusalAnswer = /* values here */
+```
+
### `components.DecisionsScoreAnswer`
```python
diff --git a/docs/components/decisionsurlcitationannotation.mdx b/docs/components/decisionsurlcitationannotation.mdx
new file mode 100644
index 00000000..d69c176a
--- /dev/null
+++ b/docs/components/decisionsurlcitationannotation.mdx
@@ -0,0 +1,13 @@
+---
+title: "DecisionsURLCitationAnnotation"
+---
+
+A web source the provider used for this request. Applies to the whole request, not to a specific answer.
+
+
+## Fields
+
+| Field | Type | Required | Description |
+| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
+| `type` | [components.DecisionsURLCitationAnnotationType](../components/decisionsurlcitationannotationtype.mdx) | ✔️ | N/A |
+| `url_citation` | [components.DecisionsURLCitationAnnotationURLCitation](../components/decisionsurlcitationannotationurlcitation.mdx) | ✔️ | N/A |
\ No newline at end of file
diff --git a/docs/components/decisionsurlcitationannotationtype.mdx b/docs/components/decisionsurlcitationannotationtype.mdx
new file mode 100644
index 00000000..01a5fcfa
--- /dev/null
+++ b/docs/components/decisionsurlcitationannotationtype.mdx
@@ -0,0 +1,15 @@
+---
+title: "DecisionsURLCitationAnnotationType"
+---
+
+## Example Usage
+
+```python
+from openrouter.components import DecisionsURLCitationAnnotationType
+value: DecisionsURLCitationAnnotationType = "url_citation"
+```
+
+
+## Values
+
+- `"url_citation"`
diff --git a/docs/components/decisionsurlcitationannotationurlcitation.mdx b/docs/components/decisionsurlcitationannotationurlcitation.mdx
new file mode 100644
index 00000000..14722dc2
--- /dev/null
+++ b/docs/components/decisionsurlcitationannotationurlcitation.mdx
@@ -0,0 +1,11 @@
+---
+title: "DecisionsURLCitationAnnotationURLCitation"
+---
+
+## Fields
+
+| Field | Type | Required | Description |
+| ------------------ | ------------------ | ------------------ | ------------------ |
+| `content` | *Optional[str]* | ➖ | N/A |
+| `title` | *Optional[str]* | ➖ | N/A |
+| `url` | *str* | ✔️ | N/A |
\ No newline at end of file
diff --git a/docs/components/speechrequest.mdx b/docs/components/speechrequest.mdx
index f559f115..f336273b 100644
--- a/docs/components/speechrequest.mdx
+++ b/docs/components/speechrequest.mdx
@@ -13,7 +13,7 @@ Text-to-speech request input
| `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), plus at most one `image_url` part as a scene image on providers that condition the cloned voice on its setting; only routed to endpoints that support voice cloning (and multiple references or image references when those parts are sent). Image mode: exactly one `image_url` part; only routed to endpoints that support image references. 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, 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 | |
+| `provider` | [Optional[components.SpeechRequestProvider]](../components/speechrequestprovider.mdx) | ➖ | Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), 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 |
| `speed` | *Optional[float]* | ➖ | Playback speed multiplier. Honored by models that support it (e.g. OpenAI TTS). Other providers either ignore it or return a 400 for a non-default value when the model has no speed control. | 1 |
diff --git a/docs/components/speechrequestignore.mdx b/docs/components/speechrequestignore.mdx
new file mode 100644
index 00000000..f8c411cf
--- /dev/null
+++ b/docs/components/speechrequestignore.mdx
@@ -0,0 +1,18 @@
+---
+title: "SpeechRequestIgnore"
+---
+
+## Supported Types
+
+### `components.ProviderName`
+
+```python
+value: components.ProviderName = /* values here */
+```
+
+### `str`
+
+```python
+value: str = /* values here */
+```
+
diff --git a/docs/components/speechrequestonly.mdx b/docs/components/speechrequestonly.mdx
new file mode 100644
index 00000000..3f833504
--- /dev/null
+++ b/docs/components/speechrequestonly.mdx
@@ -0,0 +1,18 @@
+---
+title: "SpeechRequestOnly"
+---
+
+## Supported Types
+
+### `components.ProviderName`
+
+```python
+value: components.ProviderName = /* values here */
+```
+
+### `str`
+
+```python
+value: str = /* values here */
+```
+
diff --git a/docs/components/speechrequestorder.mdx b/docs/components/speechrequestorder.mdx
new file mode 100644
index 00000000..d519ecc0
--- /dev/null
+++ b/docs/components/speechrequestorder.mdx
@@ -0,0 +1,18 @@
+---
+title: "SpeechRequestOrder"
+---
+
+## Supported Types
+
+### `components.ProviderName`
+
+```python
+value: components.ProviderName = /* values here */
+```
+
+### `str`
+
+```python
+value: str = /* values here */
+```
+
diff --git a/docs/components/speechrequestprovider.mdx b/docs/components/speechrequestprovider.mdx
index f2348328..bd91e8ae 100644
--- a/docs/components/speechrequestprovider.mdx
+++ b/docs/components/speechrequestprovider.mdx
@@ -2,13 +2,17 @@
title: "SpeechRequestProvider"
---
-Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options
+Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options
## Fields
-| Field | Type | Required | Description | Example |
-| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| `data_collection` | [OptionalNullable[components.SpeechRequestDataCollection]](../components/speechrequestdatacollection.mdx) | ➖ | Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it
- deny: use only providers which do not collect user data. | allow |
-| `options` | [Optional[components.ProviderOptions]](../components/provideroptions.mdx) | ➖ | Provider-specific options keyed by provider slug. The provider segment is case-insensitive; an endpoint tag after `/` must match the endpoint slug exactly. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped. | \{
"openai": \{
"max_tokens": 1000
}
} |
-| `zdr` | *OptionalNullable[bool]* | ➖ | Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. | true |
\ No newline at end of file
+| Field | Type | Required | Description | Example |
+| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| `allow_fallbacks` | *OptionalNullable[bool]* | ➖ | Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
| |
+| `data_collection` | [OptionalNullable[components.SpeechRequestDataCollection]](../components/speechrequestdatacollection.mdx) | ➖ | Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it
- deny: use only providers which do not collect user data. | allow |
+| `ignore` | List[[components.SpeechRequestIgnore](../components/speechrequestignore.mdx)] | ➖ | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | [
"openai",
"anthropic"
] |
+| `only` | List[[components.SpeechRequestOnly](../components/speechrequestonly.mdx)] | ➖ | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. | [
"openai",
"anthropic"
] |
+| `options` | [Optional[components.ProviderOptions]](../components/provideroptions.mdx) | ➖ | Provider-specific options keyed by provider slug. The provider segment is case-insensitive; an endpoint tag after `/` must match the endpoint slug exactly. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped. | \{
"openai": \{
"max_tokens": 1000
}
} |
+| `order` | List[[components.SpeechRequestOrder](../components/speechrequestorder.mdx)] | ➖ | An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. | [
"openai",
"anthropic"
] |
+| `zdr` | *OptionalNullable[bool]* | ➖ | Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. | true |
\ No newline at end of file
diff --git a/docs/components/sttrequest.mdx b/docs/components/sttrequest.mdx
index c250e390..b2794f52 100644
--- a/docs/components/sttrequest.mdx
+++ b/docs/components/sttrequest.mdx
@@ -14,7 +14,7 @@ Speech-to-text request input. Accepts a JSON body with input_audio containing ba
| `keyterms` | List[*str*] | ➖ | Domain terms, names, or phrases to bias recognition toward. Only supported by some providers; the request is rejected with a 400 when the selected model cannot use keyterms. Providers may cap the number of terms or characters per term and may charge extra. | [
"OpenRouter",
"Scribe"
] |
| `language` | *Optional[str]* | ➖ | ISO-639-1 language code (e.g., "en", "ja"). Auto-detected if omitted. | en |
| `model` | *str* | ✔️ | STT model identifier | openai/whisper-large-v3 |
-| `provider` | [Optional[components.STTRequestProvider]](../components/sttrequestprovider.mdx) | ➖ | Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options | |
+| `provider` | [Optional[components.STTRequestProvider]](../components/sttrequestprovider.mdx) | ➖ | Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options | |
| `response_format` | [Optional[components.STTRequestResponseFormat]](../components/sttrequestresponseformat.mdx) | ➖ | Output format. "json" (default) returns \{ text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers. | json |
| `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 |
| `temperature` | *Optional[float]* | ➖ | Sampling temperature for transcription | 0 |
diff --git a/docs/components/sttrequestignore.mdx b/docs/components/sttrequestignore.mdx
new file mode 100644
index 00000000..bbad38dd
--- /dev/null
+++ b/docs/components/sttrequestignore.mdx
@@ -0,0 +1,18 @@
+---
+title: "STTRequestIgnore"
+---
+
+## Supported Types
+
+### `components.ProviderName`
+
+```python
+value: components.ProviderName = /* values here */
+```
+
+### `str`
+
+```python
+value: str = /* values here */
+```
+
diff --git a/docs/components/sttrequestonly.mdx b/docs/components/sttrequestonly.mdx
new file mode 100644
index 00000000..8098851b
--- /dev/null
+++ b/docs/components/sttrequestonly.mdx
@@ -0,0 +1,18 @@
+---
+title: "STTRequestOnly"
+---
+
+## Supported Types
+
+### `components.ProviderName`
+
+```python
+value: components.ProviderName = /* values here */
+```
+
+### `str`
+
+```python
+value: str = /* values here */
+```
+
diff --git a/docs/components/sttrequestorder.mdx b/docs/components/sttrequestorder.mdx
new file mode 100644
index 00000000..48950a7e
--- /dev/null
+++ b/docs/components/sttrequestorder.mdx
@@ -0,0 +1,18 @@
+---
+title: "STTRequestOrder"
+---
+
+## Supported Types
+
+### `components.ProviderName`
+
+```python
+value: components.ProviderName = /* values here */
+```
+
+### `str`
+
+```python
+value: str = /* values here */
+```
+
diff --git a/docs/components/sttrequestprovider.mdx b/docs/components/sttrequestprovider.mdx
index 36887cf2..52987a53 100644
--- a/docs/components/sttrequestprovider.mdx
+++ b/docs/components/sttrequestprovider.mdx
@@ -2,13 +2,17 @@
title: "STTRequestProvider"
---
-Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options
+Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options
## Fields
-| Field | Type | Required | Description | Example |
-| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| `data_collection` | [OptionalNullable[components.STTRequestDataCollection]](../components/sttrequestdatacollection.mdx) | ➖ | Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it
- deny: use only providers which do not collect user data. | allow |
-| `options` | [Optional[components.ProviderOptions]](../components/provideroptions.mdx) | ➖ | Provider-specific options keyed by provider slug. The provider segment is case-insensitive; an endpoint tag after `/` must match the endpoint slug exactly. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped. | \{
"openai": \{
"max_tokens": 1000
}
} |
-| `zdr` | *OptionalNullable[bool]* | ➖ | Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. | true |
\ No newline at end of file
+| Field | Type | Required | Description | Example |
+| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| `allow_fallbacks` | *OptionalNullable[bool]* | ➖ | Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
| |
+| `data_collection` | [OptionalNullable[components.STTRequestDataCollection]](../components/sttrequestdatacollection.mdx) | ➖ | Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it
- deny: use only providers which do not collect user data. | allow |
+| `ignore` | List[[components.STTRequestIgnore](../components/sttrequestignore.mdx)] | ➖ | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | [
"openai",
"anthropic"
] |
+| `only` | List[[components.STTRequestOnly](../components/sttrequestonly.mdx)] | ➖ | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. | [
"openai",
"anthropic"
] |
+| `options` | [Optional[components.ProviderOptions]](../components/provideroptions.mdx) | ➖ | Provider-specific options keyed by provider slug. The provider segment is case-insensitive; an endpoint tag after `/` must match the endpoint slug exactly. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped. | \{
"openai": \{
"max_tokens": 1000
}
} |
+| `order` | List[[components.STTRequestOrder](../components/sttrequestorder.mdx)] | ➖ | An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. | [
"openai",
"anthropic"
] |
+| `zdr` | *OptionalNullable[bool]* | ➖ | Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. | true |
\ No newline at end of file
diff --git a/docs/sdks/stt/README.mdx b/docs/sdks/stt/README.mdx
index 5ed45eda..0133c3a1 100644
--- a/docs/sdks/stt/README.mdx
+++ b/docs/sdks/stt/README.mdx
@@ -52,7 +52,7 @@ with OpenRouter(
| `diarize` | *Optional[bool]* | ➖ | Label each word with the speaker who said it. Speaker labels are returned on the words array (speaker, speaker_label), so response_format must be "verbose_json" (a "json" request is rejected with a 400) and word timestamps are included even when timestamp_granularities omits "word". Only supported by some providers; the request is rejected with a 400 when the selected model cannot diarize. Providers may charge extra. | true |
| `keyterms` | List[*str*] | ➖ | Domain terms, names, or phrases to bias recognition toward. Only supported by some providers; the request is rejected with a 400 when the selected model cannot use keyterms. Providers may cap the number of terms or characters per term and may charge extra. | [
"OpenRouter",
"Scribe"
] |
| `language` | *Optional[str]* | ➖ | ISO-639-1 language code (e.g., "en", "ja"). Auto-detected if omitted. | en |
-| `provider` | [Optional[components.STTRequestProvider]](../../components/sttrequestprovider.mdx) | ➖ | Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options | |
+| `provider` | [Optional[components.STTRequestProvider]](../../components/sttrequestprovider.mdx) | ➖ | Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options | |
| `response_format` | [Optional[components.STTRequestResponseFormat]](../../components/sttrequestresponseformat.mdx) | ➖ | Output format. "json" (default) returns \{ text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers. | json |
| `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 |
| `temperature` | *Optional[float]* | ➖ | Sampling temperature for transcription | 0 |
diff --git a/docs/sdks/tts/README.mdx b/docs/sdks/tts/README.mdx
index 7a8a90fa..656a52a7 100644
--- a/docs/sdks/tts/README.mdx
+++ b/docs/sdks/tts/README.mdx
@@ -47,7 +47,7 @@ with OpenRouter(
| `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), plus at most one `image_url` part as a scene image on providers that condition the cloned voice on its setting; only routed to endpoints that support voice cloning (and multiple references or image references when those parts are sent). Image mode: exactly one `image_url` part; only routed to endpoints that support image references. 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, 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 | |
+| `provider` | [Optional[components.SpeechRequestProvider]](../../components/speechrequestprovider.mdx) | ➖ | Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), 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 |
| `speed` | *Optional[float]* | ➖ | Playback speed multiplier. Honored by models that support it (e.g. OpenAI TTS). Other providers either ignore it or return a 400 for a non-default value when the model has no speed control. | 1 |
diff --git a/pyproject.toml b/pyproject.toml
index 605c91f8..46dcc28a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "openrouter"
-version = "1.3.118"
+version = "1.3.119"
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 1d94cdc5..3dd25ead 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.118"
+__version__: str = "1.3.119"
__openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.950.13"
-__user_agent__: str = "speakeasy-sdk/python 1.3.118 2.950.13 1.0.0 openrouter"
+__user_agent__: str = "speakeasy-sdk/python 1.3.119 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 a1b3836b..dbb7fcac 100644
--- a/src/openrouter/components/__init__.py
+++ b/src/openrouter/components/__init__.py
@@ -1678,6 +1678,11 @@
TrueT,
TrueTTypedDict,
)
+ from .decisionsrefusalanswer import (
+ DecisionsRefusalAnswer,
+ DecisionsRefusalAnswerType,
+ DecisionsRefusalAnswerTypedDict,
+ )
from .decisionsrequest import (
DecisionsRequest,
DecisionsRequestTypedDict,
@@ -1711,6 +1716,13 @@
DecisionsScoreQuestionType,
DecisionsScoreQuestionTypedDict,
)
+ from .decisionsurlcitationannotation import (
+ DecisionsURLCitationAnnotation,
+ DecisionsURLCitationAnnotationType,
+ DecisionsURLCitationAnnotationTypedDict,
+ DecisionsURLCitationAnnotationURLCitation,
+ DecisionsURLCitationAnnotationURLCitationTypedDict,
+ )
from .decisionsusageinputtokensdetails import (
DecisionsUsageInputTokensDetails,
DecisionsUsageInputTokensDetailsTypedDict,
@@ -4183,6 +4195,12 @@
from .speechrequest import (
SpeechRequest,
SpeechRequestDataCollection,
+ SpeechRequestIgnore,
+ SpeechRequestIgnoreTypedDict,
+ SpeechRequestOnly,
+ SpeechRequestOnlyTypedDict,
+ SpeechRequestOrder,
+ SpeechRequestOrderTypedDict,
SpeechRequestProvider,
SpeechRequestProviderTypedDict,
SpeechRequestResponseFormat,
@@ -4262,6 +4280,12 @@
from .sttrequest import (
STTRequest,
STTRequestDataCollection,
+ STTRequestIgnore,
+ STTRequestIgnoreTypedDict,
+ STTRequestOnly,
+ STTRequestOnlyTypedDict,
+ STTRequestOrder,
+ STTRequestOrderTypedDict,
STTRequestProvider,
STTRequestProviderTypedDict,
STTRequestResponseFormat,
@@ -5890,6 +5914,9 @@
"DecisionsNoulQuestionInstructionsTypedDict",
"DecisionsNoulQuestionType",
"DecisionsNoulQuestionTypedDict",
+ "DecisionsRefusalAnswer",
+ "DecisionsRefusalAnswerType",
+ "DecisionsRefusalAnswerTypedDict",
"DecisionsRequest",
"DecisionsRequestTypedDict",
"DecisionsResponse",
@@ -5907,6 +5934,11 @@
"DecisionsScoreQuestionType",
"DecisionsScoreQuestionTypedDict",
"DecisionsTypedDict",
+ "DecisionsURLCitationAnnotation",
+ "DecisionsURLCitationAnnotationType",
+ "DecisionsURLCitationAnnotationTypedDict",
+ "DecisionsURLCitationAnnotationURLCitation",
+ "DecisionsURLCitationAnnotationURLCitationTypedDict",
"DecisionsUsageInputTokensDetails",
"DecisionsUsageInputTokensDetailsTypedDict",
"DefaultEffort",
@@ -7608,6 +7640,12 @@
"STTInputAudioTypedDict",
"STTRequest",
"STTRequestDataCollection",
+ "STTRequestIgnore",
+ "STTRequestIgnoreTypedDict",
+ "STTRequestOnly",
+ "STTRequestOnlyTypedDict",
+ "STTRequestOrder",
+ "STTRequestOrderTypedDict",
"STTRequestProvider",
"STTRequestProviderTypedDict",
"STTRequestResponseFormat",
@@ -7746,6 +7784,12 @@
"SpeechInputTypedDict",
"SpeechRequest",
"SpeechRequestDataCollection",
+ "SpeechRequestIgnore",
+ "SpeechRequestIgnoreTypedDict",
+ "SpeechRequestOnly",
+ "SpeechRequestOnlyTypedDict",
+ "SpeechRequestOrder",
+ "SpeechRequestOrderTypedDict",
"SpeechRequestProvider",
"SpeechRequestProviderTypedDict",
"SpeechRequestResponseFormat",
@@ -9446,6 +9490,9 @@
"FalseTTypedDict": ".decisionsnoulquestion",
"TrueT": ".decisionsnoulquestion",
"TrueTTypedDict": ".decisionsnoulquestion",
+ "DecisionsRefusalAnswer": ".decisionsrefusalanswer",
+ "DecisionsRefusalAnswerType": ".decisionsrefusalanswer",
+ "DecisionsRefusalAnswerTypedDict": ".decisionsrefusalanswer",
"DecisionsRequest": ".decisionsrequest",
"DecisionsRequestTypedDict": ".decisionsrequest",
"Questions": ".decisionsrequest",
@@ -9471,6 +9518,11 @@
"DecisionsScoreQuestionInstructionsTypedDict": ".decisionsscorequestion",
"DecisionsScoreQuestionType": ".decisionsscorequestion",
"DecisionsScoreQuestionTypedDict": ".decisionsscorequestion",
+ "DecisionsURLCitationAnnotation": ".decisionsurlcitationannotation",
+ "DecisionsURLCitationAnnotationType": ".decisionsurlcitationannotation",
+ "DecisionsURLCitationAnnotationTypedDict": ".decisionsurlcitationannotation",
+ "DecisionsURLCitationAnnotationURLCitation": ".decisionsurlcitationannotation",
+ "DecisionsURLCitationAnnotationURLCitationTypedDict": ".decisionsurlcitationannotation",
"DecisionsUsageInputTokensDetails": ".decisionsusageinputtokensdetails",
"DecisionsUsageInputTokensDetailsTypedDict": ".decisionsusageinputtokensdetails",
"DefaultParameters": ".defaultparameters",
@@ -11354,6 +11406,12 @@
"SpeechInputReferenceTextTypedDict": ".speechinputreferencetext",
"SpeechRequest": ".speechrequest",
"SpeechRequestDataCollection": ".speechrequest",
+ "SpeechRequestIgnore": ".speechrequest",
+ "SpeechRequestIgnoreTypedDict": ".speechrequest",
+ "SpeechRequestOnly": ".speechrequest",
+ "SpeechRequestOnlyTypedDict": ".speechrequest",
+ "SpeechRequestOrder": ".speechrequest",
+ "SpeechRequestOrderTypedDict": ".speechrequest",
"SpeechRequestProvider": ".speechrequest",
"SpeechRequestProviderTypedDict": ".speechrequest",
"SpeechRequestResponseFormat": ".speechrequest",
@@ -11413,6 +11471,12 @@
"STTInputAudioTypedDict": ".sttinputaudio",
"STTRequest": ".sttrequest",
"STTRequestDataCollection": ".sttrequest",
+ "STTRequestIgnore": ".sttrequest",
+ "STTRequestIgnoreTypedDict": ".sttrequest",
+ "STTRequestOnly": ".sttrequest",
+ "STTRequestOnlyTypedDict": ".sttrequest",
+ "STTRequestOrder": ".sttrequest",
+ "STTRequestOrderTypedDict": ".sttrequest",
"STTRequestProvider": ".sttrequest",
"STTRequestProviderTypedDict": ".sttrequest",
"STTRequestResponseFormat": ".sttrequest",
diff --git a/src/openrouter/components/decisionsrefusalanswer.py b/src/openrouter/components/decisionsrefusalanswer.py
new file mode 100644
index 00000000..e556e20a
--- /dev/null
+++ b/src/openrouter/components/decisionsrefusalanswer.py
@@ -0,0 +1,21 @@
+"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
+
+from __future__ import annotations
+from openrouter.types import BaseModel
+from typing import Literal
+from typing_extensions import TypedDict
+
+
+DecisionsRefusalAnswerType = Literal["refusal",]
+
+
+class DecisionsRefusalAnswerTypedDict(TypedDict):
+ r"""The provider declined to answer this question; no value or probabilities are returned. Other questions in the same request can still have answers."""
+
+ type: DecisionsRefusalAnswerType
+
+
+class DecisionsRefusalAnswer(BaseModel):
+ r"""The provider declined to answer this question; no value or probabilities are returned. Other questions in the same request can still have answers."""
+
+ type: DecisionsRefusalAnswerType
diff --git a/src/openrouter/components/decisionsresponse.py b/src/openrouter/components/decisionsresponse.py
index 15c3083b..49dfac71 100644
--- a/src/openrouter/components/decisionsresponse.py
+++ b/src/openrouter/components/decisionsresponse.py
@@ -4,7 +4,15 @@
from .decisionsboxanswer import DecisionsBoxAnswer, DecisionsBoxAnswerTypedDict
from .decisionschoiceanswer import DecisionsChoiceAnswer, DecisionsChoiceAnswerTypedDict
from .decisionsnoulanswer import DecisionsNoulAnswer, DecisionsNoulAnswerTypedDict
+from .decisionsrefusalanswer import (
+ DecisionsRefusalAnswer,
+ DecisionsRefusalAnswerTypedDict,
+)
from .decisionsscoreanswer import DecisionsScoreAnswer, DecisionsScoreAnswerTypedDict
+from .decisionsurlcitationannotation import (
+ DecisionsURLCitationAnnotation,
+ DecisionsURLCitationAnnotationTypedDict,
+)
from .decisionsusageinputtokensdetails import (
DecisionsUsageInputTokensDetails,
DecisionsUsageInputTokensDetailsTypedDict,
@@ -14,20 +22,21 @@
from openrouter.utils.unions import parse_open_union
from pydantic import ConfigDict, model_serializer
from pydantic.functional_validators import BeforeValidator
-from typing import Any, Dict, Literal, Optional, Union
+from typing import Any, Dict, List, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
DecisionsResponseAnswersTypedDict = TypeAliasType(
"DecisionsResponseAnswersTypedDict",
Union[
+ DecisionsRefusalAnswerTypedDict,
DecisionsNoulAnswerTypedDict,
DecisionsBoxAnswerTypedDict,
DecisionsChoiceAnswerTypedDict,
DecisionsScoreAnswerTypedDict,
],
)
-r"""A Decisions answer using a boolean, choice, score, or image bounding-box evaluation."""
+r"""A Decisions answer using a boolean, choice, score, or image bounding-box evaluation, or a refusal of that question."""
class UnknownDecisionsResponseAnswers(BaseModel):
@@ -44,6 +53,7 @@ class UnknownDecisionsResponseAnswers(BaseModel):
"box": DecisionsBoxAnswer,
"choice": DecisionsChoiceAnswer,
"noul": DecisionsNoulAnswer,
+ "refusal": DecisionsRefusalAnswer,
"score": DecisionsScoreAnswer,
}
@@ -53,6 +63,7 @@ class UnknownDecisionsResponseAnswers(BaseModel):
DecisionsBoxAnswer,
DecisionsChoiceAnswer,
DecisionsNoulAnswer,
+ DecisionsRefusalAnswer,
DecisionsScoreAnswer,
UnknownDecisionsResponseAnswers,
],
@@ -66,7 +77,7 @@ class UnknownDecisionsResponseAnswers(BaseModel):
)
),
]
-r"""A Decisions answer using a boolean, choice, score, or image bounding-box evaluation."""
+r"""A Decisions answer using a boolean, choice, score, or image bounding-box evaluation, or a refusal of that question."""
class DecisionsResponseUsageTypedDict(TypedDict):
@@ -108,6 +119,8 @@ class DecisionsResponseTypedDict(TypedDict):
answers: Dict[str, DecisionsResponseAnswersTypedDict]
model: str
usage: DecisionsResponseUsageTypedDict
+ annotations: NotRequired[List[DecisionsURLCitationAnnotationTypedDict]]
+ r"""Sources for the request as a whole, when the provider returns them. Not attributed to individual answers."""
id: NotRequired[str]
provider: NotRequired[str]
@@ -119,13 +132,16 @@ class DecisionsResponse(BaseModel):
usage: DecisionsResponseUsage
+ annotations: Optional[List[DecisionsURLCitationAnnotation]] = None
+ r"""Sources for the request as a whole, when the provider returns them. Not attributed to individual answers."""
+
id: Optional[str] = None
provider: Optional[str] = None
@model_serializer(mode="wrap")
def serialize_model(self, handler):
- optional_fields = set(["id", "provider"])
+ optional_fields = set(["annotations", "id", "provider"])
serialized = handler(self)
m = {}
diff --git a/src/openrouter/components/decisionsurlcitationannotation.py b/src/openrouter/components/decisionsurlcitationannotation.py
new file mode 100644
index 00000000..840940e6
--- /dev/null
+++ b/src/openrouter/components/decisionsurlcitationannotation.py
@@ -0,0 +1,55 @@
+"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
+
+from __future__ import annotations
+from openrouter.types import BaseModel, UNSET_SENTINEL
+from pydantic import model_serializer
+from typing import Literal, Optional
+from typing_extensions import NotRequired, TypedDict
+
+
+DecisionsURLCitationAnnotationType = Literal["url_citation",]
+
+
+class DecisionsURLCitationAnnotationURLCitationTypedDict(TypedDict):
+ url: str
+ content: NotRequired[str]
+ title: NotRequired[str]
+
+
+class DecisionsURLCitationAnnotationURLCitation(BaseModel):
+ url: str
+
+ content: Optional[str] = None
+
+ title: Optional[str] = None
+
+ @model_serializer(mode="wrap")
+ def serialize_model(self, handler):
+ optional_fields = set(["content", "title"])
+ serialized = handler(self)
+ m = {}
+
+ for n, f in type(self).model_fields.items():
+ k = f.alias or n
+ val = serialized.get(k, serialized.get(n))
+
+ if val != UNSET_SENTINEL:
+ if val is not None or k not in optional_fields:
+ m[k] = val
+
+ return m
+
+
+class DecisionsURLCitationAnnotationTypedDict(TypedDict):
+ r"""A web source the provider used for this request. Applies to the whole request, not to a specific answer."""
+
+ type: DecisionsURLCitationAnnotationType
+ url_citation: DecisionsURLCitationAnnotationURLCitationTypedDict
+
+
+class DecisionsURLCitationAnnotation(BaseModel):
+ r"""A web source the provider used for this request. Applies to the whole request, not to a specific answer."""
+
+ type: DecisionsURLCitationAnnotationType
+
+ url_citation: DecisionsURLCitationAnnotationURLCitation
diff --git a/src/openrouter/components/speechrequest.py b/src/openrouter/components/speechrequest.py
index ab487196..76ecc537 100644
--- a/src/openrouter/components/speechrequest.py
+++ b/src/openrouter/components/speechrequest.py
@@ -1,6 +1,7 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
+from .providername import ProviderName
from .provideroptions import ProviderOptions, ProviderOptionsTypedDict
from .speechinput import SpeechInput, SpeechInputTypedDict
from .speechinputreference import SpeechInputReference, SpeechInputReferenceTypedDict
@@ -15,7 +16,7 @@
)
from pydantic import model_serializer
from typing import List, Literal, Optional, Union
-from typing_extensions import NotRequired, TypedDict
+from typing_extensions import NotRequired, TypeAliasType, TypedDict
SpeechRequestDataCollection = Union[
@@ -32,23 +33,66 @@
"""
+SpeechRequestIgnoreTypedDict = TypeAliasType(
+ "SpeechRequestIgnoreTypedDict", Union[ProviderName, str]
+)
+
+
+SpeechRequestIgnore = TypeAliasType("SpeechRequestIgnore", Union[ProviderName, str])
+
+
+SpeechRequestOnlyTypedDict = TypeAliasType(
+ "SpeechRequestOnlyTypedDict", Union[ProviderName, str]
+)
+
+
+SpeechRequestOnly = TypeAliasType("SpeechRequestOnly", Union[ProviderName, str])
+
+
+SpeechRequestOrderTypedDict = TypeAliasType(
+ "SpeechRequestOrderTypedDict", Union[ProviderName, str]
+)
+
+
+SpeechRequestOrder = TypeAliasType("SpeechRequestOrder", Union[ProviderName, str])
+
+
class SpeechRequestProviderTypedDict(TypedDict):
- r"""Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options"""
+ r"""Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options"""
+
+ allow_fallbacks: NotRequired[Nullable[bool]]
+ r"""Whether to allow backup providers to serve requests
+ - true: (default) when the primary provider (or your custom providers in \"order\") is unavailable, use the next best provider.
+ - false: use only the primary/custom provider, and return the upstream error if it's unavailable.
+ """
data_collection: NotRequired[Nullable[SpeechRequestDataCollection]]
r"""Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it
- deny: use only providers which do not collect user data.
"""
+ ignore: NotRequired[Nullable[List[SpeechRequestIgnoreTypedDict]]]
+ r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."""
+ only: NotRequired[Nullable[List[SpeechRequestOnlyTypedDict]]]
+ r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."""
options: NotRequired[ProviderOptionsTypedDict]
r"""Provider-specific options keyed by provider slug. The provider segment is case-insensitive; an endpoint tag after `/` must match the endpoint slug exactly. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped."""
+ order: NotRequired[Nullable[List[SpeechRequestOrderTypedDict]]]
+ r"""An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message."""
zdr: NotRequired[Nullable[bool]]
r"""Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used."""
class SpeechRequestProvider(BaseModel):
- r"""Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options"""
+ r"""Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options"""
+
+ allow_fallbacks: OptionalNullable[bool] = UNSET
+ r"""Whether to allow backup providers to serve requests
+ - true: (default) when the primary provider (or your custom providers in \"order\") is unavailable, use the next best provider.
+ - false: use only the primary/custom provider, and return the upstream error if it's unavailable.
+
+ """
data_collection: OptionalNullable[SpeechRequestDataCollection] = UNSET
r"""Data collection setting. If no available model provider meets the requirement, your request will return an error.
@@ -57,16 +101,37 @@ class SpeechRequestProvider(BaseModel):
- deny: use only providers which do not collect user data.
"""
+ ignore: OptionalNullable[List[SpeechRequestIgnore]] = UNSET
+ r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."""
+
+ only: OptionalNullable[List[SpeechRequestOnly]] = UNSET
+ r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."""
+
options: Optional[ProviderOptions] = None
r"""Provider-specific options keyed by provider slug. The provider segment is case-insensitive; an endpoint tag after `/` must match the endpoint slug exactly. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped."""
+ order: OptionalNullable[List[SpeechRequestOrder]] = UNSET
+ r"""An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message."""
+
zdr: OptionalNullable[bool] = UNSET
r"""Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used."""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
- optional_fields = set(["data_collection", "options", "zdr"])
- nullable_fields = set(["data_collection", "zdr"])
+ optional_fields = set(
+ [
+ "allow_fallbacks",
+ "data_collection",
+ "ignore",
+ "only",
+ "options",
+ "order",
+ "zdr",
+ ]
+ )
+ nullable_fields = set(
+ ["allow_fallbacks", "data_collection", "ignore", "only", "order", "zdr"]
+ )
serialized = handler(self)
m = {}
@@ -111,7 +176,7 @@ class SpeechRequestTypedDict(TypedDict):
instructions: NotRequired[str]
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"""
+ r"""Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options"""
response_format: NotRequired[SpeechRequestResponseFormat]
r"""Audio output format"""
session_id: NotRequired[str]
@@ -142,7 +207,7 @@ class SpeechRequest(BaseModel):
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"""
+ r"""Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options"""
response_format: Optional[SpeechRequestResponseFormat] = "pcm"
r"""Audio output format"""
diff --git a/src/openrouter/components/sttrequest.py b/src/openrouter/components/sttrequest.py
index e19d9381..7bb4e08d 100644
--- a/src/openrouter/components/sttrequest.py
+++ b/src/openrouter/components/sttrequest.py
@@ -1,6 +1,7 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
+from .providername import ProviderName
from .provideroptions import ProviderOptions, ProviderOptionsTypedDict
from .sttinputaudio import STTInputAudio, STTInputAudioTypedDict
from .stttimestampgranularity import STTTimestampGranularity
@@ -15,7 +16,7 @@
)
from pydantic import model_serializer
from typing import List, Literal, Optional, Union
-from typing_extensions import NotRequired, TypedDict
+from typing_extensions import NotRequired, TypeAliasType, TypedDict
STTRequestDataCollection = Union[
@@ -32,23 +33,66 @@
"""
+STTRequestIgnoreTypedDict = TypeAliasType(
+ "STTRequestIgnoreTypedDict", Union[ProviderName, str]
+)
+
+
+STTRequestIgnore = TypeAliasType("STTRequestIgnore", Union[ProviderName, str])
+
+
+STTRequestOnlyTypedDict = TypeAliasType(
+ "STTRequestOnlyTypedDict", Union[ProviderName, str]
+)
+
+
+STTRequestOnly = TypeAliasType("STTRequestOnly", Union[ProviderName, str])
+
+
+STTRequestOrderTypedDict = TypeAliasType(
+ "STTRequestOrderTypedDict", Union[ProviderName, str]
+)
+
+
+STTRequestOrder = TypeAliasType("STTRequestOrder", Union[ProviderName, str])
+
+
class STTRequestProviderTypedDict(TypedDict):
- r"""Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options"""
+ r"""Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options"""
+
+ allow_fallbacks: NotRequired[Nullable[bool]]
+ r"""Whether to allow backup providers to serve requests
+ - true: (default) when the primary provider (or your custom providers in \"order\") is unavailable, use the next best provider.
+ - false: use only the primary/custom provider, and return the upstream error if it's unavailable.
+ """
data_collection: NotRequired[Nullable[STTRequestDataCollection]]
r"""Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it
- deny: use only providers which do not collect user data.
"""
+ ignore: NotRequired[Nullable[List[STTRequestIgnoreTypedDict]]]
+ r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."""
+ only: NotRequired[Nullable[List[STTRequestOnlyTypedDict]]]
+ r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."""
options: NotRequired[ProviderOptionsTypedDict]
r"""Provider-specific options keyed by provider slug. The provider segment is case-insensitive; an endpoint tag after `/` must match the endpoint slug exactly. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped."""
+ order: NotRequired[Nullable[List[STTRequestOrderTypedDict]]]
+ r"""An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message."""
zdr: NotRequired[Nullable[bool]]
r"""Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used."""
class STTRequestProvider(BaseModel):
- r"""Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options"""
+ r"""Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options"""
+
+ allow_fallbacks: OptionalNullable[bool] = UNSET
+ r"""Whether to allow backup providers to serve requests
+ - true: (default) when the primary provider (or your custom providers in \"order\") is unavailable, use the next best provider.
+ - false: use only the primary/custom provider, and return the upstream error if it's unavailable.
+
+ """
data_collection: OptionalNullable[STTRequestDataCollection] = UNSET
r"""Data collection setting. If no available model provider meets the requirement, your request will return an error.
@@ -57,16 +101,37 @@ class STTRequestProvider(BaseModel):
- deny: use only providers which do not collect user data.
"""
+ ignore: OptionalNullable[List[STTRequestIgnore]] = UNSET
+ r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request."""
+
+ only: OptionalNullable[List[STTRequestOnly]] = UNSET
+ r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request."""
+
options: Optional[ProviderOptions] = None
r"""Provider-specific options keyed by provider slug. The provider segment is case-insensitive; an endpoint tag after `/` must match the endpoint slug exactly. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped."""
+ order: OptionalNullable[List[STTRequestOrder]] = UNSET
+ r"""An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message."""
+
zdr: OptionalNullable[bool] = UNSET
r"""Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used."""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
- optional_fields = set(["data_collection", "options", "zdr"])
- nullable_fields = set(["data_collection", "zdr"])
+ optional_fields = set(
+ [
+ "allow_fallbacks",
+ "data_collection",
+ "ignore",
+ "only",
+ "options",
+ "order",
+ "zdr",
+ ]
+ )
+ nullable_fields = set(
+ ["allow_fallbacks", "data_collection", "ignore", "only", "order", "zdr"]
+ )
serialized = handler(self)
m = {}
@@ -113,7 +178,7 @@ class STTRequestTypedDict(TypedDict):
language: NotRequired[str]
r"""ISO-639-1 language code (e.g., \"en\", \"ja\"). Auto-detected if omitted."""
provider: NotRequired[STTRequestProviderTypedDict]
- r"""Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options"""
+ r"""Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options"""
response_format: NotRequired[STTRequestResponseFormat]
r"""Output format. \"json\" (default) returns { text, usage }. \"verbose_json\" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers."""
session_id: NotRequired[str]
@@ -147,7 +212,7 @@ class STTRequest(BaseModel):
r"""ISO-639-1 language code (e.g., \"en\", \"ja\"). Auto-detected if omitted."""
provider: Optional[STTRequestProvider] = None
- r"""Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options"""
+ r"""Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options"""
response_format: Optional[STTRequestResponseFormat] = None
r"""Output format. \"json\" (default) returns { text, usage }. \"verbose_json\" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers."""
diff --git a/src/openrouter/stt.py b/src/openrouter/stt.py
index 9787a43e..b1ca52f0 100644
--- a/src/openrouter/stt.py
+++ b/src/openrouter/stt.py
@@ -57,7 +57,7 @@ def create_transcription(
:param diarize: Label each word with the speaker who said it. Speaker labels are returned on the words array (speaker, speaker_label), so response_format must be \"verbose_json\" (a \"json\" request is rejected with a 400) and word timestamps are included even when timestamp_granularities omits \"word\". Only supported by some providers; the request is rejected with a 400 when the selected model cannot diarize. Providers may charge extra.
:param keyterms: Domain terms, names, or phrases to bias recognition toward. Only supported by some providers; the request is rejected with a 400 when the selected model cannot use keyterms. Providers may cap the number of terms or characters per term and may charge extra.
:param language: ISO-639-1 language code (e.g., \"en\", \"ja\"). Auto-detected if omitted.
- :param provider: Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options
+ :param provider: Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options
:param response_format: Output format. \"json\" (default) returns { text, usage }. \"verbose_json\" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible 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 temperature: Sampling temperature for transcription
@@ -286,7 +286,7 @@ async def create_transcription_async(
:param diarize: Label each word with the speaker who said it. Speaker labels are returned on the words array (speaker, speaker_label), so response_format must be \"verbose_json\" (a \"json\" request is rejected with a 400) and word timestamps are included even when timestamp_granularities omits \"word\". Only supported by some providers; the request is rejected with a 400 when the selected model cannot diarize. Providers may charge extra.
:param keyterms: Domain terms, names, or phrases to bias recognition toward. Only supported by some providers; the request is rejected with a 400 when the selected model cannot use keyterms. Providers may cap the number of terms or characters per term and may charge extra.
:param language: ISO-639-1 language code (e.g., \"en\", \"ja\"). Auto-detected if omitted.
- :param provider: Provider configuration: data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options
+ :param provider: Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), data policy routing preferences (`zdr`, `data_collection`) and provider-specific passthrough options
:param response_format: Output format. \"json\" (default) returns { text, usage }. \"verbose_json\" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible 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 temperature: Sampling temperature for transcription
diff --git a/src/openrouter/tts.py b/src/openrouter/tts.py
index 7f6f87ca..3abf119a 100644
--- a/src/openrouter/tts.py
+++ b/src/openrouter/tts.py
@@ -62,7 +62,7 @@ def create_speech(
: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), plus at most one `image_url` part as a scene image on providers that condition the cloned voice on its setting; only routed to endpoints that support voice cloning (and multiple references or image references when those parts are sent). Image mode: exactly one `image_url` part; only routed to endpoints that support image references. 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, 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 provider: Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), 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.
:param speed: Playback speed multiplier. Honored by models that support it (e.g. OpenAI TTS). Other providers either ignore it or return a 400 for a non-default value when the model has no speed control.
@@ -318,7 +318,7 @@ async def create_speech_async(
: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), plus at most one `image_url` part as a scene image on providers that condition the cloned voice on its setting; only routed to endpoints that support voice cloning (and multiple references or image references when those parts are sent). Image mode: exactly one `image_url` part; only routed to endpoints that support image references. 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, 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 provider: Provider configuration: provider routing preferences (`order`, `only`, `ignore`, `allow_fallbacks`), 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.
:param speed: Playback speed multiplier. Honored by models that support it (e.g. OpenAI TTS). Other providers either ignore it or return a 400 for a non-default value when the model has no speed control.
diff --git a/uv.lock b/uv.lock
index 1bddf062..c9776201 100644
--- a/uv.lock
+++ b/uv.lock
@@ -231,7 +231,7 @@ wheels = [
[[package]]
name = "openrouter"
-version = "1.3.118"
+version = "1.3.119"
source = { editable = "." }
dependencies = [
{ name = "httpcore" },