diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock
index ca49ecfe..5f181a91 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: 2e9c0843b3b5926d14c2ce981554c92a
+ docChecksum: 3f3470ebd639b0d6b50ab320a60f53a9
docVersion: 1.0.0
speakeasyVersion: 1.787.0
generationVersion: 2.914.0
- releaseVersion: 1.2.4
- configChecksum: dee5dc582d328e7e93faa0b4e5b7ae9a
+ releaseVersion: 1.2.5
+ configChecksum: 7f2e7e3856c603e5ce6ad060be13db9f
repoURL: https://github.com/OpenRouterTeam/python-sdk.git
installationURL: https://github.com/OpenRouterTeam/python-sdk.git
published: true
persistentEdits:
- generation_id: a3f5140d-7a24-4da8-a0de-9f5f5fb461f7
- pristine_commit_hash: 23b5246b75e0d0f16ff056132890afea299882f7
- pristine_tree_hash: 82f2522e790ca7b6c6c92ab41522c8ee45c0f23c
+ generation_id: e6bd2316-79aa-4e76-91ac-4c6df59413d7
+ pristine_commit_hash: 95795231f2423ea695b6d92c4412eadf3fcad08f
+ pristine_tree_hash: 41f6f8d6a6b9875e122c91c680eb59c9c7d9495c
features:
python:
acceptHeaders: 3.0.0
@@ -1905,6 +1905,10 @@ trackedFiles:
id: 4b5aa42babb9
last_write_checksum: sha1:85c65956be5b333b233ada31f980a73eb580f9b8
pristine_git_object: 36069a9639aef5294e8ef81b5e96d169b01e5b07
+ docs/components/deleteinternrequest.mdx:
+ id: e5c80eeb6e80
+ last_write_checksum: sha1:b3c0e009c71afeb39b31ef99b7f674feed4f8fde
+ pristine_git_object: 3b870d4dd3c1d960f986b62b1afb334828807bf1
docs/components/deleteinternresponse.mdx:
id: 80308aeb681f
last_write_checksum: sha1:b9f46d98fd3d91f0f1398bfbdd0d1dd2141ce4eb
@@ -2963,16 +2967,16 @@ trackedFiles:
pristine_git_object: 78a4f7f400f84c2e1f494530afa2066633443b9f
docs/components/internchatcompletionchunk.mdx:
id: 4f5dc2924625
- last_write_checksum: sha1:3f536b718ccf9e314e31f7aa5a0f5b25e4c740a2
- pristine_git_object: 8bc4eeb1907674c40964c00667264cdd9345ea21
+ last_write_checksum: sha1:0f4f38f8d2f6b648929a1a4899aa14dcc397aac8
+ pristine_git_object: 647b2b27bcb2772220838000da30d4adb8f0a1cd
docs/components/internchatcompletionchunkobject.mdx:
id: 3a1962ac4886
last_write_checksum: sha1:9602771c3a5fc48b22adf67daeaf1387bbdfb501
pristine_git_object: ae29bb6aa4cc5e60a75270c19790621c0bce4244
docs/components/internchatcompletionrequest.mdx:
id: 3ff4f362621e
- last_write_checksum: sha1:1eecd3cf0381cf17a1cb40ec5895faa5d57ef767
- pristine_git_object: 29a77fc594ef6c999309c657be96cc847b45f839
+ last_write_checksum: sha1:fc3b602f49cd7922a7b065dfe4d8c943e38bf9ed
+ pristine_git_object: ea77f21bcfbb6e188b0ab2ea56dd256f6f99d543
docs/components/internchatdelta.mdx:
id: 362ca71ada74
last_write_checksum: sha1:d69514763165871299a922f8f0dac1890283f4ab
@@ -6091,8 +6095,8 @@ trackedFiles:
pristine_git_object: 510bac097152bc64d1eccad4f2a498db9bd8a86c
docs/components/updateinternrequest.mdx:
id: fbc072e9b00d
- last_write_checksum: sha1:c888d986e5372b3f938c12f836d6c1bb47616020
- pristine_git_object: 49d486efd355e22cb1bf8954d6b520aebdf2241e
+ last_write_checksum: sha1:95ded2fa3df74187aa645553071ef0b3b825d9f6
+ pristine_git_object: cd20dcfbb7749d7b6b19e44fc2c5d2899718b01a
docs/components/updateobservabilitydestinationrequest.mdx:
id: b54091567003
last_write_checksum: sha1:d878d301eca619ed7a9820c612e2e2251feaef0a
@@ -6887,8 +6891,8 @@ trackedFiles:
pristine_git_object: fd39b2b5196d8737e978e97a8d47469940b33679
docs/operations/deleteinternrequest.mdx:
id: f8055480b92d
- last_write_checksum: sha1:61574e7bc4d9bd56398b383a8dc13dd5270343db
- pristine_git_object: b655daea6c01537c473922e0fb1ecc66f615d086
+ last_write_checksum: sha1:5d250a1e8ececb0ad27d1f1fb2a4804d8c836e51
+ pristine_git_object: 0ed033d7e9f477f6be0eec2505344ca29fa49179
docs/operations/deleteinternvaultsecretglobals.mdx:
id: 6bab12e48fb6
last_write_checksum: sha1:31611313c0d6ef1067af551a8433b2eee40dcdcd
@@ -8095,8 +8099,8 @@ trackedFiles:
pristine_git_object: 08c687694efbecf50406ae7929029d39fb121295
docs/sdks/interns/README.mdx:
id: 2f8a053ffe78
- last_write_checksum: sha1:761b9ca2d74d524a438c0c28d6b2a8eaf094d02f
- pristine_git_object: e1629ebefd58b9bc114f18c18ca4f789f9e28cf2
+ last_write_checksum: sha1:cd08ad1f1a3c790b2cc2cbdc51ba6ba7d7e80000
+ pristine_git_object: b4aaf9cfe9f4859b9c6b41d5bd6133846bc07092
docs/sdks/models/README.mdx:
id: 58f1ca464e0b
last_write_checksum: sha1:093dd30ebdd18b9763a6956915e0dcae4ae7d5e5
@@ -8159,8 +8163,8 @@ trackedFiles:
pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544
pyproject.toml:
id: 5d07e7d72637
- last_write_checksum: sha1:bdd9deb8a971c07d1b58f60aa9be49a272f4091a
- pristine_git_object: c4bbfb68c2dd7bfa194aa8882bf6dd98dfe00707
+ last_write_checksum: sha1:140a643bff5a9bd5da8b434162f752c62ef2d8ea
+ pristine_git_object: 18fe26f0d58a56819595fa9e6296bf8440564cdd
scripts/prepare_readme.py:
id: e0c5957a6035
last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54
@@ -8187,8 +8191,8 @@ trackedFiles:
pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137
src/openrouter/_version.py:
id: d8d15ad6c586
- last_write_checksum: sha1:204ec91710577183b0d13e5eb46fc40b65f894d7
- pristine_git_object: 260a571d032accb9831be6bd14d0556d7f74991e
+ last_write_checksum: sha1:b82f3c4515d029546aa3cc8bc92de92ca3cd588c
+ pristine_git_object: 7a2e6e0536d24d9405a9e06f3db0db5cb492ae15
src/openrouter/alpha.py:
id: 306c4d93308d
last_write_checksum: sha1:0c25a52ed5fb688ec1e923e4e82bcfc9cae49465
@@ -8231,8 +8235,8 @@ trackedFiles:
pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1
src/openrouter/components/__init__.py:
id: 81754e97b3f4
- last_write_checksum: sha1:4688e864f8d90268569ae28857855ab932974184
- pristine_git_object: 87f19fea2c07bf561e2f0c547ce439e545979c07
+ last_write_checksum: sha1:b15aafa75b2ffb302936401d2bf05fc68be4ab3e
+ pristine_git_object: 31ae0510c41c6b0e0194189ea0ed4b4f1c5f8d89
src/openrouter/components/aabenchmarkentry.py:
id: e2e0f0b48c82
last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c
@@ -9077,6 +9081,10 @@ trackedFiles:
id: c3ac908331ef
last_write_checksum: sha1:6a5ca367dfad148ce7f01d14044efbef37b36d2b
pristine_git_object: 0c4b2ec66b592fb5be3ac587a5c6d60c84069384
+ src/openrouter/components/deleteinternrequest.py:
+ id: cd214174bc54
+ last_write_checksum: sha1:7a3af9c749630d9b80bfbe652555d5b0b7a480c2
+ pristine_git_object: 8829804d4c1eee6d4a02d68f1ec7a9f01445c6c1
src/openrouter/components/deleteinternresponse.py:
id: ac5a1edfacb6
last_write_checksum: sha1:f00bb81495e80b7c1054160dbc698cbdbe331875
@@ -9519,12 +9527,12 @@ trackedFiles:
pristine_git_object: 54ccff74a20133907f201284b124727cba7e13cd
src/openrouter/components/internchatcompletionchunk.py:
id: 416076befae5
- last_write_checksum: sha1:c615056430a1fcac1be0658550d93dd5ae8d05b5
- pristine_git_object: b573c302f287e32d7e8af6b5a87fbe1b5f61b55b
+ last_write_checksum: sha1:37c104e427698983acda53fd08e4bb6bfb339622
+ pristine_git_object: d0a3ff2032dedcaef33a1e68315d66a9ce65a005
src/openrouter/components/internchatcompletionrequest.py:
id: a354f4a174e3
- last_write_checksum: sha1:4a6244e1da3a462a44c3a55f7a02b0c8dc415cf9
- pristine_git_object: 207fe963c62290acda5969275e6c844e4e6dd59c
+ last_write_checksum: sha1:4131ac13627ad4b9e4de0f70f335b96ff81a2fce
+ pristine_git_object: a16a69d706126a9a7b3926d3289a70c3c91866e0
src/openrouter/components/internchatdelta.py:
id: d5bd69629fe9
last_write_checksum: sha1:309b516f24413099d88cb232c9f12a95e1a01df0
@@ -10803,8 +10811,8 @@ trackedFiles:
pristine_git_object: df833960211cc7ed2a2a42fddbeafda0092e1c0c
src/openrouter/components/updateinternrequest.py:
id: 41df64f43394
- last_write_checksum: sha1:abfd6b26d1b0548a6d0a68bd508f215ac19e73ea
- pristine_git_object: ceef4fe4b1006b11ddb31a6363c10417c01ca3c1
+ last_write_checksum: sha1:7de95851732db214cd7488927551faaf9a41004d
+ pristine_git_object: 1b9db811b6931c267b00e5f12a8560be603c9da9
src/openrouter/components/updateobservabilitydestinationrequest.py:
id: d7a39fe04386
last_write_checksum: sha1:47d6d5c3b92103b9544a97475598b400afc6a6a7
@@ -11127,8 +11135,8 @@ trackedFiles:
pristine_git_object: 50643a126668498dd668c7cceb9f78c03d413d32
src/openrouter/interns.py:
id: d18df05c5c6d
- last_write_checksum: sha1:46da31cb08d788fef4b47deb9da667d2ac46d7aa
- pristine_git_object: d1dac0bfa081eb17a14a363f4c0c7d688b4b45c7
+ last_write_checksum: sha1:cf5c9ca74c5f31607eeb508bcb97078e8f0038be
+ pristine_git_object: 5272d44fdabfa2c5ab926de6c533875ff0571926
src/openrouter/models/__init__.py:
id: ed73b93abb3f
last_write_checksum: sha1:932a790ae66ccd7d7022b39c659bcf72a664ebea
@@ -11291,8 +11299,8 @@ trackedFiles:
pristine_git_object: a8c58e7fa8dd7e781d70c87ecc427f3fdff59ce9
src/openrouter/operations/deleteintern.py:
id: daeef9c6710e
- last_write_checksum: sha1:5847299fc02c61d74dbb79282817f7e310b25b3f
- pristine_git_object: a1e8d0c9b2f873282dccf4ea2a74a63dba3f4ba2
+ last_write_checksum: sha1:71c03cf5abbd6285a899a1ac7b56137892ec6dcb
+ pristine_git_object: 9595f01349b9f74cd3ac7475e907f28f7a3ba935
src/openrouter/operations/deleteinternvaultsecret.py:
id: ffac57160027
last_write_checksum: sha1:bc0d5957e085421f3a82cddc86d2bb6139a3d0f9
@@ -14838,6 +14846,8 @@ examples:
parameters:
path:
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7"
+ requestBody:
+ application/json: {"acknowledge_workspace_loss": true}
responses:
"202":
application/json: {"deleting": true}
@@ -14845,6 +14855,8 @@ examples:
application/json: {"error": {"code": "not_found", "message": "Intern not found"}}
"500":
application/json: {"error": {"code": "not_found", "message": "Intern not found"}}
+ "400":
+ application/json: {"error": {"code": "not_found", "message": "Intern not found"}}
getIntern:
speakeasy-default-get-intern:
parameters:
@@ -14941,3 +14953,4 @@ examples:
"502":
application/json: {"error": {"code": 409, "message": "That question is no longer waiting for an answer."}}
examplesVersion: 1.0.2
+releaseNotes: "## Python SDK Changes:\n* `open_router.interns.delete_intern()`: \n * `request.acknowledge_workspace_loss` **Added**\n * `error` **Changed**\n"
diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml
index 7caf4e62..6fa73af5 100644
--- a/.speakeasy/gen.yaml
+++ b/.speakeasy/gen.yaml
@@ -36,7 +36,7 @@ generation:
documentation: mintlify
preApplyUnionDiscriminators: true
python:
- version: 1.2.4
+ version: 1.2.5
additionalDependencies:
dev: {}
main: {}
diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml
index 1c4ca24f..094b1848 100644
--- a/.speakeasy/out.openapi.yaml
+++ b/.speakeasy/out.openapi.yaml
@@ -8600,6 +8600,17 @@ components:
required:
- 'deleted'
type: 'object'
+ DeleteInternRequest:
+ additionalProperties: false
+ description: 'Optional consent for a teardown that discards the workspace.'
+ example:
+ acknowledge_workspace_loss: true
+ properties:
+ acknowledge_workspace_loss:
+ default: false
+ description: 'Delete even though the workspace backup was not confirmed. Defaults to false, which refuses the teardown when a workspace archive is missing.'
+ type: 'boolean'
+ type: 'object'
DeleteInternResponse:
additionalProperties: false
properties:
@@ -12613,14 +12624,14 @@ components:
example: 'chatcmpl-f727571a-3bad-4e0d-8a9e-f18f8cda9750'
type: 'string'
model:
- description: 'The request `model` when given, or `openrouter/intern`. The final chunk may carry the model the intern reported for the run instead.'
+ description: 'The runtime''s identifier for the model the intern is running, as the intern reports it. Each chunk carries the model from the event behind it: `openrouter/intern` on chunks emitted before the intern has reported one and on chunks the API emits itself (timeout, run-ended and severed-stream errors and their final usage chunk), even after an earlier chunk named a model. It can change within a stream. It is not an OpenRouter model slug, and the request `model` is never used.'
type: 'string'
object:
enum:
- 'chat.completion.chunk'
type: 'string'
session_id:
- description: 'On the final chunk of every response, the daemon session to continue with, or `null` when the run failed before the intern reported one. Send it as `session_id` on the next request, including the `tool` reply to an interaction.'
+ description: 'On the final chunk of every response, the daemon session to continue with, or `null` when the run failed before the intern reported one. Send it as `session_id` on the next request, including the `tool` reply to an interaction. Session ids are client-visible and scoped to the intern''s own daemon.'
example: 'ses_7f3c9a'
type:
- 'string'
@@ -12652,20 +12663,20 @@ components:
minItems: 1
type: 'array'
model:
- description: 'Accepted for OpenAI compatibility and ignored. Streamed chunks report the model the intern actually used, or `openrouter/intern` when it did not report one.'
+ description: 'Accepted for OpenAI compatibility and never used. The intern runs the model configured on it (`PATCH` the intern to change it). Streamed chunks report the runtime''s identifier for that model as the intern reports it, or `openrouter/intern` on chunks whose event carries no model (before the intern reports one, and on the chunks the API emits itself: the timeout, run-ended and severed-stream error chunks, the stop chunk of a replay that ends without a terminal daemon event, and the final usage chunk after any of them). A usage chunk that follows a daemon completion event carries the model the intern reported.'
example: 'openrouter/intern'
maxLength: 256
minLength: 1
type: 'string'
session_id:
- description: 'The daemon session to continue, as returned in `session_id` on the final chunk of an earlier response. Omit it to start a new session. Required when the last message has role `tool`.'
+ description: 'The daemon session to continue, as returned in `session_id` on the final chunk of an earlier response. Omit it to start a new session. An id the intern has not seen before is not an error: it starts a new session under that id, so a mistyped id forks the conversation. Sessions are scoped to the intern''s own daemon. Required when the last message has role `tool`.'
example: 'ses_7f3c9a'
maxLength: 256
minLength: 1
type: 'string'
stream:
const: true
- description: 'Must be `true`. This endpoint only streams.'
+ description: 'Must be `true`. This endpoint only streams. `false` or an omitted `stream` is refused with `400` and reason `bad_request`.'
example: true
type: 'boolean'
required:
@@ -28003,8 +28014,10 @@ components:
- 'string'
- 'null'
model:
- description: 'New OpenRouter model slug. Null restores the workspace default.'
+ description: 'New OpenRouter model slug in `author/slug` form (an optional `:variant` suffix is accepted). Other shapes are refused with 400. Null restores the workspace default. Takes effect on the next provision: until then `GET` shows this configured model while chat chunks show the model the running intern reports.'
maxLength: 200
+ minLength: 1
+ pattern: '^[A-Za-z0-9~._:@+-]+\/[A-Za-z0-9~._:@+-]+$'
type:
- 'string'
- 'null'
@@ -36624,7 +36637,7 @@ paths:
- $ref: "#/components/parameters/AppCategories"
/interns/{internId}:
delete:
- description: 'Starts safe teardown of the intern, its runtime and its private vault. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.'
+ description: 'Starts safe teardown of the intern, its runtime and its private vault. The body is optional. Send `{"acknowledge_workspace_loss": true}` to delete a `destroy_failed` intern whose `last_failure_message` names `workspace_archive_failed`, accepting that its workspace is not backed up. The request body is capped at 1048576 bytes and a larger body is refused with 413. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.'
operationId: 'deleteIntern'
parameters:
- description: 'ID of an intern visible to the authenticated API key.'
@@ -36636,6 +36649,14 @@ paths:
example: '7c9e6679-7425-40de-944b-e07fc1f90ae7'
minLength: 1
type: 'string'
+ requestBody:
+ content:
+ application/json:
+ example:
+ acknowledge_workspace_loss: true
+ schema:
+ $ref: '#/components/schemas/DeleteInternRequest'
+ required: true
responses:
'202':
content:
@@ -36645,6 +36666,16 @@ paths:
schema:
$ref: '#/components/schemas/DeleteInternResponse'
description: 'The operation was accepted.'
+ '400':
+ content:
+ application/json:
+ example:
+ error:
+ code: 'invalid_body'
+ message: 'Invalid request body'
+ schema:
+ $ref: '#/components/schemas/InternLifecycleError'
+ description: 'The request body is invalid.'
'401':
content:
application/json:
@@ -36695,6 +36726,16 @@ paths:
schema:
$ref: '#/components/schemas/InternLifecycleError'
description: 'The intern is not in a state that allows this operation.'
+ '413':
+ content:
+ application/json:
+ example:
+ error:
+ code: 'payload_too_large'
+ message: 'Request body exceeds 1048576 bytes'
+ schema:
+ $ref: '#/components/schemas/InternLifecycleError'
+ description: 'The request body is larger than 1048576 bytes.'
'500':
content:
application/json:
diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock
index f0ccb836..31db30b7 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:5aecf9778d4418d1e4ada714aeb9cde37413fb57d6a0d2ce8487826098b70ff5
- sourceBlobDigest: sha256:1db55e3a18b6152e9b431a9fe60b01a1aa8d4b8ccd3622f8b61b14a5f3f3083e
+ sourceRevisionDigest: sha256:6c09ee03206f9286c389f9cf9296b4e34c381c3b383ae873253e4f38cb64f11d
+ sourceBlobDigest: sha256:05e64270223712bbf5b880b35cee94962efcc130ff9773f4332e5fc94f4512a0
tags:
- latest
- 1.0.0
@@ -11,10 +11,10 @@ targets:
open-router:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
- sourceRevisionDigest: sha256:5aecf9778d4418d1e4ada714aeb9cde37413fb57d6a0d2ce8487826098b70ff5
- sourceBlobDigest: sha256:1db55e3a18b6152e9b431a9fe60b01a1aa8d4b8ccd3622f8b61b14a5f3f3083e
+ sourceRevisionDigest: sha256:6c09ee03206f9286c389f9cf9296b4e34c381c3b383ae873253e4f38cb64f11d
+ sourceBlobDigest: sha256:05e64270223712bbf5b880b35cee94962efcc130ff9773f4332e5fc94f4512a0
codeSamplesNamespace: open-router-python-code-samples
- codeSamplesRevisionDigest: sha256:9a590a03a47caa543ee1f3952dc95f3fccbce0cdb6cf407b31a66754f96a0cd5
+ codeSamplesRevisionDigest: sha256:5f47abce5f532756d300ba4aa6fb317d628f6f66011cd233e89a9a24c6b4be2a
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.787.0
diff --git a/RELEASES.md b/RELEASES.md
index 825a98b5..b96dbf08 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -2449,4 +2449,14 @@ Based on:
### Generated
- [python v1.2.4] .
### Releases
-- [PyPI v1.2.4] https://pypi.org/project/openrouter/1.2.4 - .
\ No newline at end of file
+- [PyPI v1.2.4] https://pypi.org/project/openrouter/1.2.4 - .
+
+## 2026-09-19 19:16:27
+### Changes
+Based on:
+- OpenAPI Doc
+- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy
+### Generated
+- [python v1.2.5] .
+### Releases
+- [PyPI v1.2.5] https://pypi.org/project/openrouter/1.2.5 - .
\ No newline at end of file
diff --git a/docs/components/deleteinternrequest.mdx b/docs/components/deleteinternrequest.mdx
new file mode 100644
index 00000000..3b870d4d
--- /dev/null
+++ b/docs/components/deleteinternrequest.mdx
@@ -0,0 +1,12 @@
+---
+title: "DeleteInternRequest"
+---
+
+Optional consent for a teardown that discards the workspace.
+
+
+## Fields
+
+| Field | Type | Required | Description |
+| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
+| `acknowledge_workspace_loss` | *Optional[bool]* | :heavy_minus_sign: | Delete even though the workspace backup was not confirmed. Defaults to false, which refuses the teardown when a workspace archive is missing. |
\ No newline at end of file
diff --git a/docs/components/internchatcompletionchunk.mdx b/docs/components/internchatcompletionchunk.mdx
index 8bc4eeb1..647b2b27 100644
--- a/docs/components/internchatcompletionchunk.mdx
+++ b/docs/components/internchatcompletionchunk.mdx
@@ -13,7 +13,7 @@ One `data:` line of the stream. A run streams a role chunk, content and reasonin
| `created` | *int* | :heavy_check_mark: | N/A | |
| `error` | [Optional[components.InternChatStreamError]](../components/internchatstreamerror.mdx) | :heavy_minus_sign: | A failure after the response headers were sent. The chunk that carries it has `finish_reason: "error"`, then the final empty-`choices` chunk and `[DONE]` follow. Reasons here are `attachment_failed`, `busy`, `client_closed_request`, `interaction_not_pending`, `interaction_unknown`, `intern_unreachable`, `run_ended`, `stream_severed`, `timeout` or `turn_failed`. `run_ended` reports an ending the intern confirmed, such as a cancellation or a deadline, while `stream_severed` reports a connection lost without that confirmation. | \{
"code": 502,
"message": "The intern could not continue this run.",
"metadata": \{
"reason": "attachment_failed"
}
} |
| `id` | *str* | :heavy_check_mark: | The completion id, constant for the whole response. | chatcmpl-f727571a-3bad-4e0d-8a9e-f18f8cda9750 |
-| `model` | *str* | :heavy_check_mark: | The request `model` when given, or `openrouter/intern`. The final chunk may carry the model the intern reported for the run instead. | |
+| `model` | *str* | :heavy_check_mark: | The runtime's identifier for the model the intern is running, as the intern reports it. Each chunk carries the model from the event behind it: `openrouter/intern` on chunks emitted before the intern has reported one and on chunks the API emits itself (timeout, run-ended and severed-stream errors and their final usage chunk), even after an earlier chunk named a model. It can change within a stream. It is not an OpenRouter model slug, and the request `model` is never used. | |
| `object` | [components.InternChatCompletionChunkObject](../components/internchatcompletionchunkobject.mdx) | :heavy_check_mark: | N/A | |
-| `session_id` | *OptionalNullable[str]* | :heavy_minus_sign: | On the final chunk of every response, the daemon session to continue with, or `null` when the run failed before the intern reported one. Send it as `session_id` on the next request, including the `tool` reply to an interaction. | ses_7f3c9a |
+| `session_id` | *OptionalNullable[str]* | :heavy_minus_sign: | On the final chunk of every response, the daemon session to continue with, or `null` when the run failed before the intern reported one. Send it as `session_id` on the next request, including the `tool` reply to an interaction. Session ids are client-visible and scoped to the intern's own daemon. | ses_7f3c9a |
| `usage` | [OptionalNullable[components.InternChatUsage]](../components/internchatusage.mdx) | :heavy_minus_sign: | Token usage for the run as the daemon reported it, on the final chunk before `[DONE]`. `null` when the daemon reported none, and always `null` after `tool_calls` because the turn is not over. | \{
"completion_tokens": 12,
"prompt_tokens": 40,
"total_tokens": 52
} |
\ No newline at end of file
diff --git a/docs/components/internchatcompletionrequest.mdx b/docs/components/internchatcompletionrequest.mdx
index 29a77fc5..ea77f21b 100644
--- a/docs/components/internchatcompletionrequest.mdx
+++ b/docs/components/internchatcompletionrequest.mdx
@@ -7,10 +7,10 @@ An OpenAI-compatible streaming chat completion request for one intern. Other Ope
## Fields
-| Field | Type | Required | Description | Example |
-| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `approval_mode` | [Optional[components.InternApprovalMode]](../components/internapprovalmode.mdx) | :heavy_minus_sign: | How the run started by this prompt handles tool approvals. `self-drive` (the default when omitted) consents on your behalf and runs the shell unsandboxed. `manual` asks you before an approval-bearing tool runs, as an `openrouter.provide_input` permission request, and keeps the shell sandboxed until an escalation is allowed. The mode applies to the run this prompt starts and is not remembered by the session. Repeat it on each new prompt that should use it. A `tool` reply continues the run under the mode it started with. | manual |
-| `messages` | List[[components.InternChatMessage](../components/internchatmessage.mdx)] | :heavy_check_mark: | The conversation. Only the last message is read. A last `user` message starts a run. A last `tool` message answers the interaction named by its `tool_call_id` and requires `session_id`. | |
-| `model` | *Optional[str]* | :heavy_minus_sign: | Accepted for OpenAI compatibility and ignored. Streamed chunks report the model the intern actually used, or `openrouter/intern` when it did not report one. | openrouter/intern |
-| `session_id` | *Optional[str]* | :heavy_minus_sign: | The daemon session to continue, as returned in `session_id` on the final chunk of an earlier response. Omit it to start a new session. Required when the last message has role `tool`. | ses_7f3c9a |
-| `stream` | *Literal[True]* | :heavy_check_mark: | Must be `true`. This endpoint only streams. | true |
\ No newline at end of file
+| Field | Type | Required | Description | Example |
+| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `approval_mode` | [Optional[components.InternApprovalMode]](../components/internapprovalmode.mdx) | :heavy_minus_sign: | How the run started by this prompt handles tool approvals. `self-drive` (the default when omitted) consents on your behalf and runs the shell unsandboxed. `manual` asks you before an approval-bearing tool runs, as an `openrouter.provide_input` permission request, and keeps the shell sandboxed until an escalation is allowed. The mode applies to the run this prompt starts and is not remembered by the session. Repeat it on each new prompt that should use it. A `tool` reply continues the run under the mode it started with. | manual |
+| `messages` | List[[components.InternChatMessage](../components/internchatmessage.mdx)] | :heavy_check_mark: | The conversation. Only the last message is read. A last `user` message starts a run. A last `tool` message answers the interaction named by its `tool_call_id` and requires `session_id`. | |
+| `model` | *Optional[str]* | :heavy_minus_sign: | Accepted for OpenAI compatibility and never used. The intern runs the model configured on it (`PATCH` the intern to change it). Streamed chunks report the runtime's identifier for that model as the intern reports it, or `openrouter/intern` on chunks whose event carries no model (before the intern reports one, and on the chunks the API emits itself: the timeout, run-ended and severed-stream error chunks, the stop chunk of a replay that ends without a terminal daemon event, and the final usage chunk after any of them). A usage chunk that follows a daemon completion event carries the model the intern reported. | openrouter/intern |
+| `session_id` | *Optional[str]* | :heavy_minus_sign: | The daemon session to continue, as returned in `session_id` on the final chunk of an earlier response. Omit it to start a new session. An id the intern has not seen before is not an error: it starts a new session under that id, so a mistyped id forks the conversation. Sessions are scoped to the intern's own daemon. Required when the last message has role `tool`. | ses_7f3c9a |
+| `stream` | *Literal[True]* | :heavy_check_mark: | Must be `true`. This endpoint only streams. `false` or an omitted `stream` is refused with `400` and reason `bad_request`. | true |
\ No newline at end of file
diff --git a/docs/components/updateinternrequest.mdx b/docs/components/updateinternrequest.mdx
index 49d486ef..cd20dcfb 100644
--- a/docs/components/updateinternrequest.mdx
+++ b/docs/components/updateinternrequest.mdx
@@ -7,9 +7,9 @@ Lifecycle settings to change. Omitted fields stay unchanged and null clears a fi
## Fields
-| Field | Type | Required | Description |
-| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
-| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | New free-form description. Null clears it. |
-| `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | New standing instructions. Null clears them. |
-| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | New OpenRouter model slug. Null restores the workspace default. |
-| `name` | *Optional[str]* | :heavy_minus_sign: | New intern name, unique per creator within the workspace. |
\ No newline at end of file
+| Field | Type | Required | Description |
+| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | New free-form description. Null clears it. |
+| `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | New standing instructions. Null clears them. |
+| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | New OpenRouter model slug in `author/slug` form (an optional `:variant` suffix is accepted). Other shapes are refused with 400. Null restores the workspace default. Takes effect on the next provision: until then `GET` shows this configured model while chat chunks show the model the running intern reports. |
+| `name` | *Optional[str]* | :heavy_minus_sign: | New intern name, unique per creator within the workspace. |
\ No newline at end of file
diff --git a/docs/operations/deleteinternrequest.mdx b/docs/operations/deleteinternrequest.mdx
index b655daea..0ed033d7 100644
--- a/docs/operations/deleteinternrequest.mdx
+++ b/docs/operations/deleteinternrequest.mdx
@@ -9,4 +9,5 @@ title: "DeleteInternRequest"
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| |
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| |
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| |
-| `intern_id` | *str* | :heavy_check_mark: | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 |
\ No newline at end of file
+| `intern_id` | *str* | :heavy_check_mark: | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 |
+| `delete_intern_request` | [components.DeleteInternRequest](../components/deleteinternrequest.mdx) | :heavy_check_mark: | N/A | \{
"acknowledge_workspace_loss": true
} |
\ No newline at end of file
diff --git a/docs/sdks/interns/README.mdx b/docs/sdks/interns/README.mdx
index e1629ebe..b4aaf9cf 100644
--- a/docs/sdks/interns/README.mdx
+++ b/docs/sdks/interns/README.mdx
@@ -122,7 +122,7 @@ with OpenRouter(
## delete_intern
-Starts safe teardown of the intern, its runtime and its private vault. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
+Starts safe teardown of the intern, its runtime and its private vault. The body is optional. Send `{"acknowledge_workspace_loss": true}` to delete a `destroy_failed` intern whose `last_failure_message` names `workspace_archive_failed`, accepting that its workspace is not backed up. The request body is capped at 1048576 bytes and a larger body is refused with 413. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
### Example Usage
@@ -138,7 +138,7 @@ with OpenRouter(
api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router:
- res = open_router.interns.delete_intern(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7")
+ res = open_router.interns.delete_intern(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", acknowledge_workspace_loss=True)
# Handle response
print(res)
@@ -153,6 +153,7 @@ with OpenRouter(
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| |
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| |
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| |
+| `acknowledge_workspace_loss` | *Optional[bool]* | :heavy_minus_sign: | Delete even though the workspace backup was not confirmed. Defaults to false, which refuses the teardown when a workspace archive is missing. | |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
### Response
@@ -161,11 +162,11 @@ with OpenRouter(
### Errors
-| Error Type | Status Code | Content Type |
-| ----------------------------- | ----------------------------- | ----------------------------- |
-| errors.InternLifecycleError | 401, 403, 404, 408, 409 | application/json |
-| errors.InternLifecycleError | 500, 502 | application/json |
-| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
+| Error Type | Status Code | Content Type |
+| --------------------------------- | --------------------------------- | --------------------------------- |
+| errors.InternLifecycleError | 400, 401, 403, 404, 408, 409, 413 | application/json |
+| errors.InternLifecycleError | 500, 502 | application/json |
+| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
## get_intern
@@ -241,17 +242,17 @@ with OpenRouter(
### Parameters
-| Parameter | Type | Required | Description | Example |
-| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `intern_id` | *str* | :heavy_check_mark: | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 |
-| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| |
-| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| |
-| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| |
-| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | New free-form description. Null clears it. | |
-| `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | New standing instructions. Null clears them. | |
-| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | New OpenRouter model slug. Null restores the workspace default. | |
-| `name` | *Optional[str]* | :heavy_minus_sign: | New intern name, unique per creator within the workspace. | |
-| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
+| Parameter | Type | Required | Description | Example |
+| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| `intern_id` | *str* | :heavy_check_mark: | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 |
+| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| |
+| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| |
+| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| |
+| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | New free-form description. Null clears it. | |
+| `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | New standing instructions. Null clears them. | |
+| `model` | *OptionalNullable[str]* | :heavy_minus_sign: | New OpenRouter model slug in `author/slug` form (an optional `:variant` suffix is accepted). Other shapes are refused with 400. Null restores the workspace default. Takes effect on the next provision: until then `GET` shows this configured model while chat chunks show the model the running intern reports. | |
+| `name` | *Optional[str]* | :heavy_minus_sign: | New intern name, unique per creator within the workspace. | |
+| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
### Response
@@ -405,17 +406,17 @@ with OpenRouter(
### Parameters
-| Parameter | Type | Required | Description | Example |
-| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `intern_id` | *str* | :heavy_check_mark: | The intern to talk to. | a11e0000-0000-4000-8000-000000000005 |
-| `messages` | List[[components.InternChatMessage](../../components/internchatmessage.mdx)] | :heavy_check_mark: | The conversation. Only the last message is read. A last `user` message starts a run. A last `tool` message answers the interaction named by its `tool_call_id` and requires `session_id`. | |
-| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| |
-| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| |
-| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| |
-| `approval_mode` | [Optional[components.InternApprovalMode]](../../components/internapprovalmode.mdx) | :heavy_minus_sign: | How the run started by this prompt handles tool approvals. `self-drive` (the default when omitted) consents on your behalf and runs the shell unsandboxed. `manual` asks you before an approval-bearing tool runs, as an `openrouter.provide_input` permission request, and keeps the shell sandboxed until an escalation is allowed. The mode applies to the run this prompt starts and is not remembered by the session. Repeat it on each new prompt that should use it. A `tool` reply continues the run under the mode it started with. | manual |
-| `model` | *Optional[str]* | :heavy_minus_sign: | Accepted for OpenAI compatibility and ignored. Streamed chunks report the model the intern actually used, or `openrouter/intern` when it did not report one. | openrouter/intern |
-| `session_id` | *Optional[str]* | :heavy_minus_sign: | The daemon session to continue, as returned in `session_id` on the final chunk of an earlier response. Omit it to start a new session. Required when the last message has role `tool`. | ses_7f3c9a |
-| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
+| Parameter | Type | Required | Description | Example |
+| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `intern_id` | *str* | :heavy_check_mark: | The intern to talk to. | a11e0000-0000-4000-8000-000000000005 |
+| `messages` | List[[components.InternChatMessage](../../components/internchatmessage.mdx)] | :heavy_check_mark: | The conversation. Only the last message is read. A last `user` message starts a run. A last `tool` message answers the interaction named by its `tool_call_id` and requires `session_id`. | |
+| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| |
+| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| |
+| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| |
+| `approval_mode` | [Optional[components.InternApprovalMode]](../../components/internapprovalmode.mdx) | :heavy_minus_sign: | How the run started by this prompt handles tool approvals. `self-drive` (the default when omitted) consents on your behalf and runs the shell unsandboxed. `manual` asks you before an approval-bearing tool runs, as an `openrouter.provide_input` permission request, and keeps the shell sandboxed until an escalation is allowed. The mode applies to the run this prompt starts and is not remembered by the session. Repeat it on each new prompt that should use it. A `tool` reply continues the run under the mode it started with. | manual |
+| `model` | *Optional[str]* | :heavy_minus_sign: | Accepted for OpenAI compatibility and never used. The intern runs the model configured on it (`PATCH` the intern to change it). Streamed chunks report the runtime's identifier for that model as the intern reports it, or `openrouter/intern` on chunks whose event carries no model (before the intern reports one, and on the chunks the API emits itself: the timeout, run-ended and severed-stream error chunks, the stop chunk of a replay that ends without a terminal daemon event, and the final usage chunk after any of them). A usage chunk that follows a daemon completion event carries the model the intern reported. | openrouter/intern |
+| `session_id` | *Optional[str]* | :heavy_minus_sign: | The daemon session to continue, as returned in `session_id` on the final chunk of an earlier response. Omit it to start a new session. An id the intern has not seen before is not an error: it starts a new session under that id, so a mistyped id forks the conversation. Sessions are scoped to the intern's own daemon. Required when the last message has role `tool`. | ses_7f3c9a |
+| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
### Response
diff --git a/pyproject.toml b/pyproject.toml
index c4bbfb68..18fe26f0 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "openrouter"
-version = "1.2.4"
+version = "1.2.5"
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 260a571d..7a2e6e05 100644
--- a/src/openrouter/_version.py
+++ b/src/openrouter/_version.py
@@ -3,10 +3,10 @@
import importlib.metadata
__title__: str = "openrouter"
-__version__: str = "1.2.4"
+__version__: str = "1.2.5"
__openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.914.0"
-__user_agent__: str = "speakeasy-sdk/python 1.2.4 2.914.0 1.0.0 openrouter"
+__user_agent__: str = "speakeasy-sdk/python 1.2.5 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 87f19fea..31ae0510 100644
--- a/src/openrouter/components/__init__.py
+++ b/src/openrouter/components/__init__.py
@@ -1057,6 +1057,7 @@
DeleteGuardrailResponse,
DeleteGuardrailResponseTypedDict,
)
+ from .deleteinternrequest import DeleteInternRequest, DeleteInternRequestTypedDict
from .deleteinternresponse import (
DeleteInternResponse,
DeleteInternResponseTypedDict,
@@ -4223,6 +4224,8 @@
"DeleteBYOKKeyResponseTypedDict",
"DeleteGuardrailResponse",
"DeleteGuardrailResponseTypedDict",
+ "DeleteInternRequest",
+ "DeleteInternRequestTypedDict",
"DeleteInternResponse",
"DeleteInternResponseTypedDict",
"DeleteObservabilityDestinationResponse",
@@ -6751,6 +6754,8 @@
"DeleteBYOKKeyResponseTypedDict": ".deletebyokkeyresponse",
"DeleteGuardrailResponse": ".deleteguardrailresponse",
"DeleteGuardrailResponseTypedDict": ".deleteguardrailresponse",
+ "DeleteInternRequest": ".deleteinternrequest",
+ "DeleteInternRequestTypedDict": ".deleteinternrequest",
"DeleteInternResponse": ".deleteinternresponse",
"DeleteInternResponseTypedDict": ".deleteinternresponse",
"DeleteObservabilityDestinationResponse": ".deleteobservabilitydestinationresponse",
diff --git a/src/openrouter/components/deleteinternrequest.py b/src/openrouter/components/deleteinternrequest.py
new file mode 100644
index 00000000..8829804d
--- /dev/null
+++ b/src/openrouter/components/deleteinternrequest.py
@@ -0,0 +1,37 @@
+"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
+
+from __future__ import annotations
+from openrouter.types import BaseModel, UNSET_SENTINEL
+from pydantic import model_serializer
+from typing import Optional
+from typing_extensions import NotRequired, TypedDict
+
+
+class DeleteInternRequestTypedDict(TypedDict):
+ r"""Optional consent for a teardown that discards the workspace."""
+
+ acknowledge_workspace_loss: NotRequired[bool]
+ r"""Delete even though the workspace backup was not confirmed. Defaults to false, which refuses the teardown when a workspace archive is missing."""
+
+
+class DeleteInternRequest(BaseModel):
+ r"""Optional consent for a teardown that discards the workspace."""
+
+ acknowledge_workspace_loss: Optional[bool] = False
+ r"""Delete even though the workspace backup was not confirmed. Defaults to false, which refuses the teardown when a workspace archive is missing."""
+
+ @model_serializer(mode="wrap")
+ def serialize_model(self, handler):
+ optional_fields = set(["acknowledge_workspace_loss"])
+ serialized = handler(self)
+ m = {}
+
+ for n, f in type(self).model_fields.items():
+ k = f.alias or n
+ val = serialized.get(k, serialized.get(n))
+
+ if val != UNSET_SENTINEL:
+ if val is not None or k not in optional_fields:
+ m[k] = val
+
+ return m
diff --git a/src/openrouter/components/internchatcompletionchunk.py b/src/openrouter/components/internchatcompletionchunk.py
index b573c302..d0a3ff20 100644
--- a/src/openrouter/components/internchatcompletionchunk.py
+++ b/src/openrouter/components/internchatcompletionchunk.py
@@ -28,12 +28,12 @@ class InternChatCompletionChunkTypedDict(TypedDict):
id: str
r"""The completion id, constant for the whole response."""
model: str
- r"""The request `model` when given, or `openrouter/intern`. The final chunk may carry the model the intern reported for the run instead."""
+ r"""The runtime's identifier for the model the intern is running, as the intern reports it. Each chunk carries the model from the event behind it: `openrouter/intern` on chunks emitted before the intern has reported one and on chunks the API emits itself (timeout, run-ended and severed-stream errors and their final usage chunk), even after an earlier chunk named a model. It can change within a stream. It is not an OpenRouter model slug, and the request `model` is never used."""
object: InternChatCompletionChunkObject
error: NotRequired[InternChatStreamErrorTypedDict]
r"""A failure after the response headers were sent. The chunk that carries it has `finish_reason: \"error\"`, then the final empty-`choices` chunk and `[DONE]` follow. Reasons here are `attachment_failed`, `busy`, `client_closed_request`, `interaction_not_pending`, `interaction_unknown`, `intern_unreachable`, `run_ended`, `stream_severed`, `timeout` or `turn_failed`. `run_ended` reports an ending the intern confirmed, such as a cancellation or a deadline, while `stream_severed` reports a connection lost without that confirmation."""
session_id: NotRequired[Nullable[str]]
- r"""On the final chunk of every response, the daemon session to continue with, or `null` when the run failed before the intern reported one. Send it as `session_id` on the next request, including the `tool` reply to an interaction."""
+ r"""On the final chunk of every response, the daemon session to continue with, or `null` when the run failed before the intern reported one. Send it as `session_id` on the next request, including the `tool` reply to an interaction. Session ids are client-visible and scoped to the intern's own daemon."""
usage: NotRequired[Nullable[InternChatUsageTypedDict]]
r"""Token usage for the run as the daemon reported it, on the final chunk before `[DONE]`. `null` when the daemon reported none, and always `null` after `tool_calls` because the turn is not over."""
@@ -50,7 +50,7 @@ class InternChatCompletionChunk(BaseModel):
r"""The completion id, constant for the whole response."""
model: str
- r"""The request `model` when given, or `openrouter/intern`. The final chunk may carry the model the intern reported for the run instead."""
+ r"""The runtime's identifier for the model the intern is running, as the intern reports it. Each chunk carries the model from the event behind it: `openrouter/intern` on chunks emitted before the intern has reported one and on chunks the API emits itself (timeout, run-ended and severed-stream errors and their final usage chunk), even after an earlier chunk named a model. It can change within a stream. It is not an OpenRouter model slug, and the request `model` is never used."""
object: InternChatCompletionChunkObject
@@ -58,7 +58,7 @@ class InternChatCompletionChunk(BaseModel):
r"""A failure after the response headers were sent. The chunk that carries it has `finish_reason: \"error\"`, then the final empty-`choices` chunk and `[DONE]` follow. Reasons here are `attachment_failed`, `busy`, `client_closed_request`, `interaction_not_pending`, `interaction_unknown`, `intern_unreachable`, `run_ended`, `stream_severed`, `timeout` or `turn_failed`. `run_ended` reports an ending the intern confirmed, such as a cancellation or a deadline, while `stream_severed` reports a connection lost without that confirmation."""
session_id: OptionalNullable[str] = UNSET
- r"""On the final chunk of every response, the daemon session to continue with, or `null` when the run failed before the intern reported one. Send it as `session_id` on the next request, including the `tool` reply to an interaction."""
+ r"""On the final chunk of every response, the daemon session to continue with, or `null` when the run failed before the intern reported one. Send it as `session_id` on the next request, including the `tool` reply to an interaction. Session ids are client-visible and scoped to the intern's own daemon."""
usage: OptionalNullable[InternChatUsage] = UNSET
r"""Token usage for the run as the daemon reported it, on the final chunk before `[DONE]`. `null` when the daemon reported none, and always `null` after `tool_calls` because the turn is not over."""
diff --git a/src/openrouter/components/internchatcompletionrequest.py b/src/openrouter/components/internchatcompletionrequest.py
index 207fe963..a16a69d7 100644
--- a/src/openrouter/components/internchatcompletionrequest.py
+++ b/src/openrouter/components/internchatcompletionrequest.py
@@ -20,11 +20,11 @@ class InternChatCompletionRequestTypedDict(TypedDict):
approval_mode: NotRequired[InternApprovalMode]
r"""How the run started by this prompt handles tool approvals. `self-drive` (the default when omitted) consents on your behalf and runs the shell unsandboxed. `manual` asks you before an approval-bearing tool runs, as an `openrouter.provide_input` permission request, and keeps the shell sandboxed until an escalation is allowed. The mode applies to the run this prompt starts and is not remembered by the session. Repeat it on each new prompt that should use it. A `tool` reply continues the run under the mode it started with."""
model: NotRequired[str]
- r"""Accepted for OpenAI compatibility and ignored. Streamed chunks report the model the intern actually used, or `openrouter/intern` when it did not report one."""
+ r"""Accepted for OpenAI compatibility and never used. The intern runs the model configured on it (`PATCH` the intern to change it). Streamed chunks report the runtime's identifier for that model as the intern reports it, or `openrouter/intern` on chunks whose event carries no model (before the intern reports one, and on the chunks the API emits itself: the timeout, run-ended and severed-stream error chunks, the stop chunk of a replay that ends without a terminal daemon event, and the final usage chunk after any of them). A usage chunk that follows a daemon completion event carries the model the intern reported."""
session_id: NotRequired[str]
- r"""The daemon session to continue, as returned in `session_id` on the final chunk of an earlier response. Omit it to start a new session. Required when the last message has role `tool`."""
+ r"""The daemon session to continue, as returned in `session_id` on the final chunk of an earlier response. Omit it to start a new session. An id the intern has not seen before is not an error: it starts a new session under that id, so a mistyped id forks the conversation. Sessions are scoped to the intern's own daemon. Required when the last message has role `tool`."""
stream: Literal[True]
- r"""Must be `true`. This endpoint only streams."""
+ r"""Must be `true`. This endpoint only streams. `false` or an omitted `stream` is refused with `400` and reason `bad_request`."""
class InternChatCompletionRequest(BaseModel):
@@ -37,16 +37,16 @@ class InternChatCompletionRequest(BaseModel):
r"""How the run started by this prompt handles tool approvals. `self-drive` (the default when omitted) consents on your behalf and runs the shell unsandboxed. `manual` asks you before an approval-bearing tool runs, as an `openrouter.provide_input` permission request, and keeps the shell sandboxed until an escalation is allowed. The mode applies to the run this prompt starts and is not remembered by the session. Repeat it on each new prompt that should use it. A `tool` reply continues the run under the mode it started with."""
model: Optional[str] = None
- r"""Accepted for OpenAI compatibility and ignored. Streamed chunks report the model the intern actually used, or `openrouter/intern` when it did not report one."""
+ r"""Accepted for OpenAI compatibility and never used. The intern runs the model configured on it (`PATCH` the intern to change it). Streamed chunks report the runtime's identifier for that model as the intern reports it, or `openrouter/intern` on chunks whose event carries no model (before the intern reports one, and on the chunks the API emits itself: the timeout, run-ended and severed-stream error chunks, the stop chunk of a replay that ends without a terminal daemon event, and the final usage chunk after any of them). A usage chunk that follows a daemon completion event carries the model the intern reported."""
session_id: Optional[str] = None
- r"""The daemon session to continue, as returned in `session_id` on the final chunk of an earlier response. Omit it to start a new session. Required when the last message has role `tool`."""
+ r"""The daemon session to continue, as returned in `session_id` on the final chunk of an earlier response. Omit it to start a new session. An id the intern has not seen before is not an error: it starts a new session under that id, so a mistyped id forks the conversation. Sessions are scoped to the intern's own daemon. Required when the last message has role `tool`."""
STREAM: Annotated[
Annotated[Literal[True], AfterValidator(validate_const(True))],
pydantic.Field(alias="stream"),
] = True
- r"""Must be `true`. This endpoint only streams."""
+ r"""Must be `true`. This endpoint only streams. `false` or an omitted `stream` is refused with `400` and reason `bad_request`."""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
diff --git a/src/openrouter/components/updateinternrequest.py b/src/openrouter/components/updateinternrequest.py
index ceef4fe4..1b9db811 100644
--- a/src/openrouter/components/updateinternrequest.py
+++ b/src/openrouter/components/updateinternrequest.py
@@ -21,7 +21,7 @@ class UpdateInternRequestTypedDict(TypedDict):
instructions: NotRequired[Nullable[str]]
r"""New standing instructions. Null clears them."""
model: NotRequired[Nullable[str]]
- r"""New OpenRouter model slug. Null restores the workspace default."""
+ r"""New OpenRouter model slug in `author/slug` form (an optional `:variant` suffix is accepted). Other shapes are refused with 400. Null restores the workspace default. Takes effect on the next provision: until then `GET` shows this configured model while chat chunks show the model the running intern reports."""
name: NotRequired[str]
r"""New intern name, unique per creator within the workspace."""
@@ -36,7 +36,7 @@ class UpdateInternRequest(BaseModel):
r"""New standing instructions. Null clears them."""
model: OptionalNullable[str] = UNSET
- r"""New OpenRouter model slug. Null restores the workspace default."""
+ r"""New OpenRouter model slug in `author/slug` form (an optional `:variant` suffix is accepted). Other shapes are refused with 400. Null restores the workspace default. Takes effect on the next provision: until then `GET` shows this configured model while chat chunks show the model the running intern reports."""
name: Optional[str] = None
r"""New intern name, unique per creator within the workspace."""
diff --git a/src/openrouter/interns.py b/src/openrouter/interns.py
index d1dac0bf..5272d44f 100644
--- a/src/openrouter/interns.py
+++ b/src/openrouter/interns.py
@@ -601,6 +601,7 @@ def delete_intern(
http_referer: Optional[str] = None,
x_open_router_title: Optional[str] = None,
x_open_router_categories: Optional[str] = None,
+ acknowledge_workspace_loss: Optional[bool] = False,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
@@ -608,7 +609,7 @@ def delete_intern(
) -> components.DeleteInternResponse:
r"""Delete an intern
- Starts safe teardown of the intern, its runtime and its private vault. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
+ Starts safe teardown of the intern, its runtime and its private vault. The body is optional. Send `{\"acknowledge_workspace_loss\": true}` to delete a `destroy_failed` intern whose `last_failure_message` names `workspace_archive_failed`, accepting that its workspace is not backed up. The request body is capped at 1048576 bytes and a larger body is refused with 413. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
If set, this operation will use `api_key` from the global security.
@@ -620,6 +621,7 @@ def delete_intern(
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
+ :param acknowledge_workspace_loss: Delete even though the workspace backup was not confirmed. Defaults to false, which refuses the teardown when a workspace archive is missing.
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -640,6 +642,9 @@ def delete_intern(
x_open_router_title=x_open_router_title,
x_open_router_categories=x_open_router_categories,
intern_id=intern_id,
+ delete_intern_request=components.DeleteInternRequest(
+ acknowledge_workspace_loss=acknowledge_workspace_loss,
+ ),
)
req = self._build_request(
@@ -648,7 +653,7 @@ def delete_intern(
base_url=base_url,
url_variables=url_variables,
request=request,
- request_body_required=False,
+ request_body_required=True,
request_has_path_params=True,
request_has_query_params=True,
user_agent_header="user-agent",
@@ -660,6 +665,13 @@ def delete_intern(
x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories,
),
security=self.sdk_configuration.security,
+ get_serialized_body=lambda: utils.serialize_request_body(
+ request.delete_intern_request,
+ False,
+ False,
+ "json",
+ components.DeleteInternRequest,
+ ),
allow_empty_value=None,
allowed_fields=["api_key"],
timeout_ms=timeout_ms,
@@ -698,7 +710,9 @@ def delete_intern(
if utils.match_response(http_res, "202", "application/json"):
return unmarshal_json_response(components.DeleteInternResponse, http_res)
if utils.match_response(
- http_res, ["401", "403", "404", "408", "409"], "application/json"
+ http_res,
+ ["400", "401", "403", "404", "408", "409", "413"],
+ "application/json",
):
response_data = unmarshal_json_response(
errors.InternLifecycleErrorData, http_res
@@ -729,6 +743,7 @@ async def delete_intern_async(
http_referer: Optional[str] = None,
x_open_router_title: Optional[str] = None,
x_open_router_categories: Optional[str] = None,
+ acknowledge_workspace_loss: Optional[bool] = False,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
@@ -736,7 +751,7 @@ async def delete_intern_async(
) -> components.DeleteInternResponse:
r"""Delete an intern
- Starts safe teardown of the intern, its runtime and its private vault. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
+ Starts safe teardown of the intern, its runtime and its private vault. The body is optional. Send `{\"acknowledge_workspace_loss\": true}` to delete a `destroy_failed` intern whose `last_failure_message` names `workspace_archive_failed`, accepting that its workspace is not backed up. The request body is capped at 1048576 bytes and a larger body is refused with 413. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
If set, this operation will use `api_key` from the global security.
@@ -748,6 +763,7 @@ async def delete_intern_async(
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
+ :param acknowledge_workspace_loss: Delete even though the workspace backup was not confirmed. Defaults to false, which refuses the teardown when a workspace archive is missing.
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -768,6 +784,9 @@ async def delete_intern_async(
x_open_router_title=x_open_router_title,
x_open_router_categories=x_open_router_categories,
intern_id=intern_id,
+ delete_intern_request=components.DeleteInternRequest(
+ acknowledge_workspace_loss=acknowledge_workspace_loss,
+ ),
)
req = self._build_request_async(
@@ -776,7 +795,7 @@ async def delete_intern_async(
base_url=base_url,
url_variables=url_variables,
request=request,
- request_body_required=False,
+ request_body_required=True,
request_has_path_params=True,
request_has_query_params=True,
user_agent_header="user-agent",
@@ -788,6 +807,13 @@ async def delete_intern_async(
x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories,
),
security=self.sdk_configuration.security,
+ get_serialized_body=lambda: utils.serialize_request_body(
+ request.delete_intern_request,
+ False,
+ False,
+ "json",
+ components.DeleteInternRequest,
+ ),
allow_empty_value=None,
allowed_fields=["api_key"],
timeout_ms=timeout_ms,
@@ -826,7 +852,9 @@ async def delete_intern_async(
if utils.match_response(http_res, "202", "application/json"):
return unmarshal_json_response(components.DeleteInternResponse, http_res)
if utils.match_response(
- http_res, ["401", "403", "404", "408", "409"], "application/json"
+ http_res,
+ ["400", "401", "403", "404", "408", "409", "413"],
+ "application/json",
):
response_data = unmarshal_json_response(
errors.InternLifecycleErrorData, http_res
@@ -1138,7 +1166,7 @@ def update_intern(
:param description: New free-form description. Null clears it.
:param instructions: New standing instructions. Null clears them.
- :param model: New OpenRouter model slug. Null restores the workspace default.
+ :param model: New OpenRouter model slug in `author/slug` form (an optional `:variant` suffix is accepted). Other shapes are refused with 400. Null restores the workspace default. Takes effect on the next provision: until then `GET` shows this configured model while chat chunks show the model the running intern reports.
:param name: New intern name, unique per creator within the workspace.
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
@@ -1287,7 +1315,7 @@ async def update_intern_async(
:param description: New free-form description. Null clears it.
:param instructions: New standing instructions. Null clears them.
- :param model: New OpenRouter model slug. Null restores the workspace default.
+ :param model: New OpenRouter model slug in `author/slug` form (an optional `:variant` suffix is accepted). Other shapes are refused with 400. Null restores the workspace default. Takes effect on the next provision: until then `GET` shows this configured model while chat chunks show the model the running intern reports.
:param name: New intern name, unique per creator within the workspace.
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
@@ -1966,8 +1994,8 @@ def chat(
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
:param approval_mode: How the run started by this prompt handles tool approvals. `self-drive` (the default when omitted) consents on your behalf and runs the shell unsandboxed. `manual` asks you before an approval-bearing tool runs, as an `openrouter.provide_input` permission request, and keeps the shell sandboxed until an escalation is allowed. The mode applies to the run this prompt starts and is not remembered by the session. Repeat it on each new prompt that should use it. A `tool` reply continues the run under the mode it started with.
- :param model: Accepted for OpenAI compatibility and ignored. Streamed chunks report the model the intern actually used, or `openrouter/intern` when it did not report one.
- :param session_id: The daemon session to continue, as returned in `session_id` on the final chunk of an earlier response. Omit it to start a new session. Required when the last message has role `tool`.
+ :param model: Accepted for OpenAI compatibility and never used. The intern runs the model configured on it (`PATCH` the intern to change it). Streamed chunks report the runtime's identifier for that model as the intern reports it, or `openrouter/intern` on chunks whose event carries no model (before the intern reports one, and on the chunks the API emits itself: the timeout, run-ended and severed-stream error chunks, the stop chunk of a replay that ends without a terminal daemon event, and the final usage chunk after any of them). A usage chunk that follows a daemon completion event carries the model the intern reported.
+ :param session_id: The daemon session to continue, as returned in `session_id` on the final chunk of an earlier response. Omit it to start a new session. An id the intern has not seen before is not an error: it starts a new session under that id, so a mistyped id forks the conversation. Sessions are scoped to the intern's own daemon. Required when the last message has role `tool`.
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -2157,8 +2185,8 @@ async def chat_async(
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
:param approval_mode: How the run started by this prompt handles tool approvals. `self-drive` (the default when omitted) consents on your behalf and runs the shell unsandboxed. `manual` asks you before an approval-bearing tool runs, as an `openrouter.provide_input` permission request, and keeps the shell sandboxed until an escalation is allowed. The mode applies to the run this prompt starts and is not remembered by the session. Repeat it on each new prompt that should use it. A `tool` reply continues the run under the mode it started with.
- :param model: Accepted for OpenAI compatibility and ignored. Streamed chunks report the model the intern actually used, or `openrouter/intern` when it did not report one.
- :param session_id: The daemon session to continue, as returned in `session_id` on the final chunk of an earlier response. Omit it to start a new session. Required when the last message has role `tool`.
+ :param model: Accepted for OpenAI compatibility and never used. The intern runs the model configured on it (`PATCH` the intern to change it). Streamed chunks report the runtime's identifier for that model as the intern reports it, or `openrouter/intern` on chunks whose event carries no model (before the intern reports one, and on the chunks the API emits itself: the timeout, run-ended and severed-stream error chunks, the stop chunk of a replay that ends without a terminal daemon event, and the final usage chunk after any of them). A usage chunk that follows a daemon completion event carries the model the intern reported.
+ :param session_id: The daemon session to continue, as returned in `session_id` on the final chunk of an earlier response. Omit it to start a new session. An id the intern has not seen before is not an error: it starts a new session under that id, so a mistyped id forks the conversation. Sessions are scoped to the intern's own daemon. Required when the last message has role `tool`.
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
diff --git a/src/openrouter/operations/deleteintern.py b/src/openrouter/operations/deleteintern.py
index a1e8d0c9..9595f013 100644
--- a/src/openrouter/operations/deleteintern.py
+++ b/src/openrouter/operations/deleteintern.py
@@ -1,8 +1,14 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
+from openrouter.components import deleteinternrequest as components_deleteinternrequest
from openrouter.types import BaseModel, UNSET_SENTINEL
-from openrouter.utils import FieldMetadata, HeaderMetadata, PathParamMetadata
+from openrouter.utils import (
+ FieldMetadata,
+ HeaderMetadata,
+ PathParamMetadata,
+ RequestMetadata,
+)
import pydantic
from pydantic import model_serializer
from typing import Optional
@@ -76,6 +82,7 @@ def serialize_model(self, handler):
class DeleteInternRequestTypedDict(TypedDict):
intern_id: str
r"""ID of an intern visible to the authenticated API key."""
+ delete_intern_request: components_deleteinternrequest.DeleteInternRequestTypedDict
http_referer: NotRequired[str]
r"""The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
@@ -99,6 +106,11 @@ class DeleteInternRequest(BaseModel):
]
r"""ID of an intern visible to the authenticated API key."""
+ delete_intern_request: Annotated[
+ components_deleteinternrequest.DeleteInternRequest,
+ FieldMetadata(request=RequestMetadata(media_type="application/json")),
+ ]
+
http_referer: Annotated[
Optional[str],
pydantic.Field(alias="HTTP-Referer"),
diff --git a/uv.lock b/uv.lock
index b78687c5..7fbdaf8c 100644
--- a/uv.lock
+++ b/uv.lock
@@ -213,7 +213,7 @@ wheels = [
[[package]]
name = "openrouter"
-version = "1.2.4"
+version = "1.2.5"
source = { editable = "." }
dependencies = [
{ name = "httpcore" },