diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock
index 513fbdd28..9edc46b93 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: eefbd24e6e0674aad757773664c7bdd1
+ docChecksum: 7716ae43f004bad996f81fb0bcc1aa3e
docVersion: 1.0.0
speakeasyVersion: 1.803.2
generationVersion: 2.950.13
- releaseVersion: 1.3.137
- configChecksum: d1c13e2907122aeb4b5c9a5df16a1f3e
+ releaseVersion: 1.3.138
+ configChecksum: 42c8fc774282817b5cfaa48f57cd6b12
repoURL: https://github.com/OpenRouterTeam/python-sdk.git
installationURL: https://github.com/OpenRouterTeam/python-sdk.git
published: true
persistentEdits:
- generation_id: 2ac5be91-6319-4f84-b98e-3431b9e7a537
- pristine_commit_hash: 8bda6b407995baad2e9d9ba18a73785285ef1bd5
- pristine_tree_hash: d39e78cd36dbe08ea877066bb345f54cc3cc0836
+ generation_id: d5ccaf0d-c9b2-414c-b711-369a1fb5ae3c
+ pristine_commit_hash: 27099b97dc999a2e291ec3bacea6f3dd824bd51f
+ pristine_tree_hash: 24436c555e0f5b6d480a9ca13e3fcb78b26241ce
features:
python:
acceptHeaders: 3.0.0
@@ -1870,6 +1870,10 @@ trackedFiles:
id: 34ac0e581d79
last_write_checksum: sha1:62ee9ccab6cec4572383cef654997ab4106d4676
pristine_git_object: ace8f22b972273bdee620a9981abcb0cc46d994e
+ docs/components/cascademode.mdx:
+ id: e12579b7297c
+ last_write_checksum: sha1:24d8c50bea3a9f645b1d9b970eeb64a3d6c7bc4b
+ pristine_git_object: 3c814b92aff68b698f3db8546bcf8263392a4a3c
docs/components/changeguardrailpolicyassignmentrequest.mdx:
id: 35619bc1d436
last_write_checksum: sha1:253a32b8a6d92ecdd1c3038449404b876b695fe5
@@ -2408,8 +2412,8 @@ trackedFiles:
pristine_git_object: c1a03f222a3ac17e934517767f099729e3ceec24
docs/components/codeinterpreterservertool.mdx:
id: d828abe3a52a
- last_write_checksum: sha1:846e34050f51b6b169f39b206d4edb076888bcc3
- pristine_git_object: 410b4448268d865b28bad46a6d3196eaa356f7c2
+ last_write_checksum: sha1:5d9bdfde2be6c88752884c537709cf102ac79255
+ pristine_git_object: c5aff347cf85f21fb00196757fb88e7d145eb85d
docs/components/codexlocalshelltool.mdx:
id: dc18445a3e36
last_write_checksum: sha1:f30ff1d887c512319b88561be2917d2e5b744f25
@@ -3152,12 +3156,12 @@ trackedFiles:
pristine_git_object: a226240fb3b94358d33acc91761a8bba03309b63
docs/components/deferredtoolscontrol.mdx:
id: 13db9fb1f102
- last_write_checksum: sha1:af549b4b689285860c5b3acd7db1dbbced30b911
- pristine_git_object: 70fe8e10bfd7967e0c379fe93a52a3f4d474ada8
+ last_write_checksum: sha1:edb3f5df24f9b51c0d96160709b357acee685208
+ pristine_git_object: 66c21dc09f85514331d8a4d007a1f20d78b7112b
docs/components/deferredtoolscontrolscope.mdx:
id: 61fade4412af
- last_write_checksum: sha1:9d82e5340c3123b7c48033b16798b0142a8461c8
- pristine_git_object: e29edbc3c509f99ebf885f54b4ad3a5fe1a839f7
+ last_write_checksum: sha1:ff698d00ab177a0e0ac4ffe495004205f89ab63b
+ pristine_git_object: 55af6d027d9e31a4b9301804e6430ae75de2399f
docs/components/deferredtoolsdetails.mdx:
id: 18832b6c60aa
last_write_checksum: sha1:15b5cc53097084283f00f04ce8b0f4016a0abb5c
@@ -3784,8 +3788,8 @@ trackedFiles:
pristine_git_object: cd95d88afa32c9a57bc5a227912d03568da1073e
docs/components/filesearchservertool.mdx:
id: 5d9983161437
- last_write_checksum: sha1:5f835c939cbc093de25dbb0de5cbbfeeb3104934
- pristine_git_object: b6aae0ca0831223d83680e75ac3b5d722fbfe65b
+ last_write_checksum: sha1:b261824266904ca9a419943a45addfb6074ec6fd
+ pristine_git_object: d5a3f86b9532bc9c9f1076d19ef161a41b3f6d3a
docs/components/filesearchservertoolvalue1.mdx:
id: 64c038ff374b
last_write_checksum: sha1:16c205ab4e6070838b0cb688991d6407f1b02cc9
@@ -11568,8 +11572,8 @@ trackedFiles:
pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544
pyproject.toml:
id: 5d07e7d72637
- last_write_checksum: sha1:40f7d768dcc1bc7bd1b28934ab0fc9149b1b2053
- pristine_git_object: b24e788f7b1ed08e4fae778033f3ecb86a9bc05a
+ last_write_checksum: sha1:e4f3bd5236af27c73505b71ffef2658bab4dc5da
+ pristine_git_object: 9d1e2b520b78e127173f8b538d0f0cdf6348eb15
scripts/prepare_readme.py:
id: e0c5957a6035
last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54
@@ -11596,8 +11600,8 @@ trackedFiles:
pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137
src/openrouter/_version.py:
id: d8d15ad6c586
- last_write_checksum: sha1:0239eaf3782435e6e9ba86300b575f2e2ddce878
- pristine_git_object: ef3e860dee0c82d2bdd77ee814a1359450bf9236
+ last_write_checksum: sha1:7bdb608247c3d26ede5cf675632c57af2b93d311
+ pristine_git_object: a9eb8bdc052fffeb00325457e6848a11f0b936bb
src/openrouter/alpha.py:
id: 306c4d93308d
last_write_checksum: sha1:80cc0f39649445431cc2247ed0e0765438467766
@@ -11644,8 +11648,8 @@ trackedFiles:
pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1
src/openrouter/components/__init__.py:
id: 81754e97b3f4
- last_write_checksum: sha1:75101b722e8c5947eef015cf67a618d459c03b21
- pristine_git_object: c8f0c0d7c5db5d5f1d97b0f65845425d68237186
+ last_write_checksum: sha1:70ec779b6aff1883ae355b9dff464b9f771f9680
+ pristine_git_object: 16efb4fd06b3383d785755af55f793911d2eef45
src/openrouter/components/aabenchmarkentry.py:
id: e2e0f0b48c82
last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c
@@ -12668,8 +12672,8 @@ trackedFiles:
pristine_git_object: 113b249faf288b231800815733f91b2776188a48
src/openrouter/components/codeinterpreterservertool.py:
id: a72c520afbf9
- last_write_checksum: sha1:89e529b98c4b42a9d573f9234ee44f702e8bfcb7
- pristine_git_object: 5705d69dd9befc2934968d159c161a5c9acd0e16
+ last_write_checksum: sha1:d15ce34cd9f2adcde5a73d49572adcb8f0891786
+ pristine_git_object: bada3a47e7eb511ce6688ac8b7c07877459a0c68
src/openrouter/components/codexlocalshelltool.py:
id: 74a77b6a8b21
last_write_checksum: sha1:135cdc82ad9f65401da11274c786e471888e27e7
@@ -12988,8 +12992,8 @@ trackedFiles:
pristine_git_object: 8a4e94425724c374a040ea028d0933db39ec1451
src/openrouter/components/deferredtoolscontrol.py:
id: b8b6ceef6f86
- last_write_checksum: sha1:40f64cc19ddc3e79e3eaf6af3ee2bc17bd13cf40
- pristine_git_object: 04a1a09bf46c0839ebc9a3634fddd7aa36e61a12
+ last_write_checksum: sha1:08f2c8a631e138a2826f7c1d81ba0696f7bbfdaa
+ pristine_git_object: 795ceaf6e4ada26051dea36a625f95dc0a42e86f
src/openrouter/components/deferredtoolsdetails.py:
id: 044f0e33803d
last_write_checksum: sha1:2f8fcc43fc779a0cb9621149875a5e7bbfa5e6dc
@@ -13200,8 +13204,8 @@ trackedFiles:
pristine_git_object: 9d7d5b885f4f34749cbcf7416cef124a99101fb3
src/openrouter/components/filesearchservertool.py:
id: 8ecc4d4a0ddd
- last_write_checksum: sha1:0cb000d6cf7ce3680e33fa9ae92deb4ca91a120f
- pristine_git_object: 63a4322eb168678e2eca0c9a25c45353335f03e6
+ last_write_checksum: sha1:2ec65fcb5035a9f59d3041cdd20d076e89c1a2a3
+ pristine_git_object: d4bb8976cec4d3ea52d4f83f7f0d00e8c60f4086
src/openrouter/components/filesservertool.py:
id: 725f58d5d419
last_write_checksum: sha1:5014339139d47e2c80bca2b93505cd3a059e6243
@@ -21501,3 +21505,8 @@ examples:
"500":
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
examplesVersion: 1.0.2
+releaseNotes: |
+ ## Python SDK Changes:
+ * `open_router.presets.create_presets_chat_completions()`: `request.deferred_tools` **Changed**
+ * `open_router.presets.create_presets_messages()`: `request.deferred_tools` **Changed**
+ * `open_router.presets.create_presets_responses()`: `request.deferred_tools` **Changed**
diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml
index 3bf4cc84f..5fba6b468 100644
--- a/.speakeasy/gen.yaml
+++ b/.speakeasy/gen.yaml
@@ -37,7 +37,7 @@ generation:
documentation: mintlify
preApplyUnionDiscriminators: true
python:
- version: 1.3.137
+ version: 1.3.138
additionalDependencies:
dev:
pytest: '>=8.3'
diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml
index f32220468..3a7b0d06c 100644
--- a/.speakeasy/out.openapi.yaml
+++ b/.speakeasy/out.openapi.yaml
@@ -9541,7 +9541,7 @@ components:
- 'logs'
type: 'object'
CodeInterpreterServerTool:
- description: 'Code interpreter tool configuration'
+ description: 'Code interpreter tool configuration. An existing container id or `container.file_ids` requires BYOK (your own OpenAI key); requests on OpenRouter credits must use `auto` with no `file_ids`.'
example:
container: 'auto'
type: 'code_interpreter'
@@ -12166,6 +12166,13 @@ components:
type: 'bm25'
validation: 'runtime'
properties:
+ cascade_mode:
+ description: 'How a universal `tool_search` query reaches the client''s own tool search. Absent or `keywords`: a `select:` query becomes the words of the selected names and the limit is always filled. `native`: a `select:` query passes through verbatim when the client search documents `select:`, and the limit field is sent only when the model gave one, unless the client search requires it, in which case its documented default is sent. Experimental.'
+ enum:
+ - 'keywords'
+ - 'native'
+ type: 'string'
+ x-speakeasy-unknown-values: allow
interface:
description: 'How the universal profile exposes the hidden catalog to the provider. Absent or `wrappers`: the `tool_search` and `tool_exec` tools. `code_mode`: one `tool_code` tool that runs a short JavaScript program in which `search()` and `call()` reach the catalog, so several searches and calls complete in one tool result. Experimental.'
enum:
@@ -12185,10 +12192,11 @@ components:
- 'v1'
type: 'string'
scope:
- description: 'Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. Experimental.'
+ description: 'Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. `client`: only the tools the client itself marked `defer_loading`, so a harness with its own tool search keeps its other direct tools direct; an adopted client tool search is still replaced by the router wrappers, and a client-deferred tool the router cannot wrap stays direct. Experimental.'
enum:
- 'all'
- 'mcp'
+ - 'client'
type: 'string'
x-speakeasy-unknown-values: allow
search:
@@ -13763,7 +13771,7 @@ components:
- $ref: '#/components/schemas/OpenAIFile'
- $ref: '#/components/schemas/AnthropicFile'
FileSearchServerTool:
- description: 'File search tool configuration'
+ description: 'File search tool configuration. `vector_store_ids` names OpenAI vector stores, so it requires BYOK (your own OpenAI key); requests on OpenRouter credits get a 400.'
example:
type: 'file_search'
vector_store_ids:
diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock
index 69e63110d..812da3bd8 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:0fa0fcbc02e604399e25339de31398043eafa13da09165c2a7637125ce0dfbc6
- sourceBlobDigest: sha256:2b11a574db6ca188681d304d0c6e4283bbe972d8dbb5947f1c1fd2c30f549316
+ sourceRevisionDigest: sha256:d76eae41d07734b31ea35d8025d572c90403f24db9e0f3c3559413465afad962
+ sourceBlobDigest: sha256:ef8e085f7c2edf026810b4e8a42ea28ce5561489933f22f4806c9259ed31948b
tags:
- latest
- 1.0.0
@@ -11,10 +11,10 @@ targets:
open-router:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
- sourceRevisionDigest: sha256:0fa0fcbc02e604399e25339de31398043eafa13da09165c2a7637125ce0dfbc6
- sourceBlobDigest: sha256:2b11a574db6ca188681d304d0c6e4283bbe972d8dbb5947f1c1fd2c30f549316
+ sourceRevisionDigest: sha256:d76eae41d07734b31ea35d8025d572c90403f24db9e0f3c3559413465afad962
+ sourceBlobDigest: sha256:ef8e085f7c2edf026810b4e8a42ea28ce5561489933f22f4806c9259ed31948b
codeSamplesNamespace: open-router-python-code-samples
- codeSamplesRevisionDigest: sha256:6a5b1d13a8a6455443c2f508bdd3d9ee9c8016d609894a4207864e54e4e8da9c
+ codeSamplesRevisionDigest: sha256:197c7aeeaf9a5c99da5facf10fcd18b80bd333683482aa20eb70725275d07b2a
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.803.2
diff --git a/RELEASES.md b/RELEASES.md
index c104f136d..3ebe7e534 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -4139,4 +4139,14 @@ Based on:
### Generated
- [python v1.3.137] .
### Releases
-- [PyPI v1.3.137] https://pypi.org/project/openrouter/1.3.137 - .
\ No newline at end of file
+- [PyPI v1.3.137] https://pypi.org/project/openrouter/1.3.137 - .
+
+## 2026-11-07 18:08:27
+### Changes
+Based on:
+- OpenAPI Doc
+- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy
+### Generated
+- [python v1.3.138] .
+### Releases
+- [PyPI v1.3.138] https://pypi.org/project/openrouter/1.3.138 - .
\ No newline at end of file
diff --git a/docs/components/cascademode.mdx b/docs/components/cascademode.mdx
new file mode 100644
index 000000000..3c814b92a
--- /dev/null
+++ b/docs/components/cascademode.mdx
@@ -0,0 +1,22 @@
+---
+title: "CascadeMode"
+---
+
+How a universal `tool_search` query reaches the client's own tool search. Absent or `keywords`: a `select:` query becomes the words of the selected names and the limit is always filled. `native`: a `select:` query passes through verbatim when the client search documents `select:`, and the limit field is sent only when the model gave one, unless the client search requires it, in which case its documented default is sent. Experimental.
+
+## Example Usage
+
+```python
+from openrouter.components import CascadeMode
+
+# Open enum: unrecognized values are captured as UnrecognizedStr
+value: CascadeMode = "keywords"
+```
+
+
+## Values
+
+This is an open enum. Unrecognized values will not fail type checks.
+
+- `"keywords"`
+- `"native"`
diff --git a/docs/components/codeinterpreterservertool.mdx b/docs/components/codeinterpreterservertool.mdx
index 410b44482..c5aff347c 100644
--- a/docs/components/codeinterpreterservertool.mdx
+++ b/docs/components/codeinterpreterservertool.mdx
@@ -2,7 +2,7 @@
title: "CodeInterpreterServerTool"
---
-Code interpreter tool configuration
+Code interpreter tool configuration. An existing container id or `container.file_ids` requires BYOK (your own OpenAI key); requests on OpenRouter credits must use `auto` with no `file_ids`.
## Fields
diff --git a/docs/components/deferredtoolscontrol.mdx b/docs/components/deferredtoolscontrol.mdx
index 70fe8e10b..66c21dc09 100644
--- a/docs/components/deferredtoolscontrol.mdx
+++ b/docs/components/deferredtoolscontrol.mdx
@@ -7,11 +7,12 @@ Opt-in versioned router-level deferred-tool protocol. Replay assistant reasoning
## Fields
-| Field | Type | Required | Description | Example |
-| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `interface` | [Optional[components.Interface]](../components/interface.mdx) | ➖ | How the universal profile exposes the hidden catalog to the provider. Absent or `wrappers`: the `tool_search` and `tool_exec` tools. `code_mode`: one `tool_code` tool that runs a short JavaScript program in which `search()` and `call()` reach the catalog, so several searches and calls complete in one tool result. Experimental. | |
-| `profile` | [components.Profile](../components/profile.mdx) | ✔️ | Loading profile. `portable` serves the `defer_loading` tools with router-built search and call wrappers on any model and keeps the catalog fixed. `universal` defers every wrappable tool behind the same wrappers so the provider-facing tool list never changes, and rebuilds the catalog from each request so tools can be added or removed mid-conversation. | |
-| `protocol` | [components.Protocol](../components/protocol.mdx) | ✔️ | N/A | |
-| `scope` | [Optional[components.DeferredToolsControlScope]](../components/deferredtoolscontrolscope.mdx) | ➖ | Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. Experimental. | |
-| `search` | [components.DeferredToolsSearchStrategy](../components/deferredtoolssearchstrategy.mdx) | ✔️ | Router-local regex/BM25 or caller-owned custom search. | \{
"max_results": 5,
"type": "bm25"
} |
-| `validation` | [components.Validation](../components/validation.mdx) | ✔️ | Where tool-call arguments are checked against the original schema. Only `runtime` (in OpenRouter) is available in this release. | |
\ No newline at end of file
+| Field | Type | Required | Description | Example |
+| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `cascade_mode` | [Optional[components.CascadeMode]](../components/cascademode.mdx) | ➖ | How a universal `tool_search` query reaches the client's own tool search. Absent or `keywords`: a `select:` query becomes the words of the selected names and the limit is always filled. `native`: a `select:` query passes through verbatim when the client search documents `select:`, and the limit field is sent only when the model gave one, unless the client search requires it, in which case its documented default is sent. Experimental. | |
+| `interface` | [Optional[components.Interface]](../components/interface.mdx) | ➖ | How the universal profile exposes the hidden catalog to the provider. Absent or `wrappers`: the `tool_search` and `tool_exec` tools. `code_mode`: one `tool_code` tool that runs a short JavaScript program in which `search()` and `call()` reach the catalog, so several searches and calls complete in one tool result. Experimental. | |
+| `profile` | [components.Profile](../components/profile.mdx) | ✔️ | Loading profile. `portable` serves the `defer_loading` tools with router-built search and call wrappers on any model and keeps the catalog fixed. `universal` defers every wrappable tool behind the same wrappers so the provider-facing tool list never changes, and rebuilds the catalog from each request so tools can be added or removed mid-conversation. | |
+| `protocol` | [components.Protocol](../components/protocol.mdx) | ✔️ | N/A | |
+| `scope` | [Optional[components.DeferredToolsControlScope]](../components/deferredtoolscontrolscope.mdx) | ➖ | Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. `client`: only the tools the client itself marked `defer_loading`, so a harness with its own tool search keeps its other direct tools direct; an adopted client tool search is still replaced by the router wrappers, and a client-deferred tool the router cannot wrap stays direct. Experimental. | |
+| `search` | [components.DeferredToolsSearchStrategy](../components/deferredtoolssearchstrategy.mdx) | ✔️ | Router-local regex/BM25 or caller-owned custom search. | \{
"max_results": 5,
"type": "bm25"
} |
+| `validation` | [components.Validation](../components/validation.mdx) | ✔️ | Where tool-call arguments are checked against the original schema. Only `runtime` (in OpenRouter) is available in this release. | |
\ No newline at end of file
diff --git a/docs/components/deferredtoolscontrolscope.mdx b/docs/components/deferredtoolscontrolscope.mdx
index e29edbc3c..55af6d027 100644
--- a/docs/components/deferredtoolscontrolscope.mdx
+++ b/docs/components/deferredtoolscontrolscope.mdx
@@ -2,7 +2,7 @@
title: "DeferredToolsControlScope"
---
-Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. Experimental.
+Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. `client`: only the tools the client itself marked `defer_loading`, so a harness with its own tool search keeps its other direct tools direct; an adopted client tool search is still replaced by the router wrappers, and a client-deferred tool the router cannot wrap stays direct. Experimental.
## Example Usage
@@ -20,3 +20,4 @@ This is an open enum. Unrecognized values will not fail type checks.
- `"all"`
- `"mcp"`
+- `"client"`
diff --git a/docs/components/filesearchservertool.mdx b/docs/components/filesearchservertool.mdx
index b6aae0ca0..d5a3f86b9 100644
--- a/docs/components/filesearchservertool.mdx
+++ b/docs/components/filesearchservertool.mdx
@@ -2,7 +2,7 @@
title: "FileSearchServerTool"
---
-File search tool configuration
+File search tool configuration. `vector_store_ids` names OpenAI vector stores, so it requires BYOK (your own OpenAI key); requests on OpenRouter credits get a 400.
## Fields
diff --git a/pyproject.toml b/pyproject.toml
index b24e788f7..9d1e2b520 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "openrouter"
-version = "1.3.137"
+version = "1.3.138"
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 ef3e860de..a9eb8bdc0 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.137"
+__version__: str = "1.3.138"
__openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.950.13"
-__user_agent__: str = "speakeasy-sdk/python 1.3.137 2.950.13 1.0.0 openrouter"
+__user_agent__: str = "speakeasy-sdk/python 1.3.138 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 c8f0c0d7c..16efb4fd0 100644
--- a/src/openrouter/components/__init__.py
+++ b/src/openrouter/components/__init__.py
@@ -1822,6 +1822,7 @@
DeferredRegexSearchTypedDict,
)
from .deferredtoolscontrol import (
+ CascadeMode,
DeferredToolsControl,
DeferredToolsControlScope,
DeferredToolsControlTypedDict,
@@ -5770,6 +5771,7 @@
"By",
"CapabilityDescriptor",
"CapabilityDescriptorTypedDict",
+ "CascadeMode",
"ChangeGuardrailPolicyAssignmentRequest",
"ChangeGuardrailPolicyAssignmentRequestPolicyType",
"ChangeGuardrailPolicyAssignmentRequestTypedDict",
@@ -10064,6 +10066,7 @@
"DeferredRegexSearch": ".deferredregexsearch",
"DeferredRegexSearchType": ".deferredregexsearch",
"DeferredRegexSearchTypedDict": ".deferredregexsearch",
+ "CascadeMode": ".deferredtoolscontrol",
"DeferredToolsControl": ".deferredtoolscontrol",
"DeferredToolsControlScope": ".deferredtoolscontrol",
"DeferredToolsControlTypedDict": ".deferredtoolscontrol",
diff --git a/src/openrouter/components/codeinterpreterservertool.py b/src/openrouter/components/codeinterpreterservertool.py
index 5705d69dd..bada3a47e 100644
--- a/src/openrouter/components/codeinterpreterservertool.py
+++ b/src/openrouter/components/codeinterpreterservertool.py
@@ -79,14 +79,14 @@ def serialize_model(self, handler):
class CodeInterpreterServerToolTypedDict(TypedDict):
- r"""Code interpreter tool configuration"""
+ r"""Code interpreter tool configuration. An existing container id or `container.file_ids` requires BYOK (your own OpenAI key); requests on OpenRouter credits must use `auto` with no `file_ids`."""
container: ContainerTypedDict
type: TypeCodeInterpreter
class CodeInterpreterServerTool(BaseModel):
- r"""Code interpreter tool configuration"""
+ r"""Code interpreter tool configuration. An existing container id or `container.file_ids` requires BYOK (your own OpenAI key); requests on OpenRouter credits must use `auto` with no `file_ids`."""
container: Container
diff --git a/src/openrouter/components/deferredtoolscontrol.py b/src/openrouter/components/deferredtoolscontrol.py
index 04a1a09bf..795ceaf6e 100644
--- a/src/openrouter/components/deferredtoolscontrol.py
+++ b/src/openrouter/components/deferredtoolscontrol.py
@@ -11,6 +11,16 @@
from typing_extensions import NotRequired, TypedDict
+CascadeMode = Union[
+ Literal[
+ "keywords",
+ "native",
+ ],
+ UnrecognizedStr,
+]
+r"""How a universal `tool_search` query reaches the client's own tool search. Absent or `keywords`: a `select:` query becomes the words of the selected names and the limit is always filled. `native`: a `select:` query passes through verbatim when the client search documents `select:`, and the limit field is sent only when the model gave one, unless the client search requires it, in which case its documented default is sent. Experimental."""
+
+
Interface = Union[
Literal[
"wrappers",
@@ -38,10 +48,11 @@
Literal[
"all",
"mcp",
+ "client",
],
UnrecognizedStr,
]
-r"""Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. Experimental."""
+r"""Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. `client`: only the tools the client itself marked `defer_loading`, so a harness with its own tool search keeps its other direct tools direct; an adopted client tool search is still replaced by the router wrappers, and a client-deferred tool the router cannot wrap stays direct. Experimental."""
Validation = Literal["runtime",]
@@ -58,10 +69,12 @@ class DeferredToolsControlTypedDict(TypedDict):
r"""Router-local regex/BM25 or caller-owned custom search."""
validation: Validation
r"""Where tool-call arguments are checked against the original schema. Only `runtime` (in OpenRouter) is available in this release."""
+ cascade_mode: NotRequired[CascadeMode]
+ r"""How a universal `tool_search` query reaches the client's own tool search. Absent or `keywords`: a `select:` query becomes the words of the selected names and the limit is always filled. `native`: a `select:` query passes through verbatim when the client search documents `select:`, and the limit field is sent only when the model gave one, unless the client search requires it, in which case its documented default is sent. Experimental."""
interface: NotRequired[Interface]
r"""How the universal profile exposes the hidden catalog to the provider. Absent or `wrappers`: the `tool_search` and `tool_exec` tools. `code_mode`: one `tool_code` tool that runs a short JavaScript program in which `search()` and `call()` reach the catalog, so several searches and calls complete in one tool result. Experimental."""
scope: NotRequired[DeferredToolsControlScope]
- r"""Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. Experimental."""
+ r"""Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. `client`: only the tools the client itself marked `defer_loading`, so a harness with its own tool search keeps its other direct tools direct; an adopted client tool search is still replaced by the router wrappers, and a client-deferred tool the router cannot wrap stays direct. Experimental."""
class DeferredToolsControl(BaseModel):
@@ -78,15 +91,18 @@ class DeferredToolsControl(BaseModel):
validation: Validation
r"""Where tool-call arguments are checked against the original schema. Only `runtime` (in OpenRouter) is available in this release."""
+ cascade_mode: Optional[CascadeMode] = None
+ r"""How a universal `tool_search` query reaches the client's own tool search. Absent or `keywords`: a `select:` query becomes the words of the selected names and the limit is always filled. `native`: a `select:` query passes through verbatim when the client search documents `select:`, and the limit field is sent only when the model gave one, unless the client search requires it, in which case its documented default is sent. Experimental."""
+
interface: Optional[Interface] = None
r"""How the universal profile exposes the hidden catalog to the provider. Absent or `wrappers`: the `tool_search` and `tool_exec` tools. `code_mode`: one `tool_code` tool that runs a short JavaScript program in which `search()` and `call()` reach the catalog, so several searches and calls complete in one tool result. Experimental."""
scope: Optional[DeferredToolsControlScope] = None
- r"""Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. Experimental."""
+ r"""Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. `client`: only the tools the client itself marked `defer_loading`, so a harness with its own tool search keeps its other direct tools direct; an adopted client tool search is still replaced by the router wrappers, and a client-deferred tool the router cannot wrap stays direct. Experimental."""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
- optional_fields = set(["interface", "scope"])
+ optional_fields = set(["cascade_mode", "interface", "scope"])
serialized = handler(self)
m = {}
diff --git a/src/openrouter/components/filesearchservertool.py b/src/openrouter/components/filesearchservertool.py
index 63a4322eb..d4bb8976c 100644
--- a/src/openrouter/components/filesearchservertool.py
+++ b/src/openrouter/components/filesearchservertool.py
@@ -112,7 +112,7 @@ def serialize_model(self, handler):
class FileSearchServerToolTypedDict(TypedDict):
- r"""File search tool configuration"""
+ r"""File search tool configuration. `vector_store_ids` names OpenAI vector stores, so it requires BYOK (your own OpenAI key); requests on OpenRouter credits get a 400."""
type: TypeFileSearch
vector_store_ids: List[str]
@@ -122,7 +122,7 @@ class FileSearchServerToolTypedDict(TypedDict):
class FileSearchServerTool(BaseModel):
- r"""File search tool configuration"""
+ r"""File search tool configuration. `vector_store_ids` names OpenAI vector stores, so it requires BYOK (your own OpenAI key); requests on OpenRouter credits get a 400."""
type: TypeFileSearch
diff --git a/uv.lock b/uv.lock
index 8c392badc..1535ce317 100644
--- a/uv.lock
+++ b/uv.lock
@@ -231,7 +231,7 @@ wheels = [
[[package]]
name = "openrouter"
-version = "1.3.137"
+version = "1.3.138"
source = { editable = "." }
dependencies = [
{ name = "httpcore" },