diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock
index 91149e88..a1bc4668 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: 5c4e6162ecadfd23a304f79168bf5745
+ docChecksum: 06c8e9946edd210938b68d85ffb902ff
docVersion: 1.0.0
speakeasyVersion: 1.787.0
generationVersion: 2.914.0
- releaseVersion: 1.1.57
- configChecksum: 8cd5a4ccae451615a6e3107cd1f59206
+ releaseVersion: 1.1.58
+ configChecksum: 03d8d21ef3595cf11b1de19ad72c2ee0
repoURL: https://github.com/OpenRouterTeam/python-sdk.git
installationURL: https://github.com/OpenRouterTeam/python-sdk.git
published: true
persistentEdits:
- generation_id: 171237ab-3370-4c91-8681-0ddc1b0379d0
- pristine_commit_hash: 765968d6eb632e90fd1813d28f4c631768f58028
- pristine_tree_hash: 333a857f00454f26585046314ff3747a708584ee
+ generation_id: c6ef7a42-8e52-4c53-a36f-16fa8905e9b9
+ pristine_commit_hash: 952cde02a6b857b63952e37a6151f7253e0091b1
+ pristine_tree_hash: 1855d55f6fcd84d45de5b4973cd470d55d217d13
features:
python:
acceptHeaders: 3.0.0
@@ -2030,8 +2030,12 @@ trackedFiles:
pristine_git_object: da8e18a164f2bd77e34b42d88e0b553edfe8a9c3
docs/components/functioncallitem.mdx:
id: 6cb0afdc292f
- last_write_checksum: sha1:e9c1e74fee850ae488ea789133c7fbac4a42c717
- pristine_git_object: f1082d7352418d9e0055cfff070ddfb33b44ce15
+ last_write_checksum: sha1:5a28ed756ba1196d621e377c137efd2b40aaff41
+ pristine_git_object: a05ce326e271f5542767cfa285b43049c8d2bdc8
+ docs/components/functioncallitemsubagentitem.mdx:
+ id: e71e71703a47
+ last_write_checksum: sha1:24fc27e4de6e95f72e293c5275aa68c89ed3076c
+ pristine_git_object: 19df504a4d6016531c41efb30a72e3d0351f6c53
docs/components/functioncallitemtype.mdx:
id: d41eb56d2b5b
last_write_checksum: sha1:2b5ba9f95bbac58d31ca72fb29d8398a90c68f86
@@ -3466,8 +3470,8 @@ trackedFiles:
pristine_git_object: 8c38bc0f267a36c61128b1a5d747a56ff4aa6564
docs/components/openairesponsefunctiontoolcall.mdx:
id: 8e50b2457c3b
- last_write_checksum: sha1:050ae2fecc3831e37a7e830e0eeab1043fdbabf2
- pristine_git_object: efdbbbce90ebc1aa26129d87a523551e531949a3
+ last_write_checksum: sha1:4534401a23ee67eba50eccf1f49b78b26b770f9a
+ pristine_git_object: cfb351eb2596078c9579806310553e2accb4bd0e
docs/components/openairesponsefunctiontoolcalloutput.mdx:
id: f1e4ed07af7a
last_write_checksum: sha1:1179ca7cef9d376a2845001e52b128d4bb95dd00
@@ -3484,6 +3488,10 @@ trackedFiles:
id: af38067ccadd
last_write_checksum: sha1:b189125d1756e152441fced6a22160169b8bb1e5
pristine_git_object: 16e5b2059e4c6c58c603aaba63cf085af0966e7a
+ docs/components/openairesponsefunctiontoolcallsubagentitem.mdx:
+ id: f8892ce7650f
+ last_write_checksum: sha1:ce8c2d840413b64346323b8ed0010edbdcdde3f9
+ pristine_git_object: b52ff9cb9a4b2779012d4a1e27467aacff9b4a83
docs/components/openairesponsefunctiontoolcalltype.mdx:
id: aad74378a805
last_write_checksum: sha1:427d28b49c2627514b7839467cde6f2ef761559d
@@ -3802,8 +3810,8 @@ trackedFiles:
pristine_git_object: f9eb6568f06fc4b917d41a391f0b3046ac064889
docs/components/outputfunctioncallitem.mdx:
id: 1d62f9e67c2f
- last_write_checksum: sha1:6642104468672708caccef16346f824b51264670
- pristine_git_object: 86a1cd0d85064d5befa583ca69d39412683c90e4
+ last_write_checksum: sha1:566af9cdffbaa59972d4126fc651ed22f898e889
+ pristine_git_object: 5a9941276b8c2b2eb9cfb02dcccaa9b1d8d2d670
docs/components/outputfunctioncallitemstatuscompleted.mdx:
id: 9adee8d9044e
last_write_checksum: sha1:dc89eadf1d22b60e9724132c025b902c515bba72
@@ -3820,6 +3828,10 @@ trackedFiles:
id: 032eaf121751
last_write_checksum: sha1:d1133a2a0258047c769ca9c6bce709afda014df9
pristine_git_object: d4cb118508c4931e8dc3389cd9d02b98c71c7ea5
+ docs/components/outputfunctioncallitemsubagentitem.mdx:
+ id: 07de8c859b20
+ last_write_checksum: sha1:586f34f0bfac78aa09825e705bb4bfebdda36e81
+ pristine_git_object: 7cab07dcf9b5726d213068708ca5e70427546758
docs/components/outputfunctioncallitemtype.mdx:
id: cbb88dd0dc5a
last_write_checksum: sha1:e2ae4e411c58ca859cecc745f78da50f3c824aca
@@ -4030,8 +4042,8 @@ trackedFiles:
pristine_git_object: 2bfc5b85b0a0962d951930f1fd22bf3fb230750a
docs/components/outputsubagentservertoolitem.mdx:
id: afeb6acde438
- last_write_checksum: sha1:f098a2f49e4a4f2d627148d02a8e49ce2f8a89f0
- pristine_git_object: 1b15fce12d6fc2bd2096db911b9b752bf0b2ace8
+ last_write_checksum: sha1:28a36b448ac773fda95281d45bcebb1b4428873c
+ pristine_git_object: f74e9cc219f7834d51acd40be8f39eca28906cb6
docs/components/outputsubagentservertoolitemtype.mdx:
id: de66682e96c0
last_write_checksum: sha1:73a7ed6acdb716d85e1cd3b83517f12dcc5ee393
@@ -4986,16 +4998,16 @@ trackedFiles:
pristine_git_object: 957462250a173bfdf34ca2440fb46cbbd5a06cf9
docs/components/subagentreasoning.mdx:
id: 2e412fc3ecc2
- last_write_checksum: sha1:095e527fa9f146290858b2c98b6a8ccc11755e37
- pristine_git_object: 17ee212d76548c12b456eef6c7ee1e92330478d3
+ last_write_checksum: sha1:5250d73972608325576f8617c5188b005366409f
+ pristine_git_object: c1d3baea52081fbe67058042076aecd10771d6ef
docs/components/subagentreasoningeffort.mdx:
id: cc922bbdeeeb
last_write_checksum: sha1:c41a98510c6e46da0cbdd0f1106d4595b8e63c22
pristine_git_object: 6ff0d51d2b5668291fb70f4cd5ad649fe3f4f6fc
docs/components/subagentservertoolconfig.mdx:
id: f7fa49016554
- last_write_checksum: sha1:13d1921170bf027092fecb3b5b6eacbf143771af
- pristine_git_object: 3a8e769cc39c22e754bb347e8a6b55fa03d3422c
+ last_write_checksum: sha1:0f0db3e758a793bd8168050aeac3ea6b982a3588
+ pristine_git_object: 3e6825bc8223e13f43e05dbe5d267211d8f6c7ef
docs/components/subagentservertoolopenrouter.mdx:
id: 8ede88c6400a
last_write_checksum: sha1:9f4c3798805099682584724a42d211fe0861f431
@@ -7234,8 +7246,8 @@ trackedFiles:
pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544
pyproject.toml:
id: 5d07e7d72637
- last_write_checksum: sha1:7ddbc53a16bf917bfcb5a572cdb40b50a52f078a
- pristine_git_object: 36963934f7624aa899400c4d9fabb15952d04c16
+ last_write_checksum: sha1:b9eb32a35533987e08d3e8b48330159f52c563fd
+ pristine_git_object: 6d5eb569679b7dbfd13226b6b5ee01877ca5e47a
scripts/prepare_readme.py:
id: e0c5957a6035
last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54
@@ -7262,8 +7274,8 @@ trackedFiles:
pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137
src/openrouter/_version.py:
id: d8d15ad6c586
- last_write_checksum: sha1:b671af22de2bea9808c948466ff1b74adc909090
- pristine_git_object: 80371bc54bade0bc2eda19a35d1e3a39796e6fc0
+ last_write_checksum: sha1:14ae4beff235133d72d78bc00df97836d6ad5086
+ pristine_git_object: de1436078d61137886e93377ebdcd2dc702e8887
src/openrouter/analytics.py:
id: cb406b5aaabb
last_write_checksum: sha1:3ea0f1c73fb9c101b7bc5719da4dd7bf62ff469a
@@ -7306,8 +7318,8 @@ trackedFiles:
pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1
src/openrouter/components/__init__.py:
id: 81754e97b3f4
- last_write_checksum: sha1:f1dfb69c3b3296a121af19e198dc431be62d9138
- pristine_git_object: aa1609dc43dfbd4a6f64d49dd70fe272fc21e4c3
+ last_write_checksum: sha1:4873861b268ae7ca8a5761a36d7be42b26f4583b
+ pristine_git_object: 5521c2bba2263ca396bafdb33ed7515d39ac1daf
src/openrouter/components/aabenchmarkentry.py:
id: e2e0f0b48c82
last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c
@@ -8198,8 +8210,8 @@ trackedFiles:
pristine_git_object: 613c2bbaec296ed9b0da13f249ef96b9314ff9ed
src/openrouter/components/functioncallitem.py:
id: 5e69afffd660
- last_write_checksum: sha1:94c192e67b0c0c2cca046b8fc5caa296f0c0d9d8
- pristine_git_object: 8d9002fa30aea04624c233b970eb36001a764f40
+ last_write_checksum: sha1:543fedb0f6c7908eec52a860a680ffdd1a8bfa3c
+ pristine_git_object: 5a2e897e84e4becef9ecec8d8518887ce6b6f1ff
src/openrouter/components/functioncalloutputitem.py:
id: bf659aa04e7d
last_write_checksum: sha1:011dcfa6feb0042f5a20e1a0caee9d8b300b0457
@@ -8458,8 +8470,8 @@ trackedFiles:
pristine_git_object: f499cbbb546232f5cfbfe2c44fb41aefb306c87f
src/openrouter/components/inputs_union.py:
id: 17d6239cb6a7
- last_write_checksum: sha1:12efadbe47b5fbe8557ba3f188be85336847743b
- pristine_git_object: 82a4055ff813e8b8c627aba63c5202c0c7c29363
+ last_write_checksum: sha1:ab2d2da2fd44e37609c350ec39889f991e94bd40
+ pristine_git_object: 557636cb8660e4c47c77f5c892592a6c201b79a4
src/openrouter/components/inputtext.py:
id: a995ae96be99
last_write_checksum: sha1:2da9ff645acc96772701908830151c5a707ed021
@@ -8790,8 +8802,8 @@ trackedFiles:
pristine_git_object: 4cfede4cecef4d5aa4f80aff3d321cd4e1555b95
src/openrouter/components/openairesponsefunctiontoolcall.py:
id: f201e89f8dcb
- last_write_checksum: sha1:6cb86a7da1d9f11a1e9ad0e5d08173f85205ee4e
- pristine_git_object: 2351f7f08aabcf15cc6ed810a537ca4638bcd8fc
+ last_write_checksum: sha1:d95233256d22af7c8d01e9f73328b064f10b8583
+ pristine_git_object: 6220666cffdc1ad93167c9c5428b204947e36298
src/openrouter/components/openairesponsefunctiontoolcalloutput.py:
id: 1440f5810305
last_write_checksum: sha1:db5170fedf1f70f85582e93fe11228786f9d7961
@@ -8906,8 +8918,8 @@ trackedFiles:
pristine_git_object: 5f30e958618a659ecc83c746240144961c6bf6e6
src/openrouter/components/outputfunctioncallitem.py:
id: 516ed67b5406
- last_write_checksum: sha1:2dcba52e87aad59459a33bd5cd665a32c6372db9
- pristine_git_object: 13dc4afc3516bdb0590427677835c1d1590c9d9d
+ last_write_checksum: sha1:7bffd3f5f8e3b728c1e3c91bd2193f190bb90e94
+ pristine_git_object: c33627e17dd81f684806682334d2bc67a11b6fb4
src/openrouter/components/outputfusionservertoolitem.py:
id: 1d798a2bb7ae
last_write_checksum: sha1:dba77052202fb6602b18083e7c6fff1e6f2e46c7
@@ -8926,8 +8938,8 @@ trackedFiles:
pristine_git_object: 94af810bbdb87fb8c6800645354f7ec4dd067e7f
src/openrouter/components/outputitems.py:
id: 90f107de3116
- last_write_checksum: sha1:11ae20f32633b9e35a8bb591bb6c0ec8efe24d0a
- pristine_git_object: e636dee65c7243deacf11bc538b37388c78a3e40
+ last_write_checksum: sha1:3ed1ee5e49484845da550c7dbe3c18fb27e2b769
+ pristine_git_object: 3866bb7e4f63ee9d066358bed7f388232de25c6c
src/openrouter/components/outputmcpservertoolitem.py:
id: bb8c2536a58e
last_write_checksum: sha1:28d33c9226ff4ce6871457fa1fae384b590f676c
@@ -8970,8 +8982,8 @@ trackedFiles:
pristine_git_object: 18a1f6df264fe768bd78d5c4b7c1c030ecec7b37
src/openrouter/components/outputsubagentservertoolitem.py:
id: 7480e835aa08
- last_write_checksum: sha1:27fe8898137bc806619dc444b588cde5a8a32c70
- pristine_git_object: 3e4bba1425b99d114f19529ade4de6cf2e7c3f09
+ last_write_checksum: sha1:fcda61a3604f16bed4ce3842b57de32d309316f4
+ pristine_git_object: a4325ca9ec83c5713b22d58647dbbb468a066201
src/openrouter/components/outputtexteditorservertoolitem.py:
id: 2a5dc9318fe6
last_write_checksum: sha1:fc1bf715ac0084d7390eb75152f0f27994654fab
@@ -9474,16 +9486,16 @@ trackedFiles:
pristine_git_object: e803021eeec772cd3d02b5eb123c18558156e117
src/openrouter/components/subagentreasoning.py:
id: 2715ebf26eb3
- last_write_checksum: sha1:79917bf44c183cbd5f7b9e9a9ce60ef288e4f0d7
- pristine_git_object: d34c619b85be547eaae9ae7f96fad370de5c0b43
+ last_write_checksum: sha1:c66596c9e1ea6aade531934f6901778b76db5de4
+ pristine_git_object: 87af45ca3cf397993a7ec58ca7663b6ec03b9126
src/openrouter/components/subagentservertool_openrouter.py:
id: f08524c6985a
last_write_checksum: sha1:c22642aafcdbd55723b853c4e864fd7747b9fad1
pristine_git_object: b801ffef738356454a532bd4258a916858615978
src/openrouter/components/subagentservertoolconfig.py:
id: a8425c790cb6
- last_write_checksum: sha1:7e0e286aa0bce491c000e3c8ff9e099fc57a8bdf
- pristine_git_object: 54683b2862ba16d1d1b0540fef29342438d7c410
+ last_write_checksum: sha1:cd8b29ab475eead2dda68cc815868b738359fe8e
+ pristine_git_object: db9adabfbf06c5e0dd59818abc87974df6330804
src/openrouter/components/submitgenerationfeedbackrequest.py:
id: ae68ea802a9c
last_write_checksum: sha1:3d0fb9415d218dfbe5b978791c95bc0f28abb131
@@ -12151,3 +12163,4 @@ examples:
"500":
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
examplesVersion: 1.0.2
+releaseNotes: "## Python SDK Changes:\n* `open_router.beta.responses.send()`: \n * `request.input.union(Array<>)[]` **Changed**\n * `response` **Changed**\n* `open_router.chat.send()`: \n * `request.tools[].union(SubagentServerTool_OpenRouter).parameters` **Changed**\n* `open_router.presets.create_presets_chat_completions()`: \n * `request.tools[].union(SubagentServerTool_OpenRouter).parameters` **Changed**\n* `open_router.presets.create_presets_responses()`: \n * `request.input.union(Array<>)[]` **Changed**\n* `open_router.responses.send()`: \n * `request.input.union(Array<>)[]` **Changed**\n * `response` **Changed**\n"
diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml
index d83c3851..58c08e60 100644
--- a/.speakeasy/gen.yaml
+++ b/.speakeasy/gen.yaml
@@ -36,7 +36,7 @@ generation:
documentation: mintlify
preApplyUnionDiscriminators: true
python:
- version: 1.1.57
+ version: 1.1.58
additionalDependencies:
dev: {}
main: {}
diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml
index 620c0b62..dd9719cb 100644
--- a/.speakeasy/out.openapi.yaml
+++ b/.speakeasy/out.openapi.yaml
@@ -17157,6 +17157,20 @@ components:
type: 'string'
status:
$ref: '#/components/schemas/ToolCallStatus'
+ subagent_id:
+ description: 'EXPERIMENTAL — subject to change without notice. String id that matches the `call_id` of the `openrouter:subagent` server tool call that spawned the subagent. Present on every `function_call` item the subagent projects; absent on ordinary function calls.'
+ type: 'string'
+ subagent_items:
+ description: 'EXPERIMENTAL — subject to change without notice. The subagent''s output items produced on this turn. Treat this as an opaque object; you must replay it in the request so that the subagent can continue execution of the tool with the same context. If a subagent created multiple parallel tool calls, only the first tool call will have this field. The other tool calls will only have `subagent_id`. Present only if the tool call originates from a subagent spawned by the `openrouter:subagent` server tool.'
+ items:
+ additionalProperties: {}
+ properties:
+ type:
+ type: 'string'
+ required:
+ - 'type'
+ type: 'object'
+ type: 'array'
type:
enum:
- 'function_call'
@@ -18550,7 +18564,21 @@ components:
OutputFunctionCallItem:
allOf:
- $ref: '#/components/schemas/OutputItemFunctionCall'
- - properties: {}
+ - properties:
+ subagent_id:
+ description: 'EXPERIMENTAL — subject to change without notice. String id that matches the `call_id` of the `openrouter:subagent` server tool call that spawned the subagent. Present on every `function_call` item the subagent projects; absent on ordinary function calls.'
+ type: 'string'
+ subagent_items:
+ description: 'EXPERIMENTAL — subject to change without notice. The subagent''s output items produced on this turn. Treat this as an opaque object; you must replay it in the request so that the subagent can continue execution of the tool with the same context. If a subagent created multiple parallel tool calls, only the first tool call will have this field. The other tool calls will only have `subagent_id`. Present only if the tool call originates from a subagent spawned by the `openrouter:subagent` server tool.'
+ items:
+ additionalProperties: {}
+ properties:
+ type:
+ type: 'string'
+ required:
+ - 'type'
+ type: 'object'
+ type: 'array'
type: 'object'
example:
arguments: '{"location":"San Francisco"}'
@@ -19502,6 +19530,9 @@ components:
status: 'completed'
type: 'openrouter:subagent'
properties:
+ call_id:
+ description: 'EXPERIMENTAL — subject to change without notice. The `call_id` of the tool call that spawned this subagent. This id will also be included as the `subagent_id` on any `function_call` items created by the subagent. This must be returned in the request so the `function_call` can be matched with the correct subagent. A suspended `in_progress` item is announced once and never re-emitted or terminally closed — completion arrives as a new item with the same `call_id`.'
+ type: 'string'
error:
description: 'Error message when the subagent task did not produce an outcome.'
type: 'string'
@@ -23780,7 +23811,7 @@ components:
type: 'string'
x-speakeasy-unknown-values: allow
max_tokens:
- description: 'Maximum number of reasoning tokens the subagent may use. Accepted and validated but not yet forwarded to the subagent call.'
+ description: 'Maximum number of reasoning tokens the subagent may use. Forwarded to the subagent call as `reasoning.max_tokens`.'
type: 'integer'
type: 'object'
SubagentServerTool_OpenRouter:
@@ -23805,6 +23836,18 @@ components:
model: '~anthropic/claude-haiku-latest'
name: 'summarizer'
properties:
+ inherit_functions:
+ description: 'EXPERIMENTAL — subject to change without notice. When true, the subagent inherits every client function defined in the request''s top-level `tools` list. Supported on the Responses API (`/api/v1/responses`) only; other APIs reject it with a `400`.'
+ example: true
+ type: 'boolean'
+ inherited_function_names:
+ description: 'EXPERIMENTAL — subject to change without notice. Names of the top-level function tools that the subagent will inherit. Any tool that matches by name will be copied fully into the tools array of the subagent. When `inherit_functions` is `true`, this list does nothing, because every client function will be inherited by default. Names are trimmed before validation, so a whitespace-only name is rejected with a `400`. Supported on the Responses API (`/api/v1/responses`) only; other APIs reject it with a `400`.'
+ example:
+ - 'lookup_order'
+ items:
+ minLength: 1
+ type: 'string'
+ type: 'array'
instructions:
description: 'System instructions for the subagent. When omitted, the subagent responds with no system prompt of its own.'
example: 'You are a fast, focused worker. Complete the task exactly as described.'
@@ -23814,7 +23857,7 @@ components:
example: 2048
type: 'integer'
max_tool_calls:
- description: 'Maximum number of tool-calling steps the subagent may take during its agentic loop. Capped at 25. Only relevant when the subagent is given tools. Accepted and validated but not yet enforced on the subagent call.'
+ description: 'Maximum number of tool-calling steps the subagent may take during its agentic loop. Capped at 25. Only relevant when the subagent is given tools. Forwarded to the subagent call as `max_tool_calls`.'
example: 5
maximum: 25
minimum: 1
diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock
index 3a150cdc..434ea063 100644
--- a/.speakeasy/workflow.lock
+++ b/.speakeasy/workflow.lock
@@ -2,8 +2,8 @@ speakeasyVersion: 1.787.0
sources:
OpenRouter API:
sourceNamespace: open-router-chat-completions-api
- sourceRevisionDigest: sha256:582c987e6b1cc22aad969439bb0ff2a4d999c12456fa18a502cd08e584ee26d2
- sourceBlobDigest: sha256:b44ab70ecfca9448c749ed7d244f1daca04a45b958d08eeb0a495cf2bfce1341
+ sourceRevisionDigest: sha256:6190547682cb41c5b422989543ad234040f0bd8b00eeea2e5bdfe42d222c40c7
+ sourceBlobDigest: sha256:a86ecb1bc7b6d32b9bd5052f720c98b42e195fea445e0d02efc7ca3ee3ccde4a
tags:
- latest
- 1.0.0
@@ -11,10 +11,10 @@ targets:
open-router:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
- sourceRevisionDigest: sha256:582c987e6b1cc22aad969439bb0ff2a4d999c12456fa18a502cd08e584ee26d2
- sourceBlobDigest: sha256:b44ab70ecfca9448c749ed7d244f1daca04a45b958d08eeb0a495cf2bfce1341
+ sourceRevisionDigest: sha256:6190547682cb41c5b422989543ad234040f0bd8b00eeea2e5bdfe42d222c40c7
+ sourceBlobDigest: sha256:a86ecb1bc7b6d32b9bd5052f720c98b42e195fea445e0d02efc7ca3ee3ccde4a
codeSamplesNamespace: open-router-python-code-samples
- codeSamplesRevisionDigest: sha256:9365218da5db2b6f14b517d4033b5197b0659a4b13737f131ff21e73e8774b4b
+ codeSamplesRevisionDigest: sha256:192a885ca01b61cd92868dc63c2eae4362ea374515c4d219bddd8fff3e45b737
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.787.0
diff --git a/RELEASES.md b/RELEASES.md
index 60c11c15..2c01b37f 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -1359,4 +1359,14 @@ Based on:
### Generated
- [python v1.1.57] .
### Releases
-- [PyPI v1.1.57] https://pypi.org/project/openrouter/1.1.57 - .
\ No newline at end of file
+- [PyPI v1.1.57] https://pypi.org/project/openrouter/1.1.57 - .
+
+## 2026-08-17 05:32:48
+### Changes
+Based on:
+- OpenAPI Doc
+- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy
+### Generated
+- [python v1.1.58] .
+### Releases
+- [PyPI v1.1.58] https://pypi.org/project/openrouter/1.1.58 - .
\ No newline at end of file
diff --git a/docs/components/functioncallitem.mdx b/docs/components/functioncallitem.mdx
index f1082d73..a05ce326 100644
--- a/docs/components/functioncallitem.mdx
+++ b/docs/components/functioncallitem.mdx
@@ -7,12 +7,14 @@ A function call initiated by the model
## Fields
-| Field | Type | Required | Description | Example |
-| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
-| `arguments` | *str* | :heavy_check_mark: | N/A | |
-| `call_id` | *str* | :heavy_check_mark: | N/A | |
-| `id` | *str* | :heavy_check_mark: | N/A | |
-| `name` | *str* | :heavy_check_mark: | N/A | |
-| `namespace` | *Optional[str]* | :heavy_minus_sign: | Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) | |
-| `status` | [Optional[components.ToolCallStatus]](../components/toolcallstatus.mdx) | :heavy_minus_sign: | N/A | completed |
-| `type` | [components.FunctionCallItemType](../components/functioncallitemtype.mdx) | :heavy_check_mark: | N/A | |
\ No newline at end of file
+| Field | Type | Required | Description | Example |
+| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `arguments` | *str* | :heavy_check_mark: | N/A | |
+| `call_id` | *str* | :heavy_check_mark: | N/A | |
+| `id` | *str* | :heavy_check_mark: | N/A | |
+| `name` | *str* | :heavy_check_mark: | N/A | |
+| `namespace` | *Optional[str]* | :heavy_minus_sign: | Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) | |
+| `status` | [Optional[components.ToolCallStatus]](../components/toolcallstatus.mdx) | :heavy_minus_sign: | N/A | completed |
+| `subagent_id` | *Optional[str]* | :heavy_minus_sign: | EXPERIMENTAL — subject to change without notice. String id that matches the `call_id` of the `openrouter:subagent` server tool call that spawned the subagent. Present on every `function_call` item the subagent projects; absent on ordinary function calls. | |
+| `subagent_items` | List[[components.FunctionCallItemSubagentItem](../components/functioncallitemsubagentitem.mdx)] | :heavy_minus_sign: | EXPERIMENTAL — subject to change without notice. The subagent's output items produced on this turn. Treat this as an opaque object; you must replay it in the request so that the subagent can continue execution of the tool with the same context. If a subagent created multiple parallel tool calls, only the first tool call will have this field. The other tool calls will only have `subagent_id`. Present only if the tool call originates from a subagent spawned by the `openrouter:subagent` server tool. | |
+| `type` | [components.FunctionCallItemType](../components/functioncallitemtype.mdx) | :heavy_check_mark: | N/A | |
\ No newline at end of file
diff --git a/docs/components/functioncallitemsubagentitem.mdx b/docs/components/functioncallitemsubagentitem.mdx
new file mode 100644
index 00000000..19df504a
--- /dev/null
+++ b/docs/components/functioncallitemsubagentitem.mdx
@@ -0,0 +1,10 @@
+---
+title: "FunctionCallItemSubagentItem"
+---
+
+## Fields
+
+| Field | Type | Required | Description |
+| -------------------- | -------------------- | -------------------- | -------------------- |
+| `type` | *str* | :heavy_check_mark: | N/A |
+| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A |
\ No newline at end of file
diff --git a/docs/components/openairesponsefunctiontoolcall.mdx b/docs/components/openairesponsefunctiontoolcall.mdx
index efdbbbce..cfb351eb 100644
--- a/docs/components/openairesponsefunctiontoolcall.mdx
+++ b/docs/components/openairesponsefunctiontoolcall.mdx
@@ -4,12 +4,14 @@ title: "OpenAIResponseFunctionToolCall"
## Fields
-| Field | Type | Required | Description | Example |
-| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
-| `arguments` | *str* | :heavy_check_mark: | N/A | |
-| `call_id` | *str* | :heavy_check_mark: | N/A | |
-| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | |
-| `name` | *str* | :heavy_check_mark: | N/A | |
-| `namespace` | *Optional[str]* | :heavy_minus_sign: | Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) | |
-| `status` | [Optional[components.ToolCallStatus]](../components/toolcallstatus.mdx) | :heavy_minus_sign: | N/A | completed |
-| `type` | [components.OpenAIResponseFunctionToolCallType](../components/openairesponsefunctiontoolcalltype.mdx) | :heavy_check_mark: | N/A | |
\ No newline at end of file
+| Field | Type | Required | Description | Example |
+| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `arguments` | *str* | :heavy_check_mark: | N/A | |
+| `call_id` | *str* | :heavy_check_mark: | N/A | |
+| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | |
+| `name` | *str* | :heavy_check_mark: | N/A | |
+| `namespace` | *Optional[str]* | :heavy_minus_sign: | Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) | |
+| `status` | [Optional[components.ToolCallStatus]](../components/toolcallstatus.mdx) | :heavy_minus_sign: | N/A | completed |
+| `subagent_id` | *Optional[str]* | :heavy_minus_sign: | EXPERIMENTAL — subject to change without notice. String id that matches the `call_id` of the `openrouter:subagent` server tool call that spawned the subagent. Present on every `function_call` item the subagent projects; absent on ordinary function calls. | |
+| `subagent_items` | List[[components.OpenAIResponseFunctionToolCallSubagentItem](../components/openairesponsefunctiontoolcallsubagentitem.mdx)] | :heavy_minus_sign: | EXPERIMENTAL — subject to change without notice. The subagent's output items produced on this turn. Treat this as an opaque object; you must replay it in the request so that the subagent can continue execution of the tool with the same context. If a subagent created multiple parallel tool calls, only the first tool call will have this field. The other tool calls will only have `subagent_id`. Present only if the tool call originates from a subagent spawned by the `openrouter:subagent` server tool. | |
+| `type` | [components.OpenAIResponseFunctionToolCallType](../components/openairesponsefunctiontoolcalltype.mdx) | :heavy_check_mark: | N/A | |
\ No newline at end of file
diff --git a/docs/components/openairesponsefunctiontoolcallsubagentitem.mdx b/docs/components/openairesponsefunctiontoolcallsubagentitem.mdx
new file mode 100644
index 00000000..b52ff9cb
--- /dev/null
+++ b/docs/components/openairesponsefunctiontoolcallsubagentitem.mdx
@@ -0,0 +1,10 @@
+---
+title: "OpenAIResponseFunctionToolCallSubagentItem"
+---
+
+## Fields
+
+| Field | Type | Required | Description |
+| -------------------- | -------------------- | -------------------- | -------------------- |
+| `type` | *str* | :heavy_check_mark: | N/A |
+| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A |
\ No newline at end of file
diff --git a/docs/components/outputfunctioncallitem.mdx b/docs/components/outputfunctioncallitem.mdx
index 86a1cd0d..5a994127 100644
--- a/docs/components/outputfunctioncallitem.mdx
+++ b/docs/components/outputfunctioncallitem.mdx
@@ -4,12 +4,14 @@ title: "OutputFunctionCallItem"
## Fields
-| Field | Type | Required | Description |
-| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
-| `arguments` | *str* | :heavy_check_mark: | N/A |
-| `call_id` | *str* | :heavy_check_mark: | N/A |
-| `id` | *Optional[str]* | :heavy_minus_sign: | N/A |
-| `name` | *str* | :heavy_check_mark: | N/A |
-| `namespace` | *Optional[str]* | :heavy_minus_sign: | Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) |
-| `status` | [Optional[components.OutputFunctionCallItemStatusUnion]](../components/outputfunctioncallitemstatusunion.mdx) | :heavy_minus_sign: | N/A |
-| `type` | [components.OutputFunctionCallItemType](../components/outputfunctioncallitemtype.mdx) | :heavy_check_mark: | N/A |
\ No newline at end of file
+| Field | Type | Required | Description |
+| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `arguments` | *str* | :heavy_check_mark: | N/A |
+| `call_id` | *str* | :heavy_check_mark: | N/A |
+| `id` | *Optional[str]* | :heavy_minus_sign: | N/A |
+| `name` | *str* | :heavy_check_mark: | N/A |
+| `namespace` | *Optional[str]* | :heavy_minus_sign: | Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server) |
+| `status` | [Optional[components.OutputFunctionCallItemStatusUnion]](../components/outputfunctioncallitemstatusunion.mdx) | :heavy_minus_sign: | N/A |
+| `type` | [components.OutputFunctionCallItemType](../components/outputfunctioncallitemtype.mdx) | :heavy_check_mark: | N/A |
+| `subagent_id` | *Optional[str]* | :heavy_minus_sign: | EXPERIMENTAL — subject to change without notice. String id that matches the `call_id` of the `openrouter:subagent` server tool call that spawned the subagent. Present on every `function_call` item the subagent projects; absent on ordinary function calls. |
+| `subagent_items` | List[[components.OutputFunctionCallItemSubagentItem](../components/outputfunctioncallitemsubagentitem.mdx)] | :heavy_minus_sign: | EXPERIMENTAL — subject to change without notice. The subagent's output items produced on this turn. Treat this as an opaque object; you must replay it in the request so that the subagent can continue execution of the tool with the same context. If a subagent created multiple parallel tool calls, only the first tool call will have this field. The other tool calls will only have `subagent_id`. Present only if the tool call originates from a subagent spawned by the `openrouter:subagent` server tool. |
\ No newline at end of file
diff --git a/docs/components/outputfunctioncallitemsubagentitem.mdx b/docs/components/outputfunctioncallitemsubagentitem.mdx
new file mode 100644
index 00000000..7cab07dc
--- /dev/null
+++ b/docs/components/outputfunctioncallitemsubagentitem.mdx
@@ -0,0 +1,10 @@
+---
+title: "OutputFunctionCallItemSubagentItem"
+---
+
+## Fields
+
+| Field | Type | Required | Description |
+| -------------------- | -------------------- | -------------------- | -------------------- |
+| `type` | *str* | :heavy_check_mark: | N/A |
+| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A |
\ No newline at end of file
diff --git a/docs/components/outputsubagentservertoolitem.mdx b/docs/components/outputsubagentservertoolitem.mdx
index 1b15fce1..f74e9cc2 100644
--- a/docs/components/outputsubagentservertoolitem.mdx
+++ b/docs/components/outputsubagentservertoolitem.mdx
@@ -9,6 +9,7 @@ An openrouter:subagent server tool output item
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `call_id` | *Optional[str]* | :heavy_minus_sign: | EXPERIMENTAL — subject to change without notice. The `call_id` of the tool call that spawned this subagent. This id will also be included as the `subagent_id` on any `function_call` items created by the subagent. This must be returned in the request so the `function_call` can be matched with the correct subagent. A suspended `in_progress` item is announced once and never re-emitted or terminally closed — completion arrives as a new item with the same `call_id`. | |
| `error` | *Optional[str]* | :heavy_minus_sign: | Error message when the subagent task did not produce an outcome. | |
| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | |
| `instance_name` | *Optional[str]* | :heavy_minus_sign: | Provider-safe function name of the specific subagent instance that produced this item (e.g. `openrouter_subagent__1`). Present only on items from non-default instances — the second and later subagent entries in the request `tools` array. The first (default) instance omits it, even when multiple subagents are configured. When a replayed item echoes this field back, the transcript rehydrates the call under that instance's tool. This identity is positional: it is derived from the index of the subagent entry in the request `tools` array, so keep the order of subagent entries stable across requests in a conversation. | openrouter_subagent__1 |
diff --git a/docs/components/subagentreasoning.mdx b/docs/components/subagentreasoning.mdx
index 17ee212d..c1d3baea 100644
--- a/docs/components/subagentreasoning.mdx
+++ b/docs/components/subagentreasoning.mdx
@@ -7,7 +7,7 @@ Reasoning configuration forwarded to the subagent call. Use this to control reas
## Fields
-| Field | Type | Required | Description |
-| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
-| `effort` | [Optional[components.SubagentReasoningEffort]](../components/subagentreasoningeffort.mdx) | :heavy_minus_sign: | Reasoning effort level for the subagent call. |
-| `max_tokens` | *Optional[int]* | :heavy_minus_sign: | Maximum number of reasoning tokens the subagent may use. Accepted and validated but not yet forwarded to the subagent call. |
\ No newline at end of file
+| Field | Type | Required | Description |
+| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
+| `effort` | [Optional[components.SubagentReasoningEffort]](../components/subagentreasoningeffort.mdx) | :heavy_minus_sign: | Reasoning effort level for the subagent call. |
+| `max_tokens` | *Optional[int]* | :heavy_minus_sign: | Maximum number of reasoning tokens the subagent may use. Forwarded to the subagent call as `reasoning.max_tokens`. |
\ No newline at end of file
diff --git a/docs/components/subagentservertoolconfig.mdx b/docs/components/subagentservertoolconfig.mdx
index 3a8e769c..3e6825bc 100644
--- a/docs/components/subagentservertoolconfig.mdx
+++ b/docs/components/subagentservertoolconfig.mdx
@@ -7,13 +7,15 @@ Configuration for one openrouter:subagent server tool entry.
## Fields
-| Field | Type | Required | Description | Example |
-| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `instructions` | *Optional[str]* | :heavy_minus_sign: | System instructions for the subagent. When omitted, the subagent responds with no system prompt of its own. | You are a fast, focused worker. Complete the task exactly as described. |
-| `max_completion_tokens` | *Optional[int]* | :heavy_minus_sign: | Maximum number of output tokens (including reasoning) the subagent may produce. When omitted, the provider's default applies. | 2048 |
-| `max_tool_calls` | *Optional[int]* | :heavy_minus_sign: | Maximum number of tool-calling steps the subagent may take during its agentic loop. Capped at 25. Only relevant when the subagent is given tools. Accepted and validated but not yet enforced on the subagent call. | 5 |
-| `model` | *Optional[str]* | :heavy_minus_sign: | Slug of the model that executes delegated tasks (any OpenRouter model). Typically a smaller, cheaper, faster model than the one delegating. When omitted, the model from the outer API request is used. The subagent tool itself cannot be the subagent model. | ~anthropic/claude-haiku-latest |
-| `name` | *Optional[str]* | :heavy_minus_sign: | Optional name for this subagent. The model sees one tool per named subagent (and one default for an unnamed entry). Names must be unique across subagent entries. Letters, digits, spaces, underscores, and dashes; trimmed; 1–64 chars. | summarizer |
-| `reasoning` | [Optional[components.SubagentReasoning]](../components/subagentreasoning.mdx) | :heavy_minus_sign: | Reasoning configuration forwarded to the subagent call. Use this to control reasoning effort and token budget for models that support extended thinking. | \{
"effort": "low"
} |
-| `temperature` | *Optional[float]* | :heavy_minus_sign: | Sampling temperature forwarded to the subagent call. When omitted, the provider's default applies. | 0.7 |
-| `tools` | List[[components.SubagentNestedTool](../components/subagentnestedtool.mdx)] | :heavy_minus_sign: | Tools the subagent may use while executing a delegated task. The subagent runs as an agentic sub-agent over these tools, then returns its outcome. Only OpenRouter server tools are supported — function tools are rejected — and the list must not include the subagent tool itself. | |
\ No newline at end of file
+| Field | Type | Required | Description | Example |
+| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| `inherit_functions` | *Optional[bool]* | :heavy_minus_sign: | EXPERIMENTAL — subject to change without notice. When true, the subagent inherits every client function defined in the request's top-level `tools` list. Supported on the Responses API (`/api/v1/responses`) only; other APIs reject it with a `400`. | true |
+| `inherited_function_names` | List[*str*] | :heavy_minus_sign: | EXPERIMENTAL — subject to change without notice. Names of the top-level function tools that the subagent will inherit. Any tool that matches by name will be copied fully into the tools array of the subagent. When `inherit_functions` is `true`, this list does nothing, because every client function will be inherited by default. Names are trimmed before validation, so a whitespace-only name is rejected with a `400`. Supported on the Responses API (`/api/v1/responses`) only; other APIs reject it with a `400`. | [
"lookup_order"
] |
+| `instructions` | *Optional[str]* | :heavy_minus_sign: | System instructions for the subagent. When omitted, the subagent responds with no system prompt of its own. | You are a fast, focused worker. Complete the task exactly as described. |
+| `max_completion_tokens` | *Optional[int]* | :heavy_minus_sign: | Maximum number of output tokens (including reasoning) the subagent may produce. When omitted, the provider's default applies. | 2048 |
+| `max_tool_calls` | *Optional[int]* | :heavy_minus_sign: | Maximum number of tool-calling steps the subagent may take during its agentic loop. Capped at 25. Only relevant when the subagent is given tools. Forwarded to the subagent call as `max_tool_calls`. | 5 |
+| `model` | *Optional[str]* | :heavy_minus_sign: | Slug of the model that executes delegated tasks (any OpenRouter model). Typically a smaller, cheaper, faster model than the one delegating. When omitted, the model from the outer API request is used. The subagent tool itself cannot be the subagent model. | ~anthropic/claude-haiku-latest |
+| `name` | *Optional[str]* | :heavy_minus_sign: | Optional name for this subagent. The model sees one tool per named subagent (and one default for an unnamed entry). Names must be unique across subagent entries. Letters, digits, spaces, underscores, and dashes; trimmed; 1–64 chars. | summarizer |
+| `reasoning` | [Optional[components.SubagentReasoning]](../components/subagentreasoning.mdx) | :heavy_minus_sign: | Reasoning configuration forwarded to the subagent call. Use this to control reasoning effort and token budget for models that support extended thinking. | \{
"effort": "low"
} |
+| `temperature` | *Optional[float]* | :heavy_minus_sign: | Sampling temperature forwarded to the subagent call. When omitted, the provider's default applies. | 0.7 |
+| `tools` | List[[components.SubagentNestedTool](../components/subagentnestedtool.mdx)] | :heavy_minus_sign: | Tools the subagent may use while executing a delegated task. The subagent runs as an agentic sub-agent over these tools, then returns its outcome. Only OpenRouter server tools are supported — function tools are rejected — and the list must not include the subagent tool itself. | |
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 36963934..6d5eb569 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "openrouter"
-version = "1.1.57"
+version = "1.1.58"
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 80371bc5..de143607 100644
--- a/src/openrouter/_version.py
+++ b/src/openrouter/_version.py
@@ -3,10 +3,10 @@
import importlib.metadata
__title__: str = "openrouter"
-__version__: str = "1.1.57"
+__version__: str = "1.1.58"
__openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.914.0"
-__user_agent__: str = "speakeasy-sdk/python 1.1.57 2.914.0 1.0.0 openrouter"
+__user_agent__: str = "speakeasy-sdk/python 1.1.58 2.914.0 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 aa1609dc..5521c2bb 100644
--- a/src/openrouter/components/__init__.py
+++ b/src/openrouter/components/__init__.py
@@ -1077,6 +1077,8 @@
)
from .functioncallitem import (
FunctionCallItem,
+ FunctionCallItemSubagentItem,
+ FunctionCallItemSubagentItemTypedDict,
FunctionCallItemType,
FunctionCallItemTypedDict,
)
@@ -2000,6 +2002,8 @@
)
from .openairesponsefunctiontoolcall import (
OpenAIResponseFunctionToolCall,
+ OpenAIResponseFunctionToolCallSubagentItem,
+ OpenAIResponseFunctionToolCallSubagentItemTypedDict,
OpenAIResponseFunctionToolCallType,
OpenAIResponseFunctionToolCallTypedDict,
)
@@ -2191,6 +2195,8 @@
OutputFunctionCallItemStatusIncomplete,
OutputFunctionCallItemStatusUnion,
OutputFunctionCallItemStatusUnionTypedDict,
+ OutputFunctionCallItemSubagentItem,
+ OutputFunctionCallItemSubagentItemTypedDict,
OutputFunctionCallItemType,
OutputFunctionCallItemTypedDict,
)
@@ -3884,6 +3890,8 @@
"FunctionCallArgsDoneEventType",
"FunctionCallArgsDoneEventTypedDict",
"FunctionCallItem",
+ "FunctionCallItemSubagentItem",
+ "FunctionCallItemSubagentItemTypedDict",
"FunctionCallItemType",
"FunctionCallItemTypedDict",
"FunctionCallOutputItem",
@@ -4475,6 +4483,8 @@
"OpenAIResponseFunctionToolCallOutputOutput2TypedDict",
"OpenAIResponseFunctionToolCallOutputType",
"OpenAIResponseFunctionToolCallOutputTypedDict",
+ "OpenAIResponseFunctionToolCallSubagentItem",
+ "OpenAIResponseFunctionToolCallSubagentItemTypedDict",
"OpenAIResponseFunctionToolCallType",
"OpenAIResponseFunctionToolCallTypedDict",
"OpenAIResponseInputMessageItem",
@@ -4598,6 +4608,8 @@
"OutputFunctionCallItemStatusIncomplete",
"OutputFunctionCallItemStatusUnion",
"OutputFunctionCallItemStatusUnionTypedDict",
+ "OutputFunctionCallItemSubagentItem",
+ "OutputFunctionCallItemSubagentItemTypedDict",
"OutputFunctionCallItemType",
"OutputFunctionCallItemTypedDict",
"OutputFusionServerToolItem",
@@ -6110,6 +6122,8 @@
"FunctionCallArgsDoneEventType": ".functioncallargsdoneevent",
"FunctionCallArgsDoneEventTypedDict": ".functioncallargsdoneevent",
"FunctionCallItem": ".functioncallitem",
+ "FunctionCallItemSubagentItem": ".functioncallitem",
+ "FunctionCallItemSubagentItemTypedDict": ".functioncallitem",
"FunctionCallItemType": ".functioncallitem",
"FunctionCallItemTypedDict": ".functioncallitem",
"FunctionCallOutputItem": ".functioncalloutputitem",
@@ -6831,6 +6845,8 @@
"OpenAIResponseCustomToolCallOutputTypedDict": ".openairesponsecustomtoolcalloutput",
"UnknownOpenAIResponseCustomToolCallOutputOutput1": ".openairesponsecustomtoolcalloutput",
"OpenAIResponseFunctionToolCall": ".openairesponsefunctiontoolcall",
+ "OpenAIResponseFunctionToolCallSubagentItem": ".openairesponsefunctiontoolcall",
+ "OpenAIResponseFunctionToolCallSubagentItemTypedDict": ".openairesponsefunctiontoolcall",
"OpenAIResponseFunctionToolCallType": ".openairesponsefunctiontoolcall",
"OpenAIResponseFunctionToolCallTypedDict": ".openairesponsefunctiontoolcall",
"OpenAIResponseFunctionToolCallOutput": ".openairesponsefunctiontoolcalloutput",
@@ -6971,6 +6987,8 @@
"OutputFunctionCallItemStatusIncomplete": ".outputfunctioncallitem",
"OutputFunctionCallItemStatusUnion": ".outputfunctioncallitem",
"OutputFunctionCallItemStatusUnionTypedDict": ".outputfunctioncallitem",
+ "OutputFunctionCallItemSubagentItem": ".outputfunctioncallitem",
+ "OutputFunctionCallItemSubagentItemTypedDict": ".outputfunctioncallitem",
"OutputFunctionCallItemType": ".outputfunctioncallitem",
"OutputFunctionCallItemTypedDict": ".outputfunctioncallitem",
"FailedModel": ".outputfusionservertoolitem",
diff --git a/src/openrouter/components/functioncallitem.py b/src/openrouter/components/functioncallitem.py
index 8d9002fa..5a2e897e 100644
--- a/src/openrouter/components/functioncallitem.py
+++ b/src/openrouter/components/functioncallitem.py
@@ -3,11 +3,33 @@
from __future__ import annotations
from .toolcallstatus import ToolCallStatus
from openrouter.types import BaseModel, UNSET_SENTINEL
-from pydantic import model_serializer
-from typing import Literal, Optional
+import pydantic
+from pydantic import ConfigDict, model_serializer
+from typing import Any, Dict, List, Literal, Optional
from typing_extensions import NotRequired, TypedDict
+class FunctionCallItemSubagentItemTypedDict(TypedDict):
+ type: str
+
+
+class FunctionCallItemSubagentItem(BaseModel):
+ model_config = ConfigDict(
+ populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
+ )
+ __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
+
+ type: str
+
+ @property
+ def additional_properties(self):
+ return self.__pydantic_extra__
+
+ @additional_properties.setter
+ def additional_properties(self, value):
+ self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
+
+
FunctionCallItemType = Literal["function_call",]
@@ -22,6 +44,10 @@ class FunctionCallItemTypedDict(TypedDict):
namespace: NotRequired[str]
r"""Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"""
status: NotRequired[ToolCallStatus]
+ subagent_id: NotRequired[str]
+ r"""EXPERIMENTAL — subject to change without notice. String id that matches the `call_id` of the `openrouter:subagent` server tool call that spawned the subagent. Present on every `function_call` item the subagent projects; absent on ordinary function calls."""
+ subagent_items: NotRequired[List[FunctionCallItemSubagentItemTypedDict]]
+ r"""EXPERIMENTAL — subject to change without notice. The subagent's output items produced on this turn. Treat this as an opaque object; you must replay it in the request so that the subagent can continue execution of the tool with the same context. If a subagent created multiple parallel tool calls, only the first tool call will have this field. The other tool calls will only have `subagent_id`. Present only if the tool call originates from a subagent spawned by the `openrouter:subagent` server tool."""
class FunctionCallItem(BaseModel):
@@ -42,9 +68,15 @@ class FunctionCallItem(BaseModel):
status: Optional[ToolCallStatus] = None
+ subagent_id: Optional[str] = None
+ r"""EXPERIMENTAL — subject to change without notice. String id that matches the `call_id` of the `openrouter:subagent` server tool call that spawned the subagent. Present on every `function_call` item the subagent projects; absent on ordinary function calls."""
+
+ subagent_items: Optional[List[FunctionCallItemSubagentItem]] = None
+ r"""EXPERIMENTAL — subject to change without notice. The subagent's output items produced on this turn. Treat this as an opaque object; you must replay it in the request so that the subagent can continue execution of the tool with the same context. If a subagent created multiple parallel tool calls, only the first tool call will have this field. The other tool calls will only have `subagent_id`. Present only if the tool call originates from a subagent spawned by the `openrouter:subagent` server tool."""
+
@model_serializer(mode="wrap")
def serialize_model(self, handler):
- optional_fields = set(["namespace", "status"])
+ optional_fields = set(["namespace", "status", "subagent_id", "subagent_items"])
serialized = handler(self)
m = {}
diff --git a/src/openrouter/components/inputs_union.py b/src/openrouter/components/inputs_union.py
index 82a4055f..557636cb 100644
--- a/src/openrouter/components/inputs_union.py
+++ b/src/openrouter/components/inputs_union.py
@@ -388,29 +388,27 @@ def serialize_model(self, handler):
OutputFileSearchServerToolItemTypedDict,
OutputWebSearchServerToolItemTypedDict,
OutputApplyPatchServerToolItemTypedDict,
- OutputImageGenerationCallItemTypedDict,
- McpListToolsItemTypedDict,
McpApprovalResponseItemTypedDict,
+ McpListToolsItemTypedDict,
+ LocalShellCallItemTypedDict,
OutputDatetimeItemTypedDict,
OutputWebSearchCallItemTypedDict,
- LocalShellCallItemTypedDict,
McpApprovalRequestItemTypedDict,
- OutputSearchModelsServerToolItemTypedDict,
- OutputBrowserUseServerToolItemTypedDict,
+ OutputMcpServerToolItemTypedDict,
FunctionCallOutputItemTypedDict,
- OutputTextEditorServerToolItemTypedDict,
+ OutputBrowserUseServerToolItemTypedDict,
ApplyPatchCallItemTypedDict,
+ OutputTextEditorServerToolItemTypedDict,
ApplyPatchCallOutputItemTypedDict,
- OutputMcpServerToolItemTypedDict,
- OutputMemoryServerToolItemTypedDict,
- InputsMessageTypedDict,
+ OutputImageGenerationCallItemTypedDict,
+ OutputSearchModelsServerToolItemTypedDict,
OutputCustomToolCallItemTypedDict,
+ OutputMemoryServerToolItemTypedDict,
CustomToolCallItemTypedDict,
+ InputsMessageTypedDict,
+ ShellCallOutputItemTypedDict,
OutputComputerCallItemTypedDict,
ShellCallItemTypedDict,
- ShellCallOutputItemTypedDict,
- OutputFunctionCallItemTypedDict,
- FunctionCallItemTypedDict,
McpCallItemTypedDict,
AgentMessageItemTypedDict,
OutputCodeInterpreterCallItemTypedDict,
@@ -422,7 +420,9 @@ def serialize_model(self, handler):
OutputImageGenerationServerToolItemTypedDict,
OutputCodeInterpreterServerToolItemTypedDict,
OutputFusionServerToolItemTypedDict,
+ OutputFunctionCallItemTypedDict,
OutputBashServerToolItemTypedDict,
+ FunctionCallItemTypedDict,
OutputSubagentServerToolItemTypedDict,
],
)
@@ -444,29 +444,27 @@ def serialize_model(self, handler):
OutputFileSearchServerToolItem,
OutputWebSearchServerToolItem,
OutputApplyPatchServerToolItem,
- OutputImageGenerationCallItem,
- McpListToolsItem,
McpApprovalResponseItem,
+ McpListToolsItem,
+ LocalShellCallItem,
OutputDatetimeItem,
OutputWebSearchCallItem,
- LocalShellCallItem,
McpApprovalRequestItem,
- OutputSearchModelsServerToolItem,
- OutputBrowserUseServerToolItem,
+ OutputMcpServerToolItem,
FunctionCallOutputItem,
- OutputTextEditorServerToolItem,
+ OutputBrowserUseServerToolItem,
ApplyPatchCallItem,
+ OutputTextEditorServerToolItem,
ApplyPatchCallOutputItem,
- OutputMcpServerToolItem,
- OutputMemoryServerToolItem,
- InputsMessage,
+ OutputImageGenerationCallItem,
+ OutputSearchModelsServerToolItem,
OutputCustomToolCallItem,
+ OutputMemoryServerToolItem,
CustomToolCallItem,
+ InputsMessage,
+ ShellCallOutputItem,
OutputComputerCallItem,
ShellCallItem,
- ShellCallOutputItem,
- OutputFunctionCallItem,
- FunctionCallItem,
McpCallItem,
AgentMessageItem,
OutputCodeInterpreterCallItem,
@@ -478,7 +476,9 @@ def serialize_model(self, handler):
OutputImageGenerationServerToolItem,
OutputCodeInterpreterServerToolItem,
OutputFusionServerToolItem,
+ OutputFunctionCallItem,
OutputBashServerToolItem,
+ FunctionCallItem,
OutputSubagentServerToolItem,
],
)
diff --git a/src/openrouter/components/openairesponsefunctiontoolcall.py b/src/openrouter/components/openairesponsefunctiontoolcall.py
index 2351f7f0..6220666c 100644
--- a/src/openrouter/components/openairesponsefunctiontoolcall.py
+++ b/src/openrouter/components/openairesponsefunctiontoolcall.py
@@ -3,11 +3,33 @@
from __future__ import annotations
from .toolcallstatus import ToolCallStatus
from openrouter.types import BaseModel, UNSET_SENTINEL
-from pydantic import model_serializer
-from typing import Literal, Optional
+import pydantic
+from pydantic import ConfigDict, model_serializer
+from typing import Any, Dict, List, Literal, Optional
from typing_extensions import NotRequired, TypedDict
+class OpenAIResponseFunctionToolCallSubagentItemTypedDict(TypedDict):
+ type: str
+
+
+class OpenAIResponseFunctionToolCallSubagentItem(BaseModel):
+ model_config = ConfigDict(
+ populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
+ )
+ __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
+
+ type: str
+
+ @property
+ def additional_properties(self):
+ return self.__pydantic_extra__
+
+ @additional_properties.setter
+ def additional_properties(self, value):
+ self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
+
+
OpenAIResponseFunctionToolCallType = Literal["function_call",]
@@ -20,6 +42,12 @@ class OpenAIResponseFunctionToolCallTypedDict(TypedDict):
namespace: NotRequired[str]
r"""Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"""
status: NotRequired[ToolCallStatus]
+ subagent_id: NotRequired[str]
+ r"""EXPERIMENTAL — subject to change without notice. String id that matches the `call_id` of the `openrouter:subagent` server tool call that spawned the subagent. Present on every `function_call` item the subagent projects; absent on ordinary function calls."""
+ subagent_items: NotRequired[
+ List[OpenAIResponseFunctionToolCallSubagentItemTypedDict]
+ ]
+ r"""EXPERIMENTAL — subject to change without notice. The subagent's output items produced on this turn. Treat this as an opaque object; you must replay it in the request so that the subagent can continue execution of the tool with the same context. If a subagent created multiple parallel tool calls, only the first tool call will have this field. The other tool calls will only have `subagent_id`. Present only if the tool call originates from a subagent spawned by the `openrouter:subagent` server tool."""
class OpenAIResponseFunctionToolCall(BaseModel):
@@ -38,9 +66,17 @@ class OpenAIResponseFunctionToolCall(BaseModel):
status: Optional[ToolCallStatus] = None
+ subagent_id: Optional[str] = None
+ r"""EXPERIMENTAL — subject to change without notice. String id that matches the `call_id` of the `openrouter:subagent` server tool call that spawned the subagent. Present on every `function_call` item the subagent projects; absent on ordinary function calls."""
+
+ subagent_items: Optional[List[OpenAIResponseFunctionToolCallSubagentItem]] = None
+ r"""EXPERIMENTAL — subject to change without notice. The subagent's output items produced on this turn. Treat this as an opaque object; you must replay it in the request so that the subagent can continue execution of the tool with the same context. If a subagent created multiple parallel tool calls, only the first tool call will have this field. The other tool calls will only have `subagent_id`. Present only if the tool call originates from a subagent spawned by the `openrouter:subagent` server tool."""
+
@model_serializer(mode="wrap")
def serialize_model(self, handler):
- optional_fields = set(["id", "namespace", "status"])
+ optional_fields = set(
+ ["id", "namespace", "status", "subagent_id", "subagent_items"]
+ )
serialized = handler(self)
m = {}
diff --git a/src/openrouter/components/outputfunctioncallitem.py b/src/openrouter/components/outputfunctioncallitem.py
index 13dc4afc..c33627e1 100644
--- a/src/openrouter/components/outputfunctioncallitem.py
+++ b/src/openrouter/components/outputfunctioncallitem.py
@@ -2,8 +2,9 @@
from __future__ import annotations
from openrouter.types import BaseModel, UNSET_SENTINEL
-from pydantic import model_serializer
-from typing import Literal, Optional, Union
+import pydantic
+from pydantic import ConfigDict, model_serializer
+from typing import Any, Dict, List, Literal, Optional, Union
from typing_extensions import NotRequired, TypeAliasType, TypedDict
@@ -39,6 +40,27 @@
OutputFunctionCallItemType = Literal["function_call",]
+class OutputFunctionCallItemSubagentItemTypedDict(TypedDict):
+ type: str
+
+
+class OutputFunctionCallItemSubagentItem(BaseModel):
+ model_config = ConfigDict(
+ populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
+ )
+ __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
+
+ type: str
+
+ @property
+ def additional_properties(self):
+ return self.__pydantic_extra__
+
+ @additional_properties.setter
+ def additional_properties(self, value):
+ self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
+
+
class OutputFunctionCallItemTypedDict(TypedDict):
arguments: str
call_id: str
@@ -48,6 +70,10 @@ class OutputFunctionCallItemTypedDict(TypedDict):
namespace: NotRequired[str]
r"""Namespace qualifier for tools registered as part of a namespace tool group (e.g. an MCP server)"""
status: NotRequired[OutputFunctionCallItemStatusUnionTypedDict]
+ subagent_id: NotRequired[str]
+ r"""EXPERIMENTAL — subject to change without notice. String id that matches the `call_id` of the `openrouter:subagent` server tool call that spawned the subagent. Present on every `function_call` item the subagent projects; absent on ordinary function calls."""
+ subagent_items: NotRequired[List[OutputFunctionCallItemSubagentItemTypedDict]]
+ r"""EXPERIMENTAL — subject to change without notice. The subagent's output items produced on this turn. Treat this as an opaque object; you must replay it in the request so that the subagent can continue execution of the tool with the same context. If a subagent created multiple parallel tool calls, only the first tool call will have this field. The other tool calls will only have `subagent_id`. Present only if the tool call originates from a subagent spawned by the `openrouter:subagent` server tool."""
class OutputFunctionCallItem(BaseModel):
@@ -66,9 +92,17 @@ class OutputFunctionCallItem(BaseModel):
status: Optional[OutputFunctionCallItemStatusUnion] = None
+ subagent_id: Optional[str] = None
+ r"""EXPERIMENTAL — subject to change without notice. String id that matches the `call_id` of the `openrouter:subagent` server tool call that spawned the subagent. Present on every `function_call` item the subagent projects; absent on ordinary function calls."""
+
+ subagent_items: Optional[List[OutputFunctionCallItemSubagentItem]] = None
+ r"""EXPERIMENTAL — subject to change without notice. The subagent's output items produced on this turn. Treat this as an opaque object; you must replay it in the request so that the subagent can continue execution of the tool with the same context. If a subagent created multiple parallel tool calls, only the first tool call will have this field. The other tool calls will only have `subagent_id`. Present only if the tool call originates from a subagent spawned by the `openrouter:subagent` server tool."""
+
@model_serializer(mode="wrap")
def serialize_model(self, handler):
- optional_fields = set(["id", "namespace", "status"])
+ optional_fields = set(
+ ["id", "namespace", "status", "subagent_id", "subagent_items"]
+ )
serialized = handler(self)
m = {}
diff --git a/src/openrouter/components/outputitems.py b/src/openrouter/components/outputitems.py
index e636dee6..3866bb7e 100644
--- a/src/openrouter/components/outputitems.py
+++ b/src/openrouter/components/outputitems.py
@@ -141,7 +141,6 @@
OutputMemoryServerToolItemTypedDict,
OutputMessageItemTypedDict,
OutputCodeInterpreterCallItemTypedDict,
- OutputFunctionCallItemTypedDict,
OutputWebFetchServerToolItemTypedDict,
OutputCodeInterpreterServerToolItemTypedDict,
OutputReasoningItemTypedDict,
@@ -149,6 +148,7 @@
OutputFilesServerToolItemTypedDict,
OutputImageGenerationServerToolItemTypedDict,
OutputBashServerToolItemTypedDict,
+ OutputFunctionCallItemTypedDict,
OutputFusionServerToolItemTypedDict,
OutputSubagentServerToolItemTypedDict,
],
diff --git a/src/openrouter/components/outputsubagentservertoolitem.py b/src/openrouter/components/outputsubagentservertoolitem.py
index 3e4bba14..a4325ca9 100644
--- a/src/openrouter/components/outputsubagentservertoolitem.py
+++ b/src/openrouter/components/outputsubagentservertoolitem.py
@@ -16,6 +16,8 @@ class OutputSubagentServerToolItemTypedDict(TypedDict):
status: ToolCallStatus
type: OutputSubagentServerToolItemType
+ call_id: NotRequired[str]
+ r"""EXPERIMENTAL — subject to change without notice. The `call_id` of the tool call that spawned this subagent. This id will also be included as the `subagent_id` on any `function_call` items created by the subagent. This must be returned in the request so the `function_call` can be matched with the correct subagent. A suspended `in_progress` item is announced once and never re-emitted or terminally closed — completion arrives as a new item with the same `call_id`."""
error: NotRequired[str]
r"""Error message when the subagent task did not produce an outcome."""
id: NotRequired[str]
@@ -40,6 +42,9 @@ class OutputSubagentServerToolItem(BaseModel):
type: OutputSubagentServerToolItemType
+ call_id: Optional[str] = None
+ r"""EXPERIMENTAL — subject to change without notice. The `call_id` of the tool call that spawned this subagent. This id will also be included as the `subagent_id` on any `function_call` items created by the subagent. This must be returned in the request so the `function_call` can be matched with the correct subagent. A suspended `in_progress` item is announced once and never re-emitted or terminally closed — completion arrives as a new item with the same `call_id`."""
+
error: Optional[str] = None
r"""Error message when the subagent task did not produce an outcome."""
@@ -67,6 +72,7 @@ class OutputSubagentServerToolItem(BaseModel):
def serialize_model(self, handler):
optional_fields = set(
[
+ "call_id",
"error",
"id",
"instance_name",
diff --git a/src/openrouter/components/subagentreasoning.py b/src/openrouter/components/subagentreasoning.py
index d34c619b..87af45ca 100644
--- a/src/openrouter/components/subagentreasoning.py
+++ b/src/openrouter/components/subagentreasoning.py
@@ -28,7 +28,7 @@ class SubagentReasoningTypedDict(TypedDict):
effort: NotRequired[SubagentReasoningEffort]
r"""Reasoning effort level for the subagent call."""
max_tokens: NotRequired[int]
- r"""Maximum number of reasoning tokens the subagent may use. Accepted and validated but not yet forwarded to the subagent call."""
+ r"""Maximum number of reasoning tokens the subagent may use. Forwarded to the subagent call as `reasoning.max_tokens`."""
class SubagentReasoning(BaseModel):
@@ -38,7 +38,7 @@ class SubagentReasoning(BaseModel):
r"""Reasoning effort level for the subagent call."""
max_tokens: Optional[int] = None
- r"""Maximum number of reasoning tokens the subagent may use. Accepted and validated but not yet forwarded to the subagent call."""
+ r"""Maximum number of reasoning tokens the subagent may use. Forwarded to the subagent call as `reasoning.max_tokens`."""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
diff --git a/src/openrouter/components/subagentservertoolconfig.py b/src/openrouter/components/subagentservertoolconfig.py
index 54683b28..db9adabf 100644
--- a/src/openrouter/components/subagentservertoolconfig.py
+++ b/src/openrouter/components/subagentservertoolconfig.py
@@ -12,12 +12,16 @@
class SubagentServerToolConfigTypedDict(TypedDict):
r"""Configuration for one openrouter:subagent server tool entry."""
+ inherit_functions: NotRequired[bool]
+ r"""EXPERIMENTAL — subject to change without notice. When true, the subagent inherits every client function defined in the request's top-level `tools` list. Supported on the Responses API (`/api/v1/responses`) only; other APIs reject it with a `400`."""
+ inherited_function_names: NotRequired[List[str]]
+ r"""EXPERIMENTAL — subject to change without notice. Names of the top-level function tools that the subagent will inherit. Any tool that matches by name will be copied fully into the tools array of the subagent. When `inherit_functions` is `true`, this list does nothing, because every client function will be inherited by default. Names are trimmed before validation, so a whitespace-only name is rejected with a `400`. Supported on the Responses API (`/api/v1/responses`) only; other APIs reject it with a `400`."""
instructions: NotRequired[str]
r"""System instructions for the subagent. When omitted, the subagent responds with no system prompt of its own."""
max_completion_tokens: NotRequired[int]
r"""Maximum number of output tokens (including reasoning) the subagent may produce. When omitted, the provider's default applies."""
max_tool_calls: NotRequired[int]
- r"""Maximum number of tool-calling steps the subagent may take during its agentic loop. Capped at 25. Only relevant when the subagent is given tools. Accepted and validated but not yet enforced on the subagent call."""
+ r"""Maximum number of tool-calling steps the subagent may take during its agentic loop. Capped at 25. Only relevant when the subagent is given tools. Forwarded to the subagent call as `max_tool_calls`."""
model: NotRequired[str]
r"""Slug of the model that executes delegated tasks (any OpenRouter model). Typically a smaller, cheaper, faster model than the one delegating. When omitted, the model from the outer API request is used. The subagent tool itself cannot be the subagent model."""
name: NotRequired[str]
@@ -33,6 +37,12 @@ class SubagentServerToolConfigTypedDict(TypedDict):
class SubagentServerToolConfig(BaseModel):
r"""Configuration for one openrouter:subagent server tool entry."""
+ inherit_functions: Optional[bool] = None
+ r"""EXPERIMENTAL — subject to change without notice. When true, the subagent inherits every client function defined in the request's top-level `tools` list. Supported on the Responses API (`/api/v1/responses`) only; other APIs reject it with a `400`."""
+
+ inherited_function_names: Optional[List[str]] = None
+ r"""EXPERIMENTAL — subject to change without notice. Names of the top-level function tools that the subagent will inherit. Any tool that matches by name will be copied fully into the tools array of the subagent. When `inherit_functions` is `true`, this list does nothing, because every client function will be inherited by default. Names are trimmed before validation, so a whitespace-only name is rejected with a `400`. Supported on the Responses API (`/api/v1/responses`) only; other APIs reject it with a `400`."""
+
instructions: Optional[str] = None
r"""System instructions for the subagent. When omitted, the subagent responds with no system prompt of its own."""
@@ -40,7 +50,7 @@ class SubagentServerToolConfig(BaseModel):
r"""Maximum number of output tokens (including reasoning) the subagent may produce. When omitted, the provider's default applies."""
max_tool_calls: Optional[int] = None
- r"""Maximum number of tool-calling steps the subagent may take during its agentic loop. Capped at 25. Only relevant when the subagent is given tools. Accepted and validated but not yet enforced on the subagent call."""
+ r"""Maximum number of tool-calling steps the subagent may take during its agentic loop. Capped at 25. Only relevant when the subagent is given tools. Forwarded to the subagent call as `max_tool_calls`."""
model: Optional[str] = None
r"""Slug of the model that executes delegated tasks (any OpenRouter model). Typically a smaller, cheaper, faster model than the one delegating. When omitted, the model from the outer API request is used. The subagent tool itself cannot be the subagent model."""
@@ -61,6 +71,8 @@ class SubagentServerToolConfig(BaseModel):
def serialize_model(self, handler):
optional_fields = set(
[
+ "inherit_functions",
+ "inherited_function_names",
"instructions",
"max_completion_tokens",
"max_tool_calls",
diff --git a/uv.lock b/uv.lock
index 768b8f9a..cb33d088 100644
--- a/uv.lock
+++ b/uv.lock
@@ -213,7 +213,7 @@ wheels = [
[[package]]
name = "openrouter"
-version = "1.1.57"
+version = "1.1.58"
source = { editable = "." }
dependencies = [
{ name = "httpcore" },