diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock
index 2cde080ff..e884ff0b2 100644
--- a/.speakeasy/gen.lock
+++ b/.speakeasy/gen.lock
@@ -1,19 +1,19 @@
lockVersion: ""
id: ""
management:
- docChecksum: ad0a29d2f656e1f103235224ec925ad7
+ docChecksum: ac1b7d27014263854651af7c7a6bf606
docVersion: 1.0.0
speakeasyVersion: 1.787.0
generationVersion: 2.914.0
- releaseVersion: 1.3.4
- configChecksum: 57e591ed33962797da51d57d51203a35
+ releaseVersion: 1.3.5
+ configChecksum: 228cf12c42921d2017027698fbcfa9af
repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git
installationURL: https://github.com/OpenRouterTeam/typescript-sdk
published: true
persistentEdits:
- generation_id: 19ece1de-841b-4c13-922c-c0d6901b1867
- pristine_commit_hash: f45c3adcd84b7e4213ea3f0c380563d23ea6e831
- pristine_tree_hash: d04a7a6d8192d26def29552a582a0bc7069d3dac
+ generation_id: 9089d553-fc75-4d5f-8f7c-23a3f7744b1d
+ pristine_commit_hash: 007b10f79afc72fa89fb3f13f26a831cc53c01d7
+ pristine_tree_hash: 780b8599c4a60262867ed5f1c803fa4eb6907699
features:
typescript:
acceptHeaders: 2.81.2
@@ -3527,6 +3527,10 @@ trackedFiles:
id: ce7c05e37dcd
last_write_checksum: sha1:39101f4dc1d9b096b31564e8ef5c2facd3804de4
pristine_git_object: e535ca316996dfa5f546bb0b4c68f1b30a7b5b72
+ docs/models/deleteinternrequest.mdx:
+ id: 7ec4fedcc86d
+ last_write_checksum: sha1:7dd079b35e838bdaced4ea3450af8ce7d364578b
+ pristine_git_object: cc5af0e0d64b6f55b0a076eba77c4159d0c31c2d
docs/models/deleteinternresponse.mdx:
id: 03edfc138819
last_write_checksum: sha1:6c243822e73cd675ec8a82232cd4ab709048d711
@@ -5458,16 +5462,16 @@ trackedFiles:
pristine_git_object: 499465b7f8a297d0212ee2f20cbad1b6bde01fa6
docs/models/internchatcompletionchunk.mdx:
id: 0068460f12e3
- last_write_checksum: sha1:968a5e72de67f98dc9378d99bf44a360e54a0c41
- pristine_git_object: 60d0aaa77ef019d28d97b646d6f6252615c7caef
+ last_write_checksum: sha1:8a1767dcff6411a0a8db5b270fdd0663b0acfac1
+ pristine_git_object: d558a4b084233a83ffabd898005f6ac50d95d992
docs/models/internchatcompletionchunkobject.mdx:
id: e281295610be
last_write_checksum: sha1:d6e73aa1e66a16cf0cfd5a43178a078f5e8efdf4
pristine_git_object: 07a1e5d37cf68123e71abb8531e726d9a2e40876
docs/models/internchatcompletionrequest.mdx:
id: 7baa73239e5e
- last_write_checksum: sha1:79a581d95a09b7a3b73d4677860ce9a45c66cc22
- pristine_git_object: 0a599a8385d3a182a7aa0bcae6d9c725fcdde119
+ last_write_checksum: sha1:e0a42e361a7852075acb2dd31fa0eeb6a5c11be7
+ pristine_git_object: 27a2b4e3c1eea69b85043d39a088b466ac0d12a3
docs/models/internchatdelta.mdx:
id: 2757d670be40
last_write_checksum: sha1:ebe9366864caa3cc886b958166056992d1ff9235
@@ -7881,8 +7885,8 @@ trackedFiles:
pristine_git_object: 33484c212d4748d1e2645192fef4bb3919514447
docs/models/operations/deleteinternrequest.mdx:
id: 4e5711c1de17
- last_write_checksum: sha1:bd463a657fc0c9b7b1d8b7a6e1a05fd3832db4dc
- pristine_git_object: dc22159e7732ef3ea4f8444aa9f56d639147c155
+ last_write_checksum: sha1:2f94342c0c1dda3bf15f1fc245bb6c3fd8b9bd4f
+ pristine_git_object: 5d82e365c90504a4dc40c13938133eedcf75d152
docs/models/operations/deleteinternvaultsecretglobals.mdx:
id: 35445e62ab94
last_write_checksum: sha1:1cd1ed45d5becaf0e32bf9cc592b754cdd1206aa
@@ -12997,8 +13001,8 @@ trackedFiles:
pristine_git_object: eb7d5202272393e3842e98a802f36df047490329
docs/models/updateinternrequest.mdx:
id: 5cd3a329314e
- last_write_checksum: sha1:90305bf718b8e9fa5467be843752a28e81605583
- pristine_git_object: 4fdba18d4c3903fcb1bafc8c9173dba5873b5beb
+ last_write_checksum: sha1:b13ec752da4f5f4c02670b4b73290bde11596fdf
+ pristine_git_object: 01c720876a44707e2a9b6873fbcb9603cc667922
docs/models/updateobservabilitydestinationrequest.md:
id: 59d595732fad
last_write_checksum: sha1:1f630e71590e2b30653789861207cdd7c24b30f9
@@ -13646,8 +13650,8 @@ trackedFiles:
pristine_git_object: 15b7b4c80d50dd3aa0f7adc3ab4d9fb03a8efaa7
docs/sdks/interns/README.mdx:
id: 2f8a053ffe78
- last_write_checksum: sha1:b8c11cd45c3a4d9cffa6732123992e67ed812a30
- pristine_git_object: 0eb5b9ccae901772dd5a7a4eb01f504f64059a41
+ last_write_checksum: sha1:f4f0d9b9eeebff511f489d65b7bd92b52317a582
+ pristine_git_object: bd1a9aec740cb00ce8d297f299ec750e31f2c92e
docs/sdks/models/README.mdx:
id: 58f1ca464e0b
last_write_checksum: sha1:dbae6f74244ab3e9fe38e075ab67f926f33ef87d
@@ -13766,12 +13770,12 @@ trackedFiles:
pristine_git_object: 410efafd6a7f50d91ccb87131fedbe0c3d47e15a
jsr.json:
id: 7f6ab7767282
- last_write_checksum: sha1:c55d4adc66bd38737214399c9271b62a62bc5b3e
- pristine_git_object: 0d2592fa67c9c84dc57f0891635ffa7b449b2fee
+ last_write_checksum: sha1:3c97f4275190480132d5a12db34e7b65ed2af477
+ pristine_git_object: 8054f87ecd1e20529c6e28834a4c8c9887f16ebc
package.json:
id: 7030d0b2f71b
- last_write_checksum: sha1:38c5e26144a381927cd3232fee0a1e9dc94c55c8
- pristine_git_object: d6451c403af262964d496a2ef0784678c0ca88d2
+ last_write_checksum: sha1:4a2b89ad6360f55eb8ca1ddbf969a0fd6d2fdf9e
+ pristine_git_object: 7674f4c0e1c3d17236bd6c05cc380519e183d53a
src/core.ts:
id: f431fdbcd144
last_write_checksum: sha1:5aa66b0b6a5964f3eea7f3098c2eb3c0ee9c0131
@@ -14002,8 +14006,8 @@ trackedFiles:
pristine_git_object: 466bac46005019d63f121858cc675cc3bb9c51e2
src/funcs/internsDeleteIntern.ts:
id: 7eb35f20da18
- last_write_checksum: sha1:34d48eb529707088f311da56b14bdc7e977ba01e
- pristine_git_object: f07c141bd85132146a7a74f7a2cacc9ebbcf8388
+ last_write_checksum: sha1:300fd8f81c357019b3ca8b0e9b4030d1b92ce5cd
+ pristine_git_object: 24c8284553fc20c4777a2228a38d60aeb5f2cfcb
src/funcs/internsGetIntern.ts:
id: 484b04c35876
last_write_checksum: sha1:95616ff94e6ef4fe3248885d25aa71a6b01f5186
@@ -14278,8 +14282,8 @@ trackedFiles:
pristine_git_object: a187e58707bdb726ca2aff74941efe7493422d4e
src/lib/config.ts:
id: 320761608fb3
- last_write_checksum: sha1:39480e437487fe5fb1ad3f6218b1f23f0d145855
- pristine_git_object: c80f40d8957de46050b9e23a1d70c58186a40f16
+ last_write_checksum: sha1:86125b9e1f3bde0e8a60471e376be9f27f7b8f94
+ pristine_git_object: ab8a6b2b28bd3b520f79b22c56e6dda46e86f738
src/lib/dlv.ts:
id: b1988214835a
last_write_checksum: sha1:eaac763b22717206a6199104e0403ed17a4e2711
@@ -15186,6 +15190,10 @@ trackedFiles:
id: 1369f013fe1a
last_write_checksum: sha1:565ef523d328e7acec91693559d7544798cfd642
pristine_git_object: 943415e3ac21d0eb30bd73300b99874fe1cda296
+ src/models/deleteinternrequest.ts:
+ id: 732bd4f781c2
+ last_write_checksum: sha1:c6f023359d7c4e564888d8a681e6a7f92e2be747
+ pristine_git_object: 7fdce05c56caa90f221d0681cefefceb7ba97935
src/models/deleteinternresponse.ts:
id: 280574b56b8f
last_write_checksum: sha1:448c384da4015844f6d631ee7ceb089658ce267a
@@ -15672,8 +15680,8 @@ trackedFiles:
pristine_git_object: 7abdfe096d3adff317db6837dc689c69db92e127
src/models/index.ts:
id: f93644b0f37e
- last_write_checksum: sha1:cddd48b8667b363b7e2093ba038665d921f9d057
- pristine_git_object: 48042f502ede0df095566c0bd583f499797c2967
+ last_write_checksum: sha1:aa15dff6b0a56571f8afe72901eadb633a759470
+ pristine_git_object: 0a26150a9cfaef0d3613ea0e3f30aebc37394edc
src/models/inputaudio.ts:
id: 9bdc14c7565f
last_write_checksum: sha1:2f8dc4c1d6a9c2927d9eb186e0ecedf7b81838e6
@@ -15736,12 +15744,12 @@ trackedFiles:
pristine_git_object: 4f49443ce50fa0f7c73c91ecc9aaeffff1e4ddb7
src/models/internchatcompletionchunk.ts:
id: 3492df914b61
- last_write_checksum: sha1:9fc69ccad6ce6208285a1508c276cf77f92cfaea
- pristine_git_object: 7bf25c083f9b302146bf4a8c36b942ce310e827d
+ last_write_checksum: sha1:0c5514d22a8bcc152dc27add29b6af1e9ce7b2d3
+ pristine_git_object: 5d214c7583b5dfeade5a1b7f9e788da4da4fe7ba
src/models/internchatcompletionrequest.ts:
id: 46664fa50bff
- last_write_checksum: sha1:de4d901a9684119208727dd3a2a966507303dd16
- pristine_git_object: 9e1397285db65b8055e52926c84924f01fd53623
+ last_write_checksum: sha1:c6e8f3b2b2b19d8c03d3086d263827a6b0508149
+ pristine_git_object: 13f44684f0bbf3faab32f3dd00e5f6ed4297c8ad
src/models/internchatdelta.ts:
id: c2dc1f33e1df
last_write_checksum: sha1:9469ac68471b3eed4d0cf571ba5c42c79c0fe484
@@ -16364,8 +16372,8 @@ trackedFiles:
pristine_git_object: 9f9996b3729c03bc6f64457f2cb9507348519276
src/models/operations/deleteintern.ts:
id: 3d76bcc84f78
- last_write_checksum: sha1:0cea02fffbdce0f040889986ca3500bf88da6853
- pristine_git_object: 48f248d91ab3185184fccfdcae3e94b215981322
+ last_write_checksum: sha1:9d01cc322e0d1c2cc51c61a0d8bad881f27c46c7
+ pristine_git_object: ff7831b761ce95c6c1a4e1c7e51eb633d647625f
src/models/operations/deleteinternvaultsecret.ts:
id: b715772a86c5
last_write_checksum: sha1:8ca5e5f4434cfb297ac245a1563d482d6595ac75
@@ -17504,8 +17512,8 @@ trackedFiles:
pristine_git_object: 62e472e9b880f14ff6a0433cd58068fead471355
src/models/updateinternrequest.ts:
id: 8e76ee00847f
- last_write_checksum: sha1:0860e57c8f39e3d3a2e66ccbbd6d873a1ecda5dc
- pristine_git_object: ad8f74dab7ffbc2568d6675b5501cf1a56db7b13
+ last_write_checksum: sha1:4678215142798b913cec2ad624f6353e8b151f17
+ pristine_git_object: 27e0a9c076a66e8f5970cdf533c4e4b8797ae733
src/models/updateobservabilitydestinationrequest.ts:
id: b5f21f0b6b97
last_write_checksum: sha1:2294fea2fba0b81bbf04004088d3675ac8857155
@@ -17764,8 +17772,8 @@ trackedFiles:
pristine_git_object: 5c82fe389f888827f98aa52788b850ef43422e07
src/sdk/interns.ts:
id: fc3b4e6c5008
- last_write_checksum: sha1:5831a0140e55de52892fda1074d757e8dd902f16
- pristine_git_object: 3558d4be3e134fe741c02b841f55ecfcc224c93b
+ last_write_checksum: sha1:2c79df7d2c8ec4a11068620082fea7910dd02808
+ pristine_git_object: 486223a71030bee4b0bc6c7b16a47ae65071d421
src/sdk/models.ts:
id: 8c761ab180fd
last_write_checksum: sha1:0c5e5cefb7079fc69eb11ef157af6d2cb5255933
@@ -20968,6 +20976,8 @@ examples:
parameters:
path:
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7"
+ requestBody:
+ application/json: {"acknowledge_workspace_loss": true}
responses:
"202":
application/json: {"deleting": true}
@@ -20975,6 +20985,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:
@@ -21069,3 +21081,4 @@ examples:
"529":
application/json: {"error": {"code": 529, "message": "Provider returned error"}}
examplesVersion: 1.0.2
+releaseNotes: "## Typescript SDK Changes:\n* `openrouter.interns.deleteIntern()`: \n * `request.deleteInternRequest` **Added** (Breaking ⚠️)\n * `error` **Changed**\n"
diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml
index acc07bbcf..4aaedeb62 100644
--- a/.speakeasy/gen.yaml
+++ b/.speakeasy/gen.yaml
@@ -37,7 +37,7 @@ generation:
documentation: mintlify
preApplyUnionDiscriminators: true
typescript:
- version: 1.3.4
+ version: 1.3.5
acceptHeaderEnum: false
additionalDependencies:
dependencies:
diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml
index 716358a1c..8833bba90 100644
--- a/.speakeasy/out.openapi.yaml
+++ b/.speakeasy/out.openapi.yaml
@@ -8616,6 +8616,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:
@@ -12629,14 +12640,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'
@@ -12668,20 +12679,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:
@@ -28021,8 +28032,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'
@@ -36633,7 +36646,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.'
@@ -36645,6 +36658,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:
@@ -36654,6 +36675,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:
@@ -36704,6 +36735,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 f34f5c40d..89cadd37a 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:5bb7363c1dd627cc0febfa80c4f473d95a9c748c4a88d4813c83cafbe5aca40d
- sourceBlobDigest: sha256:890652a06018be2664b344710e3b3950ba52364791007b0f9f33fff3b05aff40
+ sourceRevisionDigest: sha256:1be8ee31e86ed4ae0b3c8d37f2808d76b01eda17797a430d320a4a3adc0156fb
+ sourceBlobDigest: sha256:90ce17ea838df537b466f36fa3d078045589e0605f473529e0a66799bd4aaba6
tags:
- latest
- 1.0.0
@@ -11,10 +11,10 @@ targets:
openrouter:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
- sourceRevisionDigest: sha256:5bb7363c1dd627cc0febfa80c4f473d95a9c748c4a88d4813c83cafbe5aca40d
- sourceBlobDigest: sha256:890652a06018be2664b344710e3b3950ba52364791007b0f9f33fff3b05aff40
+ sourceRevisionDigest: sha256:1be8ee31e86ed4ae0b3c8d37f2808d76b01eda17797a430d320a4a3adc0156fb
+ sourceBlobDigest: sha256:90ce17ea838df537b466f36fa3d078045589e0605f473529e0a66799bd4aaba6
codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples
- codeSamplesRevisionDigest: sha256:d667594d6b3ab7e4b615adbdd8b47686c299ce6c1e1ecafb663358fade0eb801
+ codeSamplesRevisionDigest: sha256:e80fd66a9402afd3e3bdefde66292b73abf6c97e48d044c27a76c3a6e80cbb7a
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.787.0
diff --git a/RELEASES.md b/RELEASES.md
index 9ba4e472f..65afaed24 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -3836,4 +3836,14 @@ Based on:
### Generated
- [typescript v1.3.4] .
### Releases
-- [NPM v1.3.4] https://www.npmjs.com/package/@openrouter/sdk/v/1.3.4 - .
\ No newline at end of file
+- [NPM v1.3.4] https://www.npmjs.com/package/@openrouter/sdk/v/1.3.4 - .
+
+## 2026-09-19 19:16:10
+### Changes
+Based on:
+- OpenAPI Doc
+- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy
+### Generated
+- [typescript v1.3.5] .
+### Releases
+- [NPM v1.3.5] https://www.npmjs.com/package/@openrouter/sdk/v/1.3.5 - .
\ No newline at end of file
diff --git a/docs/models/deleteinternrequest.mdx b/docs/models/deleteinternrequest.mdx
new file mode 100644
index 000000000..cc5af0e0d
--- /dev/null
+++ b/docs/models/deleteinternrequest.mdx
@@ -0,0 +1,21 @@
+---
+title: "DeleteInternRequest"
+---
+
+Optional consent for a teardown that discards the workspace.
+
+## Example Usage
+
+```typescript
+import { DeleteInternRequest } from "@openrouter/sdk/models";
+
+let value: DeleteInternRequest = {
+ acknowledgeWorkspaceLoss: true,
+};
+```
+
+## Fields
+
+| Field | Type | Required | Description |
+| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
+| `acknowledgeWorkspaceLoss` | *boolean* | :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/models/internchatcompletionchunk.mdx b/docs/models/internchatcompletionchunk.mdx
index 60d0aaa77..d558a4b08 100644
--- a/docs/models/internchatcompletionchunk.mdx
+++ b/docs/models/internchatcompletionchunk.mdx
@@ -32,7 +32,7 @@ let value: InternChatCompletionChunk = {
| `created` | *number* | :heavy_check_mark: | N/A | |
| `error` | [models.InternChatStreamError](../models/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` | *string* | :heavy_check_mark: | The completion id, constant for the whole response. | chatcmpl-f727571a-3bad-4e0d-8a9e-f18f8cda9750 |
-| `model` | *string* | :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` | *string* | :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` | [models.InternChatCompletionChunkObject](../models/internchatcompletionchunkobject.mdx) | :heavy_check_mark: | N/A | |
-| `sessionId` | *string* | :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 |
+| `sessionId` | *string* | :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` | [models.InternChatUsage](../models/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/models/internchatcompletionrequest.mdx b/docs/models/internchatcompletionrequest.mdx
index 0a599a838..27a2b4e3c 100644
--- a/docs/models/internchatcompletionrequest.mdx
+++ b/docs/models/internchatcompletionrequest.mdx
@@ -22,10 +22,10 @@ let value: InternChatCompletionRequest = {
## Fields
-| Field | Type | Required | Description | Example |
-| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `approvalMode` | [models.InternApprovalMode](../models/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` | *models.InternChatMessage*[] | :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` | *string* | :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 |
-| `sessionId` | *string* | :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` | *true* | :heavy_check_mark: | Must be `true`. This endpoint only streams. | true |
\ No newline at end of file
+| Field | Type | Required | Description | Example |
+| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `approvalMode` | [models.InternApprovalMode](../models/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` | *models.InternChatMessage*[] | :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` | *string* | :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 |
+| `sessionId` | *string* | :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` | *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/models/operations/deleteinternrequest.mdx b/docs/models/operations/deleteinternrequest.mdx
index dc22159e7..5d82e365c 100644
--- a/docs/models/operations/deleteinternrequest.mdx
+++ b/docs/models/operations/deleteinternrequest.mdx
@@ -9,6 +9,9 @@ import { DeleteInternRequest } from "@openrouter/sdk/models/operations";
let value: DeleteInternRequest = {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
+ deleteInternRequest: {
+ acknowledgeWorkspaceLoss: true,
+ },
};
```
@@ -19,4 +22,5 @@ let value: DeleteInternRequest = {
| `httpReferer` | *string* | :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.
| |
| `appTitle` | *string* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| |
| `appCategories` | *string* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| |
-| `internId` | *string* | :heavy_check_mark: | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 |
\ No newline at end of file
+| `internId` | *string* | :heavy_check_mark: | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 |
+| `deleteInternRequest` | [models.DeleteInternRequest](../../models/deleteinternrequest.mdx) | :heavy_check_mark: | N/A | \{
"acknowledge_workspace_loss": true
} |
\ No newline at end of file
diff --git a/docs/models/updateinternrequest.mdx b/docs/models/updateinternrequest.mdx
index 4fdba18d4..01c720876 100644
--- a/docs/models/updateinternrequest.mdx
+++ b/docs/models/updateinternrequest.mdx
@@ -14,9 +14,9 @@ let value: UpdateInternRequest = {};
## Fields
-| Field | Type | Required | Description |
-| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
-| `description` | *string* | :heavy_minus_sign: | New free-form description. Null clears it. |
-| `instructions` | *string* | :heavy_minus_sign: | New standing instructions. Null clears them. |
-| `model` | *string* | :heavy_minus_sign: | New OpenRouter model slug. Null restores the workspace default. |
-| `name` | *string* | :heavy_minus_sign: | New intern name, unique per creator within the workspace. |
\ No newline at end of file
+| Field | Type | Required | Description |
+| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| `description` | *string* | :heavy_minus_sign: | New free-form description. Null clears it. |
+| `instructions` | *string* | :heavy_minus_sign: | New standing instructions. Null clears them. |
+| `model` | *string* | :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` | *string* | :heavy_minus_sign: | New intern name, unique per creator within the workspace. |
\ No newline at end of file
diff --git a/docs/sdks/interns/README.mdx b/docs/sdks/interns/README.mdx
index 0eb5b9cca..bd1a9aec7 100644
--- a/docs/sdks/interns/README.mdx
+++ b/docs/sdks/interns/README.mdx
@@ -184,7 +184,7 @@ run();
## deleteIntern
-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
@@ -201,6 +201,9 @@ const openRouter = new OpenRouter({
async function run() {
const result = await openRouter.interns.deleteIntern({
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
+ deleteInternRequest: {
+ acknowledgeWorkspaceLoss: true,
+ },
});
console.log(result);
@@ -229,6 +232,9 @@ const openRouter = new OpenRouterCore({
async function run() {
const res = await internsDeleteIntern(openRouter, {
internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7",
+ deleteInternRequest: {
+ acknowledgeWorkspaceLoss: true,
+ },
});
if (res.ok) {
const { value: result } = res;
@@ -256,11 +262,11 @@ run();
### 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 | \*/\* |
## getIntern
diff --git a/jsr.json b/jsr.json
index 0d2592fa6..8054f87ec 100644
--- a/jsr.json
+++ b/jsr.json
@@ -2,7 +2,7 @@
{
"name": "@openrouter/sdk",
- "version": "1.3.4",
+ "version": "1.3.5",
"exports": {
".": "./src/index.ts",
"./models/errors": "./src/models/errors/index.ts",
diff --git a/package.json b/package.json
index a780fa3e8..5bc01ece9 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@openrouter/sdk",
- "version": "1.3.4",
+ "version": "1.3.5",
"author": "OpenRouter",
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.",
"keywords": [
@@ -73,15 +73,15 @@
"lint": "eslint --cache --max-warnings=0 src",
"build": "tsc",
"prepublishOnly": "npm run build",
- "test:watch": "vitest --watch --project unit",
- "typecheck:transit": "exit 0",
- "prepare": "npm run build",
- "test": "vitest --run --project unit",
- "test:transit": "exit 0",
"typecheck": "tsc --noEmit",
+ "typecheck:transit": "exit 0",
"compile": "tsc",
"postinstall": "node scripts/check-types.js || true",
- "test:e2e": "vitest --run --project e2e"
+ "prepare": "npm run build",
+ "test:e2e": "vitest --run --project e2e",
+ "test:transit": "exit 0",
+ "test:watch": "vitest --watch --project unit",
+ "test": "vitest --run --project unit"
},
"peerDependencies": {},
"devDependencies": {
diff --git a/src/funcs/internsDeleteIntern.ts b/src/funcs/internsDeleteIntern.ts
index f07c141bd..24c828455 100644
--- a/src/funcs/internsDeleteIntern.ts
+++ b/src/funcs/internsDeleteIntern.ts
@@ -4,7 +4,7 @@
*/
import { OpenRouterCore } from "../core.js";
-import { encodeSimple } from "../lib/encodings.js";
+import { encodeJSON, encodeSimple } from "../lib/encodings.js";
import { matchStatusCode } from "../lib/http.js";
import * as M from "../lib/matchers.js";
import { compactMap } from "../lib/primitives.js";
@@ -32,7 +32,7 @@ import { Result } from "../types/fp.js";
* Delete an intern
*
* @remarks
- * 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 {@link Security.apiKey} from the global security.
*/
@@ -91,7 +91,9 @@ async function $do(
return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
- const body = null;
+ const body = encodeJSON("body", payload.DeleteInternRequest, {
+ explode: true,
+ });
const pathParams = {
internId: encodeSimple("internId", payload.internId, {
@@ -102,6 +104,7 @@ async function $do(
const path = pathToFunc("/interns/{internId}")(pathParams);
const headers = new Headers(compactMap({
+ "Content-Type": "application/json",
Accept: "application/json",
"HTTP-Referer": encodeSimple(
"HTTP-Referer",
@@ -194,7 +197,7 @@ async function $do(
>(
M.json(202, models.DeleteInternResponse$inboundSchema),
M.jsonErr(
- [401, 403, 404, 408, 409],
+ [400, 401, 403, 404, 408, 409, 413],
errors.InternLifecycleError$inboundSchema,
),
M.jsonErr([500, 502], errors.InternLifecycleError$inboundSchema),
diff --git a/src/lib/config.ts b/src/lib/config.ts
index b95797807..534aec9ad 100644
--- a/src/lib/config.ts
+++ b/src/lib/config.ts
@@ -79,7 +79,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
export const SDK_METADATA = {
language: "typescript",
openapiDocVersion: "1.0.0",
- sdkVersion: "1.3.4",
+ sdkVersion: "1.3.5",
genVersion: "2.914.0",
- userAgent: "speakeasy-sdk/typescript 1.3.4 2.914.0 1.0.0 @openrouter/sdk",
+ userAgent: "speakeasy-sdk/typescript 1.3.5 2.914.0 1.0.0 @openrouter/sdk",
} as const;
diff --git a/src/models/deleteinternrequest.ts b/src/models/deleteinternrequest.ts
new file mode 100644
index 000000000..7fdce05c5
--- /dev/null
+++ b/src/models/deleteinternrequest.ts
@@ -0,0 +1,42 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ * @generated-id: 732bd4f781c2
+ */
+
+import * as z from "zod/v4";
+import { remap as remap$ } from "../lib/primitives.js";
+
+/**
+ * Optional consent for a teardown that discards the workspace.
+ */
+export type DeleteInternRequest = {
+ /**
+ * Delete even though the workspace backup was not confirmed. Defaults to false, which refuses the teardown when a workspace archive is missing.
+ */
+ acknowledgeWorkspaceLoss?: boolean | undefined;
+};
+
+/** @internal */
+export type DeleteInternRequest$Outbound = {
+ acknowledge_workspace_loss: boolean;
+};
+
+/** @internal */
+export const DeleteInternRequest$outboundSchema: z.ZodType<
+ DeleteInternRequest$Outbound,
+ DeleteInternRequest
+> = z.object({
+ acknowledgeWorkspaceLoss: z.boolean().default(false),
+}).transform((v) => {
+ return remap$(v, {
+ acknowledgeWorkspaceLoss: "acknowledge_workspace_loss",
+ });
+});
+
+export function deleteInternRequestToJSON(
+ deleteInternRequest: DeleteInternRequest,
+): string {
+ return JSON.stringify(
+ DeleteInternRequest$outboundSchema.parse(deleteInternRequest),
+ );
+}
diff --git a/src/models/index.ts b/src/models/index.ts
index 48042f502..0a26150a9 100644
--- a/src/models/index.ts
+++ b/src/models/index.ts
@@ -214,6 +214,7 @@ export * from "./decisionsscorequestion.js";
export * from "./defaultparameters.js";
export * from "./deletebyokkeyresponse.js";
export * from "./deleteguardrailresponse.js";
+export * from "./deleteinternrequest.js";
export * from "./deleteinternresponse.js";
export * from "./deleteobservabilitydestinationresponse.js";
export * from "./deletescimgroupmappingresponse.js";
diff --git a/src/models/internchatcompletionchunk.ts b/src/models/internchatcompletionchunk.ts
index 7bf25c083..5d214c758 100644
--- a/src/models/internchatcompletionchunk.ts
+++ b/src/models/internchatcompletionchunk.ts
@@ -47,12 +47,12 @@ export type InternChatCompletionChunk = {
*/
id: string;
/**
- * The request `model` when given, or `openrouter/intern`. The final chunk may carry the model the intern reported for the run instead.
+ * 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.
*/
model: string;
object: InternChatCompletionChunkObject;
/**
- * 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.
+ * 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.
*/
sessionId?: string | null | undefined;
/**
diff --git a/src/models/internchatcompletionrequest.ts b/src/models/internchatcompletionrequest.ts
index 9e1397285..13f44684f 100644
--- a/src/models/internchatcompletionrequest.ts
+++ b/src/models/internchatcompletionrequest.ts
@@ -28,15 +28,15 @@ export type InternChatCompletionRequest = {
*/
messages: Array;
/**
- * Accepted for OpenAI compatibility and ignored. Streamed chunks report the model the intern actually used, or `openrouter/intern` when it did not report one.
+ * 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.
*/
model?: string | undefined;
/**
- * 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`.
+ * 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`.
*/
sessionId?: string | undefined;
/**
- * Must be `true`. This endpoint only streams.
+ * Must be `true`. This endpoint only streams. `false` or an omitted `stream` is refused with `400` and reason `bad_request`.
*/
stream: true;
};
diff --git a/src/models/operations/deleteintern.ts b/src/models/operations/deleteintern.ts
index 48f248d91..ff7831b76 100644
--- a/src/models/operations/deleteintern.ts
+++ b/src/models/operations/deleteintern.ts
@@ -5,6 +5,7 @@
import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
+import * as models from "../index.js";
export type DeleteInternGlobals = {
/**
@@ -52,6 +53,7 @@ export type DeleteInternRequest = {
* ID of an intern visible to the authenticated API key.
*/
internId: string;
+ deleteInternRequest: models.DeleteInternRequest;
};
/** @internal */
@@ -60,6 +62,7 @@ export type DeleteInternRequest$Outbound = {
appTitle?: string | undefined;
appCategories?: string | undefined;
internId: string;
+ DeleteInternRequest: models.DeleteInternRequest$Outbound;
};
/** @internal */
@@ -71,9 +74,11 @@ export const DeleteInternRequest$outboundSchema: z.ZodType<
appTitle: z.string().optional(),
appCategories: z.string().optional(),
internId: z.string(),
+ deleteInternRequest: models.DeleteInternRequest$outboundSchema,
}).transform((v) => {
return remap$(v, {
httpReferer: "HTTP-Referer",
+ deleteInternRequest: "DeleteInternRequest",
});
});
diff --git a/src/models/updateinternrequest.ts b/src/models/updateinternrequest.ts
index ad8f74dab..27e0a9c07 100644
--- a/src/models/updateinternrequest.ts
+++ b/src/models/updateinternrequest.ts
@@ -18,7 +18,7 @@ export type UpdateInternRequest = {
*/
instructions?: string | null | undefined;
/**
- * New OpenRouter model slug. Null restores the workspace default.
+ * 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.
*/
model?: string | null | undefined;
/**
diff --git a/src/sdk/interns.ts b/src/sdk/interns.ts
index 3558d4be3..486223a71 100644
--- a/src/sdk/interns.ts
+++ b/src/sdk/interns.ts
@@ -56,7 +56,7 @@ export class Interns extends ClientSDK {
* Delete an intern
*
* @remarks
- * 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.
*/
async deleteIntern(
request: operations.DeleteInternRequest,