diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock
index b27c0122..95366867 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: 4d7bc309d152d9219793784223caa0e2
+ docChecksum: 6799c71d3ea4f78791dae3d42bbda90e
docVersion: 1.0.0
speakeasyVersion: 1.787.0
generationVersion: 2.914.0
- releaseVersion: 1.0.2
- configChecksum: 0d88423a51b17a0f814a69da6e567287
+ releaseVersion: 1.0.3
+ configChecksum: d626fa55bac1f913458f24bff2b8efa6
repoURL: https://github.com/OpenRouterTeam/python-sdk.git
installationURL: https://github.com/OpenRouterTeam/python-sdk.git
published: true
persistentEdits:
- generation_id: c7290cc8-9e30-476c-814d-ddbb46291b13
- pristine_commit_hash: 51e0667d890545728a2326f301008448da6999e7
- pristine_tree_hash: 30dba92ec25182ca262a2e72aaba8f67267868e9
+ generation_id: dfab1d3a-11c2-4d4b-992d-aa95cb09e46c
+ pristine_commit_hash: ada688def3e4fca7fab968ec4ec22a079ca7c9bc
+ pristine_tree_hash: c0a8f38491c96bb4c4f15f5c7cc64d2ceac6e5be
features:
python:
acceptHeaders: 3.0.0
@@ -3710,8 +3710,8 @@ trackedFiles:
pristine_git_object: 2bfc5b85b0a0962d951930f1fd22bf3fb230750a
docs/components/outputsubagentservertoolitem.mdx:
id: afeb6acde438
- last_write_checksum: sha1:36325a1dafb79158eae8b60a27cda59c6a56f25f
- pristine_git_object: edc8261cf9839725dcf0a28c6a5224787b57a41c
+ last_write_checksum: sha1:f098a2f49e4a4f2d627148d02a8e49ce2f8a89f0
+ pristine_git_object: 1b15fce12d6fc2bd2096db911b9b752bf0b2ace8
docs/components/outputsubagentservertoolitemtype.mdx:
id: de66682e96c0
last_write_checksum: sha1:73a7ed6acdb716d85e1cd3b83517f12dcc5ee393
@@ -4610,12 +4610,12 @@ trackedFiles:
pristine_git_object: 6ff0d51d2b5668291fb70f4cd5ad649fe3f4f6fc
docs/components/subagentservertoolconfig.mdx:
id: f7fa49016554
- last_write_checksum: sha1:ca1963d4e1fdf93899b06c47d3b82662e4cd5a45
- pristine_git_object: 3ce20c0c2fe0e438349c42e9edf60f2047ae976a
+ last_write_checksum: sha1:13d1921170bf027092fecb3b5b6eacbf143771af
+ pristine_git_object: 3a8e769cc39c22e754bb347e8a6b55fa03d3422c
docs/components/subagentservertoolopenrouter.mdx:
id: 8ede88c6400a
- last_write_checksum: sha1:2c6d5bf4755ade31c622cd4a4658d874e77042fc
- pristine_git_object: c50f5bf89454fc4ce29845ba8a16cc94c9858f19
+ last_write_checksum: sha1:9f4c3798805099682584724a42d211fe0861f431
+ pristine_git_object: 3b1eb0a6346f2b92a7843e0c6027f863ec445d99
docs/components/subagentservertoolopenroutertype.mdx:
id: 36a519fbf209
last_write_checksum: sha1:14f4bf5f550f0dfddb8bd950e000ed431a5470e9
@@ -6694,8 +6694,8 @@ trackedFiles:
pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544
pyproject.toml:
id: 5d07e7d72637
- last_write_checksum: sha1:e7ac166ffcdc1b8ee6eb7a4acc7a26d059036b03
- pristine_git_object: d5038fdd4789c39bb8cbde28a3045830ad4d2136
+ last_write_checksum: sha1:d9ce5e0d11cddba48a0f5abc1c55377389b54368
+ pristine_git_object: 0aceb631a7f6c55a1761d6343a4ac9de8bd146cc
scripts/prepare_readme.py:
id: e0c5957a6035
last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54
@@ -6722,8 +6722,8 @@ trackedFiles:
pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137
src/openrouter/_version.py:
id: d8d15ad6c586
- last_write_checksum: sha1:aa9006eeb9981c347e3a7ad34c37f2665a7d7177
- pristine_git_object: 0529b8a8d7c685556c80adfaca339db0803fc2f5
+ last_write_checksum: sha1:d935fba4a8ccfae2559c8342948738b422afa62c
+ pristine_git_object: 0eacd0cccbc32377b0fcc31c7a182967f78fae33
src/openrouter/analytics.py:
id: cb406b5aaabb
last_write_checksum: sha1:9e709b71dd0611056dc0cec6150b578defe32841
@@ -7830,8 +7830,8 @@ trackedFiles:
pristine_git_object: a3d84a96f4553a320f5eee5d63f6bc5c244ab446
src/openrouter/components/inputs_union.py:
id: 17d6239cb6a7
- last_write_checksum: sha1:a860c3512d4159191d30833c88d47a19110b9cc3
- pristine_git_object: 5b4249f3fa464b7a8a499789415ebaa533ce3775
+ last_write_checksum: sha1:45bcb56a8e40be9f8c3ed2a2cfd0531ec32e7038
+ pristine_git_object: 42515e2cfbebd2a731271164a6b7366e79302129
src/openrouter/components/inputtext.py:
id: a995ae96be99
last_write_checksum: sha1:2da9ff645acc96772701908830151c5a707ed021
@@ -8246,8 +8246,8 @@ trackedFiles:
pristine_git_object: 94af810bbdb87fb8c6800645354f7ec4dd067e7f
src/openrouter/components/outputitems.py:
id: 90f107de3116
- last_write_checksum: sha1:fac534b977b1ec4fc578d30158f6775be1ef338c
- pristine_git_object: 435d6ec832782df70a815222db371ebfb29998a4
+ last_write_checksum: sha1:b01b4032be1b5c74a52f0b4209319627ba5acb8c
+ pristine_git_object: 545d24fc3184380f311b61f8dc593421ef524335
src/openrouter/components/outputmcpservertoolitem.py:
id: bb8c2536a58e
last_write_checksum: sha1:28d33c9226ff4ce6871457fa1fae384b590f676c
@@ -8290,8 +8290,8 @@ trackedFiles:
pristine_git_object: 18a1f6df264fe768bd78d5c4b7c1c030ecec7b37
src/openrouter/components/outputsubagentservertoolitem.py:
id: 7480e835aa08
- last_write_checksum: sha1:c40f96bf2c5e27c2e6a4d91be46ce02461f6f2bf
- pristine_git_object: bec70ef526ee26ebdfe6681b7366cb62d081e9a6
+ last_write_checksum: sha1:27fe8898137bc806619dc444b588cde5a8a32c70
+ pristine_git_object: 3e4bba1425b99d114f19529ade4de6cf2e7c3f09
src/openrouter/components/outputtexteditorservertoolitem.py:
id: 2a5dc9318fe6
last_write_checksum: sha1:fc1bf715ac0084d7390eb75152f0f27994654fab
@@ -8762,12 +8762,12 @@ trackedFiles:
pristine_git_object: d34c619b85be547eaae9ae7f96fad370de5c0b43
src/openrouter/components/subagentservertool_openrouter.py:
id: f08524c6985a
- last_write_checksum: sha1:0b2445fa5606a93513afcfb9ac4f451603022e77
- pristine_git_object: 51cf1e2c1b8603e4933bca7f8ec389a010d4ad4f
+ last_write_checksum: sha1:c22642aafcdbd55723b853c4e864fd7747b9fad1
+ pristine_git_object: b801ffef738356454a532bd4258a916858615978
src/openrouter/components/subagentservertoolconfig.py:
id: a8425c790cb6
- last_write_checksum: sha1:f434a1ff30f069c379b1809edd62b0435998156a
- pristine_git_object: eb9f276769106934801d88ce9d2c5c5c67fe1bc2
+ last_write_checksum: sha1:7e0e286aa0bce491c000e3c8ff9e099fc57a8bdf
+ pristine_git_object: 54683b2862ba16d1d1b0540fef29342438d7c410
src/openrouter/components/submitgenerationfeedbackrequest.py:
id: ae68ea802a9c
last_write_checksum: sha1:3d0fb9415d218dfbe5b978791c95bc0f28abb131
@@ -11201,3 +11201,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.name` **Added**\n* `open_router.presets.create_presets_chat_completions()`: \n * `request.tools[].union(SubagentServerTool_OpenRouter).parameters.name` **Added**\n* `open_router.presets.create_presets_responses()`: \n * `request.input.union(Array<>)[]` **Changed**\n"
diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml
index 2ae28ff5..55e9c90f 100644
--- a/.speakeasy/gen.yaml
+++ b/.speakeasy/gen.yaml
@@ -36,7 +36,7 @@ generation:
documentation: mintlify
preApplyUnionDiscriminators: true
python:
- version: 1.0.2
+ version: 1.0.3
additionalDependencies:
dev: {}
main: {}
diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml
index dbed269c..2b626097 100644
--- a/.speakeasy/out.openapi.yaml
+++ b/.speakeasy/out.openapi.yaml
@@ -17912,9 +17912,17 @@ components:
type: 'string'
id:
type: 'string'
+ instance_name:
+ description: '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.'
+ example: 'openrouter_subagent__1'
+ type: 'string'
model:
description: 'Slug of the worker model that executed the task.'
type: 'string'
+ name:
+ description: 'Configured name of the subagent that executed the task (the `name` on its tool entry). Present only for named subagents; omitted for an unnamed (default) subagent.'
+ example: 'summarizer'
+ type: 'string'
outcome:
description: 'The worker model''s result (the outcome text returned to the delegating model).'
type: 'string'
@@ -21883,9 +21891,10 @@ components:
- 'type'
type: 'object'
SubagentServerToolConfig:
- description: 'Configuration for the openrouter:subagent server tool.'
+ description: 'Configuration for one openrouter:subagent server tool entry.'
example:
model: '~anthropic/claude-haiku-latest'
+ name: 'summarizer'
properties:
instructions:
description: 'System instructions for the subagent. When omitted, the subagent responds with no system prompt of its own.'
@@ -21905,6 +21914,13 @@ components:
description: '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.'
example: '~anthropic/claude-haiku-latest'
type: 'string'
+ name:
+ description: '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.'
+ example: 'summarizer'
+ maxLength: 64
+ minLength: 1
+ pattern: '^[a-zA-Z0-9 _-]+$'
+ type: 'string'
reasoning:
$ref: '#/components/schemas/SubagentReasoning'
temperature:
diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock
index 0e2c3caa..7e2548dd 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:90bc553557136c69e7601f536e471df2bd622ce48692f0f0211ed1349c46438e
- sourceBlobDigest: sha256:e43cdffbde0cda821063fbf0211aa73a9efe9a2ba8246783fea7fef0f6294e11
+ sourceRevisionDigest: sha256:3f4bdd779fdea2d6d51fdaa3675d6b4499461dcbef26e04b1e1c9b0fe17d521d
+ sourceBlobDigest: sha256:e1b02716f3b79f59a9649187d07bfaf4ef7e8b1aee164d3391ea67a788993fa7
tags:
- latest
- 1.0.0
@@ -11,10 +11,10 @@ targets:
open-router:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
- sourceRevisionDigest: sha256:90bc553557136c69e7601f536e471df2bd622ce48692f0f0211ed1349c46438e
- sourceBlobDigest: sha256:e43cdffbde0cda821063fbf0211aa73a9efe9a2ba8246783fea7fef0f6294e11
+ sourceRevisionDigest: sha256:3f4bdd779fdea2d6d51fdaa3675d6b4499461dcbef26e04b1e1c9b0fe17d521d
+ sourceBlobDigest: sha256:e1b02716f3b79f59a9649187d07bfaf4ef7e8b1aee164d3391ea67a788993fa7
codeSamplesNamespace: open-router-python-code-samples
- codeSamplesRevisionDigest: sha256:525f3adc33384a65334f916bbee8e617d8a57e9a2685e8c7a681269836e99bc1
+ codeSamplesRevisionDigest: sha256:d2ad35aae70010e2f82195aef860daa885a5b25ed9dc0dee8f96df0ae0d48fd3
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.787.0
diff --git a/RELEASES.md b/RELEASES.md
index 3cd25ef4..808568e7 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -599,4 +599,14 @@ Based on:
### Generated
- [python v1.0.2] .
### Releases
-- [PyPI v1.0.2] https://pypi.org/project/openrouter/1.0.2 - .
\ No newline at end of file
+- [PyPI v1.0.2] https://pypi.org/project/openrouter/1.0.2 - .
+
+## 2026-07-21 05:27:47
+### Changes
+Based on:
+- OpenAPI Doc
+- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy
+### Generated
+- [python v1.0.3] .
+### Releases
+- [PyPI v1.0.3] https://pypi.org/project/openrouter/1.0.3 - .
\ No newline at end of file
diff --git a/docs/components/outputsubagentservertoolitem.mdx b/docs/components/outputsubagentservertoolitem.mdx
index edc8261c..1b15fce1 100644
--- a/docs/components/outputsubagentservertoolitem.mdx
+++ b/docs/components/outputsubagentservertoolitem.mdx
@@ -7,13 +7,15 @@ An openrouter:subagent server tool output item
## Fields
-| Field | Type | Required | Description | Example |
-| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
-| `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 | |
-| `model` | *Optional[str]* | :heavy_minus_sign: | Slug of the worker model that executed the task. | |
-| `outcome` | *Optional[str]* | :heavy_minus_sign: | The worker model's result (the outcome text returned to the delegating model). | |
-| `status` | [components.ToolCallStatus](../components/toolcallstatus.mdx) | :heavy_check_mark: | N/A | completed |
-| `task_description` | *Optional[str]* | :heavy_minus_sign: | The task description the delegating model sent to the worker. | |
-| `task_name` | *Optional[str]* | :heavy_minus_sign: | The short task identifier the delegating model supplied. | |
-| `type` | [components.OutputSubagentServerToolItemType](../components/outputsubagentservertoolitemtype.mdx) | :heavy_check_mark: | N/A | |
\ No newline at end of file
+| Field | Type | Required | Description | Example |
+| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `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 |
+| `model` | *Optional[str]* | :heavy_minus_sign: | Slug of the worker model that executed the task. | |
+| `name` | *Optional[str]* | :heavy_minus_sign: | Configured name of the subagent that executed the task (the `name` on its tool entry). Present only for named subagents; omitted for an unnamed (default) subagent. | summarizer |
+| `outcome` | *Optional[str]* | :heavy_minus_sign: | The worker model's result (the outcome text returned to the delegating model). | |
+| `status` | [components.ToolCallStatus](../components/toolcallstatus.mdx) | :heavy_check_mark: | N/A | completed |
+| `task_description` | *Optional[str]* | :heavy_minus_sign: | The task description the delegating model sent to the worker. | |
+| `task_name` | *Optional[str]* | :heavy_minus_sign: | The short task identifier the delegating model supplied. | |
+| `type` | [components.OutputSubagentServerToolItemType](../components/outputsubagentservertoolitemtype.mdx) | :heavy_check_mark: | N/A | |
\ No newline at end of file
diff --git a/docs/components/subagentservertoolconfig.mdx b/docs/components/subagentservertoolconfig.mdx
index 3ce20c0c..3a8e769c 100644
--- a/docs/components/subagentservertoolconfig.mdx
+++ b/docs/components/subagentservertoolconfig.mdx
@@ -2,7 +2,7 @@
title: "SubagentServerToolConfig"
---
-Configuration for the openrouter:subagent server tool.
+Configuration for one openrouter:subagent server tool entry.
## Fields
@@ -13,6 +13,7 @@ Configuration for the openrouter:subagent server tool.
| `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
diff --git a/docs/components/subagentservertoolopenrouter.mdx b/docs/components/subagentservertoolopenrouter.mdx
index c50f5bf8..3b1eb0a6 100644
--- a/docs/components/subagentservertoolopenrouter.mdx
+++ b/docs/components/subagentservertoolopenrouter.mdx
@@ -9,5 +9,5 @@ OpenRouter built-in server tool: delegates self-contained tasks to a smaller, ch
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
-| `parameters` | [Optional[components.SubagentServerToolConfig]](../components/subagentservertoolconfig.mdx) | :heavy_minus_sign: | Configuration for the openrouter:subagent server tool. | \{
"model": "~anthropic/claude-haiku-latest"
} |
+| `parameters` | [Optional[components.SubagentServerToolConfig]](../components/subagentservertoolconfig.mdx) | :heavy_minus_sign: | Configuration for one openrouter:subagent server tool entry. | \{
"model": "~anthropic/claude-haiku-latest",
"name": "summarizer"
} |
| `type` | [components.SubagentServerToolOpenRouterType](../components/subagentservertoolopenroutertype.mdx) | :heavy_check_mark: | N/A | |
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index d5038fdd..0aceb631 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "openrouter"
-version = "1.0.2"
+version = "1.0.3"
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 0529b8a8..0eacd0cc 100644
--- a/src/openrouter/_version.py
+++ b/src/openrouter/_version.py
@@ -3,10 +3,10 @@
import importlib.metadata
__title__: str = "openrouter"
-__version__: str = "1.0.2"
+__version__: str = "1.0.3"
__openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.914.0"
-__user_agent__: str = "speakeasy-sdk/python 1.0.2 2.914.0 1.0.0 openrouter"
+__user_agent__: str = "speakeasy-sdk/python 1.0.3 2.914.0 1.0.0 openrouter"
try:
if __package__ is not None:
diff --git a/src/openrouter/components/inputs_union.py b/src/openrouter/components/inputs_union.py
index 5b4249f3..42515e2c 100644
--- a/src/openrouter/components/inputs_union.py
+++ b/src/openrouter/components/inputs_union.py
@@ -418,12 +418,12 @@ def serialize_model(self, handler):
OutputFilesServerToolItemTypedDict,
InputsReasoningTypedDict,
ReasoningItemTypedDict,
- OutputSubagentServerToolItemTypedDict,
OutputCodeInterpreterServerToolItemTypedDict,
OutputAdvisorServerToolItemTypedDict,
OutputWebFetchServerToolItemTypedDict,
OutputBashServerToolItemTypedDict,
OutputFusionServerToolItemTypedDict,
+ OutputSubagentServerToolItemTypedDict,
],
)
@@ -474,12 +474,12 @@ def serialize_model(self, handler):
OutputFilesServerToolItem,
InputsReasoning,
ReasoningItem,
- OutputSubagentServerToolItem,
OutputCodeInterpreterServerToolItem,
OutputAdvisorServerToolItem,
OutputWebFetchServerToolItem,
OutputBashServerToolItem,
OutputFusionServerToolItem,
+ OutputSubagentServerToolItem,
],
)
diff --git a/src/openrouter/components/outputitems.py b/src/openrouter/components/outputitems.py
index 435d6ec8..545d24fc 100644
--- a/src/openrouter/components/outputitems.py
+++ b/src/openrouter/components/outputitems.py
@@ -147,10 +147,10 @@
OutputCodeInterpreterServerToolItemTypedDict,
OutputReasoningItemTypedDict,
OutputAdvisorServerToolItemTypedDict,
- OutputSubagentServerToolItemTypedDict,
OutputFilesServerToolItemTypedDict,
OutputBashServerToolItemTypedDict,
OutputFusionServerToolItemTypedDict,
+ OutputSubagentServerToolItemTypedDict,
],
)
r"""An output item from the response"""
diff --git a/src/openrouter/components/outputsubagentservertoolitem.py b/src/openrouter/components/outputsubagentservertoolitem.py
index bec70ef5..3e4bba14 100644
--- a/src/openrouter/components/outputsubagentservertoolitem.py
+++ b/src/openrouter/components/outputsubagentservertoolitem.py
@@ -19,8 +19,12 @@ class OutputSubagentServerToolItemTypedDict(TypedDict):
error: NotRequired[str]
r"""Error message when the subagent task did not produce an outcome."""
id: NotRequired[str]
+ instance_name: NotRequired[str]
+ r"""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."""
model: NotRequired[str]
r"""Slug of the worker model that executed the task."""
+ name: NotRequired[str]
+ r"""Configured name of the subagent that executed the task (the `name` on its tool entry). Present only for named subagents; omitted for an unnamed (default) subagent."""
outcome: NotRequired[str]
r"""The worker model's result (the outcome text returned to the delegating model)."""
task_description: NotRequired[str]
@@ -41,9 +45,15 @@ class OutputSubagentServerToolItem(BaseModel):
id: Optional[str] = None
+ instance_name: Optional[str] = None
+ r"""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."""
+
model: Optional[str] = None
r"""Slug of the worker model that executed the task."""
+ name: Optional[str] = None
+ r"""Configured name of the subagent that executed the task (the `name` on its tool entry). Present only for named subagents; omitted for an unnamed (default) subagent."""
+
outcome: Optional[str] = None
r"""The worker model's result (the outcome text returned to the delegating model)."""
@@ -56,7 +66,16 @@ class OutputSubagentServerToolItem(BaseModel):
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(
- ["error", "id", "model", "outcome", "task_description", "task_name"]
+ [
+ "error",
+ "id",
+ "instance_name",
+ "model",
+ "name",
+ "outcome",
+ "task_description",
+ "task_name",
+ ]
)
serialized = handler(self)
m = {}
diff --git a/src/openrouter/components/subagentservertool_openrouter.py b/src/openrouter/components/subagentservertool_openrouter.py
index 51cf1e2c..b801ffef 100644
--- a/src/openrouter/components/subagentservertool_openrouter.py
+++ b/src/openrouter/components/subagentservertool_openrouter.py
@@ -19,7 +19,7 @@ class SubagentServerToolOpenRouterTypedDict(TypedDict):
type: SubagentServerToolOpenRouterType
parameters: NotRequired[SubagentServerToolConfigTypedDict]
- r"""Configuration for the openrouter:subagent server tool."""
+ r"""Configuration for one openrouter:subagent server tool entry."""
class SubagentServerToolOpenRouter(BaseModel):
@@ -28,7 +28,7 @@ class SubagentServerToolOpenRouter(BaseModel):
type: SubagentServerToolOpenRouterType
parameters: Optional[SubagentServerToolConfig] = None
- r"""Configuration for the openrouter:subagent server tool."""
+ r"""Configuration for one openrouter:subagent server tool entry."""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
diff --git a/src/openrouter/components/subagentservertoolconfig.py b/src/openrouter/components/subagentservertoolconfig.py
index eb9f2767..54683b28 100644
--- a/src/openrouter/components/subagentservertoolconfig.py
+++ b/src/openrouter/components/subagentservertoolconfig.py
@@ -10,7 +10,7 @@
class SubagentServerToolConfigTypedDict(TypedDict):
- r"""Configuration for the openrouter:subagent server tool."""
+ r"""Configuration for one openrouter:subagent server tool entry."""
instructions: NotRequired[str]
r"""System instructions for the subagent. When omitted, the subagent responds with no system prompt of its own."""
@@ -20,6 +20,8 @@ class SubagentServerToolConfigTypedDict(TypedDict):
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."""
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]
+ r"""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."""
reasoning: NotRequired[SubagentReasoningTypedDict]
r"""Reasoning configuration forwarded to the subagent call. Use this to control reasoning effort and token budget for models that support extended thinking."""
temperature: NotRequired[float]
@@ -29,7 +31,7 @@ class SubagentServerToolConfigTypedDict(TypedDict):
class SubagentServerToolConfig(BaseModel):
- r"""Configuration for the openrouter:subagent server tool."""
+ r"""Configuration for one openrouter:subagent server tool entry."""
instructions: Optional[str] = None
r"""System instructions for the subagent. When omitted, the subagent responds with no system prompt of its own."""
@@ -43,6 +45,9 @@ class SubagentServerToolConfig(BaseModel):
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."""
+ name: Optional[str] = None
+ r"""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."""
+
reasoning: Optional[SubagentReasoning] = None
r"""Reasoning configuration forwarded to the subagent call. Use this to control reasoning effort and token budget for models that support extended thinking."""
@@ -60,6 +65,7 @@ def serialize_model(self, handler):
"max_completion_tokens",
"max_tool_calls",
"model",
+ "name",
"reasoning",
"temperature",
"tools",
diff --git a/uv.lock b/uv.lock
index 53d13a54..e97bc55d 100644
--- a/uv.lock
+++ b/uv.lock
@@ -213,7 +213,7 @@ wheels = [
[[package]]
name = "openrouter"
-version = "1.0.2"
+version = "1.0.3"
source = { editable = "." }
dependencies = [
{ name = "httpcore" },