From 0aa0ac571d2c214ff079704af748c97f684ab002 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 23 Oct 2026 17:59:53 +0000 Subject: [PATCH 1/3] =?UTF-8?q?##=20Typescript=20SDK=20Changes:=20*=20`ope?= =?UTF-8?q?nrouter.interns.listInterns()`:=20**Removed**=20(Breaking=20?= =?UTF-8?q?=E2=9A=A0=EF=B8=8F)=20*=20`openrouter.interns.createIntern()`:?= =?UTF-8?q?=20**Removed**=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20*=20`openrou?= =?UTF-8?q?ter.interns.deleteIntern()`:=20**Removed**=20(Breaking=20?= =?UTF-8?q?=E2=9A=A0=EF=B8=8F)=20*=20`openrouter.interns.getIntern()`:=20*?= =?UTF-8?q?*Removed**=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20*=20`openrouter.?= =?UTF-8?q?interns.updateIntern()`:=20**Removed**=20(Breaking=20=E2=9A=A0?= =?UTF-8?q?=EF=B8=8F)=20*=20`openrouter.interns.getInternConnections()`:?= =?UTF-8?q?=20**Removed**=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20*=20`openrou?= =?UTF-8?q?ter.interns.getInternDaemon()`:=20**Removed**=20(Breaking=20?= =?UTF-8?q?=E2=9A=A0=EF=B8=8F)=20*=20`openrouter.interns.getInternDaemonAc?= =?UTF-8?q?cess()`:=20**Removed**=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20*=20?= =?UTF-8?q?`openrouter.interns.signInternDaemonAccessRequest()`:=20**Remov?= =?UTF-8?q?ed**=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20*=20`openrouter.intern?= =?UTF-8?q?s.signInternDaemonRequest()`:=20**Removed**=20(Breaking=20?= =?UTF-8?q?=E2=9A=A0=EF=B8=8F)=20*=20`openrouter.interns.getInternIcon()`:?= =?UTF-8?q?=20**Removed**=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20*=20`openrou?= =?UTF-8?q?ter.interns.provisionIntern()`:=20**Removed**=20(Breaking=20?= =?UTF-8?q?=E2=9A=A0=EF=B8=8F)=20*=20`openrouter.interns.suspendIntern()`:?= =?UTF-8?q?=20**Removed**=20(Breaking=20=E2=9A=A0=EF=B8=8F)=20*=20`openrou?= =?UTF-8?q?ter.interns.invoke()`:=20**Removed**=20(Breaking=20=E2=9A=A0?= =?UTF-8?q?=EF=B8=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .speakeasy/gen.lock | 755 +- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 18278 +++++++--------- .speakeasy/workflow.lock | 10 +- RELEASES.md | 12 +- docs/models/account.mdx | 25 - docs/models/code.mdx | 18 - docs/models/createinternrequest.mdx | 27 - docs/models/deleteinternrequest.mdx | 21 - docs/models/deleteinternresponse.mdx | 19 - .../models/errors/internchaterrorresponse.mdx | 19 - docs/models/errors/internlifecycleerror.mdx | 19 - docs/models/intern.mdx | 50 - docs/models/internapprovalmode.mdx | 21 - docs/models/internchatassistantmessage.mdx | 23 - docs/models/internchatchoice.mdx | 25 - docs/models/internchatchoicefinishreason.mdx | 21 - docs/models/internchatcompletionchunk.mdx | 38 - .../internchatcompletionchunkobject.mdx | 17 - docs/models/internchatcompletionrequest.mdx | 31 - docs/models/internchatdelta.mdx | 22 - docs/models/internchatdeltarole.mdx | 17 - docs/models/internchatdevelopermessage.mdx | 23 - docs/models/internchatechoedtoolcall.mdx | 27 - .../internchatechoedtoolcallfunction.mdx | 24 - docs/models/internchaterror.mdx | 24 - docs/models/internchaterrormetadata.mdx | 23 - docs/models/internchaterrormetadatareason.mdx | 21 - docs/models/internchatmessage.mdx | 54 - docs/models/internchatmessagecontent.mdx | 26 - docs/models/internchatprompttokensdetails.mdx | 21 - docs/models/internchatsteeredresponse.mdx | 23 - .../internchatsteeredresponsestatus.mdx | 19 - docs/models/internchatstreamerror.mdx | 28 - docs/models/internchatstreamingresponse.mdx | 33 - docs/models/internchatsystemmessage.mdx | 23 - docs/models/internchattextpart.mdx | 23 - docs/models/internchattextparttype.mdx | 17 - docs/models/internchattoolcall.mdx | 31 - docs/models/internchattoolcallfunction.mdx | 24 - .../models/internchattoolcallfunctionname.mdx | 17 - docs/models/internchattoolcalltype.mdx | 17 - docs/models/internchattoolmessage.mdx | 25 - docs/models/internchatusage.mdx | 27 - docs/models/internchatusermessage.mdx | 23 - docs/models/internconnection.mdx | 47 - docs/models/internconnectionlist.mdx | 19 - docs/models/internconnectionscope.mdx | 21 - docs/models/internconnectionstatus.mdx | 21 - docs/models/interndaemonaccess.mdx | 30 - docs/models/interninvokeacceptedresponse.mdx | 23 - .../interninvokeacceptedresponsestatus.mdx | 21 - docs/models/interninvokerequest.mdx | 23 - docs/models/internlifecycleerrorerror.mdx | 22 - docs/models/internlifecycleerrormetadata.mdx | 21 - docs/models/internlistresponse.mdx | 41 - docs/models/internstatus.mdx | 21 - docs/models/kind.mdx | 19 - docs/models/offreason.mdx | 21 - .../createinternchatcompletionglobals.mdx | 19 - .../createinternchatcompletionrequest.mdx | 32 - .../createinternchatcompletionresponse.mdx | 18 - ...eateinternchatcompletionresponseresult.mdx | 17 - .../models/operations/createinternglobals.mdx | 19 - .../models/operations/createinternrequest.mdx | 26 - .../models/operations/deleteinternglobals.mdx | 19 - .../models/operations/deleteinternrequest.mdx | 26 - .../getinternconnectionsglobals.mdx | 19 - .../getinternconnectionsrequest.mdx | 22 - .../getinterndaemonaccessglobals.mdx | 19 - .../getinterndaemonaccessrequest.mdx | 22 - .../operations/getinterndaemonglobals.mdx | 19 - .../operations/getinterndaemonrequest.mdx | 22 - docs/models/operations/getinternglobals.mdx | 19 - .../operations/getinterniconglobals.mdx | 19 - .../operations/getinterniconrequest.mdx | 23 - docs/models/operations/getinternrequest.mdx | 22 - .../models/operations/invokeinternglobals.mdx | 19 - .../models/operations/invokeinternrequest.mdx | 27 - .../operations/invokeinternresponse.mdx | 24 - docs/models/operations/listinternsglobals.mdx | 19 - docs/models/operations/listinternsrequest.mdx | 23 - .../operations/provisioninternglobals.mdx | 19 - .../operations/provisioninternrequest.mdx | 22 - .../signinterndaemonaccessrequestglobals.mdx | 19 - .../signinterndaemonaccessrequestrequest.mdx | 27 - .../signinterndaemonaccessrequestresponse.mdx | 32 - .../signinterndaemonrequestglobals.mdx | 19 - .../signinterndaemonrequestrequest.mdx | 27 - .../signinterndaemonrequestresponse.mdx | 27 - docs/models/operations/status.mdx | 19 - .../operations/suspendinternglobals.mdx | 19 - .../operations/suspendinternrequest.mdx | 22 - .../models/operations/updateinternglobals.mdx | 19 - .../models/operations/updateinternrequest.mdx | 24 - docs/models/progress.mdx | 25 - docs/models/provisioninternresponse.mdx | 19 - docs/models/route.mdx | 23 - docs/models/server.mdx | 25 - docs/models/signinterndaemonrequest.mdx | 21 - docs/models/signinterndaemonrequestmethod.mdx | 19 - docs/models/signinterndaemonresponse.mdx | 27 - docs/models/stateenum.mdx | 19 - docs/models/suspendinternresponse.mdx | 19 - docs/models/updateinternrequest.mdx | 22 - docs/models/viewer.mdx | 21 - docs/sdks/interns/README.mdx | 1314 -- jsr.json | 2 +- package.json | 18 +- src/funcs/internsChat.ts | 295 - src/funcs/internsCreateIntern.ts | 211 - src/funcs/internsDeleteIntern.ts | 212 - src/funcs/internsGetIntern.ts | 206 - src/funcs/internsGetInternConnections.ts | 207 - src/funcs/internsGetInternDaemon.ts | 209 - src/funcs/internsGetInternDaemonAccess.ts | 212 - src/funcs/internsGetInternIcon.ts | 215 - src/funcs/internsInvoke.ts | 225 - src/funcs/internsListInterns.ts | 216 - src/funcs/internsProvisionIntern.ts | 209 - .../internsSignInternDaemonAccessRequest.ts | 221 - src/funcs/internsSignInternDaemonRequest.ts | 215 - src/funcs/internsSuspendIntern.ts | 209 - src/funcs/internsUpdateIntern.ts | 212 - src/lib/config.ts | 4 +- src/models/createinternrequest.ts | 73 - src/models/deleteinternrequest.ts | 42 - src/models/deleteinternresponse.ts | 31 - src/models/errors/index.ts | 2 - src/models/errors/internchaterrorresponse.ts | 62 - src/models/errors/internlifecycleerror.ts | 56 - src/models/index.ts | 40 - src/models/intern.ts | 192 - src/models/internapprovalmode.ts | 26 - src/models/internchatassistantmessage.ts | 58 - src/models/internchatchoice.ts | 76 - src/models/internchatcompletionchunk.ts | 96 - src/models/internchatcompletionrequest.ts | 78 - src/models/internchatdelta.ts | 60 - src/models/internchatdevelopermessage.ts | 45 - src/models/internchatechoedtoolcall.ts | 45 - .../internchatechoedtoolcallfunction.ts | 39 - src/models/internchaterror.ts | 48 - src/models/internchaterrormetadata.ts | 78 - src/models/internchatmessage.ts | 69 - src/models/internchatmessagecontent.ts | 35 - src/models/internchatprompttokensdetails.ts | 39 - src/models/internchatsteeredresponse.ts | 66 - src/models/internchatstreamerror.ts | 48 - src/models/internchatstreamingresponse.ts | 53 - src/models/internchatsystemmessage.ts | 45 - src/models/internchattextpart.ts | 48 - src/models/internchattoolcall.ts | 61 - src/models/internchattoolcallfunction.ts | 52 - src/models/internchattoolmessage.ts | 53 - src/models/internchatusage.ts | 60 - src/models/internchatusermessage.ts | 45 - src/models/internconnection.ts | 227 - src/models/internconnectionlist.ts | 35 - src/models/interndaemonaccess.ts | 60 - src/models/interninvokeacceptedresponse.ts | 69 - src/models/interninvokerequest.ts | 48 - src/models/internlifecycleerror.ts | 77 - src/models/internlistresponse.ts | 51 - src/models/operations/createintern.ts | 92 - .../operations/createinternchatcompletion.ts | 186 - src/models/operations/deleteintern.ts | 91 - src/models/operations/getintern.ts | 86 - src/models/operations/getinternconnections.ts | 88 - src/models/operations/getinterndaemon.ts | 86 - .../operations/getinterndaemonaccess.ts | 88 - src/models/operations/getinternicon.ts | 92 - src/models/operations/index.ts | 15 - src/models/operations/invokeintern.ts | 123 - src/models/operations/listinterns.ts | 124 - src/models/operations/provisionintern.ts | 86 - .../signinterndaemonaccessrequest.ts | 126 - .../operations/signinterndaemonrequest.ts | 125 - src/models/operations/suspendintern.ts | 86 - src/models/operations/updateintern.ts | 91 - src/models/provisioninternresponse.ts | 31 - src/models/signinterndaemonrequest.ts | 89 - src/models/signinterndaemonresponse.ts | 66 - src/models/suspendinternresponse.ts | 31 - src/models/updateinternrequest.ts | 55 - src/sdk/interns.ts | 319 - src/sdk/sdk.ts | 6 - 187 files changed, 7484 insertions(+), 23120 deletions(-) delete mode 100644 docs/models/account.mdx delete mode 100644 docs/models/code.mdx delete mode 100644 docs/models/createinternrequest.mdx delete mode 100644 docs/models/deleteinternrequest.mdx delete mode 100644 docs/models/deleteinternresponse.mdx delete mode 100644 docs/models/errors/internchaterrorresponse.mdx delete mode 100644 docs/models/errors/internlifecycleerror.mdx delete mode 100644 docs/models/intern.mdx delete mode 100644 docs/models/internapprovalmode.mdx delete mode 100644 docs/models/internchatassistantmessage.mdx delete mode 100644 docs/models/internchatchoice.mdx delete mode 100644 docs/models/internchatchoicefinishreason.mdx delete mode 100644 docs/models/internchatcompletionchunk.mdx delete mode 100644 docs/models/internchatcompletionchunkobject.mdx delete mode 100644 docs/models/internchatcompletionrequest.mdx delete mode 100644 docs/models/internchatdelta.mdx delete mode 100644 docs/models/internchatdeltarole.mdx delete mode 100644 docs/models/internchatdevelopermessage.mdx delete mode 100644 docs/models/internchatechoedtoolcall.mdx delete mode 100644 docs/models/internchatechoedtoolcallfunction.mdx delete mode 100644 docs/models/internchaterror.mdx delete mode 100644 docs/models/internchaterrormetadata.mdx delete mode 100644 docs/models/internchaterrormetadatareason.mdx delete mode 100644 docs/models/internchatmessage.mdx delete mode 100644 docs/models/internchatmessagecontent.mdx delete mode 100644 docs/models/internchatprompttokensdetails.mdx delete mode 100644 docs/models/internchatsteeredresponse.mdx delete mode 100644 docs/models/internchatsteeredresponsestatus.mdx delete mode 100644 docs/models/internchatstreamerror.mdx delete mode 100644 docs/models/internchatstreamingresponse.mdx delete mode 100644 docs/models/internchatsystemmessage.mdx delete mode 100644 docs/models/internchattextpart.mdx delete mode 100644 docs/models/internchattextparttype.mdx delete mode 100644 docs/models/internchattoolcall.mdx delete mode 100644 docs/models/internchattoolcallfunction.mdx delete mode 100644 docs/models/internchattoolcallfunctionname.mdx delete mode 100644 docs/models/internchattoolcalltype.mdx delete mode 100644 docs/models/internchattoolmessage.mdx delete mode 100644 docs/models/internchatusage.mdx delete mode 100644 docs/models/internchatusermessage.mdx delete mode 100644 docs/models/internconnection.mdx delete mode 100644 docs/models/internconnectionlist.mdx delete mode 100644 docs/models/internconnectionscope.mdx delete mode 100644 docs/models/internconnectionstatus.mdx delete mode 100644 docs/models/interndaemonaccess.mdx delete mode 100644 docs/models/interninvokeacceptedresponse.mdx delete mode 100644 docs/models/interninvokeacceptedresponsestatus.mdx delete mode 100644 docs/models/interninvokerequest.mdx delete mode 100644 docs/models/internlifecycleerrorerror.mdx delete mode 100644 docs/models/internlifecycleerrormetadata.mdx delete mode 100644 docs/models/internlistresponse.mdx delete mode 100644 docs/models/internstatus.mdx delete mode 100644 docs/models/kind.mdx delete mode 100644 docs/models/offreason.mdx delete mode 100644 docs/models/operations/createinternchatcompletionglobals.mdx delete mode 100644 docs/models/operations/createinternchatcompletionrequest.mdx delete mode 100644 docs/models/operations/createinternchatcompletionresponse.mdx delete mode 100644 docs/models/operations/createinternchatcompletionresponseresult.mdx delete mode 100644 docs/models/operations/createinternglobals.mdx delete mode 100644 docs/models/operations/createinternrequest.mdx delete mode 100644 docs/models/operations/deleteinternglobals.mdx delete mode 100644 docs/models/operations/deleteinternrequest.mdx delete mode 100644 docs/models/operations/getinternconnectionsglobals.mdx delete mode 100644 docs/models/operations/getinternconnectionsrequest.mdx delete mode 100644 docs/models/operations/getinterndaemonaccessglobals.mdx delete mode 100644 docs/models/operations/getinterndaemonaccessrequest.mdx delete mode 100644 docs/models/operations/getinterndaemonglobals.mdx delete mode 100644 docs/models/operations/getinterndaemonrequest.mdx delete mode 100644 docs/models/operations/getinternglobals.mdx delete mode 100644 docs/models/operations/getinterniconglobals.mdx delete mode 100644 docs/models/operations/getinterniconrequest.mdx delete mode 100644 docs/models/operations/getinternrequest.mdx delete mode 100644 docs/models/operations/invokeinternglobals.mdx delete mode 100644 docs/models/operations/invokeinternrequest.mdx delete mode 100644 docs/models/operations/invokeinternresponse.mdx delete mode 100644 docs/models/operations/listinternsglobals.mdx delete mode 100644 docs/models/operations/listinternsrequest.mdx delete mode 100644 docs/models/operations/provisioninternglobals.mdx delete mode 100644 docs/models/operations/provisioninternrequest.mdx delete mode 100644 docs/models/operations/signinterndaemonaccessrequestglobals.mdx delete mode 100644 docs/models/operations/signinterndaemonaccessrequestrequest.mdx delete mode 100644 docs/models/operations/signinterndaemonaccessrequestresponse.mdx delete mode 100644 docs/models/operations/signinterndaemonrequestglobals.mdx delete mode 100644 docs/models/operations/signinterndaemonrequestrequest.mdx delete mode 100644 docs/models/operations/signinterndaemonrequestresponse.mdx delete mode 100644 docs/models/operations/status.mdx delete mode 100644 docs/models/operations/suspendinternglobals.mdx delete mode 100644 docs/models/operations/suspendinternrequest.mdx delete mode 100644 docs/models/operations/updateinternglobals.mdx delete mode 100644 docs/models/operations/updateinternrequest.mdx delete mode 100644 docs/models/progress.mdx delete mode 100644 docs/models/provisioninternresponse.mdx delete mode 100644 docs/models/route.mdx delete mode 100644 docs/models/server.mdx delete mode 100644 docs/models/signinterndaemonrequest.mdx delete mode 100644 docs/models/signinterndaemonrequestmethod.mdx delete mode 100644 docs/models/signinterndaemonresponse.mdx delete mode 100644 docs/models/stateenum.mdx delete mode 100644 docs/models/suspendinternresponse.mdx delete mode 100644 docs/models/updateinternrequest.mdx delete mode 100644 docs/models/viewer.mdx delete mode 100644 docs/sdks/interns/README.mdx delete mode 100644 src/funcs/internsChat.ts delete mode 100644 src/funcs/internsCreateIntern.ts delete mode 100644 src/funcs/internsDeleteIntern.ts delete mode 100644 src/funcs/internsGetIntern.ts delete mode 100644 src/funcs/internsGetInternConnections.ts delete mode 100644 src/funcs/internsGetInternDaemon.ts delete mode 100644 src/funcs/internsGetInternDaemonAccess.ts delete mode 100644 src/funcs/internsGetInternIcon.ts delete mode 100644 src/funcs/internsInvoke.ts delete mode 100644 src/funcs/internsListInterns.ts delete mode 100644 src/funcs/internsProvisionIntern.ts delete mode 100644 src/funcs/internsSignInternDaemonAccessRequest.ts delete mode 100644 src/funcs/internsSignInternDaemonRequest.ts delete mode 100644 src/funcs/internsSuspendIntern.ts delete mode 100644 src/funcs/internsUpdateIntern.ts delete mode 100644 src/models/createinternrequest.ts delete mode 100644 src/models/deleteinternrequest.ts delete mode 100644 src/models/deleteinternresponse.ts delete mode 100644 src/models/errors/internchaterrorresponse.ts delete mode 100644 src/models/errors/internlifecycleerror.ts delete mode 100644 src/models/intern.ts delete mode 100644 src/models/internapprovalmode.ts delete mode 100644 src/models/internchatassistantmessage.ts delete mode 100644 src/models/internchatchoice.ts delete mode 100644 src/models/internchatcompletionchunk.ts delete mode 100644 src/models/internchatcompletionrequest.ts delete mode 100644 src/models/internchatdelta.ts delete mode 100644 src/models/internchatdevelopermessage.ts delete mode 100644 src/models/internchatechoedtoolcall.ts delete mode 100644 src/models/internchatechoedtoolcallfunction.ts delete mode 100644 src/models/internchaterror.ts delete mode 100644 src/models/internchaterrormetadata.ts delete mode 100644 src/models/internchatmessage.ts delete mode 100644 src/models/internchatmessagecontent.ts delete mode 100644 src/models/internchatprompttokensdetails.ts delete mode 100644 src/models/internchatsteeredresponse.ts delete mode 100644 src/models/internchatstreamerror.ts delete mode 100644 src/models/internchatstreamingresponse.ts delete mode 100644 src/models/internchatsystemmessage.ts delete mode 100644 src/models/internchattextpart.ts delete mode 100644 src/models/internchattoolcall.ts delete mode 100644 src/models/internchattoolcallfunction.ts delete mode 100644 src/models/internchattoolmessage.ts delete mode 100644 src/models/internchatusage.ts delete mode 100644 src/models/internchatusermessage.ts delete mode 100644 src/models/internconnection.ts delete mode 100644 src/models/internconnectionlist.ts delete mode 100644 src/models/interndaemonaccess.ts delete mode 100644 src/models/interninvokeacceptedresponse.ts delete mode 100644 src/models/interninvokerequest.ts delete mode 100644 src/models/internlifecycleerror.ts delete mode 100644 src/models/internlistresponse.ts delete mode 100644 src/models/operations/createintern.ts delete mode 100644 src/models/operations/createinternchatcompletion.ts delete mode 100644 src/models/operations/deleteintern.ts delete mode 100644 src/models/operations/getintern.ts delete mode 100644 src/models/operations/getinternconnections.ts delete mode 100644 src/models/operations/getinterndaemon.ts delete mode 100644 src/models/operations/getinterndaemonaccess.ts delete mode 100644 src/models/operations/getinternicon.ts delete mode 100644 src/models/operations/invokeintern.ts delete mode 100644 src/models/operations/listinterns.ts delete mode 100644 src/models/operations/provisionintern.ts delete mode 100644 src/models/operations/signinterndaemonaccessrequest.ts delete mode 100644 src/models/operations/signinterndaemonrequest.ts delete mode 100644 src/models/operations/suspendintern.ts delete mode 100644 src/models/operations/updateintern.ts delete mode 100644 src/models/provisioninternresponse.ts delete mode 100644 src/models/signinterndaemonrequest.ts delete mode 100644 src/models/signinterndaemonresponse.ts delete mode 100644 src/models/suspendinternresponse.ts delete mode 100644 src/models/updateinternrequest.ts delete mode 100644 src/sdk/interns.ts diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 7ac8c62e3..1f7fea263 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: "" id: "" management: - docChecksum: 1748ed5c359604c08107e1a5ff1c6b95 + docChecksum: b115a84a0a3064752bee8d6c5de8ed0e docVersion: 1.0.0 speakeasyVersion: 1.802.0 generationVersion: 2.948.4 - releaseVersion: 1.5.6 - configChecksum: 1736204e944e47f135ef394e9c48885b + releaseVersion: 1.5.7 + configChecksum: 8756d95d94900acf0d093b1b4a2a3c86 repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true persistentEdits: - generation_id: 2f51b6f0-783f-4339-816c-b38f7a7907b9 - pristine_commit_hash: 4f820b759d46461b5b5e64fc17f335f84769d9d4 - pristine_tree_hash: 89de2817909ecca42afe53702380966c7ca8e1ac + generation_id: d89ba09f-14f5-4449-94c1-6d28ec76319b + pristine_commit_hash: 9592038cdfd3c83b8d00a3ae64c0d3dc557f4ba6 + pristine_tree_hash: 85f80cca5f78fba731686d07b7d8b66e92668af5 features: typescript: acceptHeaders: 2.81.2 @@ -93,10 +93,6 @@ trackedFiles: id: a1d342490679 last_write_checksum: sha1:4731d076694e6bacdfb7106f5fc5b7b9ba4ad63e pristine_git_object: 1e8cf49799702d9057078bb8cbb7956c159b1f3e - docs/models/account.mdx: - id: daf7abc046a5 - last_write_checksum: sha1:1a8665d3a48d96d15fd083ff3fe8950a891178fa - pristine_git_object: bdd96871306d7b6186e3f7da69b947bb7a69e598 docs/models/action.md: id: 3b583d6a609e last_write_checksum: sha1:8dc36489801452f14ed738798e511ba6be809f52 @@ -3350,10 +3346,6 @@ trackedFiles: id: 10e4bc577819 last_write_checksum: sha1:3905f0120c9b3fda9fe251eb87ab85805a9f6048 pristine_git_object: 8d9db0e3178b32982ba864470b5c261608968c01 - docs/models/code.mdx: - id: 3d3e4db6d71b - last_write_checksum: sha1:bb2a509c2f61550b5689da5267474dd08bf5ff75 - pristine_git_object: 41203d625299670d9166039c29eada42dc91ec80 docs/models/codeenum.mdx: id: 3f88334cd85d last_write_checksum: sha1:a0e04ddbd50657ea2d85fdb18f2ec1ec4528afe8 @@ -3936,10 +3928,6 @@ trackedFiles: id: 02feded74c63 last_write_checksum: sha1:e184f98d65e02c7d4d48d9f453a6007796845ce2 pristine_git_object: cd9e4575fe20f59ded33db3fbf098e8cabc0eb04 - docs/models/createinternrequest.mdx: - id: f07e26c4263d - last_write_checksum: sha1:ecab65d57dd1eab8bfd6196f7c4ba49cea918c3a - pristine_git_object: b0f4f450e5bd6d9877a6ae6056be413099c106b1 docs/models/createobservabilitydestinationrequest.md: id: 9c73d951c03a last_write_checksum: sha1:468938cf440ce35a379e85ea1374b3e612a63b3d @@ -4340,14 +4328,6 @@ trackedFiles: id: ce7c05e37dcd last_write_checksum: sha1:958f8640379d8db25ee19e1b64a10c6c34aaa60b pristine_git_object: b28d9ac03905bad544cb36bcac98125b1ea0ab61 - docs/models/deleteinternrequest.mdx: - id: 7ec4fedcc86d - last_write_checksum: sha1:5109b46448818d9996864ca1c16ba86d724a131b - pristine_git_object: a33bfd5411bbe3c2ee14fe63c0e88ca3689c1242 - docs/models/deleteinternresponse.mdx: - id: 03edfc138819 - last_write_checksum: sha1:a64c53dba430ad3f481518b4a48c41379e4de45a - pristine_git_object: 50f5d564c856c2103e0502f1798c7fe5d9881038 docs/models/deleteobservabilitydestinationresponse.md: id: 7a89a2b4dedb last_write_checksum: sha1:6f891ee428aaf1667235657ea495dd0a9ab4d442 @@ -4706,14 +4686,6 @@ trackedFiles: id: eae368e33b97 last_write_checksum: sha1:6c57649ccadea5892382ec0e85ccf81d91c780ae pristine_git_object: b31c26381b350d3515a8e669b1b65a866b3a7e86 - docs/models/errors/internchaterrorresponse.mdx: - id: 4a194a124c11 - last_write_checksum: sha1:8c2c522a1adc917b02d4f27502c68aa3064e6846 - pristine_git_object: b3caef5e6681f4763dccba7b395f65f364518d2e - docs/models/errors/internlifecycleerror.mdx: - id: "187091522104" - last_write_checksum: sha1:d97aa679191116b9a02b5468417dc6753888c792 - pristine_git_object: f188156890da74b17181ae4f75ba1c5ac2946609 docs/models/errors/notfound.mdx: id: cd0b9b2a5f76 last_write_checksum: sha1:3952f473e51cd08584eebb7e2140c9cd02d90ff8 @@ -6333,190 +6305,10 @@ trackedFiles: id: ec19fa5cbdd6 last_write_checksum: sha1:fbeb8cf798673d1eeccd8cdff4b594807e78ed19 pristine_git_object: 854097e72fce125f8b234232942c63d4ff4a4667 - docs/models/intern.mdx: - id: ff3a5a658ab7 - last_write_checksum: sha1:63115449ede28fdc22e30e82c3ae2b9447effcf9 - pristine_git_object: 3753affc632fb64a2b26fb143df8c82bb1f042b4 docs/models/internalserverresponseerrordata.mdx: id: 5c1d49dbdff6 last_write_checksum: sha1:0bea2d67970f6ad5cec81c4da2b5e10a11df9e8c pristine_git_object: 1d8b021f54c7fb7360c501bf8da6f160f2fe205c - docs/models/internapprovalmode.mdx: - id: f41657c91b7e - last_write_checksum: sha1:46870b7143fc296425da3469f76ae05beebc9cb8 - pristine_git_object: 06365d097bbcadbd00b292738dff8fd5a1d300ea - docs/models/internchatassistantmessage.mdx: - id: 49248a9505c5 - last_write_checksum: sha1:57c0ed75a9a4bd5c963ed1f6a6530c66d5bcf015 - pristine_git_object: 694655e21d9b4af60d9560c3128d3af0f4963b92 - docs/models/internchatchoice.mdx: - id: 06823c26e5de - last_write_checksum: sha1:99f2ccde4fd0f069fa233638f1602120af13eb4c - pristine_git_object: ddcc9a112a3dc526fdec4c1f040fb28147ff00a3 - docs/models/internchatchoicefinishreason.mdx: - id: 0771fbc4a9ee - last_write_checksum: sha1:3370c50c3a398dc1168215119092547e0061cd98 - pristine_git_object: e0358f51eb85384aaca74dc03ac62b7a9d1a3f99 - docs/models/internchatcompletionchunk.mdx: - id: 0068460f12e3 - last_write_checksum: sha1:2a6be0aadb19266f0550ae097cbd3640ce213b01 - pristine_git_object: 2c45144376332852d1cab37179afaf9d6dabaaf7 - 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:b5f62edce393521b78d4fd16752030e0e43777f6 - pristine_git_object: 6e07749bf3179abf4af2461c800ca2f5f7f19be1 - docs/models/internchatdelta.mdx: - id: 2757d670be40 - last_write_checksum: sha1:7ea40041a29b081664d3787f4c1405b92543e289 - pristine_git_object: 13f0b9544a7e4b2984ef2a06734126bd5bbfbd9e - docs/models/internchatdeltarole.mdx: - id: 587af0449fe0 - last_write_checksum: sha1:ecb65533cc6f7e0248bcf2cc5c7ea289bd16940a - pristine_git_object: 4ec8763d4ca0e051924d97ab99ec7272a5f643e4 - docs/models/internchatdevelopermessage.mdx: - id: a1585266bd25 - last_write_checksum: sha1:ba6a5f951228d4b1e6f0814d85d6de9ad976fd8a - pristine_git_object: ebbca3474bb5dc19514c03f6a6f9556209db446d - docs/models/internchatechoedtoolcall.mdx: - id: 96ab3c6112b5 - last_write_checksum: sha1:c9f46d19ef119ad8b49a2c33a776a41d82059cb4 - pristine_git_object: 5bb17ebd1a49908f47677dc79ba8cfee74ec28c9 - docs/models/internchatechoedtoolcallfunction.mdx: - id: 40c108986ded - last_write_checksum: sha1:365c408caf5f31725cb8ad2687b554e38693dc4d - pristine_git_object: 0c27964f494a5fbb87188d37a434368338f0ea5b - docs/models/internchaterror.mdx: - id: a64f4c0ec047 - last_write_checksum: sha1:cc549fd1c4944f9ab842ee99c051e11173c6cf66 - pristine_git_object: 58572a120f5709c0a3fc28869e2c612c24d960e2 - docs/models/internchaterrormetadata.mdx: - id: 768e549d2f1f - last_write_checksum: sha1:61e06e0be4d47e66d547300b301eb699bb883797 - pristine_git_object: 32da6623942368026bc6050a90f6eb0eaace1b89 - docs/models/internchaterrormetadatareason.mdx: - id: a277cb62fe10 - last_write_checksum: sha1:2bb9ded604a1424dd89f7d6d4816441f4d860cb2 - pristine_git_object: 1fe710eeb4826ce0f79f43e822632ceb448904f9 - docs/models/internchatmessage.mdx: - id: a07fedb39759 - last_write_checksum: sha1:d23307210644b8fa522afd55522cebcacdbd33d5 - pristine_git_object: 580223869fe64c014218af3a35ba8f209aed0343 - docs/models/internchatmessagecontent.mdx: - id: e3fd268e68ce - last_write_checksum: sha1:2602a69bc7319e8bbf2a599ac1b6b6ec6331b9d6 - pristine_git_object: 21b1551c68bf2e1407fed875712204493d272316 - docs/models/internchatprompttokensdetails.mdx: - id: f34438ff103a - last_write_checksum: sha1:af4d84b0a958f55b38906726f0e4324b58a223a2 - pristine_git_object: a2668dc811ec40efcf751e8d144cd80b2c90425a - docs/models/internchatsteeredresponse.mdx: - id: 2d962b0da17d - last_write_checksum: sha1:1fa2e276b86495379bcc3f8319cd3e3877de653d - pristine_git_object: 661ee71f59e6e048a055e1ccdf19072cff507408 - docs/models/internchatsteeredresponsestatus.mdx: - id: b20fb7ad71ff - last_write_checksum: sha1:5e9ee76dafe8e63a641ec078faf2fc9c892c10f4 - pristine_git_object: 132c04aad39fdeb90281b5c1b0f42150615fb9f2 - docs/models/internchatstreamerror.mdx: - id: 6b0f5db985c8 - last_write_checksum: sha1:aa9c28446aaa73bf7cae5dce319bdc310a15e103 - pristine_git_object: 78e2da4b086bb16b3a8fd4bdad41cbf7d578ab0b - docs/models/internchatstreamingresponse.mdx: - id: 1618863d6728 - last_write_checksum: sha1:83389ad971a3778fc205ed4e2cd536cdc803874e - pristine_git_object: 67a8a9cc8c5e0cbc95610d8a2c788bbfdcebdb65 - docs/models/internchatsystemmessage.mdx: - id: b46e9bcdad9e - last_write_checksum: sha1:169d12eaa48aab024b7865ef9df96352521d4182 - pristine_git_object: c967ae36ba2a311b23031b9a5cd19fc0851adb11 - docs/models/internchattextpart.mdx: - id: d9a82b2928da - last_write_checksum: sha1:dc8e0af3b70ca0d4154e35528695e3995b925e6b - pristine_git_object: eacc8ed54dc55cac33ca542fd08b1d56875ffd0e - docs/models/internchattextparttype.mdx: - id: 45a380fa3452 - last_write_checksum: sha1:f8b6303b64b3f527e42b5d873439e7dc4ad01838 - pristine_git_object: b39fee0506cbb2f28200aedc29c63177b02f3fd1 - docs/models/internchattoolcall.mdx: - id: d2eeed1c2f1b - last_write_checksum: sha1:7ee70cb8e2978050eac03f2b8f8df5633e32b167 - pristine_git_object: b8d9d58c89f2a4603aa58d85e2b6f1e959c0bc6b - docs/models/internchattoolcallfunction.mdx: - id: c7b89a181f4d - last_write_checksum: sha1:d8399558bfda8876d1127e5972936e2c7690faca - pristine_git_object: c378c57e131d9694753203a6ab89104014f6d83c - docs/models/internchattoolcallfunctionname.mdx: - id: dd75631db33c - last_write_checksum: sha1:c7f404eab59f7f61cbf21abf1b7965dab5320a22 - pristine_git_object: d143ffebcd5c609ba319f354f88a832493ee7d38 - docs/models/internchattoolcalltype.mdx: - id: dfce91438fbf - last_write_checksum: sha1:2cf09756ffd24e8ee3033071f9737c66784c9677 - pristine_git_object: 9fbd18166be2b992e0466541ad9b3cd7d13c1d54 - docs/models/internchattoolmessage.mdx: - id: 734404b82d93 - last_write_checksum: sha1:3edc71d5018f466470510b501081a89369aeb03d - pristine_git_object: 4b869f29b0b342399086a1ff4ba495f7d9000475 - docs/models/internchatusage.mdx: - id: 371f60c18056 - last_write_checksum: sha1:9881b01311424211746af660ac24e197989ae57a - pristine_git_object: cf6086bdec57d04032aa338172ab31578f576a54 - docs/models/internchatusermessage.mdx: - id: 3a5d92e71b59 - last_write_checksum: sha1:26d2c335c31da60f6188e765e4423d4fa7ace444 - pristine_git_object: 296798c7fef9e6b6671d8b4d90bf7ff8ef56093f - docs/models/internconnection.mdx: - id: 535995b338ec - last_write_checksum: sha1:8e537e4d1f1dbeac0c4ddabd10748c98bfd8f317 - pristine_git_object: a85b08568a17490fb84e51bd866429c3d4d116b2 - docs/models/internconnectionlist.mdx: - id: bccc982d0343 - last_write_checksum: sha1:9219126e305ff483431a5d43891034fb02a40977 - pristine_git_object: 8b96723a993ec5e4937990c1f0d8b778edaabc37 - docs/models/internconnectionscope.mdx: - id: 673ef773cb4a - last_write_checksum: sha1:400e148ae7a92db4d2742addca098f368801e6b2 - pristine_git_object: a0592c4e99c402e827a21f1662ac5e4bd20b12e4 - docs/models/internconnectionstatus.mdx: - id: f45eb5e240d7 - last_write_checksum: sha1:b5fef0cb55acf3b8be4e4e91a10eae188d929797 - pristine_git_object: a966e542a995fa0c065dfe3d15ca7ef598687240 - docs/models/interndaemonaccess.mdx: - id: 6ee5b68e2d7d - last_write_checksum: sha1:0fd286c8fa95660f3d808bec2f34ffb3a0ab67b9 - pristine_git_object: 23af535a3e47a8d79dcf21573587015ec37937de - docs/models/interninvokeacceptedresponse.mdx: - id: 10c7b75df88b - last_write_checksum: sha1:a67b038babad0eb609f8c6fb8d5cd6b6f38cfaa1 - pristine_git_object: 810a165cd2e361eb9be688d00f01e0d64c928c0e - docs/models/interninvokeacceptedresponsestatus.mdx: - id: 1e28c33362ff - last_write_checksum: sha1:5b22c26eab36d5d4cfcac9a331dd258a42d822e6 - pristine_git_object: acefdeb83731684846db89e3f973c1df083a4fea - docs/models/interninvokerequest.mdx: - id: f9e6c8e1a954 - last_write_checksum: sha1:4e7e996caebd1e26515b054148bdae635231f3ab - pristine_git_object: 13a5d14a26ab3d69abd8a2991c12b7e7a9f9a944 - docs/models/internlifecycleerrorerror.mdx: - id: 03984489ae4f - last_write_checksum: sha1:266b725e3ba9fef82c92efb806ebc192decf2831 - pristine_git_object: 91bb8e851177c50ac4f26a0bae8baaa04efa4193 - docs/models/internlifecycleerrormetadata.mdx: - id: cb4a26d2d14a - last_write_checksum: sha1:95bdd5be7514ec3f9e88361588f89a71c017da3e - pristine_git_object: 329e74559485d33d2f57dd1aae67fe2f2d00ed9b - docs/models/internlistresponse.mdx: - id: 5c9b286a062d - last_write_checksum: sha1:36770f0db322a7ba925c9abe297f6da7804fc357 - pristine_git_object: 63ef2891bc67d9bc98817fbd8953b8e96b683d5a - docs/models/internstatus.mdx: - id: 5fc34cb78035 - last_write_checksum: sha1:af6c4198a4fd4cacc699b7a4096cc7ca2752d070 - pristine_git_object: 152f9c58332b425da04cdbb1305a6f5e2854b8ec docs/models/issuedtokentype.mdx: id: 5c03c432ed60 last_write_checksum: sha1:67a5fd7cfde9715b4abac1f9423404379dc89454 @@ -6604,10 +6396,6 @@ trackedFiles: id: d3054d47278f last_write_checksum: sha1:457cf8eed83aa4fe8200c331f5af31f2bab7c5ea pristine_git_object: da5a05722adda894ef53e9042d5439e1b949c396 - docs/models/kind.mdx: - id: a2095714c5dd - last_write_checksum: sha1:1ecc0a2a63fb7d8634207be0c21babe69e12edf0 - pristine_git_object: cdf40b04efeb9cfcef5a618e7f812c9b97657d32 docs/models/kty.mdx: id: a92560a991a7 last_write_checksum: sha1:5b7e0fa21fa41e1bd8306b16d7c35030a31517a4 @@ -7869,10 +7657,6 @@ trackedFiles: id: 23adcd68acb1 last_write_checksum: sha1:82d2d57b47da2aec5761f07dbc37ef665dc8f626 pristine_git_object: 87262cb46e18e08cee6c9925d2e8580569be7e67 - docs/models/offreason.mdx: - id: 8a6d2eea3197 - last_write_checksum: sha1:9d4d480e362d47dc99356edf0d62e31866405d59 - pristine_git_object: 08e766bdae4732aaa4433cc45e1ec9cbe6bde0ee docs/models/onerror.mdx: id: "400687160660" last_write_checksum: sha1:8f9276feb35b605e006f94f01647a0d0745090f3 @@ -8654,30 +8438,6 @@ trackedFiles: id: 0846421a24fc last_write_checksum: sha1:ad6dcba414d2a7b090036970cf6bc32ba7f0378a pristine_git_object: 3144f133084e28d95a4ff10765202d6738ee7b12 - docs/models/operations/createinternchatcompletionglobals.mdx: - id: de12f3e5ce22 - last_write_checksum: sha1:0953fea03462b14352fa5c214b43cdaca0addf64 - pristine_git_object: cca17cbb634c1ab11d84719ce855661eaaeae12e - docs/models/operations/createinternchatcompletionrequest.mdx: - id: 4f8dc8d59d98 - last_write_checksum: sha1:ea073ef1d5f065115f331274891d7f8d2f8596f7 - pristine_git_object: f059da5e5ee66d4928b6bff0c842b2ce27a2602e - docs/models/operations/createinternchatcompletionresponse.mdx: - id: 658bd77b0441 - last_write_checksum: sha1:2f4492aff2e8907672aecaba59e7202158933af8 - pristine_git_object: c27e91a48b48fa394859944376a19938065d2c99 - docs/models/operations/createinternchatcompletionresponseresult.mdx: - id: 1ebdfc024b3d - last_write_checksum: sha1:59b2b6ea8785cc37b30403ae4a6410c264d9ef58 - pristine_git_object: 49ea5b618324716defa6e760c54d4b245ee3f75f - docs/models/operations/createinternglobals.mdx: - id: c8ffa9eab0e8 - last_write_checksum: sha1:3e3432c8eb9947e4ab9de6bfcd44e966b2a506c3 - pristine_git_object: e7525fe984a96a4d661e47251dd6d3d20c0e8e17 - docs/models/operations/createinternrequest.mdx: - id: d2745e216be4 - last_write_checksum: sha1:78e83c20f10f2e7243a7122c257927c448875dce - pristine_git_object: 427633d6104c5dc1deb0f7c3c11141f2a53f63fb docs/models/operations/createkeysdata.mdx: id: bfdef9b8abf8 last_write_checksum: sha1:b4bdf28beea507863889f8d2f39cfeac70d2a843 @@ -9004,14 +8764,6 @@ trackedFiles: id: e0a51928fb8e last_write_checksum: sha1:3adfe37249204edaf2c54ab9f02e0ec3c418ccaf pristine_git_object: 3325e7d282c0fc6b164438cc9cc1502c309c3847 - docs/models/operations/deleteinternglobals.mdx: - id: 12c1e3b5f360 - last_write_checksum: sha1:a06c9c6e28e1c062635d80f8c65de1aa277443bb - pristine_git_object: c6149f90a428f6c3240c8e6a2fc4f1be02adcedc - docs/models/operations/deleteinternrequest.mdx: - id: 4e5711c1de17 - last_write_checksum: sha1:b297e64e8449d4a8cb9d96261f9cd686e29885ce - pristine_git_object: 904e1cd4ec8cfff012ca4e970e0635dc4029231a docs/models/operations/deleteinternvaultsecretglobals.mdx: id: 35445e62ab94 last_write_checksum: sha1:13de455060e64e5942cbf256cd5d19b56e88ab75 @@ -9492,46 +9244,6 @@ trackedFiles: id: fafa5172a6b1 last_write_checksum: sha1:da1e5543113246a05378f8c1038b46ff49e94914 pristine_git_object: 9e4835c1de9181f39bf7226d716280a73c7328a9 - docs/models/operations/getinternconnectionsglobals.mdx: - id: 24e43979e433 - last_write_checksum: sha1:5162f11ee8e8e3eca4171560df38a63cb2f68d5d - pristine_git_object: 46facbc834a558e3081d7b44e7d51b823976f416 - docs/models/operations/getinternconnectionsrequest.mdx: - id: 95c4b909f758 - last_write_checksum: sha1:d2df7e9904ce5734d6c8be21d5feacb70e700b1f - pristine_git_object: ceb13818a50ef3c1c35bdf0fb88bdcd4316cd807 - docs/models/operations/getinterndaemonaccessglobals.mdx: - id: dfd45258d17d - last_write_checksum: sha1:3c50b7c39127ce87a311a917bf85a35feeee423c - pristine_git_object: f30f317f8607a7f075ed411f34fb34f2462a6558 - docs/models/operations/getinterndaemonaccessrequest.mdx: - id: 7c557e903580 - last_write_checksum: sha1:f8a592ae026aae7f0e1c80adadf64dd230823254 - pristine_git_object: 7c88c0423648eaf5524786d97d908af58c765308 - docs/models/operations/getinterndaemonglobals.mdx: - id: e22ae1ab795e - last_write_checksum: sha1:d13422b60b4a83977d1bf9feea02ebb4e8d18d88 - pristine_git_object: 19b5b53f9dae7d2be9694d8797da5e7db12faaa5 - docs/models/operations/getinterndaemonrequest.mdx: - id: b7f9c365664a - last_write_checksum: sha1:95c7e6ea9598b1d28e566fda2729be7c6c884d07 - pristine_git_object: 046c55cec57b887c4f96074bf0eca928d078aca3 - docs/models/operations/getinternglobals.mdx: - id: 3168d4c01772 - last_write_checksum: sha1:752335e7872971136ca92f8ae0d0d324eb51e3b1 - pristine_git_object: bb138c80552c32fa5a958438ddfcc9ef88d19586 - docs/models/operations/getinterniconglobals.mdx: - id: b516d43d9278 - last_write_checksum: sha1:9fcd1ed44329de1a2bab854d53d7707fcf710ba7 - pristine_git_object: 1d6d7e4ba40333a4a57594721a0c834c786cb5b7 - docs/models/operations/getinterniconrequest.mdx: - id: ccf03a9fbe3d - last_write_checksum: sha1:c8a122562f6f125d58c329eaee0cecc3d610572a - pristine_git_object: 0eb0626c0080b3e23e88333fefeea6a17fac8511 - docs/models/operations/getinternrequest.mdx: - id: 7b20846959da - last_write_checksum: sha1:cb77cd5853b09c80f66998cfb82f7dbcd7e60758 - pristine_git_object: 7d47f2d9f1ea6780f552bd59d687168654bc459e docs/models/operations/getkeydata.mdx: id: 07cbc34c3179 last_write_checksum: sha1:2fa153080f2bf8fc6f409733e60859ad4850fa8d @@ -9849,18 +9561,6 @@ trackedFiles: id: e1966b690efd last_write_checksum: sha1:75b21f671e2bdeb55b6badd248f27a3d9a3431d6 pristine_git_object: e7222d1f3e732241030df7ab5612b086ab2bda9a - docs/models/operations/invokeinternglobals.mdx: - id: c57a588de5a8 - last_write_checksum: sha1:836643ef049e654f209441da7c45a664a8327265 - pristine_git_object: 292a99d1560f46b111525cf6038c7c64975aed61 - docs/models/operations/invokeinternrequest.mdx: - id: 65b96c7175b1 - last_write_checksum: sha1:0198bdc8eefd3e6d5e84357704981ef4d12e7ba2 - pristine_git_object: 0823a40d0f63fbb294c812caf7a4d9f14eaed2da - docs/models/operations/invokeinternresponse.mdx: - id: f7ebc16e2abe - last_write_checksum: sha1:f3e6a70c35dabe594f58fe600a432c5ec86d0b7b - pristine_git_object: 605b22f4424a33bb95cb954d30c463c5acdee123 docs/models/operations/keepmembers.mdx: id: 591598fdced8 last_write_checksum: sha1:19946e98301ceb2e71252f3ea74798df803c9548 @@ -10117,14 +9817,6 @@ trackedFiles: id: 903c64583cbf last_write_checksum: sha1:ae64a3889e955914f457ab3c0cf3a53cb2cb0397 pristine_git_object: 7f7b31f6837283cf5b0854f444a529aed7b75de9 - docs/models/operations/listinternsglobals.mdx: - id: f62b829b195b - last_write_checksum: sha1:7e333483592ecd7577399568bd65da3af4f1a0d2 - pristine_git_object: 1836f79f7ff979f6d1d95332c67531775cb5c8f4 - docs/models/operations/listinternsrequest.mdx: - id: 74ce63b4e73a - last_write_checksum: sha1:be41dfa7ee5cf480059f039e089a2d347c932df4 - pristine_git_object: 36055078562e3cc2a8faa8a8dd3f835ea2192e0a docs/models/operations/listinternvaultsecretsglobals.mdx: id: d50aa244883c last_write_checksum: sha1:1f562efb826d3d41edfd0421287ef1ea915e5e7c @@ -10584,14 +10276,6 @@ trackedFiles: id: 45f471a16baa last_write_checksum: sha1:9134e36db9b5b15fd83dc48180c262cb62aab7a3 pristine_git_object: 091de988686492648d90d037a776397a50b4d5bc - docs/models/operations/provisioninternglobals.mdx: - id: ba777a02d1a1 - last_write_checksum: sha1:762c1ecc99ddc5eadc6b6cb9b6b0caeaa7cca3fb - pristine_git_object: 0694a703ee85589de4cfb95b4f5b4b60a3cc1976 - docs/models/operations/provisioninternrequest.mdx: - id: 8d55ad201304 - last_write_checksum: sha1:e6370dfc995d4af1e55d5f3ea608ff45708c85b1 - pristine_git_object: 89321c90be68e969d18c2a429f050d5274607f12 docs/models/operations/queryanalyticsdata1.md: id: ecb6e11852f5 last_write_checksum: sha1:d7153b0a35bd6b99a27c2239be0212dc6c749a78 @@ -10702,30 +10386,6 @@ trackedFiles: id: 385bfde59033 last_write_checksum: sha1:d8f8397c56e8e45277e0ff9c8cb2d9aeeed03e46 pristine_git_object: 45407c2ed8c36febd240bda9207a680fa5272df8 - docs/models/operations/signinterndaemonaccessrequestglobals.mdx: - id: 04a2057063b8 - last_write_checksum: sha1:01a606d52bd9653f286684782835cfa4e46b54db - pristine_git_object: ecb784a87c0c86b62699f002520f360f2377afb4 - docs/models/operations/signinterndaemonaccessrequestrequest.mdx: - id: b985e97fc8aa - last_write_checksum: sha1:48d36ae201aefe9370dc70e8d448db06d9f95252 - pristine_git_object: e13d3d72d0178d67596d968c891284515e77febe - docs/models/operations/signinterndaemonaccessrequestresponse.mdx: - id: b4751fbdb9c5 - last_write_checksum: sha1:00e1d544e275e9a83cff3b1a04aeb38feb3ee5e6 - pristine_git_object: e01e47eeff41da8f26f334fc2b923ed1c59254d3 - docs/models/operations/signinterndaemonrequestglobals.mdx: - id: 6a09ebf4afea - last_write_checksum: sha1:99ce43f3296a54bbe18e85f26747f1ed2a63f96a - pristine_git_object: bf40f2e1ae34414bceee600e416c6a7f38634210 - docs/models/operations/signinterndaemonrequestrequest.mdx: - id: b12cefeb6c09 - last_write_checksum: sha1:2582af18ae2be072b0d2e4411a2d7228bf9cf4a9 - pristine_git_object: 0dd8c3b0f95d6b718bd6ffd0f249375148327fc7 - docs/models/operations/signinterndaemonrequestresponse.mdx: - id: d21743f93421 - last_write_checksum: sha1:22a149fa8e291b37c9c1bb7e3c679f2b837e9252 - pristine_git_object: 3f26b79dc373007a21c0aa1fa92ddff1f772498f docs/models/operations/sort.md: id: b1f65a1643be last_write_checksum: sha1:543fe646dc04ed9e97b16b74d80426636b49e57a @@ -10740,10 +10400,6 @@ trackedFiles: id: b2403346c727 last_write_checksum: sha1:a328fe2e552beba0c68b6bee0e31a4a6f19a3f0a pristine_git_object: c5cc7f5e4d2138aad4da8c12a14e2e89ecb89294 - docs/models/operations/status.mdx: - id: 4bfc7a475c6e - last_write_checksum: sha1:53f39d8815642cbb62991e901cb21a2dd5c20822 - pristine_git_object: 0db0567216f715d5aae009262724544564e1d2a7 docs/models/operations/storeinternvaultsecretglobals.mdx: id: efcdc25d6c52 last_write_checksum: sha1:33d87ac416ff02002d06159797f7a413084287d6 @@ -10777,14 +10433,6 @@ trackedFiles: id: b74ddadd8c9d last_write_checksum: sha1:e9532b021dfd21e179173ea570e3c68cda32f1f0 pristine_git_object: 3f1f5e9a5e0503af5a66996c2a65751e65d628ab - docs/models/operations/suspendinternglobals.mdx: - id: 5f40429ebbbc - last_write_checksum: sha1:0500158768f4d7fe8b8f6a3e6c8dc474c9dd70fd - pristine_git_object: 1e5dbf6c0e6703e9f25b345e434660b804f74756 - docs/models/operations/suspendinternrequest.mdx: - id: 5d5559368bbf - last_write_checksum: sha1:be066f9a08dadb3f7e0bebe40be4e8cf86dcff96 - pristine_git_object: 14d81fba42278551563fbb70b63eb8346a3c98ad docs/models/operations/tasktype.md: id: 8c10844969fe last_write_checksum: sha1:5df90e1a08131b66a04f04d1ab325767dea670a9 @@ -10845,14 +10493,6 @@ trackedFiles: id: 28e8a7d06289 last_write_checksum: sha1:7ea4059f0c90b495f9ee6f859d4db7f75dc673fd pristine_git_object: 474f7d51bd7fd7bca5898501803aaf1d627bf29c - docs/models/operations/updateinternglobals.mdx: - id: 461bea34a9cb - last_write_checksum: sha1:90e60bde282972cce7b3311bbd7162dd8ce69893 - pristine_git_object: 2bbf0fac04ea47bda4e40582f48505c728cd452c - docs/models/operations/updateinternrequest.mdx: - id: d7405508da08 - last_write_checksum: sha1:df9c35e921f5b99505ba2871a8b5b503108dd56a - pristine_git_object: c5f41b6814139e9dd9a482bd3815fab6174ea423 docs/models/operations/updatekeysdata.mdx: id: debc5fcf2038 last_write_checksum: sha1:b703db7c7e7882645caf5ad586062f56297dc49c @@ -12525,10 +12165,6 @@ trackedFiles: id: 8b2583827bbb last_write_checksum: sha1:51c05aeccbbb794a0c7e0d393835d6e9aa017354 pristine_git_object: 121016e8eeffafc9a28588b8b85cea518e4d07e1 - docs/models/progress.mdx: - id: e3a7647bc262 - last_write_checksum: sha1:c734de78859891d2771599d217ee04a5366414f8 - pristine_git_object: 3feac8f5aefc38f59e5cc79acaaffefc40162148 docs/models/promptcachebreakpoint.mdx: id: 11efe47f2493 last_write_checksum: sha1:232946047170a73522180a3d55f1f9d0963f68fe @@ -12631,10 +12267,6 @@ trackedFiles: id: c4df542c5f7a last_write_checksum: sha1:bdf0017b7b749aa696dd3ccbc8e94a93942ff5d5 pristine_git_object: e7f4c09c69466a923f4e8b3c87c2ef5e91cb23af - docs/models/provisioninternresponse.mdx: - id: cadaac608ba4 - last_write_checksum: sha1:8352d108744d4d9612b06d3a403fa6e782204e50 - pristine_git_object: 3f04a40298854e89baf1e4faef297c0d4cec60bb docs/models/publicendpoint.mdx: id: 298950f1060d last_write_checksum: sha1:65a03929f7ea0f012f769b2970593a4eddd10f29 @@ -13221,10 +12853,6 @@ trackedFiles: id: 57a1e1258c52 last_write_checksum: sha1:e450a6b8ed4f97c659c067cee5720881936399a2 pristine_git_object: 12eae3b1d19e55f45f8d8215e7d7a599be78316a - docs/models/route.mdx: - id: 805008f47450 - last_write_checksum: sha1:c57f43ff74a91ef3980f225dd7f55dbbb4da5fac - pristine_git_object: db0988ebfe1fe925adc07769ad3fce5e27692961 docs/models/routedservicetier.mdx: id: fd7b0f1d910c last_write_checksum: sha1:eae44306b9b42175b7c85680003ca29fbbb59428 @@ -13328,10 +12956,6 @@ trackedFiles: id: f9005cfa3971 last_write_checksum: sha1:0865a677ca0e9cf42146365d35ff84d6a62f7428 pristine_git_object: 181327323a2486bd04abcde32abd26c4cfc34d81 - docs/models/server.mdx: - id: f28fc91c5fd0 - last_write_checksum: sha1:7d637b872fc814d60a782a6a658690b3a48b2528 - pristine_git_object: ff856f4450da337e051c5f6f1b037efa823d716a docs/models/servertool.mdx: id: c995f518eea9 last_write_checksum: sha1:391bac2fd09ffa4a4c1eabcac3c9619ce57633db @@ -13564,18 +13188,6 @@ trackedFiles: id: 1c0207f982d3 last_write_checksum: sha1:9595b259887cd799d7fd79bf23844b369814db8a pristine_git_object: 60b7ab1d8a1094570e073b81f5e0f010f62a5581 - docs/models/signinterndaemonrequest.mdx: - id: 70c5d897f438 - last_write_checksum: sha1:0e26248066bdf21f998aee1c79a76b3b30b5832a - pristine_git_object: af5de0c4c0e1e25d0367b06d21ff02162fb53623 - docs/models/signinterndaemonrequestmethod.mdx: - id: 0a9f66c6898c - last_write_checksum: sha1:21ebc57e1bdd94c4f382e87e5fababe9f3ce8310 - pristine_git_object: 7d0da39cfb2909713aa35280b824b6193a091e7c - docs/models/signinterndaemonresponse.mdx: - id: cab065c23825 - last_write_checksum: sha1:95c4f84b9680f211bb611bc1896338efbfbae050 - pristine_git_object: dbef638594fd156683d0f5237d709c352a421f86 docs/models/size.md: id: fa13061e86ae last_write_checksum: sha1:18590e6cfd13d671a075480e68beecab874b614c @@ -13699,10 +13311,6 @@ trackedFiles: id: 3a6534018b78 last_write_checksum: sha1:5d80183198ea5921713eb1534c861e1e1000991e pristine_git_object: 2513355092fa0eda3dfca570da8316415eef9fb5 - docs/models/stateenum.mdx: - id: 202b88c87758 - last_write_checksum: sha1:15da9b99ef97b36529ad55fcd7d680832d0ac005 - pristine_git_object: e899a71f83fd1abd342e60199a042749c3a53b57 docs/models/statusfailed.md: id: b058d39c35f8 last_write_checksum: sha1:38cfd2ec09b5665c327c8074c0b385ec7366b252 @@ -14048,10 +13656,6 @@ trackedFiles: id: bcb235938132 last_write_checksum: sha1:8760e16a1c689ef750ba80131ad3cdff3faa0cc8 pristine_git_object: 5fe6e0d75f9dafe993374fe618cc0e3ff8082d23 - docs/models/suspendinternresponse.mdx: - id: cbec0d2e0f79 - last_write_checksum: sha1:21ff6320dcc42bd2de4966ea246723a3cfacdb68 - pristine_git_object: 20c4d4686102cd3002534ad4494349cb1d4fda5b docs/models/switchyardrouterplugin.mdx: id: 58f9fabcbcf9 last_write_checksum: sha1:46f5c565948b7360238ac798a3226518b15cfd48 @@ -14860,10 +14464,6 @@ trackedFiles: id: fb5af9771bf7 last_write_checksum: sha1:bf71020ba11697733200aa076dbec5f68d0e3dcb pristine_git_object: 6796ef5b231fba5ad30534ff68df47fbf9b07266 - docs/models/updateinternrequest.mdx: - id: 5cd3a329314e - last_write_checksum: sha1:54449910021d782662f121fab715c7036a6160bd - pristine_git_object: 9c4ca333eb58c00e85810e22dec9d566096b93d7 docs/models/updateobservabilitydestinationrequest.md: id: 59d595732fad last_write_checksum: sha1:1f630e71590e2b30653789861207cdd7c24b30f9 @@ -15172,10 +14772,6 @@ trackedFiles: id: 7f0f523754d0 last_write_checksum: sha1:d1a74a240c328761c5146e42f3d8b1ce901e7b94 pristine_git_object: 02867f5a01f0940ecfc926c4ad9effac6a74669f - docs/models/viewer.mdx: - id: f7670b556250 - last_write_checksum: sha1:55ee2bf5a64c28de93511fba2b668749cae4e323 - pristine_git_object: 550b13bca8199d380c6c3950814b12a210f560b5 docs/models/watch.mdx: id: de77819821b3 last_write_checksum: sha1:6363de7a86386c7195d40e2cc4b2b346ac79592d @@ -15585,10 +15181,6 @@ trackedFiles: id: 534a6c102c4f last_write_checksum: sha1:42d70785eb9a157b0d0ebb1bb988661e29642a82 pristine_git_object: 06bc2e2f3be351cad390bfac313aeebbc5c944e1 - docs/sdks/interns/README.mdx: - id: 2f8a053ffe78 - last_write_checksum: sha1:fc0cd9ad6e338777799fa261383b2f548232f279 - pristine_git_object: c37de706c6a0b676fc704bc43e365564753df38f docs/sdks/models/README.mdx: id: 58f1ca464e0b last_write_checksum: sha1:bc2501bc56802273c0ea9965fd4d32fbaa828178 @@ -15723,12 +15315,12 @@ trackedFiles: pristine_git_object: 410efafd6a7f50d91ccb87131fedbe0c3d47e15a jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:cd9f2ea84b06f4ffbeeea7fc02e76a4e46e8a192 - pristine_git_object: 2116016c1338bfe240744a158f1b80f47965329e + last_write_checksum: sha1:55c934a23ae4e6c335951a9d6506b6c0a36b4a92 + pristine_git_object: 3de1ffd9b175b6513bac5a68802b880eb7daac01 package.json: id: 7030d0b2f71b - last_write_checksum: sha1:3f634f0bdbcfaac6f92a78107b39429ab7351354 - pristine_git_object: 71ec115453b94783cff81b17ec8033c5eade7030 + last_write_checksum: sha1:5e6f0ffeb964ddf5b964c28c06942a5e34346dd5 + pristine_git_object: f9b683bbad0b6d8f5ac8fa9747e99c4c68a00c6a src/core.ts: id: f431fdbcd144 last_write_checksum: sha1:5aa66b0b6a5964f3eea7f3098c2eb3c0ee9c0131 @@ -15985,66 +15577,6 @@ trackedFiles: id: fa32f43b49ee last_write_checksum: sha1:b3b6e136ba645588529d264edac7a95736bd3543 pristine_git_object: 7cae27395a6f842cde95565a869b1ba8567b38fd - src/funcs/internsChat.ts: - id: 36149dc7ea8d - last_write_checksum: sha1:43c6c23c68fd1e66ac64f331fd971076f6e46934 - pristine_git_object: b73e7606a33f6e568e0e0f0f6edc6a2cf683b295 - src/funcs/internsCreateIntern.ts: - id: 74ff6cd8e4b0 - last_write_checksum: sha1:e14cdb0c5c98f918f869b55aa8182f2179bb048b - pristine_git_object: 7bf7c9123f51cf2d488d3c3f2a7fa9385344982c - src/funcs/internsDeleteIntern.ts: - id: 7eb35f20da18 - last_write_checksum: sha1:59305c57df6deee411feed4b59260afd87347394 - pristine_git_object: 76ca8ecadfc9d0f0b6c0ac0645802bf24106b3f1 - src/funcs/internsGetIntern.ts: - id: 484b04c35876 - last_write_checksum: sha1:eb25ad753db871626ce9e204fe72c18dc6263ab0 - pristine_git_object: c63d853cce364f3ca7fe036e521b95b66062d667 - src/funcs/internsGetInternConnections.ts: - id: 5be250841af7 - last_write_checksum: sha1:f75b44d90ae2cb08467b1ab9a03059467ce02e45 - pristine_git_object: cb1a24b92e449d89c7e85e85881397167034bbcd - src/funcs/internsGetInternDaemon.ts: - id: 727cbeff5468 - last_write_checksum: sha1:f63dce846ff702abcae550694d9a00b595cc113b - pristine_git_object: f51a70bb3ad7ebe44ae9fa78122687121778f3ee - src/funcs/internsGetInternDaemonAccess.ts: - id: 464f7f69e2f0 - last_write_checksum: sha1:7c1abbc5d3d112b11e8e744dc8b91e18a82018b5 - pristine_git_object: 7d1a84bfbf78854398ec7fb9ef868a984551f6fd - src/funcs/internsGetInternIcon.ts: - id: df9f8b537f86 - last_write_checksum: sha1:3a91b32b1f35b6627b18e1d10f244602fa556140 - pristine_git_object: 5e38e57be1ef5132d92ca937a42163bb31d5cb53 - src/funcs/internsInvoke.ts: - id: d0be40cd89cf - last_write_checksum: sha1:e7e5db94633812351a50eca92befa7aa032e49a7 - pristine_git_object: 60325197f9d904257d8a5cfb86c1ebd1a10586d1 - src/funcs/internsListInterns.ts: - id: eceaf7dad653 - last_write_checksum: sha1:4765be7bd7c69b5b1458abef7180ac280d883a96 - pristine_git_object: 0e97597846738288bdf287cdaf8dec78bad7f60a - src/funcs/internsProvisionIntern.ts: - id: 38001699f102 - last_write_checksum: sha1:eea2e3e2024851c619d6ae2e5b1b8d265f7b94e3 - pristine_git_object: 84f3dddbf8bb57856bf9297f7e2f26e5d8a04ed9 - src/funcs/internsSignInternDaemonAccessRequest.ts: - id: 89cb6ec2c0e2 - last_write_checksum: sha1:b0544fe3744fe2398c518b424c061ac4c857440e - pristine_git_object: b34e219d637a77ba7a9179c8685b6427b54f7644 - src/funcs/internsSignInternDaemonRequest.ts: - id: 597f99f3800d - last_write_checksum: sha1:a34e96cfd9c1fd8e078c70f32a5eba10a36d3ae3 - pristine_git_object: 00c9ff5e2c2e1dfd1098bb3530150f1711b42921 - src/funcs/internsSuspendIntern.ts: - id: 5928ef254c09 - last_write_checksum: sha1:cda18c1920e1538e7313ff1ec2e8f907618bf81a - pristine_git_object: 5c20a90b19ec1815bea71d28471b540378caac90 - src/funcs/internsUpdateIntern.ts: - id: 1d493469e489 - last_write_checksum: sha1:3d31621ac5975fa26fd6671b77cb8dc1a21c744a - pristine_git_object: 8f5a82f87ec4ff137716429fc0ee1364e2abc80c src/funcs/modelsCount.ts: id: 371adfc67b48 last_write_checksum: sha1:b5207eb21e0d08e0f1384059f5507fdb2eb16fe0 @@ -16367,8 +15899,8 @@ trackedFiles: pristine_git_object: a187e58707bdb726ca2aff74941efe7493422d4e src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:b6cf3b582947113387ba46372917df843a707a64 - pristine_git_object: 7df4c10d2ebc548c3a7fbb6f5ed5805d2ce7f5ae + last_write_checksum: sha1:92c4db15b22b3efc808109c2655ff153f255799e + pristine_git_object: e6763e121f709b0ddd101420fd7d1e0f45c101bb src/lib/dlv.ts: id: b1988214835a last_write_checksum: sha1:eaac763b22717206a6199104e0403ed17a4e2711 @@ -17523,10 +17055,6 @@ trackedFiles: id: f0b6f29656b5 last_write_checksum: sha1:f97971ea73141b6983b75e600b0df08df5511d0f pristine_git_object: 2329ce81235843e4ec07d364e5967c5d9ace6a37 - src/models/createinternrequest.ts: - id: 98307ca98901 - last_write_checksum: sha1:844ce1e0492ea494b7403439edbfe1941537145a - pristine_git_object: 0864d6eea47b573a0b1056277cde7f93d29f1169 src/models/createobservabilitydestinationrequest.ts: id: 6e5b38b96555 last_write_checksum: sha1:1fdb6e29bfa393de6708cbb4425e9683e94cbfef @@ -17675,14 +17203,6 @@ 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 - pristine_git_object: cd0778fef706ff66235dab4ec9a410cdb4206ed1 src/models/deleteobservabilitydestinationresponse.ts: id: 86995b7dad27 last_write_checksum: sha1:48f68140327741024cf0185005993a461d0412a9 @@ -17785,20 +17305,12 @@ trackedFiles: pristine_git_object: 53bb3cfae157b89fda8e4a5b0f1dd709da82c1c9 src/models/errors/index.ts: id: c4e22507cb83 - last_write_checksum: sha1:98811aa70d3f78207b6181d829f1c71b7abb0715 - pristine_git_object: 813b620053dc91fe10bb54b20c30fb406ec3283f + last_write_checksum: sha1:a118505307e3478928be476aa8b5c1594ddf815a + pristine_git_object: 124e82e07798b22f7e7e8f6a1a61409f8ce24032 src/models/errors/internalserverresponseerror.ts: id: 02b76cec85f0 last_write_checksum: sha1:18ef8306c531d997e7f560018498aeccddd0bbee pristine_git_object: 049287eefe992b9edf21588f15a1877cbc2b77b9 - src/models/errors/internchaterrorresponse.ts: - id: bb73eae2fe73 - last_write_checksum: sha1:1f0bec6afe80ccd9ae504c9c6be5bc9dae5e3991 - pristine_git_object: 425d34bc5650d0bb95ac15f15617e9964d05faf4 - src/models/errors/internlifecycleerror.ts: - id: 31cfc72977f7 - last_write_checksum: sha1:8d0b8a64fb40695706cb1da261ac2b3a77a0bdb3 - pristine_git_object: 9663624e15dae0763955e58ec14ab8ac550ffc67 src/models/errors/notfoundresponseerror.ts: id: 1914d6d7fbaf last_write_checksum: sha1:5380b287342104d152ccdca19d51b1a9ce6584a3 @@ -18205,8 +17717,8 @@ trackedFiles: pristine_git_object: 7abdfe096d3adff317db6837dc689c69db92e127 src/models/index.ts: id: f93644b0f37e - last_write_checksum: sha1:e50627d9453555de4288b8c64e753de310ec8187 - pristine_git_object: 1bd1e5190213ae077577000160b2367101c0b3b2 + last_write_checksum: sha1:d79f376a13081fdc5e84211c47202b92ea77bdfb + pristine_git_object: abf30572377859667649b06d48bbe1927628ff1f src/models/inputaudio.ts: id: 9bdc14c7565f last_write_checksum: sha1:2f8dc4c1d6a9c2927d9eb186e0ecedf7b81838e6 @@ -18247,138 +17759,10 @@ trackedFiles: id: 970f140dadec last_write_checksum: sha1:2ae5a96b5b1b17262191d656b6daebc594966684 pristine_git_object: 339d2ae8ea1481ce2773571d214d8ba0966161be - src/models/intern.ts: - id: 88580bab3ce4 - last_write_checksum: sha1:cafcdfb689ff6d389f862b3dff126c9af6a45fc7 - pristine_git_object: bbe6a1be2f9c1f3632177af10240d207b188e09e src/models/internalserverresponseerrordata.ts: id: 48c17eec376a last_write_checksum: sha1:30c28127e79d166a956d27d9b06e3772f08e9710 pristine_git_object: a912e986de7fc9e2da94549ebe2d0f4a08bbb538 - src/models/internapprovalmode.ts: - id: cccfde70a06c - last_write_checksum: sha1:1ae77c7bee21678a986e57e05dcf390e3f4c6ba3 - pristine_git_object: aaa74302f3238be14b6c90ca25d4de492645eaad - src/models/internchatassistantmessage.ts: - id: db891c763d46 - last_write_checksum: sha1:7a9c9a8d6c2d801c0d9cfb616ff1ec7256437e33 - pristine_git_object: b3232079aa2232b57cd35086958ae176f9879d3f - src/models/internchatchoice.ts: - id: f10a43356b30 - last_write_checksum: sha1:0947c50a72bb7fa4263e5a9b7e6d7bbec7e51468 - pristine_git_object: 1bc35fdcdc4e99671287a9b09ef38466200b8498 - src/models/internchatcompletionchunk.ts: - id: 3492df914b61 - last_write_checksum: sha1:0c5514d22a8bcc152dc27add29b6af1e9ce7b2d3 - pristine_git_object: 5d214c7583b5dfeade5a1b7f9e788da4da4fe7ba - src/models/internchatcompletionrequest.ts: - id: 46664fa50bff - last_write_checksum: sha1:c6e8f3b2b2b19d8c03d3086d263827a6b0508149 - pristine_git_object: 13f44684f0bbf3faab32f3dd00e5f6ed4297c8ad - src/models/internchatdelta.ts: - id: c2dc1f33e1df - last_write_checksum: sha1:9469ac68471b3eed4d0cf571ba5c42c79c0fe484 - pristine_git_object: 019fd58ece7304ab20179b715283f56a57bef5a4 - src/models/internchatdevelopermessage.ts: - id: 42bfc57a5f4f - last_write_checksum: sha1:c4c0a155b9c69654e69e8cdbfc0acc35c36593ba - pristine_git_object: a82b6f5b5ad5b030bdd2db0aab49d3e5dbc058b2 - src/models/internchatechoedtoolcall.ts: - id: 28fd4d113f6d - last_write_checksum: sha1:66a6bab382634df694e71444bba7c1979a684f39 - pristine_git_object: b4c22093fb766d2a10a672993ca65b8be0cf78c1 - src/models/internchatechoedtoolcallfunction.ts: - id: 427820de46b3 - last_write_checksum: sha1:949839a9249de2b7425666f36cd3b68ef123e3f0 - pristine_git_object: 39d62888888708ca91226a743a7a583fd3b6efab - src/models/internchaterror.ts: - id: 9bf0417c1e10 - last_write_checksum: sha1:39f0c4bade531e08c85f4a2dd2fa02950b50766f - pristine_git_object: d6060b435c0c598f20072b45fa0481a5d217d43b - src/models/internchaterrormetadata.ts: - id: 3a4e9b3de0d5 - last_write_checksum: sha1:45e727447b86692f22ac1b93a1474308861386ff - pristine_git_object: f1ad7371f55f8ad52f9e812830f0cd44f339b062 - src/models/internchatmessage.ts: - id: b5080dcf9c97 - last_write_checksum: sha1:a490db9666a36cddb5f9837d057de649a4826a1b - pristine_git_object: 8b082491eb0f5ae0c0d83cda2952b2781a9a1339 - src/models/internchatmessagecontent.ts: - id: 98b91b7e9488 - last_write_checksum: sha1:884a02470dab2ceaea4d83b75b2c0e944359c786 - pristine_git_object: c93982ca84125fe29ff6694a8f96e2e3d247ca77 - src/models/internchatprompttokensdetails.ts: - id: f7f08da9ab18 - last_write_checksum: sha1:01adb2f9cc19f38bf3d8cc296e95d136b917b9f8 - pristine_git_object: 652657a8bf6da9361c8658d7af90ebc99fb97fda - src/models/internchatsteeredresponse.ts: - id: 81a2168a45b8 - last_write_checksum: sha1:9dbeedda0cc9c1c1cc56ed92344910049a2e532c - pristine_git_object: 5ec3ba4fb767050f62764a094a81e2ac25a9e7e0 - src/models/internchatstreamerror.ts: - id: c9734c01b14b - last_write_checksum: sha1:710411fa245bc6b44228ee79bd37f490b40a00f9 - pristine_git_object: 905651fddc69402ae11664b6434c70759278fdad - src/models/internchatstreamingresponse.ts: - id: c322164c222e - last_write_checksum: sha1:335c1f641332bdb1641becc744df1ea5f9b49d6a - pristine_git_object: 0bfd2ef3448951af705df1510c38042fc44f4c9b - src/models/internchatsystemmessage.ts: - id: 4d16d7aadf85 - last_write_checksum: sha1:d13a4e6f8d546eb8965838056992d259a7994ec9 - pristine_git_object: b71e177d1e7df84a0ab60625c076c542fb76ec60 - src/models/internchattextpart.ts: - id: f2832e16aec8 - last_write_checksum: sha1:00d6b2525be6de10a13febe5621d2458067d42a7 - pristine_git_object: ae8759f4b7dce54a862106f7e8c290cbc25d2f77 - src/models/internchattoolcall.ts: - id: ab9593cbcfd4 - last_write_checksum: sha1:ed6bf06f5c1ecd3582cc1202e949e38f4d3b90ba - pristine_git_object: 5eada8ec574a33fde7e22dcabcd7ff0828396be9 - src/models/internchattoolcallfunction.ts: - id: 5a9b88a1d80e - last_write_checksum: sha1:f53585e62c063fddc8c04e4c120bbacf7469429f - pristine_git_object: 5f2b0fd1416562e5507e2069e5cded1eac537f28 - src/models/internchattoolmessage.ts: - id: 8ef92162c037 - last_write_checksum: sha1:fff2f4817e1fa4545d09e177af2e6dd79f12bc79 - pristine_git_object: 4b51774fa76308fef4bb9ab1630da3a0bd4a3e76 - src/models/internchatusage.ts: - id: 49d346597315 - last_write_checksum: sha1:3773875213d03dfd636644dc8091a7f8c732a4eb - pristine_git_object: d9b2166769011e6f7dd7f6bea98af856bcd6a369 - src/models/internchatusermessage.ts: - id: 6d3909ea9433 - last_write_checksum: sha1:9a8118f0a654181dbd8dd1f1e798a50ace167520 - pristine_git_object: ae6f841af0a49f34f93eded5da09e1db819b5d2f - src/models/internconnection.ts: - id: c1d0989d7937 - last_write_checksum: sha1:159cd53b1ace6ee8d325519aa37162ecde78b7f3 - pristine_git_object: 06502ef88f644b07309360adae43960c27c1a224 - src/models/internconnectionlist.ts: - id: e3ed2abef547 - last_write_checksum: sha1:53c73d4fb15c320fbad4648e391eb3f96a02188f - pristine_git_object: d6de2cf2c6f1174aa02cfcdae06f0490f725fdc6 - src/models/interndaemonaccess.ts: - id: 3e1c71908a89 - last_write_checksum: sha1:80d31fde6f1837ce88eba741dc8152b86ad12408 - pristine_git_object: 5a8c2fb3a113a310627555ca3e65fb58dafecad3 - src/models/interninvokeacceptedresponse.ts: - id: 4684252ebfd9 - last_write_checksum: sha1:7a648fb23e8bfb9ffccc70155bae637aa272d695 - pristine_git_object: d825f3099aa4c09d0c8bb75948a91a8e100cfb84 - src/models/interninvokerequest.ts: - id: 087aea86ca9d - last_write_checksum: sha1:d469f9e02cd51d5f8263ab1a8a45153af9cc9725 - pristine_git_object: ffbb6be7d210cc403cd9faac1d76c16a70b2ba2d - src/models/internlifecycleerror.ts: - id: 9d7cc6ac0062 - last_write_checksum: sha1:c9a538da773832d841820900d5764b1b37db3e40 - pristine_git_object: a65e488c583cbd95c67dec12dfd13c1fda68021e - src/models/internlistresponse.ts: - id: cd6ace7e64c6 - last_write_checksum: sha1:229306f65504f90f66f349a5322d0ea2cdb2dc37 - pristine_git_object: 0099b312a851681bdbb70647221dfb5bb8908256 src/models/itemreferenceitem.ts: id: ccbe6ae60edc last_write_checksum: sha1:86c6b837d595e08a6593ffad736ca176dd544b49 @@ -18899,14 +18283,6 @@ trackedFiles: id: 0a478467f700 last_write_checksum: sha1:c698b7850c9cb739b1822801f94af20ee22f38bd pristine_git_object: 0a2ca2582247b2b60db1b464933ef5e599e430b8 - src/models/operations/createintern.ts: - id: 49d763cf1338 - last_write_checksum: sha1:7e2d225847ec5613f55df7a179082e44b9d4f303 - pristine_git_object: 1b89a6c6ff342d27af41a842b232931d59dc2446 - src/models/operations/createinternchatcompletion.ts: - id: 0d92e801a635 - last_write_checksum: sha1:f2358b094bceba0239b9fc845969c92f617fa8ca - pristine_git_object: 0a49dec7cdc20ae70b050247b7583ef45aca594b src/models/operations/createkeys.ts: id: e7a250c8b7bb last_write_checksum: sha1:f7d49285254f383428ae9dcf661367aa1a7f6aec @@ -18983,10 +18359,6 @@ trackedFiles: id: 767137f1b80b last_write_checksum: sha1:34eda028509a37d515950793ef314624b9dde507 pristine_git_object: 9f9996b3729c03bc6f64457f2cb9507348519276 - src/models/operations/deleteintern.ts: - id: 3d76bcc84f78 - last_write_checksum: sha1:9d01cc322e0d1c2cc51c61a0d8bad881f27c46c7 - pristine_git_object: ff7831b761ce95c6c1a4e1c7e51eb633d647625f src/models/operations/deleteinternvaultsecret.ts: id: b715772a86c5 last_write_checksum: sha1:8ca5e5f4434cfb297ac245a1563d482d6595ac75 @@ -19087,26 +18459,6 @@ trackedFiles: id: 11c366ebdade last_write_checksum: sha1:10483864cbd03e519b3311ed617a32239f1a4a3e pristine_git_object: 77bda268bebcc372bc07bb0c53ce6e3b7f434850 - src/models/operations/getintern.ts: - id: f7646f94d5c3 - last_write_checksum: sha1:8d293535cb8b5f21012724b6f13f3b0ab1c53561 - pristine_git_object: f468ba5502f118abe986888c04270e5e5c8dfae6 - src/models/operations/getinternconnections.ts: - id: e3ab1398423c - last_write_checksum: sha1:19c8056d8948d62e0dd5ea851f8e02b0020d52cd - pristine_git_object: 593fd0feab7c5cecb994304cf2448c28a05e8a9f - src/models/operations/getinterndaemon.ts: - id: 2f48932593a9 - last_write_checksum: sha1:ee79674c4539119cbe1d4deb627afaf893f1f496 - pristine_git_object: 3d714ef7992dfa4a39bb38b9bf3206ccb80e34bf - src/models/operations/getinterndaemonaccess.ts: - id: 2320374f9c4b - last_write_checksum: sha1:989fdb1240545b0368bba31eb155246a3fc99bbe - pristine_git_object: 3a95dde7c1ffcaeaccc3b29401866221ccd48c2d - src/models/operations/getinternicon.ts: - id: a41b9b092844 - last_write_checksum: sha1:f3245909778c8f6fb0331e7ae043aaada9e133bd - pristine_git_object: ea6d9d103b50bc9bfcc8adc96a57a728cfec94fe src/models/operations/getkey.ts: id: 27d0f86c087f last_write_checksum: sha1:d46bbe27ce08526d6fa8614d7566b6ff46f89337 @@ -19181,12 +18533,8 @@ trackedFiles: pristine_git_object: a052ed42bd123e79be1f05dc823c808f8c32b383 src/models/operations/index.ts: id: 0d9ffaf774d2 - last_write_checksum: sha1:c3f1d0a1b0302929a1c4c22f32087670896b8993 - pristine_git_object: 44039e95403051da0af78e1904c0f3d1f012358e - src/models/operations/invokeintern.ts: - id: f2b19fbd8a96 - last_write_checksum: sha1:55f0d7c3a2020919fbf3e92c2c7524a75a412504 - pristine_git_object: d2d1c887f8636c4c4cd7f3917b47349459774da1 + last_write_checksum: sha1:571ac0ead9729381d47f9aa86d936f13568c46fc + pristine_git_object: d52057092721a447a3b84de3013f1fb4f1397cd3 src/models/operations/list.ts: id: ce11386ad30f last_write_checksum: sha1:538b86fd8e5c673750fc206984ab142a8492bcda @@ -19255,10 +18603,6 @@ trackedFiles: id: 8162d29b4032 last_write_checksum: sha1:9ee1bc688169aa52e40fac2cb5049318d5dc49b3 pristine_git_object: 50bfa2a6310e7534e6d3c848574b71785e0bec4b - src/models/operations/listinterns.ts: - id: 3fe8f2b8da99 - last_write_checksum: sha1:9b698c834a6e3f647f566ea445980e3e28378ebd - pristine_git_object: 688a9eba8222986615678f432546cb1c84880618 src/models/operations/listinternvaultsecrets.ts: id: b36839da75f4 last_write_checksum: sha1:e0fb63ce51a57af12347462eea27ef389e0590cb @@ -19347,10 +18691,6 @@ trackedFiles: id: 83724b6f486c last_write_checksum: sha1:6b9741deb8a583a073b7744e125ef48e7b5e2e06 pristine_git_object: ec58a5137bcc192799ece358f9ef949eb11bb6c3 - src/models/operations/provisionintern.ts: - id: 10202b36a7cd - last_write_checksum: sha1:d2c63146f737a2dc02f781068add93f5977085a3 - pristine_git_object: a8ec859ed24b8b576455abd637a25b5b5337269b src/models/operations/queryanalytics.ts: id: 2b9c6044e362 last_write_checksum: sha1:7cb0a811810f6164517fcc8ebcd3b81bdd840e84 @@ -19359,14 +18699,6 @@ trackedFiles: id: 52a55a780d2d last_write_checksum: sha1:e4b5e0b9cf265e98a00d8fa2f5e528d81b296285 pristine_git_object: 8756ca7b0acb40f5f8f9bfc59375920b74ddcad9 - src/models/operations/signinterndaemonaccessrequest.ts: - id: 5b44549b1bcd - last_write_checksum: sha1:a1923a1bdb496914ebd66794f553224ea4ecc859 - pristine_git_object: 6c69535466203d2f8ee570c9e44753de2c653751 - src/models/operations/signinterndaemonrequest.ts: - id: fa6bfb2ce12b - last_write_checksum: sha1:c5334abb10734f6571cd94bd9d47a0ad57aaab2a - pristine_git_object: 6dda7b3a75480f6b26d8f5428515bffdbd424e4c src/models/operations/storeinternvaultsecret.ts: id: 050b1bb769f1 last_write_checksum: sha1:5fd9780b455f72e335c1eee9bbc811879cbe7247 @@ -19379,10 +18711,6 @@ trackedFiles: id: 0c88d9ca4722 last_write_checksum: sha1:cc6d8c0b2c1174dc05007f6f3a50b6f2442ac182 pristine_git_object: 646fd903439244dc59e478dbb0c58d840b99c253 - src/models/operations/suspendintern.ts: - id: 189ee7e2d8bb - last_write_checksum: sha1:08d4941c90b4b1f07e5c1d7e38062a912d1ba6a0 - pristine_git_object: 61ec3f407335bd397fb064ba36c7657326b0013c src/models/operations/updatebyokkey.ts: id: e302ae3fa539 last_write_checksum: sha1:4c2c2862ec42a9e05af7b0c3e5fe2f6234969b05 @@ -19395,10 +18723,6 @@ trackedFiles: id: f9780f5d66dd last_write_checksum: sha1:db1008af35055ff6679ab053c9b5c375bfb0b303 pristine_git_object: 7c5dc47c0d7062c8dcb77f1dd796479fa2755c6e - src/models/operations/updateintern.ts: - id: fb05d7710bfa - last_write_checksum: sha1:4f89fd5c0c0bb5bce93bf4446ac76b26da01e28a - pristine_git_object: b12bfa75b8812eeb2df57a33cca8d4d2166e27e7 src/models/operations/updatekeys.ts: id: 30a0942aa2b9 last_write_checksum: sha1:642bfe92f9df6c3aae396c06332905b0a07a7eed @@ -19839,10 +19163,6 @@ trackedFiles: id: 1491329aae16 last_write_checksum: sha1:433e970ee4d232d2d9881fda290815ce426e0336 pristine_git_object: fc796682165e0c6c8f0787ee2cb37c79671557f9 - src/models/provisioninternresponse.ts: - id: 43ed2389f509 - last_write_checksum: sha1:7849ce3cfcf8f34690d9fde7c74acf7451ec048c - pristine_git_object: 5960d3c3b97f3571ffdc2f633f503fdfc10ec88d src/models/publicendpoint.ts: id: 396ce3186017 last_write_checksum: sha1:a717573d2b2785923ad4822900917997258797fd @@ -20119,14 +19439,6 @@ trackedFiles: id: 6619f9fcf764 last_write_checksum: sha1:39d981dca38f13e7139b2353c4e59953eaa5745d pristine_git_object: b7e831da0a7045eea3f87f9135d9e68af797df11 - src/models/signinterndaemonrequest.ts: - id: 2a823896a299 - last_write_checksum: sha1:1a3351ad9731237188b77fd03799f7f8a7746f2f - pristine_git_object: 4c962623753a3891c76c6f9400e8f24f686c740b - src/models/signinterndaemonresponse.ts: - id: 255ec3cd7651 - last_write_checksum: sha1:c853175c764863c3546e615ada61eaad003906e0 - pristine_git_object: a1c310beeee21e2181b3fb86b468e704962e72a0 src/models/speechinput.ts: id: 40afc7088e49 last_write_checksum: sha1:0e818ca8e54763074f81d372c0addeb0c1541ed8 @@ -20287,10 +19599,6 @@ trackedFiles: id: 16760a92290d last_write_checksum: sha1:2d3d37aaa12752b49e418d47a37fdbf114ad776c pristine_git_object: d135932c6a9c7eea61dd72a21b9ed95752570432 - src/models/suspendinternresponse.ts: - id: 1a88b3e1ceb1 - last_write_checksum: sha1:583a0da395f5c104d8d387e1c211480ed3c39d39 - pristine_git_object: 59c0163a1041af96c877b4aaa619e9e6607b6809 src/models/switchyardrouterplugin.ts: id: 90395eb02944 last_write_checksum: sha1:3955f6c1ec8c98d30c781fd5edca51298a24eecf @@ -20435,10 +19743,6 @@ trackedFiles: id: a1debd60e96d last_write_checksum: sha1:818ca8d0fdd11a7a768a396708b84b5e171d73c1 pristine_git_object: 62e472e9b880f14ff6a0433cd58068fead471355 - src/models/updateinternrequest.ts: - id: 8e76ee00847f - last_write_checksum: sha1:4678215142798b913cec2ad624f6353e8b151f17 - pristine_git_object: 27e0a9c076a66e8f5970cdf533c4e4b8797ae733 src/models/updateobservabilitydestinationrequest.ts: id: b5f21f0b6b97 last_write_checksum: sha1:c99efae9db379fa1f4e45fd80c5796b3c87bede6 @@ -20735,10 +20039,6 @@ trackedFiles: id: a857902a703f last_write_checksum: sha1:54cdd8319bfbee269b54b8c56988fc0a678f2ec3 pristine_git_object: 5c82fe389f888827f98aa52788b850ef43422e07 - src/sdk/interns.ts: - id: fc3b4e6c5008 - last_write_checksum: sha1:e651b73d5f0445882c6139166713b0d084023720 - pristine_git_object: 623e58df4ca88b6851b8201596eacc84d54d58fd src/sdk/models.ts: id: 8c761ab180fd last_write_checksum: sha1:0c5e5cefb7079fc69eb11ef157af6d2cb5255933 @@ -20781,8 +20081,8 @@ trackedFiles: pristine_git_object: 8e9b4047e476a17451b5feb7e9d4a32eec7f61f8 src/sdk/sdk.ts: id: 784571af2f69 - last_write_checksum: sha1:66caad45bc5f387afb2c1c319e9f680be711ef7a - pristine_git_object: 5f89b6b08723e4d1f2e9d1d156e974c796c647f7 + last_write_checksum: sha1:d96a063a73e9065c8ac2fcb23ba6d140685ad7e1 + pristine_git_object: 4d284c4b3076da08e04b6df3fe6b868fc449c658 src/sdk/stt.ts: id: fd9e88c22d1f last_write_checksum: sha1:59ba5f5c87bc57bf52d0b46b81e194a3099b08fb @@ -25227,4 +24527,17 @@ examples: examplesVersion: 1.0.2 releaseNotes: | ## Typescript SDK Changes: - * `openrouter.generations.getGeneration()`: `error.status[403]` **Added** + * `openrouter.interns.listInterns()`: **Removed** (Breaking ⚠️) + * `openrouter.interns.createIntern()`: **Removed** (Breaking ⚠️) + * `openrouter.interns.deleteIntern()`: **Removed** (Breaking ⚠️) + * `openrouter.interns.getIntern()`: **Removed** (Breaking ⚠️) + * `openrouter.interns.updateIntern()`: **Removed** (Breaking ⚠️) + * `openrouter.interns.getInternConnections()`: **Removed** (Breaking ⚠️) + * `openrouter.interns.getInternDaemon()`: **Removed** (Breaking ⚠️) + * `openrouter.interns.getInternDaemonAccess()`: **Removed** (Breaking ⚠️) + * `openrouter.interns.signInternDaemonAccessRequest()`: **Removed** (Breaking ⚠️) + * `openrouter.interns.signInternDaemonRequest()`: **Removed** (Breaking ⚠️) + * `openrouter.interns.getInternIcon()`: **Removed** (Breaking ⚠️) + * `openrouter.interns.provisionIntern()`: **Removed** (Breaking ⚠️) + * `openrouter.interns.suspendIntern()`: **Removed** (Breaking ⚠️) + * `openrouter.interns.invoke()`: **Removed** (Breaking ⚠️) diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 3517d02f4..5ba68484e 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true typescript: - version: 1.5.6 + version: 1.5.7 acceptHeaderEnum: false additionalDependencies: dependencies: diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index ae7ae4eee..1a081d707 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -8186,6 +8186,7 @@ components: type: 'string' required: - 'error_type' + title: 'ChatStreamChunkMetadata' type: 'object' required: - 'message' @@ -10071,47 +10072,6 @@ components: required: - 'data' type: 'object' - CreateInternRequest: - additionalProperties: false - description: 'Settings for a new intern.' - example: - name: 'research-assistant' - provision: true - workspace_id: '89f9f5b2-3f89-4eaf-83ca-5ceae149e8bb' - properties: - description: - description: 'Free-form description, or null.' - maxLength: 2000 - type: - - 'string' - - 'null' - instructions: - description: 'Standing instructions the intern boots with, or null.' - maxLength: 100000 - type: - - 'string' - - 'null' - name: - description: 'Intern name, unique per creator within the workspace.' - maxLength: 17 - minLength: 2 - pattern: '^[a-z][a-z0-9]*(-[a-z0-9]+)*$' - type: 'string' - provision: - default: false - description: 'Start provisioning during this create operation. Defaults to false.' - type: 'boolean' - vault_id: - description: 'Vault owned by another intern in this workspace to attach as a borrowed vault.' - format: 'uuid' - type: 'string' - workspace_id: - description: 'Workspace that will own the intern. Defaults to the workspace the API key resolves to. When given, it must match the API key workspace.' - format: 'uuid' - type: 'string' - required: - - 'name' - type: 'object' CreateObservabilityDestinationRequest: example: config: @@ -11258,26 +11218,6 @@ 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: - deleting: - const: true - type: 'boolean' - required: - - 'deleting' - type: 'object' DeleteObservabilityDestinationResponse: example: deleted: true @@ -15188,136 +15128,6 @@ components: - 'string' - 'null' x-speakeasy-unknown-values: allow - Intern: - description: 'Public lifecycle state and settings for one intern.' - example: - attached_vault_id: null - can_edit: true - created_at: '2026-09-16T08:30:00.000Z' - created_by_you: true - description: 'Researches customer questions' - hostname: 'research-assistant.openrouter.ai' - icon_sha256: null - id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' - instructions: null - last_failure_message: null - model: 'openai/gpt-5.4' - name: 'research-assistant' - progress: null - status: 'running' - updated_at: '2026-09-16T08:45:00.000Z' - vault_id: 'b431c59d-6eed-41ac-bc89-9a89be79a121' - workspace_id: '89f9f5b2-3f89-4eaf-83ca-5ceae149e8bb' - properties: - attached_vault_id: - description: 'Vault the intern borrows from another intern, or null when it borrows none.' - type: - - 'string' - - 'null' - can_edit: - description: 'Whether this key may change the intern (update, provision, suspend, delete). Present on list and retrieve; false while lifecycle writes are closed for the account.' - type: 'boolean' - created_at: - description: 'ISO 8601 creation time.' - type: 'string' - created_by_you: - description: 'Whether the user behind the key created the intern. Present on list and retrieve; absent for organization keys, which act for no user.' - type: 'boolean' - description: - description: 'Free-form description.' - type: - - 'string' - - 'null' - hostname: - description: 'Public hostname the intern is reachable at, or null until provisioning has assigned one.' - type: - - 'string' - - 'null' - icon_sha256: - description: 'SHA-256 of the intern icon, or null when it has none. Present on list and retrieve; fetch the bytes from `GET /api/v1/interns/{intern_id}/icon`.' - type: - - 'string' - - 'null' - id: - description: 'Intern id.' - type: 'string' - instructions: - description: 'Standing instructions the intern boots with.' - type: - - 'string' - - 'null' - last_failure_message: - description: 'Why the last provisioning attempt failed, when status is failed.' - type: - - 'string' - - 'null' - model: - description: 'OpenRouter model slug the intern runs, or null for the workspace default.' - type: - - 'string' - - 'null' - name: - description: 'Intern name, unique per creator within a workspace.' - type: 'string' - progress: - description: 'Active provisioning step, or null once provisioning has settled.' - properties: - step_label: - description: 'Human-readable label of the active provisioning step.' - type: 'string' - step_number: - description: 'One-based index of the active step.' - type: 'integer' - total_steps: - description: 'Number of provisioning steps.' - type: 'integer' - required: - - 'step_label' - - 'step_number' - - 'total_steps' - type: - - 'object' - - 'null' - status: - description: 'Lifecycle status.' - enum: - - 'awaiting_slack_install' - - 'queued' - - 'provisioning' - - 'running' - - 'failed' - - 'stopped' - - 'destroying' - - 'destroy_failed' - type: 'string' - x-speakeasy-unknown-values: allow - updated_at: - description: 'ISO 8601 last update time.' - type: 'string' - vault_id: - description: 'Vault the intern owns, or null before it has been created.' - type: - - 'string' - - 'null' - workspace_id: - description: 'Workspace that owns the intern and scopes its secrets.' - type: 'string' - required: - - 'id' - - 'name' - - 'description' - - 'instructions' - - 'model' - - 'status' - - 'last_failure_message' - - 'progress' - - 'hostname' - - 'workspace_id' - - 'vault_id' - - 'attached_vault_id' - - 'created_at' - - 'updated_at' - type: 'object' InternalServerResponse: description: 'Internal Server Error - Unexpected server error' example: @@ -15358,891 +15168,1191 @@ components: - 'code' - 'message' type: 'object' - InternApprovalMode: - description: '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.' - enum: - - 'manual' - - 'self-drive' - example: 'manual' - type: 'string' - x-speakeasy-unknown-values: allow - InternChatAssistantMessage: - description: 'An assistant message from an earlier response. When answering an interaction, echo the streamed `tool_calls` here before the `tool` message.' + ItemReferenceItem: + description: 'A reference to a previous response item by ID' example: - content: null - role: 'assistant' - tool_calls: - - function: - arguments: '{"kind":"permission","operation":"shell","options":["allow_once","reject_once"]}' - name: 'openrouter.provide_input' - id: '15e90ad6-5320-4a59-af4f-b371428154fa' + id: 'msg-abc123' + type: 'item_reference' properties: - content: - $ref: '#/components/schemas/InternChatMessageContent' - role: - enum: - - 'assistant' + id: type: 'string' - tool_calls: - items: - $ref: '#/components/schemas/InternChatEchoedToolCall' - type: 'array' - required: - - 'role' - type: 'object' - InternChatChoice: - description: 'The single choice this endpoint streams.' - example: - delta: - content: 'Hello' - finish_reason: null - index: 0 - properties: - delta: - $ref: '#/components/schemas/InternChatDelta' - finish_reason: - description: '`null` while streaming. `stop` when the run completed, `tool_calls` when the run is waiting for the caller to answer the streamed tool call, `error` on the terminal error chunk.' + type: enum: - - 'error' - - 'stop' - - 'tool_calls' - - null - type: - - 'string' - - 'null' - x-speakeasy-unknown-values: allow - index: - type: 'integer' + - 'item_reference' + type: 'string' required: - - 'delta' - - 'finish_reason' - - 'index' + - 'type' + - 'id' type: 'object' - InternChatCompletionChunk: - description: 'One `data:` line of the stream. A run streams a role chunk, content and reasoning chunks, then a finish chunk: `stop`, `tool_calls` (the run is paused for input) or `error` (with an `error` object). A final chunk with empty `choices` follows in every case, carrying `session_id` and `usage` (`null` unless the daemon reported usage, and always `null` after `tool_calls`). Every stream ends with `[DONE]`.' + JevRouterPlugin: + additionalProperties: false example: - choices: - - delta: - content: 'Hello' - finish_reason: null - index: 0 - created: 1789537541 - id: 'chatcmpl-f727571a-3bad-4e0d-8a9e-f18f8cda9750' - model: 'openrouter/intern' - object: 'chat.completion.chunk' + excluded_models: + - 'openai/gpt-6-astra' + id: 'jev-router' + models: + - 'anthropic/*' + - 'openai/gpt-5.6-sol' properties: - choices: - description: 'One choice on content, tool-call and error chunks. Empty on the final chunk that carries `session_id`.' + allowed_models: + description: 'Alias of `models`, matching the auto-router field name. Entries from both fields are combined.' + example: + - 'anthropic/*' items: - $ref: '#/components/schemas/InternChatChoice' + maxLength: 1024 + type: 'string' + maxItems: 1024 type: 'array' - created: - type: 'integer' - error: - $ref: '#/components/schemas/InternChatStreamError' - id: - description: 'The completion id, constant for the whole response.' - example: 'chatcmpl-f727571a-3bad-4e0d-8a9e-f18f8cda9750' - type: 'string' - model: - 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.' + cost_tier: + description: 'Select low, medium, high, or a cost tier configured by the operator. Overrides the live-config tier and replaces the shared routing policy with that tier. Omit to use the live configuration. Model exclusions and the router kill switch still apply.' + example: 'medium' + pattern: '^[a-z][a-z0-9_-]{0,31}$' type: 'string' - object: + excluded_models: + description: 'Remove these models from the router. Each entry is a model slug or a wildcard pattern (e.g. "xiaomi/*"). A `~author/family-latest` alias matches every revision of that family. Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. Applied after `models`, so an excluded pattern always wins over an included one; when the lists leave no model the request can use, it fails with 404 rather than routing outside them.' + example: + - 'openai/gpt-6-astra' + - 'xiaomi/*' + items: + maxLength: 1024 + type: 'string' + maxItems: 1024 + type: 'array' + id: enum: - - 'chat.completion.chunk' + - 'jev-router' 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. Session ids are client-visible and scoped to the intern''s own daemon.' - example: 'ses_7f3c9a' - type: - - 'string' - - 'null' - usage: - $ref: '#/components/schemas/InternChatUsage' + models: + description: 'Restrict the router to these models. Each entry is a model slug or a wildcard pattern (e.g. "anthropic/*"), matched against the current pool; models outside the pool are ignored. A `~author/family-latest` alias matches every revision of that family. Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. When omitted or empty, every model in the pool is a candidate; when no pool model matches, the list is ignored and the whole pool is used (`excluded_models` still apply). `allowed_models` is an alias; entries from both fields are combined.' + example: + - 'anthropic/*' + - 'openai/gpt-5.6-sol' + items: + maxLength: 1024 + type: 'string' + maxItems: 1024 + type: 'array' required: - - 'choices' - - 'created' - 'id' - - 'model' - - 'object' type: 'object' - InternChatCompletionRequest: - description: 'An OpenAI-compatible streaming chat completion request for one intern. Other OpenAI fields such as `temperature` or `tools` are ignored. The intern owns its sampling and its tools.' + KeyAssignment: example: - approval_mode: 'manual' - messages: - - content: 'Summarize the open pull requests.' - role: 'user' - stream: true + assigned_by: 'user_abc123' + created_at: '2025-08-24T10:30:00Z' + guardrail_id: '550e8400-e29b-41d4-a716-446655440001' + id: '550e8400-e29b-41d4-a716-446655440000' + key_hash: 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + key_label: 'prod-key' + key_name: 'Production Key' properties: - approval_mode: - $ref: '#/components/schemas/InternApprovalMode' - messages: - description: '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`.' - items: - $ref: '#/components/schemas/InternChatMessage' - minItems: 1 - type: 'array' - model: - 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 + assigned_by: + description: 'User ID of who made the assignment' + example: 'user_abc123' + type: + - 'string' + - 'null' + created_at: + description: 'ISO 8601 timestamp of when the assignment was created' + example: '2025-08-24T10:30:00Z' 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. 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 + guardrail_id: + description: 'ID of the guardrail' + example: '550e8400-e29b-41d4-a716-446655440001' + format: 'uuid' type: 'string' - stream: - const: true - 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: - - 'messages' - - 'stream' - type: 'object' - InternChatDelta: - description: 'The incremental content of one chunk. The first chunk carries `role`, text chunks carry `content`, reasoning chunks carry `reasoning`, and an interaction chunk carries one complete `tool_calls` entry.' - example: - content: 'Hello' - properties: - content: + id: + description: 'Unique identifier for the assignment' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' type: 'string' - reasoning: + key_hash: + description: 'Hash of the assigned API key' + example: 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' type: 'string' - role: - enum: - - 'assistant' + key_label: + description: 'Label of the API key' + example: 'prod-key' type: 'string' - tool_calls: - items: - $ref: '#/components/schemas/InternChatToolCall' - type: 'array' + key_name: + description: 'Name of the API key' + example: 'Production Key' + type: 'string' + required: + - 'id' + - 'key_hash' + - 'guardrail_id' + - 'key_name' + - 'key_label' + - 'assigned_by' + - 'created_at' type: 'object' - InternChatDeveloperMessage: - description: 'A developer message. Accepted for client compatibility and not forwarded.' + KeyBudget: + description: 'One budget layer that applies to requests made with this key, with the spend enforcement compares against it.' example: - content: 'Answer briefly.' - role: 'developer' + budget_id: null + guardrail_id: '0df9e665-d932-5740-b2c7-b52af166bc11' + include_byok: false + limit_usd: 50 + remaining_usd: 17.5 + reset_interval: 'weekly' + resets_at: '2026-10-12T00:00:00.000Z' + scope: 'member' + spend_usd: 32.5 properties: - content: - $ref: '#/components/schemas/InternChatMessageContent' - role: + budget_id: + description: 'ID of the workspace budget for the `workspace` scope; null for other scopes.' + example: null + type: + - 'string' + - 'null' + guardrail_id: + description: 'ID of the guardrail that carries this budget; null for other scopes.' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' + type: + - 'string' + - 'null' + include_byok: + description: 'Whether external BYOK inference spend counts toward this budget.' + example: false + type: 'boolean' + limit_usd: + description: 'Budget limit in USD for the current window.' + example: 50 + format: 'double' + type: 'number' + remaining_usd: + description: '`limit_usd - spend_usd`. Zero or negative means this layer rejects requests with a 403 until it resets.' + example: 17.5 + format: 'double' + type: 'number' + reset_interval: + description: 'UTC window the spend is counted over (weeks start Monday); null for a lifetime budget that never resets.' enum: - - 'developer' + - 'daily' + - 'weekly' + - 'monthly' + - null + example: 'weekly' + type: + - 'string' + - 'null' + x-speakeasy-unknown-values: allow + resets_at: + description: 'ISO 8601 UTC instant at which the window rolls over and spend returns to zero; null for a lifetime budget.' + example: '2026-10-12T00:00:00.000Z' + format: 'date-time' + type: + - 'string' + - 'null' + scope: + description: 'Which budget layer this is, in the order enforcement checks them: the workspace default guardrail against the member aggregate (`workspace_default_member`) and against this key (`workspace_default_key`), the member guardrail (`member`), the API key guardrail (`api_key`), a workspace budget (`workspace`), or the key''s own limit (`key_limit`).' + enum: + - 'workspace_default_member' + - 'workspace_default_key' + - 'member' + - 'api_key' + - 'workspace' + - 'key_limit' + example: 'member' type: 'string' + x-speakeasy-unknown-values: allow + spend_usd: + description: 'Spend in USD that enforcement counts against this limit in the current window: the member aggregate for member-scoped layers, otherwise this key or workspace.' + example: 32.5 + format: 'double' + type: 'number' required: - - 'content' - - 'role' + - 'scope' + - 'guardrail_id' + - 'budget_id' + - 'limit_usd' + - 'spend_usd' + - 'remaining_usd' + - 'reset_interval' + - 'resets_at' + - 'include_byok' type: 'object' - InternChatEchoedToolCall: - description: 'The `openrouter.provide_input` tool call from the previous response, echoed back unchanged. Its `id` is the interaction the following `tool` message answers.' + Legacy_ChatContentVideo: + deprecated: true + description: 'Video input content part (legacy format - deprecated)' example: - function: - arguments: '{"kind":"permission","operation":"shell","options":["allow_once","reject_once"]}' - name: 'openrouter.provide_input' - id: '15e90ad6-5320-4a59-af4f-b371428154fa' + type: 'input_video' + video_url: + url: 'https://example.com/video.mp4' properties: - function: - $ref: '#/components/schemas/InternChatEchoedToolCallFunction' - id: - maxLength: 128 - minLength: 1 + type: + enum: + - 'input_video' type: 'string' + video_url: + $ref: '#/components/schemas/Legacy_ChatContentVideoInput' required: - - 'function' - - 'id' + - 'type' + - 'video_url' type: 'object' - InternChatEchoedToolCallFunction: - description: 'The function name and JSON arguments string exactly as streamed.' + Legacy_ChatContentVideoInput: + description: 'Video input object' example: - arguments: '{"kind":"permission","operation":"shell","options":["allow_once","reject_once"]}' - name: 'openrouter.provide_input' + url: 'https://example.com/video.mp4' properties: - arguments: + processing: + description: 'Video processing mode. `agentic` enables agentic video processing and `static` forces fixed-rate frame sampling on providers that support it (currently Google Gemini).' + enum: + - 'agentic' + - 'static' + example: 'agentic' type: 'string' - name: + x-speakeasy-unknown-values: allow + url: + description: 'URL of the video (data: URLs supported)' type: 'string' required: - - 'arguments' - - 'name' + - 'url' type: 'object' - InternChatError: - description: 'The OpenAI-compatible error object. `metadata` is present on refusals from the chat route. Authentication refusals (`401`), the departed-creator `403` and the programme `404` carry only `code` and `message`.' + Legacy_WebSearchServerTool: + description: 'Web search tool configuration' example: - code: 409 - message: 'That question is no longer waiting for an answer.' - metadata: - reason: 'interaction_not_pending' - retryable: false + engine: 'auto' + filters: + allowed_domains: + - 'example.com' + type: 'web_search' properties: - code: - description: 'The HTTP status of the response.' + engine: + $ref: '#/components/schemas/WebSearchEngineEnum' + filters: + $ref: '#/components/schemas/WebSearchDomainFilter' + max_results: + description: 'Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped.' + example: 5 type: 'integer' - message: - type: 'string' - metadata: - $ref: '#/components/schemas/InternChatErrorMetadata' - required: - - 'code' - - 'message' - type: 'object' - InternChatErrorMetadata: - description: 'Machine-readable detail for the failure.' - example: - reason: 'interaction_not_pending' - retryable: false - properties: - reason: - description: 'A stable reason a client can branch on.' - enum: - - 'attachment_failed' - - 'bad_request' - - 'busy' - - 'client_closed_request' - - 'interaction_not_pending' - - 'interaction_unknown' - - 'intern_not_ready' - - 'intern_rejected' - - 'intern_unreachable' - - 'not_found' - - 'payload_too_large' - - 'rate_limited' - - 'run_ended' - - 'stream_severed' - - 'timeout' - - 'turn_failed' + max_uses: + description: 'Maximum number of web searches the model may perform in a single request. Once reached, further search calls return an error result instead of executing. Applies to the Exa, Firecrawl, Parallel, and Perplexity engines. With native provider search, forwarded only to Anthropic (as `max_uses`); other native search providers have no equivalent parameter and ignore it.' + example: 3 + type: 'integer' + mode: + $ref: '#/components/schemas/WebSearchMode' + search_context_size: + $ref: '#/components/schemas/SearchContextSizeEnum' + type: + enum: + - 'web_search' type: 'string' - x-speakeasy-unknown-values: allow - retryable: - description: 'Whether the same request may be sent again unchanged. Always `true` for the transient refusals — `busy`, `intern_not_ready`, `intern_unreachable`, `rate_limited`, `stream_severed` and `timeout` — and always `false` for the ones a retry cannot fix. For `turn_failed` it varies by failure and is the intern''s own classification of what went wrong: `true` for an upstream overload, rate limit, timeout or transport fault, `false` for an authentication or bad-request failure that would be rejected the same way again. Branch on this field rather than on `reason` when deciding whether to retry. A `429`, and a `409` or `503` with reason `busy`, also carry a `Retry-After` header saying how long to wait.' - type: 'boolean' + user_location: + $ref: '#/components/schemas/WebSearchUserLocation' + x_search: + $ref: '#/components/schemas/XSearchOptions' required: - - 'reason' - - 'retryable' + - 'type' type: 'object' - InternChatErrorResponse: - description: 'A refusal before the stream opens. Once the response is `200` and streaming, failures arrive as a chunk with `finish_reason: "error"` instead.' + ListBYOKKeysResponse: example: - error: - code: 409 - message: 'That question is no longer waiting for an answer.' - metadata: - reason: 'interaction_not_pending' - retryable: false + data: + - allowed_api_key_hashes: null + allowed_models: null + allowed_user_ids: null + created_at: '2025-08-24T10:30:00Z' + declared_region: null + declared_zdr: null + disabled: false + id: '11111111-2222-3333-4444-555555555555' + is_byok_only: false + is_fallback: false + is_required: false + label: 'sk-...AbCd' + name: 'Production OpenAI Key' + provider: 'openai' + sort_order: 0 + workspace_id: '550e8400-e29b-41d4-a716-446655440000' + total_count: 1 properties: - error: - $ref: '#/components/schemas/InternChatError' - required: - - 'error' - type: 'object' - InternChatMessage: - description: 'One OpenAI-compatible chat message, discriminated by `role`.' - discriminator: - mapping: - assistant: '#/components/schemas/InternChatAssistantMessage' - developer: '#/components/schemas/InternChatDeveloperMessage' - system: '#/components/schemas/InternChatSystemMessage' - tool: '#/components/schemas/InternChatToolMessage' - user: '#/components/schemas/InternChatUserMessage' - propertyName: 'role' - example: - content: 'Summarize the open pull requests.' - role: 'user' - oneOf: - - $ref: '#/components/schemas/InternChatSystemMessage' - - $ref: '#/components/schemas/InternChatDeveloperMessage' - - $ref: '#/components/schemas/InternChatUserMessage' - - $ref: '#/components/schemas/InternChatAssistantMessage' - - $ref: '#/components/schemas/InternChatToolMessage' - InternChatMessageContent: - anyOf: - - type: 'string' - - items: - $ref: '#/components/schemas/InternChatTextPart' + data: + description: 'List of BYOK credentials.' + items: + $ref: '#/components/schemas/BYOKKey' type: 'array' - - type: 'null' - description: 'Message text as a string or a list of text parts. Assistant history may carry null. Only the last message is read; earlier messages are accepted so ordinary clients can resend history.' - example: 'Summarize the open pull requests.' - InternChatPromptTokensDetails: - description: 'Prompt tokens served from cache, when the daemon reported them.' - example: - cached_tokens: 1024 - properties: - cached_tokens: + total_count: + description: 'Total number of BYOK credentials matching the filters.' + example: 1 type: 'integer' required: - - 'cached_tokens' - type: 'object' - InternChatSteeredResponse: - description: 'The message was delivered into the turn already running on the same session. Its effect is streamed on that turn, not here.' - example: - session_id: 'sess_01j9x0k4q7v8r2t3m6n5p8w9y1' - status: 'steered' - properties: - session_id: - description: 'The session of the running turn the message was delivered to.' - example: 'sess_01j9x0k4q7v8r2t3m6n5p8w9y1' - type: 'string' - status: - description: 'The message was handed to the turn already running on this session.' - enum: - - 'steered' - type: 'string' - required: - - 'session_id' - - 'status' + - 'data' + - 'total_count' type: 'object' - InternChatStreamError: - description: '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.' + ListEndpointsResponse: + description: 'List of available endpoints for a model' example: - code: 502 - message: 'The intern could not continue this run.' - metadata: - reason: 'attachment_failed' - retryable: false + architecture: + input_modalities: + - 'text' + instruct_type: 'chatml' + modality: 'text->text' + output_modalities: + - 'text' + tokenizer: 'GPT' + created: 1692901234 + description: 'GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.' + endpoints: + - context_length: 8192 + latency_last_30m: + p50: 0.25 + p75: 0.35 + p90: 0.48 + p99: 0.85 + max_completion_tokens: 4096 + max_prompt_tokens: 8192 + model_id: 'openai/gpt-4' + model_name: 'GPT-4' + name: 'OpenAI: GPT-4' + pricing: + completion: '0.00006' + image: '0' + prompt: '0.00003' + request: '0' + provider_name: 'OpenAI' + quantization: 'fp16' + status: 0 + supported_parameters: + - 'temperature' + - 'top_p' + - 'max_tokens' + - 'frequency_penalty' + - 'presence_penalty' + supports_diarization: false + supports_implicit_caching: true + tag: 'openai' + throughput_last_30m: + p50: 45.2 + p75: 38.5 + p90: 28.3 + p99: 15.1 + uptime_last_1d: 99.8 + uptime_last_30m: 99.5 + uptime_last_5m: 100 + id: 'openai/gpt-4' + name: 'GPT-4' properties: - code: - description: 'The HTTP status this failure would have had before the stream opened.' + architecture: + allOf: + - $ref: '#/components/schemas/ModelArchitecture' + - properties: + input_modalities: + description: 'Supported input modalities' + items: + $ref: '#/components/schemas/InputModality' + type: 'array' + instruct_type: + $ref: '#/components/schemas/InstructType' + modality: + description: 'Primary modality of the model' + example: 'text' + type: + - 'string' + - 'null' + output_modalities: + description: 'Supported output modalities' + items: + $ref: '#/components/schemas/OutputModality' + type: 'array' + tokenizer: + anyOf: + - $ref: '#/components/schemas/ModelGroup' + - type: 'null' + required: + - 'tokenizer' + - 'instruct_type' + - 'modality' + - 'input_modalities' + - 'output_modalities' + created: + description: 'Unix timestamp of when the model was created' + example: 1692901234 type: 'integer' - message: + description: + description: 'Description of the model' + example: 'GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.' + type: 'string' + endpoints: + description: 'List of available endpoints for this model' + items: + $ref: '#/components/schemas/PublicEndpoint' + type: 'array' + id: + description: 'Unique identifier for the model' + example: 'openai/gpt-4' + type: 'string' + name: + description: 'Display name of the model' + example: 'GPT-4' type: 'string' - metadata: - $ref: '#/components/schemas/InternChatErrorMetadata' required: - - 'code' - - 'message' - - 'metadata' + - 'id' + - 'name' + - 'created' + - 'description' + - 'architecture' + - 'endpoints' type: 'object' - InternChatStreamingResponse: - description: 'A server-sent event carrying one chunk. The stream ends with `data: [DONE]`.' + ListExternalUsersResponse: example: data: - choices: - - delta: - tool_calls: - - function: - arguments: '{"fields":[{"name":"answer","options":["red","blue","Other"],"required":true,"type":"string"}],"kind":"elicitation","message":"Which colour do you prefer?"}' - name: 'openrouter.provide_input' - id: '15e90ad6-5320-4a59-af4f-b371428154fa' - index: 0 - type: 'function' - finish_reason: null - index: 0 - created: 1789537541 - id: 'chatcmpl-f727571a-3bad-4e0d-8a9e-f18f8cda9750' - model: 'openrouter/intern' - object: 'chat.completion.chunk' + - created_at: '2026-09-16T12:00:00Z' + is_active: true + updated_at: '2026-09-16T12:00:00Z' + user: 'employee_123' + total_count: 1 properties: data: - $ref: '#/components/schemas/InternChatCompletionChunk' + items: + $ref: '#/components/schemas/ExternalUser' + type: 'array' + total_count: + description: 'Number of registrations matching the filters before pagination.' + example: 1 + type: 'integer' required: - 'data' + - 'total_count' type: 'object' - InternChatSystemMessage: - description: 'A system message. Accepted for client compatibility and not forwarded.' + ListGuardrailsResponse: example: - content: 'You are a helpful assistant.' - role: 'system' + data: + - allowed_models: null + allowed_providers: + - 'openai' + - 'anthropic' + - 'google' + content_filter_builtins: + - action: 'redact' + label: '[EMAIL]' + slug: 'email' + content_filters: null + created_at: '2025-08-24T10:30:00Z' + description: 'Guardrail for production environment' + enable_free_model_publication: false + enable_free_model_training: true + enable_paid_model_training: true + enforce_zdr: null + enforce_zdr_anthropic: true + enforce_zdr_google: false + enforce_zdr_openai: true + enforce_zdr_other: false + enforce_zdr_xai: false + id: '550e8400-e29b-41d4-a716-446655440000' + ignored_models: null + ignored_providers: null + include_byok_in_budgets: false + limit_usd: 100 + name: 'Production Guardrail' + reset_interval: 'monthly' + updated_at: '2025-08-24T15:45:00Z' + workspace_id: '0df9e665-d932-5740-b2c7-b52af166bc11' + total_count: 1 properties: - content: - $ref: '#/components/schemas/InternChatMessageContent' - role: - enum: - - 'system' - type: 'string' + data: + description: 'List of guardrails' + items: + $ref: '#/components/schemas/Guardrail' + type: 'array' + total_count: + description: 'Total number of guardrails' + example: 25 + type: 'integer' required: - - 'content' - - 'role' + - 'data' + - 'total_count' type: 'object' - InternChatTextPart: - description: 'One text part of a message.' + ListKeyAssignmentsResponse: example: - text: 'Summarize the open pull requests.' - type: 'text' + data: + - assigned_by: 'user_abc123' + created_at: '2025-08-24T10:30:00Z' + guardrail_id: '550e8400-e29b-41d4-a716-446655440001' + id: '550e8400-e29b-41d4-a716-446655440000' + key_hash: 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + key_label: 'prod-key' + key_name: 'Production Key' + total_count: 1 properties: - text: - type: 'string' - type: - enum: - - 'text' - type: 'string' + data: + description: 'List of key assignments' + items: + $ref: '#/components/schemas/KeyAssignment' + type: 'array' + total_count: + description: 'Total number of key assignments for this guardrail' + example: 25 + type: 'integer' required: - - 'text' - - 'type' + - 'data' + - 'total_count' type: 'object' - InternChatToolCall: - description: 'An `openrouter.provide_input` request. The run pauses on the daemon until a `tool` message answers it, the caller cancels it, or its interaction deadline passes.' + ListMemberAssignmentsResponse: example: - function: - arguments: '{"fields":[{"name":"answer","options":["red","blue","Other"],"required":true,"type":"string"}],"kind":"elicitation","message":"Which colour do you prefer?"}' - name: 'openrouter.provide_input' - id: '15e90ad6-5320-4a59-af4f-b371428154fa' - index: 0 - type: 'function' + data: + - assigned_by: 'user_abc123' + created_at: '2025-08-24T10:30:00Z' + guardrail_id: '550e8400-e29b-41d4-a716-446655440001' + id: '550e8400-e29b-41d4-a716-446655440000' + organization_id: 'org_xyz789' + user_id: 'user_abc123' + total_count: 1 properties: - function: - $ref: '#/components/schemas/InternChatToolCallFunction' - id: - description: 'The interaction id. Send it back as `tool_call_id` on the `tool` message that answers it.' - example: '15e90ad6-5320-4a59-af4f-b371428154fa' - type: 'string' - index: + data: + description: 'List of member assignments' + items: + $ref: '#/components/schemas/MemberAssignment' + type: 'array' + total_count: + description: 'Total number of member assignments' + example: 10 type: 'integer' - type: - enum: - - 'function' - type: 'string' required: - - 'function' - - 'id' - - 'index' - - 'type' + - 'data' + - 'total_count' type: 'object' - InternChatToolCallFunction: - description: 'The single tool this endpoint calls, asking the caller for input.' + ListObservabilityDestinationsResponse: example: - arguments: '{"fields":[{"name":"answer","options":["red","blue","Other"],"required":true,"type":"string"}],"kind":"elicitation","message":"Which colour do you prefer?"}' - name: 'openrouter.provide_input' + data: + - api_key_hashes: null + broadcast_generation_cost: false + broadcast_generation_cost_allocation: false + broadcast_generation_identity: false + broadcast_generation_request_context: false + config: + baseUrl: 'https://us.cloud.langfuse.com' + publicKey: 'pk-l...EfGh' + secretKey: 'sk-l...AbCd' + created_at: '2025-08-24T10:30:00Z' + enabled: true + filter_rules: null + id: '99999999-aaaa-bbbb-cccc-dddddddddddd' + name: 'Production Langfuse' + privacy_mode: false + regions: + - 'global' + sampling_rate: 1 + type: 'langfuse' + updated_at: '2025-08-24T15:45:00Z' + workspace_id: '550e8400-e29b-41d4-a716-446655440000' + total_count: 1 properties: - arguments: - description: 'A JSON object string describing the interaction. A permission request is `{"kind":"permission","operation":,"options":[]}`. A question is `{"kind":"elicitation","message":,"fields":[]}`.' - example: '{"fields":[{"name":"answer","options":["red","blue","Other"],"required":true,"type":"string"}],"kind":"elicitation","message":"Which colour do you prefer?"}' - type: 'string' - name: - enum: - - 'openrouter.provide_input' - type: 'string' + data: + description: 'List of observability destinations.' + items: + $ref: '#/components/schemas/ObservabilityDestination' + type: 'array' + total_count: + description: 'Total number of destinations matching the filters.' + example: 1 + type: 'integer' required: - - 'arguments' - - 'name' + - 'data' + - 'total_count' type: 'object' - InternChatToolMessage: - description: 'The answer to an `openrouter.provide_input` tool call. `tool_call_id` is the streamed tool call id and `session_id` must name the same session. For a permission, `content` is one of the offered option kinds (`allow_once`, `allow_always`, `reject_once`, `reject_always`) or `cancel`. For a question (elicitation), `content` is a JSON object string with `action` (`accept`, `decline` or `cancel`) and, for `accept`, `content` holding the field values. The answer is delivered to the run that asked. It never starts a new run.' + ListPresetsResponse: + description: 'A paginated list of presets.' example: - content: 'allow_once' - role: 'tool' - tool_call_id: '15e90ad6-5320-4a59-af4f-b371428154fa' + data: + - created_at: '2026-04-20T10:00:00Z' + creator_user_id: 'user_2dHFtVWx2n56w6HkM0000000000' + description: null + designated_version_id: '550e8400-e29b-41d4-a716-446655440000' + id: '650e8400-e29b-41d4-a716-446655440001' + name: 'my-preset' + slug: 'my-preset' + status: 'active' + status_updated_at: null + updated_at: '2026-04-20T10:00:00Z' + workspace_id: '750e8400-e29b-41d4-a716-446655440002' + total_count: 1 properties: - content: - $ref: '#/components/schemas/InternChatMessageContent' - role: - enum: - - 'tool' - type: 'string' - tool_call_id: - maxLength: 128 - minLength: 1 - type: 'string' + data: + items: + $ref: '#/components/schemas/Preset' + type: 'array' + total_count: + type: 'integer' required: - - 'content' - - 'role' - - 'tool_call_id' + - 'data' + - 'total_count' type: 'object' - InternChatUsage: - description: '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.' + ListPresetVersionsResponse: + description: 'A paginated list of preset versions.' example: - completion_tokens: 12 - prompt_tokens: 40 - total_tokens: 52 + data: + - config: + model: 'openai/gpt-4o' + temperature: 0.7 + created_at: '2026-04-20T10:00:00Z' + creator_id: 'user_2dHFtVWx2n56w6HkM0000000000' + id: '550e8400-e29b-41d4-a716-446655440000' + preset_id: '650e8400-e29b-41d4-a716-446655440001' + system_prompt: 'You are a helpful assistant.' + updated_at: '2026-04-20T10:00:00Z' + version: 1 + total_count: 1 properties: - completion_tokens: - type: 'integer' - cost: - description: 'The cost of the run in USD, when the daemon reported one.' - format: 'double' - type: 'number' - prompt_tokens: + data: + items: + $ref: '#/components/schemas/PresetDesignatedVersion' + type: 'array' + total_count: type: 'integer' - prompt_tokens_details: - $ref: '#/components/schemas/InternChatPromptTokensDetails' - total_tokens: + required: + - 'data' + - 'total_count' + type: 'object' + ListPrivateEndpointsResponse: + properties: + data: + items: + $ref: '#/components/schemas/PrivateEndpointSummary' + type: 'array' + required: + - 'data' + type: 'object' + ListScimGroupMappingsResponse: + properties: + data: + items: + $ref: '#/components/schemas/ScimGroupMapping' + type: 'array' + total_count: type: 'integer' required: - - 'completion_tokens' - - 'prompt_tokens' - - 'total_tokens' - type: - - 'object' - - 'null' - InternChatUserMessage: - description: 'A user message. When it is the last message its text is the prompt for a new run, at most 32000 characters.' - example: - content: 'Summarize the open pull requests.' - role: 'user' + - 'data' + - 'total_count' + type: 'object' + ListScimGroupsResponse: properties: - content: - $ref: '#/components/schemas/InternChatMessageContent' - role: - enum: - - 'user' - type: 'string' + data: + items: + $ref: '#/components/schemas/ScimGroup' + type: 'array' + total_count: + type: 'integer' required: - - 'content' - - 'role' + - 'data' + - 'total_count' type: 'object' - InternConnection: + ListToolsResponse: properties: - account: - properties: - acts_as: - description: 'Whose account it acts as, when known.' - type: - - 'string' - - 'null' - is_your_account_linked: - type: - - 'boolean' - - 'null' - note: - type: - - 'string' - - 'null' - scope: - description: '`workspace` for a shared connection, `yours` for the key user''s personal account, `shared` for a teammate''s.' - enum: - - 'workspace' - - 'yours' - - 'shared' - type: 'string' - x-speakeasy-unknown-values: allow - required: - - 'acts_as' - - 'is_your_account_linked' - - 'note' - - 'scope' - type: 'object' - id: - description: 'Stable id: the credential id of an MCP server, else the kind (`slack`, `github`, `google`).' - type: 'string' - is_enabled: - description: 'Whether the intern reaches it now.' - type: 'boolean' - is_intern_only: - description: 'Scoped to this intern rather than shared by the workspace.' - type: 'boolean' - kind: - enum: - - 'slack' - - 'github' - - 'google' - - 'mcp' - type: 'string' - x-speakeasy-unknown-values: allow - mcp_server_name: - description: 'The name the intern''s MCP config keys the server by; null when it is not an MCP server or is off.' - type: - - 'string' - - 'null' - name: - description: 'Display name.' - type: 'string' - off_reason: - description: '`switched_off` for this intern, `disabled` for the whole workspace; null while on.' - enum: - - 'switched_off' - - 'disabled' - - null - type: - - 'string' - - 'null' - x-speakeasy-unknown-values: allow - server: - properties: - host: - type: - - 'string' - - 'null' - surface: - type: 'string' - transport: - type: 'string' - url: - type: - - 'string' - - 'null' - required: - - 'host' - - 'surface' - - 'transport' - - 'url' - type: - - 'object' - - 'null' - status: + data: + items: + $ref: '#/components/schemas/ServerTool' + type: 'array' + links: properties: - reason: + next: + description: 'URL for the next page of results, or null if this is the last page' + example: null type: - 'string' - 'null' - state: - enum: - - 'connected' - - 'needs_reconnect' - - 'not_tested' - - 'error' - type: 'string' - x-speakeasy-unknown-values: allow required: - - 'state' - - 'reason' + - 'next' type: 'object' - tool_count: - description: 'Tools found by the last successful test.' - type: - - 'integer' - - 'null' + total_count: + description: 'Total number of tools' + example: 12 + type: 'integer' required: - - 'id' - - 'kind' - - 'name' - - 'is_enabled' - - 'is_intern_only' - - 'off_reason' - - 'mcp_server_name' - - 'server' - - 'status' - - 'tool_count' - - 'account' + - 'data' + - 'total_count' + - 'links' type: 'object' - InternConnectionList: + ListWorkspaceBudgetsResponse: + example: + data: + - created_at: '2025-08-24T10:30:00Z' + id: '770e8400-e29b-41d4-a716-446655440000' + limit_usd: 100 + reset_interval: 'monthly' + updated_at: '2025-08-24T15:45:00Z' + workspace_id: '550e8400-e29b-41d4-a716-446655440000' + include_byok_in_budgets: false properties: data: + description: 'List of budgets configured for the workspace' items: - $ref: '#/components/schemas/InternConnection' + $ref: '#/components/schemas/WorkspaceBudget' type: 'array' + include_byok_in_budgets: + description: 'Whether BYOK (bring-your-own-key) spend is included when enforcing the workspace''s budgets. This is a workspace-wide setting that applies to all budget intervals (daily, weekly, monthly, and lifetime).' + example: false + type: 'boolean' required: - 'data' type: 'object' - InternDaemonAccess: - description: 'The intern daemon''s origin, the bearer `ori tui --host` sends to it as `ORI_DAEMON_TOKEN`, and who the caller is on the intern.' + ListWorkspaceMembersResponse: example: - origin: 'https://research-assistant-7c9e6679.or.bot' - token: 'daemon_token' - viewer: - principals: - - 'clerk:user_2abc' - - 'slack:T0123:U0456' + data: + - created_at: '2025-08-24T10:30:00Z' + id: '660e8400-e29b-41d4-a716-446655440000' + role: 'member' + user_id: 'user_abc123' + workspace_id: '550e8400-e29b-41d4-a716-446655440000' + total_count: 1 properties: - origin: - pattern: '^https?:\/\/([a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*)(?::(\d{1,5}))?$/iu' - type: 'string' - token: - pattern: '^[\w-]+$/u' - type: 'string' - viewer: - properties: - principals: - description: 'The caller''s Ori principals on this intern: `clerk:`, and, when the grant carries `vault:read`, `slack::` for each Slack account they linked to it. A session started by one of them in a one-to-one Slack DM is the caller''s to see.' - items: - type: 'string' - type: 'array' - required: - - 'principals' - type: 'object' + data: + description: 'List of workspace members' + items: + $ref: '#/components/schemas/WorkspaceMember' + type: 'array' + total_count: + description: 'Total number of members in the workspace' + example: 5 + type: 'integer' required: - - 'origin' - - 'token' - - 'viewer' + - 'data' + - 'total_count' type: 'object' - InternInvokeAcceptedResponse: - description: 'The intern admitted the prompt. The run continues on the intern.' + ListWorkspacesResponse: example: - session_id: 'b51a0e21-368b-4780-a220-14655bf28c55' - status: 'started' + data: + - created_at: '2025-08-24T10:30:00Z' + created_by: 'user_abc123' + default_guardrail_id: '595d5849-7e86-51fd-a7c0-705c34e4afff' + default_image_model: 'openai/dall-e-3' + default_provider_sort: 'price' + default_text_model: 'openai/gpt-4o' + description: 'Production environment workspace' + disabled_server_tools: null + id: '550e8400-e29b-41d4-a716-446655440000' + include_byok_in_budgets: false + io_logging_api_key_ids: null + io_logging_sampling_rate: 1 + is_data_discount_logging_enabled: true + is_observability_broadcast_enabled: false + is_observability_io_logging_enabled: false + name: 'Production' + slug: 'production' + updated_at: '2025-08-24T15:45:00Z' + total_count: 1 properties: - session_id: - description: 'The session the run belongs to. Send it back to continue the conversation.' - example: 'b51a0e21-368b-4780-a220-14655bf28c55' + data: + description: 'List of workspaces' + items: + $ref: '#/components/schemas/Workspace' + type: 'array' + total_count: + description: 'Total number of workspaces' + example: 5 + type: 'integer' + required: + - 'data' + - 'total_count' + type: 'object' + LocalShellCallItem: + description: 'A local shell command execution call' + example: + action: + command: + - 'ls' + - '-la' + env: + PATH: '/usr/bin' + timeout_ms: 5000 + type: 'exec' + call_id: 'call-abc123' + id: 'shell-abc123' + status: 'completed' + type: 'local_shell_call' + properties: + action: + properties: + command: + items: + type: 'string' + type: 'array' + env: + additionalProperties: + type: 'string' + type: 'object' + timeout_ms: + type: + - 'integer' + - 'null' + type: + enum: + - 'exec' + type: 'string' + user: + type: + - 'string' + - 'null' + working_directory: + type: + - 'string' + - 'null' + required: + - 'type' + - 'command' + - 'env' + type: 'object' + call_id: + type: 'string' + id: type: 'string' status: - description: '`started` when a new run began. `steered` when the session already had a run going and the prompt was delivered into it instead.' + $ref: '#/components/schemas/ToolCallStatus' + type: enum: - - 'started' - - 'steered' - example: 'started' + - 'local_shell_call' type: 'string' - x-speakeasy-unknown-values: allow required: - - 'session_id' + - 'type' + - 'id' + - 'call_id' + - 'action' - 'status' type: 'object' - InternInvokeRequest: - description: 'A prompt to run on the intern without holding a connection open.' + LocalShellCallOutputItem: + description: 'Output from a local shell command execution' example: - input: 'New support ticket 48213. Case token: ct_9f2c. Investigate and reply.' + id: 'output-abc123' + output: "total 24\ndrwxr-xr-x 5 user staff 160 Jan 1 12:00 ." + status: 'completed' + type: 'local_shell_call_output' properties: - input: - description: 'The prompt for the run, at most 32000 characters.' - example: 'New support ticket 48213. Case token: ct_9f2c. Investigate and reply.' - maxLength: 32000 - minLength: 1 + id: type: 'string' - session_id: - description: 'The session to run in. Send the `session_id` from an earlier `202` to continue that conversation, for example to hand the intern a decision on a case it is working. Omit it to start a new session. Only a `session_id` this endpoint issued to the same caller on the same intern is accepted; any other is refused with `404`.' - example: 'b51a0e21-368b-4780-a220-14655bf28c55' - maxLength: 256 - minLength: 1 + output: + type: 'string' + status: + anyOf: + - $ref: '#/components/schemas/ToolCallStatus' + - type: 'null' + type: + enum: + - 'local_shell_call_output' type: 'string' required: - - 'input' + - 'type' + - 'id' + - 'output' type: 'object' - InternLifecycleError: - additionalProperties: false - description: 'Intern lifecycle request failure.' - example: - error: - code: 404 - message: 'Intern not found' - metadata: - reason: 'not_found' - retryable: false - properties: - error: - additionalProperties: false - properties: - code: - anyOf: - - type: 'string' - - type: 'integer' - message: - type: 'string' - metadata: - additionalProperties: false - properties: - reason: - type: 'string' - retryable: - type: 'boolean' - required: - - 'reason' - - 'retryable' - type: 'object' + ManagedPrivateEndpoint: + allOf: + - $ref: '#/components/schemas/PrivateEndpointSummary' + - properties: + declared_region: + $ref: '#/components/schemas/PrivateEndpointDeclaredRegion' + declared_zdr: + description: 'Whether you attest this deployment retains no prompt or completion data. `null` means undeclared.' + example: true + type: + - 'boolean' + - 'null' required: - - 'code' - - 'message' + - 'declared_zdr' + - 'declared_region' type: 'object' + ManagedPrivateEndpointResponse: + properties: + data: + $ref: '#/components/schemas/ManagedPrivateEndpoint' required: - - 'error' + - 'data' type: 'object' - InternListResponse: - additionalProperties: false - description: 'Interns visible to the authenticated API key.' + McpApprovalRequestItem: + description: 'Request for approval to execute an MCP tool' example: - data: - - attached_vault_id: null - can_edit: true - created_at: '2026-09-16T08:30:00.000Z' - created_by_you: true - description: 'Researches customer questions' - hostname: 'research-assistant.openrouter.ai' - icon_sha256: null - id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' - instructions: null - last_failure_message: null - model: 'openai/gpt-5.4' - name: 'research-assistant' - progress: null - status: 'running' - updated_at: '2026-09-16T08:45:00.000Z' - vault_id: 'b431c59d-6eed-41ac-bc89-9a89be79a121' - workspace_id: '89f9f5b2-3f89-4eaf-83ca-5ceae149e8bb' - has_more: false + arguments: '{"id":"123"}' + id: 'approval-abc123' + name: 'delete_record' + server_label: 'database-server' + type: 'mcp_approval_request' properties: - data: - items: - $ref: '#/components/schemas/Intern' - type: 'array' - has_more: - description: 'True when more interns match the current filters.' + arguments: + type: 'string' + id: + type: 'string' + name: + type: 'string' + server_label: + type: 'string' + type: + enum: + - 'mcp_approval_request' + type: 'string' + required: + - 'type' + - 'id' + - 'name' + - 'arguments' + - 'server_label' + type: 'object' + McpApprovalResponseItem: + description: 'User response to an MCP tool approval request' + example: + approval_request_id: 'approval-abc123' + approve: true + reason: 'Approved for execution' + type: 'mcp_approval_response' + properties: + approval_request_id: + type: 'string' + approve: type: 'boolean' - next_cursor: - description: 'Opaque cursor, present when `has_more` is true. Pass it as `starting_after` to fetch the next page.' - example: 'MjAyNi0wOS0xNlQwODozMDowMC4wMDAwMDBafDdjOWU2Njc5LTc0MjUtNDBkZS05NDRiLWUwN2ZjMWY5MGFlNw' + id: + type: + - 'string' + - 'null' + reason: + type: + - 'string' + - 'null' + type: + enum: + - 'mcp_approval_response' type: 'string' required: - - 'data' - - 'has_more' + - 'type' + - 'approval_request_id' + - 'approve' type: 'object' - ItemReferenceItem: - description: 'A reference to a previous response item by ID' + McpCallItem: + description: 'An MCP tool call with its output or error' example: - id: 'msg-abc123' - type: 'item_reference' + arguments: '{"query":"SELECT * FROM users"}' + id: 'mcp-call-abc123' + name: 'query_database' + output: '[{"id":1,"name":"Alice"}]' + server_label: 'database-server' + type: 'mcp_call' properties: + arguments: + type: 'string' + error: + $ref: '#/components/schemas/McpToolCallError' id: type: 'string' + name: + type: 'string' + output: + type: + - 'string' + - 'null' + server_label: + type: 'string' type: enum: - - 'item_reference' + - 'mcp_call' type: 'string' required: - 'type' - 'id' + - 'name' + - 'arguments' + - 'server_label' type: 'object' - JevRouterPlugin: - additionalProperties: false + McpHttpError: + description: 'The MCP server request failed at the HTTP layer' example: - excluded_models: - - 'openai/gpt-6-astra' - id: 'jev-router' - models: - - 'anthropic/*' - - 'openai/gpt-5.6-sol' + code: 503 + message: 'Service Unavailable' + type: 'http_error' properties: - allowed_models: - description: 'Alias of `models`, matching the auto-router field name. Entries from both fields are combined.' - example: - - 'anthropic/*' - items: - maxLength: 1024 - type: 'string' - maxItems: 1024 - type: 'array' - cost_tier: - description: 'Select low, medium, high, or a cost tier configured by the operator. Overrides the live-config tier and replaces the shared routing policy with that tier. Omit to use the live configuration. Model exclusions and the router kill switch still apply.' - example: 'medium' - pattern: '^[a-z][a-z0-9_-]{0,31}$' + code: + type: 'integer' + message: type: 'string' - excluded_models: - description: 'Remove these models from the router. Each entry is a model slug or a wildcard pattern (e.g. "xiaomi/*"). A `~author/family-latest` alias matches every revision of that family. Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. Applied after `models`, so an excluded pattern always wins over an included one; when the lists leave no model the request can use, it fails with 404 rather than routing outside them.' - example: - - 'openai/gpt-6-astra' - - 'xiaomi/*' - items: - maxLength: 1024 - type: 'string' - maxItems: 1024 - type: 'array' - id: + type: enum: - - 'jev-router' + - 'http_error' type: 'string' - models: - description: 'Restrict the router to these models. Each entry is a model slug or a wildcard pattern (e.g. "anthropic/*"), matched against the current pool; models outside the pool are ignored. A `~author/family-latest` alias matches every revision of that family. Up to 1024 patterns, each at most 1024 characters, with 65536 total characters across all patterns. When omitted or empty, every model in the pool is a candidate; when no pool model matches, the list is ignored and the whole pool is used (`excluded_models` still apply). `allowed_models` is an alias; entries from both fields are combined.' - example: - - 'anthropic/*' - - 'openai/gpt-5.6-sol' + required: + - 'type' + - 'code' + - 'message' + type: 'object' + McpListToolsItem: + description: 'List of available MCP tools from a server' + example: + id: 'mcp-list-abc123' + server_label: 'database-server' + tools: + - description: 'Execute a database query' + input_schema: + properties: + query: + type: 'string' + type: 'object' + name: 'query_database' + type: 'mcp_list_tools' + properties: + error: + type: + - 'string' + - 'null' + id: + type: 'string' + server_label: + type: 'string' + tools: items: - maxLength: 1024 - type: 'string' - maxItems: 1024 + properties: + annotations: {} + description: + type: + - 'string' + - 'null' + input_schema: + additionalProperties: {} + type: 'object' + name: + type: 'string' + required: + - 'name' + - 'input_schema' + type: 'object' type: 'array' + type: + enum: + - 'mcp_list_tools' + type: 'string' required: + - 'type' - 'id' + - 'server_label' + - 'tools' type: 'object' - KeyAssignment: + McpProtocolError: + description: 'The MCP server returned a protocol-level error' + example: + code: -32601 + message: 'Method not found' + type: 'mcp_protocol_error' + properties: + code: + type: 'integer' + message: + type: 'string' + type: + enum: + - 'mcp_protocol_error' + type: 'string' + required: + - 'type' + - 'code' + - 'message' + type: 'object' + McpServerTool: + description: 'MCP (Model Context Protocol) tool configuration' + example: + server_label: 'my-server' + server_url: 'https://example.com/mcp' + type: 'mcp' + properties: + allowed_tools: + anyOf: + - items: + type: 'string' + type: 'array' + - properties: + read_only: + type: 'boolean' + tool_names: + items: + type: 'string' + type: 'array' + type: 'object' + - type: 'null' + authorization: + type: 'string' + connector_id: + enum: + - 'connector_dropbox' + - 'connector_gmail' + - 'connector_googlecalendar' + - 'connector_googledrive' + - 'connector_microsoftteams' + - 'connector_outlookcalendar' + - 'connector_outlookemail' + - 'connector_sharepoint' + type: 'string' + x-speakeasy-unknown-values: allow + headers: + additionalProperties: + type: 'string' + type: + - 'object' + - 'null' + require_approval: + anyOf: + - properties: + always: + properties: + tool_names: + items: + type: 'string' + type: 'array' + type: 'object' + never: + properties: + tool_names: + items: + type: 'string' + type: 'array' + type: 'object' + type: 'object' + - enum: + - 'always' + type: 'string' + - enum: + - 'never' + type: 'string' + - type: 'null' + server_description: + type: 'string' + server_label: + type: 'string' + server_url: + type: 'string' + type: + enum: + - 'mcp' + type: 'string' + required: + - 'type' + - 'server_label' + type: 'object' + McpToolCallError: + anyOf: + - type: 'string' + - $ref: '#/components/schemas/McpProtocolError' + - $ref: '#/components/schemas/McpToolExecutionError' + - $ref: '#/components/schemas/McpHttpError' + - type: 'null' + description: 'Error from an MCP tool call, either a plain message or a structured error' + example: + code: 503 + message: 'Service Unavailable' + type: 'http_error' + McpToolExecutionError: + description: 'The MCP tool ran but reported a failure' + example: + content: 'Connection refused' + type: 'mcp_tool_execution_error' + properties: + content: {} + type: + enum: + - 'mcp_tool_execution_error' + type: 'string' + required: + - 'type' + type: 'object' + MemberAssignment: example: assigned_by: 'user_abc123' created_at: '2025-08-24T10:30:00Z' guardrail_id: '550e8400-e29b-41d4-a716-446655440001' id: '550e8400-e29b-41d4-a716-446655440000' - key_hash: 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' - key_label: 'prod-key' - key_name: 'Production Key' + organization_id: 'org_xyz789' + user_id: 'user_abc123' properties: assigned_by: description: 'User ID of who made the assignment' @@ -16264,2862 +16374,1754 @@ components: example: '550e8400-e29b-41d4-a716-446655440000' format: 'uuid' type: 'string' - key_hash: - description: 'Hash of the assigned API key' - example: 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + organization_id: + description: 'Organization ID' + example: 'org_xyz789' type: 'string' - key_label: - description: 'Label of the API key' - example: 'prod-key' - type: 'string' - key_name: - description: 'Name of the API key' - example: 'Production Key' + user_id: + description: 'Clerk user ID of the assigned member' + example: 'user_abc123' type: 'string' required: - 'id' - - 'key_hash' + - 'user_id' + - 'organization_id' - 'guardrail_id' - - 'key_name' - - 'key_label' - 'assigned_by' - 'created_at' type: 'object' - KeyBudget: - description: 'One budget layer that applies to requests made with this key, with the spend enforcement compares against it.' + MessagesAdvisorToolResultBlock: + description: 'Advisor tool result from a prior assistant turn, replayed back to the model on the next turn. Mirrors the block Anthropic returns in assistant content when the `advisor_20260301` tool runs.' example: - budget_id: null - guardrail_id: '0df9e665-d932-5740-b2c7-b52af166bc11' - include_byok: false - limit_usd: 50 - remaining_usd: 17.5 - reset_interval: 'weekly' - resets_at: '2026-10-12T00:00:00.000Z' - scope: 'member' - spend_usd: 32.5 + content: + text: 'Advisor response text' + type: 'advisor_result' + tool_use_id: 'srvtoolu_01abc' + type: 'advisor_tool_result' properties: - budget_id: - description: 'ID of the workspace budget for the `workspace` scope; null for other scopes.' - example: null - type: - - 'string' - - 'null' - guardrail_id: - description: 'ID of the guardrail that carries this budget; null for other scopes.' - example: '0df9e665-d932-5740-b2c7-b52af166bc11' - type: - - 'string' - - 'null' - include_byok: - description: 'Whether external BYOK inference spend counts toward this budget.' - example: false - type: 'boolean' - limit_usd: - description: 'Budget limit in USD for the current window.' - example: 50 - format: 'double' - type: 'number' - remaining_usd: - description: '`limit_usd - spend_usd`. Zero or negative means this layer rejects requests with a 403 until it resets.' - example: 17.5 - format: 'double' - type: 'number' - reset_interval: - description: 'UTC window the spend is counted over (weeks start Monday); null for a lifetime budget that never resets.' - enum: - - 'daily' - - 'weekly' - - 'monthly' - - null - example: 'weekly' - type: - - 'string' - - 'null' - x-speakeasy-unknown-values: allow - resets_at: - description: 'ISO 8601 UTC instant at which the window rolls over and spend returns to zero; null for a lifetime budget.' - example: '2026-10-12T00:00:00.000Z' - format: 'date-time' - type: - - 'string' - - 'null' - scope: - description: 'Which budget layer this is, in the order enforcement checks them: the workspace default guardrail against the member aggregate (`workspace_default_member`) and against this key (`workspace_default_key`), the member guardrail (`member`), the API key guardrail (`api_key`), a workspace budget (`workspace`), or the key''s own limit (`key_limit`).' - enum: - - 'workspace_default_member' - - 'workspace_default_key' - - 'member' - - 'api_key' - - 'workspace' - - 'key_limit' - example: 'member' + content: + additionalProperties: {} + type: 'object' + tool_use_id: type: 'string' - x-speakeasy-unknown-values: allow - spend_usd: - description: 'Spend in USD that enforcement counts against this limit in the current window: the member aggregate for member-scoped layers, otherwise this key or workspace.' - example: 32.5 - format: 'double' - type: 'number' - required: - - 'scope' - - 'guardrail_id' - - 'budget_id' - - 'limit_usd' - - 'spend_usd' - - 'remaining_usd' - - 'reset_interval' - - 'resets_at' - - 'include_byok' - type: 'object' - Legacy_ChatContentVideo: - deprecated: true - description: 'Video input content part (legacy format - deprecated)' - example: - type: 'input_video' - video_url: - url: 'https://example.com/video.mp4' - properties: type: enum: - - 'input_video' + - 'advisor_tool_result' type: 'string' - video_url: - $ref: '#/components/schemas/Legacy_ChatContentVideoInput' required: - 'type' - - 'video_url' + - 'tool_use_id' + - 'content' type: 'object' - Legacy_ChatContentVideoInput: - description: 'Video input object' + MessagesBashToolResultBlock: + description: 'Output of a sandbox-executed `openrouter:bash` call from a prior assistant turn. Accepted on replay and dropped before the provider request — Anthropic has no equivalent block.' example: - url: 'https://example.com/video.mp4' + content: + command: 'ls' + exitCode: 0 + stderr: '' + stdout: "README.md\n" + tool_use_id: 'srvtoolu_01abc' + type: 'openrouter_bash_tool_result' properties: - processing: - description: 'Video processing mode. `agentic` enables agentic video processing and `static` forces fixed-rate frame sampling on providers that support it (currently Google Gemini).' - enum: - - 'agentic' - - 'static' - example: 'agentic' + container_id: + description: 'The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed.' type: 'string' - x-speakeasy-unknown-values: allow - url: - description: 'URL of the video (data: URLs supported)' + content: + additionalProperties: {} + type: 'object' + files: + description: 'Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API.' + items: + properties: + container_id: + type: 'string' + end_index: + type: 'integer' + file_id: + type: 'string' + filename: + type: 'string' + start_index: + type: 'integer' + type: + enum: + - 'container_file_citation' + type: 'string' + required: + - 'type' + - 'container_id' + - 'file_id' + - 'filename' + - 'start_index' + - 'end_index' + type: 'object' + type: 'array' + tool_use_id: type: 'string' - required: - - 'url' - type: 'object' - Legacy_WebSearchServerTool: - description: 'Web search tool configuration' - example: - engine: 'auto' - filters: - allowed_domains: - - 'example.com' - type: 'web_search' - properties: - engine: - $ref: '#/components/schemas/WebSearchEngineEnum' - filters: - $ref: '#/components/schemas/WebSearchDomainFilter' - max_results: - description: 'Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, Parallel, and Perplexity engines; ignored with native provider search. Perplexity supports a maximum of 20; values above 20 are clamped.' - example: 5 - type: 'integer' - max_uses: - description: 'Maximum number of web searches the model may perform in a single request. Once reached, further search calls return an error result instead of executing. Applies to the Exa, Firecrawl, Parallel, and Perplexity engines. With native provider search, forwarded only to Anthropic (as `max_uses`); other native search providers have no equivalent parameter and ignore it.' - example: 3 - type: 'integer' - mode: - $ref: '#/components/schemas/WebSearchMode' - search_context_size: - $ref: '#/components/schemas/SearchContextSizeEnum' type: enum: - - 'web_search' + - 'openrouter_bash_tool_result' type: 'string' - user_location: - $ref: '#/components/schemas/WebSearchUserLocation' - x_search: - $ref: '#/components/schemas/XSearchOptions' required: - 'type' + - 'tool_use_id' + - 'content' type: 'object' - ListBYOKKeysResponse: + MessagesContentBlockDeltaEvent: + description: 'Event sent when content is added to a content block' example: - data: - - allowed_api_key_hashes: null - allowed_models: null - allowed_user_ids: null - created_at: '2025-08-24T10:30:00Z' - declared_region: null - declared_zdr: null - disabled: false - id: '11111111-2222-3333-4444-555555555555' - is_byok_only: false - is_fallback: false - is_required: false - label: 'sk-...AbCd' - name: 'Production OpenAI Key' - provider: 'openai' - sort_order: 0 - workspace_id: '550e8400-e29b-41d4-a716-446655440000' - total_count: 1 + delta: + text: 'Hello' + type: 'text_delta' + index: 0 + type: 'content_block_delta' properties: - data: - description: 'List of BYOK credentials.' - items: - $ref: '#/components/schemas/BYOKKey' - type: 'array' - total_count: - description: 'Total number of BYOK credentials matching the filters.' - example: 1 + delta: + oneOf: + - properties: + text: + type: 'string' + type: + enum: + - 'text_delta' + type: 'string' + required: + - 'type' + - 'text' + type: 'object' + - properties: + partial_json: + type: 'string' + type: + enum: + - 'input_json_delta' + type: 'string' + required: + - 'type' + - 'partial_json' + type: 'object' + - properties: + thinking: + type: 'string' + type: + enum: + - 'thinking_delta' + type: 'string' + required: + - 'type' + - 'thinking' + type: 'object' + - properties: + signature: + type: 'string' + type: + enum: + - 'signature_delta' + type: 'string' + required: + - 'type' + - 'signature' + type: 'object' + - properties: + citation: + discriminator: + mapping: + char_location: '#/components/schemas/AnthropicCitationCharLocation' + content_block_location: '#/components/schemas/AnthropicCitationContentBlockLocation' + page_location: '#/components/schemas/AnthropicCitationPageLocation' + search_result_location: '#/components/schemas/AnthropicCitationSearchResultLocation' + web_search_result_location: '#/components/schemas/AnthropicCitationWebSearchResultLocation' + propertyName: 'type' + oneOf: + - $ref: '#/components/schemas/AnthropicCitationCharLocation' + - $ref: '#/components/schemas/AnthropicCitationPageLocation' + - $ref: '#/components/schemas/AnthropicCitationContentBlockLocation' + - $ref: '#/components/schemas/AnthropicCitationWebSearchResultLocation' + - $ref: '#/components/schemas/AnthropicCitationSearchResultLocation' + type: + enum: + - 'citations_delta' + type: 'string' + required: + - 'type' + - 'citation' + type: 'object' + - properties: + content: + type: + - 'string' + - 'null' + encrypted_content: + type: + - 'string' + - 'null' + type: + enum: + - 'compaction_delta' + type: 'string' + required: + - 'type' + - 'content' + type: 'object' + index: type: 'integer' + type: + enum: + - 'content_block_delta' + type: 'string' required: - - 'data' - - 'total_count' + - 'type' + - 'index' + - 'delta' type: 'object' - ListEndpointsResponse: - description: 'List of available endpoints for a model' + MessagesContentBlockStartEvent: + description: 'Event sent when a new content block starts' example: - architecture: - input_modalities: - - 'text' - instruct_type: 'chatml' - modality: 'text->text' - output_modalities: - - 'text' - tokenizer: 'GPT' - created: 1692901234 - description: 'GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.' - endpoints: - - context_length: 8192 - latency_last_30m: - p50: 0.25 - p75: 0.35 - p90: 0.48 - p99: 0.85 - max_completion_tokens: 4096 - max_prompt_tokens: 8192 - model_id: 'openai/gpt-4' - model_name: 'GPT-4' - name: 'OpenAI: GPT-4' - pricing: - completion: '0.00006' - image: '0' - prompt: '0.00003' - request: '0' - provider_name: 'OpenAI' - quantization: 'fp16' - status: 0 - supported_parameters: - - 'temperature' - - 'top_p' - - 'max_tokens' - - 'frequency_penalty' - - 'presence_penalty' - supports_diarization: false - supports_implicit_caching: true - tag: 'openai' - throughput_last_30m: - p50: 45.2 - p75: 38.5 - p90: 28.3 - p99: 15.1 - uptime_last_1d: 99.8 - uptime_last_30m: 99.5 - uptime_last_5m: 100 - id: 'openai/gpt-4' - name: 'GPT-4' + content_block: + citations: [] + text: '' + type: 'text' + index: 0 + type: 'content_block_start' properties: - architecture: - allOf: - - $ref: '#/components/schemas/ModelArchitecture' + content_block: + anyOf: + - $ref: '#/components/schemas/AnthropicTextBlock' + - $ref: '#/components/schemas/AnthropicToolUseBlock' + - $ref: '#/components/schemas/AnthropicThinkingBlock' + - $ref: '#/components/schemas/AnthropicRedactedThinkingBlock' + - $ref: '#/components/schemas/ORAnthropicServerToolUseBlock' + - $ref: '#/components/schemas/AnthropicWebSearchToolResult' + - $ref: '#/components/schemas/AnthropicWebFetchToolResult' + - $ref: '#/components/schemas/AnthropicCodeExecutionToolResult' + - $ref: '#/components/schemas/AnthropicBashCodeExecutionToolResult' + - $ref: '#/components/schemas/AnthropicTextEditorCodeExecutionToolResult' + - $ref: '#/components/schemas/AnthropicToolSearchToolResult' + - $ref: '#/components/schemas/AnthropicContainerUpload' + - $ref: '#/components/schemas/AnthropicCompactionBlock' + - $ref: '#/components/schemas/AnthropicAdvisorToolResult' + - $ref: '#/components/schemas/ORAnthropicShellToolResult' + - $ref: '#/components/schemas/ORAnthropicBashToolResult' + - $ref: '#/components/schemas/ORAnthropicToolSearchResult' - properties: - input_modalities: - description: 'Supported input modalities' - items: - $ref: '#/components/schemas/InputModality' - type: 'array' - instruct_type: - $ref: '#/components/schemas/InstructType' - modality: - description: 'Primary modality of the model' - example: 'text' + content: type: - 'string' - 'null' - output_modalities: - description: 'Supported output modalities' - items: - $ref: '#/components/schemas/OutputModality' - type: 'array' - tokenizer: - anyOf: - - $ref: '#/components/schemas/ModelGroup' - - type: 'null' + encrypted_content: + type: + - 'string' + - 'null' + type: + enum: + - 'compaction' + type: 'string' required: - - 'tokenizer' - - 'instruct_type' - - 'modality' - - 'input_modalities' - - 'output_modalities' - created: - description: 'Unix timestamp of when the model was created' - example: 1692901234 + - 'type' + - 'content' + type: 'object' + index: type: 'integer' - description: - description: 'Description of the model' - example: 'GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.' - type: 'string' - endpoints: - description: 'List of available endpoints for this model' - items: - $ref: '#/components/schemas/PublicEndpoint' - type: 'array' - id: - description: 'Unique identifier for the model' - example: 'openai/gpt-4' - type: 'string' - name: - description: 'Display name of the model' - example: 'GPT-4' + type: + enum: + - 'content_block_start' type: 'string' required: - - 'id' - - 'name' - - 'created' - - 'description' - - 'architecture' - - 'endpoints' + - 'type' + - 'index' + - 'content_block' type: 'object' - ListExternalUsersResponse: + MessagesContentBlockStopEvent: + description: 'Event sent when a content block is complete' example: - data: - - created_at: '2026-09-16T12:00:00Z' - is_active: true - updated_at: '2026-09-16T12:00:00Z' - user: 'employee_123' - total_count: 1 + index: 0 + type: 'content_block_stop' properties: - data: - items: - $ref: '#/components/schemas/ExternalUser' - type: 'array' - total_count: - description: 'Number of registrations matching the filters before pagination.' - example: 1 + index: type: 'integer' + type: + enum: + - 'content_block_stop' + type: 'string' required: - - 'data' - - 'total_count' - type: 'object' - ListGuardrailsResponse: - example: - data: - - allowed_models: null - allowed_providers: - - 'openai' - - 'anthropic' - - 'google' - content_filter_builtins: - - action: 'redact' - label: '[EMAIL]' - slug: 'email' - content_filters: null - created_at: '2025-08-24T10:30:00Z' - description: 'Guardrail for production environment' - enable_free_model_publication: false - enable_free_model_training: true - enable_paid_model_training: true - enforce_zdr: null - enforce_zdr_anthropic: true - enforce_zdr_google: false - enforce_zdr_openai: true - enforce_zdr_other: false - enforce_zdr_xai: false - id: '550e8400-e29b-41d4-a716-446655440000' - ignored_models: null - ignored_providers: null - include_byok_in_budgets: false - limit_usd: 100 - name: 'Production Guardrail' - reset_interval: 'monthly' - updated_at: '2025-08-24T15:45:00Z' - workspace_id: '0df9e665-d932-5740-b2c7-b52af166bc11' - total_count: 1 - properties: - data: - description: 'List of guardrails' - items: - $ref: '#/components/schemas/Guardrail' - type: 'array' - total_count: - description: 'Total number of guardrails' - example: 25 - type: 'integer' - required: - - 'data' - - 'total_count' - type: 'object' - ListKeyAssignmentsResponse: - example: - data: - - assigned_by: 'user_abc123' - created_at: '2025-08-24T10:30:00Z' - guardrail_id: '550e8400-e29b-41d4-a716-446655440001' - id: '550e8400-e29b-41d4-a716-446655440000' - key_hash: 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' - key_label: 'prod-key' - key_name: 'Production Key' - total_count: 1 - properties: - data: - description: 'List of key assignments' - items: - $ref: '#/components/schemas/KeyAssignment' - type: 'array' - total_count: - description: 'Total number of key assignments for this guardrail' - example: 25 - type: 'integer' - required: - - 'data' - - 'total_count' - type: 'object' - ListMemberAssignmentsResponse: - example: - data: - - assigned_by: 'user_abc123' - created_at: '2025-08-24T10:30:00Z' - guardrail_id: '550e8400-e29b-41d4-a716-446655440001' - id: '550e8400-e29b-41d4-a716-446655440000' - organization_id: 'org_xyz789' - user_id: 'user_abc123' - total_count: 1 - properties: - data: - description: 'List of member assignments' - items: - $ref: '#/components/schemas/MemberAssignment' - type: 'array' - total_count: - description: 'Total number of member assignments' - example: 10 - type: 'integer' - required: - - 'data' - - 'total_count' - type: 'object' - ListObservabilityDestinationsResponse: - example: - data: - - api_key_hashes: null - broadcast_generation_cost: false - broadcast_generation_cost_allocation: false - broadcast_generation_identity: false - broadcast_generation_request_context: false - config: - baseUrl: 'https://us.cloud.langfuse.com' - publicKey: 'pk-l...EfGh' - secretKey: 'sk-l...AbCd' - created_at: '2025-08-24T10:30:00Z' - enabled: true - filter_rules: null - id: '99999999-aaaa-bbbb-cccc-dddddddddddd' - name: 'Production Langfuse' - privacy_mode: false - regions: - - 'global' - sampling_rate: 1 - type: 'langfuse' - updated_at: '2025-08-24T15:45:00Z' - workspace_id: '550e8400-e29b-41d4-a716-446655440000' - total_count: 1 - properties: - data: - description: 'List of observability destinations.' - items: - $ref: '#/components/schemas/ObservabilityDestination' - type: 'array' - total_count: - description: 'Total number of destinations matching the filters.' - example: 1 - type: 'integer' - required: - - 'data' - - 'total_count' - type: 'object' - ListPresetsResponse: - description: 'A paginated list of presets.' - example: - data: - - created_at: '2026-04-20T10:00:00Z' - creator_user_id: 'user_2dHFtVWx2n56w6HkM0000000000' - description: null - designated_version_id: '550e8400-e29b-41d4-a716-446655440000' - id: '650e8400-e29b-41d4-a716-446655440001' - name: 'my-preset' - slug: 'my-preset' - status: 'active' - status_updated_at: null - updated_at: '2026-04-20T10:00:00Z' - workspace_id: '750e8400-e29b-41d4-a716-446655440002' - total_count: 1 - properties: - data: - items: - $ref: '#/components/schemas/Preset' - type: 'array' - total_count: - type: 'integer' - required: - - 'data' - - 'total_count' + - 'type' + - 'index' type: 'object' - ListPresetVersionsResponse: - description: 'A paginated list of preset versions.' + MessagesDeltaEvent: + description: 'Event sent when the message metadata changes (e.g., stop_reason)' example: - data: - - config: - model: 'openai/gpt-4o' - temperature: 0.7 - created_at: '2026-04-20T10:00:00Z' - creator_id: 'user_2dHFtVWx2n56w6HkM0000000000' - id: '550e8400-e29b-41d4-a716-446655440000' - preset_id: '650e8400-e29b-41d4-a716-446655440001' - system_prompt: 'You are a helpful assistant.' - updated_at: '2026-04-20T10:00:00Z' - version: 1 - total_count: 1 - properties: - data: - items: - $ref: '#/components/schemas/PresetDesignatedVersion' - type: 'array' - total_count: - type: 'integer' - required: - - 'data' - - 'total_count' - type: 'object' - ListPrivateEndpointsResponse: - properties: - data: - items: - $ref: '#/components/schemas/PrivateEndpointSummary' - type: 'array' - required: - - 'data' - type: 'object' - ListScimGroupMappingsResponse: - properties: - data: - items: - $ref: '#/components/schemas/ScimGroupMapping' - type: 'array' - total_count: - type: 'integer' - required: - - 'data' - - 'total_count' - type: 'object' - ListScimGroupsResponse: - properties: - data: - items: - $ref: '#/components/schemas/ScimGroup' - type: 'array' - total_count: - type: 'integer' - required: - - 'data' - - 'total_count' - type: 'object' - ListToolsResponse: + delta: + container: null + stop_details: null + stop_reason: 'end_turn' + stop_sequence: null + type: 'message_delta' + usage: + cache_creation_input_tokens: null + cache_read_input_tokens: null + input_tokens: null + output_tokens: 15 + output_tokens_details: null + server_tool_use: null properties: - data: - items: - $ref: '#/components/schemas/ServerTool' - type: 'array' - links: + delta: properties: - next: - description: 'URL for the next page of results, or null if this is the last page' - example: null + container: + $ref: '#/components/schemas/AnthropicContainer' + safeguard_results: + items: + $ref: '#/components/schemas/AnthropicSafeguardResult' + type: + - 'array' + - 'null' + stop_details: + $ref: '#/components/schemas/AnthropicRefusalStopDetails' + stop_reason: + $ref: '#/components/schemas/ORAnthropicStopReason' + stop_sequence: type: - 'string' - 'null' required: - - 'next' + - 'container' + - 'stop_details' + - 'stop_reason' + - 'stop_sequence' type: 'object' - total_count: - description: 'Total number of tools' - example: 12 - type: 'integer' - required: - - 'data' - - 'total_count' - - 'links' - type: 'object' - ListWorkspaceBudgetsResponse: - example: - data: - - created_at: '2025-08-24T10:30:00Z' - id: '770e8400-e29b-41d4-a716-446655440000' - limit_usd: 100 - reset_interval: 'monthly' - updated_at: '2025-08-24T15:45:00Z' - workspace_id: '550e8400-e29b-41d4-a716-446655440000' - include_byok_in_budgets: false - properties: - data: - description: 'List of budgets configured for the workspace' - items: - $ref: '#/components/schemas/WorkspaceBudget' - type: 'array' - include_byok_in_budgets: - description: 'Whether BYOK (bring-your-own-key) spend is included when enforcing the workspace''s budgets. This is a workspace-wide setting that applies to all budget intervals (daily, weekly, monthly, and lifetime).' - example: false - type: 'boolean' - required: - - 'data' - type: 'object' - ListWorkspaceMembersResponse: - example: - data: - - created_at: '2025-08-24T10:30:00Z' - id: '660e8400-e29b-41d4-a716-446655440000' - role: 'member' - user_id: 'user_abc123' - workspace_id: '550e8400-e29b-41d4-a716-446655440000' - total_count: 1 - properties: - data: - description: 'List of workspace members' - items: - $ref: '#/components/schemas/WorkspaceMember' - type: 'array' - total_count: - description: 'Total number of members in the workspace' - example: 5 - type: 'integer' - required: - - 'data' - - 'total_count' - type: 'object' - ListWorkspacesResponse: - example: - data: - - created_at: '2025-08-24T10:30:00Z' - created_by: 'user_abc123' - default_guardrail_id: '595d5849-7e86-51fd-a7c0-705c34e4afff' - default_image_model: 'openai/dall-e-3' - default_provider_sort: 'price' - default_text_model: 'openai/gpt-4o' - description: 'Production environment workspace' - disabled_server_tools: null - id: '550e8400-e29b-41d4-a716-446655440000' - include_byok_in_budgets: false - io_logging_api_key_ids: null - io_logging_sampling_rate: 1 - is_data_discount_logging_enabled: true - is_observability_broadcast_enabled: false - is_observability_io_logging_enabled: false - name: 'Production' - slug: 'production' - updated_at: '2025-08-24T15:45:00Z' - total_count: 1 - properties: - data: - description: 'List of workspaces' - items: - $ref: '#/components/schemas/Workspace' - type: 'array' - total_count: - description: 'Total number of workspaces' - example: 5 - type: 'integer' - required: - - 'data' - - 'total_count' - type: 'object' - LocalShellCallItem: - description: 'A local shell command execution call' - example: - action: - command: - - 'ls' - - '-la' - env: - PATH: '/usr/bin' - timeout_ms: 5000 - type: 'exec' - call_id: 'call-abc123' - id: 'shell-abc123' - status: 'completed' - type: 'local_shell_call' - properties: - action: + type: + enum: + - 'message_delta' + type: 'string' + usage: properties: - command: - items: - type: 'string' - type: 'array' - env: - additionalProperties: - type: 'string' - type: 'object' - timeout_ms: + cache_creation: + $ref: '#/components/schemas/AnthropicCacheCreation' + cache_creation_input_tokens: type: - 'integer' - 'null' - type: - enum: - - 'exec' - type: 'string' - user: + cache_read_input_tokens: type: - - 'string' + - 'integer' - 'null' - working_directory: + input_tokens: type: - - 'string' + - 'integer' - 'null' + iterations: + items: + $ref: '#/components/schemas/AnthropicUsageIteration' + type: 'array' + output_tokens: + type: 'integer' + output_tokens_details: + $ref: '#/components/schemas/AnthropicOutputTokensDetails' + server_tool_use: + $ref: '#/components/schemas/ORAnthropicServerToolUsage' required: - - 'type' - - 'command' - - 'env' + - 'input_tokens' + - 'output_tokens' + - 'output_tokens_details' + - 'cache_creation_input_tokens' + - 'cache_read_input_tokens' + - 'server_tool_use' type: 'object' - call_id: - type: 'string' - id: - type: 'string' - status: - $ref: '#/components/schemas/ToolCallStatus' - type: - enum: - - 'local_shell_call' - type: 'string' required: - 'type' - - 'id' - - 'call_id' - - 'action' - - 'status' + - 'delta' + - 'usage' type: 'object' - LocalShellCallOutputItem: - description: 'Output from a local shell command execution' + MessagesErrorEvent: + description: 'Error event in the stream' example: - id: 'output-abc123' - output: "total 24\ndrwxr-xr-x 5 user staff 160 Jan 1 12:00 ." - status: 'completed' - type: 'local_shell_call_output' + error: + error_type: 'provider_overloaded' + message: 'Overloaded' + type: 'overloaded_error' + type: 'error' properties: - id: - type: 'string' - output: - type: 'string' - status: - anyOf: - - $ref: '#/components/schemas/ToolCallStatus' - - type: 'null' + error: + properties: + error_type: + $ref: '#/components/schemas/ApiErrorType' + message: + type: 'string' + type: + type: 'string' + required: + - 'type' + - 'message' + type: 'object' + openrouter_metadata: + $ref: '#/components/schemas/OpenRouterMetadata' type: enum: - - 'local_shell_call_output' + - 'error' type: 'string' required: - 'type' - - 'id' - - 'output' + - 'error' type: 'object' - ManagedPrivateEndpoint: - allOf: - - $ref: '#/components/schemas/PrivateEndpointSummary' - - properties: - declared_region: - $ref: '#/components/schemas/PrivateEndpointDeclaredRegion' - declared_zdr: - description: 'Whether you attest this deployment retains no prompt or completion data. `null` means undeclared.' - example: true - type: - - 'boolean' - - 'null' - required: - - 'declared_zdr' - - 'declared_region' - type: 'object' - ManagedPrivateEndpointResponse: + MessagesFallbackParam: + additionalProperties: {} + description: 'Fallback model to try when the primary model fails or refuses. Only the `model` field is supported; per-attempt overrides are rejected.' + example: + model: 'claude-opus-4-8' properties: - data: - $ref: '#/components/schemas/ManagedPrivateEndpoint' + model: + type: 'string' required: - - 'data' + - 'model' type: 'object' - McpApprovalRequestItem: - description: 'Request for approval to execute an MCP tool' + MessagesMessageParam: + description: 'Anthropic message with OpenRouter extensions' example: - arguments: '{"id":"123"}' - id: 'approval-abc123' - name: 'delete_record' - server_label: 'database-server' - type: 'mcp_approval_request' + content: 'Hello, how are you?' + role: 'user' properties: - arguments: - type: 'string' - id: - type: 'string' - name: - type: 'string' - server_label: - type: 'string' - type: + clear_at: + $ref: '#/components/schemas/AnthropicSystemClearAt' + content: + anyOf: + - type: 'string' + - items: + oneOf: + - $ref: '#/components/schemas/AnthropicTextBlockParam' + - $ref: '#/components/schemas/AnthropicImageBlockParam' + - $ref: '#/components/schemas/AnthropicDocumentBlockParam' + - properties: + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + id: + type: 'string' + input: {} + name: + type: 'string' + type: + enum: + - 'tool_use' + type: 'string' + required: + - 'type' + - 'id' + - 'name' + type: 'object' + - properties: + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + content: + anyOf: + - type: 'string' + - items: + anyOf: + - $ref: '#/components/schemas/AnthropicTextBlockParam' + - $ref: '#/components/schemas/AnthropicImageBlockParam' + - properties: + tool_name: + type: 'string' + type: + enum: + - 'tool_reference' + type: 'string' + required: + - 'type' + - 'tool_name' + type: 'object' + - $ref: '#/components/schemas/AnthropicSearchResultBlockParam' + - $ref: '#/components/schemas/AnthropicDocumentBlockParam' + type: 'array' + is_error: + type: 'boolean' + tool_use_id: + type: 'string' + type: + enum: + - 'tool_result' + type: 'string' + required: + - 'type' + - 'tool_use_id' + type: 'object' + - properties: + signature: + type: 'string' + thinking: + type: 'string' + type: + enum: + - 'thinking' + type: 'string' + required: + - 'type' + - 'thinking' + - 'signature' + type: 'object' + - properties: + data: + type: 'string' + type: + enum: + - 'redacted_thinking' + type: 'string' + required: + - 'type' + - 'data' + type: 'object' + - properties: + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + id: + type: 'string' + input: {} + name: + type: 'string' + type: + enum: + - 'server_tool_use' + type: 'string' + required: + - 'type' + - 'id' + - 'name' + type: 'object' + - properties: + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + content: + anyOf: + - items: + $ref: '#/components/schemas/AnthropicWebSearchResultBlockParam' + type: 'array' + - properties: + error_code: + enum: + - 'invalid_tool_input' + - 'unavailable' + - 'max_uses_exceeded' + - 'too_many_requests' + - 'query_too_long' + - 'request_too_large' + type: 'string' + x-speakeasy-unknown-values: allow + type: + enum: + - 'web_search_tool_result_error' + type: 'string' + required: + - 'type' + - 'error_code' + type: 'object' + tool_use_id: + type: 'string' + type: + enum: + - 'web_search_tool_result' + type: 'string' + required: + - 'type' + - 'tool_use_id' + - 'content' + type: 'object' + - $ref: '#/components/schemas/AnthropicSearchResultBlockParam' + - properties: + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + content: + type: + - 'string' + - 'null' + encrypted_content: + type: + - 'string' + - 'null' + type: + enum: + - 'compaction' + type: 'string' + required: + - 'type' + - 'content' + type: 'object' + - $ref: '#/components/schemas/MessagesAdvisorToolResultBlock' + - $ref: '#/components/schemas/MessagesToolAdditionBlock' + - $ref: '#/components/schemas/MessagesToolRemovalBlock' + - $ref: '#/components/schemas/MessagesShellToolResultBlock' + - $ref: '#/components/schemas/MessagesBashToolResultBlock' + - $ref: '#/components/schemas/ORAnthropicToolSearchResultParam' + type: 'array' + output_config: + $ref: '#/components/schemas/AnthropicMessageOutputConfig' + role: enum: - - 'mcp_approval_request' + - 'user' + - 'assistant' + - 'system' type: 'string' + x-speakeasy-unknown-values: allow required: - - 'type' - - 'id' - - 'name' - - 'arguments' - - 'server_label' + - 'role' + - 'content' type: 'object' - McpApprovalResponseItem: - description: 'User response to an MCP tool approval request' + MessagesOutputConfig: + description: 'Configuration for controlling output behavior. Supports the effort parameter and structured output format.' example: - approval_request_id: 'approval-abc123' - approve: true - reason: 'Approved for execution' - type: 'mcp_approval_response' + effort: 'medium' properties: - approval_request_id: - type: 'string' - approve: - type: 'boolean' - id: + effort: + description: 'How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer. Valid values are `low`, `medium`, `high`, `xhigh`, or `max`.' + enum: + - 'low' + - 'medium' + - 'high' + - 'xhigh' + - 'max' + - null + example: 'medium' type: - 'string' - 'null' - reason: + x-speakeasy-unknown-values: allow + format: + description: 'A schema to specify Claude''s output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs).' + properties: + schema: + additionalProperties: {} + type: 'object' + type: + enum: + - 'json_schema' + type: 'string' + required: + - 'type' + - 'schema' type: - - 'string' + - 'object' - 'null' - type: - enum: - - 'mcp_approval_response' - type: 'string' - required: - - 'type' - - 'approval_request_id' - - 'approve' - type: 'object' - McpCallItem: - description: 'An MCP tool call with its output or error' - example: - arguments: '{"query":"SELECT * FROM users"}' - id: 'mcp-call-abc123' - name: 'query_database' - output: '[{"id":1,"name":"Alice"}]' - server_label: 'database-server' - type: 'mcp_call' - properties: - arguments: - type: 'string' - error: - $ref: '#/components/schemas/McpToolCallError' - id: - type: 'string' - name: - type: 'string' - output: + task_budget: + description: 'Task budget for an agentic turn. The model sees a countdown of remaining tokens and uses it to prioritize work and wind down gracefully. Advisory — does not enforce a hard cap.' + example: + total: 400000 + type: 'tokens' + properties: + remaining: + minimum: 0 + type: + - 'integer' + - 'null' + total: + minimum: 20000 + type: 'integer' + type: + enum: + - 'tokens' + type: 'string' + required: + - 'type' + - 'total' type: - - 'string' + - 'object' - 'null' - server_label: - type: 'string' - type: - enum: - - 'mcp_call' - type: 'string' - required: - - 'type' - - 'id' - - 'name' - - 'arguments' - - 'server_label' type: 'object' - McpHttpError: - description: 'The MCP server request failed at the HTTP layer' + MessagesPingEvent: + description: 'Keep-alive ping event' example: - code: 503 - message: 'Service Unavailable' - type: 'http_error' + type: 'ping' properties: - code: - type: 'integer' - message: - type: 'string' type: enum: - - 'http_error' + - 'ping' type: 'string' required: - 'type' - - 'code' - - 'message' type: 'object' - McpListToolsItem: - description: 'List of available MCP tools from a server' + MessagesRequest: + description: 'Request schema for Anthropic Messages API endpoint' example: - id: 'mcp-list-abc123' - server_label: 'database-server' - tools: - - description: 'Execute a database query' - input_schema: - properties: - query: - type: 'string' - type: 'object' - name: 'query_database' - type: 'mcp_list_tools' + max_tokens: 1024 + messages: + - content: 'Hello, how are you?' + role: 'user' + model: 'anthropic/claude-4.5-sonnet-20250929' + temperature: 0.7 properties: - error: + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + context_management: + properties: + edits: + items: + oneOf: + - properties: + clear_at_least: + $ref: '#/components/schemas/AnthropicInputTokensClearAtLeast' + clear_tool_inputs: + anyOf: + - type: 'boolean' + - items: + type: 'string' + type: 'array' + - type: 'null' + exclude_tools: + items: + type: 'string' + type: + - 'array' + - 'null' + keep: + $ref: '#/components/schemas/AnthropicToolUsesKeep' + trigger: + discriminator: + mapping: + input_tokens: '#/components/schemas/AnthropicInputTokensTrigger' + tool_uses: '#/components/schemas/AnthropicToolUsesTrigger' + propertyName: 'type' + oneOf: + - $ref: '#/components/schemas/AnthropicInputTokensTrigger' + - $ref: '#/components/schemas/AnthropicToolUsesTrigger' + type: + enum: + - 'clear_tool_uses_20250919' + type: 'string' + required: + - 'type' + type: 'object' + - properties: + keep: + anyOf: + - $ref: '#/components/schemas/AnthropicThinkingTurns' + - properties: + type: + enum: + - 'all' + type: 'string' + required: + - 'type' + type: 'object' + - enum: + - 'all' + type: 'string' + type: + enum: + - 'clear_thinking_20251015' + type: 'string' + required: + - 'type' + type: 'object' + - properties: + instructions: + type: + - 'string' + - 'null' + pause_after_compaction: + type: 'boolean' + trigger: + anyOf: + - allOf: + - $ref: '#/components/schemas/AnthropicInputTokensTrigger' + - properties: {} + type: 'object' + - type: 'null' + example: + type: 'input_tokens' + value: 100000 + type: + enum: + - 'compact_20260112' + type: 'string' + required: + - 'type' + type: 'object' + type: 'array' type: - - 'string' + - 'object' - 'null' - id: - type: 'string' - server_label: - type: 'string' - tools: + deferred_tools: + $ref: '#/components/schemas/DeferredToolsControl' + fallbacks: + description: 'Fallback models to try if the primary model fails or refuses, in order. Handled by OpenRouter multi-model routing rather than Anthropic server-side fallbacks; cannot be combined with `models`. Each entry accepts only `model`. Maximum of 3 entries.' + example: + - model: 'claude-opus-4-8' items: - properties: - annotations: {} - description: - type: - - 'string' - - 'null' - input_schema: - additionalProperties: {} - type: 'object' - name: - type: 'string' - required: - - 'name' - - 'input_schema' - type: 'object' - type: 'array' - type: - enum: - - 'mcp_list_tools' - type: 'string' - required: - - 'type' - - 'id' - - 'server_label' - - 'tools' - type: 'object' - McpProtocolError: - description: 'The MCP server returned a protocol-level error' - example: - code: -32601 - message: 'Method not found' - type: 'mcp_protocol_error' - properties: - code: + $ref: '#/components/schemas/MessagesFallbackParam' + type: + - 'array' + - 'null' + max_tokens: type: 'integer' - message: - type: 'string' - type: - enum: - - 'mcp_protocol_error' + messages: + items: + $ref: '#/components/schemas/MessagesMessageParam' + type: + - 'array' + - 'null' + metadata: + properties: + user_id: + type: + - 'string' + - 'null' + title: 'MessagesRequestMetadata' + type: 'object' + model: type: 'string' - required: - - 'type' - - 'code' - - 'message' - type: 'object' - McpServerTool: - description: 'MCP (Model Context Protocol) tool configuration' - example: - server_label: 'my-server' - server_url: 'https://example.com/mcp' - type: 'mcp' - properties: - allowed_tools: - anyOf: - - items: - type: 'string' - type: 'array' - - properties: - read_only: - type: 'boolean' - tool_names: - items: - type: 'string' - type: 'array' - type: 'object' - - type: 'null' - authorization: - type: 'string' - connector_id: - enum: - - 'connector_dropbox' - - 'connector_gmail' - - 'connector_googlecalendar' - - 'connector_googledrive' - - 'connector_microsoftteams' - - 'connector_outlookcalendar' - - 'connector_outlookemail' - - 'connector_sharepoint' - type: 'string' - x-speakeasy-unknown-values: allow - headers: - additionalProperties: + models: + items: type: 'string' + type: 'array' + output_config: + $ref: '#/components/schemas/MessagesOutputConfig' + plugins: + description: 'Plugins you want to enable for this request, including their settings.' + items: + discriminator: + mapping: + alignment: '#/components/schemas/AlignmentPlugin' + armor: '#/components/schemas/ArmorPlugin' + auto-beta-router: '#/components/schemas/AutoBetaRouterPlugin' + auto-router: '#/components/schemas/AutoRouterPlugin' + context-compression: '#/components/schemas/ContextCompressionPlugin' + file-parser: '#/components/schemas/FileParserPlugin' + fusion: '#/components/schemas/FusionPlugin' + jev-router: '#/components/schemas/JevRouterPlugin' + moderation: '#/components/schemas/ModerationPlugin' + pareto-router: '#/components/schemas/ParetoRouterPlugin' + response-healing: '#/components/schemas/ResponseHealingPlugin' + switchyard-router: '#/components/schemas/SwitchyardRouterPlugin' + web: '#/components/schemas/WebSearchPlugin' + web-fetch: '#/components/schemas/WebFetchPlugin' + propertyName: 'id' + oneOf: + - $ref: '#/components/schemas/AutoRouterPlugin' + - $ref: '#/components/schemas/AutoBetaRouterPlugin' + - $ref: '#/components/schemas/ModerationPlugin' + - $ref: '#/components/schemas/WebSearchPlugin' + - $ref: '#/components/schemas/WebFetchPlugin' + - $ref: '#/components/schemas/FileParserPlugin' + - $ref: '#/components/schemas/ResponseHealingPlugin' + - $ref: '#/components/schemas/ContextCompressionPlugin' + - $ref: '#/components/schemas/ParetoRouterPlugin' + - $ref: '#/components/schemas/FusionPlugin' + - $ref: '#/components/schemas/SwitchyardRouterPlugin' + - $ref: '#/components/schemas/JevRouterPlugin' + - $ref: '#/components/schemas/AlignmentPlugin' + - $ref: '#/components/schemas/ArmorPlugin' + type: 'array' + provider: + $ref: '#/components/schemas/ProviderPreferences' + route: + $ref: '#/components/schemas/DeprecatedRoute' + safeguards: + items: + $ref: '#/components/schemas/AnthropicSafeguard' type: - - 'object' - - 'null' - require_approval: - anyOf: - - properties: - always: - properties: - tool_names: - items: - type: 'string' - type: 'array' - type: 'object' - never: - properties: - tool_names: - items: - type: 'string' - type: 'array' - type: 'object' - type: 'object' - - enum: - - 'always' - type: 'string' - - enum: - - 'never' - type: 'string' - - type: 'null' - server_description: - type: 'string' - server_label: - type: 'string' - server_url: - type: 'string' - type: - enum: - - 'mcp' - type: 'string' - required: - - 'type' - - 'server_label' - type: 'object' - McpToolCallError: - anyOf: - - type: 'string' - - $ref: '#/components/schemas/McpProtocolError' - - $ref: '#/components/schemas/McpToolExecutionError' - - $ref: '#/components/schemas/McpHttpError' - - type: 'null' - description: 'Error from an MCP tool call, either a plain message or a structured error' - example: - code: 503 - message: 'Service Unavailable' - type: 'http_error' - McpToolExecutionError: - description: 'The MCP tool ran but reported a failure' - example: - content: 'Connection refused' - type: 'mcp_tool_execution_error' - properties: - content: {} - type: - enum: - - 'mcp_tool_execution_error' - type: 'string' - required: - - 'type' - type: 'object' - MemberAssignment: - example: - assigned_by: 'user_abc123' - created_at: '2025-08-24T10:30:00Z' - guardrail_id: '550e8400-e29b-41d4-a716-446655440001' - id: '550e8400-e29b-41d4-a716-446655440000' - organization_id: 'org_xyz789' - user_id: 'user_abc123' - properties: - assigned_by: - description: 'User ID of who made the assignment' - example: 'user_abc123' - type: - - 'string' + - 'array' - 'null' - created_at: - description: 'ISO 8601 timestamp of when the assignment was created' - example: '2025-08-24T10:30:00Z' - type: 'string' - guardrail_id: - description: 'ID of the guardrail' - example: '550e8400-e29b-41d4-a716-446655440001' - format: 'uuid' - type: 'string' - id: - description: 'Unique identifier for the assignment' - example: '550e8400-e29b-41d4-a716-446655440000' - format: 'uuid' - type: 'string' - organization_id: - description: 'Organization ID' - example: 'org_xyz789' - type: 'string' - user_id: - description: 'Clerk user ID of the assigned member' - example: 'user_abc123' - type: 'string' - required: - - 'id' - - 'user_id' - - 'organization_id' - - 'guardrail_id' - - 'assigned_by' - - 'created_at' - type: 'object' - MessagesAdvisorToolResultBlock: - description: 'Advisor tool result from a prior assistant turn, replayed back to the model on the next turn. Mirrors the block Anthropic returns in assistant content when the `advisor_20260301` tool runs.' - example: - content: - text: 'Advisor response text' - type: 'advisor_result' - tool_use_id: 'srvtoolu_01abc' - type: 'advisor_tool_result' - properties: - content: - additionalProperties: {} - type: 'object' - tool_use_id: - type: 'string' - type: - enum: - - 'advisor_tool_result' + service_tier: type: 'string' - required: - - 'type' - - 'tool_use_id' - - 'content' - type: 'object' - MessagesBashToolResultBlock: - description: 'Output of a sandbox-executed `openrouter:bash` call from a prior assistant turn. Accepted on replay and dropped before the provider request — Anthropic has no equivalent block.' - example: - content: - command: 'ls' - exitCode: 0 - stderr: '' - stdout: "README.md\n" - tool_use_id: 'srvtoolu_01abc' - type: 'openrouter_bash_tool_result' - properties: - container_id: - description: 'The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed.' + session_id: + description: 'A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.' + maxLength: 256 type: 'string' - content: - additionalProperties: {} - type: 'object' - files: - description: 'Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API.' + speed: + allOf: + - $ref: '#/components/schemas/AnthropicSpeed' + - description: 'Controls output generation speed. When set to `fast`, uses a higher-speed inference configuration at premium pricing. Defaults to `standard` when omitted.' + example: 'fast' + stop_sequences: items: - properties: - container_id: - type: 'string' - end_index: - type: 'integer' - file_id: - type: 'string' - filename: - type: 'string' - start_index: - type: 'integer' - type: - enum: - - 'container_file_citation' - type: 'string' - required: - - 'type' - - 'container_id' - - 'file_id' - - 'filename' - - 'start_index' - - 'end_index' - type: 'object' + type: 'string' type: 'array' - tool_use_id: - type: 'string' - type: - enum: - - 'openrouter_bash_tool_result' - type: 'string' - required: - - 'type' - - 'tool_use_id' - - 'content' - type: 'object' - MessagesContentBlockDeltaEvent: - description: 'Event sent when content is added to a content block' - example: - delta: - text: 'Hello' - type: 'text_delta' - index: 0 - type: 'content_block_delta' - properties: - delta: + stop_server_tools_when: + $ref: '#/components/schemas/StopServerToolsWhen' + stream: + type: 'boolean' + system: + anyOf: + - type: 'string' + - items: + $ref: '#/components/schemas/AnthropicTextBlockParam' + type: 'array' + temperature: + format: 'double' + type: 'number' + thinking: oneOf: - properties: - text: - type: 'string' + block_binding: + $ref: '#/components/schemas/AnthropicThinkingBlockBinding' + budget_tokens: + type: 'integer' + display: + $ref: '#/components/schemas/AnthropicThinkingDisplay' type: enum: - - 'text_delta' + - 'enabled' type: 'string' required: - 'type' - - 'text' + - 'budget_tokens' type: 'object' - properties: - partial_json: - type: 'string' type: enum: - - 'input_json_delta' + - 'disabled' type: 'string' required: - 'type' - - 'partial_json' type: 'object' - properties: - thinking: + block_binding: + $ref: '#/components/schemas/AnthropicThinkingBlockBinding' + display: + $ref: '#/components/schemas/AnthropicThinkingDisplay' + type: + enum: + - 'adaptive' type: 'string' + required: + - 'type' + type: 'object' + - additionalProperties: false + properties: type: enum: - - 'thinking_delta' + - 'between_tools' type: 'string' required: - 'type' - - 'thinking' type: 'object' + tool_choice: + oneOf: - properties: - signature: - type: 'string' + disable_parallel_tool_use: + type: 'boolean' type: enum: - - 'signature_delta' + - 'auto' type: 'string' required: - 'type' - - 'signature' type: 'object' - properties: - citation: - discriminator: - mapping: - char_location: '#/components/schemas/AnthropicCitationCharLocation' - content_block_location: '#/components/schemas/AnthropicCitationContentBlockLocation' - page_location: '#/components/schemas/AnthropicCitationPageLocation' - search_result_location: '#/components/schemas/AnthropicCitationSearchResultLocation' - web_search_result_location: '#/components/schemas/AnthropicCitationWebSearchResultLocation' - propertyName: 'type' - oneOf: - - $ref: '#/components/schemas/AnthropicCitationCharLocation' - - $ref: '#/components/schemas/AnthropicCitationPageLocation' - - $ref: '#/components/schemas/AnthropicCitationContentBlockLocation' - - $ref: '#/components/schemas/AnthropicCitationWebSearchResultLocation' - - $ref: '#/components/schemas/AnthropicCitationSearchResultLocation' + disable_parallel_tool_use: + type: 'boolean' type: enum: - - 'citations_delta' + - 'any' type: 'string' required: - 'type' - - 'citation' type: 'object' - properties: - content: - type: - - 'string' - - 'null' - encrypted_content: - type: - - 'string' - - 'null' type: enum: - - 'compaction_delta' + - 'none' type: 'string' required: - 'type' - - 'content' type: 'object' - index: - type: 'integer' - type: - enum: - - 'content_block_delta' - type: 'string' - required: - - 'type' - - 'index' - - 'delta' - type: 'object' - MessagesContentBlockStartEvent: - description: 'Event sent when a new content block starts' - example: - content_block: - citations: [] - text: '' - type: 'text' - index: 0 - type: 'content_block_start' - properties: - content_block: - anyOf: - - $ref: '#/components/schemas/AnthropicTextBlock' - - $ref: '#/components/schemas/AnthropicToolUseBlock' - - $ref: '#/components/schemas/AnthropicThinkingBlock' - - $ref: '#/components/schemas/AnthropicRedactedThinkingBlock' - - $ref: '#/components/schemas/ORAnthropicServerToolUseBlock' - - $ref: '#/components/schemas/AnthropicWebSearchToolResult' - - $ref: '#/components/schemas/AnthropicWebFetchToolResult' - - $ref: '#/components/schemas/AnthropicCodeExecutionToolResult' - - $ref: '#/components/schemas/AnthropicBashCodeExecutionToolResult' - - $ref: '#/components/schemas/AnthropicTextEditorCodeExecutionToolResult' - - $ref: '#/components/schemas/AnthropicToolSearchToolResult' - - $ref: '#/components/schemas/AnthropicContainerUpload' - - $ref: '#/components/schemas/AnthropicCompactionBlock' - - $ref: '#/components/schemas/AnthropicAdvisorToolResult' - - $ref: '#/components/schemas/ORAnthropicShellToolResult' - - $ref: '#/components/schemas/ORAnthropicBashToolResult' - - $ref: '#/components/schemas/ORAnthropicToolSearchResult' - properties: - content: - type: - - 'string' - - 'null' - encrypted_content: - type: - - 'string' - - 'null' + disable_parallel_tool_use: + type: 'boolean' + name: + type: 'string' type: enum: - - 'compaction' + - 'tool' type: 'string' required: - 'type' - - 'content' + - 'name' type: 'object' - index: - type: 'integer' - type: - enum: - - 'content_block_start' - type: 'string' - required: - - 'type' - - 'index' - - 'content_block' - type: 'object' - MessagesContentBlockStopEvent: - description: 'Event sent when a content block is complete' - example: - index: 0 - type: 'content_block_stop' - properties: - index: - type: 'integer' - type: - enum: - - 'content_block_stop' - type: 'string' - required: - - 'type' - - 'index' - type: 'object' - MessagesDeltaEvent: - description: 'Event sent when the message metadata changes (e.g., stop_reason)' - example: - delta: - container: null - stop_details: null - stop_reason: 'end_turn' - stop_sequence: null - type: 'message_delta' - usage: - cache_creation_input_tokens: null - cache_read_input_tokens: null - input_tokens: null - output_tokens: 15 - output_tokens_details: null - server_tool_use: null - properties: - delta: - properties: - container: - $ref: '#/components/schemas/AnthropicContainer' - safeguard_results: - items: - $ref: '#/components/schemas/AnthropicSafeguardResult' - type: - - 'array' - - 'null' - stop_details: - $ref: '#/components/schemas/AnthropicRefusalStopDetails' - stop_reason: - $ref: '#/components/schemas/ORAnthropicStopReason' - stop_sequence: - type: - - 'string' - - 'null' - required: - - 'container' - - 'stop_details' - - 'stop_reason' - - 'stop_sequence' - type: 'object' - type: - enum: - - 'message_delta' - type: 'string' - usage: - properties: - cache_creation: - $ref: '#/components/schemas/AnthropicCacheCreation' - cache_creation_input_tokens: - type: - - 'integer' - - 'null' - cache_read_input_tokens: - type: - - 'integer' - - 'null' - input_tokens: + tools: + items: + anyOf: + - properties: + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + defer_loading: + type: 'boolean' + description: + type: 'string' + input_schema: + additionalProperties: {} + properties: + properties: {} + required: + items: + type: 'string' + type: + - 'array' + - 'null' + type: + default: 'object' + type: 'string' + type: 'object' + name: + type: 'string' + strict: + type: 'boolean' + type: + enum: + - 'custom' + type: 'string' + required: + - 'name' + - 'input_schema' + type: 'object' + - properties: + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + name: + enum: + - 'bash' + type: 'string' + type: + enum: + - 'bash_20250124' + type: 'string' + required: + - 'type' + - 'name' + type: 'object' + - properties: + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + name: + enum: + - 'str_replace_editor' + type: 'string' + type: + enum: + - 'text_editor_20250124' + type: 'string' + required: + - 'type' + - 'name' + type: 'object' + - properties: + allowed_domains: + items: + type: 'string' + type: + - 'array' + - 'null' + blocked_domains: + items: + type: 'string' + type: + - 'array' + - 'null' + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + max_uses: + type: + - 'integer' + - 'null' + name: + enum: + - 'web_search' + type: 'string' + type: + enum: + - 'web_search_20250305' + type: 'string' + user_location: + $ref: '#/components/schemas/AnthropicWebSearchToolUserLocation' + required: + - 'type' + - 'name' + type: 'object' + - properties: + allowed_callers: + $ref: '#/components/schemas/AnthropicAllowedCallers' + allowed_domains: + items: + type: 'string' + type: + - 'array' + - 'null' + blocked_domains: + items: + type: 'string' + type: + - 'array' + - 'null' + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + max_uses: + type: + - 'integer' + - 'null' + name: + enum: + - 'web_search' + type: 'string' + type: + enum: + - 'web_search_20260209' + type: 'string' + user_location: + $ref: '#/components/schemas/AnthropicWebSearchToolUserLocation' + required: + - 'type' + - 'name' + type: 'object' + - properties: + allowed_callers: + $ref: '#/components/schemas/AnthropicAllowedCallers' + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + caching: + anyOf: + - $ref: '#/components/schemas/AnthropicCacheControlDirective' + - type: 'null' + defer_loading: + type: 'boolean' + max_uses: + type: 'integer' + model: + type: 'string' + name: + enum: + - 'advisor' + type: 'string' + type: + enum: + - 'advisor_20260301' + type: 'string' + required: + - 'type' + - 'name' + - 'model' + type: 'object' + - $ref: '#/components/schemas/BashServerTool' + - $ref: '#/components/schemas/DatetimeServerTool' + - $ref: '#/components/schemas/ImageGenerationServerTool_OpenRouter' + - $ref: '#/components/schemas/MessagesSearchModelsServerTool' + - $ref: '#/components/schemas/WebFetchServerTool' + - $ref: '#/components/schemas/OpenRouterWebSearchServerTool' + - additionalProperties: {} + properties: + type: + type: 'string' + required: + - 'type' + type: 'object' + - $ref: '#/components/schemas/AnthropicToolSearchToolBm25' + - $ref: '#/components/schemas/AnthropicToolSearchToolRegex' + - $ref: '#/components/schemas/ShellServerTool_OpenRouter' + - $ref: '#/components/schemas/ToolSearchServerTool' + type: 'array' + top_k: + type: 'integer' + top_p: + format: 'double' + type: 'number' + trace: + $ref: '#/components/schemas/TraceConfig' + user: + description: 'A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 256 characters.' + maxLength: 256 + type: 'string' + required: + - 'model' + - 'messages' + type: 'object' + MessagesResult: + allOf: + - $ref: '#/components/schemas/BaseMessagesResult' + - properties: + context_management: + properties: + applied_edits: + items: + additionalProperties: {} + properties: + type: + type: 'string' + required: + - 'type' + type: 'object' + type: 'array' + required: + - 'applied_edits' type: - - 'integer' + - 'object' - 'null' - iterations: + openrouter_metadata: + $ref: '#/components/schemas/OpenRouterMetadata' + provider: + type: 'string' + safeguard_results: items: - $ref: '#/components/schemas/AnthropicUsageIteration' - type: 'array' - output_tokens: - type: 'integer' - output_tokens_details: - $ref: '#/components/schemas/AnthropicOutputTokensDetails' - server_tool_use: - $ref: '#/components/schemas/ORAnthropicServerToolUsage' - required: - - 'input_tokens' - - 'output_tokens' - - 'output_tokens_details' - - 'cache_creation_input_tokens' - - 'cache_read_input_tokens' - - 'server_tool_use' + $ref: '#/components/schemas/AnthropicSafeguardResult' + type: + - 'array' + - 'null' + usage: + allOf: + - $ref: '#/components/schemas/AnthropicUsage' + - properties: + cost: + format: 'double' + type: + - 'number' + - 'null' + cost_details: + $ref: '#/components/schemas/CostDetails' + is_byok: + type: 'boolean' + iterations: + items: + $ref: '#/components/schemas/AnthropicUsageIteration' + type: 'array' + server_tool_use: + $ref: '#/components/schemas/ORAnthropicServerToolUsage' + service_tier: + type: + - 'string' + - 'null' + speed: + $ref: '#/components/schemas/AnthropicSpeed' + type: 'object' + example: + cache_creation: null + cache_creation_input_tokens: null + cache_read_input_tokens: null + inference_geo: null + input_tokens: 100 + output_tokens: 50 + output_tokens_details: null + server_tool_use: null + service_tier: 'standard' type: 'object' - required: - - 'type' - - 'delta' - - 'usage' - type: 'object' - MessagesErrorEvent: - description: 'Error event in the stream' + description: 'Non-streaming response from the Anthropic Messages API with OpenRouter extensions' example: - error: - error_type: 'provider_overloaded' - message: 'Overloaded' - type: 'overloaded_error' - type: 'error' + container: null + content: + - citations: [] + text: 'Hello! I''m doing well, thank you for asking.' + type: 'text' + id: 'msg_01XFDUDYJgAACzvnptvVoYEL' + model: 'claude-sonnet-4-5-20250929' + role: 'assistant' + stop_details: null + stop_reason: 'end_turn' + stop_sequence: null + type: 'message' + usage: + cache_creation: null + cache_creation_input_tokens: null + cache_read_input_tokens: null + inference_geo: null + input_tokens: 12 + output_tokens: 15 + output_tokens_details: null + server_tool_use: null + service_tier: 'standard' + MessagesSearchModelsServerTool: + description: 'OpenRouter built-in server tool: searches and filters AI models available on OpenRouter' + example: + parameters: + max_results: 5 + type: 'openrouter:experimental__search_models' properties: - error: - properties: - error_type: - $ref: '#/components/schemas/ApiErrorType' - message: - type: 'string' - type: - type: 'string' - required: - - 'type' - - 'message' - type: 'object' - openrouter_metadata: - $ref: '#/components/schemas/OpenRouterMetadata' + parameters: + $ref: '#/components/schemas/SearchModelsServerToolConfig' type: enum: - - 'error' + - 'openrouter:experimental__search_models' type: 'string' required: - 'type' - - 'error' type: 'object' - MessagesFallbackParam: - additionalProperties: {} - description: 'Fallback model to try when the primary model fails or refuses. Only the `model` field is supported; per-attempt overrides are rejected.' + MessagesShellToolResultBlock: + description: 'Output of an `openrouter:shell` call from a prior assistant turn. Accepted on replay and dropped before the provider request — Anthropic has no equivalent block.' example: - model: 'claude-opus-4-8' + content: + output: + - outcome: + exit_code: 0 + type: 'exit' + stderr: '' + stdout: "README.md\n" + tool_use_id: 'srvtoolu_01abc' + type: 'openrouter_shell_tool_result' properties: - model: + container_id: + description: 'The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed.' + type: 'string' + content: + additionalProperties: {} + type: 'object' + files: + description: 'Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API.' + items: + properties: + container_id: + type: 'string' + end_index: + type: 'integer' + file_id: + type: 'string' + filename: + type: 'string' + start_index: + type: 'integer' + type: + enum: + - 'container_file_citation' + type: 'string' + required: + - 'type' + - 'container_id' + - 'file_id' + - 'filename' + - 'start_index' + - 'end_index' + type: 'object' + type: 'array' + tool_use_id: + type: 'string' + type: + enum: + - 'openrouter_shell_tool_result' type: 'string' required: - - 'model' + - 'type' + - 'tool_use_id' + - 'content' type: 'object' - MessagesMessageParam: - description: 'Anthropic message with OpenRouter extensions' + MessagesStartEvent: + description: 'Event sent at the start of a streaming message' example: - content: 'Hello, how are you?' - role: 'user' + message: + container: null + content: [] + id: 'msg_01XFDUDYJgAACzvnptvVoYEL' + model: 'claude-sonnet-4-5-20250929' + role: 'assistant' + stop_details: null + stop_reason: null + stop_sequence: null + type: 'message' + usage: + cache_creation: null + cache_creation_input_tokens: null + cache_read_input_tokens: null + inference_geo: null + input_tokens: 12 + output_tokens: 0 + output_tokens_details: null + server_tool_use: null + service_tier: 'standard' + type: 'message_start' properties: - clear_at: - $ref: '#/components/schemas/AnthropicSystemClearAt' - content: - anyOf: - - type: 'string' - - items: - oneOf: - - $ref: '#/components/schemas/AnthropicTextBlockParam' - - $ref: '#/components/schemas/AnthropicImageBlockParam' - - $ref: '#/components/schemas/AnthropicDocumentBlockParam' - - properties: - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - id: - type: 'string' - input: {} - name: - type: 'string' - type: - enum: - - 'tool_use' - type: 'string' - required: - - 'type' - - 'id' - - 'name' - type: 'object' - - properties: - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - content: - anyOf: - - type: 'string' - - items: - anyOf: - - $ref: '#/components/schemas/AnthropicTextBlockParam' - - $ref: '#/components/schemas/AnthropicImageBlockParam' - - properties: - tool_name: - type: 'string' - type: - enum: - - 'tool_reference' - type: 'string' - required: - - 'type' - - 'tool_name' - type: 'object' - - $ref: '#/components/schemas/AnthropicSearchResultBlockParam' - - $ref: '#/components/schemas/AnthropicDocumentBlockParam' - type: 'array' - is_error: - type: 'boolean' - tool_use_id: - type: 'string' - type: - enum: - - 'tool_result' - type: 'string' - required: - - 'type' - - 'tool_use_id' - type: 'object' - - properties: - signature: - type: 'string' - thinking: - type: 'string' - type: - enum: - - 'thinking' - type: 'string' - required: - - 'type' - - 'thinking' - - 'signature' - type: 'object' - - properties: - data: - type: 'string' - type: - enum: - - 'redacted_thinking' - type: 'string' - required: - - 'type' - - 'data' - type: 'object' - - properties: - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - id: - type: 'string' - input: {} - name: - type: 'string' - type: - enum: - - 'server_tool_use' - type: 'string' - required: - - 'type' - - 'id' - - 'name' - type: 'object' - - properties: - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - content: - anyOf: - - items: - $ref: '#/components/schemas/AnthropicWebSearchResultBlockParam' - type: 'array' - - properties: - error_code: - enum: - - 'invalid_tool_input' - - 'unavailable' - - 'max_uses_exceeded' - - 'too_many_requests' - - 'query_too_long' - - 'request_too_large' - type: 'string' - x-speakeasy-unknown-values: allow - type: - enum: - - 'web_search_tool_result_error' - type: 'string' - required: - - 'type' - - 'error_code' - type: 'object' - tool_use_id: - type: 'string' - type: - enum: - - 'web_search_tool_result' - type: 'string' - required: - - 'type' - - 'tool_use_id' - - 'content' - type: 'object' - - $ref: '#/components/schemas/AnthropicSearchResultBlockParam' - - properties: - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - content: - type: - - 'string' - - 'null' - encrypted_content: - type: - - 'string' - - 'null' - type: - enum: - - 'compaction' - type: 'string' - required: - - 'type' - - 'content' - type: 'object' - - $ref: '#/components/schemas/MessagesAdvisorToolResultBlock' - - $ref: '#/components/schemas/MessagesToolAdditionBlock' - - $ref: '#/components/schemas/MessagesToolRemovalBlock' - - $ref: '#/components/schemas/MessagesShellToolResultBlock' - - $ref: '#/components/schemas/MessagesBashToolResultBlock' - - $ref: '#/components/schemas/ORAnthropicToolSearchResultParam' - type: 'array' - output_config: - $ref: '#/components/schemas/AnthropicMessageOutputConfig' - role: - enum: - - 'user' - - 'assistant' - - 'system' - type: 'string' - x-speakeasy-unknown-values: allow - required: - - 'role' - - 'content' - type: 'object' - MessagesOutputConfig: - description: 'Configuration for controlling output behavior. Supports the effort parameter and structured output format.' - example: - effort: 'medium' - properties: - effort: - description: 'How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer. Valid values are `low`, `medium`, `high`, `xhigh`, or `max`.' - enum: - - 'low' - - 'medium' - - 'high' - - 'xhigh' - - 'max' - - null - example: 'medium' - type: - - 'string' - - 'null' - x-speakeasy-unknown-values: allow - format: - description: 'A schema to specify Claude''s output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs).' + message: properties: - schema: - additionalProperties: {} - type: 'object' - type: - enum: - - 'json_schema' + container: + $ref: '#/components/schemas/AnthropicContainer' + content: + items: + $ref: '#/components/schemas/ORAnthropicContentBlock' + type: 'array' + id: type: 'string' - required: - - 'type' - - 'schema' - type: - - 'object' - - 'null' - task_budget: - description: 'Task budget for an agentic turn. The model sees a countdown of remaining tokens and uses it to prioritize work and wind down gracefully. Advisory — does not enforce a hard cap.' - example: - total: 400000 - type: 'tokens' - properties: - remaining: - minimum: 0 + input_transformations: + items: + $ref: '#/components/schemas/AnthropicInputTransformation' type: - - 'integer' + - 'array' - 'null' - total: - minimum: 20000 - type: 'integer' + model: + type: 'string' + provider: + enum: + - 'AnyScale' + - 'Atoma' + - 'Cent-ML' + - 'CrofAI' + - 'Enfer' + - 'GoPomelo' + - 'HuggingFace' + - 'Hyperbolic' + - 'Hyperbolic 2' + - 'InoCloud' + - 'Kluster' + - 'Lambda' + - 'Lepton' + - 'Lynn 2' + - 'Lynn' + - 'Mancer' + - 'Modal' + - 'NCompass' + - 'Nineteen' + - 'OctoAI' + - 'Recursal' + - 'Reflection' + - 'Replicate' + - 'SambaNova 2' + - 'SF Compute' + - 'Targon' + - 'Together 2' + - 'Ubicloud' + - '01.AI' + - 'AkashML' + - 'AI21' + - 'AionLabs' + - 'Alibaba' + - 'Ambient' + - 'Baidu' + - 'Amazon Bedrock' + - 'Amazon Nova' + - 'Anthropic' + - 'Arcee AI' + - 'AssemblyAI' + - 'AtlasCloud' + - 'Avian' + - 'Azure' + - 'BaseTen' + - 'BytePlus' + - 'Black Forest Labs' + - 'Cerebras' + - 'Chutes' + - 'Cirrascale' + - 'Claude Platform on AWS' + - 'Clarifai' + - 'Cloudflare' + - 'Cohere' + - 'CoreWeave' + - 'Cosine' + - 'Crucible' + - 'Crusoe' + - 'Darkbloom' + - 'Databricks' + - 'Decart' + - 'Deepgram' + - 'DeepInfra' + - 'DeepSeek' + - 'DekaLLM' + - 'DigitalOcean' + - 'ElevenLabs' + - 'Featherless' + - 'Fireworks' + - 'Fish Audio' + - 'Friendli' + - 'GMICloud' + - 'Google' + - 'Google AI Studio' + - 'Groq' + - 'HeyGen' + - 'Inception' + - 'Inceptron' + - 'InferenceNet' + - 'Ionstream' + - 'Infermatic' + - 'Io Net' + - 'Inferact vLLM' + - 'Inflection' + - 'Liquid' + - 'Makora' + - 'Mara' + - 'Mancer 2' + - 'Meta' + - 'Minimax' + - 'ModelRun' + - 'Mistral' + - 'Modular' + - 'Moonshot AI' + - 'Morph' + - 'VoyageAI by MongoDB' + - 'TypeSafe' + - 'Near AI' + - 'Nebius' + - 'Nex AGI' + - 'NextBit' + - 'Novita' + - 'Nvidia' + - 'Ollama' + - 'OpenAI' + - 'OpenInference' + - 'Parasail' + - 'ParetoAlpha' + - 'Poolside' + - 'PrimeIntellect' + - 'Perceptron' + - 'Perplexity' + - 'Phala' + - 'Recraft' + - 'Recursive' + - 'Reka' + - 'Relace' + - 'Respan' + - 'Sail Research' + - 'Sakana AI' + - 'SambaNova' + - 'ScaleDown' + - 'Seed' + - 'SiliconFlow' + - 'Sourceful' + - 'StepFun' + - 'Stealth' + - 'StreamLake' + - 'Switchpoint' + - 'Tencent' + - 'Tenstorrent' + - 'Thinking Machines' + - 'Together' + - 'Unbiased' + - 'Upstage' + - 'Venice' + - 'Wafer' + - 'WandB' + - 'Quiver' + - 'Krea' + - 'Runway' + - 'Xiaomi' + - 'xAI' + - 'Z.AI' + - 'FakeProvider' + type: 'string' + x-speakeasy-unknown-values: 'allow' + role: + enum: + - 'assistant' + type: 'string' + stop_details: + $ref: '#/components/schemas/AnthropicRefusalStopDetails' + stop_reason: {} + stop_sequence: {} type: enum: - - 'tokens' + - 'message' type: 'string' + usage: + allOf: + - $ref: '#/components/schemas/AnthropicUsage' + - properties: + iterations: + items: + $ref: '#/components/schemas/AnthropicUsageIteration' + type: 'array' + speed: + $ref: '#/components/schemas/AnthropicSpeed' + type: 'object' + example: + cache_creation: + ephemeral_1h_input_tokens: 0 + ephemeral_5m_input_tokens: 7381 + cache_creation_input_tokens: 7381 + cache_read_input_tokens: 0 + inference_geo: null + input_tokens: 100 + output_tokens: 1 + output_tokens_details: null + server_tool_use: null + service_tier: 'standard' required: + - 'id' - 'type' - - 'total' - type: - - 'object' - - 'null' + - 'role' + - 'container' + - 'content' + - 'model' + - 'stop_reason' + - 'stop_details' + - 'stop_sequence' + - 'usage' + type: 'object' + type: + enum: + - 'message_start' + type: 'string' + required: + - 'type' + - 'message' type: 'object' - MessagesPingEvent: - description: 'Keep-alive ping event' + MessagesStopEvent: + description: 'Event sent when the message is complete' example: - type: 'ping' + type: 'message_stop' properties: + openrouter_metadata: + $ref: '#/components/schemas/OpenRouterMetadata' type: enum: - - 'ping' + - 'message_stop' type: 'string' required: - 'type' type: 'object' - MessagesRequest: - description: 'Request schema for Anthropic Messages API endpoint' + MessagesStreamEvents: + description: 'Union of all possible streaming events' + discriminator: + mapping: + content_block_delta: '#/components/schemas/MessagesContentBlockDeltaEvent' + content_block_start: '#/components/schemas/MessagesContentBlockStartEvent' + content_block_stop: '#/components/schemas/MessagesContentBlockStopEvent' + error: '#/components/schemas/MessagesErrorEvent' + message_delta: '#/components/schemas/MessagesDeltaEvent' + message_start: '#/components/schemas/MessagesStartEvent' + message_stop: '#/components/schemas/MessagesStopEvent' + ping: '#/components/schemas/MessagesPingEvent' + propertyName: 'type' example: - max_tokens: 1024 - messages: - - content: 'Hello, how are you?' - role: 'user' - model: 'anthropic/claude-4.5-sonnet-20250929' - temperature: 0.7 + delta: + text: 'Hello' + type: 'text_delta' + index: 0 + type: 'content_block_delta' + oneOf: + - $ref: '#/components/schemas/MessagesStartEvent' + - $ref: '#/components/schemas/MessagesDeltaEvent' + - $ref: '#/components/schemas/MessagesStopEvent' + - $ref: '#/components/schemas/MessagesContentBlockStartEvent' + - $ref: '#/components/schemas/MessagesContentBlockDeltaEvent' + - $ref: '#/components/schemas/MessagesContentBlockStopEvent' + - $ref: '#/components/schemas/MessagesPingEvent' + - $ref: '#/components/schemas/MessagesErrorEvent' + MessagesStreamingResponse: + example: + data: + delta: + text: 'Hello' + type: 'text_delta' + index: 0 + type: 'content_block_delta' + event: 'content_block_delta' + properties: + data: + $ref: '#/components/schemas/MessagesStreamEvents' + event: + type: 'string' + required: + - 'event' + - 'data' + type: 'object' + MessagesToolAdditionBlock: + description: 'Loads a previously deferred tool (declared in `tools` with `defer_loading: true`) mid-conversation without invalidating the prompt cache. Only valid in `role: "system"` messages. Not supported on Claude Sonnet 5 or models older than Claude Opus 4.8.' + example: + tool: + name: 'get_forecast' + type: 'tool_reference' + type: 'tool_addition' properties: cache_control: $ref: '#/components/schemas/AnthropicCacheControlDirective' - context_management: - properties: - edits: - items: - oneOf: - - properties: - clear_at_least: - $ref: '#/components/schemas/AnthropicInputTokensClearAtLeast' - clear_tool_inputs: - anyOf: - - type: 'boolean' - - items: - type: 'string' - type: 'array' - - type: 'null' - exclude_tools: - items: - type: 'string' - type: - - 'array' - - 'null' - keep: - $ref: '#/components/schemas/AnthropicToolUsesKeep' - trigger: - discriminator: - mapping: - input_tokens: '#/components/schemas/AnthropicInputTokensTrigger' - tool_uses: '#/components/schemas/AnthropicToolUsesTrigger' - propertyName: 'type' - oneOf: - - $ref: '#/components/schemas/AnthropicInputTokensTrigger' - - $ref: '#/components/schemas/AnthropicToolUsesTrigger' - type: - enum: - - 'clear_tool_uses_20250919' - type: 'string' - required: - - 'type' - type: 'object' - - properties: - keep: - anyOf: - - $ref: '#/components/schemas/AnthropicThinkingTurns' - - properties: - type: - enum: - - 'all' - type: 'string' - required: - - 'type' - type: 'object' - - enum: - - 'all' - type: 'string' - type: - enum: - - 'clear_thinking_20251015' - type: 'string' - required: - - 'type' - type: 'object' - - properties: - instructions: - type: - - 'string' - - 'null' - pause_after_compaction: - type: 'boolean' - trigger: - anyOf: - - allOf: - - $ref: '#/components/schemas/AnthropicInputTokensTrigger' - - properties: {} - type: 'object' - - type: 'null' - example: - type: 'input_tokens' - value: 100000 - type: - enum: - - 'compact_20260112' - type: 'string' - required: - - 'type' - type: 'object' - type: 'array' - type: - - 'object' - - 'null' - deferred_tools: - $ref: '#/components/schemas/DeferredToolsControl' - fallbacks: - description: 'Fallback models to try if the primary model fails or refuses, in order. Handled by OpenRouter multi-model routing rather than Anthropic server-side fallbacks; cannot be combined with `models`. Each entry accepts only `model`. Maximum of 3 entries.' - example: - - model: 'claude-opus-4-8' - items: - $ref: '#/components/schemas/MessagesFallbackParam' - type: - - 'array' - - 'null' - max_tokens: - type: 'integer' - messages: - items: - $ref: '#/components/schemas/MessagesMessageParam' - type: - - 'array' - - 'null' - metadata: - properties: - user_id: - type: - - 'string' - - 'null' - type: 'object' - model: - type: 'string' - models: - items: - type: 'string' - type: 'array' - output_config: - $ref: '#/components/schemas/MessagesOutputConfig' - plugins: - description: 'Plugins you want to enable for this request, including their settings.' - items: - discriminator: - mapping: - alignment: '#/components/schemas/AlignmentPlugin' - armor: '#/components/schemas/ArmorPlugin' - auto-beta-router: '#/components/schemas/AutoBetaRouterPlugin' - auto-router: '#/components/schemas/AutoRouterPlugin' - context-compression: '#/components/schemas/ContextCompressionPlugin' - file-parser: '#/components/schemas/FileParserPlugin' - fusion: '#/components/schemas/FusionPlugin' - jev-router: '#/components/schemas/JevRouterPlugin' - moderation: '#/components/schemas/ModerationPlugin' - pareto-router: '#/components/schemas/ParetoRouterPlugin' - response-healing: '#/components/schemas/ResponseHealingPlugin' - switchyard-router: '#/components/schemas/SwitchyardRouterPlugin' - web: '#/components/schemas/WebSearchPlugin' - web-fetch: '#/components/schemas/WebFetchPlugin' - propertyName: 'id' - oneOf: - - $ref: '#/components/schemas/AutoRouterPlugin' - - $ref: '#/components/schemas/AutoBetaRouterPlugin' - - $ref: '#/components/schemas/ModerationPlugin' - - $ref: '#/components/schemas/WebSearchPlugin' - - $ref: '#/components/schemas/WebFetchPlugin' - - $ref: '#/components/schemas/FileParserPlugin' - - $ref: '#/components/schemas/ResponseHealingPlugin' - - $ref: '#/components/schemas/ContextCompressionPlugin' - - $ref: '#/components/schemas/ParetoRouterPlugin' - - $ref: '#/components/schemas/FusionPlugin' - - $ref: '#/components/schemas/SwitchyardRouterPlugin' - - $ref: '#/components/schemas/JevRouterPlugin' - - $ref: '#/components/schemas/AlignmentPlugin' - - $ref: '#/components/schemas/ArmorPlugin' - type: 'array' - provider: - $ref: '#/components/schemas/ProviderPreferences' - route: - $ref: '#/components/schemas/DeprecatedRoute' - safeguards: - items: - $ref: '#/components/schemas/AnthropicSafeguard' - type: - - 'array' - - 'null' - service_tier: - type: 'string' - session_id: - description: 'A unique identifier for grouping related requests (e.g., a conversation or agent workflow). When provided, OpenRouter uses it as the sticky routing key, routing all requests in the session to the same provider to maximize prompt cache hits. Also used for observability grouping. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.' - maxLength: 256 - type: 'string' - speed: - allOf: - - $ref: '#/components/schemas/AnthropicSpeed' - - description: 'Controls output generation speed. When set to `fast`, uses a higher-speed inference configuration at premium pricing. Defaults to `standard` when omitted.' - example: 'fast' - stop_sequences: - items: - type: 'string' - type: 'array' - stop_server_tools_when: - $ref: '#/components/schemas/StopServerToolsWhen' - stream: - type: 'boolean' - system: - anyOf: - - type: 'string' - - items: - $ref: '#/components/schemas/AnthropicTextBlockParam' - type: 'array' - temperature: - format: 'double' - type: 'number' - thinking: + tool: oneOf: - properties: - block_binding: - $ref: '#/components/schemas/AnthropicThinkingBlockBinding' - budget_tokens: - type: 'integer' - display: - $ref: '#/components/schemas/AnthropicThinkingDisplay' + name: + type: 'string' type: enum: - - 'enabled' + - 'tool_reference' type: 'string' required: - 'type' - - 'budget_tokens' + - 'name' type: 'object' - properties: + name: + type: 'string' + server_name: + type: 'string' type: enum: - - 'disabled' + - 'mcp_tool_reference' type: 'string' required: - 'type' + - 'name' + - 'server_name' type: 'object' - properties: - block_binding: - $ref: '#/components/schemas/AnthropicThinkingBlockBinding' - display: - $ref: '#/components/schemas/AnthropicThinkingDisplay' - type: - enum: - - 'adaptive' + server_name: type: 'string' - required: - - 'type' - type: 'object' - - additionalProperties: false - properties: type: enum: - - 'between_tools' + - 'mcp_toolset_reference' type: 'string' required: - 'type' + - 'server_name' type: 'object' - tool_choice: + type: + enum: + - 'tool_addition' + type: 'string' + required: + - 'type' + - 'tool' + type: 'object' + MessagesToolRemovalBlock: + description: 'Removes a tool from the conversation mid-conversation without invalidating the prompt cache. Only valid in `role: "system"` messages. Not supported on Claude Sonnet 5 or models older than Claude Opus 4.8.' + example: + tool: + name: 'get_weather' + type: 'tool_reference' + type: 'tool_removal' + properties: + cache_control: + $ref: '#/components/schemas/AnthropicCacheControlDirective' + tool: oneOf: - properties: - disable_parallel_tool_use: - type: 'boolean' - type: - enum: - - 'auto' + name: type: 'string' - required: - - 'type' - type: 'object' - - properties: - disable_parallel_tool_use: - type: 'boolean' type: enum: - - 'any' + - 'tool_reference' type: 'string' required: - 'type' + - 'name' type: 'object' - properties: + name: + type: 'string' + server_name: + type: 'string' type: enum: - - 'none' + - 'mcp_tool_reference' type: 'string' required: - 'type' + - 'name' + - 'server_name' type: 'object' - properties: - disable_parallel_tool_use: - type: 'boolean' - name: + server_name: type: 'string' type: enum: - - 'tool' + - 'mcp_toolset_reference' type: 'string' required: - 'type' - - 'name' + - 'server_name' type: 'object' - tools: - items: - anyOf: - - properties: - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - defer_loading: - type: 'boolean' - description: - type: 'string' - input_schema: - additionalProperties: {} - properties: - properties: {} - required: - items: - type: 'string' - type: - - 'array' - - 'null' - type: - default: 'object' - type: 'string' - type: 'object' - name: - type: 'string' - strict: - type: 'boolean' - type: - enum: - - 'custom' - type: 'string' - required: - - 'name' - - 'input_schema' - type: 'object' - - properties: - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - name: - enum: - - 'bash' - type: 'string' - type: - enum: - - 'bash_20250124' - type: 'string' - required: - - 'type' - - 'name' - type: 'object' - - properties: - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - name: - enum: - - 'str_replace_editor' - type: 'string' - type: - enum: - - 'text_editor_20250124' - type: 'string' - required: - - 'type' - - 'name' - type: 'object' - - properties: - allowed_domains: - items: - type: 'string' - type: - - 'array' - - 'null' - blocked_domains: - items: - type: 'string' - type: - - 'array' - - 'null' - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - max_uses: - type: - - 'integer' - - 'null' - name: - enum: - - 'web_search' - type: 'string' - type: - enum: - - 'web_search_20250305' - type: 'string' - user_location: - $ref: '#/components/schemas/AnthropicWebSearchToolUserLocation' - required: - - 'type' - - 'name' - type: 'object' - - properties: - allowed_callers: - $ref: '#/components/schemas/AnthropicAllowedCallers' - allowed_domains: - items: - type: 'string' - type: - - 'array' - - 'null' - blocked_domains: - items: - type: 'string' - type: - - 'array' - - 'null' - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - max_uses: - type: - - 'integer' - - 'null' - name: - enum: - - 'web_search' - type: 'string' - type: - enum: - - 'web_search_20260209' - type: 'string' - user_location: - $ref: '#/components/schemas/AnthropicWebSearchToolUserLocation' - required: - - 'type' - - 'name' - type: 'object' - - properties: - allowed_callers: - $ref: '#/components/schemas/AnthropicAllowedCallers' - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - caching: - anyOf: - - $ref: '#/components/schemas/AnthropicCacheControlDirective' - - type: 'null' - defer_loading: - type: 'boolean' - max_uses: - type: 'integer' - model: - type: 'string' - name: - enum: - - 'advisor' - type: 'string' - type: - enum: - - 'advisor_20260301' - type: 'string' - required: - - 'type' - - 'name' - - 'model' - type: 'object' - - $ref: '#/components/schemas/BashServerTool' - - $ref: '#/components/schemas/DatetimeServerTool' - - $ref: '#/components/schemas/ImageGenerationServerTool_OpenRouter' - - $ref: '#/components/schemas/MessagesSearchModelsServerTool' - - $ref: '#/components/schemas/WebFetchServerTool' - - $ref: '#/components/schemas/OpenRouterWebSearchServerTool' - - additionalProperties: {} - properties: - type: - type: 'string' - required: - - 'type' - type: 'object' - - $ref: '#/components/schemas/AnthropicToolSearchToolBm25' - - $ref: '#/components/schemas/AnthropicToolSearchToolRegex' - - $ref: '#/components/schemas/ShellServerTool_OpenRouter' - - $ref: '#/components/schemas/ToolSearchServerTool' - type: 'array' - top_k: - type: 'integer' - top_p: - format: 'double' - type: 'number' - trace: - $ref: '#/components/schemas/TraceConfig' - user: - description: 'A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 256 characters.' - maxLength: 256 - type: 'string' - required: - - 'model' - - 'messages' - type: 'object' - MessagesResult: - allOf: - - $ref: '#/components/schemas/BaseMessagesResult' - - properties: - context_management: - properties: - applied_edits: - items: - additionalProperties: {} - properties: - type: - type: 'string' - required: - - 'type' - type: 'object' - type: 'array' - required: - - 'applied_edits' - type: - - 'object' - - 'null' - openrouter_metadata: - $ref: '#/components/schemas/OpenRouterMetadata' - provider: - type: 'string' - safeguard_results: - items: - $ref: '#/components/schemas/AnthropicSafeguardResult' - type: - - 'array' - - 'null' - usage: - allOf: - - $ref: '#/components/schemas/AnthropicUsage' - - properties: - cost: - format: 'double' - type: - - 'number' - - 'null' - cost_details: - $ref: '#/components/schemas/CostDetails' - is_byok: - type: 'boolean' - iterations: - items: - $ref: '#/components/schemas/AnthropicUsageIteration' - type: 'array' - server_tool_use: - $ref: '#/components/schemas/ORAnthropicServerToolUsage' - service_tier: - type: - - 'string' - - 'null' - speed: - $ref: '#/components/schemas/AnthropicSpeed' - type: 'object' - example: - cache_creation: null - cache_creation_input_tokens: null - cache_read_input_tokens: null - inference_geo: null - input_tokens: 100 - output_tokens: 50 - output_tokens_details: null - server_tool_use: null - service_tier: 'standard' - type: 'object' - description: 'Non-streaming response from the Anthropic Messages API with OpenRouter extensions' - example: - container: null - content: - - citations: [] - text: 'Hello! I''m doing well, thank you for asking.' - type: 'text' - id: 'msg_01XFDUDYJgAACzvnptvVoYEL' - model: 'claude-sonnet-4-5-20250929' - role: 'assistant' - stop_details: null - stop_reason: 'end_turn' - stop_sequence: null - type: 'message' - usage: - cache_creation: null - cache_creation_input_tokens: null - cache_read_input_tokens: null - inference_geo: null - input_tokens: 12 - output_tokens: 15 - output_tokens_details: null - server_tool_use: null - service_tier: 'standard' - MessagesSearchModelsServerTool: - description: 'OpenRouter built-in server tool: searches and filters AI models available on OpenRouter' - example: - parameters: - max_results: 5 - type: 'openrouter:experimental__search_models' - properties: - parameters: - $ref: '#/components/schemas/SearchModelsServerToolConfig' type: enum: - - 'openrouter:experimental__search_models' + - 'tool_removal' type: 'string' required: - 'type' + - 'tool' type: 'object' - MessagesShellToolResultBlock: - description: 'Output of an `openrouter:shell` call from a prior assistant turn. Accepted on replay and dropped before the provider request — Anthropic has no equivalent block.' - example: - content: - output: - - outcome: - exit_code: 0 - type: 'exit' - stderr: '' - stdout: "README.md\n" - tool_use_id: 'srvtoolu_01abc' - type: 'openrouter_shell_tool_result' - properties: - container_id: - description: 'The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed.' - type: 'string' - content: - additionalProperties: {} - type: 'object' - files: - description: 'Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API.' - items: - properties: - container_id: - type: 'string' - end_index: - type: 'integer' - file_id: - type: 'string' - filename: - type: 'string' - start_index: - type: 'integer' - type: - enum: - - 'container_file_citation' - type: 'string' - required: - - 'type' - - 'container_id' - - 'file_id' - - 'filename' - - 'start_index' - - 'end_index' - type: 'object' - type: 'array' - tool_use_id: - type: 'string' - type: - enum: - - 'openrouter_shell_tool_result' - type: 'string' - required: - - 'type' - - 'tool_use_id' - - 'content' - type: 'object' - MessagesStartEvent: - description: 'Event sent at the start of a streaming message' - example: - message: - container: null - content: [] - id: 'msg_01XFDUDYJgAACzvnptvVoYEL' - model: 'claude-sonnet-4-5-20250929' - role: 'assistant' - stop_details: null - stop_reason: null - stop_sequence: null - type: 'message' - usage: - cache_creation: null - cache_creation_input_tokens: null - cache_read_input_tokens: null - inference_geo: null - input_tokens: 12 - output_tokens: 0 - output_tokens_details: null - server_tool_use: null - service_tier: 'standard' - type: 'message_start' - properties: - message: - properties: - container: - $ref: '#/components/schemas/AnthropicContainer' - content: - items: - $ref: '#/components/schemas/ORAnthropicContentBlock' - type: 'array' - id: - type: 'string' - input_transformations: - items: - $ref: '#/components/schemas/AnthropicInputTransformation' - type: - - 'array' - - 'null' - model: - type: 'string' - provider: - enum: - - 'AnyScale' - - 'Atoma' - - 'Cent-ML' - - 'CrofAI' - - 'Enfer' - - 'GoPomelo' - - 'HuggingFace' - - 'Hyperbolic' - - 'Hyperbolic 2' - - 'InoCloud' - - 'Kluster' - - 'Lambda' - - 'Lepton' - - 'Lynn 2' - - 'Lynn' - - 'Mancer' - - 'Modal' - - 'NCompass' - - 'Nineteen' - - 'OctoAI' - - 'Recursal' - - 'Reflection' - - 'Replicate' - - 'SambaNova 2' - - 'SF Compute' - - 'Targon' - - 'Together 2' - - 'Ubicloud' - - '01.AI' - - 'AkashML' - - 'AI21' - - 'AionLabs' - - 'Alibaba' - - 'Ambient' - - 'Baidu' - - 'Amazon Bedrock' - - 'Amazon Nova' - - 'Anthropic' - - 'Arcee AI' - - 'AssemblyAI' - - 'AtlasCloud' - - 'Avian' - - 'Azure' - - 'BaseTen' - - 'BytePlus' - - 'Black Forest Labs' - - 'Cerebras' - - 'Chutes' - - 'Cirrascale' - - 'Claude Platform on AWS' - - 'Clarifai' - - 'Cloudflare' - - 'Cohere' - - 'CoreWeave' - - 'Cosine' - - 'Crucible' - - 'Crusoe' - - 'Darkbloom' - - 'Databricks' - - 'Decart' - - 'Deepgram' - - 'DeepInfra' - - 'DeepSeek' - - 'DekaLLM' - - 'DigitalOcean' - - 'ElevenLabs' - - 'Featherless' - - 'Fireworks' - - 'Fish Audio' - - 'Friendli' - - 'GMICloud' - - 'Google' - - 'Google AI Studio' - - 'Groq' - - 'HeyGen' - - 'Inception' - - 'Inceptron' - - 'InferenceNet' - - 'Ionstream' - - 'Infermatic' - - 'Io Net' - - 'Inferact vLLM' - - 'Inflection' - - 'Liquid' - - 'Makora' - - 'Mara' - - 'Mancer 2' - - 'Meta' - - 'Minimax' - - 'ModelRun' - - 'Mistral' - - 'Modular' - - 'Moonshot AI' - - 'Morph' - - 'VoyageAI by MongoDB' - - 'TypeSafe' - - 'Near AI' - - 'Nebius' - - 'Nex AGI' - - 'NextBit' - - 'Novita' - - 'Nvidia' - - 'Ollama' - - 'OpenAI' - - 'OpenInference' - - 'Parasail' - - 'ParetoAlpha' - - 'Poolside' - - 'PrimeIntellect' - - 'Perceptron' - - 'Perplexity' - - 'Phala' - - 'Recraft' - - 'Recursive' - - 'Reka' - - 'Relace' - - 'Respan' - - 'Sail Research' - - 'Sakana AI' - - 'SambaNova' - - 'ScaleDown' - - 'Seed' - - 'SiliconFlow' - - 'Sourceful' - - 'StepFun' - - 'Stealth' - - 'StreamLake' - - 'Switchpoint' - - 'Tencent' - - 'Tenstorrent' - - 'Thinking Machines' - - 'Together' - - 'Unbiased' - - 'Upstage' - - 'Venice' - - 'Wafer' - - 'WandB' - - 'Quiver' - - 'Krea' - - 'Runway' - - 'Xiaomi' - - 'xAI' - - 'Z.AI' - - 'FakeProvider' - type: 'string' - x-speakeasy-unknown-values: 'allow' - role: - enum: - - 'assistant' - type: 'string' - stop_details: - $ref: '#/components/schemas/AnthropicRefusalStopDetails' - stop_reason: {} - stop_sequence: {} - type: - enum: - - 'message' - type: 'string' - usage: - allOf: - - $ref: '#/components/schemas/AnthropicUsage' - - properties: - iterations: - items: - $ref: '#/components/schemas/AnthropicUsageIteration' - type: 'array' - speed: - $ref: '#/components/schemas/AnthropicSpeed' - type: 'object' - example: - cache_creation: - ephemeral_1h_input_tokens: 0 - ephemeral_5m_input_tokens: 7381 - cache_creation_input_tokens: 7381 - cache_read_input_tokens: 0 - inference_geo: null - input_tokens: 100 - output_tokens: 1 - output_tokens_details: null - server_tool_use: null - service_tier: 'standard' - required: - - 'id' - - 'type' - - 'role' - - 'container' - - 'content' - - 'model' - - 'stop_reason' - - 'stop_details' - - 'stop_sequence' - - 'usage' - type: 'object' - type: - enum: - - 'message_start' - type: 'string' - required: - - 'type' - - 'message' - type: 'object' - MessagesStopEvent: - description: 'Event sent when the message is complete' - example: - type: 'message_stop' - properties: - openrouter_metadata: - $ref: '#/components/schemas/OpenRouterMetadata' - type: - enum: - - 'message_stop' - type: 'string' - required: - - 'type' - type: 'object' - MessagesStreamEvents: - description: 'Union of all possible streaming events' - discriminator: - mapping: - content_block_delta: '#/components/schemas/MessagesContentBlockDeltaEvent' - content_block_start: '#/components/schemas/MessagesContentBlockStartEvent' - content_block_stop: '#/components/schemas/MessagesContentBlockStopEvent' - error: '#/components/schemas/MessagesErrorEvent' - message_delta: '#/components/schemas/MessagesDeltaEvent' - message_start: '#/components/schemas/MessagesStartEvent' - message_stop: '#/components/schemas/MessagesStopEvent' - ping: '#/components/schemas/MessagesPingEvent' - propertyName: 'type' - example: - delta: - text: 'Hello' - type: 'text_delta' - index: 0 - type: 'content_block_delta' - oneOf: - - $ref: '#/components/schemas/MessagesStartEvent' - - $ref: '#/components/schemas/MessagesDeltaEvent' - - $ref: '#/components/schemas/MessagesStopEvent' - - $ref: '#/components/schemas/MessagesContentBlockStartEvent' - - $ref: '#/components/schemas/MessagesContentBlockDeltaEvent' - - $ref: '#/components/schemas/MessagesContentBlockStopEvent' - - $ref: '#/components/schemas/MessagesPingEvent' - - $ref: '#/components/schemas/MessagesErrorEvent' - MessagesStreamingResponse: - example: - data: - delta: - text: 'Hello' - type: 'text_delta' - index: 0 - type: 'content_block_delta' - event: 'content_block_delta' - properties: - data: - $ref: '#/components/schemas/MessagesStreamEvents' - event: - type: 'string' - required: - - 'event' - - 'data' - type: 'object' - MessagesToolAdditionBlock: - description: 'Loads a previously deferred tool (declared in `tools` with `defer_loading: true`) mid-conversation without invalidating the prompt cache. Only valid in `role: "system"` messages. Not supported on Claude Sonnet 5 or models older than Claude Opus 4.8.' - example: - tool: - name: 'get_forecast' - type: 'tool_reference' - type: 'tool_addition' - properties: - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - tool: - oneOf: - - properties: - name: - type: 'string' - type: - enum: - - 'tool_reference' - type: 'string' - required: - - 'type' - - 'name' - type: 'object' - - properties: - name: - type: 'string' - server_name: - type: 'string' - type: - enum: - - 'mcp_tool_reference' - type: 'string' - required: - - 'type' - - 'name' - - 'server_name' - type: 'object' - - properties: - server_name: - type: 'string' - type: - enum: - - 'mcp_toolset_reference' - type: 'string' - required: - - 'type' - - 'server_name' - type: 'object' - type: - enum: - - 'tool_addition' - type: 'string' - required: - - 'type' - - 'tool' - type: 'object' - MessagesToolRemovalBlock: - description: 'Removes a tool from the conversation mid-conversation without invalidating the prompt cache. Only valid in `role: "system"` messages. Not supported on Claude Sonnet 5 or models older than Claude Opus 4.8.' - example: - tool: - name: 'get_weather' - type: 'tool_reference' - type: 'tool_removal' - properties: - cache_control: - $ref: '#/components/schemas/AnthropicCacheControlDirective' - tool: - oneOf: - - properties: - name: - type: 'string' - type: - enum: - - 'tool_reference' - type: 'string' - required: - - 'type' - - 'name' - type: 'object' - - properties: - name: - type: 'string' - server_name: - type: 'string' - type: - enum: - - 'mcp_tool_reference' - type: 'string' - required: - - 'type' - - 'name' - - 'server_name' - type: 'object' - - properties: - server_name: - type: 'string' - type: - enum: - - 'mcp_toolset_reference' - type: 'string' - required: - - 'type' - - 'server_name' - type: 'object' - type: - enum: - - 'tool_removal' - type: 'string' - required: - - 'type' - - 'tool' - type: 'object' - MetadataLevel: - description: 'Opt-in level for surfacing routing metadata on the response under `openrouter_metadata`.' - enum: - - 'disabled' - - 'enabled' - example: 'enabled' - type: 'string' - x-speakeasy-unknown-values: allow - Model: - description: 'Information about an AI model available on OpenRouter' + MetadataLevel: + description: 'Opt-in level for surfacing routing metadata on the response under `openrouter_metadata`.' + enum: + - 'disabled' + - 'enabled' + example: 'enabled' + type: 'string' + x-speakeasy-unknown-values: allow + Model: + description: 'Information about an AI model available on OpenRouter' example: architecture: input_modalities: @@ -22285,6 +21287,7 @@ components: enum: - 'POST' - 'PUT' + title: 'ObservabilityWebhookDestinationMethod' type: 'string' x-speakeasy-unknown-values: allow url: @@ -23186,6 +22189,7 @@ components: - 'misalignment_policy_violation' - 'data_residency_mismatch' - 'permission_denied' + title: 'CodeEnum' type: 'string' x-speakeasy-unknown-values: allow message: @@ -27671,15 +26675,6 @@ components: - 'null' x-speakeasy-unknown-values: allow type: 'object' - ProvisionInternResponse: - additionalProperties: false - properties: - provisioning: - const: true - type: 'boolean' - required: - - 'provisioning' - type: 'object' PublicEndpoint: description: 'Information about a specific model endpoint' example: @@ -30062,63 +29057,6 @@ components: oneOf: - $ref: '#/components/schemas/ContainerAutoEnvironment' - $ref: '#/components/schemas/ContainerReferenceEnvironment' - SignInternDaemonRequest: - additionalProperties: false - properties: - bodySha256: - description: 'Lower-case hex SHA-256 of the exact bytes the CLI will send as the daemon request body.' - example: 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' - pattern: '^[0-9a-f]{64}$' - type: 'string' - route: - additionalProperties: false - description: 'The daemon request the proof is for. When present the response also carries the single-use, route-bound proof (`x-ori-invoke-signature-v2`, `x-ori-invoke-nonce`).' - properties: - method: - description: 'The HTTP method of the daemon request.' - enum: - - 'POST' - type: 'string' - path: - description: 'The daemon request path, percent-encoded as sent, without origin or query. The route-bound proof admits only this path.' - example: '/api/invoke' - pattern: '^\/[!"$->@-~]{0,2047}$' - type: 'string' - required: - - 'method' - - 'path' - type: 'object' - required: - - 'bodySha256' - type: 'object' - SignInternDaemonResponse: - additionalProperties: false - description: 'Headers the CLI copies onto the daemon request so the sidecar can verify who is asking.' - example: - x-ori-invoke-signature: 'MEUCIQ...' - x-ori-invoke-timestamp: '1789000000' - x-ori-invoke-user: 'user_2abc' - properties: - x-ori-invoke-nonce: - description: 'Present with `x-ori-invoke-signature-v2`: the single-use id that proof is bound to.' - type: 'string' - x-ori-invoke-signature: - description: 'Base64 Ed25519 signature over the intern id, timestamp, user and body digest.' - type: 'string' - x-ori-invoke-signature-v2: - description: 'Present when the request named a `route`: Base64 Ed25519 signature over the intern id, timestamp, nonce, user, method, path and body digest. The intern accepts it once.' - type: 'string' - x-ori-invoke-timestamp: - description: 'Unix seconds at signing; the daemon refuses proofs older than its window.' - type: 'string' - x-ori-invoke-user: - description: 'The verified OAuth subject the proof names. Never taken from the request.' - type: 'string' - required: - - 'x-ori-invoke-signature' - - 'x-ori-invoke-timestamp' - - 'x-ori-invoke-user' - type: 'object' SpeechInput: anyOf: - type: 'string' @@ -31335,15 +30273,6 @@ components: seed: type: 'boolean' type: 'object' - SuspendInternResponse: - additionalProperties: false - properties: - suspended: - const: true - type: 'boolean' - required: - - 'suspended' - type: 'object' SwitchyardRouterPlugin: example: algorithm: 'stage' @@ -32952,40 +31881,6 @@ components: required: - 'data' type: 'object' - UpdateInternRequest: - additionalProperties: false - description: 'Lifecycle settings to change. Omitted fields stay unchanged and null clears a field.' - example: - description: 'Researches customer questions' - model: 'openai/gpt-5.4' - properties: - description: - description: 'New free-form description. Null clears it.' - maxLength: 2000 - type: - - 'string' - - 'null' - instructions: - description: 'New standing instructions. Null clears them.' - maxLength: 100000 - type: - - 'string' - - 'null' - model: - 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' - name: - description: 'New intern name, unique per creator within the workspace.' - maxLength: 17 - minLength: 2 - pattern: '^[a-z][a-z0-9]*(-[a-z0-9]+)*$' - type: 'string' - type: 'object' UpdateObservabilityDestinationRequest: example: enabled: false @@ -34645,2318 +33540,291 @@ components: - 'array' - 'null' io_logging_sampling_rate: - description: 'Sampling rate for I/O logging (0.0001-1). 1 means 100% of requests are logged.' - example: 1 - format: 'double' - type: 'number' - is_data_discount_logging_enabled: - description: 'Whether data discount logging is enabled for this workspace' - example: true - type: 'boolean' - is_observability_broadcast_enabled: - description: 'Whether broadcast is enabled for this workspace' - example: false - type: 'boolean' - is_observability_io_logging_enabled: - description: 'Whether private logging is enabled for this workspace' - example: false - type: 'boolean' - name: - description: 'Name of the workspace' - example: 'Production' - type: 'string' - slug: - description: 'URL-friendly slug for the workspace' - example: 'production' - type: 'string' - updated_at: - description: 'ISO 8601 timestamp of when the workspace was last updated' - example: '2025-08-24T15:45:00Z' - type: - - 'string' - - 'null' - required: - - 'id' - - 'default_guardrail_id' - - 'name' - - 'slug' - - 'description' - - 'default_text_model' - - 'default_image_model' - - 'default_provider_sort' - - 'is_observability_io_logging_enabled' - - 'is_observability_broadcast_enabled' - - 'is_data_discount_logging_enabled' - - 'io_logging_sampling_rate' - - 'io_logging_api_key_ids' - - 'created_at' - - 'updated_at' - - 'created_by' - type: 'object' - WorkspaceBudget: - example: - created_at: '2025-08-24T10:30:00Z' - id: '770e8400-e29b-41d4-a716-446655440000' - limit_usd: 100 - reset_interval: 'monthly' - updated_at: '2025-08-24T15:45:00Z' - workspace_id: '550e8400-e29b-41d4-a716-446655440000' - properties: - created_at: - description: 'ISO 8601 timestamp of when the budget was created' - example: '2025-08-24T10:30:00Z' - type: 'string' - id: - description: 'Unique identifier for the budget' - example: '770e8400-e29b-41d4-a716-446655440000' - format: 'uuid' - type: 'string' - limit_usd: - description: 'Spending limit in USD for this interval' - example: 100 - format: 'double' - type: 'number' - reset_interval: - description: 'Interval at which spend resets. Null means a lifetime (one-time) budget.' - enum: - - 'daily' - - 'weekly' - - 'monthly' - - null - example: 'monthly' - type: - - 'string' - - 'null' - x-speakeasy-unknown-values: allow - updated_at: - description: 'ISO 8601 timestamp of when the budget was last updated' - example: '2025-08-24T15:45:00Z' - type: 'string' - workspace_id: - description: 'ID of the workspace the budget belongs to' - example: '550e8400-e29b-41d4-a716-446655440000' - format: 'uuid' - type: 'string' - required: - - 'id' - - 'workspace_id' - - 'limit_usd' - - 'reset_interval' - - 'created_at' - - 'updated_at' - type: 'object' - WorkspaceBudgetInterval: - description: 'Budget reset interval. Use "lifetime" for a one-time budget that never resets.' - enum: - - 'daily' - - 'weekly' - - 'monthly' - - 'lifetime' - example: 'monthly' - type: 'string' - x-speakeasy-unknown-values: allow - WorkspaceMember: - example: - created_at: '2025-08-24T10:30:00Z' - id: '660e8400-e29b-41d4-a716-446655440000' - role: 'member' - user_id: 'user_abc123' - workspace_id: '550e8400-e29b-41d4-a716-446655440000' - properties: - created_at: - description: 'ISO 8601 timestamp of when the membership was created' - example: '2025-08-24T10:30:00Z' - type: 'string' - id: - description: 'Unique identifier for the workspace membership' - example: '660e8400-e29b-41d4-a716-446655440000' - format: 'uuid' - type: 'string' - role: - description: 'Role of the member in the workspace' - enum: - - 'admin' - - 'member' - example: 'member' - type: 'string' - x-speakeasy-unknown-values: allow - user_id: - description: 'Clerk user ID of the member' - example: 'user_abc123' - type: 'string' - workspace_id: - description: 'ID of the workspace' - example: '550e8400-e29b-41d4-a716-446655440000' - format: 'uuid' - type: 'string' - required: - - 'id' - - 'workspace_id' - - 'user_id' - - 'role' - - 'created_at' - type: 'object' - XSearchOptions: - additionalProperties: false - description: 'Enable SpaceXAI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXAI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXAI, per post and per user profile fetched.' - example: - allowed_x_handles: - - 'OpenRouterAI' - from_date: '2025-01-01' - properties: - allowed_x_handles: - description: 'Only include posts from these X handles (max 20). Cannot be used with excluded_x_handles.' - example: - - 'OpenRouterAI' - items: - type: 'string' - maxItems: 20 - type: 'array' - enable_image_understanding: - description: 'Analyze images attached to matching posts.' - type: 'boolean' - enable_video_understanding: - description: 'Analyze videos attached to matching posts.' - type: 'boolean' - excluded_x_handles: - description: 'Exclude posts from these X handles (max 20). Cannot be used with allowed_x_handles.' - example: - - 'spamaccount' - items: - type: 'string' - maxItems: 20 - type: 'array' - from_date: - description: 'Start of the post date range (ISO 8601 date, e.g. "2025-01-01").' - example: '2025-01-01' - format: 'date' - type: 'string' - to_date: - description: 'End of the post date range (ISO 8601 date, e.g. "2025-12-31").' - example: '2025-12-31' - format: 'date' - type: 'string' - type: 'object' - securitySchemes: - apiKey: - description: 'API key as bearer token in Authorization header' - scheme: 'bearer' - type: 'http' - bearer: - description: 'API key as bearer token in Authorization header' - scheme: 'bearer' - type: 'http' -externalDocs: - description: 'OpenRouter Documentation' - url: 'https://openrouter.ai/docs' -info: - contact: - email: 'support@openrouter.ai' - name: 'OpenRouter Support' - url: 'https://openrouter.ai/docs' - description: 'OpenAI-compatible API with additional OpenRouter features' - license: - name: 'MIT' - url: 'https://opensource.org/licenses/MIT' - title: 'OpenRouter API' - version: '1.0.0' -openapi: '3.1.0' -paths: - /activity: - get: - description: 'Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. Pass `workspace_id` to scope the response to a single workspace. Pass `group_by=workspace` to split each row per workspace and include `workspace_id` on every item; by default rows are aggregated across workspaces and `workspace_id` is not returned. Activity recorded before workspace resolution existed is permanently attributed to the account default workspace (no backfill is possible). [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'getUserActivity' - parameters: - - description: 'Filter by a single UTC date in the last 30 days (YYYY-MM-DD format).' - in: 'query' - name: 'date' - required: false - schema: - description: 'Filter by a single UTC date in the last 30 days (YYYY-MM-DD format).' - example: '2025-08-24' - type: 'string' - - description: 'Filter by API key hash (SHA-256 hex string, as returned by the keys API).' - in: 'query' - name: 'api_key_hash' - required: false - schema: - description: 'Filter by API key hash (SHA-256 hex string, as returned by the keys API).' - example: 'abc123def456...' - type: 'string' - - description: 'Filter by org member user ID. Only applicable for organization accounts.' - in: 'query' - name: 'user_id' - required: false - schema: - description: 'Filter by org member user ID. Only applicable for organization accounts.' - example: 'user_abc123' - type: 'string' - - description: 'Set to ''workspace'' to split each row per workspace and include `workspace_id` on every item. Omitted by default, in which case rows are aggregated across workspaces (by date, model, and endpoint) and `workspace_id` is not returned — preserving the historical response shape.' - in: 'query' - name: 'group_by' - required: false - schema: - description: 'Set to ''workspace'' to split each row per workspace and include `workspace_id` on every item. Omitted by default, in which case rows are aggregated across workspaces (by date, model, and endpoint) and `workspace_id` is not returned — preserving the historical response shape.' - enum: - - 'workspace' - example: 'workspace' - type: 'string' - - description: 'Filter by workspace ID (UUID). Returns only activity attributed to that workspace. The workspace must belong to the authenticated account.' - in: 'query' - name: 'workspace_id' - required: false - schema: - description: 'Filter by workspace ID (UUID). Returns only activity attributed to that workspace. The workspace must belong to the authenticated account.' - example: '550e8400-e29b-41d4-a716-446655440000' - type: 'string' - responses: - '200': - content: - application/json: - example: - data: - - byok_usage_inference: 0.012 - cached_tokens: 10 - completion_tokens: 125 - date: '2025-08-24' - endpoint_id: '550e8400-e29b-41d4-a716-446655440000' - model: 'openai/gpt-4.1' - model_permaslug: 'openai/gpt-4.1-2025-04-14' - prompt_tokens: 50 - provider_name: 'OpenAI' - reasoning_tokens: 25 - requests: 5 - usage: 0.015 - schema: - $ref: '#/components/schemas/ActivityResponse' - description: 'Returns user activity data grouped by endpoint' - '400': - content: - application/json: - example: - error: - code: 400 - message: 'Invalid request parameters' - schema: - $ref: '#/components/schemas/BadRequestResponse' - description: 'Bad Request - Invalid request parameters or malformed input' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'Missing Authentication header' - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '403': - content: - application/json: - example: - error: - code: 403 - message: 'Only management keys can perform this operation' - schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' - '404': - content: - application/json: - example: - error: - code: 404 - message: 'Resource not found' - schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' - '500': - content: - application/json: - example: - error: - code: 500 - message: 'Internal Server Error' - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - summary: 'Get user activity grouped by endpoint' - tags: - - 'Analytics' - x-speakeasy-max-method-params: 5 - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /analytics/meta: - get: - description: 'Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'getAnalyticsMeta' - responses: - '200': - content: - application/json: - example: - data: - dimensions: - - display_label: 'Model' - name: 'model' - granularities: - - display_label: 'Day' - name: 'day' - metrics: - - display_format: 'number' - display_label: 'Request Count' - is_rate: false - name: 'request_count' - operators: - - name: 'eq' - value_type: 'scalar' - schema: - properties: - data: - properties: - dimensions: - items: - properties: - display_label: - description: 'Human-readable label' - example: 'Model' - type: 'string' - name: - description: 'Dimension identifier used in query requests' - example: 'model' - type: 'string' - required: - - 'name' - - 'display_label' - type: 'object' - type: 'array' - granularities: - items: - properties: - display_label: - description: 'Human-readable label' - example: 'Day' - type: 'string' - name: - description: 'Granularity identifier' - enum: - - 'minute' - - 'hour' - - 'day' - - 'week' - - 'month' - example: 'day' - type: 'string' - x-speakeasy-unknown-values: allow - required: - - 'name' - - 'display_label' - type: 'object' - type: 'array' - metrics: - items: - properties: - display_format: - description: 'How this metric value should be formatted for display (e.g. percent → multiply by 100 and append %, currency → prefix with $)' - enum: - - 'number' - - 'currency' - - 'percent' - - 'latency' - - 'throughput' - example: 'number' - type: 'string' - x-speakeasy-unknown-values: allow - display_label: - description: 'Human-readable label' - example: 'Request Count' - type: 'string' - is_rate: - description: 'Whether this metric is a rate/ratio (averaged, not summed)' - type: 'boolean' - name: - description: 'Metric identifier used in query requests' - example: 'request_count' - type: 'string' - required: - - 'name' - - 'display_label' - - 'is_rate' - - 'display_format' - type: 'object' - type: 'array' - operators: - items: - properties: - name: - description: 'Operator identifier used in filter definitions' - enum: - - 'eq' - - 'neq' - - 'in' - - 'not_in' - - 'gt' - - 'gte' - - 'lt' - - 'lte' - example: 'eq' - type: 'string' - x-speakeasy-unknown-values: allow - value_type: - description: 'Whether the operator expects a single value or an array' - enum: - - 'scalar' - - 'array' - type: 'string' - x-speakeasy-unknown-values: allow - required: - - 'name' - - 'value_type' - type: 'object' - type: 'array' - required: - - 'metrics' - - 'dimensions' - - 'operators' - - 'granularities' - type: 'object' - required: - - 'data' - type: 'object' - description: 'Returns analytics query metadata' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'Missing Authentication header' - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '403': - content: - application/json: - example: - error: - code: 403 - message: 'Only management keys can perform this operation' - schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' - '500': - content: - application/json: - example: - error: - code: 500 - message: 'Internal Server Error' - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - summary: 'Get available analytics metrics and dimensions' - tags: - - 'Analytics' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /analytics/query: - post: - description: 'Execute an analytics query with specified metrics, dimensions, filters, and time range. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'queryAnalytics' - requestBody: - content: - application/json: - example: - dimensions: - - 'model' - granularity: 'day' - limit: 100 - metrics: - - 'request_count' - time_range: - end: '2025-01-08T00:00:00Z' - start: '2025-01-01T00:00:00Z' - schema: - properties: - classifier_dimensions: - description: 'Group results by custom classifier tags, breaking down metrics by the specified dimension values. Requires an active classifier on the workspace.' - properties: - classifier_id: - description: 'UUID of the classifier whose tags to group by.' - example: '550e8400-e29b-41d4-a716-446655440000' - format: 'uuid' - type: 'string' - dimension_names: - items: - description: 'Classifier dimension name (snake_case identifier). Each name becomes its own column key in the response; providing two names cross-groups results by both dimensions. With no names, the response uses `clf_dimension_name`/`clf_dimension_value` columns (one row per dimension/value pair).' - example: 'department' - type: 'string' - maxItems: 2 - type: 'array' - include_nulls: - description: 'When true, also include generations that have no tag from this classifier. Defaults to false, which returns only classified generations.' - type: 'boolean' - required: - - 'classifier_id' - type: 'object' - classifier_filters: - description: 'Filter results to generations with specific classifier tag values. Can be combined with classifier_dimensions (must use the same classifier_id) or used independently with standard dimensions.' - properties: - classifier_id: - description: 'UUID of the classifier whose tags to filter by. Must match classifier_dimensions.classifier_id when both are specified.' - example: '550e8400-e29b-41d4-a716-446655440000' - format: 'uuid' - type: 'string' - filters: - items: - properties: - field: - description: 'Classifier dimension name to filter on (snake_case identifier, e.g. "department", "work_type").' - example: 'department' - type: 'string' - operator: - description: 'Filter operator. Only equality/set operators are supported (eq, neq, in, not_in) — ordered comparisons are not available because classification values are strings.' - example: 'eq' - type: 'string' - value: - anyOf: - - type: 'string' - - format: 'double' - type: 'number' - - items: - anyOf: - - type: 'string' - - format: 'double' - type: 'number' - type: 'array' - description: 'Filter value. Use a scalar (string or number) for eq/neq, or an array for in/not_in.' - example: 'Engineering' - required: - - 'field' - - 'operator' - - 'value' - type: 'object' - maxItems: 10 - minItems: 1 - type: 'array' - required: - - 'classifier_id' - - 'filters' - type: 'object' - dimensions: - items: - description: 'Dimension to group by (up to 2). Use the /meta endpoint for available dimensions.' - example: 'model' - type: 'string' - maxItems: 2 - type: 'array' - filters: - items: - properties: - field: - description: 'Dimension to filter on. Use the /meta endpoint for available dimensions.' - example: 'model' - type: 'string' - include_unset: - description: 'Include rows where the dimension has no value. Applies only to the `in` and `not_in` operators and dimensions that have an unset bucket.' - type: 'boolean' - operator: - description: 'Filter operator' - example: 'eq' - type: 'string' - value: - anyOf: - - type: 'string' - - format: 'double' - type: 'number' - - items: - anyOf: - - type: 'string' - - format: 'double' - type: 'number' - type: 'array' - description: 'Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.' - required: - - 'field' - - 'operator' - - 'value' - type: 'object' - maxItems: 20 - type: 'array' - granularity: - description: 'Time granularity' - example: 'day' - type: 'string' - group_limit: - description: 'Maximum rows per distinct combination of dimensions. When omitted on time-series queries (granularity + dimensions), auto-computed to avoid truncating time windows. Explicit values override the default and may truncate time buckets if set lower than the number of buckets in the range. Ignored when no dimensions are specified.' - example: 100 - type: 'integer' - limit: - description: 'Maximum total rows returned. Defaults to 1000. On time-series queries with dimensions and no explicit group_limit, the server may raise this to accommodate the expected number of unique time-bucket/dimension combinations.' - type: 'integer' - metrics: - items: - description: 'Metric name' - example: 'request_count' - type: 'string' - minItems: 1 - type: 'array' - order_by: - properties: - direction: - enum: - - 'asc' - - 'desc' - type: 'string' - x-speakeasy-unknown-values: allow - field: - description: 'Field to order by: a metric included in `metrics` (or "request_count", which may be ordered by without being requested), a requested dimension, or "date".' - example: 'request_count' - type: 'string' - required: - - 'field' - - 'direction' - type: 'object' - time_range: - properties: - end: - description: 'ISO 8601 UTC timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are rejected.' - example: '2027-12-31T23:59:59Z' - format: 'date-time' - type: 'string' - start: - description: 'ISO 8601 UTC timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are rejected.' - example: '2027-12-31T23:59:59Z' - format: 'date-time' - type: 'string' - required: - - 'start' - - 'end' - type: 'object' - required: - - 'metrics' - type: 'object' - required: true - responses: - '200': - content: - application/json: - example: - data: - data: - - date__day: '2025-01-01T00:00:00.000Z' - request_count: 1500 - metadata: - query_time_ms: 42 - row_count: 1 - truncated: false - schema: - properties: - data: - properties: - cachedAt: - format: 'double' - type: 'number' - data: - items: - description: 'A row of analytics data with metric/dimension values' - type: 'object' - type: 'array' - metadata: - properties: - query_time_ms: - format: 'double' - type: 'number' - row_count: - type: 'integer' - truncated: - type: 'boolean' - required: - - 'query_time_ms' - - 'row_count' - - 'truncated' - type: 'object' - warnings: - description: 'Warnings about filter resolution issues (e.g. unresolvable api_key_id hashes). The query still runs normally; these inform the caller that some filter values could not be resolved.' - items: - type: 'string' - type: 'array' - required: - - 'data' - - 'metadata' - type: 'object' - required: - - 'data' - type: 'object' - description: 'Analytics query results' - '400': - content: - application/json: - example: - error: - code: 400 - message: 'Invalid request parameters' - schema: - $ref: '#/components/schemas/BadRequestResponse' - description: 'Bad Request - Invalid request parameters or malformed input' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'Missing Authentication header' - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '403': - content: - application/json: - example: - error: - code: 403 - message: 'Only management keys can perform this operation' - schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' - '408': - content: - application/json: - example: - error: - code: 408 - message: 'Operation timed out. Please try again later.' - schema: - $ref: '#/components/schemas/RequestTimeoutResponse' - description: 'Request Timeout - Operation exceeded time limit' - '500': - content: - application/json: - example: - error: - code: 500 - message: 'Internal Server Error' - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - summary: 'Query analytics data' - tags: - - 'Analytics' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /api/alpha/decisions: - post: - description: 'Submits a Decisions request to the Decisions router' - operationId: 'createApiAlphaDecisions' - requestBody: - content: - application/json: - example: - model: 'typesafe/jev-1.13' - questions: - is_bug: - criteria: - 'false': 'The customer is asking a question or requesting a feature.' - 'true': 'The customer describes broken or unexpected product behavior.' - instructions: 'Is the customer reporting a software defect?' - type: 'noul' - team: - criteria: - account: 'Login, permissions, or profile issues.' - frontend: 'Rendering, layout, or browser compatibility issues.' - payments: 'Checkout, billing, or payment processing issues.' - instructions: 'Which team should own this ticket?' - type: 'choice' - urgency: - criteria: - - 'Can wait for the next release' - - 'Should be fixed this week' - - 'Blocking revenue right now' - instructions: 'How urgent is this ticket?' - type: 'score' - state: - customer_tier: 'enterprise' - ticket: 'My checkout page shows a blank screen after I click Pay. I have tried two browsers.' - schema: - $ref: '#/components/schemas/DecisionsRequest' - required: true - responses: - '200': - content: - application/json: - example: - answers: - is_bug: - noul: 0.96 - type: 'noul' - team: - choice: 'payments' - confidence: 0.75 - probabilities: - account: 0 - frontend: 0.16 - payments: 0.84 - type: 'choice' - urgency: - confidence: 0.99 - legend: - '0': 'Can wait for the next release' - '1': 'Should be fixed this week' - '2': 'Blocking revenue right now' - probabilities: - '0': 0 - '1': 0.01 - '2': 0.99 - score: 1.99 - type: 'score' - id: 'gen-dec-1789738314-X5e5eKGQdvR9rblyX250' - model: 'typesafe/jev-1.13-20260917' - provider: 'TypeSafe' - usage: - cost: 0.000019992 - input_tokens: 476 - output_tokens: 70 - schema: - $ref: '#/components/schemas/DecisionsResponse' - description: 'Decisions response' - '400': - content: - application/json: - example: - error: - code: 400 - message: 'Invalid request parameters' - schema: - $ref: '#/components/schemas/BadRequestResponse' - description: 'Bad Request - Invalid request parameters or malformed input' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'Missing Authentication header' - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '402': - content: - application/json: - example: - error: - code: 402 - message: 'Insufficient credits. Add more using https://openrouter.ai/credits' - schema: - $ref: '#/components/schemas/PaymentRequiredResponse' - description: 'Payment Required - Insufficient credits or quota to complete request' - '403': - content: - application/json: - example: - error: - code: 403 - message: 'Only management keys can perform this operation' - schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' - '404': - content: - application/json: - example: - error: - code: 404 - message: 'Resource not found' - schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' - '413': - content: - application/json: - example: - error: - code: 413 - message: 'Request payload too large' - schema: - $ref: '#/components/schemas/PayloadTooLargeResponse' - description: 'Payload Too Large - Request payload exceeds size limits' - '429': - content: - application/json: - example: - error: - code: 429 - message: 'Rate limit exceeded' - schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: 'Too Many Requests - Rate limit exceeded' - '500': - content: - application/json: - example: - error: - code: 500 - message: 'Internal Server Error' - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - '502': - content: - application/json: - example: - error: - code: 502 - message: 'Provider returned error' - schema: - $ref: '#/components/schemas/BadGatewayResponse' - description: 'Bad Gateway - Provider/upstream API failure' - '503': - content: - application/json: - example: - error: - code: 503 - message: 'Service temporarily unavailable' - schema: - $ref: '#/components/schemas/ServiceUnavailableResponse' - description: 'Service Unavailable - Service temporarily unavailable' - '524': - content: - application/json: - example: - error: - code: 524 - message: 'Request timed out. Please try again later.' - schema: - $ref: '#/components/schemas/EdgeNetworkTimeoutResponse' - description: 'Infrastructure Timeout - Provider request timed out at edge network' - '529': - content: - application/json: - example: - error: - code: 529 - message: 'Provider returned error' - schema: - $ref: '#/components/schemas/ProviderOverloadedResponse' - description: 'Provider Overloaded - Provider is temporarily overloaded' - servers: - - url: 'https://openrouter.ai' - summary: 'Submit a Decisions request' - tags: - - 'alpha.decisions' - x-speakeasy-name-override: 'create' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /audio/speech: - post: - description: 'Synthesizes audio from the input text. Returns a raw audio bytestream in the requested format (e.g. mp3, pcm, wav).' - operationId: 'createAudioSpeech' - requestBody: - content: - application/json: - example: - input: 'Hello world' - model: 'mistralai/voxtral-mini-tts-2603' - response_format: 'pcm' - speed: 1 - voice: 'en_paul_neutral' - schema: - $ref: '#/components/schemas/SpeechRequest' - required: true - responses: - '200': - content: - audio/*: - schema: - description: 'Raw audio bytestream. Content-Type varies by requested format (audio/mpeg for mp3, audio/pcm for pcm — 16-bit little-endian).' - example: '' - format: 'binary' - type: 'string' - description: 'Audio bytes stream' - '400': - content: - application/json: - example: - error: - code: 400 - message: 'Invalid request parameters' - schema: - $ref: '#/components/schemas/BadRequestResponse' - description: 'Bad Request - Invalid request parameters or malformed input' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'Missing Authentication header' - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '402': - content: - application/json: - example: - error: - code: 402 - message: 'Insufficient credits. Add more using https://openrouter.ai/credits' - schema: - $ref: '#/components/schemas/PaymentRequiredResponse' - description: 'Payment Required - Insufficient credits or quota to complete request' - '403': - content: - application/json: - example: - error: - code: 403 - message: 'Only management keys can perform this operation' - schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' - '404': - content: - application/json: - example: - error: - code: 404 - message: 'Resource not found' - schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' - '413': - content: - application/json: - example: - error: - code: 413 - message: 'Request payload too large' - schema: - $ref: '#/components/schemas/PayloadTooLargeResponse' - description: 'Payload Too Large - Request payload exceeds size limits' - '429': - content: - application/json: - example: - error: - code: 429 - message: 'Rate limit exceeded' - schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: 'Too Many Requests - Rate limit exceeded' - '500': - content: - application/json: - example: - error: - code: 500 - message: 'Internal Server Error' - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - '502': - content: - application/json: - example: - error: - code: 502 - message: 'Provider returned error' - schema: - $ref: '#/components/schemas/BadGatewayResponse' - description: 'Bad Gateway - Provider/upstream API failure' - '503': - content: - application/json: - example: - error: - code: 503 - message: 'Service temporarily unavailable' - schema: - $ref: '#/components/schemas/ServiceUnavailableResponse' - description: 'Service Unavailable - Service temporarily unavailable' - '524': - content: - application/json: - example: - error: - code: 524 - message: 'Request timed out. Please try again later.' - schema: - $ref: '#/components/schemas/EdgeNetworkTimeoutResponse' - description: 'Infrastructure Timeout - Provider request timed out at edge network' - '529': - content: - application/json: - example: - error: - code: 529 - message: 'Provider returned error' - schema: - $ref: '#/components/schemas/ProviderOverloadedResponse' - description: 'Provider Overloaded - Provider is temporarily overloaded' - summary: 'Create speech' - tags: - - 'TTS' - x-speakeasy-max-method-params: 1 - x-speakeasy-name-override: 'createSpeech' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /audio/transcriptions: - post: - description: 'Transcribes audio into text. Accepts base64-encoded audio input as JSON, an OpenAI-style multipart/form-data file upload, or a URL the provider downloads directly, and returns the transcribed text.' - operationId: 'createAudioTranscriptions' - requestBody: - content: - application/json: - example: - input_audio: - data: 'UklGRiQA...' - format: 'wav' - language: 'en' - model: 'openai/whisper-large-v3' - schema: - $ref: '#/components/schemas/STTRequest' - multipart/form-data: - example: - file: 'audio.wav' - language: 'en' - model: 'openai/whisper-large-v3' - schema: - properties: - diarize: - description: 'Label each word with the speaker who said it (words[].speaker, words[].speaker_label). Requires response_format "verbose_json" (400 otherwise); word timestamps are included even when timestamp_granularities[] omits "word". Only supported by some providers; 400 when the selected model cannot diarize.' - type: 'boolean' - file: - description: 'The audio file to transcribe. The format is derived from the filename extension or the file part content type. Max 25 MB; send larger files as base64 JSON via input_audio, or by URL via source_url. Exactly one of file or source_url is required.' - format: 'binary' - type: 'string' - keyterms[]: - description: 'Domain terms, names, or phrases to bias recognition toward; repeat the part once per term (keyterms=... is also accepted). Only supported by some providers; 400 when the selected model cannot use keyterms.' - items: - type: 'string' - type: 'array' - language: - description: 'The language of the input audio (ISO-639-1).' - type: 'string' - model: - description: 'The model to use for transcription.' - type: 'string' - provider: - description: 'JSON-encoded provider preferences object, the same shape as the JSON body field: { "zdr": true, "data_collection": "deny", "options": { "": { ... } } }. Only options for the matched provider are forwarded. Must decode to a JSON object.' - type: 'string' - response_format: - description: 'The response format. "json" (default) returns { text, usage }; "verbose_json" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only).' - enum: - - 'json' - - 'verbose_json' - type: 'string' - x-speakeasy-unknown-values: allow - session_id: - description: 'A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence.' - maxLength: 256 - type: 'string' - source_url: - description: 'Publicly reachable http(s) URL of the audio file, downloaded by the provider directly (no size limit on our side). The format is derived from the URL path extension. Only supported by some providers; exactly one of file or source_url is required.' - format: 'uri' - type: 'string' - temperature: - description: 'The sampling temperature.' - type: 'number' - timestamp_granularities[]: - description: 'Timestamp detail levels to include when response_format is "verbose_json". "word" additionally returns word-level timestamps in the words array.' - items: - enum: - - 'word' - - 'segment' - type: 'string' - x-speakeasy-unknown-values: allow - type: 'array' - trace: - description: 'JSON-encoded trace metadata object (trace_id, trace_name, span_name, generation_name, parent_span_id and custom keys) attached to the Broadcast trace. Must decode to a JSON object.' - type: 'string' - user: - description: 'A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider.' - maxLength: 256 - type: 'string' - required: - - 'model' - type: 'object' - required: true - responses: - '200': - content: - application/json: - example: - text: 'Hello, this is a test of OpenAI speech-to-text transcription.' - usage: - cost: 0.000508 - input_tokens: 83 - output_tokens: 30 - seconds: 9.2 - total_tokens: 113 - schema: - $ref: '#/components/schemas/STTResponse' - description: 'Transcription result' - '400': - content: - application/json: - example: - error: - code: 400 - message: 'Invalid request parameters' - schema: - $ref: '#/components/schemas/BadRequestResponse' - description: 'Bad Request - Invalid request parameters or malformed input' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'Missing Authentication header' - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '402': - content: - application/json: - example: - error: - code: 402 - message: 'Insufficient credits. Add more using https://openrouter.ai/credits' - schema: - $ref: '#/components/schemas/PaymentRequiredResponse' - description: 'Payment Required - Insufficient credits or quota to complete request' - '403': - content: - application/json: - example: - error: - code: 403 - message: 'Only management keys can perform this operation' - schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' - '404': - content: - application/json: - example: - error: - code: 404 - message: 'Resource not found' - schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' - '413': - content: - application/json: - example: - error: - code: 413 - message: 'Request payload too large' - schema: - $ref: '#/components/schemas/PayloadTooLargeResponse' - description: 'Payload Too Large - Request payload exceeds size limits' - '429': - content: - application/json: - example: - error: - code: 429 - message: 'Rate limit exceeded' - schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: 'Too Many Requests - Rate limit exceeded' - '500': - content: - application/json: - example: - error: - code: 500 - message: 'Internal Server Error' - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - '502': - content: - application/json: - example: - error: - code: 502 - message: 'Provider returned error' - schema: - $ref: '#/components/schemas/BadGatewayResponse' - description: 'Bad Gateway - Provider/upstream API failure' - '503': - content: - application/json: - example: - error: - code: 503 - message: 'Service temporarily unavailable' - schema: - $ref: '#/components/schemas/ServiceUnavailableResponse' - description: 'Service Unavailable - Service temporarily unavailable' - '504': - content: - application/json: - example: - error: - code: 504 - message: 'The operation was aborted due to timeout' - schema: - $ref: '#/components/schemas/GatewayTimeoutResponse' - description: 'Gateway Timeout - Provider did not respond before the upstream deadline' - '524': - content: - application/json: - example: - error: - code: 524 - message: 'Request timed out. Please try again later.' - schema: - $ref: '#/components/schemas/EdgeNetworkTimeoutResponse' - description: 'Infrastructure Timeout - Provider request timed out at edge network' - '529': - content: - application/json: - example: - error: - code: 529 - message: 'Provider returned error' - schema: - $ref: '#/components/schemas/ProviderOverloadedResponse' - description: 'Provider Overloaded - Provider is temporarily overloaded' - summary: 'Create transcription' - tags: - - 'STT' - x-speakeasy-max-method-params: 1 - x-speakeasy-name-override: 'createTranscription' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /auth/keys: - post: - description: 'Exchange an authorization code from the PKCE flow for a user-controlled API key' - operationId: 'exchangeAuthCodeForAPIKey' - requestBody: - content: - application/json: - example: - code: 'auth_code_abc123def456' - code_challenge_method: 'S256' - code_verifier: 'dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk' - schema: - example: - code: 'auth_code_abc123def456' - code_challenge_method: 'S256' - code_verifier: 'dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk' - properties: - code: - description: 'The authorization code received from the OAuth redirect' - example: 'auth_code_abc123def456' - type: 'string' - code_challenge_method: - description: 'The method used to generate the code challenge' - enum: - - 'S256' - - 'plain' - - null - example: 'S256' - type: - - 'string' - - 'null' - x-speakeasy-unknown-values: allow - code_verifier: - description: 'The code verifier if code_challenge was used in the authorization request' - example: 'dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk' - type: 'string' - required: - - 'code' - type: 'object' - required: true - responses: - '200': - content: - application/json: - example: - key: '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' - user_id: 'user_2yOPcMpKoQhcd4bVgSMlELRaIah' - schema: - example: - key: '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' - user_id: 'user_2yOPcMpKoQhcd4bVgSMlELRaIah' - properties: - key: - description: 'The API key to use for OpenRouter requests' - example: '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' - type: 'string' - user_id: - description: 'User ID associated with the API key' - example: 'user_2yOPcMpKoQhcd4bVgSMlELRaIah' - type: - - 'string' - - 'null' - required: - - 'key' - - 'user_id' - type: 'object' - description: 'Successfully exchanged code for an API key' - '400': - content: - application/json: - example: - error: - code: 400 - message: 'Invalid request parameters' - schema: - $ref: '#/components/schemas/BadRequestResponse' - description: 'Bad Request - Invalid request parameters or malformed input' - '403': - content: - application/json: - example: - error: - code: 403 - message: 'Only management keys can perform this operation' - schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' - '500': - content: - application/json: - example: - error: - code: 500 - message: 'Internal Server Error' - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - summary: 'Exchange authorization code for API key' - tags: - - 'OAuth' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /auth/keys/code: - post: - description: 'Create an authorization code for the PKCE flow to generate a user-controlled API key' - operationId: 'createAuthKeysCode' - requestBody: - content: - application/json: - example: - callback_url: 'https://myapp.com/auth/callback' - code_challenge: 'E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM' - code_challenge_method: 'S256' - limit: 100 - schema: - example: - callback_url: 'https://myapp.com/auth/callback' - code_challenge: 'E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM' - code_challenge_method: 'S256' - limit: 100 - properties: - callback_url: - description: 'The callback URL to redirect to after authorization. Supports https URLs and localhost/127.0.0.1 URLs on any port for local CLI tools.' - example: 'https://myapp.com/auth/callback' - format: 'uri' - type: 'string' - code_challenge: - description: 'PKCE code challenge for enhanced security' - example: 'E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM' - type: 'string' - code_challenge_method: - description: 'The method used to generate the code challenge' - enum: - - 'S256' - - 'plain' - example: 'S256' - type: 'string' - x-speakeasy-unknown-values: allow - expires_at: - description: 'Optional ISO 8601 UTC expiration timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are rejected.' - example: '2027-12-31T23:59:59Z' - format: 'date-time' - type: - - 'string' - - 'null' - key_label: - description: 'Optional custom label for the API key. Defaults to the app name if not provided.' - example: 'My Custom Key' - maxLength: 100 - type: 'string' - limit: - description: 'Credit limit for the API key to be created' - example: 100 - format: 'double' - type: 'number' - spawn_agent: - description: 'Agent identifier for spawn telemetry' - example: 'my-agent' - type: 'string' - x-fern-ignore: true - x-speakeasy-ignore: true - spawn_cloud: - description: 'Cloud identifier for spawn telemetry' - example: 'aws-us-east-1' - type: 'string' - x-fern-ignore: true - x-speakeasy-ignore: true - usage_limit_type: - description: 'Optional credit limit reset interval. When set, the credit limit resets on this interval.' - enum: - - 'daily' - - 'weekly' - - 'monthly' - example: 'monthly' - type: 'string' - x-speakeasy-unknown-values: allow - workspace_id: - description: 'Optional workspace ID to associate the API key with' - format: 'uuid' - type: 'string' - required: - - 'callback_url' - type: 'object' - required: true - responses: - '200': - content: - application/json: - example: - data: - app_id: 12345 - created_at: '2025-08-24T10:30:00Z' - id: 'auth_code_xyz789' - schema: - example: - data: - app_id: 12345 - created_at: '2025-08-24T10:30:00Z' - id: 'auth_code_xyz789' - properties: - data: - description: 'Auth code data' - example: - app_id: 12345 - created_at: '2025-08-24T10:30:00Z' - id: 'auth_code_xyz789' - properties: - app_id: - description: 'The application ID associated with this auth code' - example: 12345 - type: 'integer' - created_at: - description: 'ISO 8601 timestamp of when the auth code was created' - example: '2025-08-24T10:30:00Z' - type: 'string' - id: - description: 'The authorization code ID to use in the exchange request' - example: 'auth_code_xyz789' - type: 'string' - required: - - 'id' - - 'app_id' - - 'created_at' - type: 'object' - required: - - 'data' - type: 'object' - description: 'Successfully created authorization code' - '400': - content: - application/json: - example: - error: - code: 400 - message: 'Invalid request parameters' - schema: - $ref: '#/components/schemas/BadRequestResponse' - description: 'Bad Request - Invalid request parameters or malformed input' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'Missing Authentication header' - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '403': - content: - application/json: - example: - error: - code: 403 - message: 'Only management keys can perform this operation' - schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' - '409': - content: - application/json: - example: - error: - code: 409 - message: 'Resource conflict. Please try again later.' - schema: - $ref: '#/components/schemas/ConflictResponse' - description: 'Conflict - Resource conflict or concurrent modification' - '500': - content: - application/json: - example: - error: - code: 500 - message: 'Internal Server Error' - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - summary: 'Create authorization code' - tags: - - 'OAuth' - x-speakeasy-name-override: 'createAuthCode' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /batches: - get: - description: 'Lists batches in the workspace of the authenticating API key, newest first. To fetch the next page, pass the previous page''s `last_id` as `after`. List items omit `results`. Use `GET /batches/{id}` to get them. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).' - operationId: 'listBatches' - parameters: - - description: 'Maximum number of batches to return, from 1 through 100.' - in: 'query' - name: 'limit' - required: false - schema: - description: 'Maximum number of batches to return, from 1 through 100.' - example: 20 - type: 'integer' - - description: 'Batch id from the previous page''s `last_id`.' - in: 'query' - name: 'after' - required: false - schema: - description: 'Batch id from the previous page''s `last_id`.' - example: 'batch_7a4b02' - minLength: 1 - type: 'string' - - description: 'Repeat this parameter to include more than one status.' - explode: true - in: 'query' - name: 'status' - required: false - schema: - description: 'Repeat this parameter to include more than one status.' - example: - - 'completed' - - 'failed' - items: - $ref: '#/components/schemas/BatchListStatus' - type: 'array' - style: 'form' - - description: 'Only include batches created strictly after this timestamp.' - in: 'query' - name: 'created_after' - required: false - schema: - $ref: '#/components/schemas/BatchListTimestamp' - - description: 'Only include batches created strictly before this timestamp.' - in: 'query' - name: 'created_before' - required: false - schema: - allOf: - - $ref: '#/components/schemas/BatchListTimestamp' - - description: 'Only include batches created strictly before this timestamp.' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BatchListResponse' - description: 'A newest-first page of batches.' - '400': - content: - application/json: - example: - error: - code: 400 - message: 'Invalid batch list query.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'Malformed or unsupported batch list query parameters.' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'No auth credentials found.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'Missing or invalid API key.' - '429': - content: - application/json: - example: - error: - code: 429 - message: 'Rate limit exceeded.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'Batch API rate limit exceeded for the billable entity.' - '500': - content: - application/json: - example: - error: - code: 500 - message: 'Internal server error.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'Unexpected error in the ingress or upstream batch-api.' - '502': - content: - application/json: - example: - error: - code: 502 - message: 'Upstream batch-api is unavailable.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'The batch service is unavailable, or an upstream provider operation failed, including batch or file cleanup.' - summary: 'List batches' - tags: - - 'Batch' - x-speakeasy-name-override: 'list' - x-speakeasy-pagination: - inputs: - - in: 'parameters' - name: 'after' - type: 'cursor' - outputs: - nextCursor: '$.last_id' - results: '$.data' - type: 'cursor' - post: - description: 'Creates a batch of requests that run asynchronously against a single endpoint (`/v1/chat/completions`, `/v1/responses`, `/v1/messages`, `/v1/embeddings`). Returns `202` with `status: "validating"`. Poll `GET /batches/{id}` for progress and results. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).' - operationId: 'createBatches' - requestBody: - content: - application/json: - examples: - chatCompletions: - summary: 'Chat completions batch' - value: - endpoint: '/v1/chat/completions' - model: 'openai/gpt-4o' - requests: - - body: - messages: - - content: 'Summarize ...' - role: 'user' - model: 'openai/gpt-4o' - custom_id: 'req-0001' - messages: - summary: 'Messages batch' - value: - endpoint: '/v1/messages' - model: 'openai/gpt-5-nano' - requests: - - body: - max_tokens: 1024 - messages: - - content: 'Summarize ...' - role: 'user' - model: 'openai/gpt-5-nano' - custom_id: 'req-0001' - providerPinned: - summary: 'Batch pinned to Vertex' - value: - endpoint: '/v1/chat/completions' - model: 'google/gemini-3.6-flash' - provider: - only: - - 'google-vertex' - requests: - - body: - messages: - - content: 'Summarize ...' - role: 'user' - model: 'google/gemini-3.6-flash' - custom_id: 'req-0001' - responses: - summary: 'Responses batch' - value: - endpoint: '/v1/responses' - model: 'openai/gpt-4o' - requests: - - body: - input: - - content: - - text: 'Summarize ...' - type: 'input_text' - role: 'user' - model: 'openai/gpt-4o' - custom_id: 'req-0001' - schema: - $ref: '#/components/schemas/BatchSubmitBody' - description: 'The batch to create. Each item in `requests` has a unique `custom_id` and a `body` in the request format of the chosen `endpoint`.' - required: true - responses: - '202': - content: - application/json: - schema: - $ref: '#/components/schemas/BatchObject' - description: 'Batch payload durably persisted and queued for asynchronous validation and provider submission (`status: "validating"`).' - '400': - content: - application/json: - example: - error: - code: 400 - message: 'custom_id is required on requests[0].' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'Malformed batch input or an unknown/incompatible batch model.' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'No auth credentials found.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'Missing or invalid API key.' - '402': - content: - application/json: - example: - error: - code: 402 - message: 'Insufficient balance for this batch.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'The estimated batch cost exceeds the available balance.' - '403': - content: - application/json: - example: - error: - code: 403 - message: 'The selected provider or model is not allowed.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'The resolved batch endpoint is blocked by account policy.' - '404': - content: - application/json: - example: - error: - code: 404 - message: 'Batch not found.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'No batch exists for the given id.' - '413': - content: - application/json: - example: - error: - code: 413 - message: 'Batch input exceeds the 200 MB payload limit.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'Batch input exceeds the maximum payload size.' - '422': - content: - application/json: - example: - error: - code: 422 - message: 'The batch request could not be processed.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'The requested model variant or custom IDs violate Batch API constraints.' - '429': - content: - application/json: - example: - error: - code: 429 - message: 'Rate limit exceeded.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'Batch API rate limit exceeded for the billable entity.' - '500': - content: - application/json: - example: - error: - code: 500 - message: 'Internal server error.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'Unexpected error in the ingress or upstream batch-api.' - '502': - content: - application/json: - example: - error: - code: 502 - message: 'Upstream batch-api is unavailable.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'The batch service is unavailable, or an upstream provider operation failed, including batch or file cleanup.' - summary: 'Create a batch' - tags: - - 'Batch' - x-speakeasy-retries: - retryConnectionErrors: false - statusCodes: - - '429' - strategy: 'backoff' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /batches/{id}: - delete: - description: 'Deletes a batch in a terminal status (`completed`, `failed`, `expired`, or `cancelled`) and its stored requests and results. Batches still in progress return `409`. Billing and usage records are kept. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).' - operationId: 'deleteBatch' - parameters: - - description: 'The batch job id returned from submit.' - in: 'path' - name: 'id' - required: true - schema: - description: 'The batch job id returned from submit.' - example: 'batch_abc123' - minLength: 1 + description: 'Sampling rate for I/O logging (0.0001-1). 1 means 100% of requests are logged.' + example: 1 + format: 'double' + type: 'number' + is_data_discount_logging_enabled: + description: 'Whether data discount logging is enabled for this workspace' + example: true + type: 'boolean' + is_observability_broadcast_enabled: + description: 'Whether broadcast is enabled for this workspace' + example: false + type: 'boolean' + is_observability_io_logging_enabled: + description: 'Whether private logging is enabled for this workspace' + example: false + type: 'boolean' + name: + description: 'Name of the workspace' + example: 'Production' + type: 'string' + slug: + description: 'URL-friendly slug for the workspace' + example: 'production' + type: 'string' + updated_at: + description: 'ISO 8601 timestamp of when the workspace was last updated' + example: '2025-08-24T15:45:00Z' + type: + - 'string' + - 'null' + required: + - 'id' + - 'default_guardrail_id' + - 'name' + - 'slug' + - 'description' + - 'default_text_model' + - 'default_image_model' + - 'default_provider_sort' + - 'is_observability_io_logging_enabled' + - 'is_observability_broadcast_enabled' + - 'is_data_discount_logging_enabled' + - 'io_logging_sampling_rate' + - 'io_logging_api_key_ids' + - 'created_at' + - 'updated_at' + - 'created_by' + type: 'object' + WorkspaceBudget: + example: + created_at: '2025-08-24T10:30:00Z' + id: '770e8400-e29b-41d4-a716-446655440000' + limit_usd: 100 + reset_interval: 'monthly' + updated_at: '2025-08-24T15:45:00Z' + workspace_id: '550e8400-e29b-41d4-a716-446655440000' + properties: + created_at: + description: 'ISO 8601 timestamp of when the budget was created' + example: '2025-08-24T10:30:00Z' + type: 'string' + id: + description: 'Unique identifier for the budget' + example: '770e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + limit_usd: + description: 'Spending limit in USD for this interval' + example: 100 + format: 'double' + type: 'number' + reset_interval: + description: 'Interval at which spend resets. Null means a lifetime (one-time) budget.' + enum: + - 'daily' + - 'weekly' + - 'monthly' + - null + example: 'monthly' + type: + - 'string' + - 'null' + x-speakeasy-unknown-values: allow + updated_at: + description: 'ISO 8601 timestamp of when the budget was last updated' + example: '2025-08-24T15:45:00Z' + type: 'string' + workspace_id: + description: 'ID of the workspace the budget belongs to' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + required: + - 'id' + - 'workspace_id' + - 'limit_usd' + - 'reset_interval' + - 'created_at' + - 'updated_at' + type: 'object' + WorkspaceBudgetInterval: + description: 'Budget reset interval. Use "lifetime" for a one-time budget that never resets.' + enum: + - 'daily' + - 'weekly' + - 'monthly' + - 'lifetime' + example: 'monthly' + type: 'string' + x-speakeasy-unknown-values: allow + WorkspaceMember: + example: + created_at: '2025-08-24T10:30:00Z' + id: '660e8400-e29b-41d4-a716-446655440000' + role: 'member' + user_id: 'user_abc123' + workspace_id: '550e8400-e29b-41d4-a716-446655440000' + properties: + created_at: + description: 'ISO 8601 timestamp of when the membership was created' + example: '2025-08-24T10:30:00Z' + type: 'string' + id: + description: 'Unique identifier for the workspace membership' + example: '660e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + role: + description: 'Role of the member in the workspace' + enum: + - 'admin' + - 'member' + example: 'member' + type: 'string' + x-speakeasy-unknown-values: allow + user_id: + description: 'Clerk user ID of the member' + example: 'user_abc123' + type: 'string' + workspace_id: + description: 'ID of the workspace' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + required: + - 'id' + - 'workspace_id' + - 'user_id' + - 'role' + - 'created_at' + type: 'object' + XSearchOptions: + additionalProperties: false + description: 'Enable SpaceXAI X (Twitter) search alongside native web search, with optional filters. Only applies to SpaceXAI endpoints with native search; omit to search the web only. X search is billed separately by SpaceXAI, per post and per user profile fetched.' + example: + allowed_x_handles: + - 'OpenRouterAI' + from_date: '2025-01-01' + properties: + allowed_x_handles: + description: 'Only include posts from these X handles (max 20). Cannot be used with excluded_x_handles.' + example: + - 'OpenRouterAI' + items: type: 'string' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BatchDeletedObject' - description: 'The batch was deleted; per-target outcomes are reported under `deletion`.' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'No auth credentials found.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'Missing or invalid API key.' - '404': - content: - application/json: - example: - error: - code: 404 - message: 'Batch not found.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'No batch exists for the given id.' - '409': - content: - application/json: - example: - error: - code: 409 - message: 'Only completed, failed, expired, or cancelled batches can be deleted. Wait for the batch to finish and try again.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'The batch is still processing, its required provider key is unavailable, or its state changed during deletion.' - '429': - content: - application/json: - example: - error: - code: 429 - message: 'Rate limit exceeded.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'Batch API rate limit exceeded for the billable entity.' - '500': - content: - application/json: - example: - error: - code: 500 - message: 'Internal server error.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'Unexpected error in the ingress or upstream batch-api.' - '502': - content: - application/json: - example: - error: - code: 502 - message: 'Upstream batch-api is unavailable.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'The batch service is unavailable, or an upstream provider operation failed, including batch or file cleanup.' - summary: 'Delete a batch' - tags: - - 'Batch' - x-speakeasy-name-override: 'delete' - get: - description: 'Returns a batch with its status and request counts. Batches in a terminal status include `results`. Failed batches report the reason in `error.message`. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).' - operationId: 'getBatches' - parameters: - - description: 'The batch job id returned from submit.' - in: 'path' - name: 'id' - required: true - schema: - description: 'The batch job id returned from submit.' - example: 'batch_abc123' - minLength: 1 + maxItems: 20 + type: 'array' + enable_image_understanding: + description: 'Analyze images attached to matching posts.' + type: 'boolean' + enable_video_understanding: + description: 'Analyze videos attached to matching posts.' + type: 'boolean' + excluded_x_handles: + description: 'Exclude posts from these X handles (max 20). Cannot be used with allowed_x_handles.' + example: + - 'spamaccount' + items: type: 'string' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BatchObject' - description: 'The current batch job status.' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'No auth credentials found.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'Missing or invalid API key.' - '402': - content: - application/json: - schema: - $ref: '#/components/schemas/BatchPaymentRequiredResponse' - description: 'The finalized batch cost exceeds the available balance; metadata is returned with `results: null`. Top up credits and poll again to receive the persisted results.' - '404': - content: - application/json: - example: - error: - code: 404 - message: 'Batch not found.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'No batch exists for the given id.' - '410': - content: - application/json: - example: - error: - code: 410 - message: 'Batch results have expired. OpenRouter deletes batch results 30 days after the batch is created.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'The batch results were deleted after the 30-day retention window.' - '429': - content: - application/json: - example: - error: - code: 429 - message: 'Rate limit exceeded.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'Batch API rate limit exceeded for the billable entity.' - '500': - content: - application/json: - example: - error: - code: 500 - message: 'Internal server error.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'Unexpected error in the ingress or upstream batch-api.' - '502': - content: - application/json: - example: - error: - code: 502 - message: 'Upstream batch-api is unavailable.' - schema: - $ref: '#/components/schemas/BatchErrorResponse' - description: 'The batch service is unavailable, or an upstream provider operation failed, including batch or file cleanup.' - summary: 'Get a batch' - tags: - - 'Batch' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /benchmarks: + maxItems: 20 + type: 'array' + from_date: + description: 'Start of the post date range (ISO 8601 date, e.g. "2025-01-01").' + example: '2025-01-01' + format: 'date' + type: 'string' + to_date: + description: 'End of the post date range (ISO 8601 date, e.g. "2025-12-31").' + example: '2025-12-31' + format: 'date' + type: 'string' + type: 'object' + securitySchemes: + apiKey: + description: 'API key as bearer token in Authorization header' + scheme: 'bearer' + type: 'http' + bearer: + description: 'API key as bearer token in Authorization header' + scheme: 'bearer' + type: 'http' +externalDocs: + description: 'OpenRouter Documentation' + url: 'https://openrouter.ai/docs' +info: + contact: + email: 'support@openrouter.ai' + name: 'OpenRouter Support' + url: 'https://openrouter.ai/docs' + description: 'OpenAI-compatible API with additional OpenRouter features' + license: + name: 'MIT' + url: 'https://opensource.org/licenses/MIT' + title: 'OpenRouter API' + version: '1.0.0' +openapi: '3.1.0' +paths: + /activity: get: - description: 'Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena, and OpenRouter''s own tau-bench, GPQA, and web-search evals). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Use task_type=search (or a search_* benchmark_type) for OpenRouter''s search benchmarks, which publish each model''s highest-scoring eligible evaluation configuration with same-configuration runs combined by task-weighted mean. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.' - operationId: 'getBenchmarks' + description: 'Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. Pass `workspace_id` to scope the response to a single workspace. Pass `group_by=workspace` to split each row per workspace and include `workspace_id` on every item; by default rows are aggregated across workspaces and `workspace_id` is not returned. Activity recorded before workspace resolution existed is permanently attributed to the account default workspace (no backfill is possible). [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'getUserActivity' parameters: - - description: 'Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources.' - in: 'query' - name: 'source' - required: false - schema: - description: 'Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources.' - enum: - - 'artificial-analysis' - - 'design-arena' - - 'openrouter' - example: 'artificial-analysis' - type: 'string' - x-speakeasy-unknown-values: allow - - description: 'Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. `search` returns OpenRouter search benchmark results only.' - in: 'query' - name: 'task_type' - required: false - schema: - description: 'Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. `search` returns OpenRouter search benchmark results only.' - enum: - - 'coding' - - 'intelligence' - - 'agentic' - - 'search' - example: 'coding' - type: 'string' - x-speakeasy-unknown-values: allow - - description: 'Return results for one exact OpenRouter benchmark. A `search_*` value narrows the response to search results only; a classic value narrows the OpenRouter items and leaves other sources'' items as they are.' + - description: 'Filter by a single UTC date in the last 30 days (YYYY-MM-DD format).' in: 'query' - name: 'benchmark_type' + name: 'date' required: false schema: - description: 'Return results for one exact OpenRouter benchmark. A `search_*` value narrows the response to search results only; a classic value narrows the OpenRouter items and leaves other sources'' items as they are.' - enum: - - 'gpqa_diamond' - - 'tau_bench_verified_airline' - - 'search_browsecomp' - - 'search_hle' - - 'search_dsqa' - - 'search_widesearch' - example: 'search_widesearch' + description: 'Filter by a single UTC date in the last 30 days (YYYY-MM-DD format).' + example: '2025-08-24' type: 'string' - x-speakeasy-unknown-values: allow - - description: 'Search benchmarks only: include the published lane configuration whitelist in each search item. Defaults to false. The whitelist is limited to agent turn count, reasoning effort, and temperature so future harness configuration changes do not change the public contract.' - in: 'query' - name: 'include_run_config' - required: false - schema: - default: false - description: 'Search benchmarks only: include the published lane configuration whitelist in each search item. Defaults to false. The whitelist is limited to agent turn count, reasoning effort, and temperature so future harness configuration changes do not change the public contract.' - example: true - type: 'boolean' - - description: 'OpenRouter search benchmarks only: filter by the search engine used.' + - description: 'Filter by API key hash (SHA-256 hex string, as returned by the keys API).' in: 'query' - name: 'search_engine' + name: 'api_key_hash' required: false schema: - description: 'OpenRouter search benchmarks only: filter by the search engine used.' - example: 'exa' + description: 'Filter by API key hash (SHA-256 hex string, as returned by the keys API).' + example: 'abc123def456...' type: 'string' - - description: 'OpenRouter search benchmarks only: filter by the request surface the lane ran on.' + - description: 'Filter by org member user ID. Only applicable for organization accounts.' in: 'query' - name: 'search_surface' + name: 'user_id' required: false schema: - description: 'OpenRouter search benchmarks only: filter by the request surface the lane ran on.' - enum: - - 'server-tool' - - 'plugin' - example: 'server-tool' + description: 'Filter by org member user ID. Only applicable for organization accounts.' + example: 'user_abc123' type: 'string' - x-speakeasy-unknown-values: allow - - description: 'Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.' + - description: 'Set to ''workspace'' to split each row per workspace and include `workspace_id` on every item. Omitted by default, in which case rows are aggregated across workspaces (by date, model, and endpoint) and `workspace_id` is not returned — preserving the historical response shape.' in: 'query' - name: 'arena' + name: 'group_by' required: false schema: - description: 'Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.' + description: 'Set to ''workspace'' to split each row per workspace and include `workspace_id` on every item. Omitted by default, in which case rows are aggregated across workspaces (by date, model, and endpoint) and `workspace_id` is not returned — preserving the historical response shape.' enum: - - 'models' - - 'builders' - - 'agents' - example: 'models' + - 'workspace' + example: 'workspace' type: 'string' - x-speakeasy-unknown-values: allow - - description: 'Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories.' + - description: 'Filter by workspace ID (UUID). Returns only activity attributed to that workspace. The workspace must belong to the authenticated account.' in: 'query' - name: 'category' + name: 'workspace_id' required: false schema: - description: 'Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories.' - example: 'codecategories' + description: 'Filter by workspace ID (UUID). Returns only activity attributed to that workspace. The workspace must belong to the authenticated account.' + example: '550e8400-e29b-41d4-a716-446655440000' type: 'string' - - description: 'Maximum number of items to return. When omitted, all matching results are returned.' - in: 'query' - name: 'max_results' - required: false - schema: - description: 'Maximum number of items to return. When omitted, all matching results are returned.' - example: 50 - minimum: 1 - type: 'integer' responses: '200': content: application/json: example: data: - - agentic_index: 58.3 - coding_index: 65.8 - display_name: 'GPT-4o' - intelligence_index: 71.2 - model_permaslug: 'openai/gpt-4o' - pricing: - completion: '0.00001' - prompt: '0.0000025' - source: 'artificial-analysis' - - accuracy: 0.72 - accuracy_stddev: 0.03 - avg_cost_per_task: 0.002 - benchmark_type: 'gpqa_diamond' - display_name: 'GPT-4o' - last_run_timestamp: '2026-06-03T12:00:00Z' - model_permaslug: 'openai/gpt-4o' - source: 'openrouter' - total_tasks: 300 - meta: - as_of: '2026-06-03T12:00:00Z' - citation: null - model_count: 1 - source: null - source_url: null - task_type: null - version: 'v1' + - byok_usage_inference: 0.012 + cached_tokens: 10 + completion_tokens: 125 + date: '2025-08-24' + endpoint_id: '550e8400-e29b-41d4-a716-446655440000' + model: 'openai/gpt-4.1' + model_permaslug: 'openai/gpt-4.1-2025-04-14' + prompt_tokens: 50 + provider_name: 'OpenAI' + reasoning_tokens: 25 + requests: 5 + usage: 0.015 schema: - $ref: '#/components/schemas/UnifiedBenchmarksResponse' - description: 'Benchmark results filtered by the specified source and optional task type.' + $ref: '#/components/schemas/ActivityResponse' + description: 'Returns user activity data grouped by endpoint' '400': content: application/json: @@ -36977,16 +33845,26 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: 'Unauthorized - Authentication required or invalid credentials' - '429': + '403': content: application/json: example: error: - code: 429 - message: 'Rate limit exceeded' + code: 403 + message: 'Only management keys can perform this operation' schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: 'Too Many Requests - Rate limit exceeded' + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' '500': content: application/json: @@ -36997,203 +33875,420 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'List Benchmarks' + summary: 'Get user activity grouped by endpoint' tags: - - 'Benchmarks' + - 'Analytics' + x-speakeasy-max-method-params: 5 parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /byok: + /analytics/meta: get: - description: 'List the bring-your-own-key (BYOK) provider credentials for the authenticated entity''s default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace, or the `provider` query parameter to filter by upstream provider. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'listBYOKKeys' - parameters: - - description: 'Number of records to skip for pagination' - in: 'query' - name: 'offset' - required: false - schema: - default: 0 - description: 'Number of records to skip for pagination' - example: 0 - minimum: 0 - type: - - 'integer' - - 'null' - - description: 'Maximum number of records to return (max 100)' - in: 'query' - name: 'limit' - required: false - schema: - default: 50 - description: 'Maximum number of records to return (max 100)' - example: 50 - maximum: 100 - minimum: 1 - type: 'integer' - - description: 'Optional workspace ID to filter by. When omitted, resolves to the account’s default workspace; if that default has been deleted, the request returns a 400 and you must pass `workspace_id` explicitly.' - in: 'query' - name: 'workspace_id' - required: false - schema: - description: 'Optional workspace ID to filter by. When omitted, resolves to the account’s default workspace; if that default has been deleted, the request returns a 400 and you must pass `workspace_id` explicitly.' - example: '550e8400-e29b-41d4-a716-446655440000' - format: 'uuid' - type: 'string' - - description: 'Optional provider slug to filter by (e.g. `openai`, `anthropic`, `amazon-bedrock`).' - in: 'query' - name: 'provider' - required: false - schema: - description: 'Optional provider slug to filter by (e.g. `openai`, `anthropic`, `amazon-bedrock`).' - enum: - - 'ai21' - - 'aion-labs' - - 'akashml' - - 'alibaba' - - 'amazon-bedrock' - - 'amazon-bedrock/claude-on-aws' - - 'amazon-nova' - - 'ambient' - - 'anthropic' - - 'anthropic/2' - - 'arcee-ai' - - 'assemblyai' - - 'atlas-cloud' - - 'avian' - - 'azure' - - 'baidu' - - 'baseten' - - 'black-forest-labs' - - 'byteplus' - - 'cerebras' - - 'chutes' - - 'cirrascale' - - 'clarifai' - - 'claude-on-aws' - - 'cloudflare' - - 'cohere' - - 'coreweave' - - 'cosine' - - 'crusoe' - - 'darkbloom' - - 'databricks' - - 'decart' - - 'deepgram' - - 'deepinfra' - - 'deepseek' - - 'dekallm' - - 'digitalocean' - - 'elevenlabs' - - 'featherless' - - 'fireworks' - - 'fish-audio' - - 'friendli' - - 'gmicloud' - - 'google-ai-studio' - - 'google-vertex' - - 'groq' - - 'heygen' - - 'inception' - - 'inceptron' - - 'inferact-vllm' - - 'inference-net' - - 'infermatic' - - 'inflection' - - 'io-net' - - 'ionstream' - - 'krea' - - 'liquid' - - 'makora' - - 'mancer' - - 'mara' - - 'meta' - - 'minimax' - - 'mistral' - - 'modal' - - 'modelrun' - - 'modular' - - 'moonshotai' - - 'morph' - - 'near-ai' - - 'nebius' - - 'nex-agi' - - 'nextbit' - - 'novita' - - 'nvidia' - - 'ollama' - - 'open-inference' - - 'openai' - - 'parasail' - - 'pareto-alpha' - - 'perceptron' - - 'perplexity' - - 'phala' - - 'poolside' - - 'primeintellect' - - 'quiver' - - 'recraft' - - 'recursive' - - 'reka' - - 'relace' - - 'respan' - - 'runway' - - 'sail-research' - - 'sakana' - - 'sakana-ai' - - 'sambanova' - - 'scaledown' - - 'seed' - - 'siliconflow' - - 'sourceful' - - 'stepfun' - - 'streamlake' - - 'switchpoint' - - 'tencent' - - 'tenstorrent' - - 'thinkingmachines' - - 'together' - - 'typesafe' - - 'unbiased' - - 'upstage' - - 'venice' - - 'voyageai' - - 'wafer' - - 'wandb' - - 'wandb-legacy' - - 'xai' - - 'xiaomi' - - 'z-ai' - example: 'openai' - type: 'string' - x-speakeasy-unknown-values: allow + description: 'Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'getAnalyticsMeta' + responses: + '200': + content: + application/json: + example: + data: + dimensions: + - display_label: 'Model' + name: 'model' + granularities: + - display_label: 'Day' + name: 'day' + metrics: + - display_format: 'number' + display_label: 'Request Count' + is_rate: false + name: 'request_count' + operators: + - name: 'eq' + value_type: 'scalar' + schema: + properties: + data: + properties: + dimensions: + items: + properties: + display_label: + description: 'Human-readable label' + example: 'Model' + type: 'string' + name: + description: 'Dimension identifier used in query requests' + example: 'model' + type: 'string' + required: + - 'name' + - 'display_label' + type: 'object' + type: 'array' + granularities: + items: + properties: + display_label: + description: 'Human-readable label' + example: 'Day' + type: 'string' + name: + description: 'Granularity identifier' + enum: + - 'minute' + - 'hour' + - 'day' + - 'week' + - 'month' + example: 'day' + type: 'string' + x-speakeasy-unknown-values: allow + required: + - 'name' + - 'display_label' + type: 'object' + type: 'array' + metrics: + items: + properties: + display_format: + description: 'How this metric value should be formatted for display (e.g. percent → multiply by 100 and append %, currency → prefix with $)' + enum: + - 'number' + - 'currency' + - 'percent' + - 'latency' + - 'throughput' + example: 'number' + type: 'string' + x-speakeasy-unknown-values: allow + display_label: + description: 'Human-readable label' + example: 'Request Count' + type: 'string' + is_rate: + description: 'Whether this metric is a rate/ratio (averaged, not summed)' + type: 'boolean' + name: + description: 'Metric identifier used in query requests' + example: 'request_count' + type: 'string' + required: + - 'name' + - 'display_label' + - 'is_rate' + - 'display_format' + type: 'object' + type: 'array' + operators: + items: + properties: + name: + description: 'Operator identifier used in filter definitions' + enum: + - 'eq' + - 'neq' + - 'in' + - 'not_in' + - 'gt' + - 'gte' + - 'lt' + - 'lte' + example: 'eq' + type: 'string' + x-speakeasy-unknown-values: allow + value_type: + description: 'Whether the operator expects a single value or an array' + enum: + - 'scalar' + - 'array' + type: 'string' + x-speakeasy-unknown-values: allow + required: + - 'name' + - 'value_type' + type: 'object' + type: 'array' + required: + - 'metrics' + - 'dimensions' + - 'operators' + - 'granularities' + type: 'object' + required: + - 'data' + type: 'object' + description: 'Returns analytics query metadata' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Get available analytics metrics and dimensions' + tags: + - 'Analytics' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /analytics/query: + post: + description: 'Execute an analytics query with specified metrics, dimensions, filters, and time range. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'queryAnalytics' + requestBody: + content: + application/json: + example: + dimensions: + - 'model' + granularity: 'day' + limit: 100 + metrics: + - 'request_count' + time_range: + end: '2025-01-08T00:00:00Z' + start: '2025-01-01T00:00:00Z' + schema: + properties: + classifier_dimensions: + description: 'Group results by custom classifier tags, breaking down metrics by the specified dimension values. Requires an active classifier on the workspace.' + properties: + classifier_id: + description: 'UUID of the classifier whose tags to group by.' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + dimension_names: + items: + description: 'Classifier dimension name (snake_case identifier). Each name becomes its own column key in the response; providing two names cross-groups results by both dimensions. With no names, the response uses `clf_dimension_name`/`clf_dimension_value` columns (one row per dimension/value pair).' + example: 'department' + type: 'string' + maxItems: 2 + type: 'array' + include_nulls: + description: 'When true, also include generations that have no tag from this classifier. Defaults to false, which returns only classified generations.' + type: 'boolean' + required: + - 'classifier_id' + type: 'object' + classifier_filters: + description: 'Filter results to generations with specific classifier tag values. Can be combined with classifier_dimensions (must use the same classifier_id) or used independently with standard dimensions.' + properties: + classifier_id: + description: 'UUID of the classifier whose tags to filter by. Must match classifier_dimensions.classifier_id when both are specified.' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + filters: + items: + properties: + field: + description: 'Classifier dimension name to filter on (snake_case identifier, e.g. "department", "work_type").' + example: 'department' + type: 'string' + operator: + description: 'Filter operator. Only equality/set operators are supported (eq, neq, in, not_in) — ordered comparisons are not available because classification values are strings.' + example: 'eq' + type: 'string' + value: + anyOf: + - type: 'string' + - format: 'double' + type: 'number' + - items: + anyOf: + - type: 'string' + - format: 'double' + type: 'number' + type: 'array' + description: 'Filter value. Use a scalar (string or number) for eq/neq, or an array for in/not_in.' + example: 'Engineering' + required: + - 'field' + - 'operator' + - 'value' + type: 'object' + maxItems: 10 + minItems: 1 + type: 'array' + required: + - 'classifier_id' + - 'filters' + type: 'object' + dimensions: + items: + description: 'Dimension to group by (up to 2). Use the /meta endpoint for available dimensions.' + example: 'model' + type: 'string' + maxItems: 2 + type: 'array' + filters: + items: + properties: + field: + description: 'Dimension to filter on. Use the /meta endpoint for available dimensions.' + example: 'model' + type: 'string' + include_unset: + description: 'Include rows where the dimension has no value. Applies only to the `in` and `not_in` operators and dimensions that have an unset bucket.' + type: 'boolean' + operator: + description: 'Filter operator' + example: 'eq' + type: 'string' + value: + anyOf: + - type: 'string' + - format: 'double' + type: 'number' + - items: + anyOf: + - type: 'string' + - format: 'double' + type: 'number' + type: 'array' + description: 'Filter value (scalar or array depending on operator). Several dimensions are enriched in responses (returned as human-readable labels), but filters must use the underlying ID: `api_key_id` — numeric ID (from generation metadata) or key hash (64-char hex from GET /api/v1/keys, resolved server-side); `user` — Clerk user ID (e.g. "user_abc123"), not the display name; `workspace` — workspace UUID, not the workspace name (filtering or grouping by the account default workspace also covers activity recorded before workspace resolution existed, which is attributed to that default workspace); `app` — numeric app ID, not the app title; `model` — permaslug (e.g. "openai/gpt-4o"), not the display name. Other dimensions (provider, origin, country, etc.) are not enriched and accept the value as returned.' + required: + - 'field' + - 'operator' + - 'value' + type: 'object' + maxItems: 20 + type: 'array' + granularity: + description: 'Time granularity' + example: 'day' + type: 'string' + group_limit: + description: 'Maximum rows per distinct combination of dimensions. When omitted on time-series queries (granularity + dimensions), auto-computed to avoid truncating time windows. Explicit values override the default and may truncate time buckets if set lower than the number of buckets in the range. Ignored when no dimensions are specified.' + example: 100 + type: 'integer' + limit: + description: 'Maximum total rows returned. Defaults to 1000. On time-series queries with dimensions and no explicit group_limit, the server may raise this to accommodate the expected number of unique time-bucket/dimension combinations.' + type: 'integer' + metrics: + items: + description: 'Metric name' + example: 'request_count' + type: 'string' + minItems: 1 + type: 'array' + order_by: + properties: + direction: + enum: + - 'asc' + - 'desc' + type: 'string' + x-speakeasy-unknown-values: allow + field: + description: 'Field to order by: a metric included in `metrics` (or "request_count", which may be ordered by without being requested), a requested dimension, or "date".' + example: 'request_count' + type: 'string' + required: + - 'field' + - 'direction' + type: 'object' + time_range: + properties: + end: + description: 'ISO 8601 UTC timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are rejected.' + example: '2027-12-31T23:59:59Z' + format: 'date-time' + type: 'string' + start: + description: 'ISO 8601 UTC timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are rejected.' + example: '2027-12-31T23:59:59Z' + format: 'date-time' + type: 'string' + required: + - 'start' + - 'end' + type: 'object' + required: + - 'metrics' + type: 'object' + required: true responses: '200': content: application/json: example: data: - - allowed_api_key_hashes: null - allowed_models: null - allowed_user_ids: null - created_at: '2025-08-24T10:30:00Z' - declared_region: null - declared_zdr: null - disabled: false - id: '11111111-2222-3333-4444-555555555555' - is_byok_only: false - is_fallback: false - is_required: false - label: 'sk-...AbCd' - name: 'Production OpenAI Key' - provider: 'openai' - sort_order: 0 - workspace_id: '550e8400-e29b-41d4-a716-446655440000' - total_count: 1 + data: + - date__day: '2025-01-01T00:00:00.000Z' + request_count: 1500 + metadata: + query_time_ms: 42 + row_count: 1 + truncated: false schema: - $ref: '#/components/schemas/ListBYOKKeysResponse' - description: 'List of BYOK credentials' + properties: + data: + properties: + cachedAt: + format: 'double' + type: 'number' + data: + items: + description: 'A row of analytics data with metric/dimension values' + type: 'object' + type: 'array' + metadata: + properties: + query_time_ms: + format: 'double' + type: 'number' + row_count: + type: 'integer' + truncated: + type: 'boolean' + required: + - 'query_time_ms' + - 'row_count' + - 'truncated' + title: 'Metadata' + type: 'object' + warnings: + description: 'Warnings about filter resolution issues (e.g. unresolvable api_key_id hashes). The query still runs normally; these inform the caller that some filter values could not be resolved.' + items: + type: 'string' + type: 'array' + required: + - 'data' + - 'metadata' + type: 'object' + required: + - 'data' + type: 'object' + description: 'Analytics query results' '400': content: application/json: @@ -37224,6 +34319,16 @@ paths: schema: $ref: '#/components/schemas/ForbiddenResponse' description: 'Forbidden - Authentication successful but insufficient permissions' + '408': + content: + application/json: + example: + error: + code: 408 + message: 'Operation timed out. Please try again later.' + schema: + $ref: '#/components/schemas/RequestTimeoutResponse' + description: 'Request Timeout - Operation exceeded time limit' '500': content: application/json: @@ -37234,59 +34339,88 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'List BYOK provider credentials' + summary: 'Query analytics data' tags: - - 'BYOK' - x-speakeasy-name-override: 'list' - x-speakeasy-pagination: - inputs: - - in: 'parameters' - name: 'offset' - type: 'offset' - - in: 'parameters' - name: 'limit' - type: 'limit' - outputs: - results: '$.data' - type: 'offsetLimit' + - 'Analytics' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /api/alpha/decisions: post: - description: 'Create a new bring-your-own-key (BYOK) provider credential. The raw key is encrypted at rest and never returned in API responses. When `workspace_id` is omitted, the credential is created in the default workspace; if that default has been deleted, the request returns a 400 and you must pass `workspace_id` explicitly. Treat the raw key as write-only; it is never returned after creation. Use `allowed_api_key_hashes` to restrict the credential to specific OpenRouter API keys. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'createBYOKKey' + description: 'Submits a Decisions request to the Decisions router' + operationId: 'createApiAlphaDecisions' requestBody: content: application/json: example: - key: 'sk-proj-abc123...' - name: 'Production OpenAI Key' - provider: 'openai' + model: 'typesafe/jev-1.13' + questions: + is_bug: + criteria: + 'false': 'The customer is asking a question or requesting a feature.' + 'true': 'The customer describes broken or unexpected product behavior.' + instructions: 'Is the customer reporting a software defect?' + type: 'noul' + team: + criteria: + account: 'Login, permissions, or profile issues.' + frontend: 'Rendering, layout, or browser compatibility issues.' + payments: 'Checkout, billing, or payment processing issues.' + instructions: 'Which team should own this ticket?' + type: 'choice' + urgency: + criteria: + - 'Can wait for the next release' + - 'Should be fixed this week' + - 'Blocking revenue right now' + instructions: 'How urgent is this ticket?' + type: 'score' + state: + customer_tier: 'enterprise' + ticket: 'My checkout page shows a blank screen after I click Pay. I have tried two browsers.' schema: - $ref: '#/components/schemas/CreateBYOKKeyRequest' + $ref: '#/components/schemas/DecisionsRequest' required: true responses: - '201': + '200': content: application/json: example: - data: - allowed_api_key_hashes: null - allowed_models: null - allowed_user_ids: null - created_at: '2025-08-24T10:30:00Z' - declared_region: null - declared_zdr: null - disabled: false - id: '11111111-2222-3333-4444-555555555555' - is_byok_only: false - is_fallback: false - is_required: false - label: 'sk-...AbCd' - name: 'Production OpenAI Key' - provider: 'openai' - sort_order: 0 - workspace_id: '550e8400-e29b-41d4-a716-446655440000' + answers: + is_bug: + noul: 0.96 + type: 'noul' + team: + choice: 'payments' + confidence: 0.75 + probabilities: + account: 0 + frontend: 0.16 + payments: 0.84 + type: 'choice' + urgency: + confidence: 0.99 + legend: + '0': 'Can wait for the next release' + '1': 'Should be fixed this week' + '2': 'Blocking revenue right now' + probabilities: + '0': 0 + '1': 0.01 + '2': 0.99 + score: 1.99 + type: 'score' + id: 'gen-dec-1789738314-X5e5eKGQdvR9rblyX250' + model: 'typesafe/jev-1.13-20260917' + provider: 'TypeSafe' + usage: + cost: 0.000019992 + input_tokens: 476 + output_tokens: 70 schema: - $ref: '#/components/schemas/CreateBYOKKeyResponse' - description: 'BYOK credential created successfully' + $ref: '#/components/schemas/DecisionsResponse' + description: 'Decisions response' '400': content: application/json: @@ -37307,67 +34441,16 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: 'Unauthorized - Authentication required or invalid credentials' - '403': - content: - application/json: - example: - error: - code: 403 - message: 'Only management keys can perform this operation' - schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' - '500': - content: - application/json: - example: - error: - code: 500 - message: 'Internal Server Error' - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - summary: 'Create a BYOK provider credential' - tags: - - 'BYOK' - x-speakeasy-name-override: 'create' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /byok/{id}: - delete: - description: 'Delete (soft-delete) a bring-your-own-key (BYOK) provider credential by its `id`. The encrypted key material is wiped and the record is marked as deleted. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'deleteBYOKKey' - parameters: - - description: 'The BYOK credential ID (UUID).' - in: 'path' - name: 'id' - required: true - schema: - description: 'The BYOK credential ID (UUID).' - example: '11111111-2222-3333-4444-555555555555' - format: 'uuid' - type: 'string' - responses: - '200': - content: - application/json: - example: - deleted: true - schema: - $ref: '#/components/schemas/DeleteBYOKKeyResponse' - description: 'BYOK credential deleted successfully' - '401': + '402': content: application/json: example: error: - code: 401 - message: 'Missing Authentication header' + code: 402 + message: 'Insufficient credits. Add more using https://openrouter.ai/credits' schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' + $ref: '#/components/schemas/PaymentRequiredResponse' + description: 'Payment Required - Insufficient credits or quota to complete request' '403': content: application/json: @@ -37388,6 +34471,26 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: 'Not Found - Resource does not exist' + '413': + content: + application/json: + example: + error: + code: 413 + message: 'Request payload too large' + schema: + $ref: '#/components/schemas/PayloadTooLargeResponse' + description: 'Payload Too Large - Request payload exceeds size limits' + '429': + content: + application/json: + example: + error: + code: 429 + message: 'Rate limit exceeded' + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - Rate limit exceeded' '500': content: application/json: @@ -37398,139 +34501,82 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Delete a BYOK provider credential' - tags: - - 'BYOK' - x-speakeasy-name-override: 'delete' - get: - description: 'Get a single bring-your-own-key (BYOK) provider credential by its `id`. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'getBYOKKey' - parameters: - - description: 'The BYOK credential ID (UUID).' - in: 'path' - name: 'id' - required: true - schema: - description: 'The BYOK credential ID (UUID).' - example: '11111111-2222-3333-4444-555555555555' - format: 'uuid' - type: 'string' - responses: - '200': - content: - application/json: - example: - data: - allowed_api_key_hashes: null - allowed_models: null - allowed_user_ids: null - created_at: '2025-08-24T10:30:00Z' - declared_region: null - declared_zdr: null - disabled: false - id: '11111111-2222-3333-4444-555555555555' - is_byok_only: false - is_fallback: false - is_required: false - label: 'sk-...AbCd' - name: 'Production OpenAI Key' - provider: 'openai' - sort_order: 0 - workspace_id: '550e8400-e29b-41d4-a716-446655440000' - schema: - $ref: '#/components/schemas/GetBYOKKeyResponse' - description: 'BYOK credential details' - '401': + '502': content: application/json: example: error: - code: 401 - message: 'Missing Authentication header' + code: 502 + message: 'Provider returned error' schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '403': + $ref: '#/components/schemas/BadGatewayResponse' + description: 'Bad Gateway - Provider/upstream API failure' + '503': content: application/json: example: error: - code: 403 - message: 'Only management keys can perform this operation' + code: 503 + message: 'Service temporarily unavailable' schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' - '404': + $ref: '#/components/schemas/ServiceUnavailableResponse' + description: 'Service Unavailable - Service temporarily unavailable' + '524': content: application/json: example: error: - code: 404 - message: 'Resource not found' + code: 524 + message: 'Request timed out. Please try again later.' schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' - '500': + $ref: '#/components/schemas/EdgeNetworkTimeoutResponse' + description: 'Infrastructure Timeout - Provider request timed out at edge network' + '529': content: application/json: example: error: - code: 500 - message: 'Internal Server Error' + code: 529 + message: 'Provider returned error' schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - summary: 'Get a BYOK provider credential' + $ref: '#/components/schemas/ProviderOverloadedResponse' + description: 'Provider Overloaded - Provider is temporarily overloaded' + servers: + - url: 'https://openrouter.ai' + summary: 'Submit a Decisions request' tags: - - 'BYOK' - x-speakeasy-name-override: 'get' - patch: - description: 'Update an existing bring-your-own-key (BYOK) provider credential by its `id`. Include the `key` field to rotate the raw provider API key in-place (the previous key material is overwritten). Use `allowed_api_key_hashes` to restrict the credential to specific OpenRouter API keys (`null` clears the restriction). [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'updateBYOKKey' - parameters: - - description: 'The BYOK credential ID (UUID).' - in: 'path' - name: 'id' - required: true - schema: - description: 'The BYOK credential ID (UUID).' - example: '11111111-2222-3333-4444-555555555555' - format: 'uuid' - type: 'string' + - 'alpha.decisions' + x-speakeasy-name-override: 'create' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /audio/speech: + post: + description: 'Synthesizes audio from the input text. Returns a raw audio bytestream in the requested format (e.g. mp3, pcm, wav).' + operationId: 'createAudioSpeech' requestBody: content: application/json: example: - disabled: false - name: 'Updated OpenAI Key' + input: 'Hello world' + model: 'mistralai/voxtral-mini-tts-2603' + response_format: 'pcm' + speed: 1 + voice: 'en_paul_neutral' schema: - $ref: '#/components/schemas/UpdateBYOKKeyRequest' + $ref: '#/components/schemas/SpeechRequest' required: true responses: '200': content: - application/json: - example: - data: - allowed_api_key_hashes: null - allowed_models: null - allowed_user_ids: null - created_at: '2025-08-24T10:30:00Z' - declared_region: null - declared_zdr: null - disabled: false - id: '11111111-2222-3333-4444-555555555555' - is_byok_only: false - is_fallback: false - is_required: false - label: 'sk-...AbCd' - name: 'Updated OpenAI Key' - provider: 'openai' - sort_order: 0 - workspace_id: '550e8400-e29b-41d4-a716-446655440000' + audio/*: schema: - $ref: '#/components/schemas/UpdateBYOKKeyResponse' - description: 'BYOK credential updated successfully' + description: 'Raw audio bytestream. Content-Type varies by requested format (audio/mpeg for mp3, audio/pcm for pcm — 16-bit little-endian).' + example: '' + format: 'binary' + type: 'string' + description: 'Audio bytes stream' '400': content: application/json: @@ -37551,6 +34597,16 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: 'Unauthorized - Authentication required or invalid credentials' + '402': + content: + application/json: + example: + error: + code: 402 + message: 'Insufficient credits. Add more using https://openrouter.ai/credits' + schema: + $ref: '#/components/schemas/PaymentRequiredResponse' + description: 'Payment Required - Insufficient credits or quota to complete request' '403': content: application/json: @@ -37566,105 +34622,186 @@ paths: application/json: example: error: - code: 404 - message: 'Resource not found' + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '413': + content: + application/json: + example: + error: + code: 413 + message: 'Request payload too large' + schema: + $ref: '#/components/schemas/PayloadTooLargeResponse' + description: 'Payload Too Large - Request payload exceeds size limits' + '429': + content: + application/json: + example: + error: + code: 429 + message: 'Rate limit exceeded' + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - Rate limit exceeded' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + '502': + content: + application/json: + example: + error: + code: 502 + message: 'Provider returned error' + schema: + $ref: '#/components/schemas/BadGatewayResponse' + description: 'Bad Gateway - Provider/upstream API failure' + '503': + content: + application/json: + example: + error: + code: 503 + message: 'Service temporarily unavailable' schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' - '409': + $ref: '#/components/schemas/ServiceUnavailableResponse' + description: 'Service Unavailable - Service temporarily unavailable' + '524': content: application/json: example: error: - code: 409 - message: 'Resource conflict. Please try again later.' + code: 524 + message: 'Request timed out. Please try again later.' schema: - $ref: '#/components/schemas/ConflictResponse' - description: 'Conflict - Resource conflict or concurrent modification' - '500': + $ref: '#/components/schemas/EdgeNetworkTimeoutResponse' + description: 'Infrastructure Timeout - Provider request timed out at edge network' + '529': content: application/json: example: error: - code: 500 - message: 'Internal Server Error' + code: 529 + message: 'Provider returned error' schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - summary: 'Update a BYOK provider credential' + $ref: '#/components/schemas/ProviderOverloadedResponse' + description: 'Provider Overloaded - Provider is temporarily overloaded' + summary: 'Create speech' tags: - - 'BYOK' - x-speakeasy-name-override: 'update' + - 'TTS' + x-speakeasy-max-method-params: 1 + x-speakeasy-name-override: 'createSpeech' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /chat/completions: + /audio/transcriptions: post: - description: 'Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.' - operationId: 'sendChatCompletionRequest' - parameters: - - description: 'Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility.' - example: 'enabled' - in: 'header' - name: 'X-OpenRouter-Metadata' - required: false - schema: - $ref: '#/components/schemas/MetadataLevel' + description: 'Transcribes audio into text. Accepts base64-encoded audio input as JSON, an OpenAI-style multipart/form-data file upload, or a URL the provider downloads directly, and returns the transcribed text.' + operationId: 'createAudioTranscriptions' requestBody: content: application/json: example: - max_tokens: 150 - messages: - - content: 'You are a helpful assistant.' - role: 'system' - - content: 'What is the capital of France?' - role: 'user' - model: 'openai/gpt-4' - temperature: 0.7 + input_audio: + data: 'UklGRiQA...' + format: 'wav' + language: 'en' + model: 'openai/whisper-large-v3' schema: - $ref: '#/components/schemas/ChatRequest' + $ref: '#/components/schemas/STTRequest' + multipart/form-data: + example: + file: 'audio.wav' + language: 'en' + model: 'openai/whisper-large-v3' + schema: + properties: + diarize: + description: 'Label each word with the speaker who said it (words[].speaker, words[].speaker_label). Requires response_format "verbose_json" (400 otherwise); word timestamps are included even when timestamp_granularities[] omits "word". Only supported by some providers; 400 when the selected model cannot diarize.' + type: 'boolean' + file: + description: 'The audio file to transcribe. The format is derived from the filename extension or the file part content type. Max 25 MB; send larger files as base64 JSON via input_audio, or by URL via source_url. Exactly one of file or source_url is required.' + format: 'binary' + type: 'string' + keyterms[]: + description: 'Domain terms, names, or phrases to bias recognition toward; repeat the part once per term (keyterms=... is also accepted). Only supported by some providers; 400 when the selected model cannot use keyterms.' + items: + type: 'string' + type: 'array' + language: + description: 'The language of the input audio (ISO-639-1).' + type: 'string' + model: + description: 'The model to use for transcription.' + type: 'string' + provider: + description: 'JSON-encoded provider preferences object, the same shape as the JSON body field: { "zdr": true, "data_collection": "deny", "options": { "": { ... } } }. Only options for the matched provider are forwarded. Must decode to a JSON object.' + type: 'string' + response_format: + description: 'The response format. "json" (default) returns { text, usage }; "verbose_json" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only).' + enum: + - 'json' + - 'verbose_json' + type: 'string' + x-speakeasy-unknown-values: allow + session_id: + description: 'A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence.' + maxLength: 256 + type: 'string' + source_url: + description: 'Publicly reachable http(s) URL of the audio file, downloaded by the provider directly (no size limit on our side). The format is derived from the URL path extension. Only supported by some providers; exactly one of file or source_url is required.' + format: 'uri' + type: 'string' + temperature: + description: 'The sampling temperature.' + type: 'number' + timestamp_granularities[]: + description: 'Timestamp detail levels to include when response_format is "verbose_json". "word" additionally returns word-level timestamps in the words array.' + items: + enum: + - 'word' + - 'segment' + type: 'string' + x-speakeasy-unknown-values: allow + type: 'array' + trace: + description: 'JSON-encoded trace metadata object (trace_id, trace_name, span_name, generation_name, parent_span_id and custom keys) attached to the Broadcast trace. Must decode to a JSON object.' + type: 'string' + user: + description: 'A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider.' + maxLength: 256 + type: 'string' + required: + - 'model' + type: 'object' required: true responses: '200': content: application/json: example: - choices: - - finish_reason: 'stop' - index: 0 - message: - content: 'The capital of France is Paris.' - role: 'assistant' - created: 1677652288 - id: 'chatcmpl-123' - model: 'openai/gpt-4' - object: 'chat.completion' - system_fingerprint: 'fp_44709d6fcb' + text: 'Hello, this is a test of OpenAI speech-to-text transcription.' usage: - completion_tokens: 10 - prompt_tokens: 25 - total_tokens: 35 - schema: - $ref: '#/components/schemas/ChatResult' - text/event-stream: - example: - data: - choices: - - delta: - content: 'Hello' - role: 'assistant' - finish_reason: null - index: 0 - created: 1677652288 - id: 'chatcmpl-123' - model: 'openai/gpt-4' - object: 'chat.completion.chunk' + cost: 0.000508 + input_tokens: 83 + output_tokens: 30 + seconds: 9.2 + total_tokens: 113 schema: - $ref: '#/components/schemas/ChatStreamingResponse' - x-speakeasy-sse-sentinel: '[DONE]' - description: 'Successful chat completion response' + $ref: '#/components/schemas/STTResponse' + description: 'Transcription result' '400': content: application/json: @@ -37698,51 +34835,13 @@ paths: '403': content: application/json: - examples: - guardrail-blocked: - summary: 'Guardrail blocked the request' - value: - error: - code: 403 - message: 'Request blocked: prompt injection patterns detected' - metadata: - patterns: - - 'ignore all previous instructions' - openrouter_metadata: - attempt: 1 - endpoints: - available: - - model: 'openai/gpt-4o' - provider: 'OpenAI' - selected: false - total: 1 - is_byok: false - pipeline: - - data: - action: 'blocked' - detected: true - engines: - - 'regex' - patterns: - - 'ignore all previous instructions' - guardrail_id: 'grd_abc123' - guardrail_scope: 'api-key' - name: 'regex_pi_detection' - summary: 'Blocked: prompt injection detected (1 pattern matched)' - type: 'guardrail' - region: 'iad' - requested: 'openai/gpt-4o' - strategy: 'direct' - summary: 'available=1' - insufficient-permissions: - summary: 'Insufficient permissions' - value: - error: - code: 403 - message: 'Only management keys can perform this operation' + example: + error: + code: 403 + message: 'Only management keys can perform this operation' schema: $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions, or a guardrail blocked the request. When guardrails block and the `X-OpenRouter-Metadata: enabled` header is present, the response includes `openrouter_metadata` with full routing context and a `pipeline` array containing guardrail stage details.' + description: 'Forbidden - Authentication successful but insufficient permissions' '404': content: application/json: @@ -37753,16 +34852,6 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: 'Not Found - Resource does not exist' - '408': - content: - application/json: - example: - error: - code: 408 - message: 'Operation timed out. Please try again later.' - schema: - $ref: '#/components/schemas/RequestTimeoutResponse' - description: 'Request Timeout - Operation exceeded time limit' '413': content: application/json: @@ -37773,16 +34862,6 @@ paths: schema: $ref: '#/components/schemas/PayloadTooLargeResponse' description: 'Payload Too Large - Request payload exceeds size limits' - '422': - content: - application/json: - example: - error: - code: 422 - message: 'Invalid argument' - schema: - $ref: '#/components/schemas/UnprocessableEntityResponse' - description: 'Unprocessable Entity - Semantic validation failure' '429': content: application/json: @@ -37823,6 +34902,16 @@ paths: schema: $ref: '#/components/schemas/ServiceUnavailableResponse' description: 'Service Unavailable - Service temporarily unavailable' + '504': + content: + application/json: + example: + error: + code: 504 + message: 'The operation was aborted due to timeout' + schema: + $ref: '#/components/schemas/GatewayTimeoutResponse' + description: 'Gateway Timeout - Provider did not respond before the upstream deadline' '524': content: application/json: @@ -37843,60 +34932,82 @@ paths: schema: $ref: '#/components/schemas/ProviderOverloadedResponse' description: 'Provider Overloaded - Provider is temporarily overloaded' - summary: 'Create a chat completion' + summary: 'Create transcription' tags: - - 'Chat' - x-speakeasy-group: 'chat' - x-speakeasy-name-override: 'send' - x-speakeasy-stream-request-field: 'stream' + - 'STT' + x-speakeasy-max-method-params: 1 + x-speakeasy-name-override: 'createTranscription' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /classifications/task: - get: - description: "Returns the market-share breakdown of OpenRouter traffic by task classification\n(e.g. code generation, web search, summarization) over a trailing time window.\n\nEach classification reports its share of classified sampled requests (`usage_share`)\nand classified sampled token volume (`token_share`) as fractions between 0 and 1.\nThe unclassified `other` bucket is excluded. Absolute volumes are not exposed\nbecause the underlying data is sampled.\n\nEach classification also includes a `models` array listing the top models by\nrequest volume within that classification, with their within-tag usage and token shares.\n\nClassifications are grouped into macro-categories (Code, Data, Agent, General)\nwith aggregate shares provided for each.\n\nAuthenticate with any valid OpenRouter API key (same key used for inference).\nRate-limited to 30 requests/minute per key and 500 requests/day per account.\n\nWhen republishing or quoting this data, cite as:\n\"Source: OpenRouter (openrouter.ai/rankings), as of {as_of}.\"" - operationId: 'getTaskClassifications' - parameters: - - description: 'Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.' - in: 'query' - name: 'window' - required: false - schema: - default: '7d' - description: 'Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.' - enum: - - '7d' - example: '7d' - type: 'string' + /auth/keys: + post: + description: 'Exchange an authorization code from the PKCE flow for a user-controlled API key' + operationId: 'exchangeAuthCodeForAPIKey' + requestBody: + content: + application/json: + example: + code: 'auth_code_abc123def456' + code_challenge_method: 'S256' + code_verifier: 'dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk' + schema: + example: + code: 'auth_code_abc123def456' + code_challenge_method: 'S256' + code_verifier: 'dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk' + properties: + code: + description: 'The authorization code received from the OAuth redirect' + example: 'auth_code_abc123def456' + type: 'string' + code_challenge_method: + description: 'The method used to generate the code challenge' + enum: + - 'S256' + - 'plain' + - null + example: 'S256' + type: + - 'string' + - 'null' + x-speakeasy-unknown-values: allow + code_verifier: + description: 'The code verifier if code_challenge was used in the authorization request' + example: 'dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk' + type: 'string' + required: + - 'code' + type: 'object' + required: true responses: '200': content: application/json: example: - data: - as_of: '2026-06-17' - classifications: - - category_token_share: 0.48 - category_usage_share: 0.51 - display_name: 'Code Generation' - macro_category: 'code' - models: - - id: 'openai/gpt-4.1-mini' - tag_token_share: 0.75 - tag_usage_share: 0.55 - tag: 'code:general_impl' - token_share: 0.31 - usage_share: 0.23 - macro_categories: - - key: 'code' - label: 'Code' - token_share: 0.52 - usage_share: 0.45 - window_days: 7 + key: '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' + user_id: 'user_2yOPcMpKoQhcd4bVgSMlELRaIah' schema: - $ref: '#/components/schemas/TaskClassificationResponse' - description: 'Task classification market-share data for the requested trailing window.' + example: + key: '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' + user_id: 'user_2yOPcMpKoQhcd4bVgSMlELRaIah' + properties: + key: + description: 'The API key to use for OpenRouter requests' + example: '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' + type: 'string' + user_id: + description: 'User ID associated with the API key' + example: 'user_2yOPcMpKoQhcd4bVgSMlELRaIah' + type: + - 'string' + - 'null' + required: + - 'key' + - 'user_id' + type: 'object' + description: 'Successfully exchanged code for an API key' '400': content: application/json: @@ -37907,26 +35018,16 @@ paths: schema: $ref: '#/components/schemas/BadRequestResponse' description: 'Bad Request - Invalid request parameters or malformed input' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'Missing Authentication header' - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '429': + '403': content: application/json: example: error: - code: 429 - message: 'Rate limit exceeded' + code: 403 + message: 'Only management keys can perform this operation' schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: 'Too Many Requests - Rate limit exceeded' + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' '500': content: application/json: @@ -37937,65 +35038,139 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Task classification market share' + summary: 'Exchange authorization code for API key' tags: - - 'Classifications' + - 'OAuth' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /containers/{container_id}/files: - get: - description: 'Lists the files in a container, in lexicographic path order. The container id is the canonical id returned in bash/shell tool results; a restarted session is a separate container with its own id. Paginate with `limit` and `after` (pass the previous page’s `last_id`); `has_more: true` always means the next page is fetchable that way. `last_id` is the resume cursor: it is the last listed file’s id, except when a page ends at the per-request scan bound on hidden bookkeeping objects, where it names the scan position instead and may not appear in `data` (which can then be empty).' - operationId: 'listContainerFiles' - parameters: - - description: 'The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own `-r`-suffixed id. A session-derived id is always `sess_` + the sanitized session key, which is not necessarily the raw session id that was sent.' - in: 'path' - name: 'container_id' - required: true - schema: - description: 'The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own `-r`-suffixed id. A session-derived id is always `sess_` + the sanitized session key, which is not necessarily the raw session id that was sent.' - example: 'sess_abc123' - type: 'string' - - description: 'Maximum number of files to return (1-1000). Defaults to 100 when absent.' - in: 'query' - name: 'limit' - required: false - schema: - default: 100 - description: 'Maximum number of files to return (1-1000). Defaults to 100 when absent.' - example: 100 - maximum: 1000 - minimum: 1 - type: 'integer' - - description: 'Forward cursor: the previous page’s `last_id` (or any container file id); listing resumes strictly after that path. A `last_id` from a page that stopped at the scan bound may name a directory-marker path (trailing `/`) that was never listed as a file; such cursors are accepted.' - in: 'query' - name: 'after' - required: false - schema: - description: 'Forward cursor: the previous page’s `last_id` (or any container file id); listing resumes strictly after that path. A `last_id` from a page that stopped at the scan bound may name a directory-marker path (trailing `/`) that was never listed as a file; such cursors are accepted.' - example: 'cfile_b3V0L3JlcG9ydC5jc3Y' - type: 'string' - responses: - '200': - content: - application/json: + /auth/keys/code: + post: + description: 'Create an authorization code for the PKCE flow to generate a user-controlled API key' + operationId: 'createAuthKeysCode' + requestBody: + content: + application/json: + example: + callback_url: 'https://myapp.com/auth/callback' + code_challenge: 'E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM' + code_challenge_method: 'S256' + limit: 100 + schema: example: - data: - - bytes: 123 - container_id: 'sess_abc123' - created_at: 1755640000 - id: 'cfile_b3V0L3JlcG9ydC5jc3Y' - object: 'container.file' - path: 'out/report.csv' - source: 'assistant' - first_id: 'cfile_b3V0L3JlcG9ydC5jc3Y' - has_more: false - last_id: 'cfile_b3V0L3JlcG9ydC5jc3Y' - object: 'list' + callback_url: 'https://myapp.com/auth/callback' + code_challenge: 'E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM' + code_challenge_method: 'S256' + limit: 100 + properties: + callback_url: + description: 'The callback URL to redirect to after authorization. Supports https URLs and localhost/127.0.0.1 URLs on any port for local CLI tools.' + example: 'https://myapp.com/auth/callback' + format: 'uri' + type: 'string' + code_challenge: + description: 'PKCE code challenge for enhanced security' + example: 'E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM' + type: 'string' + code_challenge_method: + description: 'The method used to generate the code challenge' + enum: + - 'S256' + - 'plain' + example: 'S256' + type: 'string' + x-speakeasy-unknown-values: allow + expires_at: + description: 'Optional ISO 8601 UTC expiration timestamp. Must include seconds (YYYY-MM-DDTHH:MM:SSZ; fractional seconds allowed); minute-precision timestamps are rejected.' + example: '2027-12-31T23:59:59Z' + format: 'date-time' + type: + - 'string' + - 'null' + key_label: + description: 'Optional custom label for the API key. Defaults to the app name if not provided.' + example: 'My Custom Key' + maxLength: 100 + type: 'string' + limit: + description: 'Credit limit for the API key to be created' + example: 100 + format: 'double' + type: 'number' + spawn_agent: + description: 'Agent identifier for spawn telemetry' + example: 'my-agent' + type: 'string' + x-fern-ignore: true + x-speakeasy-ignore: true + spawn_cloud: + description: 'Cloud identifier for spawn telemetry' + example: 'aws-us-east-1' + type: 'string' + x-fern-ignore: true + x-speakeasy-ignore: true + usage_limit_type: + description: 'Optional credit limit reset interval. When set, the credit limit resets on this interval.' + enum: + - 'daily' + - 'weekly' + - 'monthly' + example: 'monthly' + type: 'string' + x-speakeasy-unknown-values: allow + workspace_id: + description: 'Optional workspace ID to associate the API key with' + format: 'uuid' + type: 'string' + required: + - 'callback_url' + type: 'object' + required: true + responses: + '200': + content: + application/json: + example: + data: + app_id: 12345 + created_at: '2025-08-24T10:30:00Z' + id: 'auth_code_xyz789' schema: - $ref: '#/components/schemas/ContainerFileListResponse' - description: 'The files in the container.' + example: + data: + app_id: 12345 + created_at: '2025-08-24T10:30:00Z' + id: 'auth_code_xyz789' + properties: + data: + description: 'Auth code data' + example: + app_id: 12345 + created_at: '2025-08-24T10:30:00Z' + id: 'auth_code_xyz789' + properties: + app_id: + description: 'The application ID associated with this auth code' + example: 12345 + type: 'integer' + created_at: + description: 'ISO 8601 timestamp of when the auth code was created' + example: '2025-08-24T10:30:00Z' + type: 'string' + id: + description: 'The authorization code ID to use in the exchange request' + example: 'auth_code_xyz789' + type: 'string' + required: + - 'id' + - 'app_id' + - 'created_at' + type: 'object' + required: + - 'data' + type: 'object' + description: 'Successfully created authorization code' '400': content: application/json: @@ -38026,16 +35201,16 @@ paths: schema: $ref: '#/components/schemas/ForbiddenResponse' description: 'Forbidden - Authentication successful but insufficient permissions' - '429': + '409': content: application/json: example: error: - code: 429 - message: 'Rate limit exceeded' + code: 409 + message: 'Resource conflict. Please try again later.' schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: 'Too Many Requests - Rate limit exceeded' + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' '500': content: application/json: @@ -38046,790 +35221,638 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - '503': - content: - application/json: - example: - error: - code: 503 - message: 'Service temporarily unavailable' - schema: - $ref: '#/components/schemas/ServiceUnavailableResponse' - description: 'Service Unavailable - Service temporarily unavailable' - summary: 'List container files' + summary: 'Create authorization code' tags: - - 'Containers' + - 'OAuth' + x-speakeasy-name-override: 'createAuthCode' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /containers/{container_id}/files/{file_id}: + /batches: get: - description: 'Returns the metadata of a single file in a container.' - operationId: 'getContainerFile' + description: 'Lists batches in the workspace of the authenticating API key, newest first. To fetch the next page, pass the previous page''s `last_id` as `after`. List items omit `results`. Use `GET /batches/{id}` to get them. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).' + operationId: 'listBatches' parameters: - - description: 'The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own `-r`-suffixed id. A session-derived id is always `sess_` + the sanitized session key, which is not necessarily the raw session id that was sent.' - in: 'path' - name: 'container_id' - required: true + - description: 'Maximum number of batches to return, from 1 through 100.' + in: 'query' + name: 'limit' + required: false schema: - description: 'The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own `-r`-suffixed id. A session-derived id is always `sess_` + the sanitized session key, which is not necessarily the raw session id that was sent.' - example: 'sess_abc123' - type: 'string' - - description: 'Container file id (`cfile_` + base64url of the file path).' - in: 'path' - name: 'file_id' - required: true + description: 'Maximum number of batches to return, from 1 through 100.' + example: 20 + type: 'integer' + - description: 'Batch id from the previous page''s `last_id`.' + in: 'query' + name: 'after' + required: false schema: - description: 'Container file id (`cfile_` + base64url of the file path).' - example: 'cfile_b3V0L3JlcG9ydC5jc3Y' + description: 'Batch id from the previous page''s `last_id`.' + example: 'batch_7a4b02' + minLength: 1 type: 'string' + - description: 'Repeat this parameter to include more than one status.' + explode: true + in: 'query' + name: 'status' + required: false + schema: + description: 'Repeat this parameter to include more than one status.' + example: + - 'completed' + - 'failed' + items: + $ref: '#/components/schemas/BatchListStatus' + type: 'array' + style: 'form' + - description: 'Only include batches created strictly after this timestamp.' + in: 'query' + name: 'created_after' + required: false + schema: + $ref: '#/components/schemas/BatchListTimestamp' + - description: 'Only include batches created strictly before this timestamp.' + in: 'query' + name: 'created_before' + required: false + schema: + allOf: + - $ref: '#/components/schemas/BatchListTimestamp' + - description: 'Only include batches created strictly before this timestamp.' responses: '200': content: application/json: - example: - bytes: 123 - container_id: 'sess_abc123' - created_at: 1755640000 - id: 'cfile_b3V0L3JlcG9ydC5jc3Y' - object: 'container.file' - path: 'out/report.csv' - source: 'assistant' schema: - $ref: '#/components/schemas/ContainerFile' - description: 'The container file.' + $ref: '#/components/schemas/BatchListResponse' + description: 'A newest-first page of batches.' '400': content: application/json: example: error: code: 400 - message: 'Invalid request parameters' + message: 'Invalid batch list query.' schema: - $ref: '#/components/schemas/BadRequestResponse' - description: 'Bad Request - Invalid request parameters or malformed input' + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Malformed or unsupported batch list query parameters.' '401': content: application/json: example: error: code: 401 - message: 'Missing Authentication header' - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '403': - content: - application/json: - example: - error: - code: 403 - message: 'Only management keys can perform this operation' - schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' - '404': - content: - application/json: - example: - error: - code: 404 - message: 'Resource not found' + message: 'No auth credentials found.' schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Missing or invalid API key.' '429': content: application/json: example: error: code: 429 - message: 'Rate limit exceeded' + message: 'Rate limit exceeded.' schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: 'Too Many Requests - Rate limit exceeded' + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Batch API rate limit exceeded for the billable entity.' '500': content: application/json: example: error: code: 500 - message: 'Internal Server Error' + message: 'Internal server error.' schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - '503': + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Unexpected error in the ingress or upstream batch-api.' + '502': content: application/json: example: error: - code: 503 - message: 'Service temporarily unavailable' + code: 502 + message: 'Upstream batch-api is unavailable.' schema: - $ref: '#/components/schemas/ServiceUnavailableResponse' - description: 'Service Unavailable - Service temporarily unavailable' - summary: 'Retrieve a container file' + $ref: '#/components/schemas/BatchErrorResponse' + description: 'The batch service is unavailable, or an upstream provider operation failed, including batch or file cleanup.' + summary: 'List batches' tags: - - 'Containers' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /containers/{container_id}/files/{file_id}/content: - get: - description: 'Streams the raw bytes of a file in a container.' - operationId: 'downloadContainerFileContent' - parameters: - - description: 'The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own `-r`-suffixed id. A session-derived id is always `sess_` + the sanitized session key, which is not necessarily the raw session id that was sent.' - in: 'path' - name: 'container_id' - required: true - schema: - description: 'The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own `-r`-suffixed id. A session-derived id is always `sess_` + the sanitized session key, which is not necessarily the raw session id that was sent.' - example: 'sess_abc123' - type: 'string' - - description: 'Container file id (`cfile_` + base64url of the file path).' - in: 'path' - name: 'file_id' - required: true - schema: - description: 'Container file id (`cfile_` + base64url of the file path).' - example: 'cfile_b3V0L3JlcG9ydC5jc3Y' - type: 'string' + - 'Batch' + x-speakeasy-name-override: 'list' + x-speakeasy-pagination: + inputs: + - in: 'parameters' + name: 'after' + type: 'cursor' + outputs: + nextCursor: '$.last_id' + results: '$.data' + type: 'cursor' + post: + description: 'Creates a batch of requests that run asynchronously against a single endpoint (`/v1/chat/completions`, `/v1/responses`, `/v1/messages`, `/v1/embeddings`). Returns `202` with `status: "validating"`. Poll `GET /batches/{id}` for progress and results. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).' + operationId: 'createBatches' + requestBody: + content: + application/json: + examples: + chatCompletions: + summary: 'Chat completions batch' + value: + endpoint: '/v1/chat/completions' + model: 'openai/gpt-4o' + requests: + - body: + messages: + - content: 'Summarize ...' + role: 'user' + model: 'openai/gpt-4o' + custom_id: 'req-0001' + messages: + summary: 'Messages batch' + value: + endpoint: '/v1/messages' + model: 'openai/gpt-5-nano' + requests: + - body: + max_tokens: 1024 + messages: + - content: 'Summarize ...' + role: 'user' + model: 'openai/gpt-5-nano' + custom_id: 'req-0001' + providerPinned: + summary: 'Batch pinned to Vertex' + value: + endpoint: '/v1/chat/completions' + model: 'google/gemini-3.6-flash' + provider: + only: + - 'google-vertex' + requests: + - body: + messages: + - content: 'Summarize ...' + role: 'user' + model: 'google/gemini-3.6-flash' + custom_id: 'req-0001' + responses: + summary: 'Responses batch' + value: + endpoint: '/v1/responses' + model: 'openai/gpt-4o' + requests: + - body: + input: + - content: + - text: 'Summarize ...' + type: 'input_text' + role: 'user' + model: 'openai/gpt-4o' + custom_id: 'req-0001' + schema: + $ref: '#/components/schemas/BatchSubmitBody' + description: 'The batch to create. Each item in `requests` has a unique `custom_id` and a `body` in the request format of the chosen `endpoint`.' + required: true responses: - '200': + '202': content: - application/octet-stream: - example: 'binary file contents' + application/json: schema: - format: 'binary' - type: 'string' - description: 'The raw file content.' + $ref: '#/components/schemas/BatchObject' + description: 'Batch payload durably persisted and queued for asynchronous validation and provider submission (`status: "validating"`).' '400': content: application/json: example: error: code: 400 - message: 'Invalid request parameters' + message: 'custom_id is required on requests[0].' schema: - $ref: '#/components/schemas/BadRequestResponse' - description: 'Bad Request - Invalid request parameters or malformed input' + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Malformed batch input or an unknown/incompatible batch model.' '401': content: application/json: example: error: code: 401 - message: 'Missing Authentication header' + message: 'No auth credentials found.' schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Missing or invalid API key.' + '402': + content: + application/json: + example: + error: + code: 402 + message: 'Insufficient balance for this batch.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'The estimated batch cost exceeds the available balance.' '403': content: application/json: example: error: code: 403 - message: 'Only management keys can perform this operation' + message: 'The selected provider or model is not allowed.' schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' + $ref: '#/components/schemas/BatchErrorResponse' + description: 'The resolved batch endpoint is blocked by account policy.' '404': content: application/json: example: error: code: 404 - message: 'Resource not found' + message: 'Batch not found.' schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' + $ref: '#/components/schemas/BatchErrorResponse' + description: 'No batch exists for the given id.' + '413': + content: + application/json: + example: + error: + code: 413 + message: 'Batch input exceeds the 200 MB payload limit.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Batch input exceeds the maximum payload size.' + '422': + content: + application/json: + example: + error: + code: 422 + message: 'The batch request could not be processed.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'The requested model variant or custom IDs violate Batch API constraints.' '429': content: application/json: example: error: code: 429 - message: 'Rate limit exceeded' + message: 'Rate limit exceeded.' schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: 'Too Many Requests - Rate limit exceeded' + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Batch API rate limit exceeded for the billable entity.' '500': content: application/json: example: error: code: 500 - message: 'Internal Server Error' + message: 'Internal server error.' schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - '503': + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Unexpected error in the ingress or upstream batch-api.' + '502': content: application/json: example: error: - code: 503 - message: 'Service temporarily unavailable' + code: 502 + message: 'Upstream batch-api is unavailable.' schema: - $ref: '#/components/schemas/ServiceUnavailableResponse' - description: 'Service Unavailable - Service temporarily unavailable' - summary: 'Download container file content' + $ref: '#/components/schemas/BatchErrorResponse' + description: 'The batch service is unavailable, or an upstream provider operation failed, including batch or file cleanup.' + summary: 'Create a batch' tags: - - 'Containers' + - 'Batch' + x-speakeasy-retries: + retryConnectionErrors: false + statusCodes: + - '429' + strategy: 'backoff' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /containers/{container_id}/files/{file_id}/promote: - post: - description: 'Copies a file from the container''s sandbox prefix into the workspace''s durable document storage, so it outlives the container. Returns the new document in the Files API shape, with a durable file id in the documents namespace. The copy counts against the workspace''s storage quota. Unlike a direct upload, promoted files are downloadable.' - operationId: 'promoteContainerFile' + /batches/{id}: + delete: + description: 'Deletes a batch in a terminal status (`completed`, `failed`, `expired`, or `cancelled`) and its stored requests and results. Batches still in progress return `409`. Billing and usage records are kept. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).' + operationId: 'deleteBatch' parameters: - - description: 'The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own `-r`-suffixed id. A session-derived id is always `sess_` + the sanitized session key, which is not necessarily the raw session id that was sent.' - in: 'path' - name: 'container_id' - required: true - schema: - description: 'The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own `-r`-suffixed id. A session-derived id is always `sess_` + the sanitized session key, which is not necessarily the raw session id that was sent.' - example: 'sess_abc123' - type: 'string' - - description: 'Container file id (`cfile_` + base64url of the file path).' + - description: 'The batch job id returned from submit.' in: 'path' - name: 'file_id' + name: 'id' required: true schema: - description: 'Container file id (`cfile_` + base64url of the file path).' - example: 'cfile_b3V0L3JlcG9ydC5jc3Y' + description: 'The batch job id returned from submit.' + example: 'batch_abc123' + minLength: 1 type: 'string' responses: '200': content: application/json: - example: - _shape: 'openrouter' - created_at: '2026-08-23T00:00:00Z' - downloadable: true - filename: 'out/report.csv' - id: 'or_file_011CNha8iCJcU1wXNR6q4V8w' - mime_type: 'text/csv' - size_bytes: 123 - type: 'file' - schema: - $ref: '#/components/schemas/FileResponse' - description: 'The promoted file, as a workspace document.' - '400': - content: - application/json: - example: - error: - code: 400 - message: 'Invalid request parameters' - schema: - $ref: '#/components/schemas/BadRequestResponse' - description: 'Bad Request - Invalid request parameters or malformed input' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'Missing Authentication header' - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '403': - content: - application/json: - example: - error: - code: 403 - message: 'Only management keys can perform this operation' - schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' - '404': - content: - application/json: - example: - error: - code: 404 - message: 'Resource not found' - schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' - '413': - content: - application/json: - example: - error: - code: 413 - message: 'Request payload too large' - schema: - $ref: '#/components/schemas/PayloadTooLargeResponse' - description: 'Payload Too Large - Request payload exceeds size limits' - '429': - content: - application/json: - example: - error: - code: 429 - message: 'Rate limit exceeded' - schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: 'Too Many Requests - Rate limit exceeded' - '499': - content: - application/json: - example: - error: - code: 499 - message: 'The request was cancelled.' - schema: - $ref: '#/components/schemas/ClientClosedRequestResponse' - description: 'Client Closed Request - The caller cancelled the request' - '500': - content: - application/json: - example: - error: - code: 500 - message: 'Internal Server Error' schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - '503': + $ref: '#/components/schemas/BatchDeletedObject' + description: 'The batch was deleted; per-target outcomes are reported under `deletion`.' + '401': content: application/json: example: error: - code: 503 - message: 'Service temporarily unavailable' + code: 401 + message: 'No auth credentials found.' schema: - $ref: '#/components/schemas/ServiceUnavailableResponse' - description: 'Service Unavailable - Service temporarily unavailable' - summary: 'Promote a container file into workspace documents' - tags: - - 'Containers' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /credits: - get: - description: 'Get total credits purchased and used for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'getCredits' - responses: - '200': + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Missing or invalid API key.' + '404': content: application/json: example: - data: - total_credits: 100.5 - total_usage: 25.75 + error: + code: 404 + message: 'Batch not found.' schema: - description: 'Total credits purchased and used' - example: - data: - total_credits: 100.5 - total_usage: 25.75 - properties: - data: - example: - total_credits: 100.5 - total_usage: 25.75 - properties: - total_credits: - description: 'Total credits purchased' - example: 100.5 - format: 'double' - type: 'number' - total_usage: - description: 'Total credits used' - example: 25.75 - format: 'double' - type: 'number' - required: - - 'total_credits' - - 'total_usage' - type: 'object' - required: - - 'data' - type: 'object' - description: 'Returns the total credits purchased and used' - '401': + $ref: '#/components/schemas/BatchErrorResponse' + description: 'No batch exists for the given id.' + '409': content: application/json: example: error: - code: 401 - message: 'Missing Authentication header' + code: 409 + message: 'Only completed, failed, expired, or cancelled batches can be deleted. Wait for the batch to finish and try again.' schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '403': + $ref: '#/components/schemas/BatchErrorResponse' + description: 'The batch is still processing, its required provider key is unavailable, or its state changed during deletion.' + '429': content: application/json: example: error: - code: 403 - message: 'Only management keys can perform this operation' + code: 429 + message: 'Rate limit exceeded.' schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Batch API rate limit exceeded for the billable entity.' '500': content: application/json: example: error: code: 500 - message: 'Internal Server Error' + message: 'Internal server error.' schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - summary: 'Get remaining credits' - tags: - - 'Credits' - x-speakeasy-name-override: 'getCredits' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /credits/coinbase: - post: - deprecated: true - description: 'Deprecated. The Coinbase APIs used by this endpoint have been deprecated, so Coinbase Commerce charges have been removed. Use the web credits purchase flow instead.' - operationId: 'createCoinbaseCharge' - responses: - '200': - description: 'This endpoint is deprecated and will never return a 200 response.' - '410': + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Unexpected error in the ingress or upstream batch-api.' + '502': content: application/json: example: error: - code: 410 - message: 'The Coinbase APIs used by this endpoint have been deprecated, so the Coinbase Commerce credits API has been removed. Use the web credits purchase flow instead.' + code: 502 + message: 'Upstream batch-api is unavailable.' schema: - $ref: '#/components/schemas/GoneResponse' - description: 'Gone - Endpoint has been permanently removed or deprecated' - security: [] - summary: 'Deprecated Coinbase Commerce charge endpoint' + $ref: '#/components/schemas/BatchErrorResponse' + description: 'The batch service is unavailable, or an upstream provider operation failed, including batch or file cleanup.' + summary: 'Delete a batch' tags: - - 'Credits' - x-fern-ignore: true - x-speakeasy-ignore: true - x-speakeasy-name-override: 'createCoinbaseCharge' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /datasets/app-rankings: + - 'Batch' + x-speakeasy-name-override: 'delete' get: - description: "Returns the top public apps on OpenRouter ranked by token usage inside the requested\ndate window, matching the public apps marketplace on openrouter.ai/apps. Token totals\nare `prompt_tokens + completion_tokens`; hidden and private apps are excluded and\ntraffic from related app aliases is merged into the canonical visible app.\n\n`sort=popular` (default) ranks by total token volume inside the window.\n`sort=trending` ranks by absolute excess token growth: window volume minus the average\nvolume of the three equal-length periods immediately preceding the window. Apps with\nno excess growth are omitted, so `trending` may return fewer than `limit` rows.\n\nFilter with `category` (marketplace category group, e.g. `coding`) or `subcategory`\n(e.g. `cli-agent`). Ranks are re-numbered 1..N after filtering. Page with `offset` —\n`rank` stays absolute, so the first row of `offset=50` is `rank: 51`.\n\nAuthenticate with any valid OpenRouter API key (same key used for inference).\nRate-limited to 30 requests/minute per key and 500 requests/day per account.\n\nWhen republishing or quoting this dataset, OpenRouter must be cited as:\n\"Source: OpenRouter (openrouter.ai/apps), as of {as_of}.\"\n\nToken counts come from each upstream provider's own tokenizer, so a token attributed\nto one app is not directly comparable to a token attributed to another app whose\ntraffic flows through a different provider.\n\nLicensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/): reuse and republish with attribution to OpenRouter." - operationId: 'getAppRankings' + description: 'Returns a batch with its status and request counts. Batches in a terminal status include `results`. Failed batches report the reason in `error.message`. See the [Batch API Quickstart](https://openrouter.ai/docs/batch-quickstart).' + operationId: 'getBatches' parameters: - - description: 'Marketplace category group to filter by (e.g. `coding`). Only apps tagged with a subcategory inside this group are returned. Mutually combinable with `subcategory` — when both are supplied the `subcategory` must belong to the `category` group.' - in: 'query' - name: 'category' - required: false - schema: - description: 'Marketplace category group to filter by (e.g. `coding`). Only apps tagged with a subcategory inside this group are returned. Mutually combinable with `subcategory` — when both are supplied the `subcategory` must belong to the `category` group.' - enum: - - 'coding' - - 'creative' - - 'productivity' - - 'entertainment' - example: 'coding' - type: 'string' - x-speakeasy-unknown-values: allow - - description: 'Marketplace subcategory to filter by (e.g. `cli-agent`). Takes precedence over `category` for the actual filter; when `category` is also supplied the pair must be consistent.' - in: 'query' - name: 'subcategory' - required: false - schema: - description: 'Marketplace subcategory to filter by (e.g. `cli-agent`). Takes precedence over `category` for the actual filter; when `category` is also supplied the pair must be consistent.' - enum: - - 'cli-agent' - - 'ide-extension' - - 'cloud-agent' - - 'programming-app' - - 'native-app-builder' - - 'creative-writing' - - 'video-gen' - - 'image-gen' - - 'audio-gen' - - 'roleplay' - - 'game' - - 'writing-assistant' - - 'general-chat' - - 'personal-agent' - - 'legal' - example: 'cli-agent' - type: 'string' - x-speakeasy-unknown-values: allow - - description: '`popular` ranks apps by total token volume inside the date window. `trending` ranks apps by absolute excess token growth: window volume minus the average volume of the three equal-length periods immediately preceding the window. Apps with no excess growth are omitted from `trending` results.' - in: 'query' - name: 'sort' - required: false - schema: - default: 'popular' - description: '`popular` ranks apps by total token volume inside the date window. `trending` ranks apps by absolute excess token growth: window volume minus the average volume of the three equal-length periods immediately preceding the window. Apps with no excess growth are omitted from `trending` results.' - enum: - - 'popular' - - 'trending' - example: 'popular' - type: 'string' - x-speakeasy-unknown-values: allow - - description: 'Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`.' - in: 'query' - name: 'start_date' - required: false - schema: - description: 'Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`.' - example: '2026-04-12' - pattern: '^\d{4}-\d{2}-\d{2}$' - type: 'string' - - description: 'End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400.' - in: 'query' - name: 'end_date' - required: false + - description: 'The batch job id returned from submit.' + in: 'path' + name: 'id' + required: true schema: - description: 'End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400.' - example: '2026-05-11' - pattern: '^\d{4}-\d{2}-\d{2}$' + description: 'The batch job id returned from submit.' + example: 'batch_abc123' + minLength: 1 type: 'string' - - description: 'Maximum number of apps to return (1-100). Defaults to 50.' - in: 'query' - name: 'limit' - required: false - schema: - default: 50 - description: 'Maximum number of apps to return (1-100). Defaults to 50.' - example: 50 - maximum: 100 - minimum: 1 - type: 'integer' - - description: 'Number of ranked apps to skip before the first returned row (0-100). Defaults to 0. `rank` stays absolute, so the first row of `offset=50` is `rank: 51`.' - in: 'query' - name: 'offset' - required: false - schema: - default: 0 - description: 'Number of ranked apps to skip before the first returned row (0-100). Defaults to 0. `rank` stays absolute, so the first row of `offset=50` is `rank: 51`.' - example: 0 - maximum: 100 - minimum: 0 - type: - - 'integer' - - 'null' responses: '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BatchObject' + description: 'The current batch job status.' + '401': content: application/json: example: - data: - - app_id: 12345 - app_name: 'Cline' - rank: 1 - total_requests: 4321 - total_tokens: '12345678' - - app_id: 67890 - app_name: 'Roo Code' - rank: 2 - total_requests: 2109 - total_tokens: '9876543' - meta: - as_of: '2026-05-12T02:00:00Z' - end_date: '2026-05-11' - start_date: '2026-04-12' - version: 'v1' + error: + code: 401 + message: 'No auth credentials found.' schema: - $ref: '#/components/schemas/AppRankingsResponse' - description: 'Apps ranked per the requested `sort`, re-numbered 1..N. `popular` sorts by `total_tokens` descending; `trending` sorts by absolute excess token growth descending and may return fewer than `limit` rows.' - '400': + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Missing or invalid API key.' + '402': + content: + application/json: + schema: + $ref: '#/components/schemas/BatchPaymentRequiredResponse' + description: 'The finalized batch cost exceeds the available balance; metadata is returned with `results: null`. Top up credits and poll again to receive the persisted results.' + '404': content: application/json: example: error: - code: 400 - message: 'Invalid request parameters' + code: 404 + message: 'Batch not found.' schema: - $ref: '#/components/schemas/BadRequestResponse' - description: 'Bad Request - Invalid request parameters or malformed input' - '401': + $ref: '#/components/schemas/BatchErrorResponse' + description: 'No batch exists for the given id.' + '410': content: application/json: example: error: - code: 401 - message: 'Missing Authentication header' + code: 410 + message: 'Batch results have expired. OpenRouter deletes batch results 30 days after the batch is created.' schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' + $ref: '#/components/schemas/BatchErrorResponse' + description: 'The batch results were deleted after the 30-day retention window.' '429': content: application/json: example: error: code: 429 - message: 'Rate limit exceeded' + message: 'Rate limit exceeded.' schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: 'Too Many Requests - Rate limit exceeded' + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Batch API rate limit exceeded for the billable entity.' '500': content: application/json: example: error: code: 500 - message: 'Internal Server Error' + message: 'Internal server error.' schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - summary: 'Top apps by token usage' + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Unexpected error in the ingress or upstream batch-api.' + '502': + content: + application/json: + example: + error: + code: 502 + message: 'Upstream batch-api is unavailable.' + schema: + $ref: '#/components/schemas/BatchErrorResponse' + description: 'The batch service is unavailable, or an upstream provider operation failed, including batch or file cleanup.' + summary: 'Get a batch' tags: - - 'Datasets' - x-speakeasy-pagination: - inputs: - - in: 'parameters' - name: 'offset' - type: 'offset' - - in: 'parameters' - name: 'limit' - type: 'limit' - outputs: - results: '$.data' - type: 'offsetLimit' + - 'Batch' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /datasets/rankings-daily: + /benchmarks: get: - description: "Returns the top 50 public models per day by total token usage on OpenRouter, plus a\nsingle aggregated `other` row per day that sums every model outside that top 50.\nToken totals are `prompt_tokens + completion_tokens`, matching the public rankings\nchart on openrouter.ai/rankings.\n\nEach row is a distinct `(date, model_permaslug)` pair. The `other` row uses the\nreserved permaslug `other` and is always returned last within its date, so callers\ncan compute `top-50 traffic / total daily traffic` without a second request.\n\nOptional filters slice the dataset. `period` (`day`/`week`/`month`) sets the time\ngrain. `modality` and `context_bucket` narrow the exact dataset by output/input\nmodality (or tool-calling activity) and request context length. `category` and\n`language_type` instead read a sampled, upsampled dataset whose `total_tokens` are\nweekly-grain estimates — they cannot be combined with each other or with the exact\nfilters, and reject `period=day` with a 400.\n\nAuthenticate with any valid OpenRouter API key (same key used for inference).\nRate-limited to 30 requests/minute per key and 500 requests/day per account.\n\nWhen republishing or quoting this dataset, OpenRouter must be cited as:\n\"Source: OpenRouter (openrouter.ai/rankings), as of {as_of}.\"\n\nToken counts come from each upstream provider's own tokenizer (Anthropic counts\nare as reported by Anthropic, OpenAI counts are as reported by OpenAI, etc.), so\na token in one row is not directly comparable to a token in another row from a\ndifferent provider.\n\nLicensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/): reuse and republish with attribution to OpenRouter." - operationId: 'getRankingsDaily' + description: 'Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena, and OpenRouter''s own tau-bench, GPQA, and web-search evals). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Use task_type=search (or a search_* benchmark_type) for OpenRouter''s search benchmarks, which publish each model''s highest-scoring eligible evaluation configuration with same-configuration runs combined by task-weighted mean. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.' + operationId: 'getBenchmarks' parameters: - - description: 'Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`.' + - description: 'Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources.' in: 'query' - name: 'start_date' + name: 'source' required: false schema: - description: 'Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`.' - example: '2026-04-12' - pattern: '^\d{4}-\d{2}-\d{2}$' + description: 'Benchmark source to query. Determines the shape of the returned items. When omitted, returns results from all sources.' + enum: + - 'artificial-analysis' + - 'design-arena' + - 'openrouter' + example: 'artificial-analysis' type: 'string' - - description: 'End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400.' + x-speakeasy-unknown-values: allow + - description: 'Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. `search` returns OpenRouter search benchmark results only.' in: 'query' - name: 'end_date' + name: 'task_type' required: false schema: - description: 'End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400.' - example: '2026-05-11' - pattern: '^\d{4}-\d{2}-\d{2}$' + description: 'Filter results by task type. For Artificial Analysis, maps to the corresponding index. For Design Arena, maps to the matching category. `search` returns OpenRouter search benchmark results only.' + enum: + - 'coding' + - 'intelligence' + - 'agentic' + - 'search' + example: 'coding' type: 'string' - - description: 'Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries.' + x-speakeasy-unknown-values: allow + - description: 'Return results for one exact OpenRouter benchmark. A `search_*` value narrows the response to search results only; a classic value narrows the OpenRouter items and leaves other sources'' items as they are.' in: 'query' - name: 'period' + name: 'benchmark_type' required: false schema: - description: 'Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries.' + description: 'Return results for one exact OpenRouter benchmark. A `search_*` value narrows the response to search results only; a classic value narrows the OpenRouter items and leaves other sources'' items as they are.' enum: - - 'day' - - 'week' - - 'month' - example: 'day' + - 'gpqa_diamond' + - 'tau_bench_verified_airline' + - 'search_browsecomp' + - 'search_hle' + - 'search_dsqa' + - 'search_widesearch' + example: 'search_widesearch' type: 'string' x-speakeasy-unknown-values: allow - - description: 'Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`.' + - description: 'Search benchmarks only: include the published lane configuration whitelist in each search item. Defaults to false. The whitelist is limited to agent turn count, reasoning effort, and temperature so future harness configuration changes do not change the public contract.' in: 'query' - name: 'modality' + name: 'include_run_config' required: false schema: - description: 'Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`.' - enum: - - 'text' - - 'image' - - 'image_output' - - 'audio' - - 'tool_calling' - example: 'text' + default: false + description: 'Search benchmarks only: include the published lane configuration whitelist in each search item. Defaults to false. The whitelist is limited to agent turn count, reasoning effort, and temperature so future harness configuration changes do not change the public contract.' + example: true + type: 'boolean' + - description: 'OpenRouter search benchmarks only: filter by the search engine used.' + in: 'query' + name: 'search_engine' + required: false + schema: + description: 'OpenRouter search benchmarks only: filter by the search engine used.' + example: 'exa' type: 'string' - x-speakeasy-unknown-values: allow - - description: 'Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`.' + - description: 'OpenRouter search benchmarks only: filter by the request surface the lane ran on.' in: 'query' - name: 'context_bucket' + name: 'search_surface' required: false schema: - description: 'Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`.' + description: 'OpenRouter search benchmarks only: filter by the request surface the lane ran on.' enum: - - '1K' - - '10K' - - '100K' - - '1M' - - '10M' - example: '100K' + - 'server-tool' + - 'plugin' + example: 'server-tool' type: 'string' x-speakeasy-unknown-values: allow - - description: 'Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`.' + - description: 'Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.' in: 'query' - name: 'category' + name: 'arena' required: false schema: - description: 'Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`.' + description: 'Design Arena only: arena to query. Defaults to `models` when source is `design-arena`.' enum: - - 'programming' - - 'roleplay' - - 'marketing' - - 'marketing/seo' - - 'technology' - - 'science' - - 'translation' - - 'legal' - - 'finance' - - 'health' - - 'trivia' - - 'academia' - example: 'programming' + - 'models' + - 'builders' + - 'agents' + example: 'models' type: 'string' x-speakeasy-unknown-values: allow - - description: 'Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`.' + - description: 'Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories.' in: 'query' - name: 'language_type' + name: 'category' required: false schema: - description: 'Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`.' - enum: - - 'natural' - - 'programming' - example: 'natural' + description: 'Design Arena only: category within the arena (e.g. `codecategories`, `uicomponent`, `gamedev`, `3d`, `dataviz`, `image`, `video`, `svg`). When omitted, returns all categories.' + example: 'codecategories' type: 'string' - x-speakeasy-unknown-values: allow + - description: 'Maximum number of items to return. When omitted, all matching results are returned.' + in: 'query' + name: 'max_results' + required: false + schema: + description: 'Maximum number of items to return. When omitted, all matching results are returned.' + example: 50 + minimum: 1 + type: 'integer' responses: '200': content: application/json: example: data: - - date: '2026-05-11' - model_permaslug: 'openai/gpt-4o-2024-05-13' - total_tokens: '12345678' - - date: '2026-05-11' - model_permaslug: 'anthropic/claude-3.5-sonnet-20241022' - total_tokens: '9876543' - - date: '2026-05-11' - model_permaslug: 'other' - total_tokens: '4321098' + - agentic_index: 58.3 + coding_index: 65.8 + display_name: 'GPT-4o' + intelligence_index: 71.2 + model_permaslug: 'openai/gpt-4o' + pricing: + completion: '0.00001' + prompt: '0.0000025' + source: 'artificial-analysis' + - accuracy: 0.72 + accuracy_stddev: 0.03 + avg_cost_per_task: 0.002 + benchmark_type: 'gpqa_diamond' + display_name: 'GPT-4o' + last_run_timestamp: '2026-06-03T12:00:00Z' + model_permaslug: 'openai/gpt-4o' + source: 'openrouter' + total_tasks: 300 meta: - as_of: '2026-05-12T02:00:00Z' - end_date: '2026-05-11' - start_date: '2026-04-12' + as_of: '2026-06-03T12:00:00Z' + citation: null + model_count: 1 + source: null + source_url: null + task_type: null version: 'v1' schema: - $ref: '#/components/schemas/RankingsDailyResponse' - description: 'Up to 51 rows per day — the top 50 public models by `total_tokens` plus a single aggregated `other` row covering every model outside that top 50. Sorted by `date` ascending, then by `total_tokens` descending, with `other` pinned last within its date.' + $ref: '#/components/schemas/UnifiedBenchmarksResponse' + description: 'Benchmark results filtered by the specified source and optional task type.' '400': content: application/json: @@ -38870,91 +35893,203 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Daily token totals for top 50 models' + summary: 'List Benchmarks' tags: - - 'Datasets' + - 'Benchmarks' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /datasets/session-cost: + /byok: get: - description: "Returns weekly refreshed, aggregated cost-per-session cells for the published harnesses.\nSessions are never pooled across apps. Medians are of per-session USD spend, and\nprivacy-preserving aggregation never exposes clerk_user_id values or per-session rows.\n\nFilter by `app_slug`, `model`, or `turn_range`. Filtering by `model` alone works across apps\nfor harness-vs-harness comparison at a fixed model. Results refresh weekly and include the source snapshot\nwindow in `meta`.\n\nLicensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/): reuse and republish with attribution to OpenRouter." - operationId: 'getSessionCost' + description: 'List the bring-your-own-key (BYOK) provider credentials for the authenticated entity''s default workspace. Use the `workspace_id` query parameter to scope the result to a different workspace, or the `provider` query parameter to filter by upstream provider. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'listBYOKKeys' parameters: - - description: 'Filter to one published harness slug.' + - description: 'Number of records to skip for pagination' + in: 'query' + name: 'offset' + required: false + schema: + default: 0 + description: 'Number of records to skip for pagination' + example: 0 + minimum: 0 + type: + - 'integer' + - 'null' + - description: 'Maximum number of records to return (max 100)' in: 'query' - name: 'app_slug' + name: 'limit' required: false schema: - description: 'Filter to one published harness slug.' - example: 'hermes-agent' - type: 'string' - - description: 'Exact model permaslug filter. Works across all harness apps.' + default: 50 + description: 'Maximum number of records to return (max 100)' + example: 50 + maximum: 100 + minimum: 1 + type: 'integer' + - description: 'Optional workspace ID to filter by. When omitted, resolves to the account’s default workspace; if that default has been deleted, the request returns a 400 and you must pass `workspace_id` explicitly.' in: 'query' - name: 'model' + name: 'workspace_id' required: false schema: - description: 'Exact model permaslug filter. Works across all harness apps.' - example: 'anthropic/claude-4.8-opus' + description: 'Optional workspace ID to filter by. When omitted, resolves to the account’s default workspace; if that default has been deleted, the request returns a 400 and you must pass `workspace_id` explicitly.' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' type: 'string' - - description: 'Filter by the inclusive number of turns in a session.' + - description: 'Optional provider slug to filter by (e.g. `openai`, `anthropic`, `amazon-bedrock`).' in: 'query' - name: 'turn_range' + name: 'provider' required: false schema: - description: 'Filter by the inclusive number of turns in a session.' + description: 'Optional provider slug to filter by (e.g. `openai`, `anthropic`, `amazon-bedrock`).' enum: - - '1-turn' - - '2-9-turns' - - '10-49-turns' - - '50-plus-turns' - example: '10-49-turns' + - 'ai21' + - 'aion-labs' + - 'akashml' + - 'alibaba' + - 'amazon-bedrock' + - 'amazon-bedrock/claude-on-aws' + - 'amazon-nova' + - 'ambient' + - 'anthropic' + - 'anthropic/2' + - 'arcee-ai' + - 'assemblyai' + - 'atlas-cloud' + - 'avian' + - 'azure' + - 'baidu' + - 'baseten' + - 'black-forest-labs' + - 'byteplus' + - 'cerebras' + - 'chutes' + - 'cirrascale' + - 'clarifai' + - 'claude-on-aws' + - 'cloudflare' + - 'cohere' + - 'coreweave' + - 'cosine' + - 'crusoe' + - 'darkbloom' + - 'databricks' + - 'decart' + - 'deepgram' + - 'deepinfra' + - 'deepseek' + - 'dekallm' + - 'digitalocean' + - 'elevenlabs' + - 'featherless' + - 'fireworks' + - 'fish-audio' + - 'friendli' + - 'gmicloud' + - 'google-ai-studio' + - 'google-vertex' + - 'groq' + - 'heygen' + - 'inception' + - 'inceptron' + - 'inferact-vllm' + - 'inference-net' + - 'infermatic' + - 'inflection' + - 'io-net' + - 'ionstream' + - 'krea' + - 'liquid' + - 'makora' + - 'mancer' + - 'mara' + - 'meta' + - 'minimax' + - 'mistral' + - 'modal' + - 'modelrun' + - 'modular' + - 'moonshotai' + - 'morph' + - 'near-ai' + - 'nebius' + - 'nex-agi' + - 'nextbit' + - 'novita' + - 'nvidia' + - 'ollama' + - 'open-inference' + - 'openai' + - 'parasail' + - 'pareto-alpha' + - 'perceptron' + - 'perplexity' + - 'phala' + - 'poolside' + - 'primeintellect' + - 'quiver' + - 'recraft' + - 'recursive' + - 'reka' + - 'relace' + - 'respan' + - 'runway' + - 'sail-research' + - 'sakana' + - 'sakana-ai' + - 'sambanova' + - 'scaledown' + - 'seed' + - 'siliconflow' + - 'sourceful' + - 'stepfun' + - 'streamlake' + - 'switchpoint' + - 'tencent' + - 'tenstorrent' + - 'thinkingmachines' + - 'together' + - 'typesafe' + - 'unbiased' + - 'upstage' + - 'venice' + - 'voyageai' + - 'wafer' + - 'wandb' + - 'wandb-legacy' + - 'xai' + - 'xiaomi' + - 'z-ai' + example: 'openai' type: 'string' x-speakeasy-unknown-values: allow - - description: 'Maximum number of cells to return (1-500). Defaults to 100.' - in: 'query' - name: 'limit' - required: false - schema: - default: 100 - description: 'Maximum number of cells to return (1-500). Defaults to 100.' - example: 100 - maximum: 500 - minimum: 1 - type: 'integer' - - description: 'Number of sorted cells to skip (0-5000). Defaults to 0.' - in: 'query' - name: 'offset' - required: false - schema: - default: 0 - description: 'Number of sorted cells to skip (0-5000). Defaults to 0.' - example: 0 - maximum: 5000 - minimum: 0 - type: - - 'integer' - - 'null' responses: '200': content: application/json: example: data: - - app_name: 'Hermes Agent' - app_slug: 'hermes-agent' - median_session_cost_usd: 1.74 - model_permaslug: 'anthropic/claude-4.8-opus' - turn_range: '10-49-turns' - meta: - as_of: '2026-05-12T02:00:00.000Z' - version: 'v1' - window_days: 30 - window_end_date: '2026-05-11' + - allowed_api_key_hashes: null + allowed_models: null + allowed_user_ids: null + created_at: '2025-08-24T10:30:00Z' + declared_region: null + declared_zdr: null + disabled: false + id: '11111111-2222-3333-4444-555555555555' + is_byok_only: false + is_fallback: false + is_required: false + label: 'sk-...AbCd' + name: 'Production OpenAI Key' + provider: 'openai' + sort_order: 0 + workspace_id: '550e8400-e29b-41d4-a716-446655440000' + total_count: 1 schema: - $ref: '#/components/schemas/SessionCostResponse' - description: 'Aggregated cost-per-session cells for the requested filters.' + $ref: '#/components/schemas/ListBYOKKeysResponse' + description: 'List of BYOK credentials' '400': content: application/json: @@ -38975,16 +36110,16 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: 'Unauthorized - Authentication required or invalid credentials' - '429': + '403': content: application/json: example: error: - code: 429 - message: 'Rate limit exceeded' + code: 403 + message: 'Only management keys can perform this operation' schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: 'Too Many Requests - Rate limit exceeded' + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' '500': content: application/json: @@ -38995,9 +36130,10 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Cost per session by harness and model' + summary: 'List BYOK provider credentials' tags: - - 'Datasets' + - 'BYOK' + x-speakeasy-name-override: 'list' x-speakeasy-pagination: inputs: - in: 'parameters' @@ -39009,261 +36145,44 @@ paths: outputs: results: '$.data' type: 'offsetLimit' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /embeddings: post: - description: 'Submits an embedding request to the embeddings router' - operationId: 'createEmbeddings' + description: 'Create a new bring-your-own-key (BYOK) provider credential. The raw key is encrypted at rest and never returned in API responses. When `workspace_id` is omitted, the credential is created in the default workspace; if that default has been deleted, the request returns a 400 and you must pass `workspace_id` explicitly. Treat the raw key as write-only; it is never returned after creation. Use `allowed_api_key_hashes` to restrict the credential to specific OpenRouter API keys. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'createBYOKKey' requestBody: content: application/json: + example: + key: 'sk-proj-abc123...' + name: 'Production OpenAI Key' + provider: 'openai' schema: - description: 'Embeddings request input' - example: - dimensions: 1536 - input: 'The quick brown fox jumps over the lazy dog' - model: 'openai/text-embedding-3-small' - properties: - dimensions: - description: 'The number of dimensions for the output embeddings' - example: 1536 - minimum: 1 - type: 'integer' - encoding_format: - description: 'The format of the output embeddings' - enum: - - 'float' - - 'base64' - example: 'float' - type: 'string' - x-speakeasy-unknown-values: allow - input: - anyOf: - - minLength: 1 - type: 'string' - - items: - minLength: 1 - type: 'string' - type: 'array' - - items: - type: 'number' - type: 'array' - - items: - items: - type: 'number' - type: 'array' - type: 'array' - - items: - properties: - content: - items: - oneOf: - - properties: - text: - minLength: 1 - type: 'string' - type: - enum: - - 'text' - type: 'string' - required: - - 'type' - - 'text' - type: 'object' - - properties: - image_url: - properties: - url: - type: 'string' - required: - - 'url' - type: 'object' - type: - enum: - - 'image_url' - type: 'string' - required: - - 'type' - - 'image_url' - type: 'object' - - $ref: '#/components/schemas/ContentPartInputAudio' - - $ref: '#/components/schemas/ContentPartInputVideo' - - $ref: '#/components/schemas/ContentPartInputFile' - minItems: 1 - type: 'array' - required: - - 'content' - type: 'object' - type: 'array' - description: 'Text, token, or multimodal input(s) to embed' - example: 'The quick brown fox jumps over the lazy dog' - input_type: - description: 'The type of input (e.g. search_query, search_document)' - example: 'search_query' - type: 'string' - model: - description: 'The model to use for embeddings' - example: 'openai/text-embedding-3-small' - type: 'string' - provider: - allOf: - - $ref: '#/components/schemas/ProviderPreferences' - - description: 'Provider routing preferences for the request.' - session_id: - description: 'A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.' - example: 'session-1234' - maxLength: 256 - type: 'string' - trace: - $ref: '#/components/schemas/TraceConfig' - user: - description: 'A unique identifier for the end-user' - example: 'user-1234' - type: 'string' - required: - - 'input' - - 'model' - type: 'object' + $ref: '#/components/schemas/CreateBYOKKeyRequest' required: true responses: - '200': + '201': content: application/json: + example: + data: + allowed_api_key_hashes: null + allowed_models: null + allowed_user_ids: null + created_at: '2025-08-24T10:30:00Z' + declared_region: null + declared_zdr: null + disabled: false + id: '11111111-2222-3333-4444-555555555555' + is_byok_only: false + is_fallback: false + is_required: false + label: 'sk-...AbCd' + name: 'Production OpenAI Key' + provider: 'openai' + sort_order: 0 + workspace_id: '550e8400-e29b-41d4-a716-446655440000' schema: - description: 'Embeddings response containing embedding vectors' - example: - data: - - embedding: - - 0.0023064255 - - -0.009327292 - - 0.015797347 - index: 0 - object: 'embedding' - model: 'openai/text-embedding-3-small' - object: 'list' - usage: - prompt_tokens: 8 - total_tokens: 8 - properties: - data: - description: 'List of embedding objects' - example: - - embedding: - - 0.0023064255 - - -0.009327292 - - 0.015797347 - index: 0 - object: 'embedding' - items: - description: 'A single embedding object' - example: - embedding: - - 0.0023064255 - - -0.009327292 - - 0.015797347 - index: 0 - object: 'embedding' - properties: - embedding: - anyOf: - - items: - type: 'number' - type: 'array' - - type: 'string' - description: 'Embedding vector as an array of floats or a base64 string' - example: - - 0.0023064255 - - -0.009327292 - - 0.015797347 - index: - description: 'Index of the embedding in the input list' - example: 0 - type: 'integer' - object: - enum: - - 'embedding' - type: 'string' - required: - - 'object' - - 'embedding' - type: 'object' - type: 'array' - id: - description: 'Unique identifier for the embeddings response' - example: 'embd-1234567890' - type: 'string' - model: - description: 'The model used for embeddings' - example: 'openai/text-embedding-3-small' - type: 'string' - object: - enum: - - 'list' - type: 'string' - usage: - description: 'Token usage statistics' - example: - prompt_tokens: 8 - total_tokens: 8 - properties: - cost: - description: 'Cost of the request in credits' - example: 0.0001 - format: 'double' - type: 'number' - cost_details: - $ref: '#/components/schemas/CostDetails' - is_byok: - description: 'Whether a request was made using a Bring Your Own Key configuration' - type: 'boolean' - prompt_tokens: - description: 'Number of tokens in the input' - example: 8 - type: 'integer' - prompt_tokens_details: - description: 'Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included.' - properties: - audio_tokens: - description: 'Number of audio tokens in the input' - type: 'integer' - file_tokens: - description: 'Number of file/document tokens in the input' - type: 'integer' - image_tokens: - description: 'Number of image tokens in the input' - example: 258 - type: 'integer' - text_tokens: - description: 'Number of text tokens in the input' - example: 8 - type: 'integer' - video_tokens: - description: 'Number of video tokens in the input' - type: 'integer' - type: 'object' - total_tokens: - description: 'Total number of tokens used' - example: 8 - type: 'integer' - required: - - 'prompt_tokens' - - 'total_tokens' - type: 'object' - required: - - 'object' - - 'data' - - 'model' - type: 'object' - text/event-stream: - example: 'data: [DONE]' - schema: - description: 'Not used for embeddings - embeddings do not support streaming' - type: 'string' - x-speakeasy-sse-sentinel: '[DONE]' - description: 'Embedding response' + $ref: '#/components/schemas/CreateBYOKKeyResponse' + description: 'BYOK credential created successfully' '400': content: application/json: @@ -39282,18 +36201,8 @@ paths: code: 401 message: 'Missing Authentication header' schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '402': - content: - application/json: - example: - error: - code: 402 - message: 'Insufficient credits. Add more using https://openrouter.ai/credits' - schema: - $ref: '#/components/schemas/PaymentRequiredResponse' - description: 'Payment Required - Insufficient credits or quota to complete request' + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' '403': content: application/json: @@ -39304,56 +36213,77 @@ paths: schema: $ref: '#/components/schemas/ForbiddenResponse' description: 'Forbidden - Authentication successful but insufficient permissions' - '404': + '500': content: application/json: example: error: - code: 404 - message: 'Resource not found' + code: 500 + message: 'Internal Server Error' schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' - '408': + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Create a BYOK provider credential' + tags: + - 'BYOK' + x-speakeasy-name-override: 'create' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /byok/{id}: + delete: + description: 'Delete (soft-delete) a bring-your-own-key (BYOK) provider credential by its `id`. The encrypted key material is wiped and the record is marked as deleted. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'deleteBYOKKey' + parameters: + - description: 'The BYOK credential ID (UUID).' + in: 'path' + name: 'id' + required: true + schema: + description: 'The BYOK credential ID (UUID).' + example: '11111111-2222-3333-4444-555555555555' + format: 'uuid' + type: 'string' + responses: + '200': content: application/json: example: - error: - code: 408 - message: 'Operation timed out. Please try again later.' + deleted: true schema: - $ref: '#/components/schemas/RequestTimeoutResponse' - description: 'Request Timeout - Operation exceeded time limit' - '413': + $ref: '#/components/schemas/DeleteBYOKKeyResponse' + description: 'BYOK credential deleted successfully' + '401': content: application/json: example: error: - code: 413 - message: 'Request payload too large' + code: 401 + message: 'Missing Authentication header' schema: - $ref: '#/components/schemas/PayloadTooLargeResponse' - description: 'Payload Too Large - Request payload exceeds size limits' - '429': + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': content: application/json: example: error: - code: 429 - message: 'Rate limit exceeded' + code: 403 + message: 'Only management keys can perform this operation' schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: 'Too Many Requests - Rate limit exceeded' - '499': + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': content: application/json: example: error: - code: 499 - message: 'The request was cancelled.' + code: 404 + message: 'Resource not found' schema: - $ref: '#/components/schemas/ClientClosedRequestResponse' - description: 'Client Closed Request - The caller cancelled the request' + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' '500': content: application/json: @@ -39364,132 +36294,139 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - '502': + summary: 'Delete a BYOK provider credential' + tags: + - 'BYOK' + x-speakeasy-name-override: 'delete' + get: + description: 'Get a single bring-your-own-key (BYOK) provider credential by its `id`. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'getBYOKKey' + parameters: + - description: 'The BYOK credential ID (UUID).' + in: 'path' + name: 'id' + required: true + schema: + description: 'The BYOK credential ID (UUID).' + example: '11111111-2222-3333-4444-555555555555' + format: 'uuid' + type: 'string' + responses: + '200': content: application/json: example: - error: - code: 502 - message: 'Provider returned error' + data: + allowed_api_key_hashes: null + allowed_models: null + allowed_user_ids: null + created_at: '2025-08-24T10:30:00Z' + declared_region: null + declared_zdr: null + disabled: false + id: '11111111-2222-3333-4444-555555555555' + is_byok_only: false + is_fallback: false + is_required: false + label: 'sk-...AbCd' + name: 'Production OpenAI Key' + provider: 'openai' + sort_order: 0 + workspace_id: '550e8400-e29b-41d4-a716-446655440000' schema: - $ref: '#/components/schemas/BadGatewayResponse' - description: 'Bad Gateway - Provider/upstream API failure' - '503': + $ref: '#/components/schemas/GetBYOKKeyResponse' + description: 'BYOK credential details' + '401': content: application/json: example: error: - code: 503 - message: 'Service temporarily unavailable' + code: 401 + message: 'Missing Authentication header' schema: - $ref: '#/components/schemas/ServiceUnavailableResponse' - description: 'Service Unavailable - Service temporarily unavailable' - '504': + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': content: application/json: example: error: - code: 504 - message: 'The operation was aborted due to timeout' + code: 403 + message: 'Only management keys can perform this operation' schema: - $ref: '#/components/schemas/GatewayTimeoutResponse' - description: 'Gateway Timeout - Provider did not respond before the upstream deadline' - '524': + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': content: application/json: example: error: - code: 524 - message: 'Request timed out. Please try again later.' + code: 404 + message: 'Resource not found' schema: - $ref: '#/components/schemas/EdgeNetworkTimeoutResponse' - description: 'Infrastructure Timeout - Provider request timed out at edge network' - '529': + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '500': content: application/json: example: error: - code: 529 - message: 'Provider returned error' + code: 500 + message: 'Internal Server Error' schema: - $ref: '#/components/schemas/ProviderOverloadedResponse' - description: 'Provider Overloaded - Provider is temporarily overloaded' - summary: 'Submit an embedding request' + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Get a BYOK provider credential' tags: - - 'Embeddings' - x-speakeasy-name-override: 'generate' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /embeddings/models: - get: - description: 'Returns a list of all available embeddings models and their properties' - operationId: 'listEmbeddingsModels' + - 'BYOK' + x-speakeasy-name-override: 'get' + patch: + description: 'Update an existing bring-your-own-key (BYOK) provider credential by its `id`. Include the `key` field to rotate the raw provider API key in-place (the previous key material is overwritten). Use `allowed_api_key_hashes` to restrict the credential to specific OpenRouter API keys (`null` clears the restriction). [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'updateBYOKKey' parameters: - - description: 'Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned' - in: 'query' - name: 'offset' - required: false - schema: - default: 0 - description: 'Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned' - example: 0 - minimum: 0 - type: - - 'integer' - - 'null' - - description: 'Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned' - in: 'query' - name: 'limit' - required: false + - description: 'The BYOK credential ID (UUID).' + in: 'path' + name: 'id' + required: true schema: - default: 500 - description: 'Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned' - example: 500 - maximum: 1000 - minimum: 1 - type: 'integer' + description: 'The BYOK credential ID (UUID).' + example: '11111111-2222-3333-4444-555555555555' + format: 'uuid' + type: 'string' + requestBody: + content: + application/json: + example: + disabled: false + name: 'Updated OpenAI Key' + schema: + $ref: '#/components/schemas/UpdateBYOKKeyRequest' + required: true responses: '200': content: application/json: example: data: - - architecture: - input_modalities: - - 'text' - instruct_type: null - modality: 'text->embeddings' - output_modalities: - - 'embeddings' - tokenizer: 'GPT' - canonical_slug: 'openai/text-embedding-3-small' - context_length: 8192 - created: 1692901234 - default_parameters: null - description: 'OpenAI text embedding model optimized for performance.' - expiration_date: null - id: 'openai/text-embedding-3-small' - knowledge_cutoff: null - links: - details: '/api/v1/models/openai/text-embedding-3-small/endpoints' - name: 'Text Embedding 3 Small' - per_request_limits: null - pricing: - completion: '0' - image: '0' - prompt: '0.00000002' - request: '0' - supported_parameters: [] - supported_voices: null - top_provider: - context_length: 8192 - is_moderated: false - max_completion_tokens: null + allowed_api_key_hashes: null + allowed_models: null + allowed_user_ids: null + created_at: '2025-08-24T10:30:00Z' + declared_region: null + declared_zdr: null + disabled: false + id: '11111111-2222-3333-4444-555555555555' + is_byok_only: false + is_fallback: false + is_required: false + label: 'sk-...AbCd' + name: 'Updated OpenAI Key' + provider: 'openai' + sort_order: 0 + workspace_id: '550e8400-e29b-41d4-a716-446655440000' schema: - $ref: '#/components/schemas/ModelsListResponse' - description: 'Returns a list of embeddings models' + $ref: '#/components/schemas/UpdateBYOKKeyResponse' + description: 'BYOK credential updated successfully' '400': content: application/json: @@ -39500,132 +36437,16 @@ paths: schema: $ref: '#/components/schemas/BadRequestResponse' description: 'Bad Request - Invalid request parameters or malformed input' - '500': + '401': content: application/json: example: error: - code: 500 - message: 'Internal Server Error' - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - summary: 'List all embeddings models' - tags: - - 'Embeddings' - x-speakeasy-name-override: 'listModels' - x-speakeasy-pagination: - inputs: - - in: 'parameters' - name: 'offset' - type: 'offset' - - in: 'parameters' - name: 'limit' - type: 'limit' - outputs: - results: '$.data' - type: 'offsetLimit' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /endpoints/zdr: - get: - operationId: 'listEndpointsZdr' - responses: - '200': - content: - application/json: - example: - data: - - context_length: 8192 - latency_last_30m: - p50: 0.25 - p75: 0.35 - p90: 0.48 - p99: 0.85 - max_completion_tokens: 4096 - max_prompt_tokens: 8192 - model_id: 'openai/gpt-4' - model_name: 'GPT-4' - name: 'OpenAI: GPT-4' - native_tools: {} - pricing: - completion: '0.00006' - image: '0' - prompt: '0.00003' - request: '0' - provider_name: 'OpenAI' - quantization: 'fp16' - status: 0 - supported_parameters: - - 'temperature' - - 'top_p' - - 'max_tokens' - supports_diarization: false - supports_image_reference: false - supports_implicit_caching: true - supports_multiple_audio_references: false - supports_voice_cloning: false - tag: 'openai' - throughput_last_30m: - p50: 45.2 - p75: 38.5 - p90: 28.3 - p99: 15.1 - uptime_last_1d: 99.8 - uptime_last_30m: 99.5 - uptime_last_5m: 100 + code: 401 + message: 'Missing Authentication header' schema: - example: - data: - - context_length: 8192 - latency_last_30m: - p50: 0.25 - p75: 0.35 - p90: 0.48 - p99: 0.85 - max_completion_tokens: 4096 - max_prompt_tokens: 8192 - model_id: 'openai/gpt-4' - model_name: 'GPT-4' - name: 'OpenAI: GPT-4' - native_tools: {} - pricing: - completion: '0.00006' - image: '0' - prompt: '0.00003' - request: '0' - provider_name: 'OpenAI' - quantization: 'fp16' - status: 0 - supported_parameters: - - 'temperature' - - 'top_p' - - 'max_tokens' - supports_diarization: false - supports_image_reference: false - supports_implicit_caching: true - supports_multiple_audio_references: false - supports_voice_cloning: false - tag: 'openai' - throughput_last_30m: - p50: 45.2 - p75: 38.5 - p90: 28.3 - p99: 15.1 - uptime_last_1d: 99.8 - uptime_last_30m: 99.5 - uptime_last_5m: 100 - properties: - data: - items: - $ref: '#/components/schemas/PublicEndpoint' - type: 'array' - required: - - 'data' - type: 'object' - description: 'Returns a list of endpoints' + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' '403': content: application/json: @@ -39636,6 +36457,26 @@ paths: schema: $ref: '#/components/schemas/ForbiddenResponse' description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Resource conflict. Please try again later.' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Resource conflict or concurrent modification' '500': content: application/json: @@ -39646,76 +36487,80 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Preview the impact of ZDR on the available endpoints' + summary: 'Update a BYOK provider credential' tags: - - 'Endpoints' - x-speakeasy-name-override: 'listZdrEndpoints' + - 'BYOK' + x-speakeasy-name-override: 'update' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /external-users: - get: - description: 'List registrations belonging to the authenticated organization. Inactive registrations are excluded by default. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'listExternalUsers' + /chat/completions: + post: + description: 'Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.' + operationId: 'sendChatCompletionRequest' parameters: - - description: 'Number of records to skip for pagination' - in: 'query' - name: 'offset' - required: false - schema: - default: 0 - description: 'Number of records to skip for pagination' - example: 0 - minimum: 0 - type: - - 'integer' - - 'null' - - description: 'Maximum number of records to return (max 100)' - in: 'query' - name: 'limit' - required: false - schema: - default: 50 - description: 'Maximum number of records to return (max 100)' - example: 50 - maximum: 100 - minimum: 1 - type: 'integer' - - description: 'Immutable case-sensitive tracking string supplied as user on inference requests or as external.user on API keys: 1 to 512 characters, well-formed Unicode, no NUL, no surrounding whitespace. URL-encode it in resource paths; an ID of `.` or `..` cannot be addressed by path, so look it up with the list filter.' - in: 'query' - name: 'user' - required: false - schema: - description: 'Immutable case-sensitive tracking string supplied as user on inference requests or as external.user on API keys: 1 to 512 characters, well-formed Unicode, no NUL, no surrounding whitespace. URL-encode it in resource paths; an ID of `.` or `..` cannot be addressed by path, so look it up with the list filter.' - example: 'employee_123' - maxLength: 512 - minLength: 1 - pattern: '^[^\u0000]+$' - type: 'string' - - description: 'Include deactivated registrations.' - in: 'query' - name: 'include_inactive' + - description: 'Opt-in to surface routing metadata on the response under `openrouter_metadata`. Defaults to `disabled`. The legacy header `X-OpenRouter-Experimental-Metadata` is also accepted for backward compatibility.' + example: 'enabled' + in: 'header' + name: 'X-OpenRouter-Metadata' required: false schema: - default: false - description: 'Include deactivated registrations.' - example: false - type: 'boolean' + $ref: '#/components/schemas/MetadataLevel' + requestBody: + content: + application/json: + example: + max_tokens: 150 + messages: + - content: 'You are a helpful assistant.' + role: 'system' + - content: 'What is the capital of France?' + role: 'user' + model: 'openai/gpt-4' + temperature: 0.7 + schema: + $ref: '#/components/schemas/ChatRequest' + required: true responses: '200': content: application/json: example: - data: - - created_at: '2026-09-16T12:00:00Z' - is_active: true - updated_at: '2026-09-16T12:00:00Z' - user: 'employee_123' - total_count: 1 + choices: + - finish_reason: 'stop' + index: 0 + message: + content: 'The capital of France is Paris.' + role: 'assistant' + created: 1677652288 + id: 'chatcmpl-123' + model: 'openai/gpt-4' + object: 'chat.completion' + system_fingerprint: 'fp_44709d6fcb' + usage: + completion_tokens: 10 + prompt_tokens: 25 + total_tokens: 35 + schema: + $ref: '#/components/schemas/ChatResult' + text/event-stream: + example: + data: + choices: + - delta: + content: 'Hello' + role: 'assistant' + finish_reason: null + index: 0 + created: 1677652288 + id: 'chatcmpl-123' + model: 'openai/gpt-4' + object: 'chat.completion.chunk' schema: - $ref: '#/components/schemas/ListExternalUsersResponse' - description: 'Matching registrations and their total count.' + $ref: '#/components/schemas/ChatStreamingResponse' + x-speakeasy-sse-sentinel: '[DONE]' + description: 'Successful chat completion response' '400': content: application/json: @@ -39736,16 +36581,64 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: 'Unauthorized - Authentication required or invalid credentials' - '403': + '402': content: application/json: example: error: - code: 403 - message: 'Only management keys can perform this operation' + code: 402 + message: 'Insufficient credits. Add more using https://openrouter.ai/credits' + schema: + $ref: '#/components/schemas/PaymentRequiredResponse' + description: 'Payment Required - Insufficient credits or quota to complete request' + '403': + content: + application/json: + examples: + guardrail-blocked: + summary: 'Guardrail blocked the request' + value: + error: + code: 403 + message: 'Request blocked: prompt injection patterns detected' + metadata: + patterns: + - 'ignore all previous instructions' + openrouter_metadata: + attempt: 1 + endpoints: + available: + - model: 'openai/gpt-4o' + provider: 'OpenAI' + selected: false + total: 1 + is_byok: false + pipeline: + - data: + action: 'blocked' + detected: true + engines: + - 'regex' + patterns: + - 'ignore all previous instructions' + guardrail_id: 'grd_abc123' + guardrail_scope: 'api-key' + name: 'regex_pi_detection' + summary: 'Blocked: prompt injection detected (1 pattern matched)' + type: 'guardrail' + region: 'iad' + requested: 'openai/gpt-4o' + strategy: 'direct' + summary: 'available=1' + insufficient-permissions: + summary: 'Insufficient permissions' + value: + error: + code: 403 + message: 'Only management keys can perform this operation' schema: $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' + description: 'Forbidden - Authentication successful but insufficient permissions, or a guardrail blocked the request. When guardrails block and the `X-OpenRouter-Metadata: enabled` header is present, the response includes `openrouter_metadata` with full routing context and a `pipeline` array containing guardrail stage details.' '404': content: application/json: @@ -39756,134 +36649,150 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: 'Not Found - Resource does not exist' - '500': + '408': content: application/json: example: error: - code: 500 - message: 'Internal Server Error' + code: 408 + message: 'Operation timed out. Please try again later.' schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - summary: 'List registered external users' - tags: - - 'External Users' - - End Users - x-speakeasy-name-override: 'list' - x-speakeasy-pagination: - inputs: - - in: 'parameters' - name: 'offset' - type: 'offset' - - in: 'parameters' - name: 'limit' - type: 'limit' - outputs: - results: '$.data' - type: 'offsetLimit' - post: - description: 'Register a caller-supplied tracking ID under the authenticated organization. No login account, policy, or credentials are created. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'createExternalUser' - requestBody: - content: - application/json: - example: - user: 'employee_123' - schema: - $ref: '#/components/schemas/CreateExternalUserRequest' - required: true - responses: - '201': + $ref: '#/components/schemas/RequestTimeoutResponse' + description: 'Request Timeout - Operation exceeded time limit' + '413': content: application/json: example: - data: - created_at: '2026-09-16T12:00:00Z' - is_active: true - updated_at: '2026-09-16T12:00:00Z' - user: 'employee_123' + error: + code: 413 + message: 'Request payload too large' schema: - $ref: '#/components/schemas/ExternalUserResponse' - description: 'The registered external user. No generated public identifier is returned.' - '400': + $ref: '#/components/schemas/PayloadTooLargeResponse' + description: 'Payload Too Large - Request payload exceeds size limits' + '422': content: application/json: example: error: - code: 400 - message: 'Invalid request parameters' + code: 422 + message: 'Invalid argument' schema: - $ref: '#/components/schemas/BadRequestResponse' - description: 'Bad Request - Invalid request parameters or malformed input' - '401': + $ref: '#/components/schemas/UnprocessableEntityResponse' + description: 'Unprocessable Entity - Semantic validation failure' + '429': content: application/json: example: error: - code: 401 - message: 'Missing Authentication header' + code: 429 + message: 'Rate limit exceeded' schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '404': + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - Rate limit exceeded' + '500': content: application/json: example: error: - code: 404 - message: 'Resource not found' + code: 500 + message: 'Internal Server Error' schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' - '409': + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + '502': content: application/json: example: error: - code: 409 - message: 'This tracking ID is already registered' + code: 502 + message: 'Provider returned error' schema: - $ref: '#/components/schemas/ConflictResponse' - description: 'The tracking ID is already registered in this organization, active or not.' - '500': + $ref: '#/components/schemas/BadGatewayResponse' + description: 'Bad Gateway - Provider/upstream API failure' + '503': content: application/json: example: error: - code: 500 - message: 'Internal Server Error' + code: 503 + message: 'Service temporarily unavailable' schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - summary: 'Register an external user' + $ref: '#/components/schemas/ServiceUnavailableResponse' + description: 'Service Unavailable - Service temporarily unavailable' + '524': + content: + application/json: + example: + error: + code: 524 + message: 'Request timed out. Please try again later.' + schema: + $ref: '#/components/schemas/EdgeNetworkTimeoutResponse' + description: 'Infrastructure Timeout - Provider request timed out at edge network' + '529': + content: + application/json: + example: + error: + code: 529 + message: 'Provider returned error' + schema: + $ref: '#/components/schemas/ProviderOverloadedResponse' + description: 'Provider Overloaded - Provider is temporarily overloaded' + summary: 'Create a chat completion' tags: - - 'External Users' - - End Users - x-speakeasy-name-override: 'create' + - 'Chat' + x-speakeasy-group: 'chat' + x-speakeasy-name-override: 'send' + x-speakeasy-stream-request-field: 'stream' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /external-users/{user}: - delete: - description: 'Soft-deactivate a registration while retaining its tracking ID. Repeat deactivation succeeds. This does not block inference; reactivate through PATCH. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'deleteExternalUser' + /classifications/task: + get: + description: "Returns the market-share breakdown of OpenRouter traffic by task classification\n(e.g. code generation, web search, summarization) over a trailing time window.\n\nEach classification reports its share of classified sampled requests (`usage_share`)\nand classified sampled token volume (`token_share`) as fractions between 0 and 1.\nThe unclassified `other` bucket is excluded. Absolute volumes are not exposed\nbecause the underlying data is sampled.\n\nEach classification also includes a `models` array listing the top models by\nrequest volume within that classification, with their within-tag usage and token shares.\n\nClassifications are grouped into macro-categories (Code, Data, Agent, General)\nwith aggregate shares provided for each.\n\nAuthenticate with any valid OpenRouter API key (same key used for inference).\nRate-limited to 30 requests/minute per key and 500 requests/day per account.\n\nWhen republishing or quoting this data, cite as:\n\"Source: OpenRouter (openrouter.ai/rankings), as of {as_of}.\"" + operationId: 'getTaskClassifications' parameters: - - description: 'Immutable case-sensitive tracking string supplied as user on inference requests or as external.user on API keys: 1 to 512 characters, well-formed Unicode, no NUL, no surrounding whitespace. URL-encode it in resource paths; an ID of `.` or `..` cannot be addressed by path, so look it up with the list filter.' - in: 'path' - name: 'user' - required: true + - description: 'Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.' + in: 'query' + name: 'window' + required: false schema: - description: 'Immutable case-sensitive tracking string supplied as user on inference requests or as external.user on API keys: 1 to 512 characters, well-formed Unicode, no NUL, no surrounding whitespace. URL-encode it in resource paths; an ID of `.` or `..` cannot be addressed by path, so look it up with the list filter.' - example: 'employee_123' - maxLength: 512 - minLength: 1 - pattern: '^[^\u0000]+$' + default: '7d' + description: 'Trailing time window for the classification data. Currently only `7d` (trailing 7 days) is supported.' + enum: + - '7d' + example: '7d' type: 'string' responses: - '204': - description: 'Registration is inactive.' + '200': + content: + application/json: + example: + data: + as_of: '2026-06-17' + classifications: + - category_token_share: 0.48 + category_usage_share: 0.51 + display_name: 'Code Generation' + macro_category: 'code' + models: + - id: 'openai/gpt-4.1-mini' + tag_token_share: 0.75 + tag_usage_share: 0.55 + tag: 'code:general_impl' + token_share: 0.31 + usage_share: 0.23 + macro_categories: + - key: 'code' + label: 'Code' + token_share: 0.52 + usage_share: 0.45 + window_days: 7 + schema: + $ref: '#/components/schemas/TaskClassificationResponse' + description: 'Task classification market-share data for the requested trailing window.' '400': content: application/json: @@ -39904,16 +36813,16 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: 'Unauthorized - Authentication required or invalid credentials' - '404': + '429': content: application/json: example: error: - code: 404 - message: 'Resource not found' + code: 429 + message: 'Rate limit exceeded' schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - Rate limit exceeded' '500': content: application/json: @@ -39924,25 +36833,44 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Deactivate a registered external user' + summary: 'Task classification market share' tags: - - 'External Users' - - End Users - x-speakeasy-name-override: 'delete' + - 'Classifications' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /containers/{container_id}/files: get: - description: 'Retrieve an active or inactive registration by its URL-encoded, caller-supplied tracking ID. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'getExternalUser' + description: 'Lists the files in a container, in lexicographic path order. The container id is the canonical id returned in bash/shell tool results; a restarted session is a separate container with its own id. Paginate with `limit` and `after` (pass the previous page’s `last_id`); `has_more: true` always means the next page is fetchable that way. `last_id` is the resume cursor: it is the last listed file’s id, except when a page ends at the per-request scan bound on hidden bookkeeping objects, where it names the scan position instead and may not appear in `data` (which can then be empty).' + operationId: 'listContainerFiles' parameters: - - description: 'Immutable case-sensitive tracking string supplied as user on inference requests or as external.user on API keys: 1 to 512 characters, well-formed Unicode, no NUL, no surrounding whitespace. URL-encode it in resource paths; an ID of `.` or `..` cannot be addressed by path, so look it up with the list filter.' + - description: 'The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own `-r`-suffixed id. A session-derived id is always `sess_` + the sanitized session key, which is not necessarily the raw session id that was sent.' in: 'path' - name: 'user' + name: 'container_id' required: true schema: - description: 'Immutable case-sensitive tracking string supplied as user on inference requests or as external.user on API keys: 1 to 512 characters, well-formed Unicode, no NUL, no surrounding whitespace. URL-encode it in resource paths; an ID of `.` or `..` cannot be addressed by path, so look it up with the list filter.' - example: 'employee_123' - maxLength: 512 - minLength: 1 - pattern: '^[^\u0000]+$' + description: 'The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own `-r`-suffixed id. A session-derived id is always `sess_` + the sanitized session key, which is not necessarily the raw session id that was sent.' + example: 'sess_abc123' + type: 'string' + - description: 'Maximum number of files to return (1-1000). Defaults to 100 when absent.' + in: 'query' + name: 'limit' + required: false + schema: + default: 100 + description: 'Maximum number of files to return (1-1000). Defaults to 100 when absent.' + example: 100 + maximum: 1000 + minimum: 1 + type: 'integer' + - description: 'Forward cursor: the previous page’s `last_id` (or any container file id); listing resumes strictly after that path. A `last_id` from a page that stopped at the scan bound may name a directory-marker path (trailing `/`) that was never listed as a file; such cursors are accepted.' + in: 'query' + name: 'after' + required: false + schema: + description: 'Forward cursor: the previous page’s `last_id` (or any container file id); listing resumes strictly after that path. A `last_id` from a page that stopped at the scan bound may name a directory-marker path (trailing `/`) that was never listed as a file; such cursors are accepted.' + example: 'cfile_b3V0L3JlcG9ydC5jc3Y' type: 'string' responses: '200': @@ -39950,13 +36878,20 @@ paths: application/json: example: data: - created_at: '2026-09-16T12:00:00Z' - is_active: true - updated_at: '2026-09-16T12:00:00Z' - user: 'employee_123' + - bytes: 123 + container_id: 'sess_abc123' + created_at: 1755640000 + id: 'cfile_b3V0L3JlcG9ydC5jc3Y' + object: 'container.file' + path: 'out/report.csv' + source: 'assistant' + first_id: 'cfile_b3V0L3JlcG9ydC5jc3Y' + has_more: false + last_id: 'cfile_b3V0L3JlcG9ydC5jc3Y' + object: 'list' schema: - $ref: '#/components/schemas/ExternalUserResponse' - description: 'The registered external user. No generated public identifier is returned.' + $ref: '#/components/schemas/ContainerFileListResponse' + description: 'The files in the container.' '400': content: application/json: @@ -39987,16 +36922,16 @@ paths: schema: $ref: '#/components/schemas/ForbiddenResponse' description: 'Forbidden - Authentication successful but insufficient permissions' - '404': + '429': content: application/json: example: error: - code: 404 - message: 'Resource not found' + code: 429 + message: 'Rate limit exceeded' schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - Rate limit exceeded' '500': content: application/json: @@ -40007,47 +36942,59 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Get a registered external user' + '503': + content: + application/json: + example: + error: + code: 503 + message: 'Service temporarily unavailable' + schema: + $ref: '#/components/schemas/ServiceUnavailableResponse' + description: 'Service Unavailable - Service temporarily unavailable' + summary: 'List container files' tags: - - 'External Users' - - End Users - x-speakeasy-name-override: 'get' - patch: - description: 'Update registration state without changing identity. State changes do not enforce inference access. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'updateExternalUser' + - 'Containers' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /containers/{container_id}/files/{file_id}: + get: + description: 'Returns the metadata of a single file in a container.' + operationId: 'getContainerFile' parameters: - - description: 'Immutable case-sensitive tracking string supplied as user on inference requests or as external.user on API keys: 1 to 512 characters, well-formed Unicode, no NUL, no surrounding whitespace. URL-encode it in resource paths; an ID of `.` or `..` cannot be addressed by path, so look it up with the list filter.' + - description: 'The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own `-r`-suffixed id. A session-derived id is always `sess_` + the sanitized session key, which is not necessarily the raw session id that was sent.' in: 'path' - name: 'user' + name: 'container_id' required: true schema: - description: 'Immutable case-sensitive tracking string supplied as user on inference requests or as external.user on API keys: 1 to 512 characters, well-formed Unicode, no NUL, no surrounding whitespace. URL-encode it in resource paths; an ID of `.` or `..` cannot be addressed by path, so look it up with the list filter.' - example: 'employee_123' - maxLength: 512 - minLength: 1 - pattern: '^[^\u0000]+$' + description: 'The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own `-r`-suffixed id. A session-derived id is always `sess_` + the sanitized session key, which is not necessarily the raw session id that was sent.' + example: 'sess_abc123' + type: 'string' + - description: 'Container file id (`cfile_` + base64url of the file path).' + in: 'path' + name: 'file_id' + required: true + schema: + description: 'Container file id (`cfile_` + base64url of the file path).' + example: 'cfile_b3V0L3JlcG9ydC5jc3Y' type: 'string' - requestBody: - content: - application/json: - example: - is_active: true - schema: - $ref: '#/components/schemas/UpdateExternalUserRequest' - required: true responses: '200': content: application/json: example: - data: - created_at: '2026-09-16T12:00:00Z' - is_active: true - updated_at: '2026-09-16T12:00:00Z' - user: 'employee_123' + bytes: 123 + container_id: 'sess_abc123' + created_at: 1755640000 + id: 'cfile_b3V0L3JlcG9ydC5jc3Y' + object: 'container.file' + path: 'out/report.csv' + source: 'assistant' schema: - $ref: '#/components/schemas/ExternalUserResponse' - description: 'The registered external user. No generated public identifier is returned.' + $ref: '#/components/schemas/ContainerFile' + description: 'The container file.' '400': content: application/json: @@ -40068,6 +37015,16 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' '404': content: application/json: @@ -40078,6 +37035,16 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: 'Not Found - Resource does not exist' + '429': + content: + application/json: + example: + error: + code: 429 + message: 'Rate limit exceeded' + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - Rate limit exceeded' '500': content: application/json: @@ -40088,110 +37055,53 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Update a registered external user' + '503': + content: + application/json: + example: + error: + code: 503 + message: 'Service temporarily unavailable' + schema: + $ref: '#/components/schemas/ServiceUnavailableResponse' + description: 'Service Unavailable - Service temporarily unavailable' + summary: 'Retrieve a container file' tags: - - 'External Users' - - End Users - x-speakeasy-name-override: 'update' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /files: - get: - description: 'Lists files belonging to the workspace of the authenticating API key.' - operationId: 'listFiles' - parameters: - - description: 'Maximum number of files to return (1–1000).' - in: 'query' - name: 'limit' - required: false - schema: - description: 'Maximum number of files to return (1–1000).' - example: 100 - maximum: 1000 - minimum: 1 - type: 'integer' - - description: 'Opaque pagination cursor from a previous response.' - in: 'query' - name: 'cursor' - required: false - schema: - description: 'Opaque pagination cursor from a previous response.' - example: 'eyJjdXJzb3IiOiJvcl9maWxlXzAxMUNOaGE4aUNKY1Uxd1hOUjZxNFY4dyJ9' - type: 'string' - - description: 'Workspace to scope the request to. Defaults to the caller’s default workspace.' - in: 'query' - name: 'workspace_id' - required: false - schema: - description: 'Workspace to scope the request to. Defaults to the caller’s default workspace.' - example: 'a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7' - format: 'uuid' - type: 'string' - - description: 'Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.' - example: 'openai' - in: 'query' - name: 'provider' - required: false - schema: - $ref: '#/components/schemas/FileProvider' - - description: 'OpenAI-style forward cursor: the id to list after.' - in: 'query' - name: 'after' - required: false - schema: - description: 'OpenAI-style forward cursor: the id to list after.' - example: 'or_file_011CNha8iCJcU1wXNR6q4V8w' - type: 'string' - - description: 'Anthropic-style forward cursor: the id to list after.' - in: 'query' - name: 'after_id' - required: false - schema: - description: 'Anthropic-style forward cursor: the id to list after.' - example: 'or_file_011CNha8iCJcU1wXNR6q4V8w' - type: 'string' - - description: 'Anthropic-style reverse cursor. Not supported by OpenRouter storage.' - in: 'query' - name: 'before_id' - required: false + - 'Containers' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /containers/{container_id}/files/{file_id}/content: + get: + description: 'Streams the raw bytes of a file in a container.' + operationId: 'downloadContainerFileContent' + parameters: + - description: 'The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own `-r`-suffixed id. A session-derived id is always `sess_` + the sanitized session key, which is not necessarily the raw session id that was sent.' + in: 'path' + name: 'container_id' + required: true schema: - description: 'Anthropic-style reverse cursor. Not supported by OpenRouter storage.' - example: 'or_file_011CNha8iCJcU1wXNR6q4V8w' + description: 'The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own `-r`-suffixed id. A session-derived id is always `sess_` + the sanitized session key, which is not necessarily the raw session id that was sent.' + example: 'sess_abc123' type: 'string' - - description: 'Sort direction. Only `asc` is supported by OpenRouter storage.' - in: 'query' - name: 'order' - required: false + - description: 'Container file id (`cfile_` + base64url of the file path).' + in: 'path' + name: 'file_id' + required: true schema: - description: 'Sort direction. Only `asc` is supported by OpenRouter storage.' - enum: - - 'asc' - - 'desc' - example: 'asc' + description: 'Container file id (`cfile_` + base64url of the file path).' + example: 'cfile_b3V0L3JlcG9ydC5jc3Y' type: 'string' - x-speakeasy-unknown-values: allow responses: '200': content: - application/json: - example: - cursor: null - data: - - created_at: '2025-01-01T00:00:00Z' - downloadable: false - filename: 'document.pdf' - id: 'or_file_011CNha8iCJcU1wXNR6q4V8w' - mime_type: 'application/pdf' - size_bytes: 1024000 - type: 'file' - first_id: 'or_file_011CNha8iCJcU1wXNR6q4V8w' - has_more: false - last_id: 'or_file_011CNha8iCJcU1wXNR6q4V8w' + application/octet-stream: + example: 'binary file contents' schema: - $ref: '#/components/schemas/FileListResponse' - description: 'A page of files.' + format: 'binary' + type: 'string' + description: 'The raw file content.' '400': content: application/json: @@ -40222,6 +37132,16 @@ paths: schema: $ref: '#/components/schemas/ForbiddenResponse' description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' '429': content: application/json: @@ -40242,16 +37162,6 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - '502': - content: - application/json: - example: - error: - code: 502 - message: 'Provider returned error' - schema: - $ref: '#/components/schemas/BadGatewayResponse' - description: 'Bad Gateway - Provider/upstream API failure' '503': content: application/json: @@ -40262,68 +37172,50 @@ paths: schema: $ref: '#/components/schemas/ServiceUnavailableResponse' description: 'Service Unavailable - Service temporarily unavailable' - summary: 'List files' + summary: 'Download container file content' tags: - - 'Files' - x-speakeasy-name-override: 'list' - x-speakeasy-pagination: - inputs: - - in: 'parameters' - name: 'cursor' - type: 'cursor' - outputs: - nextCursor: '$.cursor' - results: '$.data' - type: 'cursor' + - 'Containers' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /containers/{container_id}/files/{file_id}/promote: post: - description: 'Uploads a file to be referenced in future API calls. The file is stored under the workspace of the authenticating API key. Maximum file size: 100 MB; empty files are rejected. The file type is determined from the file contents — not the filename or the declared content type — and must be a PDF, a PNG/JPEG/GIF/WebP image, a DOCX/XLSX/PPTX document, an MP3/WAV/FLAC/OGG audio file, or UTF-8 text. Text is reported by its structure as `application/json`, `application/x-ndjson`, `text/csv`, `text/markdown`, or `text/plain`.' - operationId: 'uploadFile' + description: 'Copies a file from the container''s sandbox prefix into the workspace''s durable document storage, so it outlives the container. Returns the new document in the Files API shape, with a durable file id in the documents namespace. The copy counts against the workspace''s storage quota. Unlike a direct upload, promoted files are downloadable.' + operationId: 'promoteContainerFile' parameters: - - description: 'Workspace to scope the request to. Defaults to the caller’s default workspace.' - in: 'query' - name: 'workspace_id' - required: false + - description: 'The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own `-r`-suffixed id. A session-derived id is always `sess_` + the sanitized session key, which is not necessarily the raw session id that was sent.' + in: 'path' + name: 'container_id' + required: true schema: - description: 'Workspace to scope the request to. Defaults to the caller’s default workspace.' - example: 'a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7' - format: 'uuid' + description: 'The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own `-r`-suffixed id. A session-derived id is always `sess_` + the sanitized session key, which is not necessarily the raw session id that was sent.' + example: 'sess_abc123' type: 'string' - - description: 'Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.' - example: 'openai' - in: 'query' - name: 'provider' - required: false + - description: 'Container file id (`cfile_` + base64url of the file path).' + in: 'path' + name: 'file_id' + required: true schema: - $ref: '#/components/schemas/FileProvider' - requestBody: - content: - multipart/form-data: - example: - file: 'document.pdf' - schema: - properties: - file: - format: 'binary' - type: 'string' - required: - - 'file' - type: 'object' - required: true + description: 'Container file id (`cfile_` + base64url of the file path).' + example: 'cfile_b3V0L3JlcG9ydC5jc3Y' + type: 'string' responses: '200': content: application/json: example: - created_at: '2025-01-01T00:00:00Z' - downloadable: false - filename: 'document.pdf' + _shape: 'openrouter' + created_at: '2026-08-23T00:00:00Z' + downloadable: true + filename: 'out/report.csv' id: 'or_file_011CNha8iCJcU1wXNR6q4V8w' - mime_type: 'application/pdf' - size_bytes: 1024000 + mime_type: 'text/csv' + size_bytes: 123 type: 'file' schema: $ref: '#/components/schemas/FileResponse' - description: 'The uploaded file metadata.' + description: 'The promoted file, as a workspace document.' '400': content: application/json: @@ -40354,6 +37246,16 @@ paths: schema: $ref: '#/components/schemas/ForbiddenResponse' description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' '413': content: application/json: @@ -40394,16 +37296,6 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - '502': - content: - application/json: - example: - error: - code: 502 - message: 'Provider returned error' - schema: - $ref: '#/components/schemas/BadGatewayResponse' - description: 'Bad Gateway - Provider/upstream API failure' '503': content: application/json: @@ -40414,84 +37306,446 @@ paths: schema: $ref: '#/components/schemas/ServiceUnavailableResponse' description: 'Service Unavailable - Service temporarily unavailable' - summary: 'Upload a file' + summary: 'Promote a container file into workspace documents' tags: - - 'Files' - x-speakeasy-name-override: 'upload' + - 'Containers' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /files/{file_id}: - delete: - description: 'Deletes a file owned by the requesting workspace. Deletion is irreversible.' - operationId: 'deleteFile' + /credits: + get: + description: 'Get total credits purchased and used for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'getCredits' + responses: + '200': + content: + application/json: + example: + data: + total_credits: 100.5 + total_usage: 25.75 + schema: + description: 'Total credits purchased and used' + example: + data: + total_credits: 100.5 + total_usage: 25.75 + properties: + data: + example: + total_credits: 100.5 + total_usage: 25.75 + properties: + total_credits: + description: 'Total credits purchased' + example: 100.5 + format: 'double' + type: 'number' + total_usage: + description: 'Total credits used' + example: 25.75 + format: 'double' + type: 'number' + required: + - 'total_credits' + - 'total_usage' + type: 'object' + required: + - 'data' + type: 'object' + description: 'Returns the total credits purchased and used' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Get remaining credits' + tags: + - 'Credits' + x-speakeasy-name-override: 'getCredits' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /credits/coinbase: + post: + deprecated: true + description: 'Deprecated. The Coinbase APIs used by this endpoint have been deprecated, so Coinbase Commerce charges have been removed. Use the web credits purchase flow instead.' + operationId: 'createCoinbaseCharge' + responses: + '200': + description: 'This endpoint is deprecated and will never return a 200 response.' + '410': + content: + application/json: + example: + error: + code: 410 + message: 'The Coinbase APIs used by this endpoint have been deprecated, so the Coinbase Commerce credits API has been removed. Use the web credits purchase flow instead.' + schema: + $ref: '#/components/schemas/GoneResponse' + description: 'Gone - Endpoint has been permanently removed or deprecated' + security: [] + summary: 'Deprecated Coinbase Commerce charge endpoint' + tags: + - 'Credits' + x-fern-ignore: true + x-speakeasy-ignore: true + x-speakeasy-name-override: 'createCoinbaseCharge' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /datasets/app-rankings: + get: + description: "Returns the top public apps on OpenRouter ranked by token usage inside the requested\ndate window, matching the public apps marketplace on openrouter.ai/apps. Token totals\nare `prompt_tokens + completion_tokens`; hidden and private apps are excluded and\ntraffic from related app aliases is merged into the canonical visible app.\n\n`sort=popular` (default) ranks by total token volume inside the window.\n`sort=trending` ranks by absolute excess token growth: window volume minus the average\nvolume of the three equal-length periods immediately preceding the window. Apps with\nno excess growth are omitted, so `trending` may return fewer than `limit` rows.\n\nFilter with `category` (marketplace category group, e.g. `coding`) or `subcategory`\n(e.g. `cli-agent`). Ranks are re-numbered 1..N after filtering. Page with `offset` —\n`rank` stays absolute, so the first row of `offset=50` is `rank: 51`.\n\nAuthenticate with any valid OpenRouter API key (same key used for inference).\nRate-limited to 30 requests/minute per key and 500 requests/day per account.\n\nWhen republishing or quoting this dataset, OpenRouter must be cited as:\n\"Source: OpenRouter (openrouter.ai/apps), as of {as_of}.\"\n\nToken counts come from each upstream provider's own tokenizer, so a token attributed\nto one app is not directly comparable to a token attributed to another app whose\ntraffic flows through a different provider.\n\nLicensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/): reuse and republish with attribution to OpenRouter." + operationId: 'getAppRankings' parameters: - - in: 'path' - name: 'file_id' - required: true + - description: 'Marketplace category group to filter by (e.g. `coding`). Only apps tagged with a subcategory inside this group are returned. Mutually combinable with `subcategory` — when both are supplied the `subcategory` must belong to the `category` group.' + in: 'query' + name: 'category' + required: false + schema: + description: 'Marketplace category group to filter by (e.g. `coding`). Only apps tagged with a subcategory inside this group are returned. Mutually combinable with `subcategory` — when both are supplied the `subcategory` must belong to the `category` group.' + enum: + - 'coding' + - 'creative' + - 'productivity' + - 'entertainment' + example: 'coding' + type: 'string' + x-speakeasy-unknown-values: allow + - description: 'Marketplace subcategory to filter by (e.g. `cli-agent`). Takes precedence over `category` for the actual filter; when `category` is also supplied the pair must be consistent.' + in: 'query' + name: 'subcategory' + required: false + schema: + description: 'Marketplace subcategory to filter by (e.g. `cli-agent`). Takes precedence over `category` for the actual filter; when `category` is also supplied the pair must be consistent.' + enum: + - 'cli-agent' + - 'ide-extension' + - 'cloud-agent' + - 'programming-app' + - 'native-app-builder' + - 'creative-writing' + - 'video-gen' + - 'image-gen' + - 'audio-gen' + - 'roleplay' + - 'game' + - 'writing-assistant' + - 'general-chat' + - 'personal-agent' + - 'legal' + example: 'cli-agent' + type: 'string' + x-speakeasy-unknown-values: allow + - description: '`popular` ranks apps by total token volume inside the date window. `trending` ranks apps by absolute excess token growth: window volume minus the average volume of the three equal-length periods immediately preceding the window. Apps with no excess growth are omitted from `trending` results.' + in: 'query' + name: 'sort' + required: false + schema: + default: 'popular' + description: '`popular` ranks apps by total token volume inside the date window. `trending` ranks apps by absolute excess token growth: window volume minus the average volume of the three equal-length periods immediately preceding the window. Apps with no excess growth are omitted from `trending` results.' + enum: + - 'popular' + - 'trending' + example: 'popular' + type: 'string' + x-speakeasy-unknown-values: allow + - description: 'Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`.' + in: 'query' + name: 'start_date' + required: false + schema: + description: 'Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`.' + example: '2026-04-12' + pattern: '^\d{4}-\d{2}-\d{2}$' + type: 'string' + - description: 'End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400.' + in: 'query' + name: 'end_date' + required: false + schema: + description: 'End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400.' + example: '2026-05-11' + pattern: '^\d{4}-\d{2}-\d{2}$' + type: 'string' + - description: 'Maximum number of apps to return (1-100). Defaults to 50.' + in: 'query' + name: 'limit' + required: false + schema: + default: 50 + description: 'Maximum number of apps to return (1-100). Defaults to 50.' + example: 50 + maximum: 100 + minimum: 1 + type: 'integer' + - description: 'Number of ranked apps to skip before the first returned row (0-100). Defaults to 0. `rank` stays absolute, so the first row of `offset=50` is `rank: 51`.' + in: 'query' + name: 'offset' + required: false + schema: + default: 0 + description: 'Number of ranked apps to skip before the first returned row (0-100). Defaults to 0. `rank` stays absolute, so the first row of `offset=50` is `rank: 51`.' + example: 0 + maximum: 100 + minimum: 0 + type: + - 'integer' + - 'null' + responses: + '200': + content: + application/json: + example: + data: + - app_id: 12345 + app_name: 'Cline' + rank: 1 + total_requests: 4321 + total_tokens: '12345678' + - app_id: 67890 + app_name: 'Roo Code' + rank: 2 + total_requests: 2109 + total_tokens: '9876543' + meta: + as_of: '2026-05-12T02:00:00Z' + end_date: '2026-05-11' + start_date: '2026-04-12' + version: 'v1' + schema: + $ref: '#/components/schemas/AppRankingsResponse' + description: 'Apps ranked per the requested `sort`, re-numbered 1..N. `popular` sorts by `total_tokens` descending; `trending` sorts by absolute excess token growth descending and may return fewer than `limit` rows.' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': + content: + application/json: + example: + error: + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '429': + content: + application/json: + example: + error: + code: 429 + message: 'Rate limit exceeded' + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - Rate limit exceeded' + '500': + content: + application/json: + example: + error: + code: 500 + message: 'Internal Server Error' + schema: + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Top apps by token usage' + tags: + - 'Datasets' + x-speakeasy-pagination: + inputs: + - in: 'parameters' + name: 'offset' + type: 'offset' + - in: 'parameters' + name: 'limit' + type: 'limit' + outputs: + results: '$.data' + type: 'offsetLimit' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /datasets/rankings-daily: + get: + description: "Returns the top 50 public models per day by total token usage on OpenRouter, plus a\nsingle aggregated `other` row per day that sums every model outside that top 50.\nToken totals are `prompt_tokens + completion_tokens`, matching the public rankings\nchart on openrouter.ai/rankings.\n\nEach row is a distinct `(date, model_permaslug)` pair. The `other` row uses the\nreserved permaslug `other` and is always returned last within its date, so callers\ncan compute `top-50 traffic / total daily traffic` without a second request.\n\nOptional filters slice the dataset. `period` (`day`/`week`/`month`) sets the time\ngrain. `modality` and `context_bucket` narrow the exact dataset by output/input\nmodality (or tool-calling activity) and request context length. `category` and\n`language_type` instead read a sampled, upsampled dataset whose `total_tokens` are\nweekly-grain estimates — they cannot be combined with each other or with the exact\nfilters, and reject `period=day` with a 400.\n\nAuthenticate with any valid OpenRouter API key (same key used for inference).\nRate-limited to 30 requests/minute per key and 500 requests/day per account.\n\nWhen republishing or quoting this dataset, OpenRouter must be cited as:\n\"Source: OpenRouter (openrouter.ai/rankings), as of {as_of}.\"\n\nToken counts come from each upstream provider's own tokenizer (Anthropic counts\nare as reported by Anthropic, OpenAI counts are as reported by OpenAI, etc.), so\na token in one row is not directly comparable to a token in another row from a\ndifferent provider.\n\nLicensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/): reuse and republish with attribution to OpenRouter." + operationId: 'getRankingsDaily' + parameters: + - description: 'Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`.' + in: 'query' + name: 'start_date' + required: false + schema: + description: 'Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`.' + example: '2026-04-12' + pattern: '^\d{4}-\d{2}-\d{2}$' + type: 'string' + - description: 'End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400.' + in: 'query' + name: 'end_date' + required: false + schema: + description: 'End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400.' + example: '2026-05-11' + pattern: '^\d{4}-\d{2}-\d{2}$' + type: 'string' + - description: 'Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries.' + in: 'query' + name: 'period' + required: false + schema: + description: 'Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries.' + enum: + - 'day' + - 'week' + - 'month' + example: 'day' + type: 'string' + x-speakeasy-unknown-values: allow + - description: 'Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`.' + in: 'query' + name: 'modality' + required: false schema: - example: 'or_file_011CNha8iCJcU1wXNR6q4V8w' - maxLength: 256 - minLength: 1 - pattern: '^[\w-]+$' + description: 'Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`.' + enum: + - 'text' + - 'image' + - 'image_output' + - 'audio' + - 'tool_calling' + example: 'text' type: 'string' - - description: 'Workspace to scope the request to. Defaults to the caller’s default workspace.' + x-speakeasy-unknown-values: allow + - description: 'Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`.' in: 'query' - name: 'workspace_id' + name: 'context_bucket' required: false schema: - description: 'Workspace to scope the request to. Defaults to the caller’s default workspace.' - example: 'a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7' - format: 'uuid' + description: 'Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`.' + enum: + - '1K' + - '10K' + - '100K' + - '1M' + - '10M' + example: '100K' type: 'string' - - description: 'Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.' - example: 'openai' + x-speakeasy-unknown-values: allow + - description: 'Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`.' in: 'query' - name: 'provider' + name: 'category' required: false schema: - $ref: '#/components/schemas/FileProvider' + description: 'Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`.' + enum: + - 'programming' + - 'roleplay' + - 'marketing' + - 'marketing/seo' + - 'technology' + - 'science' + - 'translation' + - 'legal' + - 'finance' + - 'health' + - 'trivia' + - 'academia' + example: 'programming' + type: 'string' + x-speakeasy-unknown-values: allow + - description: 'Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`.' + in: 'query' + name: 'language_type' + required: false + schema: + description: 'Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`.' + enum: + - 'natural' + - 'programming' + example: 'natural' + type: 'string' + x-speakeasy-unknown-values: allow responses: '200': content: application/json: example: - id: 'or_file_011CNha8iCJcU1wXNR6q4V8w' - type: 'file_deleted' - schema: - $ref: '#/components/schemas/FileDeleteResponse' - description: 'The file was deleted.' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'Missing Authentication header' + data: + - date: '2026-05-11' + model_permaslug: 'openai/gpt-4o-2024-05-13' + total_tokens: '12345678' + - date: '2026-05-11' + model_permaslug: 'anthropic/claude-3.5-sonnet-20241022' + total_tokens: '9876543' + - date: '2026-05-11' + model_permaslug: 'other' + total_tokens: '4321098' + meta: + as_of: '2026-05-12T02:00:00Z' + end_date: '2026-05-11' + start_date: '2026-04-12' + version: 'v1' schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '403': + $ref: '#/components/schemas/RankingsDailyResponse' + description: 'Up to 51 rows per day — the top 50 public models by `total_tokens` plus a single aggregated `other` row covering every model outside that top 50. Sorted by `date` ascending, then by `total_tokens` descending, with `other` pinned last within its date.' + '400': content: application/json: example: error: - code: 403 - message: 'Only management keys can perform this operation' + code: 400 + message: 'Invalid request parameters' schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' - '404': + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': content: application/json: example: error: - code: 404 - message: 'Resource not found' + code: 401 + message: 'Missing Authentication header' schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' '429': content: application/json: @@ -40512,104 +37766,111 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - '502': - content: - application/json: - example: - error: - code: 502 - message: 'Provider returned error' - schema: - $ref: '#/components/schemas/BadGatewayResponse' - description: 'Bad Gateway - Provider/upstream API failure' - '503': - content: - application/json: - example: - error: - code: 503 - message: 'Service temporarily unavailable' - schema: - $ref: '#/components/schemas/ServiceUnavailableResponse' - description: 'Service Unavailable - Service temporarily unavailable' - summary: 'Delete a file' + summary: 'Daily token totals for top 50 models' tags: - - 'Files' - x-speakeasy-name-override: 'delete' + - 'Datasets' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /datasets/session-cost: get: - description: 'Retrieves metadata for a single file owned by the requesting workspace.' - operationId: 'getFileMetadata' + description: "Returns weekly refreshed, aggregated cost-per-session cells for the published harnesses.\nSessions are never pooled across apps. Medians are of per-session USD spend, and\nprivacy-preserving aggregation never exposes clerk_user_id values or per-session rows.\n\nFilter by `app_slug`, `model`, or `turn_range`. Filtering by `model` alone works across apps\nfor harness-vs-harness comparison at a fixed model. Results refresh weekly and include the source snapshot\nwindow in `meta`.\n\nLicensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/): reuse and republish with attribution to OpenRouter." + operationId: 'getSessionCost' parameters: - - in: 'path' - name: 'file_id' - required: true + - description: 'Filter to one published harness slug.' + in: 'query' + name: 'app_slug' + required: false schema: - example: 'or_file_011CNha8iCJcU1wXNR6q4V8w' - maxLength: 256 - minLength: 1 - pattern: '^[\w-]+$' + description: 'Filter to one published harness slug.' + example: 'hermes-agent' type: 'string' - - description: 'Workspace to scope the request to. Defaults to the caller’s default workspace.' + - description: 'Exact model permaslug filter. Works across all harness apps.' in: 'query' - name: 'workspace_id' + name: 'model' required: false schema: - description: 'Workspace to scope the request to. Defaults to the caller’s default workspace.' - example: 'a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7' - format: 'uuid' + description: 'Exact model permaslug filter. Works across all harness apps.' + example: 'anthropic/claude-4.8-opus' type: 'string' - - description: 'Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.' - example: 'openai' + - description: 'Filter by the inclusive number of turns in a session.' in: 'query' - name: 'provider' + name: 'turn_range' required: false schema: - $ref: '#/components/schemas/FileProvider' + description: 'Filter by the inclusive number of turns in a session.' + enum: + - '1-turn' + - '2-9-turns' + - '10-49-turns' + - '50-plus-turns' + example: '10-49-turns' + type: 'string' + x-speakeasy-unknown-values: allow + - description: 'Maximum number of cells to return (1-500). Defaults to 100.' + in: 'query' + name: 'limit' + required: false + schema: + default: 100 + description: 'Maximum number of cells to return (1-500). Defaults to 100.' + example: 100 + maximum: 500 + minimum: 1 + type: 'integer' + - description: 'Number of sorted cells to skip (0-5000). Defaults to 0.' + in: 'query' + name: 'offset' + required: false + schema: + default: 0 + description: 'Number of sorted cells to skip (0-5000). Defaults to 0.' + example: 0 + maximum: 5000 + minimum: 0 + type: + - 'integer' + - 'null' responses: '200': content: application/json: example: - created_at: '2025-01-01T00:00:00Z' - downloadable: false - filename: 'document.pdf' - id: 'or_file_011CNha8iCJcU1wXNR6q4V8w' - mime_type: 'application/pdf' - size_bytes: 1024000 - type: 'file' - schema: - $ref: '#/components/schemas/FileResponse' - description: 'The file metadata.' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'Missing Authentication header' + data: + - app_name: 'Hermes Agent' + app_slug: 'hermes-agent' + median_session_cost_usd: 1.74 + model_permaslug: 'anthropic/claude-4.8-opus' + turn_range: '10-49-turns' + meta: + as_of: '2026-05-12T02:00:00.000Z' + version: 'v1' + window_days: 30 + window_end_date: '2026-05-11' schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '403': + $ref: '#/components/schemas/SessionCostResponse' + description: 'Aggregated cost-per-session cells for the requested filters.' + '400': content: application/json: example: error: - code: 403 - message: 'Only management keys can perform this operation' + code: 400 + message: 'Invalid request parameters' schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' - '404': + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': content: application/json: example: error: - code: 404 - message: 'Resource not found' + code: 401 + message: 'Missing Authentication header' schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' '429': content: application/json: @@ -40630,73 +37891,275 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - '502': - content: - application/json: - example: - error: - code: 502 - message: 'Provider returned error' - schema: - $ref: '#/components/schemas/BadGatewayResponse' - description: 'Bad Gateway - Provider/upstream API failure' - '503': - content: - application/json: - example: - error: - code: 503 - message: 'Service temporarily unavailable' - schema: - $ref: '#/components/schemas/ServiceUnavailableResponse' - description: 'Service Unavailable - Service temporarily unavailable' - summary: 'Get file metadata' + summary: 'Cost per session by harness and model' tags: - - 'Files' - x-speakeasy-name-override: 'retrieve' + - 'Datasets' + x-speakeasy-pagination: + inputs: + - in: 'parameters' + name: 'offset' + type: 'offset' + - in: 'parameters' + name: 'limit' + type: 'limit' + outputs: + results: '$.data' + type: 'offsetLimit' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /files/{file_id}/content: - get: - description: 'Downloads the raw bytes of a file. Only files created server-side are downloadable; uploaded files return 400.' - operationId: 'downloadFileContent' - parameters: - - in: 'path' - name: 'file_id' - required: true - schema: - example: 'or_file_011CNha8iCJcU1wXNR6q4V8w' - maxLength: 256 - minLength: 1 - pattern: '^[\w-]+$' - type: 'string' - - description: 'Workspace to scope the request to. Defaults to the caller’s default workspace.' - in: 'query' - name: 'workspace_id' - required: false - schema: - description: 'Workspace to scope the request to. Defaults to the caller’s default workspace.' - example: 'a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7' - format: 'uuid' - type: 'string' - - description: 'Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.' - example: 'openai' - in: 'query' - name: 'provider' - required: false - schema: - $ref: '#/components/schemas/FileProvider' + /embeddings: + post: + description: 'Submits an embedding request to the embeddings router' + operationId: 'createEmbeddings' + requestBody: + content: + application/json: + schema: + description: 'Embeddings request input' + example: + dimensions: 1536 + input: 'The quick brown fox jumps over the lazy dog' + model: 'openai/text-embedding-3-small' + properties: + dimensions: + description: 'The number of dimensions for the output embeddings' + example: 1536 + minimum: 1 + type: 'integer' + encoding_format: + description: 'The format of the output embeddings' + enum: + - 'float' + - 'base64' + example: 'float' + type: 'string' + x-speakeasy-unknown-values: allow + input: + anyOf: + - minLength: 1 + type: 'string' + - items: + minLength: 1 + type: 'string' + type: 'array' + - items: + type: 'number' + type: 'array' + - items: + items: + type: 'number' + type: 'array' + type: 'array' + - items: + properties: + content: + items: + oneOf: + - properties: + text: + minLength: 1 + type: 'string' + type: + enum: + - 'text' + type: 'string' + required: + - 'type' + - 'text' + type: 'object' + - properties: + image_url: + properties: + url: + type: 'string' + required: + - 'url' + type: 'object' + type: + enum: + - 'image_url' + type: 'string' + required: + - 'type' + - 'image_url' + type: 'object' + - $ref: '#/components/schemas/ContentPartInputAudio' + - $ref: '#/components/schemas/ContentPartInputVideo' + - $ref: '#/components/schemas/ContentPartInputFile' + minItems: 1 + type: 'array' + required: + - 'content' + type: 'object' + type: 'array' + description: 'Text, token, or multimodal input(s) to embed' + example: 'The quick brown fox jumps over the lazy dog' + input_type: + description: 'The type of input (e.g. search_query, search_document)' + example: 'search_query' + type: 'string' + model: + description: 'The model to use for embeddings' + example: 'openai/text-embedding-3-small' + type: 'string' + provider: + allOf: + - $ref: '#/components/schemas/ProviderPreferences' + - description: 'Provider routing preferences for the request.' + session_id: + description: 'A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters.' + example: 'session-1234' + maxLength: 256 + type: 'string' + trace: + $ref: '#/components/schemas/TraceConfig' + user: + description: 'A unique identifier for the end-user' + example: 'user-1234' + type: 'string' + required: + - 'input' + - 'model' + type: 'object' + required: true responses: '200': content: - application/octet-stream: - example: 'binary file contents' + application/json: + schema: + description: 'Embeddings response containing embedding vectors' + example: + data: + - embedding: + - 0.0023064255 + - -0.009327292 + - 0.015797347 + index: 0 + object: 'embedding' + model: 'openai/text-embedding-3-small' + object: 'list' + usage: + prompt_tokens: 8 + total_tokens: 8 + properties: + data: + description: 'List of embedding objects' + example: + - embedding: + - 0.0023064255 + - -0.009327292 + - 0.015797347 + index: 0 + object: 'embedding' + items: + description: 'A single embedding object' + example: + embedding: + - 0.0023064255 + - -0.009327292 + - 0.015797347 + index: 0 + object: 'embedding' + properties: + embedding: + anyOf: + - items: + type: 'number' + type: 'array' + - type: 'string' + description: 'Embedding vector as an array of floats or a base64 string' + example: + - 0.0023064255 + - -0.009327292 + - 0.015797347 + index: + description: 'Index of the embedding in the input list' + example: 0 + type: 'integer' + object: + enum: + - 'embedding' + type: 'string' + required: + - 'object' + - 'embedding' + type: 'object' + type: 'array' + id: + description: 'Unique identifier for the embeddings response' + example: 'embd-1234567890' + type: 'string' + model: + description: 'The model used for embeddings' + example: 'openai/text-embedding-3-small' + type: 'string' + object: + enum: + - 'list' + type: 'string' + usage: + description: 'Token usage statistics' + example: + prompt_tokens: 8 + total_tokens: 8 + properties: + cost: + description: 'Cost of the request in credits' + example: 0.0001 + format: 'double' + type: 'number' + cost_details: + $ref: '#/components/schemas/CostDetails' + is_byok: + description: 'Whether a request was made using a Bring Your Own Key configuration' + type: 'boolean' + prompt_tokens: + description: 'Number of tokens in the input' + example: 8 + type: 'integer' + prompt_tokens_details: + description: 'Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included.' + properties: + audio_tokens: + description: 'Number of audio tokens in the input' + type: 'integer' + file_tokens: + description: 'Number of file/document tokens in the input' + type: 'integer' + image_tokens: + description: 'Number of image tokens in the input' + example: 258 + type: 'integer' + text_tokens: + description: 'Number of text tokens in the input' + example: 8 + type: 'integer' + video_tokens: + description: 'Number of video tokens in the input' + type: 'integer' + type: 'object' + total_tokens: + description: 'Total number of tokens used' + example: 8 + type: 'integer' + required: + - 'prompt_tokens' + - 'total_tokens' + type: 'object' + required: + - 'object' + - 'data' + - 'model' + type: 'object' + text/event-stream: + example: 'data: [DONE]' schema: - format: 'binary' + description: 'Not used for embeddings - embeddings do not support streaming' type: 'string' - description: 'The raw file content.' + x-speakeasy-sse-sentinel: '[DONE]' + description: 'Embedding response' '400': content: application/json: @@ -40717,6 +38180,16 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: 'Unauthorized - Authentication required or invalid credentials' + '402': + content: + application/json: + example: + error: + code: 402 + message: 'Insufficient credits. Add more using https://openrouter.ai/credits' + schema: + $ref: '#/components/schemas/PaymentRequiredResponse' + description: 'Payment Required - Insufficient credits or quota to complete request' '403': content: application/json: @@ -40737,6 +38210,26 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: 'Not Found - Resource does not exist' + '408': + content: + application/json: + example: + error: + code: 408 + message: 'Operation timed out. Please try again later.' + schema: + $ref: '#/components/schemas/RequestTimeoutResponse' + description: 'Request Timeout - Operation exceeded time limit' + '413': + content: + application/json: + example: + error: + code: 413 + message: 'Request payload too large' + schema: + $ref: '#/components/schemas/PayloadTooLargeResponse' + description: 'Payload Too Large - Request payload exceeds size limits' '429': content: application/json: @@ -40747,6 +38240,16 @@ paths: schema: $ref: '#/components/schemas/TooManyRequestsResponse' description: 'Too Many Requests - Rate limit exceeded' + '499': + content: + application/json: + example: + error: + code: 499 + message: 'The request was cancelled.' + schema: + $ref: '#/components/schemas/ClientClosedRequestResponse' + description: 'Client Closed Request - The caller cancelled the request' '500': content: application/json: @@ -40777,160 +38280,16 @@ paths: schema: $ref: '#/components/schemas/ServiceUnavailableResponse' description: 'Service Unavailable - Service temporarily unavailable' - summary: 'Download file content' - tags: - - 'Files' - x-speakeasy-name-override: 'download' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /generation: - get: - operationId: 'getGeneration' - parameters: - - description: 'The generation ID' - in: 'query' - name: 'id' - required: true - schema: - description: 'The generation ID' - example: 'gen-1234567890' - maxLength: 128 - pattern: '^gen-[0-9A-Za-z-]+$' - type: 'string' - responses: - '200': - content: - application/json: - example: - data: - api_type: 'completions' - app_id: 12345 - cache_discount: null - cancelled: false - created_at: '2024-07-15T23:33:19.433273+00:00' - data_region: 'global' - external_user: 'user-123' - finish_reason: 'stop' - generation_time: 1200 - http_referer: 'https://openrouter.ai/' - id: 'gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG' - is_byok: false - latency: 1250 - model: 'sao10k/l3-stheno-8b' - moderation_latency: 50 - native_finish_reason: 'stop' - native_tokens_cached: 3 - native_tokens_completion: 25 - native_tokens_completion_images: 0 - native_tokens_prompt: 10 - native_tokens_reasoning: 5 - num_fetches: 0 - num_input_audio_prompt: 0 - num_media_completion: 0 - num_media_prompt: 1 - num_search_results: 5 - origin: 'https://openrouter.ai/' - preset_id: 'a9e8d400-592a-494f-908c-375efa66cafd' - provider_name: 'Infermatic' - provider_responses: null - request_id: 'req-1727282430-aBcDeFgHiJkLmNoPqRsT' - router: 'openrouter/auto' - service_tier: 'priority' - session_id: null - streamed: true - tokens_completion: 25 - tokens_prompt: 10 - total_cost: 0.0015 - upstream_id: 'chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946' - upstream_inference_cost: 0.0012 - usage: 0.0015 - user_agent: 'Mozilla/5.0' - web_search_engine: 'exa' - schema: - $ref: '#/components/schemas/GenerationResponse' - description: 'Returns the request metadata for this generation' - '400': - content: - application/json: - example: - error: - code: 400 - message: 'Invalid request parameters' - schema: - $ref: '#/components/schemas/BadRequestResponse' - description: 'Bad Request - Invalid request parameters or malformed input' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'Missing Authentication header' - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '402': - content: - application/json: - example: - error: - code: 402 - message: 'Insufficient credits. Add more using https://openrouter.ai/credits' - schema: - $ref: '#/components/schemas/PaymentRequiredResponse' - description: 'Payment Required - Insufficient credits or quota to complete request' - '403': - content: - application/json: - example: - error: - code: 403 - message: 'Management key does not have permission for this request' - schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - The management key does not have permission for this request' - '404': - content: - application/json: - example: - error: - code: 404 - message: 'Resource not found' - schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' - '429': - content: - application/json: - example: - error: - code: 429 - message: 'Rate limit exceeded' - schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: 'Too Many Requests - Rate limit exceeded' - '500': - content: - application/json: - example: - error: - code: 500 - message: 'Internal Server Error' - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - '502': + '504': content: application/json: example: error: - code: 502 - message: 'Provider returned error' + code: 504 + message: 'The operation was aborted due to timeout' schema: - $ref: '#/components/schemas/BadGatewayResponse' - description: 'Bad Gateway - Provider/upstream API failure' + $ref: '#/components/schemas/GatewayTimeoutResponse' + description: 'Gateway Timeout - Provider did not respond before the upstream deadline' '524': content: application/json: @@ -40951,44 +38310,82 @@ paths: schema: $ref: '#/components/schemas/ProviderOverloadedResponse' description: 'Provider Overloaded - Provider is temporarily overloaded' - summary: 'Get request & usage metadata for a generation' + summary: 'Submit an embedding request' tags: - - 'Generations' + - 'Embeddings' + x-speakeasy-name-override: 'generate' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /generation/content: + /embeddings/models: get: - operationId: 'listGenerationContent' + description: 'Returns a list of all available embeddings models and their properties' + operationId: 'listEmbeddingsModels' parameters: - - description: 'The generation ID' + - description: 'Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned' in: 'query' - name: 'id' - required: true + name: 'offset' + required: false schema: - description: 'The generation ID' - example: 'gen-1234567890' - maxLength: 128 - pattern: '^gen-[0-9A-Za-z-]+$' - type: 'string' + default: 0 + description: 'Number of records to skip for pagination. When both offset and limit are omitted, the full list is returned' + example: 0 + minimum: 0 + type: + - 'integer' + - 'null' + - description: 'Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned' + in: 'query' + name: 'limit' + required: false + schema: + default: 500 + description: 'Maximum number of records to return (max 1000). When both offset and limit are omitted, the full list is returned' + example: 500 + maximum: 1000 + minimum: 1 + type: 'integer' responses: '200': content: application/json: example: data: - error: null - input: - messages: - - content: 'What is the meaning of life?' - role: 'user' - output: - completion: 'The meaning of life is a philosophical question...' - reasoning: null + - architecture: + input_modalities: + - 'text' + instruct_type: null + modality: 'text->embeddings' + output_modalities: + - 'embeddings' + tokenizer: 'GPT' + canonical_slug: 'openai/text-embedding-3-small' + context_length: 8192 + created: 1692901234 + default_parameters: null + description: 'OpenAI text embedding model optimized for performance.' + expiration_date: null + id: 'openai/text-embedding-3-small' + knowledge_cutoff: null + links: + details: '/api/v1/models/openai/text-embedding-3-small/endpoints' + name: 'Text Embedding 3 Small' + per_request_limits: null + pricing: + completion: '0' + image: '0' + prompt: '0.00000002' + request: '0' + supported_parameters: [] + supported_voices: null + top_provider: + context_length: 8192 + is_moderated: false + max_completion_tokens: null schema: - $ref: '#/components/schemas/GenerationContentResponse' - description: 'Returns the stored prompt and completion content, plus the failure error when the generation failed' + $ref: '#/components/schemas/ModelsListResponse' + description: 'Returns a list of embeddings models' '400': content: application/json: @@ -40999,46 +38396,6 @@ paths: schema: $ref: '#/components/schemas/BadRequestResponse' description: 'Bad Request - Invalid request parameters or malformed input' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'Missing Authentication header' - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '403': - content: - application/json: - example: - error: - code: 403 - message: 'Only management keys can perform this operation' - schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' - '404': - content: - application/json: - example: - error: - code: 404 - message: 'Resource not found' - schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' - '429': - content: - application/json: - example: - error: - code: 429 - message: 'Rate limit exceeded' - schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: 'Too Many Requests - Rate limit exceeded' '500': content: application/json: @@ -41049,117 +38406,132 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - '502': - content: - application/json: - example: - error: - code: 502 - message: 'Provider returned error' - schema: - $ref: '#/components/schemas/BadGatewayResponse' - description: 'Bad Gateway - Provider/upstream API failure' - '524': - content: - application/json: - example: - error: - code: 524 - message: 'Request timed out. Please try again later.' - schema: - $ref: '#/components/schemas/EdgeNetworkTimeoutResponse' - description: 'Infrastructure Timeout - Provider request timed out at edge network' - '529': - content: - application/json: - example: - error: - code: 529 - message: 'Provider returned error' - schema: - $ref: '#/components/schemas/ProviderOverloadedResponse' - description: 'Provider Overloaded - Provider is temporarily overloaded' - summary: 'Get stored prompt, completion, and error content for a generation' + summary: 'List all embeddings models' tags: - - 'Generations' + - 'Embeddings' + x-speakeasy-name-override: 'listModels' + x-speakeasy-pagination: + inputs: + - in: 'parameters' + name: 'offset' + type: 'offset' + - in: 'parameters' + name: 'limit' + type: 'limit' + outputs: + results: '$.data' + type: 'offsetLimit' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /generation/feedback: - post: - description: 'Submit structured feedback on a generation the authenticated user made. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'submitGenerationFeedback' - requestBody: - content: - application/json: - example: - category: 'incorrect_response' - comment: 'The model repeated the same paragraph three times.' - generation_id: 'gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG' - schema: - $ref: '#/components/schemas/SubmitGenerationFeedbackRequest' - required: true + /endpoints/zdr: + get: + operationId: 'listEndpointsZdr' responses: '200': content: application/json: example: data: - success: true - schema: - $ref: '#/components/schemas/SubmitGenerationFeedbackResponse' - description: 'Feedback recorded successfully' - '400': - content: - application/json: - example: - error: - code: 400 - message: 'Invalid request parameters' - schema: - $ref: '#/components/schemas/BadRequestResponse' - description: 'Bad Request - Invalid request parameters or malformed input' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'Missing Authentication header' - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '404': - content: - application/json: - example: - error: - code: 404 - message: 'Resource not found' - schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' - '409': - content: - application/json: - example: - error: - code: 409 - message: 'Feedback was already submitted for this generation' + - context_length: 8192 + latency_last_30m: + p50: 0.25 + p75: 0.35 + p90: 0.48 + p99: 0.85 + max_completion_tokens: 4096 + max_prompt_tokens: 8192 + model_id: 'openai/gpt-4' + model_name: 'GPT-4' + name: 'OpenAI: GPT-4' + native_tools: {} + pricing: + completion: '0.00006' + image: '0' + prompt: '0.00003' + request: '0' + provider_name: 'OpenAI' + quantization: 'fp16' + status: 0 + supported_parameters: + - 'temperature' + - 'top_p' + - 'max_tokens' + supports_diarization: false + supports_image_reference: false + supports_implicit_caching: true + supports_multiple_audio_references: false + supports_voice_cloning: false + tag: 'openai' + throughput_last_30m: + p50: 45.2 + p75: 38.5 + p90: 28.3 + p99: 15.1 + uptime_last_1d: 99.8 + uptime_last_30m: 99.5 + uptime_last_5m: 100 schema: - $ref: '#/components/schemas/ConflictResponse' - description: 'Conflict - Feedback was already submitted for this generation by this account. The first submission is kept.' - '429': + example: + data: + - context_length: 8192 + latency_last_30m: + p50: 0.25 + p75: 0.35 + p90: 0.48 + p99: 0.85 + max_completion_tokens: 4096 + max_prompt_tokens: 8192 + model_id: 'openai/gpt-4' + model_name: 'GPT-4' + name: 'OpenAI: GPT-4' + native_tools: {} + pricing: + completion: '0.00006' + image: '0' + prompt: '0.00003' + request: '0' + provider_name: 'OpenAI' + quantization: 'fp16' + status: 0 + supported_parameters: + - 'temperature' + - 'top_p' + - 'max_tokens' + supports_diarization: false + supports_image_reference: false + supports_implicit_caching: true + supports_multiple_audio_references: false + supports_voice_cloning: false + tag: 'openai' + throughput_last_30m: + p50: 45.2 + p75: 38.5 + p90: 28.3 + p99: 15.1 + uptime_last_1d: 99.8 + uptime_last_30m: 99.5 + uptime_last_5m: 100 + properties: + data: + items: + $ref: '#/components/schemas/PublicEndpoint' + type: 'array' + required: + - 'data' + type: 'object' + description: 'Returns a list of endpoints' + '403': content: application/json: example: error: - code: 429 - message: 'Rate limit exceeded' + code: 403 + message: 'Only management keys can perform this operation' schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: 'Too Many Requests - Rate limit exceeded' + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' '500': content: application/json: @@ -41170,18 +38542,18 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Submit feedback for a generation' + summary: 'Preview the impact of ZDR on the available endpoints' tags: - - 'Generations' - x-speakeasy-name-override: 'submitFeedback' + - 'Endpoints' + x-speakeasy-name-override: 'listZdrEndpoints' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /guardrails: + /external-users: get: - description: 'List all guardrails for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'listGuardrails' + description: 'List registrations belonging to the authenticated organization. Inactive registrations are excluded by default. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'listExternalUsers' parameters: - description: 'Number of records to skip for pagination' in: 'query' @@ -41206,42 +38578,40 @@ paths: maximum: 100 minimum: 1 type: 'integer' - - description: 'Filter guardrails by workspace ID. By default, guardrails in the default workspace are returned.' + - description: 'Immutable case-sensitive tracking string supplied as user on inference requests or as external.user on API keys: 1 to 512 characters, well-formed Unicode, no NUL, no surrounding whitespace. URL-encode it in resource paths; an ID of `.` or `..` cannot be addressed by path, so look it up with the list filter.' in: 'query' - name: 'workspace_id' + name: 'user' required: false schema: - description: 'Filter guardrails by workspace ID. By default, guardrails in the default workspace are returned.' - example: '0df9e665-d932-5740-b2c7-b52af166bc11' - format: 'uuid' + description: 'Immutable case-sensitive tracking string supplied as user on inference requests or as external.user on API keys: 1 to 512 characters, well-formed Unicode, no NUL, no surrounding whitespace. URL-encode it in resource paths; an ID of `.` or `..` cannot be addressed by path, so look it up with the list filter.' + example: 'employee_123' + maxLength: 512 + minLength: 1 + pattern: '^[^\u0000]+$' type: 'string' + - description: 'Include deactivated registrations.' + in: 'query' + name: 'include_inactive' + required: false + schema: + default: false + description: 'Include deactivated registrations.' + example: false + type: 'boolean' responses: '200': content: application/json: example: data: - - allowed_models: null - allowed_providers: - - 'openai' - - 'anthropic' - - 'google' - created_at: '2025-08-24T10:30:00Z' - description: 'Guardrail for production environment' - enforce_zdr: false - id: '550e8400-e29b-41d4-a716-446655440000' - ignored_models: null - ignored_providers: null - include_byok_in_budgets: false - limit_usd: 100 - name: 'Production Guardrail' - reset_interval: 'monthly' - updated_at: '2025-08-24T15:45:00Z' - workspace_id: '0df9e665-d932-5740-b2c7-b52af166bc11' + - created_at: '2026-09-16T12:00:00Z' + is_active: true + updated_at: '2026-09-16T12:00:00Z' + user: 'employee_123' total_count: 1 schema: - $ref: '#/components/schemas/ListGuardrailsResponse' - description: 'List of guardrails' + $ref: '#/components/schemas/ListExternalUsersResponse' + description: 'Matching registrations and their total count.' '400': content: application/json: @@ -41272,6 +38642,16 @@ paths: schema: $ref: '#/components/schemas/ForbiddenResponse' description: 'Forbidden - Authentication successful but insufficient permissions' + '404': + content: + application/json: + example: + error: + code: 404 + message: 'Resource not found' + schema: + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' '500': content: application/json: @@ -41282,9 +38662,10 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'List guardrails' + summary: 'List registered external users' tags: - - 'Guardrails' + - 'External Users' + - End Users x-speakeasy-name-override: 'list' x-speakeasy-pagination: inputs: @@ -41298,32 +38679,15 @@ paths: results: '$.data' type: 'offsetLimit' post: - description: 'Create a new guardrail for the authenticated user. A newly created guardrail enforces nothing until it is assigned to API keys or organization members; `workspace_id` places the guardrail in a workspace but does not apply it to that workspace''s traffic. To restrict all traffic in a workspace, update the workspace''s default guardrail instead. Set `allowed_data_regions` to enforce [In-Region Routing](/docs/guides/features/in-region-routing#enforcing-in-region-routing-with-guardrails): governed requests must arrive through one of the listed OpenRouter domains and are rejected with a 403 otherwise. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'createGuardrail' + description: 'Register a caller-supplied tracking ID under the authenticated organization. No login account, policy, or credentials are created. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'createExternalUser' requestBody: content: application/json: example: - allowed_data_regions: - - 'europe' - allowed_models: null - allowed_providers: - - 'openai' - - 'anthropic' - - 'deepseek' - description: 'A guardrail for limiting API usage' - enforce_zdr_anthropic: true - enforce_zdr_google: false - enforce_zdr_openai: true - enforce_zdr_other: false - enforce_zdr_xai: false - ignored_models: null - ignored_providers: null - limit_usd: 50 - name: 'My New Guardrail' - reset_interval: 'monthly' + user: 'employee_123' schema: - $ref: '#/components/schemas/CreateGuardrailRequest' + $ref: '#/components/schemas/CreateExternalUserRequest' required: true responses: '201': @@ -41331,31 +38695,13 @@ paths: application/json: example: data: - allowed_models: null - allowed_providers: - - 'openai' - - 'anthropic' - - 'google' - created_at: '2025-08-24T10:30:00Z' - description: 'A guardrail for limiting API usage' - enforce_zdr: null - enforce_zdr_anthropic: true - enforce_zdr_google: false - enforce_zdr_openai: true - enforce_zdr_other: false - enforce_zdr_xai: false - id: '550e8400-e29b-41d4-a716-446655440000' - ignored_models: null - ignored_providers: null - include_byok_in_budgets: false - limit_usd: 50 - name: 'My New Guardrail' - reset_interval: 'monthly' - updated_at: null - workspace_id: '0df9e665-d932-5740-b2c7-b52af166bc11' + created_at: '2026-09-16T12:00:00Z' + is_active: true + updated_at: '2026-09-16T12:00:00Z' + user: 'employee_123' schema: - $ref: '#/components/schemas/CreateGuardrailResponse' - description: 'Guardrail created successfully' + $ref: '#/components/schemas/ExternalUserResponse' + description: 'The registered external user. No generated public identifier is returned.' '400': content: application/json: @@ -41376,16 +38722,26 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: 'Unauthorized - Authentication required or invalid credentials' - '403': + '404': content: application/json: example: error: - code: 403 - message: 'Only management keys can perform this operation' + code: 404 + message: 'Resource not found' schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'The management key does not have permission for this request, the workspace is not owned by this account, or the workspace does not allow a person-name or address sensitive-info filter.' + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'This tracking ID is already registered' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'The tracking ID is already registered in this organization, active or not.' '500': content: application/json: @@ -41396,37 +38752,44 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Create a guardrail' + summary: 'Register an external user' tags: - - 'Guardrails' + - 'External Users' + - End Users x-speakeasy-name-override: 'create' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /guardrails/{id}: + /external-users/{user}: delete: - description: 'Delete an existing guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'deleteGuardrail' + description: 'Soft-deactivate a registration while retaining its tracking ID. Repeat deactivation succeeds. This does not block inference; reactivate through PATCH. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'deleteExternalUser' parameters: - - description: 'The unique identifier of the guardrail to delete' + - description: 'Immutable case-sensitive tracking string supplied as user on inference requests or as external.user on API keys: 1 to 512 characters, well-formed Unicode, no NUL, no surrounding whitespace. URL-encode it in resource paths; an ID of `.` or `..` cannot be addressed by path, so look it up with the list filter.' in: 'path' - name: 'id' + name: 'user' required: true schema: - description: 'The unique identifier of the guardrail to delete' - example: '550e8400-e29b-41d4-a716-446655440000' - format: 'uuid' + description: 'Immutable case-sensitive tracking string supplied as user on inference requests or as external.user on API keys: 1 to 512 characters, well-formed Unicode, no NUL, no surrounding whitespace. URL-encode it in resource paths; an ID of `.` or `..` cannot be addressed by path, so look it up with the list filter.' + example: 'employee_123' + maxLength: 512 + minLength: 1 + pattern: '^[^\u0000]+$' type: 'string' responses: - '200': + '204': + description: 'Registration is inactive.' + '400': content: application/json: example: - deleted: true + error: + code: 400 + message: 'Invalid request parameters' schema: - $ref: '#/components/schemas/DeleteGuardrailResponse' - description: 'Guardrail deleted successfully' + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' '401': content: application/json: @@ -41437,16 +38800,6 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: 'Unauthorized - Authentication required or invalid credentials' - '403': - content: - application/json: - example: - error: - code: 403 - message: 'Only management keys can perform this operation' - schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' '404': content: application/json: @@ -41467,22 +38820,25 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Delete a guardrail' + summary: 'Deactivate a registered external user' tags: - - 'Guardrails' + - 'External Users' + - End Users x-speakeasy-name-override: 'delete' get: - description: 'Get a single guardrail by ID. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'getGuardrail' + description: 'Retrieve an active or inactive registration by its URL-encoded, caller-supplied tracking ID. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'getExternalUser' parameters: - - description: 'The unique identifier of the guardrail to retrieve' + - description: 'Immutable case-sensitive tracking string supplied as user on inference requests or as external.user on API keys: 1 to 512 characters, well-formed Unicode, no NUL, no surrounding whitespace. URL-encode it in resource paths; an ID of `.` or `..` cannot be addressed by path, so look it up with the list filter.' in: 'path' - name: 'id' + name: 'user' required: true schema: - description: 'The unique identifier of the guardrail to retrieve' - example: '550e8400-e29b-41d4-a716-446655440000' - format: 'uuid' + description: 'Immutable case-sensitive tracking string supplied as user on inference requests or as external.user on API keys: 1 to 512 characters, well-formed Unicode, no NUL, no surrounding whitespace. URL-encode it in resource paths; an ID of `.` or `..` cannot be addressed by path, so look it up with the list filter.' + example: 'employee_123' + maxLength: 512 + minLength: 1 + pattern: '^[^\u0000]+$' type: 'string' responses: '200': @@ -41490,26 +38846,23 @@ paths: application/json: example: data: - allowed_models: null - allowed_providers: - - 'openai' - - 'anthropic' - - 'google' - created_at: '2025-08-24T10:30:00Z' - description: 'Guardrail for production environment' - enforce_zdr: false - id: '550e8400-e29b-41d4-a716-446655440000' - ignored_models: null - ignored_providers: null - include_byok_in_budgets: false - limit_usd: 100 - name: 'Production Guardrail' - reset_interval: 'monthly' - updated_at: '2025-08-24T15:45:00Z' - workspace_id: '0df9e665-d932-5740-b2c7-b52af166bc11' + created_at: '2026-09-16T12:00:00Z' + is_active: true + updated_at: '2026-09-16T12:00:00Z' + user: 'employee_123' schema: - $ref: '#/components/schemas/GetGuardrailResponse' - description: 'Guardrail details' + $ref: '#/components/schemas/ExternalUserResponse' + description: 'The registered external user. No generated public identifier is returned.' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' '401': content: application/json: @@ -41539,7 +38892,7 @@ paths: message: 'Resource not found' schema: $ref: '#/components/schemas/NotFoundResponse' - description: 'Guardrail not found, or the workspace default guardrail has not been configured yet.' + description: 'Not Found - Resource does not exist' '500': content: application/json: @@ -41550,33 +38903,33 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Get a guardrail' + summary: 'Get a registered external user' tags: - - 'Guardrails' + - 'External Users' + - End Users x-speakeasy-name-override: 'get' patch: - description: 'Update an existing guardrail, or materialize an unconfigured workspace default guardrail. Collection fields use replace semantics: send the full desired set on every update. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'updateGuardrail' + description: 'Update registration state without changing identity. State changes do not enforce inference access. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'updateExternalUser' parameters: - - description: 'The unique identifier of the guardrail to update' + - description: 'Immutable case-sensitive tracking string supplied as user on inference requests or as external.user on API keys: 1 to 512 characters, well-formed Unicode, no NUL, no surrounding whitespace. URL-encode it in resource paths; an ID of `.` or `..` cannot be addressed by path, so look it up with the list filter.' in: 'path' - name: 'id' + name: 'user' required: true schema: - description: 'The unique identifier of the guardrail to update' - example: '550e8400-e29b-41d4-a716-446655440000' - format: 'uuid' + description: 'Immutable case-sensitive tracking string supplied as user on inference requests or as external.user on API keys: 1 to 512 characters, well-formed Unicode, no NUL, no surrounding whitespace. URL-encode it in resource paths; an ID of `.` or `..` cannot be addressed by path, so look it up with the list filter.' + example: 'employee_123' + maxLength: 512 + minLength: 1 + pattern: '^[^\u0000]+$' type: 'string' requestBody: content: application/json: example: - description: 'Updated description' - limit_usd: 75 - name: 'Updated Guardrail Name' - reset_interval: 'weekly' + is_active: true schema: - $ref: '#/components/schemas/UpdateGuardrailRequest' + $ref: '#/components/schemas/UpdateExternalUserRequest' required: true responses: '200': @@ -41584,29 +38937,13 @@ paths: application/json: example: data: - allowed_models: null - allowed_providers: - - 'openai' - created_at: '2025-08-24T10:30:00Z' - description: 'Updated description' - enforce_zdr: null - enforce_zdr_anthropic: true - enforce_zdr_google: true - enforce_zdr_openai: true - enforce_zdr_other: true - enforce_zdr_xai: true - id: '550e8400-e29b-41d4-a716-446655440000' - ignored_models: null - ignored_providers: null - include_byok_in_budgets: true - limit_usd: 75 - name: 'Updated Guardrail Name' - reset_interval: 'weekly' - updated_at: '2025-08-24T16:00:00Z' - workspace_id: '0df9e665-d932-5740-b2c7-b52af166bc11' + created_at: '2026-09-16T12:00:00Z' + is_active: true + updated_at: '2026-09-16T12:00:00Z' + user: 'employee_123' schema: - $ref: '#/components/schemas/UpdateGuardrailResponse' - description: 'Guardrail updated successfully' + $ref: '#/components/schemas/ExternalUserResponse' + description: 'The registered external user. No generated public identifier is returned.' '400': content: application/json: @@ -41616,7 +38953,7 @@ paths: message: 'Invalid request parameters' schema: $ref: '#/components/schemas/BadRequestResponse' - description: 'Invalid request, or an attempt to change a workspace default guardrail''s name (which is derived from its workspace and not editable; sending the current name unchanged is accepted).' + description: 'Bad Request - Invalid request parameters or malformed input' '401': content: application/json: @@ -41627,16 +38964,6 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: 'Unauthorized - Authentication required or invalid credentials' - '403': - content: - application/json: - example: - error: - code: 403 - message: 'Only management keys can perform this operation' - schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'The management key does not have permission for this request, or the update would add a person-name or address sensitive-info filter to a workspace that does not allow it.' '404': content: application/json: @@ -41647,16 +38974,6 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: 'Not Found - Resource does not exist' - '409': - content: - application/json: - example: - error: - code: 409 - message: 'Resource conflict. Please try again later.' - schema: - $ref: '#/components/schemas/ConflictResponse' - description: 'Guardrail name conflict — another guardrail in this workspace already uses the requested name.' '500': content: application/json: @@ -41667,68 +38984,120 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Update a guardrail' + summary: 'Update a registered external user' tags: - - 'Guardrails' + - 'External Users' + - End Users x-speakeasy-name-override: 'update' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /guardrails/{id}/assignments/keys: + /files: get: - description: 'List all API key assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'listGuardrailKeyAssignments' + description: 'Lists files belonging to the workspace of the authenticating API key.' + operationId: 'listFiles' parameters: - - description: 'The unique identifier of the guardrail' - in: 'path' - name: 'id' - required: true + - description: 'Maximum number of files to return (1–1000).' + in: 'query' + name: 'limit' + required: false schema: - description: 'The unique identifier of the guardrail' - example: '550e8400-e29b-41d4-a716-446655440000' + description: 'Maximum number of files to return (1–1000).' + example: 100 + maximum: 1000 + minimum: 1 + type: 'integer' + - description: 'Opaque pagination cursor from a previous response.' + in: 'query' + name: 'cursor' + required: false + schema: + description: 'Opaque pagination cursor from a previous response.' + example: 'eyJjdXJzb3IiOiJvcl9maWxlXzAxMUNOaGE4aUNKY1Uxd1hOUjZxNFY4dyJ9' + type: 'string' + - description: 'Workspace to scope the request to. Defaults to the caller’s default workspace.' + in: 'query' + name: 'workspace_id' + required: false + schema: + description: 'Workspace to scope the request to. Defaults to the caller’s default workspace.' + example: 'a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7' format: 'uuid' type: 'string' - - description: 'Number of records to skip for pagination' + - description: 'Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.' + example: 'openai' in: 'query' - name: 'offset' + name: 'provider' required: false schema: - default: 0 - description: 'Number of records to skip for pagination' - example: 0 - minimum: 0 - type: - - 'integer' - - 'null' - - description: 'Maximum number of records to return (max 100)' + $ref: '#/components/schemas/FileProvider' + - description: 'OpenAI-style forward cursor: the id to list after.' in: 'query' - name: 'limit' + name: 'after' required: false schema: - default: 50 - description: 'Maximum number of records to return (max 100)' - example: 50 - maximum: 100 - minimum: 1 - type: 'integer' + description: 'OpenAI-style forward cursor: the id to list after.' + example: 'or_file_011CNha8iCJcU1wXNR6q4V8w' + type: 'string' + - description: 'Anthropic-style forward cursor: the id to list after.' + in: 'query' + name: 'after_id' + required: false + schema: + description: 'Anthropic-style forward cursor: the id to list after.' + example: 'or_file_011CNha8iCJcU1wXNR6q4V8w' + type: 'string' + - description: 'Anthropic-style reverse cursor. Not supported by OpenRouter storage.' + in: 'query' + name: 'before_id' + required: false + schema: + description: 'Anthropic-style reverse cursor. Not supported by OpenRouter storage.' + example: 'or_file_011CNha8iCJcU1wXNR6q4V8w' + type: 'string' + - description: 'Sort direction. Only `asc` is supported by OpenRouter storage.' + in: 'query' + name: 'order' + required: false + schema: + description: 'Sort direction. Only `asc` is supported by OpenRouter storage.' + enum: + - 'asc' + - 'desc' + example: 'asc' + type: 'string' + x-speakeasy-unknown-values: allow responses: '200': content: application/json: example: - data: - - assigned_by: 'user_abc123' - created_at: '2025-08-24T10:30:00Z' - guardrail_id: '550e8400-e29b-41d4-a716-446655440001' - id: '550e8400-e29b-41d4-a716-446655440000' - key_hash: 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' - key_label: 'prod-key' - key_name: 'Production Key' - total_count: 1 + cursor: null + data: + - created_at: '2025-01-01T00:00:00Z' + downloadable: false + filename: 'document.pdf' + id: 'or_file_011CNha8iCJcU1wXNR6q4V8w' + mime_type: 'application/pdf' + size_bytes: 1024000 + type: 'file' + first_id: 'or_file_011CNha8iCJcU1wXNR6q4V8w' + has_more: false + last_id: 'or_file_011CNha8iCJcU1wXNR6q4V8w' + schema: + $ref: '#/components/schemas/FileListResponse' + description: 'A page of files.' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' schema: - $ref: '#/components/schemas/ListKeyAssignmentsResponse' - description: 'List of key assignments' + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' '401': content: application/json: @@ -41749,16 +39118,16 @@ paths: schema: $ref: '#/components/schemas/ForbiddenResponse' description: 'Forbidden - Authentication successful but insufficient permissions' - '404': + '429': content: application/json: example: error: - code: 404 - message: 'Resource not found' + code: 429 + message: 'Rate limit exceeded' schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - Rate limit exceeded' '500': content: application/json: @@ -41769,52 +39138,88 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'List key assignments for a guardrail' + '502': + content: + application/json: + example: + error: + code: 502 + message: 'Provider returned error' + schema: + $ref: '#/components/schemas/BadGatewayResponse' + description: 'Bad Gateway - Provider/upstream API failure' + '503': + content: + application/json: + example: + error: + code: 503 + message: 'Service temporarily unavailable' + schema: + $ref: '#/components/schemas/ServiceUnavailableResponse' + description: 'Service Unavailable - Service temporarily unavailable' + summary: 'List files' tags: - - 'Guardrails' - x-speakeasy-name-override: 'listGuardrailKeyAssignments' + - 'Files' + x-speakeasy-name-override: 'list' x-speakeasy-pagination: inputs: - in: 'parameters' - name: 'offset' - type: 'offset' - - in: 'parameters' - name: 'limit' - type: 'limit' + name: 'cursor' + type: 'cursor' outputs: + nextCursor: '$.cursor' results: '$.data' - type: 'offsetLimit' + type: 'cursor' post: - description: 'Assign multiple API keys to a specific guardrail. A key may hold at most one guardrail; assigning replaces any existing assignment. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'bulkAssignKeysToGuardrail' + description: 'Uploads a file to be referenced in future API calls. The file is stored under the workspace of the authenticating API key. Maximum file size: 100 MB; empty files are rejected. The file type is determined from the file contents — not the filename or the declared content type — and must be a PDF, a PNG/JPEG/GIF/WebP image, a DOCX/XLSX/PPTX document, an MP3/WAV/FLAC/OGG audio file, or UTF-8 text. Text is reported by its structure as `application/json`, `application/x-ndjson`, `text/csv`, `text/markdown`, or `text/plain`.' + operationId: 'uploadFile' parameters: - - description: 'The unique identifier of the guardrail' - in: 'path' - name: 'id' - required: true + - description: 'Workspace to scope the request to. Defaults to the caller’s default workspace.' + in: 'query' + name: 'workspace_id' + required: false schema: - description: 'The unique identifier of the guardrail' - example: '550e8400-e29b-41d4-a716-446655440000' + description: 'Workspace to scope the request to. Defaults to the caller’s default workspace.' + example: 'a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7' format: 'uuid' type: 'string' + - description: 'Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.' + example: 'openai' + in: 'query' + name: 'provider' + required: false + schema: + $ref: '#/components/schemas/FileProvider' requestBody: content: - application/json: + multipart/form-data: example: - key_hashes: - - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + file: 'document.pdf' schema: - $ref: '#/components/schemas/BulkAssignKeysRequest' + properties: + file: + format: 'binary' + type: 'string' + required: + - 'file' + type: 'object' required: true responses: '200': content: application/json: example: - assigned_count: 3 + created_at: '2025-01-01T00:00:00Z' + downloadable: false + filename: 'document.pdf' + id: 'or_file_011CNha8iCJcU1wXNR6q4V8w' + mime_type: 'application/pdf' + size_bytes: 1024000 + type: 'file' schema: - $ref: '#/components/schemas/BulkAssignKeysResponse' - description: 'Assignment result' + $ref: '#/components/schemas/FileResponse' + description: 'The uploaded file metadata.' '400': content: application/json: @@ -41844,178 +39249,115 @@ paths: message: 'Only management keys can perform this operation' schema: $ref: '#/components/schemas/ForbiddenResponse' - description: 'The management key does not have permission for this request, or the guardrail has no workspace and carries a person-name or address sensitive-info filter, and at least one target key belongs to a workspace that does not allow that filter.' - '404': - content: - application/json: - example: - error: - code: 404 - message: 'Resource not found' - schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' - '500': + description: 'Forbidden - Authentication successful but insufficient permissions' + '413': content: application/json: example: error: - code: 500 - message: 'Internal Server Error' - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - summary: 'Bulk assign keys to a guardrail' - tags: - - 'Guardrails' - x-speakeasy-name-override: 'bulkAssignKeys' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /guardrails/{id}/assignments/keys/remove: - post: - description: 'Unassign multiple API keys from a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'bulkUnassignKeysFromGuardrail' - parameters: - - description: 'The unique identifier of the guardrail' - in: 'path' - name: 'id' - required: true - schema: - description: 'The unique identifier of the guardrail' - example: '550e8400-e29b-41d4-a716-446655440000' - format: 'uuid' - type: 'string' - requestBody: - content: - application/json: - example: - key_hashes: - - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' - schema: - $ref: '#/components/schemas/BulkUnassignKeysRequest' - required: true - responses: - '200': - content: - application/json: - example: - unassigned_count: 3 + code: 413 + message: 'Request payload too large' schema: - $ref: '#/components/schemas/BulkUnassignKeysResponse' - description: 'Unassignment result' - '400': + $ref: '#/components/schemas/PayloadTooLargeResponse' + description: 'Payload Too Large - Request payload exceeds size limits' + '429': content: application/json: example: error: - code: 400 - message: 'Invalid request parameters' + code: 429 + message: 'Rate limit exceeded' schema: - $ref: '#/components/schemas/BadRequestResponse' - description: 'Bad Request - Invalid request parameters or malformed input' - '401': + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - Rate limit exceeded' + '499': content: application/json: example: error: - code: 401 - message: 'Missing Authentication header' + code: 499 + message: 'The request was cancelled.' schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '403': + $ref: '#/components/schemas/ClientClosedRequestResponse' + description: 'Client Closed Request - The caller cancelled the request' + '500': content: application/json: example: error: - code: 403 - message: 'Only management keys can perform this operation' + code: 500 + message: 'Internal Server Error' schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' - '404': + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + '502': content: application/json: example: error: - code: 404 - message: 'Resource not found' + code: 502 + message: 'Provider returned error' schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' - '500': + $ref: '#/components/schemas/BadGatewayResponse' + description: 'Bad Gateway - Provider/upstream API failure' + '503': content: application/json: example: error: - code: 500 - message: 'Internal Server Error' + code: 503 + message: 'Service temporarily unavailable' schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - summary: 'Bulk unassign keys from a guardrail' + $ref: '#/components/schemas/ServiceUnavailableResponse' + description: 'Service Unavailable - Service temporarily unavailable' + summary: 'Upload a file' tags: - - 'Guardrails' - x-speakeasy-name-override: 'bulkUnassignKeys' + - 'Files' + x-speakeasy-name-override: 'upload' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /guardrails/{id}/assignments/members: - get: - description: 'List all organization member assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'listGuardrailMemberAssignments' + /files/{file_id}: + delete: + description: 'Deletes a file owned by the requesting workspace. Deletion is irreversible.' + operationId: 'deleteFile' parameters: - - description: 'The unique identifier of the guardrail' - in: 'path' - name: 'id' + - in: 'path' + name: 'file_id' required: true schema: - description: 'The unique identifier of the guardrail' - example: '550e8400-e29b-41d4-a716-446655440000' - format: 'uuid' + example: 'or_file_011CNha8iCJcU1wXNR6q4V8w' + maxLength: 256 + minLength: 1 + pattern: '^[\w-]+$' type: 'string' - - description: 'Number of records to skip for pagination' + - description: 'Workspace to scope the request to. Defaults to the caller’s default workspace.' in: 'query' - name: 'offset' + name: 'workspace_id' required: false schema: - default: 0 - description: 'Number of records to skip for pagination' - example: 0 - minimum: 0 - type: - - 'integer' - - 'null' - - description: 'Maximum number of records to return (max 100)' + description: 'Workspace to scope the request to. Defaults to the caller’s default workspace.' + example: 'a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7' + format: 'uuid' + type: 'string' + - description: 'Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.' + example: 'openai' in: 'query' - name: 'limit' + name: 'provider' required: false schema: - default: 50 - description: 'Maximum number of records to return (max 100)' - example: 50 - maximum: 100 - minimum: 1 - type: 'integer' + $ref: '#/components/schemas/FileProvider' responses: '200': content: application/json: example: - data: - - assigned_by: 'user_abc123' - created_at: '2025-08-24T10:30:00Z' - guardrail_id: '550e8400-e29b-41d4-a716-446655440001' - id: '550e8400-e29b-41d4-a716-446655440000' - organization_id: 'org_xyz789' - user_id: 'user_abc123' - total_count: 1 + id: 'or_file_011CNha8iCJcU1wXNR6q4V8w' + type: 'file_deleted' schema: - $ref: '#/components/schemas/ListMemberAssignmentsResponse' - description: 'List of member assignments' + $ref: '#/components/schemas/FileDeleteResponse' + description: 'The file was deleted.' '401': content: application/json: @@ -42046,164 +39388,94 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: 'Not Found - Resource does not exist' - '500': - content: - application/json: - example: - error: - code: 500 - message: 'Internal Server Error' - schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - summary: 'List member assignments for a guardrail' - tags: - - 'Guardrails' - x-speakeasy-name-override: 'listGuardrailMemberAssignments' - x-speakeasy-pagination: - inputs: - - in: 'parameters' - name: 'offset' - type: 'offset' - - in: 'parameters' - name: 'limit' - type: 'limit' - outputs: - results: '$.data' - type: 'offsetLimit' - post: - description: 'Assign multiple organization members to a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'bulkAssignMembersToGuardrail' - parameters: - - description: 'The unique identifier of the guardrail' - in: 'path' - name: 'id' - required: true - schema: - description: 'The unique identifier of the guardrail' - example: '550e8400-e29b-41d4-a716-446655440000' - format: 'uuid' - type: 'string' - requestBody: - content: - application/json: - example: - member_user_ids: - - 'user_abc123' - - 'user_def456' - schema: - $ref: '#/components/schemas/BulkAssignMembersRequest' - required: true - responses: - '200': - content: - application/json: - example: - assigned_count: 2 - schema: - $ref: '#/components/schemas/BulkAssignMembersResponse' - description: 'Assignment result' - '400': - content: - application/json: - example: - error: - code: 400 - message: 'Invalid request parameters' - schema: - $ref: '#/components/schemas/BadRequestResponse' - description: 'Bad Request - Invalid request parameters or malformed input' - '401': + '429': content: application/json: example: error: - code: 401 - message: 'Missing Authentication header' + code: 429 + message: 'Rate limit exceeded' schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '403': + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - Rate limit exceeded' + '500': content: application/json: example: error: - code: 403 - message: 'Only management keys can perform this operation' + code: 500 + message: 'Internal Server Error' schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' - '404': + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + '502': content: application/json: example: error: - code: 404 - message: 'Resource not found' + code: 502 + message: 'Provider returned error' schema: - $ref: '#/components/schemas/NotFoundResponse' - description: 'Not Found - Resource does not exist' - '500': + $ref: '#/components/schemas/BadGatewayResponse' + description: 'Bad Gateway - Provider/upstream API failure' + '503': content: application/json: example: error: - code: 500 - message: 'Internal Server Error' + code: 503 + message: 'Service temporarily unavailable' schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - summary: 'Bulk assign members to a guardrail' + $ref: '#/components/schemas/ServiceUnavailableResponse' + description: 'Service Unavailable - Service temporarily unavailable' + summary: 'Delete a file' tags: - - 'Guardrails' - x-speakeasy-name-override: 'bulkAssignMembers' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /guardrails/{id}/assignments/members/remove: - post: - description: 'Unassign multiple organization members from a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'bulkUnassignMembersFromGuardrail' + - 'Files' + x-speakeasy-name-override: 'delete' + get: + description: 'Retrieves metadata for a single file owned by the requesting workspace.' + operationId: 'getFileMetadata' parameters: - - description: 'The unique identifier of the guardrail' - in: 'path' - name: 'id' + - in: 'path' + name: 'file_id' required: true schema: - description: 'The unique identifier of the guardrail' - example: '550e8400-e29b-41d4-a716-446655440000' + example: 'or_file_011CNha8iCJcU1wXNR6q4V8w' + maxLength: 256 + minLength: 1 + pattern: '^[\w-]+$' + type: 'string' + - description: 'Workspace to scope the request to. Defaults to the caller’s default workspace.' + in: 'query' + name: 'workspace_id' + required: false + schema: + description: 'Workspace to scope the request to. Defaults to the caller’s default workspace.' + example: 'a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7' format: 'uuid' type: 'string' - requestBody: - content: - application/json: - example: - member_user_ids: - - 'user_abc123' - - 'user_def456' - schema: - $ref: '#/components/schemas/BulkUnassignMembersRequest' - required: true + - description: 'Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.' + example: 'openai' + in: 'query' + name: 'provider' + required: false + schema: + $ref: '#/components/schemas/FileProvider' responses: '200': content: application/json: example: - unassigned_count: 2 - schema: - $ref: '#/components/schemas/BulkUnassignMembersResponse' - description: 'Unassignment result' - '400': - content: - application/json: - example: - error: - code: 400 - message: 'Invalid request parameters' + created_at: '2025-01-01T00:00:00Z' + downloadable: false + filename: 'document.pdf' + id: 'or_file_011CNha8iCJcU1wXNR6q4V8w' + mime_type: 'application/pdf' + size_bytes: 1024000 + type: 'file' schema: - $ref: '#/components/schemas/BadRequestResponse' - description: 'Bad Request - Invalid request parameters or malformed input' + $ref: '#/components/schemas/FileResponse' + description: 'The file metadata.' '401': content: application/json: @@ -42234,6 +39506,16 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: 'Not Found - Resource does not exist' + '429': + content: + application/json: + example: + error: + code: 429 + message: 'Rate limit exceeded' + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - Rate limit exceeded' '500': content: application/json: @@ -42244,59 +39526,73 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Bulk unassign members from a guardrail' + '502': + content: + application/json: + example: + error: + code: 502 + message: 'Provider returned error' + schema: + $ref: '#/components/schemas/BadGatewayResponse' + description: 'Bad Gateway - Provider/upstream API failure' + '503': + content: + application/json: + example: + error: + code: 503 + message: 'Service temporarily unavailable' + schema: + $ref: '#/components/schemas/ServiceUnavailableResponse' + description: 'Service Unavailable - Service temporarily unavailable' + summary: 'Get file metadata' tags: - - 'Guardrails' - x-speakeasy-name-override: 'bulkUnassignMembers' + - 'Files' + x-speakeasy-name-override: 'retrieve' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /guardrails/assignments/keys: + /files/{file_id}/content: get: - description: 'List all API key guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'listKeyAssignments' + description: 'Downloads the raw bytes of a file. Only files created server-side are downloadable; uploaded files return 400.' + operationId: 'downloadFileContent' parameters: - - description: 'Number of records to skip for pagination' + - in: 'path' + name: 'file_id' + required: true + schema: + example: 'or_file_011CNha8iCJcU1wXNR6q4V8w' + maxLength: 256 + minLength: 1 + pattern: '^[\w-]+$' + type: 'string' + - description: 'Workspace to scope the request to. Defaults to the caller’s default workspace.' in: 'query' - name: 'offset' + name: 'workspace_id' required: false schema: - default: 0 - description: 'Number of records to skip for pagination' - example: 0 - minimum: 0 - type: - - 'integer' - - 'null' - - description: 'Maximum number of records to return (max 100)' + description: 'Workspace to scope the request to. Defaults to the caller’s default workspace.' + example: 'a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7' + format: 'uuid' + type: 'string' + - description: 'Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.' + example: 'openai' in: 'query' - name: 'limit' + name: 'provider' required: false schema: - default: 50 - description: 'Maximum number of records to return (max 100)' - example: 50 - maximum: 100 - minimum: 1 - type: 'integer' + $ref: '#/components/schemas/FileProvider' responses: '200': content: - application/json: - example: - data: - - assigned_by: 'user_abc123' - created_at: '2025-08-24T10:30:00Z' - guardrail_id: '550e8400-e29b-41d4-a716-446655440001' - id: '550e8400-e29b-41d4-a716-446655440000' - key_hash: 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' - key_label: 'prod-key' - key_name: 'Production Key' - total_count: 1 + application/octet-stream: + example: 'binary file contents' schema: - $ref: '#/components/schemas/ListKeyAssignmentsResponse' - description: 'List of key assignments' + format: 'binary' + type: 'string' + description: 'The raw file content.' '400': content: application/json: @@ -42337,6 +39633,16 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: 'Not Found - Resource does not exist' + '429': + content: + application/json: + example: + error: + code: 429 + message: 'Rate limit exceeded' + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - Rate limit exceeded' '500': content: application/json: @@ -42347,69 +39653,100 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'List all key assignments' + '502': + content: + application/json: + example: + error: + code: 502 + message: 'Provider returned error' + schema: + $ref: '#/components/schemas/BadGatewayResponse' + description: 'Bad Gateway - Provider/upstream API failure' + '503': + content: + application/json: + example: + error: + code: 503 + message: 'Service temporarily unavailable' + schema: + $ref: '#/components/schemas/ServiceUnavailableResponse' + description: 'Service Unavailable - Service temporarily unavailable' + summary: 'Download file content' tags: - - 'Guardrails' - x-speakeasy-name-override: 'listKeyAssignments' - x-speakeasy-pagination: - inputs: - - in: 'parameters' - name: 'offset' - type: 'offset' - - in: 'parameters' - name: 'limit' - type: 'limit' - outputs: - results: '$.data' - type: 'offsetLimit' + - 'Files' + x-speakeasy-name-override: 'download' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /guardrails/assignments/members: + /generation: get: - description: 'List all organization member guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.' - operationId: 'listMemberAssignments' + operationId: 'getGeneration' parameters: - - description: 'Number of records to skip for pagination' - in: 'query' - name: 'offset' - required: false - schema: - default: 0 - description: 'Number of records to skip for pagination' - example: 0 - minimum: 0 - type: - - 'integer' - - 'null' - - description: 'Maximum number of records to return (max 100)' + - description: 'The generation ID' in: 'query' - name: 'limit' - required: false + name: 'id' + required: true schema: - default: 50 - description: 'Maximum number of records to return (max 100)' - example: 50 - maximum: 100 - minimum: 1 - type: 'integer' + description: 'The generation ID' + example: 'gen-1234567890' + maxLength: 128 + pattern: '^gen-[0-9A-Za-z-]+$' + type: 'string' responses: '200': content: application/json: example: data: - - assigned_by: 'user_abc123' - created_at: '2025-08-24T10:30:00Z' - guardrail_id: '550e8400-e29b-41d4-a716-446655440001' - id: '550e8400-e29b-41d4-a716-446655440000' - organization_id: 'org_xyz789' - user_id: 'user_abc123' - total_count: 1 + api_type: 'completions' + app_id: 12345 + cache_discount: null + cancelled: false + created_at: '2024-07-15T23:33:19.433273+00:00' + data_region: 'global' + external_user: 'user-123' + finish_reason: 'stop' + generation_time: 1200 + http_referer: 'https://openrouter.ai/' + id: 'gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG' + is_byok: false + latency: 1250 + model: 'sao10k/l3-stheno-8b' + moderation_latency: 50 + native_finish_reason: 'stop' + native_tokens_cached: 3 + native_tokens_completion: 25 + native_tokens_completion_images: 0 + native_tokens_prompt: 10 + native_tokens_reasoning: 5 + num_fetches: 0 + num_input_audio_prompt: 0 + num_media_completion: 0 + num_media_prompt: 1 + num_search_results: 5 + origin: 'https://openrouter.ai/' + preset_id: 'a9e8d400-592a-494f-908c-375efa66cafd' + provider_name: 'Infermatic' + provider_responses: null + request_id: 'req-1727282430-aBcDeFgHiJkLmNoPqRsT' + router: 'openrouter/auto' + service_tier: 'priority' + session_id: null + streamed: true + tokens_completion: 25 + tokens_prompt: 10 + total_cost: 0.0015 + upstream_id: 'chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946' + upstream_inference_cost: 0.0012 + usage: 0.0015 + user_agent: 'Mozilla/5.0' + web_search_engine: 'exa' schema: - $ref: '#/components/schemas/ListMemberAssignmentsResponse' - description: 'List of member assignments' + $ref: '#/components/schemas/GenerationResponse' + description: 'Returns the request metadata for this generation' '400': content: application/json: @@ -42430,16 +39767,26 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: 'Unauthorized - Authentication required or invalid credentials' + '402': + content: + application/json: + example: + error: + code: 402 + message: 'Insufficient credits. Add more using https://openrouter.ai/credits' + schema: + $ref: '#/components/schemas/PaymentRequiredResponse' + description: 'Payment Required - Insufficient credits or quota to complete request' '403': content: application/json: example: error: code: 403 - message: 'Only management keys can perform this operation' + message: 'Management key does not have permission for this request' schema: $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' + description: 'Forbidden - The management key does not have permission for this request' '404': content: application/json: @@ -42450,6 +39797,16 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: 'Not Found - Resource does not exist' + '429': + content: + application/json: + example: + error: + code: 429 + message: 'Rate limit exceeded' + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - Rate limit exceeded' '500': content: application/json: @@ -42460,63 +39817,74 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'List all member assignments' + '502': + content: + application/json: + example: + error: + code: 502 + message: 'Provider returned error' + schema: + $ref: '#/components/schemas/BadGatewayResponse' + description: 'Bad Gateway - Provider/upstream API failure' + '524': + content: + application/json: + example: + error: + code: 524 + message: 'Request timed out. Please try again later.' + schema: + $ref: '#/components/schemas/EdgeNetworkTimeoutResponse' + description: 'Infrastructure Timeout - Provider request timed out at edge network' + '529': + content: + application/json: + example: + error: + code: 529 + message: 'Provider returned error' + schema: + $ref: '#/components/schemas/ProviderOverloadedResponse' + description: 'Provider Overloaded - Provider is temporarily overloaded' + summary: 'Get request & usage metadata for a generation' tags: - - 'Guardrails' - x-speakeasy-name-override: 'listMemberAssignments' - x-speakeasy-pagination: - inputs: - - in: 'parameters' - name: 'offset' - type: 'offset' - - in: 'parameters' - name: 'limit' - type: 'limit' - outputs: - results: '$.data' - type: 'offsetLimit' + - 'Generations' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /images: - post: - description: 'Generates an image from a text prompt via the image generation router' - operationId: 'createImages' - requestBody: - content: - application/json: - example: - model: 'bytedance-seed/seedream-4.5' - prompt: 'a red panda astronaut floating in space, studio lighting' - schema: - $ref: '#/components/schemas/ImageGenerationRequest' - required: true + /generation/content: + get: + operationId: 'listGenerationContent' + parameters: + - description: 'The generation ID' + in: 'query' + name: 'id' + required: true + schema: + description: 'The generation ID' + example: 'gen-1234567890' + maxLength: 128 + pattern: '^gen-[0-9A-Za-z-]+$' + type: 'string' responses: '200': content: application/json: - example: - created: 1748372400 - data: - - b64_json: '' - usage: - completion_tokens: 4175 - cost: 0.04 - prompt_tokens: 0 - total_tokens: 4175 - schema: - $ref: '#/components/schemas/ImageGenerationResponse' - text/event-stream: example: data: - b64_json: '' - partial_image_index: 0 - type: 'image_generation.partial_image' + error: null + input: + messages: + - content: 'What is the meaning of life?' + role: 'user' + output: + completion: 'The meaning of life is a philosophical question...' + reasoning: null schema: - $ref: '#/components/schemas/ImageStreamingResponse' - x-speakeasy-sse-sentinel: '[DONE]' - description: 'Image generation response' + $ref: '#/components/schemas/GenerationContentResponse' + description: 'Returns the stored prompt and completion content, plus the failure error when the generation failed' '400': content: application/json: @@ -42537,16 +39905,6 @@ paths: schema: $ref: '#/components/schemas/UnauthorizedResponse' description: 'Unauthorized - Authentication required or invalid credentials' - '402': - content: - application/json: - example: - error: - code: 402 - message: 'Insufficient credits. Add more using https://openrouter.ai/credits' - schema: - $ref: '#/components/schemas/PaymentRequiredResponse' - description: 'Payment Required - Insufficient credits or quota to complete request' '403': content: application/json: @@ -42567,16 +39925,6 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: 'Not Found - Resource does not exist' - '413': - content: - application/json: - example: - error: - code: 413 - message: 'Request payload too large' - schema: - $ref: '#/components/schemas/PayloadTooLargeResponse' - description: 'Payload Too Large - Request payload exceeds size limits' '429': content: application/json: @@ -42627,110 +39975,57 @@ paths: schema: $ref: '#/components/schemas/ProviderOverloadedResponse' description: 'Provider Overloaded - Provider is temporarily overloaded' - summary: 'Generate an image' + summary: 'Get stored prompt, completion, and error content for a generation' tags: - - 'Images' - x-speakeasy-name-override: 'generate' + - 'Generations' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /images/models: - get: - description: 'Lists every image generation model with its top-level supported-parameter superset and a URL to its full per-endpoint records.' - operationId: 'listImageModels' + /generation/feedback: + post: + description: 'Submit structured feedback on a generation the authenticated user made. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'submitGenerationFeedback' + requestBody: + content: + application/json: + example: + category: 'incorrect_response' + comment: 'The model repeated the same paragraph three times.' + generation_id: 'gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG' + schema: + $ref: '#/components/schemas/SubmitGenerationFeedbackRequest' + required: true responses: '200': content: application/json: example: data: - - architecture: - input_modalities: - - 'text' - output_modalities: - - 'image' - created: 1692901234 - description: 'A text-to-image model.' - endpoints: '/api/v1/images/models/bytedance-seed/seedream-4.5/endpoints' - id: 'bytedance-seed/seedream-4.5' - name: 'Seedream 4.5' - supported_parameters: - resolution: - type: 'enum' - values: - - '1K' - - '2K' - - '4K' - supports_streaming: false + success: true schema: - $ref: '#/components/schemas/ImageModelsListResponse' - description: 'List of image generation models' - '500': + $ref: '#/components/schemas/SubmitGenerationFeedbackResponse' + description: 'Feedback recorded successfully' + '400': content: application/json: example: error: - code: 500 - message: 'Internal Server Error' + code: 400 + message: 'Invalid request parameters' schema: - $ref: '#/components/schemas/InternalServerResponse' - description: 'Internal Server Error - Unexpected server error' - summary: 'List image generation models' - tags: - - 'Images' - x-speakeasy-name-override: 'listModels' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /images/models/{author}/{slug}/endpoints: - get: - description: 'Returns the full per-endpoint records for an image model: each endpoint''s definitive supported parameters, pricing, and passthrough allowlist.' - operationId: 'listImageModelEndpoints' - parameters: - - description: 'Model author/organization' - in: 'path' - name: 'author' - required: true - schema: - description: 'Model author/organization' - example: 'bytedance-seed' - type: 'string' - - description: 'Model slug' - in: 'path' - name: 'slug' - required: true - schema: - description: 'Model slug' - example: 'seedream-4.5' - type: 'string' - responses: - '200': + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': content: application/json: example: - endpoints: - - allowed_passthrough_parameters: [] - pricing: - - billable: 'output_image' - cost_usd: 0.05 - unit: 'image' - provider_name: 'Bytedance' - provider_slug: 'bytedance' - provider_tag: 'bytedance' - supported_parameters: - resolution: - type: 'enum' - values: - - '1K' - - '2K' - - '4K' - supports_streaming: false - id: 'bytedance-seed/seedream-4.5' + error: + code: 401 + message: 'Missing Authentication header' schema: - $ref: '#/components/schemas/ImageModelEndpointsResponse' - description: 'The full per-endpoint records for an image model' + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' '404': content: application/json: @@ -42741,6 +40036,26 @@ paths: schema: $ref: '#/components/schemas/NotFoundResponse' description: 'Not Found - Resource does not exist' + '409': + content: + application/json: + example: + error: + code: 409 + message: 'Feedback was already submitted for this generation' + schema: + $ref: '#/components/schemas/ConflictResponse' + description: 'Conflict - Feedback was already submitted for this generation by this account. The first submission is kept.' + '429': + content: + application/json: + example: + error: + code: 429 + message: 'Rate limit exceeded' + schema: + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - Rate limit exceeded' '500': content: application/json: @@ -42751,69 +40066,49 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'List endpoints for an image model' + summary: 'Submit feedback for a generation' tags: - - 'Images' - x-speakeasy-name-override: 'listModelEndpoints' + - 'Generations' + x-speakeasy-name-override: 'submitFeedback' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /interns: + /guardrails: get: - description: 'Lists interns visible to the authenticated key, newest first. Filter by workspace and one or more lifecycle statuses. The API key selects the caller, workspace and visible interns. An intern''s own API key sees only that intern: the collection and every other intern answer 404 to it. 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: 'listInterns' + description: 'List all guardrails for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'listGuardrails' parameters: - - description: 'Maximum number of interns to return, from 1 through 500.' - in: 'query' - name: 'limit' - required: false - schema: - description: 'Maximum number of interns to return, from 1 through 500.' - example: 50 - maximum: 500 - minimum: 1 - type: 'integer' - - description: 'Comma-separated lifecycle statuses to include, at most 8. Repeats are collapsed.' - explode: false + - description: 'Number of records to skip for pagination' in: 'query' - name: 'status' + name: 'offset' required: false schema: - description: 'Comma-separated lifecycle statuses to include, at most 8. Repeats are collapsed.' - example: - - 'queued' - - 'running' - items: - enum: - - 'awaiting_slack_install' - - 'queued' - - 'provisioning' - - 'running' - - 'failed' - - 'stopped' - - 'destroying' - - 'destroy_failed' - type: 'string' - x-speakeasy-unknown-values: allow - maxItems: 8 - type: 'array' - style: 'form' - - description: 'The opaque `next_cursor` of the previous page. Returns the interns that come after it in the newest-first order. A malformed cursor is a 400.' + default: 0 + description: 'Number of records to skip for pagination' + example: 0 + minimum: 0 + type: + - 'integer' + - 'null' + - description: 'Maximum number of records to return (max 100)' in: 'query' - name: 'starting_after' + name: 'limit' required: false schema: - description: 'The opaque `next_cursor` of the previous page. Returns the interns that come after it in the newest-first order. A malformed cursor is a 400.' - example: 'MjAyNi0wOS0xNlQwODozMDowMC4wMDAwMDBafDdjOWU2Njc5LTc0MjUtNDBkZS05NDRiLWUwN2ZjMWY5MGFlNw' - type: 'string' - - description: 'Only return interns in this workspace. It must match the API key workspace.' + default: 50 + description: 'Maximum number of records to return (max 100)' + example: 50 + maximum: 100 + minimum: 1 + type: 'integer' + - description: 'Filter guardrails by workspace ID. By default, guardrails in the default workspace are returned.' in: 'query' name: 'workspace_id' required: false schema: - description: 'Only return interns in this workspace. It must match the API key workspace.' - example: '89f9f5b2-3f89-4eaf-83ca-5ceae149e8bb' + description: 'Filter guardrails by workspace ID. By default, guardrails in the default workspace are returned.' + example: '0df9e665-d932-5740-b2c7-b52af166bc11' format: 'uuid' type: 'string' responses: @@ -42822,2269 +40117,1540 @@ paths: application/json: example: data: - - attached_vault_id: null - can_edit: true - created_at: '2026-09-16T08:30:00.000Z' - created_by_you: true - description: 'Researches customer questions' - hostname: 'research-assistant.openrouter.ai' - icon_sha256: null - id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' - instructions: null - last_failure_message: null - model: 'openai/gpt-5.4' - name: 'research-assistant' - progress: null - status: 'running' - updated_at: '2026-09-16T08:45:00.000Z' - vault_id: 'b431c59d-6eed-41ac-bc89-9a89be79a121' - workspace_id: '89f9f5b2-3f89-4eaf-83ca-5ceae149e8bb' - has_more: false + - allowed_models: null + allowed_providers: + - 'openai' + - 'anthropic' + - 'google' + created_at: '2025-08-24T10:30:00Z' + description: 'Guardrail for production environment' + enforce_zdr: false + id: '550e8400-e29b-41d4-a716-446655440000' + ignored_models: null + ignored_providers: null + include_byok_in_budgets: false + limit_usd: 100 + name: 'Production Guardrail' + reset_interval: 'monthly' + updated_at: '2025-08-24T15:45:00Z' + workspace_id: '0df9e665-d932-5740-b2c7-b52af166bc11' + total_count: 1 schema: - $ref: '#/components/schemas/InternListResponse' - description: 'Interns matching the filters.' + $ref: '#/components/schemas/ListGuardrailsResponse' + description: 'List of guardrails' '400': content: application/json: example: error: code: 400 - message: 'Invalid list query' - metadata: - reason: 'invalid_body' - retryable: false + message: 'Invalid request parameters' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The list filters are invalid.' + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' '401': content: application/json: example: error: code: 401 - message: 'Invalid or missing API key' + message: 'Missing Authentication header' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'Missing, unknown or provisioning API key.' + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' '403': content: application/json: example: error: code: 403 - message: 'Forbidden' - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The key owner no longer has access, or the request used a regional hostname.' - '404': - content: - application/json: - example: - error: - code: 404 - message: 'Intern not found' - metadata: - reason: 'not_found' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The caller is outside the Intern API programme, or the intern is hidden.' - '408': - content: - application/json: - example: - error: - code: 408 - message: 'Operation timed out after 10s. Please try again later.' - metadata: - reason: 'timeout' - retryable: true + message: 'Only management keys can perform this operation' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request exceeded its route deadline. The deadline quoted in the message is the route''s own, so it differs between operations.' + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' '500': content: application/json: example: error: code: 500 - message: 'The request could not be completed' - metadata: - reason: 'internal_error' - retryable: true + message: 'Internal Server Error' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request could not be completed. `metadata.reason` says whether to try again: `internal_error` is a transient failure and carries `metadata.retryable: true`, so the same request may be sent again, while `configuration_error` carries `retryable: false` because the next attempt reads the same missing binding or unusable stored credential.' - security: - - apiKey: [] - summary: 'List interns' + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'List guardrails' tags: - - 'Interns' + - 'Guardrails' + x-speakeasy-name-override: 'list' + x-speakeasy-pagination: + inputs: + - in: 'parameters' + name: 'offset' + type: 'offset' + - in: 'parameters' + name: 'limit' + type: 'limit' + outputs: + results: '$.data' + type: 'offsetLimit' post: - description: 'Creates an intern in an explicit workspace. The operation also creates its private vault. It can start provisioning immediately or wait for a later provision call. A retry with the same idempotency key and body resumes unfinished work. The request body is capped at 1048576 bytes and a larger body is refused with 413. A non-empty body must declare `Content-Type: application/json` or it is refused with 415. The API key selects the caller, workspace and visible interns. An intern''s own API key sees only that intern: the collection and every other intern answer 404 to it. 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: 'createIntern' - parameters: - - description: 'Key that makes retries resume the same create operation, from 1 through 255 characters. An empty or longer key is refused with 400. Without the header, the server derives a stable key from the request body.' - in: 'header' - name: 'Idempotency-Key' - required: false - schema: - description: 'Key that makes retries resume the same create operation, from 1 through 255 characters. An empty or longer key is refused with 400. Without the header, the server derives a stable key from the request body.' - example: 'create-research-assistant-2026-09-16' - maxLength: 255 - minLength: 1 - type: 'string' + description: 'Create a new guardrail for the authenticated user. A newly created guardrail enforces nothing until it is assigned to API keys or organization members; `workspace_id` places the guardrail in a workspace but does not apply it to that workspace''s traffic. To restrict all traffic in a workspace, update the workspace''s default guardrail instead. Set `allowed_data_regions` to enforce [In-Region Routing](/docs/guides/features/in-region-routing#enforcing-in-region-routing-with-guardrails): governed requests must arrive through one of the listed OpenRouter domains and are rejected with a 403 otherwise. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'createGuardrail' requestBody: content: application/json: example: - name: 'research-assistant' - provision: true - workspace_id: '89f9f5b2-3f89-4eaf-83ca-5ceae149e8bb' + allowed_data_regions: + - 'europe' + allowed_models: null + allowed_providers: + - 'openai' + - 'anthropic' + - 'deepseek' + description: 'A guardrail for limiting API usage' + enforce_zdr_anthropic: true + enforce_zdr_google: false + enforce_zdr_openai: true + enforce_zdr_other: false + enforce_zdr_xai: false + ignored_models: null + ignored_providers: null + limit_usd: 50 + name: 'My New Guardrail' + reset_interval: 'monthly' schema: - $ref: '#/components/schemas/CreateInternRequest' + $ref: '#/components/schemas/CreateGuardrailRequest' required: true responses: - '200': - content: - application/json: - example: - attached_vault_id: null - can_edit: true - created_at: '2026-09-16T08:30:00.000Z' - created_by_you: true - description: 'Researches customer questions' - hostname: 'research-assistant.openrouter.ai' - icon_sha256: null - id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' - instructions: null - last_failure_message: null - model: 'openai/gpt-5.4' - name: 'research-assistant' - progress: null - status: 'running' - updated_at: '2026-09-16T08:45:00.000Z' - vault_id: 'b431c59d-6eed-41ac-bc89-9a89be79a121' - workspace_id: '89f9f5b2-3f89-4eaf-83ca-5ceae149e8bb' - schema: - $ref: '#/components/schemas/Intern' - description: 'A completed create operation was replayed.' '201': content: application/json: example: - attached_vault_id: null - can_edit: true - created_at: '2026-09-16T08:30:00.000Z' - created_by_you: true - description: 'Researches customer questions' - hostname: 'research-assistant.openrouter.ai' - icon_sha256: null - id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' - instructions: null - last_failure_message: null - model: 'openai/gpt-5.4' - name: 'research-assistant' - progress: null - status: 'running' - updated_at: '2026-09-16T08:45:00.000Z' - vault_id: 'b431c59d-6eed-41ac-bc89-9a89be79a121' - workspace_id: '89f9f5b2-3f89-4eaf-83ca-5ceae149e8bb' - schema: - $ref: '#/components/schemas/Intern' - description: 'Intern created.' + data: + allowed_models: null + allowed_providers: + - 'openai' + - 'anthropic' + - 'google' + created_at: '2025-08-24T10:30:00Z' + description: 'A guardrail for limiting API usage' + enforce_zdr: null + enforce_zdr_anthropic: true + enforce_zdr_google: false + enforce_zdr_openai: true + enforce_zdr_other: false + enforce_zdr_xai: false + id: '550e8400-e29b-41d4-a716-446655440000' + ignored_models: null + ignored_providers: null + include_byok_in_budgets: false + limit_usd: 50 + name: 'My New Guardrail' + reset_interval: 'monthly' + updated_at: null + workspace_id: '0df9e665-d932-5740-b2c7-b52af166bc11' + schema: + $ref: '#/components/schemas/CreateGuardrailResponse' + description: 'Guardrail created successfully' '400': content: application/json: example: error: code: 400 - message: 'Invalid request body' - metadata: - reason: 'invalid_body' - retryable: false + message: 'Invalid request parameters' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request body is invalid.' + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' '401': content: application/json: example: error: code: 401 - message: 'Invalid or missing API key' + message: 'Missing Authentication header' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'Missing, unknown or provisioning API key.' + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' '403': - content: - application/json: - examples: - lifecycle_writes_disabled: - value: - error: - code: 403 - message: 'Intern lifecycle writes are not enabled for this account' - metadata: - reason: 'lifecycle_writes_disabled' - retryable: false - no_acting_user: - value: - error: - code: 403 - message: 'This key acts as the organization and has no member to own a new intern' - metadata: - reason: 'no_acting_user' - retryable: false - workspace_capability_unavailable: - value: - error: - code: 403 - message: 'This feature is not available in this workspace.' - metadata: - reason: 'workspace_capability_unavailable' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The key acts as an organization and has no member who can own the intern, the workspace does not allow interns, lifecycle writes are not enabled for the caller, or regional access is refused.' - '404': - content: - application/json: - example: - error: - code: 404 - message: 'Intern not found' - metadata: - reason: 'not_found' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The caller is outside the Intern API programme, or the intern is hidden.' - '408': - content: - application/json: - example: - error: - code: 408 - message: 'Operation timed out after 10s. Please try again later.' - metadata: - reason: 'timeout' - retryable: true - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request exceeded its route deadline. The deadline quoted in the message is the route''s own, so it differs between operations.' - '409': - content: - application/json: - examples: - idempotency_key_reused: - value: - error: - code: 409 - message: 'This Idempotency-Key was already used with a different request' - metadata: - reason: 'idempotency_key_reused' - retryable: false - name_taken: - value: - error: - code: 409 - message: 'An intern named "research-assistant" already exists in this workspace' - metadata: - reason: 'name_taken' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The idempotency key was reused, the intern name is already taken in the workspace, the member reached the intern limit, or the requested vault cannot be attached.' - '413': - content: - application/json: - example: - error: - code: 413 - message: 'Request body exceeds 1048576 bytes' - metadata: - reason: 'payload_too_large' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request body is larger than 1048576 bytes.' - '415': content: application/json: example: error: - code: 415 - message: 'Request body must be sent as application/json' - metadata: - reason: 'unsupported_media_type' - retryable: false + code: 403 + message: 'Only management keys can perform this operation' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request body is non-empty and its Content-Type is not application/json.' + $ref: '#/components/schemas/ForbiddenResponse' + description: 'The management key does not have permission for this request, the workspace is not owned by this account, or the workspace does not allow a person-name or address sensitive-info filter.' '500': content: application/json: example: error: code: 500 - message: 'The request could not be completed' - metadata: - reason: 'internal_error' - retryable: true - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request could not be completed. `metadata.reason` says whether to try again: `internal_error` is a transient failure and carries `metadata.retryable: true`, so the same request may be sent again, while `configuration_error` carries `retryable: false` because the next attempt reads the same missing binding or unusable stored credential.' - '502': - content: - application/json: - example: - error: - code: 502 - message: 'The intern was created but setup is not ready yet, retry the request' - metadata: - reason: 'upstream_unavailable' - retryable: true + message: 'Internal Server Error' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The vault or provisioner did not complete a recoverable create step. Retry the same request.' - security: - - apiKey: [] - summary: 'Create an intern' + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Create a guardrail' tags: - - 'Interns' + - 'Guardrails' + x-speakeasy-name-override: 'create' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /interns/{internId}: + /guardrails/{id}: delete: - 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. A non-empty body must declare `Content-Type: application/json` or it is refused with 415. The API key selects the caller, workspace and visible interns. An intern''s own API key sees only that intern: the collection and every other intern answer 404 to it. 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' + description: 'Delete an existing guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'deleteGuardrail' parameters: - - description: 'ID of an intern visible to the authenticated API key.' + - description: 'The unique identifier of the guardrail to delete' in: 'path' - name: 'internId' + name: 'id' required: true schema: - description: 'ID of an intern visible to the authenticated API key.' - example: '7c9e6679-7425-40de-944b-e07fc1f90ae7' - minLength: 1 + description: 'The unique identifier of the guardrail to delete' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' type: 'string' - requestBody: - content: - application/json: - example: - acknowledge_workspace_loss: true - schema: - $ref: '#/components/schemas/DeleteInternRequest' - required: true responses: - '202': - content: - application/json: - example: - deleting: true - schema: - $ref: '#/components/schemas/DeleteInternResponse' - description: 'The operation was accepted.' - '400': + '200': content: application/json: example: - error: - code: 400 - message: 'Invalid request body' - metadata: - reason: 'invalid_body' - retryable: false + deleted: true schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request body is invalid.' + $ref: '#/components/schemas/DeleteGuardrailResponse' + description: 'Guardrail deleted successfully' '401': content: application/json: example: error: code: 401 - message: 'Invalid or missing API key' + message: 'Missing Authentication header' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'Missing, unknown or provisioning API key.' + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' '403': content: application/json: example: error: code: 403 - message: 'Intern lifecycle writes are not enabled for this account' - metadata: - reason: 'lifecycle_writes_disabled' - retryable: false + message: 'Only management keys can perform this operation' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The key owner no longer has access, the request used a regional hostname, or lifecycle writes are not enabled for the caller (`metadata.reason` is `lifecycle_writes_disabled`).' + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' '404': content: application/json: example: error: code: 404 - message: 'Intern not found' - metadata: - reason: 'not_found' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The caller is outside the Intern API programme, or the intern is hidden.' - '408': - content: - application/json: - example: - error: - code: 408 - message: 'Operation timed out after 10s. Please try again later.' - metadata: - reason: 'timeout' - retryable: true - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request exceeded its route deadline. The deadline quoted in the message is the route''s own, so it differs between operations.' - '409': - content: - application/json: - example: - error: - code: 409 - message: 'Another operation holds the intern, retry once it settles' - metadata: - reason: 'intern_busy' - retryable: true - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The intern is not in a state that allows this operation. `metadata.reason` says whether to try again: `intern_busy` means another operation still holds the intern and carries `metadata.retryable: true`, so the same request may be sent again once it settles. A duplicate delete of an intern already being deleted is not a conflict and is accepted with 202.' - '413': - content: - application/json: - example: - error: - code: 413 - message: 'Request body exceeds 1048576 bytes' - metadata: - reason: 'payload_too_large' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request body is larger than 1048576 bytes.' - '415': - content: - application/json: - example: - error: - code: 415 - message: 'Request body must be sent as application/json' - metadata: - reason: 'unsupported_media_type' - retryable: false + message: 'Resource not found' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request body is non-empty and its Content-Type is not application/json.' + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' '500': content: application/json: example: error: code: 500 - message: 'The request could not be completed' - metadata: - reason: 'internal_error' - retryable: true - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request could not be completed. `metadata.reason` says whether to try again: `internal_error` is a transient failure and carries `metadata.retryable: true`, so the same request may be sent again, while `configuration_error` carries `retryable: false` because the next attempt reads the same missing binding or unusable stored credential.' - '502': - content: - application/json: - example: - error: - code: 502 - message: 'The intern service could not be reached, retry the request' - metadata: - reason: 'upstream_unavailable' - retryable: true + message: 'Internal Server Error' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The intern service could not accept the operation.' - security: - - apiKey: [] - summary: 'Delete an intern' + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Delete a guardrail' tags: - - 'Interns' + - 'Guardrails' + x-speakeasy-name-override: 'delete' get: - description: 'Returns the public lifecycle state and settings for one visible intern. The API key selects the caller, workspace and visible interns. An intern''s own API key sees only that intern: the collection and every other intern answer 404 to it. 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: 'getIntern' + description: 'Get a single guardrail by ID. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'getGuardrail' parameters: - - description: 'ID of an intern visible to the authenticated API key.' + - description: 'The unique identifier of the guardrail to retrieve' in: 'path' - name: 'internId' + name: 'id' required: true schema: - description: 'ID of an intern visible to the authenticated API key.' - example: '7c9e6679-7425-40de-944b-e07fc1f90ae7' - minLength: 1 + description: 'The unique identifier of the guardrail to retrieve' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' type: 'string' responses: '200': content: application/json: example: - attached_vault_id: null - can_edit: true - created_at: '2026-09-16T08:30:00.000Z' - created_by_you: true - description: 'Researches customer questions' - hostname: 'research-assistant.openrouter.ai' - icon_sha256: null - id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' - instructions: null - last_failure_message: null - model: 'openai/gpt-5.4' - name: 'research-assistant' - progress: null - status: 'running' - updated_at: '2026-09-16T08:45:00.000Z' - vault_id: 'b431c59d-6eed-41ac-bc89-9a89be79a121' - workspace_id: '89f9f5b2-3f89-4eaf-83ca-5ceae149e8bb' - schema: - $ref: '#/components/schemas/Intern' - description: 'Intern lifecycle state and settings.' + data: + allowed_models: null + allowed_providers: + - 'openai' + - 'anthropic' + - 'google' + created_at: '2025-08-24T10:30:00Z' + description: 'Guardrail for production environment' + enforce_zdr: false + id: '550e8400-e29b-41d4-a716-446655440000' + ignored_models: null + ignored_providers: null + include_byok_in_budgets: false + limit_usd: 100 + name: 'Production Guardrail' + reset_interval: 'monthly' + updated_at: '2025-08-24T15:45:00Z' + workspace_id: '0df9e665-d932-5740-b2c7-b52af166bc11' + schema: + $ref: '#/components/schemas/GetGuardrailResponse' + description: 'Guardrail details' '401': content: application/json: example: error: code: 401 - message: 'Invalid or missing API key' + message: 'Missing Authentication header' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'Missing, unknown or provisioning API key.' + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' '403': content: application/json: example: error: code: 403 - message: 'Forbidden' + message: 'Only management keys can perform this operation' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The key owner no longer has access, or the request used a regional hostname.' + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' '404': content: application/json: example: error: code: 404 - message: 'Intern not found' - metadata: - reason: 'not_found' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The caller is outside the Intern API programme, or the intern is hidden.' - '408': - content: - application/json: - example: - error: - code: 408 - message: 'Operation timed out after 10s. Please try again later.' - metadata: - reason: 'timeout' - retryable: true + message: 'Resource not found' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request exceeded its route deadline. The deadline quoted in the message is the route''s own, so it differs between operations.' + $ref: '#/components/schemas/NotFoundResponse' + description: 'Guardrail not found, or the workspace default guardrail has not been configured yet.' '500': content: application/json: example: error: code: 500 - message: 'The request could not be completed' - metadata: - reason: 'internal_error' - retryable: true + message: 'Internal Server Error' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request could not be completed. `metadata.reason` says whether to try again: `internal_error` is a transient failure and carries `metadata.retryable: true`, so the same request may be sent again, while `configuration_error` carries `retryable: false` because the next attempt reads the same missing binding or unusable stored credential.' - security: - - apiKey: [] - summary: 'Get an intern' + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Get a guardrail' tags: - - 'Interns' + - 'Guardrails' + x-speakeasy-name-override: 'get' patch: - description: 'Changes the intern name, description, instructions or model. Omitted fields stay unchanged. The request body is capped at 1048576 bytes and a larger body is refused with 413. A non-empty body must declare `Content-Type: application/json` or it is refused with 415. The API key selects the caller, workspace and visible interns. An intern''s own API key sees only that intern: the collection and every other intern answer 404 to it. 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: 'updateIntern' + description: 'Update an existing guardrail, or materialize an unconfigured workspace default guardrail. Collection fields use replace semantics: send the full desired set on every update. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'updateGuardrail' parameters: - - description: 'ID of an intern visible to the authenticated API key.' + - description: 'The unique identifier of the guardrail to update' in: 'path' - name: 'internId' + name: 'id' required: true schema: - description: 'ID of an intern visible to the authenticated API key.' - example: '7c9e6679-7425-40de-944b-e07fc1f90ae7' - minLength: 1 + description: 'The unique identifier of the guardrail to update' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' type: 'string' requestBody: content: application/json: example: - description: 'Researches customer questions' - model: 'openai/gpt-5.4' + description: 'Updated description' + limit_usd: 75 + name: 'Updated Guardrail Name' + reset_interval: 'weekly' schema: - $ref: '#/components/schemas/UpdateInternRequest' + $ref: '#/components/schemas/UpdateGuardrailRequest' required: true responses: '200': content: application/json: example: - attached_vault_id: null - can_edit: true - created_at: '2026-09-16T08:30:00.000Z' - created_by_you: true - description: 'Researches customer questions' - hostname: 'research-assistant.openrouter.ai' - icon_sha256: null - id: '7c9e6679-7425-40de-944b-e07fc1f90ae7' - instructions: null - last_failure_message: null - model: 'openai/gpt-5.4' - name: 'research-assistant' - progress: null - status: 'running' - updated_at: '2026-09-16T08:45:00.000Z' - vault_id: 'b431c59d-6eed-41ac-bc89-9a89be79a121' - workspace_id: '89f9f5b2-3f89-4eaf-83ca-5ceae149e8bb' - schema: - $ref: '#/components/schemas/Intern' - description: 'Updated intern.' + data: + allowed_models: null + allowed_providers: + - 'openai' + created_at: '2025-08-24T10:30:00Z' + description: 'Updated description' + enforce_zdr: null + enforce_zdr_anthropic: true + enforce_zdr_google: true + enforce_zdr_openai: true + enforce_zdr_other: true + enforce_zdr_xai: true + id: '550e8400-e29b-41d4-a716-446655440000' + ignored_models: null + ignored_providers: null + include_byok_in_budgets: true + limit_usd: 75 + name: 'Updated Guardrail Name' + reset_interval: 'weekly' + updated_at: '2025-08-24T16:00:00Z' + workspace_id: '0df9e665-d932-5740-b2c7-b52af166bc11' + schema: + $ref: '#/components/schemas/UpdateGuardrailResponse' + description: 'Guardrail updated successfully' '400': content: application/json: example: error: code: 400 - message: 'Invalid request body' - metadata: - reason: 'invalid_body' - retryable: false + message: 'Invalid request parameters' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request body is invalid.' + $ref: '#/components/schemas/BadRequestResponse' + description: 'Invalid request, or an attempt to change a workspace default guardrail''s name (which is derived from its workspace and not editable; sending the current name unchanged is accepted).' '401': content: application/json: example: error: code: 401 - message: 'Invalid or missing API key' + message: 'Missing Authentication header' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'Missing, unknown or provisioning API key.' + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' '403': content: application/json: example: error: code: 403 - message: 'Intern lifecycle writes are not enabled for this account' - metadata: - reason: 'lifecycle_writes_disabled' - retryable: false + message: 'Only management keys can perform this operation' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The key owner no longer has access, the request used a regional hostname, or lifecycle writes are not enabled for the caller (`metadata.reason` is `lifecycle_writes_disabled`).' + $ref: '#/components/schemas/ForbiddenResponse' + description: 'The management key does not have permission for this request, or the update would add a person-name or address sensitive-info filter to a workspace that does not allow it.' '404': content: application/json: example: error: code: 404 - message: 'Intern not found' - metadata: - reason: 'not_found' - retryable: false + message: 'Resource not found' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The caller is outside the Intern API programme, or the intern is hidden.' - '408': + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '409': content: application/json: example: error: - code: 408 - message: 'Operation timed out after 10s. Please try again later.' - metadata: - reason: 'timeout' - retryable: true + code: 409 + message: 'Resource conflict. Please try again later.' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request exceeded its route deadline. The deadline quoted in the message is the route''s own, so it differs between operations.' - '409': + $ref: '#/components/schemas/ConflictResponse' + description: 'Guardrail name conflict — another guardrail in this workspace already uses the requested name.' + '500': content: application/json: example: error: - code: 409 - message: 'An intern named "research-assistant" already exists in this workspace' - metadata: - reason: 'name_taken' - retryable: false + code: 500 + message: 'Internal Server Error' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The new name is already taken by an intern in this workspace.' - '413': + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Update a guardrail' + tags: + - 'Guardrails' + x-speakeasy-name-override: 'update' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" + /guardrails/{id}/assignments/keys: + get: + description: 'List all API key assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'listGuardrailKeyAssignments' + parameters: + - description: 'The unique identifier of the guardrail' + in: 'path' + name: 'id' + required: true + schema: + description: 'The unique identifier of the guardrail' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' + type: 'string' + - description: 'Number of records to skip for pagination' + in: 'query' + name: 'offset' + required: false + schema: + default: 0 + description: 'Number of records to skip for pagination' + example: 0 + minimum: 0 + type: + - 'integer' + - 'null' + - description: 'Maximum number of records to return (max 100)' + in: 'query' + name: 'limit' + required: false + schema: + default: 50 + description: 'Maximum number of records to return (max 100)' + example: 50 + maximum: 100 + minimum: 1 + type: 'integer' + responses: + '200': + content: + application/json: + example: + data: + - assigned_by: 'user_abc123' + created_at: '2025-08-24T10:30:00Z' + guardrail_id: '550e8400-e29b-41d4-a716-446655440001' + id: '550e8400-e29b-41d4-a716-446655440000' + key_hash: 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + key_label: 'prod-key' + key_name: 'Production Key' + total_count: 1 + schema: + $ref: '#/components/schemas/ListKeyAssignmentsResponse' + description: 'List of key assignments' + '401': content: application/json: example: error: - code: 413 - message: 'Request body exceeds 1048576 bytes' - metadata: - reason: 'payload_too_large' - retryable: false + code: 401 + message: 'Missing Authentication header' + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': + content: + application/json: + example: + error: + code: 403 + message: 'Only management keys can perform this operation' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request body is larger than 1048576 bytes.' - '415': + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': content: application/json: example: error: - code: 415 - message: 'Request body must be sent as application/json' - metadata: - reason: 'unsupported_media_type' - retryable: false + code: 404 + message: 'Resource not found' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request body is non-empty and its Content-Type is not application/json.' + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' '500': content: application/json: example: error: code: 500 - message: 'The request could not be completed' - metadata: - reason: 'internal_error' - retryable: true + message: 'Internal Server Error' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request could not be completed. `metadata.reason` says whether to try again: `internal_error` is a transient failure and carries `metadata.retryable: true`, so the same request may be sent again, while `configuration_error` carries `retryable: false` because the next attempt reads the same missing binding or unusable stored credential.' - security: - - apiKey: [] - summary: 'Update an intern' + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'List key assignments for a guardrail' tags: - - 'Interns' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /interns/{internId}/chat/completions: + - 'Guardrails' + x-speakeasy-name-override: 'listGuardrailKeyAssignments' + x-speakeasy-pagination: + inputs: + - in: 'parameters' + name: 'offset' + type: 'offset' + - in: 'parameters' + name: 'limit' + type: 'limit' + outputs: + results: '$.data' + type: 'offsetLimit' post: - description: "Sends a prompt to one of your interns and streams the reply as OpenAI-compatible server-sent events ending with `[DONE]`. The run executes on the intern, which may pause to ask you something. It then streams one `openrouter.provide_input` tool call and finishes with `finish_reason: \"tool_calls\"`, and the run stays open on the intern.\n\nEvery response, whether it ends with `stop`, `tool_calls` or `error`, is followed by a final chunk with empty `choices` that carries `session_id`, then `data: [DONE]`. That chunk carries the `usage` the intern reported for the run, after `stop` or `error`, and `null` when the intern reported none. After `tool_calls` its `usage` is `null` because the turn is not over. Read through `[DONE]`: the `session_id` you need to reply arrives after the `tool_calls` finish chunk.\n\nTo answer, send a second request with the same `session_id`, the assistant message echoing that tool call, and a `tool` message whose `tool_call_id` is the tool call id and whose `content` is the answer. The answer is delivered to the run that asked and the stream continues from where it paused. A question stays open for its interaction deadline (5 minutes by default) and the run is cancelled when that passes. Rejected replies do not extend the deadline.\n\nClosing the connection after the `[DONE]` that follows `finish_reason: \"tool_calls\"` keeps the run alive. Disconnecting while a response is still streaming cancels the run. The stream writes a `: keepalive` comment whenever nothing else has been written for 30 seconds, so a disconnect is noticed within that interval even while the intern is silent.\n\nA run the intern ends while you are still connected, by cancellation or by a deadline, ends the stream with a `finish_reason: \"error\"` chunk carrying `410` and reason `run_ended`, then the final empty-`choices` chunk and `[DONE]`. That error reports only an ending the intern confirmed. A connection that breaks without that confirmation ends with reason `stream_severed`, and a client that has already disconnected is promised no final event.\n\nSet `approval_mode` to `manual` to have the intern ask before approval-bearing tools such as the shell. Omitted, the run self-drives and consents on your behalf. The mode belongs to the run started by that prompt and must be repeated on later prompts.\n\nAvailable to interns programme members. Callers outside the programme receive `404` for every path under `/api/v1/interns`." - operationId: 'createInternChatCompletion' + description: 'Assign multiple API keys to a specific guardrail. A key may hold at most one guardrail; assigning replaces any existing assignment. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'bulkAssignKeysToGuardrail' parameters: - - description: 'The intern to talk to.' + - description: 'The unique identifier of the guardrail' in: 'path' - name: 'internId' + name: 'id' required: true schema: - description: 'The intern to talk to.' - example: 'a11e0000-0000-4000-8000-000000000005' + description: 'The unique identifier of the guardrail' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' type: 'string' requestBody: content: application/json: example: - approval_mode: 'manual' - messages: - - content: 'Summarize the open pull requests.' - role: 'user' - stream: true + key_hashes: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' schema: - $ref: '#/components/schemas/InternChatCompletionRequest' + $ref: '#/components/schemas/BulkAssignKeysRequest' required: true responses: '200': - content: - text/event-stream: - example: - data: - choices: - - delta: - tool_calls: - - function: - arguments: '{"kind":"permission","operation":"shell","options":["allow_once","allow_always","reject_once","reject_always"]}' - name: 'openrouter.provide_input' - id: '15e90ad6-5320-4a59-af4f-b371428154fa' - index: 0 - type: 'function' - finish_reason: null - index: 0 - created: 1789537541 - id: 'chatcmpl-f727571a-3bad-4e0d-8a9e-f18f8cda9750' - model: 'openrouter/intern' - object: 'chat.completion.chunk' - schema: - $ref: '#/components/schemas/InternChatStreamingResponse' - x-speakeasy-sse-sentinel: '[DONE]' - description: 'The streamed completion. Chunks carry text, then a finish chunk: `finish_reason: "stop"` when the turn is complete, `finish_reason: "tool_calls"` when the intern is waiting for an answer, or `finish_reason: "error"` for a failure after this status. A final chunk with empty `choices` follows in every case, carrying `session_id` and `usage` (`null` unless the intern reported usage, and always `null` after `tool_calls`), and the stream ends with `data: [DONE]`.' - '202': content: application/json: + example: + assigned_count: 3 schema: - $ref: '#/components/schemas/InternChatSteeredResponse' - description: 'A turn is already running in this `session_id`, and the message was delivered into it instead of starting a new turn. Nothing streams here: the intern takes the message up on the running turn, whose stream continues on the request that started it. Sent only for a `user` message with a `session_id`; a `tool` reply into a running session gets `409 busy`, as does a message the intern could not take. Other sessions on the same intern are not affected and run in parallel.' + $ref: '#/components/schemas/BulkAssignKeysResponse' + description: 'Assignment result' '400': content: application/json: example: error: code: 400 - message: 'The intern did not accept that answer for this tool_call_id.' - metadata: - reason: 'bad_request' - retryable: false + message: 'Invalid request parameters' schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'The body is not a valid request (`bad_request`), or the intern did not accept the answer for the pending question, such as a permission option it did not offer.' + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' '401': content: application/json: example: error: code: 401 - message: 'Invalid or missing API key' + message: 'Missing Authentication header' schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'No valid API key.' + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' '403': content: application/json: example: error: code: 403 - message: 'This API key''s creator is no longer a member of the organization. Ask an organization admin to reassign the key to an active member.' + message: 'Only management keys can perform this operation' schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'The key belongs to a member who has left the organization and holds no grant.' + $ref: '#/components/schemas/ForbiddenResponse' + description: 'The management key does not have permission for this request, or the guardrail has no workspace and carries a person-name or address sensitive-info filter, and at least one target key belongs to a workspace that does not allow that filter.' '404': content: application/json: example: error: code: 404 - message: 'No pending question has this tool_call_id.' - metadata: - reason: 'interaction_unknown' - retryable: false - schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'The caller is outside the interns programme, the intern does not exist for this key (`not_found`), or no pending question has this `tool_call_id` in this session (`interaction_unknown`).' - '408': - content: - application/json: - example: - error: - code: 408 - message: 'Operation timed out after 300s. Please try again later.' - metadata: - reason: 'timeout' - retryable: true - schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'The request exceeded the route''s own deadline before the handler answered (`timeout`). Distinct from the 504, which is the intern failing to answer within the turn budget.' - '409': - content: - application/json: - example: - error: - code: 409 - message: 'The run that asked this question has already ended.' - metadata: - reason: 'interaction_not_pending' - retryable: false - schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'The intern is not running (`intern_not_ready`), a turn is already running in this session and did not take the message within 15 seconds (`busy`, also sent when the turn is waiting on a question of its own), the question is no longer waiting (`interaction_not_pending`), or another request is already attached to the run (`attachment_failed`). Turns in different sessions on the same intern run in parallel. `intern_not_ready` and `busy` report `retryable: true`, and a `busy` refusal carries `Retry-After`.' - headers: - Retry-After: - description: 'Seconds to wait before retrying this request. Present only on a `busy` refusal.' - required: false - schema: - description: 'Seconds to wait before retrying this request. Present only on a `busy` refusal.' - example: '5' - type: 'string' - '410': - content: - application/json: - example: - error: - code: 410 - message: 'The run produced more output than the intern retains for replay.' - metadata: - reason: 'attachment_failed' - retryable: false - schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'The run produced more output than the intern retains, so the paused stream cannot be resumed (`attachment_failed`).' - '413': - content: - application/json: - example: - error: - code: 413 - message: 'Request body exceeds 1048576 bytes' - metadata: - reason: 'payload_too_large' - retryable: false - schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'The body exceeds 1 MiB (`payload_too_large`).' - '429': - content: - application/json: - example: - error: - code: 429 - message: 'Too many intern turns. Please wait a moment.' - metadata: - reason: 'rate_limited' - retryable: true - schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'Too many turns for the user or organization this key acts as (`rate_limited`). It reports `retryable: true` and carries `Retry-After`.' - headers: - Retry-After: - description: 'Seconds to wait before retrying this request.' - required: true - schema: - description: 'Seconds to wait before retrying this request.' - example: '60' - type: 'string' - '502': - content: - application/json: - example: - error: - code: 502 - message: 'The intern could not be reached.' - metadata: - reason: 'intern_unreachable' - retryable: true - schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'The intern could not be reached or rejected the request (`intern_unreachable`, `intern_rejected`), the intern refused the turn before any output (`turn_failed`), or its stream ended before the turn started (`stream_severed`). `intern_unreachable` and `stream_severed` are transient and report `retryable: true`; `intern_rejected` reports `false`. A `turn_failed` varies by failure and carries the intern''s own classification of what went wrong, so read `metadata.retryable` rather than assuming from the reason.' - '503': - content: - application/json: - example: - error: - code: 503 - message: 'The intern cannot hold another run open across a question right now. Retry later.' - metadata: - reason: 'busy' - retryable: true - schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'The intern cannot hold another run open across a question right now (`busy`). It reports `retryable: true` and carries `Retry-After`.' - headers: - Retry-After: - description: 'Seconds to wait before retrying this request.' - required: true + message: 'Resource not found' schema: - description: 'Seconds to wait before retrying this request.' - example: '5' - type: 'string' - '504': + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '500': content: application/json: example: error: - code: 504 - message: 'The intern did not answer in time.' - metadata: - reason: 'timeout' - retryable: true + code: 500 + message: 'Internal Server Error' schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'The intern did not answer within the request budget (`timeout`).' - security: - - apiKey: [] - summary: 'Stream a chat completion with an intern' + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Bulk assign keys to a guardrail' tags: - - 'Interns' - x-speakeasy-group: 'interns' - x-speakeasy-name-override: 'chat' + - 'Guardrails' + x-speakeasy-name-override: 'bulkAssignKeys' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /interns/{internId}/connections: - get: - description: 'Returns the Slack, GitHub, Google Workspace and MCP connections one visible intern can reach, and the shared ones switched off for it or disabled for the workspace. An OAuth grant needs `vault:read`, because the list names members'' personal accounts; without it the route answers 403 `insufficient_scope`. The response is sent with `Cache-Control: no-store`. The API key selects the caller, workspace and visible interns. An intern''s own API key sees only that intern: the collection and every other intern answer 404 to it. 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: 'getInternConnections' + /guardrails/{id}/assignments/keys/remove: + post: + description: 'Unassign multiple API keys from a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'bulkUnassignKeysFromGuardrail' parameters: - - description: 'ID of an intern visible to the authenticated API key.' + - description: 'The unique identifier of the guardrail' in: 'path' - name: 'internId' + name: 'id' required: true schema: - description: 'ID of an intern visible to the authenticated API key.' - example: '7c9e6679-7425-40de-944b-e07fc1f90ae7' - minLength: 1 + description: 'The unique identifier of the guardrail' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' type: 'string' + requestBody: + content: + application/json: + example: + key_hashes: + - 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + schema: + $ref: '#/components/schemas/BulkUnassignKeysRequest' + required: true responses: '200': content: application/json: example: - data: - - account: - acts_as: null - is_your_account_linked: null - note: null - scope: 'workspace' - id: 'github' - is_enabled: true - is_intern_only: false - kind: 'github' - mcp_server_name: null - name: 'GitHub' - off_reason: null - server: null - status: - reason: null - state: 'connected' - tool_count: null - schema: - $ref: '#/components/schemas/InternConnectionList' - description: 'The intern connections.' + unassigned_count: 3 + schema: + $ref: '#/components/schemas/BulkUnassignKeysResponse' + description: 'Unassignment result' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' '401': content: application/json: example: error: code: 401 - message: 'Invalid or missing API key' + message: 'Missing Authentication header' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'Missing, unknown or provisioning API key.' + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' '403': content: application/json: example: error: code: 403 - message: 'Forbidden' + message: 'Only management keys can perform this operation' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The key owner no longer has access, or the request used a regional hostname.' + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' '404': content: application/json: example: error: code: 404 - message: 'Intern not found' - metadata: - reason: 'not_found' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The caller is outside the Intern API programme, or the intern is hidden.' - '408': - content: - application/json: - example: - error: - code: 408 - message: 'Operation timed out after 10s. Please try again later.' - metadata: - reason: 'timeout' - retryable: true + message: 'Resource not found' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request exceeded its route deadline. The deadline quoted in the message is the route''s own, so it differs between operations.' + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' '500': content: application/json: example: error: code: 500 - message: 'The request could not be completed' - metadata: - reason: 'internal_error' - retryable: true + message: 'Internal Server Error' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request could not be completed. `metadata.reason` says whether to try again: `internal_error` is a transient failure and carries `metadata.retryable: true`, so the same request may be sent again, while `configuration_error` carries `retryable: false` because the next attempt reads the same missing binding or unusable stored credential.' - security: - - apiKey: [] - summary: 'List an intern''s connections' + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Bulk unassign keys from a guardrail' tags: - - 'Interns' + - 'Guardrails' + x-speakeasy-name-override: 'bulkUnassignKeys' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /interns/{internId}/daemon: + /guardrails/{id}/assignments/members: get: - description: 'Returns the origin and daemon token that attach `ori tui --host` to one visible, running intern. The token is a credential: only an OAuth-token caller (`ori login --oidc`) may read it, the response is sent with `Cache-Control: no-store`, and each reveal is logged by caller and intern. API keys get 403 `personal_identity_required`. The API key selects the caller, workspace and visible interns. An intern''s own API key sees only that intern: the collection and every other intern answer 404 to it. 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: 'getInternDaemon' + description: 'List all organization member assignments for a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'listGuardrailMemberAssignments' parameters: - - description: 'ID of an intern visible to the authenticated API key.' + - description: 'The unique identifier of the guardrail' in: 'path' - name: 'internId' + name: 'id' required: true schema: - description: 'ID of an intern visible to the authenticated API key.' - example: '7c9e6679-7425-40de-944b-e07fc1f90ae7' - minLength: 1 + description: 'The unique identifier of the guardrail' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' type: 'string' + - description: 'Number of records to skip for pagination' + in: 'query' + name: 'offset' + required: false + schema: + default: 0 + description: 'Number of records to skip for pagination' + example: 0 + minimum: 0 + type: + - 'integer' + - 'null' + - description: 'Maximum number of records to return (max 100)' + in: 'query' + name: 'limit' + required: false + schema: + default: 50 + description: 'Maximum number of records to return (max 100)' + example: 50 + maximum: 100 + minimum: 1 + type: 'integer' responses: '200': content: application/json: + example: + data: + - assigned_by: 'user_abc123' + created_at: '2025-08-24T10:30:00Z' + guardrail_id: '550e8400-e29b-41d4-a716-446655440001' + id: '550e8400-e29b-41d4-a716-446655440000' + organization_id: 'org_xyz789' + user_id: 'user_abc123' + total_count: 1 schema: - $ref: '#/components/schemas/InternDaemonAccess' - description: 'Daemon origin and token.' + $ref: '#/components/schemas/ListMemberAssignmentsResponse' + description: 'List of member assignments' '401': content: application/json: example: error: code: 401 - message: 'Invalid or missing API key' + message: 'Missing Authentication header' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'Missing, unknown or provisioning API key.' + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' '403': content: application/json: example: error: code: 403 - message: 'Forbidden' + message: 'Only management keys can perform this operation' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The key owner no longer has access, or the request used a regional hostname.' + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' '404': content: application/json: example: error: code: 404 - message: 'Intern not found' - metadata: - reason: 'not_found' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The caller is outside the Intern API programme, or the intern is hidden.' - '408': - content: - application/json: - example: - error: - code: 408 - message: 'Operation timed out after 10s. Please try again later.' - metadata: - reason: 'timeout' - retryable: true - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request exceeded its route deadline. The deadline quoted in the message is the route''s own, so it differs between operations.' - '409': - content: - application/json: - example: - error: - code: 409 - message: 'This intern is not running.' - metadata: - reason: 'intern_not_running' - retryable: false + message: 'Resource not found' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The intern cannot be attached to. `metadata.reason` is `intern_not_running`, `intern_unreachable` when it has no usable address yet, or `intern_needs_restart` when it was provisioned before daemon access was available.' + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' '500': content: application/json: example: error: code: 500 - message: 'The request could not be completed' - metadata: - reason: 'internal_error' - retryable: true + message: 'Internal Server Error' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request could not be completed. `metadata.reason` says whether to try again: `internal_error` is a transient failure and carries `metadata.retryable: true`, so the same request may be sent again, while `configuration_error` carries `retryable: false` because the next attempt reads the same missing binding or unusable stored credential.' - security: - - apiKey: [] - summary: 'Get an intern''s daemon access' + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'List member assignments for a guardrail' tags: - - 'Interns' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /interns/{internId}/daemon-access: - get: - deprecated: true - description: 'Deprecated alias of `GET /interns/{internId}/daemon` with the same request, response, and errors. The API key selects the caller, workspace and visible interns. An intern''s own API key sees only that intern: the collection and every other intern answer 404 to it. 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: 'getInternDaemonAccess' + - 'Guardrails' + x-speakeasy-name-override: 'listGuardrailMemberAssignments' + x-speakeasy-pagination: + inputs: + - in: 'parameters' + name: 'offset' + type: 'offset' + - in: 'parameters' + name: 'limit' + type: 'limit' + outputs: + results: '$.data' + type: 'offsetLimit' + post: + description: 'Assign multiple organization members to a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'bulkAssignMembersToGuardrail' parameters: - - description: 'ID of an intern visible to the authenticated API key.' + - description: 'The unique identifier of the guardrail' in: 'path' - name: 'internId' + name: 'id' required: true schema: - description: 'ID of an intern visible to the authenticated API key.' - example: '7c9e6679-7425-40de-944b-e07fc1f90ae7' - minLength: 1 + description: 'The unique identifier of the guardrail' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' type: 'string' + requestBody: + content: + application/json: + example: + member_user_ids: + - 'user_abc123' + - 'user_def456' + schema: + $ref: '#/components/schemas/BulkAssignMembersRequest' + required: true responses: '200': - content: - application/json: - schema: - $ref: '#/components/schemas/InternDaemonAccess' - description: 'Daemon origin and token.' - '401': content: application/json: example: - error: - code: 401 - message: 'Invalid or missing API key' + assigned_count: 2 schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'Missing, unknown or provisioning API key.' - '403': + $ref: '#/components/schemas/BulkAssignMembersResponse' + description: 'Assignment result' + '400': content: application/json: example: error: - code: 403 - message: 'Forbidden' + code: 400 + message: 'Invalid request parameters' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The key owner no longer has access, or the request used a regional hostname.' - '404': + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': content: application/json: example: error: - code: 404 - message: 'Intern not found' - metadata: - reason: 'not_found' - retryable: false + code: 401 + message: 'Missing Authentication header' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The caller is outside the Intern API programme, or the intern is hidden.' - '408': + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': content: application/json: example: error: - code: 408 - message: 'Operation timed out after 10s. Please try again later.' - metadata: - reason: 'timeout' - retryable: true + code: 403 + message: 'Only management keys can perform this operation' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request exceeded its route deadline. The deadline quoted in the message is the route''s own, so it differs between operations.' - '409': + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': content: application/json: example: error: - code: 409 - message: 'This intern is not running.' - metadata: - reason: 'intern_not_running' - retryable: false + code: 404 + message: 'Resource not found' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The intern cannot be attached to. `metadata.reason` is `intern_not_running`, `intern_unreachable` when it has no usable address yet, or `intern_needs_restart` when it was provisioned before daemon access was available.' + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' '500': content: application/json: example: error: code: 500 - message: 'The request could not be completed' - metadata: - reason: 'internal_error' - retryable: true + message: 'Internal Server Error' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request could not be completed. `metadata.reason` says whether to try again: `internal_error` is a transient failure and carries `metadata.retryable: true`, so the same request may be sent again, while `configuration_error` carries `retryable: false` because the next attempt reads the same missing binding or unusable stored credential.' - security: - - apiKey: [] - summary: 'Get an intern''s daemon access (deprecated alias)' + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Bulk assign members to a guardrail' tags: - - 'Interns' + - 'Guardrails' + x-speakeasy-name-override: 'bulkAssignMembers' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /interns/{internId}/daemon-access/sign: + /guardrails/{id}/assignments/members/remove: post: - deprecated: true - description: 'Deprecated alias of `POST /interns/{internId}/daemon/sign` with the same request, response, and errors. The API key selects the caller, workspace and visible interns. An intern''s own API key sees only that intern: the collection and every other intern answer 404 to it. 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: 'signInternDaemonAccessRequest' + description: 'Unassign multiple organization members from a specific guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'bulkUnassignMembersFromGuardrail' parameters: - - description: 'ID of an intern visible to the authenticated API key.' + - description: 'The unique identifier of the guardrail' in: 'path' - name: 'internId' + name: 'id' required: true schema: - description: 'ID of an intern visible to the authenticated API key.' - example: '7c9e6679-7425-40de-944b-e07fc1f90ae7' - minLength: 1 + description: 'The unique identifier of the guardrail' + example: '550e8400-e29b-41d4-a716-446655440000' + format: 'uuid' type: 'string' requestBody: content: application/json: + example: + member_user_ids: + - 'user_abc123' + - 'user_def456' schema: - $ref: '#/components/schemas/SignInternDaemonRequest' + $ref: '#/components/schemas/BulkUnassignMembersRequest' required: true responses: '200': content: application/json: + example: + unassigned_count: 2 schema: - $ref: '#/components/schemas/SignInternDaemonResponse' - description: 'Signature headers for the digest.' + $ref: '#/components/schemas/BulkUnassignMembersResponse' + description: 'Unassignment result' '400': content: application/json: example: error: code: 400 - message: 'Invalid request body' - metadata: - reason: 'invalid_body' - retryable: false + message: 'Invalid request parameters' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request body is invalid.' + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' '401': content: application/json: example: error: code: 401 - message: 'Invalid or missing API key' + message: 'Missing Authentication header' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'Missing, unknown or provisioning API key.' + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' '403': content: application/json: example: error: code: 403 - message: 'Personal connections require ori login --oidc.' - metadata: - reason: 'personal_identity_required' - retryable: false + message: 'Only management keys can perform this operation' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The caller is an API key, which names no person (`personal_identity_required`), or an OAuth grant without `vault:read` (`insufficient_scope`). Also returned when the key owner no longer has access or the request used a regional hostname.' + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' '404': content: application/json: example: error: code: 404 - message: 'Intern not found' - metadata: - reason: 'not_found' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The caller is outside the Intern API programme, or the intern is hidden.' - '408': - content: - application/json: - example: - error: - code: 408 - message: 'Operation timed out after 10s. Please try again later.' - metadata: - reason: 'timeout' - retryable: true - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request exceeded its route deadline. The deadline quoted in the message is the route''s own, so it differs between operations.' - '413': - content: - application/json: - example: - error: - code: 413 - message: 'Request body exceeds 1048576 bytes' - metadata: - reason: 'payload_too_large' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request body is larger than 1048576 bytes.' - '415': - content: - application/json: - example: - error: - code: 415 - message: 'Request body must be sent as application/json' - metadata: - reason: 'unsupported_media_type' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request body is non-empty and its Content-Type is not application/json.' - '429': - content: - application/json: - example: - error: - code: 429 - message: 'Too many intern turns. Please wait a moment.' - metadata: - reason: 'rate_limited' - retryable: true - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'Too many turns for the user or organization this credential acts as (`rate_limited`). Shares the chat turn limiter, reports `retryable: true` and carries `Retry-After`.' - headers: - Retry-After: - description: 'Seconds to wait before retrying this request.' - required: true + message: 'Resource not found' schema: - description: 'Seconds to wait before retrying this request.' - example: '60' - type: 'string' + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' '500': content: application/json: example: error: code: 500 - message: 'The request could not be completed' - metadata: - reason: 'internal_error' - retryable: true + message: 'Internal Server Error' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request could not be completed. `metadata.reason` says whether to try again: `internal_error` is a transient failure and carries `metadata.retryable: true`, so the same request may be sent again, while `configuration_error` carries `retryable: false` because the next attempt reads the same missing binding or unusable stored credential.' - security: - - apiKey: [] - summary: 'Sign a daemon request with the caller''s identity (deprecated alias)' + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'Bulk unassign members from a guardrail' tags: - - 'Interns' + - 'Guardrails' + x-speakeasy-name-override: 'bulkUnassignMembers' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /interns/{internId}/daemon/sign: - post: - description: 'Signs the SHA-256 digest of one request the CLI is about to send to the intern daemon, binding it to the intern and to the signed-in member so personal connections resolve. Only an OAuth session from `ori login --oidc` whose grant carries `vault:read` can sign: an API key is refused with 403 because it names no person, and an `interns`-only grant is refused with 403 because a proof releases that user''s personal connections. The route is behind the same gate as chat and counts against the chat turn limiter. The response is sent with `Cache-Control: no-store`. The API key selects the caller, workspace and visible interns. An intern''s own API key sees only that intern: the collection and every other intern answer 404 to it. 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: 'signInternDaemonRequest' + /guardrails/assignments/keys: + get: + description: 'List all API key guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'listKeyAssignments' parameters: - - description: 'ID of an intern visible to the authenticated API key.' - in: 'path' - name: 'internId' - required: true + - description: 'Number of records to skip for pagination' + in: 'query' + name: 'offset' + required: false schema: - description: 'ID of an intern visible to the authenticated API key.' - example: '7c9e6679-7425-40de-944b-e07fc1f90ae7' - minLength: 1 - type: 'string' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SignInternDaemonRequest' - required: true + default: 0 + description: 'Number of records to skip for pagination' + example: 0 + minimum: 0 + type: + - 'integer' + - 'null' + - description: 'Maximum number of records to return (max 100)' + in: 'query' + name: 'limit' + required: false + schema: + default: 50 + description: 'Maximum number of records to return (max 100)' + example: 50 + maximum: 100 + minimum: 1 + type: 'integer' responses: '200': content: application/json: + example: + data: + - assigned_by: 'user_abc123' + created_at: '2025-08-24T10:30:00Z' + guardrail_id: '550e8400-e29b-41d4-a716-446655440001' + id: '550e8400-e29b-41d4-a716-446655440000' + key_hash: 'c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93' + key_label: 'prod-key' + key_name: 'Production Key' + total_count: 1 schema: - $ref: '#/components/schemas/SignInternDaemonResponse' - description: 'Signature headers for the digest.' + $ref: '#/components/schemas/ListKeyAssignmentsResponse' + description: 'List of key assignments' '400': content: application/json: example: error: code: 400 - message: 'Invalid request body' - metadata: - reason: 'invalid_body' - retryable: false + message: 'Invalid request parameters' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request body is invalid.' + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' '401': content: application/json: example: error: code: 401 - message: 'Invalid or missing API key' + message: 'Missing Authentication header' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'Missing, unknown or provisioning API key.' + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' '403': content: application/json: example: error: code: 403 - message: 'Personal connections require ori login --oidc.' - metadata: - reason: 'personal_identity_required' - retryable: false + message: 'Only management keys can perform this operation' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The caller is an API key, which names no person (`personal_identity_required`), or an OAuth grant without `vault:read` (`insufficient_scope`). Also returned when the key owner no longer has access or the request used a regional hostname.' + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' '404': content: application/json: example: error: code: 404 - message: 'Intern not found' - metadata: - reason: 'not_found' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The caller is outside the Intern API programme, or the intern is hidden.' - '408': - content: - application/json: - example: - error: - code: 408 - message: 'Operation timed out after 10s. Please try again later.' - metadata: - reason: 'timeout' - retryable: true - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request exceeded its route deadline. The deadline quoted in the message is the route''s own, so it differs between operations.' - '413': - content: - application/json: - example: - error: - code: 413 - message: 'Request body exceeds 1048576 bytes' - metadata: - reason: 'payload_too_large' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request body is larger than 1048576 bytes.' - '415': - content: - application/json: - example: - error: - code: 415 - message: 'Request body must be sent as application/json' - metadata: - reason: 'unsupported_media_type' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request body is non-empty and its Content-Type is not application/json.' - '429': - content: - application/json: - example: - error: - code: 429 - message: 'Too many intern turns. Please wait a moment.' - metadata: - reason: 'rate_limited' - retryable: true - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'Too many turns for the user or organization this credential acts as (`rate_limited`). Shares the chat turn limiter, reports `retryable: true` and carries `Retry-After`.' - headers: - Retry-After: - description: 'Seconds to wait before retrying this request.' - required: true + message: 'Resource not found' schema: - description: 'Seconds to wait before retrying this request.' - example: '60' - type: 'string' + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' '500': content: application/json: example: error: code: 500 - message: 'The request could not be completed' - metadata: - reason: 'internal_error' - retryable: true + message: 'Internal Server Error' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request could not be completed. `metadata.reason` says whether to try again: `internal_error` is a transient failure and carries `metadata.retryable: true`, so the same request may be sent again, while `configuration_error` carries `retryable: false` because the next attempt reads the same missing binding or unusable stored credential.' - security: - - apiKey: [] - summary: 'Sign a daemon request with the caller''s identity' + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'List all key assignments' tags: - - 'Interns' + - 'Guardrails' + x-speakeasy-name-override: 'listKeyAssignments' + x-speakeasy-pagination: + inputs: + - in: 'parameters' + name: 'offset' + type: 'offset' + - in: 'parameters' + name: 'limit' + type: 'limit' + outputs: + results: '$.data' + type: 'offsetLimit' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /interns/{internId}/icon: + /guardrails/assignments/members: get: - description: 'Returns the icon image of one visible intern. Pass the intern''s `icon_sha256` as `v` to receive a response that can be cached indefinitely. The API key selects the caller, workspace and visible interns. An intern''s own API key sees only that intern: the collection and every other intern answer 404 to it. 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: 'getInternIcon' + description: 'List all organization member guardrail assignments for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.' + operationId: 'listMemberAssignments' parameters: - - description: 'ID of an intern visible to the authenticated API key.' - in: 'path' - name: 'internId' - required: true + - description: 'Number of records to skip for pagination' + in: 'query' + name: 'offset' + required: false schema: - description: 'ID of an intern visible to the authenticated API key.' - example: '7c9e6679-7425-40de-944b-e07fc1f90ae7' - minLength: 1 - type: 'string' - - description: 'The `icon_sha256` the caller expects.' + default: 0 + description: 'Number of records to skip for pagination' + example: 0 + minimum: 0 + type: + - 'integer' + - 'null' + - description: 'Maximum number of records to return (max 100)' in: 'query' - name: 'v' + name: 'limit' required: false schema: - description: 'The `icon_sha256` the caller expects.' - type: 'string' + default: 50 + description: 'Maximum number of records to return (max 100)' + example: 50 + maximum: 100 + minimum: 1 + type: 'integer' responses: '200': content: - image/*: + application/json: + example: + data: + - assigned_by: 'user_abc123' + created_at: '2025-08-24T10:30:00Z' + guardrail_id: '550e8400-e29b-41d4-a716-446655440001' + id: '550e8400-e29b-41d4-a716-446655440000' + organization_id: 'org_xyz789' + user_id: 'user_abc123' + total_count: 1 schema: - format: 'binary' - type: 'string' - description: 'Icon image bytes.' + $ref: '#/components/schemas/ListMemberAssignmentsResponse' + description: 'List of member assignments' + '400': + content: + application/json: + example: + error: + code: 400 + message: 'Invalid request parameters' + schema: + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' '401': content: application/json: example: error: code: 401 - message: 'Invalid or missing API key' + message: 'Missing Authentication header' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'Missing, unknown or provisioning API key.' + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' '403': content: application/json: example: error: code: 403 - message: 'Forbidden' + message: 'Only management keys can perform this operation' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The key owner no longer has access, or the request used a regional hostname.' + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' '404': content: application/json: example: error: code: 404 - message: 'Intern not found' - metadata: - reason: 'not_found' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The caller is outside the Intern API programme, or the intern is hidden.' - '408': - content: - application/json: - example: - error: - code: 408 - message: 'Operation timed out after 10s. Please try again later.' - metadata: - reason: 'timeout' - retryable: true + message: 'Resource not found' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request exceeded its route deadline. The deadline quoted in the message is the route''s own, so it differs between operations.' + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' '500': content: application/json: example: error: code: 500 - message: 'The request could not be completed' - metadata: - reason: 'internal_error' - retryable: true + message: 'Internal Server Error' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request could not be completed. `metadata.reason` says whether to try again: `internal_error` is a transient failure and carries `metadata.retryable: true`, so the same request may be sent again, while `configuration_error` carries `retryable: false` because the next attempt reads the same missing binding or unusable stored credential.' - security: - - apiKey: [] - summary: 'Get an intern''s icon' + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'List all member assignments' tags: - - 'Interns' + - 'Guardrails' + x-speakeasy-name-override: 'listMemberAssignments' + x-speakeasy-pagination: + inputs: + - in: 'parameters' + name: 'offset' + type: 'offset' + - in: 'parameters' + name: 'limit' + type: 'limit' + outputs: + results: '$.data' + type: 'offsetLimit' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /interns/{internId}/invoke: + /images: post: - description: "Starts a run on one of your interns and answers `202` with the `session_id` as soon as the intern accepts it. The run keeps going on the intern after the response. Nothing about its progress comes back on this request; the intern reports through its own tools, such as Slack.\n\nSend the same `session_id` later to continue the conversation, for example to hand the intern a decision on work it started. If that session already has a run going, the prompt is delivered into it and the status is `steered`. A `session_id` is accepted only from the caller it was issued to, on the same intern; any other, including sessions started from Slack or the chat endpoint, is refused with `404`.\n\nRuns started here self-drive: the intern consents to its own tool approvals, and a question it asks is answered by its own fallback. A run ends when the intern finishes it or after its execution deadline (1 hour by default).\n\nAvailable to interns programme members. Callers outside the programme receive `404` for every path under `/api/v1/interns`." - operationId: 'invokeIntern' - parameters: - - description: 'The intern to run.' - in: 'path' - name: 'internId' - required: true - schema: - description: 'The intern to run.' - example: 'a11e0000-0000-4000-8000-000000000005' - type: 'string' + description: 'Generates an image from a text prompt via the image generation router' + operationId: 'createImages' requestBody: content: application/json: + example: + model: 'bytedance-seed/seedream-4.5' + prompt: 'a red panda astronaut floating in space, studio lighting' schema: - $ref: '#/components/schemas/InternInvokeRequest' + $ref: '#/components/schemas/ImageGenerationRequest' required: true responses: - '202': + '200': content: application/json: + example: + created: 1748372400 + data: + - b64_json: '' + usage: + completion_tokens: 4175 + cost: 0.04 + prompt_tokens: 0 + total_tokens: 4175 + schema: + $ref: '#/components/schemas/ImageGenerationResponse' + text/event-stream: + example: + data: + b64_json: '' + partial_image_index: 0 + type: 'image_generation.partial_image' schema: - $ref: '#/components/schemas/InternInvokeAcceptedResponse' - description: 'The intern accepted the prompt. The run continues on the intern.' + $ref: '#/components/schemas/ImageStreamingResponse' + x-speakeasy-sse-sentinel: '[DONE]' + description: 'Image generation response' '400': content: application/json: example: error: code: 400 - message: 'Invalid invoke request (input: Too small: expected string to have >=1 characters).' - metadata: - reason: 'bad_request' - retryable: false + message: 'Invalid request parameters' schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'The body is not a valid request (`bad_request`).' + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' '401': content: application/json: example: error: code: 401 - message: 'Invalid or missing API key' - schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'No valid API key.' - '403': - content: - application/json: - example: - error: - code: 403 - message: 'This API key''s creator is no longer a member of the organization. Ask an organization admin to reassign the key to an active member.' + message: 'Missing Authentication header' schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'The key belongs to a member who has left the organization and holds no grant.' - '404': + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '402': content: application/json: example: error: - code: 404 - message: 'Intern not found' - metadata: - reason: 'not_found' - retryable: false + code: 402 + message: 'Insufficient credits. Add more using https://openrouter.ai/credits' schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'The caller is outside the interns programme, the intern does not exist for this key, or the `session_id` was not issued to this caller on this intern (`not_found`).' - '408': + $ref: '#/components/schemas/PaymentRequiredResponse' + description: 'Payment Required - Insufficient credits or quota to complete request' + '403': content: application/json: example: error: - code: 408 - message: 'Operation timed out after 60s. Please try again later.' - metadata: - reason: 'timeout' - retryable: true + code: 403 + message: 'Only management keys can perform this operation' schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'The request exceeded the route''s own deadline before the handler answered (`timeout`).' - '409': + $ref: '#/components/schemas/ForbiddenResponse' + description: 'Forbidden - Authentication successful but insufficient permissions' + '404': content: application/json: example: error: - code: 409 - message: 'This intern is not running.' - metadata: - reason: 'intern_not_ready' - retryable: true - schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'The intern is not running or its runtime is too old to keep a run going without a connection (`intern_not_ready`), or the session already has a run that did not take the prompt (`busy`). A `busy` refusal carries `Retry-After`.' - headers: - Retry-After: - description: 'Seconds to wait before retrying this request. Present only on a `busy` refusal.' - required: false + code: 404 + message: 'Resource not found' schema: - description: 'Seconds to wait before retrying this request. Present only on a `busy` refusal.' - example: '5' - type: 'string' + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' '413': content: application/json: example: error: code: 413 - message: 'Request body exceeds 1048576 bytes' - metadata: - reason: 'payload_too_large' - retryable: false + message: 'Request payload too large' schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'The body exceeds 1 MiB (`payload_too_large`).' + $ref: '#/components/schemas/PayloadTooLargeResponse' + description: 'Payload Too Large - Request payload exceeds size limits' '429': content: application/json: example: error: code: 429 - message: 'Too many intern turns. Please wait a moment.' - metadata: - reason: 'rate_limited' - retryable: true - schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'Too many turns for the user or organization this key acts as (`rate_limited`). It carries `Retry-After`.' - headers: - Retry-After: - description: 'Seconds to wait before retrying this request.' - required: true + message: 'Rate limit exceeded' schema: - description: 'Seconds to wait before retrying this request.' - example: '60' - type: 'string' + $ref: '#/components/schemas/TooManyRequestsResponse' + description: 'Too Many Requests - Rate limit exceeded' '500': content: application/json: example: error: code: 500 - message: 'Could not look up the intern' - metadata: - reason: 'intern_unreachable' - retryable: true + message: 'Internal Server Error' schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'The intern could not be looked up, or authenticating the key failed.' + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' '502': content: application/json: example: error: code: 502 - message: 'The intern could not be reached.' - metadata: - reason: 'intern_unreachable' - retryable: true + message: 'Provider returned error' schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'The intern could not be reached, rejected the request, or refused the turn before it started.' - '503': + $ref: '#/components/schemas/BadGatewayResponse' + description: 'Bad Gateway - Provider/upstream API failure' + '524': content: application/json: example: error: - code: 503 - message: 'The intern cannot hold another run open across a question right now. Retry later.' - metadata: - reason: 'busy' - retryable: true - schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'The intern cannot take another run right now (`busy`). It reports `retryable: true` and carries `Retry-After`.' - headers: - Retry-After: - description: 'Seconds to wait before retrying this request.' - required: true + code: 524 + message: 'Request timed out. Please try again later.' schema: - description: 'Seconds to wait before retrying this request.' - example: '5' - type: 'string' - '504': + $ref: '#/components/schemas/EdgeNetworkTimeoutResponse' + description: 'Infrastructure Timeout - Provider request timed out at edge network' + '529': content: application/json: example: error: - code: 504 - message: 'The intern did not answer in time.' - metadata: - reason: 'timeout' - retryable: true + code: 529 + message: 'Provider returned error' schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'The intern did not accept the turn in time (`timeout`).' - security: - - apiKey: [] - summary: 'Start an intern run without waiting for it' + $ref: '#/components/schemas/ProviderOverloadedResponse' + description: 'Provider Overloaded - Provider is temporarily overloaded' + summary: 'Generate an image' tags: - - 'Interns' - x-speakeasy-group: 'interns' - x-speakeasy-name-override: 'invoke' + - 'Images' + x-speakeasy-name-override: 'generate' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /interns/{internId}/provision: - post: - description: 'Starts the first boot, or resumes an intern after suspension. This operation takes no request body. A body carrying any field is refused with 400 rather than ignored. The API key selects the caller, workspace and visible interns. An intern''s own API key sees only that intern: the collection and every other intern answer 404 to it. 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: 'provisionIntern' - parameters: - - description: 'ID of an intern visible to the authenticated API key.' - in: 'path' - name: 'internId' - required: true - schema: - description: 'ID of an intern visible to the authenticated API key.' - example: '7c9e6679-7425-40de-944b-e07fc1f90ae7' - minLength: 1 - type: 'string' + /images/models: + get: + description: 'Lists every image generation model with its top-level supported-parameter superset and a URL to its full per-endpoint records.' + operationId: 'listImageModels' responses: - '202': - content: - application/json: - example: - provisioning: true - schema: - $ref: '#/components/schemas/ProvisionInternResponse' - description: 'The operation was accepted.' - '400': - content: - application/json: - example: - error: - code: 400 - message: 'Invalid request body' - metadata: - reason: 'invalid_body' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request body is invalid.' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'Invalid or missing API key' - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'Missing, unknown or provisioning API key.' - '403': - content: - application/json: - example: - error: - code: 403 - message: 'Intern lifecycle writes are not enabled for this account' - metadata: - reason: 'lifecycle_writes_disabled' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The key owner no longer has access, the request used a regional hostname, or lifecycle writes are not enabled for the caller (`metadata.reason` is `lifecycle_writes_disabled`).' - '404': - content: - application/json: - example: - error: - code: 404 - message: 'Intern not found' - metadata: - reason: 'not_found' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The caller is outside the Intern API programme, or the intern is hidden.' - '408': - content: - application/json: - example: - error: - code: 408 - message: 'Operation timed out after 10s. Please try again later.' - metadata: - reason: 'timeout' - retryable: true - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request exceeded its route deadline. The deadline quoted in the message is the route''s own, so it differs between operations.' - '409': - content: - application/json: - example: - error: - code: 409 - message: 'Another operation holds the intern, retry once it settles' - metadata: - reason: 'intern_busy' - retryable: true - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The intern is not in a state that allows this operation. `metadata.reason` says whether to try again: `intern_busy` means another operation still holds the intern and carries `metadata.retryable: true`, so the same request may be sent again once it settles. A duplicate delete of an intern already being deleted is not a conflict and is accepted with 202.' - '413': - content: - application/json: - example: - error: - code: 413 - message: 'Request body exceeds 1048576 bytes' - metadata: - reason: 'payload_too_large' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request body is larger than 1048576 bytes.' - '415': + '200': content: application/json: example: - error: - code: 415 - message: 'Request body must be sent as application/json' - metadata: - reason: 'unsupported_media_type' - retryable: false + data: + - architecture: + input_modalities: + - 'text' + output_modalities: + - 'image' + created: 1692901234 + description: 'A text-to-image model.' + endpoints: '/api/v1/images/models/bytedance-seed/seedream-4.5/endpoints' + id: 'bytedance-seed/seedream-4.5' + name: 'Seedream 4.5' + supported_parameters: + resolution: + type: 'enum' + values: + - '1K' + - '2K' + - '4K' + supports_streaming: false schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request body is non-empty and its Content-Type is not application/json.' + $ref: '#/components/schemas/ImageModelsListResponse' + description: 'List of image generation models' '500': content: application/json: example: error: code: 500 - message: 'The request could not be completed' - metadata: - reason: 'internal_error' - retryable: true - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request could not be completed. `metadata.reason` says whether to try again: `internal_error` is a transient failure and carries `metadata.retryable: true`, so the same request may be sent again, while `configuration_error` carries `retryable: false` because the next attempt reads the same missing binding or unusable stored credential.' - '502': - content: - application/json: - example: - error: - code: 502 - message: 'The intern service could not be reached, retry the request' - metadata: - reason: 'upstream_unavailable' - retryable: true + message: 'Internal Server Error' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The intern service could not accept the operation.' - security: - - apiKey: [] - summary: 'Provision an intern' + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'List image generation models' tags: - - 'Interns' + - 'Images' + x-speakeasy-name-override: 'listModels' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /interns/{internId}/suspend: - post: - description: 'Stops the intern runtime while keeping its disk and configuration for a later provision call. This operation takes no request body. A body carrying any field is refused with 400 rather than ignored. The API key selects the caller, workspace and visible interns. An intern''s own API key sees only that intern: the collection and every other intern answer 404 to it. 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: 'suspendIntern' + /images/models/{author}/{slug}/endpoints: + get: + description: 'Returns the full per-endpoint records for an image model: each endpoint''s definitive supported parameters, pricing, and passthrough allowlist.' + operationId: 'listImageModelEndpoints' parameters: - - description: 'ID of an intern visible to the authenticated API key.' + - description: 'Model author/organization' in: 'path' - name: 'internId' + name: 'author' required: true schema: - description: 'ID of an intern visible to the authenticated API key.' - example: '7c9e6679-7425-40de-944b-e07fc1f90ae7' - minLength: 1 + description: 'Model author/organization' + example: 'bytedance-seed' + type: 'string' + - description: 'Model slug' + in: 'path' + name: 'slug' + required: true + schema: + description: 'Model slug' + example: 'seedream-4.5' type: 'string' responses: '200': content: application/json: example: - suspended: true - schema: - $ref: '#/components/schemas/SuspendInternResponse' - description: 'Intern suspended.' - '400': - content: - application/json: - example: - error: - code: 400 - message: 'Invalid request body' - metadata: - reason: 'invalid_body' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request body is invalid.' - '401': - content: - application/json: - example: - error: - code: 401 - message: 'Invalid or missing API key' - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'Missing, unknown or provisioning API key.' - '403': - content: - application/json: - example: - error: - code: 403 - message: 'Intern lifecycle writes are not enabled for this account' - metadata: - reason: 'lifecycle_writes_disabled' - retryable: false + endpoints: + - allowed_passthrough_parameters: [] + pricing: + - billable: 'output_image' + cost_usd: 0.05 + unit: 'image' + provider_name: 'Bytedance' + provider_slug: 'bytedance' + provider_tag: 'bytedance' + supported_parameters: + resolution: + type: 'enum' + values: + - '1K' + - '2K' + - '4K' + supports_streaming: false + id: 'bytedance-seed/seedream-4.5' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The key owner no longer has access, the request used a regional hostname, or lifecycle writes are not enabled for the caller (`metadata.reason` is `lifecycle_writes_disabled`).' + $ref: '#/components/schemas/ImageModelEndpointsResponse' + description: 'The full per-endpoint records for an image model' '404': content: application/json: example: error: code: 404 - message: 'Intern not found' - metadata: - reason: 'not_found' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The caller is outside the Intern API programme, or the intern is hidden.' - '408': - content: - application/json: - example: - error: - code: 408 - message: 'Operation timed out after 10s. Please try again later.' - metadata: - reason: 'timeout' - retryable: true - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request exceeded its route deadline. The deadline quoted in the message is the route''s own, so it differs between operations.' - '409': - content: - application/json: - example: - error: - code: 409 - message: 'Another operation holds the intern, retry once it settles' - metadata: - reason: 'intern_busy' - retryable: true - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The intern is not in a state that allows this operation. `metadata.reason` says whether to try again: `intern_busy` means another operation still holds the intern and carries `metadata.retryable: true`, so the same request may be sent again once it settles. A duplicate delete of an intern already being deleted is not a conflict and is accepted with 202.' - '413': - content: - application/json: - example: - error: - code: 413 - message: 'Request body exceeds 1048576 bytes' - metadata: - reason: 'payload_too_large' - retryable: false - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request body is larger than 1048576 bytes.' - '415': - content: - application/json: - example: - error: - code: 415 - message: 'Request body must be sent as application/json' - metadata: - reason: 'unsupported_media_type' - retryable: false + message: 'Resource not found' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request body is non-empty and its Content-Type is not application/json.' + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' '500': content: application/json: example: error: code: 500 - message: 'The request could not be completed' - metadata: - reason: 'internal_error' - retryable: true - schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request could not be completed. `metadata.reason` says whether to try again: `internal_error` is a transient failure and carries `metadata.retryable: true`, so the same request may be sent again, while `configuration_error` carries `retryable: false` because the next attempt reads the same missing binding or unusable stored credential.' - '502': - content: - application/json: - example: - error: - code: 502 - message: 'The intern service could not be reached, retry the request' - metadata: - reason: 'upstream_unavailable' - retryable: true + message: 'Internal Server Error' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The intern service could not accept the operation.' - security: - - apiKey: [] - summary: 'Suspend an intern' + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'List endpoints for an image model' tags: - - 'Interns' + - 'Images' + x-speakeasy-name-override: 'listModelEndpoints' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" @@ -56508,8 +53074,6 @@ tags: name: 'Guardrails' - description: 'Images endpoints' name: 'Images' - - description: 'Create, inspect, update, provision, suspend and delete OpenRouter interns through an API key, and talk to them: the chat route streams OpenAI-compatible completions from one intern, pausing as an `openrouter.provide_input` tool call when the intern needs your permission or an answer. Available to interns programme members; other callers receive 404. See https://openrouter.ai/docs/guides/ori/intern-chat.' - name: 'Interns' - description: 'Model information endpoints' name: 'Models' - description: 'OAuth authentication endpoints' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 8d25ca80e..686ea44eb 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.802.0 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:46f8a73182eecf2f969ec014e319a989aed696f70e9e34977dff5cce61ce7a44 - sourceBlobDigest: sha256:f858134db440db4df6790614d9fbf8d17e4966b6d025fac278844593ae86a944 + sourceRevisionDigest: sha256:12a9536ef41eeb336c00fe2a924c8e7bd76a6d5aac4a0d2718032e7126aea798 + sourceBlobDigest: sha256:72ae8a5539f92d178f078e8e590e730fabfb0138dd189d895150d070833bbfd1 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: openrouter: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:46f8a73182eecf2f969ec014e319a989aed696f70e9e34977dff5cce61ce7a44 - sourceBlobDigest: sha256:f858134db440db4df6790614d9fbf8d17e4966b6d025fac278844593ae86a944 + sourceRevisionDigest: sha256:12a9536ef41eeb336c00fe2a924c8e7bd76a6d5aac4a0d2718032e7126aea798 + sourceBlobDigest: sha256:72ae8a5539f92d178f078e8e590e730fabfb0138dd189d895150d070833bbfd1 codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:f94e8127e127e562ede90b98ca18d776d9f49632eb2c40be80efbed93ccc21fe + codeSamplesRevisionDigest: sha256:03d3d3e13a0121dec05fe5dd00c739d2c10ec483e277b7adccde7e5f26f02330 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.802.0 diff --git a/RELEASES.md b/RELEASES.md index f5afc9260..9cf820f7a 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -4446,4 +4446,14 @@ Based on: ### Generated - [typescript v1.5.6] . ### Releases -- [NPM v1.5.6] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.6 - . \ No newline at end of file +- [NPM v1.5.6] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.6 - . + +## 2026-10-23 17:57:35 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.802.0 (2.948.4) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v1.5.7] . +### Releases +- [NPM v1.5.7] https://www.npmjs.com/package/@openrouter/sdk/v/1.5.7 - . \ No newline at end of file diff --git a/docs/models/account.mdx b/docs/models/account.mdx deleted file mode 100644 index bdd968713..000000000 --- a/docs/models/account.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: "Account" ---- - -## Example Usage - -```typescript -import { Account } from "@openrouter/sdk/models"; - -let value: Account = { - actsAs: "", - isYourAccountLinked: true, - note: "", - scope: "workspace", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `actsAs` | *string* | ✔️ | Whose account it acts as, when known. | -| `isYourAccountLinked` | *boolean* | ✔️ | N/A | -| `note` | *string* | ✔️ | N/A | -| `scope` | [models.InternConnectionScope](../models/internconnectionscope.mdx) | ✔️ | `workspace` for a shared connection, `yours` for the key user's personal account, `shared` for a teammate's. | \ No newline at end of file diff --git a/docs/models/code.mdx b/docs/models/code.mdx deleted file mode 100644 index 41203d625..000000000 --- a/docs/models/code.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: "Code" ---- - -## Supported Types - -### `string` - -```typescript -const value: string = ""; -``` - -### `number` - -```typescript -const value: number = 128403; -``` - diff --git a/docs/models/createinternrequest.mdx b/docs/models/createinternrequest.mdx deleted file mode 100644 index b0f4f450e..000000000 --- a/docs/models/createinternrequest.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: "CreateInternRequest" ---- - -Settings for a new intern. - -## Example Usage - -```typescript -import { CreateInternRequest } from "@openrouter/sdk/models"; - -let value: CreateInternRequest = { - name: "research-assistant", - provision: true, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -| `description` | *string* | ➖ | Free-form description, or null. | -| `instructions` | *string* | ➖ | Standing instructions the intern boots with, or null. | -| `name` | *string* | ✔️ | Intern name, unique per creator within the workspace. | -| `provision` | *boolean* | ➖ | Start provisioning during this create operation. Defaults to false. | -| `vaultId` | *string* | ➖ | Vault owned by another intern in this workspace to attach as a borrowed vault. | -| `workspaceId` | *string* | ➖ | Workspace that will own the intern. Defaults to the workspace the API key resolves to. When given, it must match the API key workspace. | \ No newline at end of file diff --git a/docs/models/deleteinternrequest.mdx b/docs/models/deleteinternrequest.mdx deleted file mode 100644 index a33bfd541..000000000 --- a/docs/models/deleteinternrequest.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -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* | ➖ | 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/deleteinternresponse.mdx b/docs/models/deleteinternresponse.mdx deleted file mode 100644 index 50f5d564c..000000000 --- a/docs/models/deleteinternresponse.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "DeleteInternResponse" ---- - -## Example Usage - -```typescript -import { DeleteInternResponse } from "@openrouter/sdk/models"; - -let value: DeleteInternResponse = { - deleting: true, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `deleting` | *true* | ✔️ | N/A | \ No newline at end of file diff --git a/docs/models/errors/internchaterrorresponse.mdx b/docs/models/errors/internchaterrorresponse.mdx deleted file mode 100644 index b3caef5e6..000000000 --- a/docs/models/errors/internchaterrorresponse.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "InternChatErrorResponse" ---- - -A refusal before the stream opens. Once the response is `200` and streaming, failures arrive as a chunk with `finish_reason: "error"` instead. - -## Example Usage - -```typescript -import { InternChatErrorResponse } from "@openrouter/sdk/models/errors"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `error` | [models.InternChatError](../../models/internchaterror.mdx) | ✔️ | The OpenAI-compatible error object. `metadata` is present on refusals from the chat route. Authentication refusals (`401`), the departed-creator `403` and the programme `404` carry only `code` and `message`. | \{
"code": 409,
"message": "That question is no longer waiting for an answer.",
"metadata": \{
"reason": "interaction_not_pending",
"retryable": false
}
} | \ No newline at end of file diff --git a/docs/models/errors/internlifecycleerror.mdx b/docs/models/errors/internlifecycleerror.mdx deleted file mode 100644 index f18815689..000000000 --- a/docs/models/errors/internlifecycleerror.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "InternLifecycleError" ---- - -Intern lifecycle request failure. - -## Example Usage - -```typescript -import { InternLifecycleError } from "@openrouter/sdk/models/errors"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `error` | [models.InternLifecycleErrorError](../../models/internlifecycleerrorerror.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/docs/models/intern.mdx b/docs/models/intern.mdx deleted file mode 100644 index 3753affc6..000000000 --- a/docs/models/intern.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: "Intern" ---- - -Public lifecycle state and settings for one intern. - -## Example Usage - -```typescript -import { Intern } from "@openrouter/sdk/models"; - -let value: Intern = { - attachedVaultId: null, - createdAt: "2026-09-16T08:30:00.000Z", - description: "Researches customer questions", - hostname: "research-assistant.openrouter.ai", - id: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - instructions: null, - lastFailureMessage: null, - model: "openai/gpt-5.4", - name: "research-assistant", - progress: null, - status: "running", - updatedAt: "2026-09-16T08:45:00.000Z", - vaultId: "b431c59d-6eed-41ac-bc89-9a89be79a121", - workspaceId: "89f9f5b2-3f89-4eaf-83ca-5ceae149e8bb", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `attachedVaultId` | *string* | ✔️ | Vault the intern borrows from another intern, or null when it borrows none. | -| `canEdit` | *boolean* | ➖ | Whether this key may change the intern (update, provision, suspend, delete). Present on list and retrieve; false while lifecycle writes are closed for the account. | -| `createdAt` | *string* | ✔️ | ISO 8601 creation time. | -| `createdByYou` | *boolean* | ➖ | Whether the user behind the key created the intern. Present on list and retrieve; absent for organization keys, which act for no user. | -| `description` | *string* | ✔️ | Free-form description. | -| `hostname` | *string* | ✔️ | Public hostname the intern is reachable at, or null until provisioning has assigned one. | -| `iconSha256` | *string* | ➖ | SHA-256 of the intern icon, or null when it has none. Present on list and retrieve; fetch the bytes from `GET /api/v1/interns/{intern_id}/icon`. | -| `id` | *string* | ✔️ | Intern id. | -| `instructions` | *string* | ✔️ | Standing instructions the intern boots with. | -| `lastFailureMessage` | *string* | ✔️ | Why the last provisioning attempt failed, when status is failed. | -| `model` | *string* | ✔️ | OpenRouter model slug the intern runs, or null for the workspace default. | -| `name` | *string* | ✔️ | Intern name, unique per creator within a workspace. | -| `progress` | [models.Progress](../models/progress.mdx) | ✔️ | Active provisioning step, or null once provisioning has settled. | -| `status` | [models.InternStatus](../models/internstatus.mdx) | ✔️ | Lifecycle status. | -| `updatedAt` | *string* | ✔️ | ISO 8601 last update time. | -| `vaultId` | *string* | ✔️ | Vault the intern owns, or null before it has been created. | -| `workspaceId` | *string* | ✔️ | Workspace that owns the intern and scopes its secrets. | \ No newline at end of file diff --git a/docs/models/internapprovalmode.mdx b/docs/models/internapprovalmode.mdx deleted file mode 100644 index 06365d097..000000000 --- a/docs/models/internapprovalmode.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: "InternApprovalMode" ---- - -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. - -## Example Usage - -```typescript -import { InternApprovalMode } from "@openrouter/sdk/models"; - -let value: InternApprovalMode = "manual"; - -// Open enum: unrecognized values are captured as Unrecognized -``` - -## Values - -```typescript -"manual" | "self-drive" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/internchatassistantmessage.mdx b/docs/models/internchatassistantmessage.mdx deleted file mode 100644 index 694655e21..000000000 --- a/docs/models/internchatassistantmessage.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: "InternChatAssistantMessage" ---- - -An assistant message from an earlier response. When answering an interaction, echo the streamed `tool_calls` here before the `tool` message. - -## Example Usage - -```typescript -import { InternChatAssistantMessage } from "@openrouter/sdk/models"; - -let value: InternChatAssistantMessage = { - role: "assistant", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content` | *models.InternChatMessageContent* | ➖ | Message text as a string or a list of text parts. Assistant history may carry null. Only the last message is read; earlier messages are accepted so ordinary clients can resend history. | Summarize the open pull requests. | -| `role` | *"assistant"* | ✔️ | N/A | | -| `toolCalls` | [models.InternChatEchoedToolCall](../models/internchatechoedtoolcall.mdx)[] | ➖ | N/A | | \ No newline at end of file diff --git a/docs/models/internchatchoice.mdx b/docs/models/internchatchoice.mdx deleted file mode 100644 index ddcc9a112..000000000 --- a/docs/models/internchatchoice.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: "InternChatChoice" ---- - -The single choice this endpoint streams. - -## Example Usage - -```typescript -import { InternChatChoice } from "@openrouter/sdk/models"; - -let value: InternChatChoice = { - delta: {}, - finishReason: null, - index: 0, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `delta` | [models.InternChatDelta](../models/internchatdelta.mdx) | ✔️ | The incremental content of one chunk. The first chunk carries `role`, text chunks carry `content`, reasoning chunks carry `reasoning`, and an interaction chunk carries one complete `tool_calls` entry. | \{
"content": "Hello"
} | -| `finishReason` | [models.InternChatChoiceFinishReason](../models/internchatchoicefinishreason.mdx) | ✔️ | `null` while streaming. `stop` when the run completed, `tool_calls` when the run is waiting for the caller to answer the streamed tool call, `error` on the terminal error chunk. | | -| `index` | *number* | ✔️ | N/A | | \ No newline at end of file diff --git a/docs/models/internchatchoicefinishreason.mdx b/docs/models/internchatchoicefinishreason.mdx deleted file mode 100644 index e0358f51e..000000000 --- a/docs/models/internchatchoicefinishreason.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: "InternChatChoiceFinishReason" ---- - -`null` while streaming. `stop` when the run completed, `tool_calls` when the run is waiting for the caller to answer the streamed tool call, `error` on the terminal error chunk. - -## Example Usage - -```typescript -import { InternChatChoiceFinishReason } from "@openrouter/sdk/models"; - -let value: InternChatChoiceFinishReason = "tool_calls"; - -// Open enum: unrecognized values are captured as Unrecognized -``` - -## Values - -```typescript -"error" | "stop" | "tool_calls" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/internchatcompletionchunk.mdx b/docs/models/internchatcompletionchunk.mdx deleted file mode 100644 index 2c4514437..000000000 --- a/docs/models/internchatcompletionchunk.mdx +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: "InternChatCompletionChunk" ---- - -One `data:` line of the stream. A run streams a role chunk, content and reasoning chunks, then a finish chunk: `stop`, `tool_calls` (the run is paused for input) or `error` (with an `error` object). A final chunk with empty `choices` follows in every case, carrying `session_id` and `usage` (`null` unless the daemon reported usage, and always `null` after `tool_calls`). Every stream ends with `[DONE]`. - -## Example Usage - -```typescript -import { InternChatCompletionChunk } from "@openrouter/sdk/models"; - -let value: InternChatCompletionChunk = { - choices: [ - { - delta: {}, - finishReason: null, - index: 0, - }, - ], - created: 1789537541, - id: "chatcmpl-f727571a-3bad-4e0d-8a9e-f18f8cda9750", - model: "openrouter/intern", - object: "chat.completion.chunk", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `choices` | [models.InternChatChoice](../models/internchatchoice.mdx)[] | ✔️ | One choice on content, tool-call and error chunks. Empty on the final chunk that carries `session_id`. | | -| `created` | *number* | ✔️ | N/A | | -| `error` | [models.InternChatStreamError](../models/internchatstreamerror.mdx) | ➖ | 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",
"retryable": false
}
} | -| `id` | *string* | ✔️ | The completion id, constant for the whole response. | chatcmpl-f727571a-3bad-4e0d-8a9e-f18f8cda9750 | -| `model` | *string* | ✔️ | 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) | ✔️ | N/A | | -| `sessionId` | *string* | ➖ | 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) | ➖ | 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/internchatcompletionchunkobject.mdx b/docs/models/internchatcompletionchunkobject.mdx deleted file mode 100644 index 07a1e5d37..000000000 --- a/docs/models/internchatcompletionchunkobject.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: "InternChatCompletionChunkObject" ---- - -## Example Usage - -```typescript -import { InternChatCompletionChunkObject } from "@openrouter/sdk/models"; - -let value: InternChatCompletionChunkObject = "chat.completion.chunk"; -``` - -## Values - -```typescript -"chat.completion.chunk" -``` \ No newline at end of file diff --git a/docs/models/internchatcompletionrequest.mdx b/docs/models/internchatcompletionrequest.mdx deleted file mode 100644 index 6e07749bf..000000000 --- a/docs/models/internchatcompletionrequest.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: "InternChatCompletionRequest" ---- - -An OpenAI-compatible streaming chat completion request for one intern. Other OpenAI fields such as `temperature` or `tools` are ignored. The intern owns its sampling and its tools. - -## Example Usage - -```typescript -import { InternChatCompletionRequest } from "@openrouter/sdk/models"; - -let value: InternChatCompletionRequest = { - messages: [ - { - content: "Summarize the open pull requests.", - role: "user", - }, - ], - stream: true, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `approvalMode` | [models.InternApprovalMode](../models/internapprovalmode.mdx) | ➖ | 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*[] | ✔️ | 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* | ➖ | 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* | ➖ | 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* | ✔️ | 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/internchatdelta.mdx b/docs/models/internchatdelta.mdx deleted file mode 100644 index 13f0b9544..000000000 --- a/docs/models/internchatdelta.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: "InternChatDelta" ---- - -The incremental content of one chunk. The first chunk carries `role`, text chunks carry `content`, reasoning chunks carry `reasoning`, and an interaction chunk carries one complete `tool_calls` entry. - -## Example Usage - -```typescript -import { InternChatDelta } from "@openrouter/sdk/models"; - -let value: InternChatDelta = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -| `content` | *string* | ➖ | N/A | -| `reasoning` | *string* | ➖ | N/A | -| `role` | [models.InternChatDeltaRole](../models/internchatdeltarole.mdx) | ➖ | N/A | -| `toolCalls` | [models.InternChatToolCall](../models/internchattoolcall.mdx)[] | ➖ | N/A | \ No newline at end of file diff --git a/docs/models/internchatdeltarole.mdx b/docs/models/internchatdeltarole.mdx deleted file mode 100644 index 4ec8763d4..000000000 --- a/docs/models/internchatdeltarole.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: "InternChatDeltaRole" ---- - -## Example Usage - -```typescript -import { InternChatDeltaRole } from "@openrouter/sdk/models"; - -let value: InternChatDeltaRole = "assistant"; -``` - -## Values - -```typescript -"assistant" -``` \ No newline at end of file diff --git a/docs/models/internchatdevelopermessage.mdx b/docs/models/internchatdevelopermessage.mdx deleted file mode 100644 index ebbca3474..000000000 --- a/docs/models/internchatdevelopermessage.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: "InternChatDeveloperMessage" ---- - -A developer message. Accepted for client compatibility and not forwarded. - -## Example Usage - -```typescript -import { InternChatDeveloperMessage } from "@openrouter/sdk/models"; - -let value: InternChatDeveloperMessage = { - content: "Summarize the open pull requests.", - role: "developer", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content` | *models.InternChatMessageContent* | ✔️ | Message text as a string or a list of text parts. Assistant history may carry null. Only the last message is read; earlier messages are accepted so ordinary clients can resend history. | Summarize the open pull requests. | -| `role` | *"developer"* | ✔️ | N/A | | \ No newline at end of file diff --git a/docs/models/internchatechoedtoolcall.mdx b/docs/models/internchatechoedtoolcall.mdx deleted file mode 100644 index 5bb17ebd1..000000000 --- a/docs/models/internchatechoedtoolcall.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: "InternChatEchoedToolCall" ---- - -The `openrouter.provide_input` tool call from the previous response, echoed back unchanged. Its `id` is the interaction the following `tool` message answers. - -## Example Usage - -```typescript -import { InternChatEchoedToolCall } from "@openrouter/sdk/models"; - -let value: InternChatEchoedToolCall = { - function: { - arguments: - "{\"kind\":\"permission\",\"operation\":\"shell\",\"options\":[\"allow_once\",\"reject_once\"]}", - name: "openrouter.provide_input", - }, - id: "15e90ad6-5320-4a59-af4f-b371428154fa", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -| `function` | [models.InternChatEchoedToolCallFunction](../models/internchatechoedtoolcallfunction.mdx) | ✔️ | The function name and JSON arguments string exactly as streamed. | \{
"arguments": "\{\"kind\":\"permission\",\"operation\":\"shell\",\"options\":[\"allow_once\",\"reject_once\"]}",
"name": "openrouter.provide_input"
} | -| `id` | *string* | ✔️ | N/A | | \ No newline at end of file diff --git a/docs/models/internchatechoedtoolcallfunction.mdx b/docs/models/internchatechoedtoolcallfunction.mdx deleted file mode 100644 index 0c27964f4..000000000 --- a/docs/models/internchatechoedtoolcallfunction.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "InternChatEchoedToolCallFunction" ---- - -The function name and JSON arguments string exactly as streamed. - -## Example Usage - -```typescript -import { InternChatEchoedToolCallFunction } from "@openrouter/sdk/models"; - -let value: InternChatEchoedToolCallFunction = { - arguments: - "{\"kind\":\"permission\",\"operation\":\"shell\",\"options\":[\"allow_once\",\"reject_once\"]}", - name: "openrouter.provide_input", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `arguments` | *string* | ✔️ | N/A | -| `name` | *string* | ✔️ | N/A | \ No newline at end of file diff --git a/docs/models/internchaterror.mdx b/docs/models/internchaterror.mdx deleted file mode 100644 index 58572a120..000000000 --- a/docs/models/internchaterror.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "InternChatError" ---- - -The OpenAI-compatible error object. `metadata` is present on refusals from the chat route. Authentication refusals (`401`), the departed-creator `403` and the programme `404` carry only `code` and `message`. - -## Example Usage - -```typescript -import { InternChatError } from "@openrouter/sdk/models"; - -let value: InternChatError = { - code: 409, - message: "That question is no longer waiting for an answer.", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `code` | *number* | ✔️ | The HTTP status of the response. | | -| `message` | *string* | ✔️ | N/A | | -| `metadata` | [models.InternChatErrorMetadata](../models/internchaterrormetadata.mdx) | ➖ | Machine-readable detail for the failure. | \{
"reason": "interaction_not_pending",
"retryable": false
} | \ No newline at end of file diff --git a/docs/models/internchaterrormetadata.mdx b/docs/models/internchaterrormetadata.mdx deleted file mode 100644 index 32da66239..000000000 --- a/docs/models/internchaterrormetadata.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: "InternChatErrorMetadata" ---- - -Machine-readable detail for the failure. - -## Example Usage - -```typescript -import { InternChatErrorMetadata } from "@openrouter/sdk/models"; - -let value: InternChatErrorMetadata = { - reason: "interaction_not_pending", - retryable: false, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `reason` | [models.InternChatErrorMetadataReason](../models/internchaterrormetadatareason.mdx) | ✔️ | A stable reason a client can branch on. | -| `retryable` | *boolean* | ✔️ | Whether the same request may be sent again unchanged. Always `true` for the transient refusals — `busy`, `intern_not_ready`, `intern_unreachable`, `rate_limited`, `stream_severed` and `timeout` — and always `false` for the ones a retry cannot fix. For `turn_failed` it varies by failure and is the intern's own classification of what went wrong: `true` for an upstream overload, rate limit, timeout or transport fault, `false` for an authentication or bad-request failure that would be rejected the same way again. Branch on this field rather than on `reason` when deciding whether to retry. A `429`, and a `409` or `503` with reason `busy`, also carry a `Retry-After` header saying how long to wait. | \ No newline at end of file diff --git a/docs/models/internchaterrormetadatareason.mdx b/docs/models/internchaterrormetadatareason.mdx deleted file mode 100644 index 1fe710eeb..000000000 --- a/docs/models/internchaterrormetadatareason.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: "InternChatErrorMetadataReason" ---- - -A stable reason a client can branch on. - -## Example Usage - -```typescript -import { InternChatErrorMetadataReason } from "@openrouter/sdk/models"; - -let value: InternChatErrorMetadataReason = "client_closed_request"; - -// Open enum: unrecognized values are captured as Unrecognized -``` - -## Values - -```typescript -"attachment_failed" | "bad_request" | "busy" | "client_closed_request" | "interaction_not_pending" | "interaction_unknown" | "intern_not_ready" | "intern_rejected" | "intern_unreachable" | "not_found" | "payload_too_large" | "rate_limited" | "run_ended" | "stream_severed" | "timeout" | "turn_failed" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/internchatmessage.mdx b/docs/models/internchatmessage.mdx deleted file mode 100644 index 580223869..000000000 --- a/docs/models/internchatmessage.mdx +++ /dev/null @@ -1,54 +0,0 @@ ---- -title: "InternChatMessage" ---- - -One OpenAI-compatible chat message, discriminated by `role`. - - -## Supported Types - -### `models.InternChatAssistantMessage` - -```typescript -const value: models.InternChatAssistantMessage = { - role: "assistant", -}; -``` - -### `models.InternChatDeveloperMessage` - -```typescript -const value: models.InternChatDeveloperMessage = { - content: "Summarize the open pull requests.", - role: "developer", -}; -``` - -### `models.InternChatSystemMessage` - -```typescript -const value: models.InternChatSystemMessage = { - content: "Summarize the open pull requests.", - role: "system", -}; -``` - -### `models.InternChatToolMessage` - -```typescript -const value: models.InternChatToolMessage = { - content: "Summarize the open pull requests.", - role: "tool", - toolCallId: "", -}; -``` - -### `models.InternChatUserMessage` - -```typescript -const value: models.InternChatUserMessage = { - content: "Summarize the open pull requests.", - role: "user", -}; -``` - diff --git a/docs/models/internchatmessagecontent.mdx b/docs/models/internchatmessagecontent.mdx deleted file mode 100644 index 21b1551c6..000000000 --- a/docs/models/internchatmessagecontent.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: "InternChatMessageContent" ---- - -Message text as a string or a list of text parts. Assistant history may carry null. Only the last message is read; earlier messages are accepted so ordinary clients can resend history. - - -## Supported Types - -### `string` - -```typescript -const value: string = "Summarize the open pull requests."; -``` - -### `models.InternChatTextPart[]` - -```typescript -const value: models.InternChatTextPart[] = [ - { - text: "Summarize the open pull requests.", - type: "text", - }, -]; -``` - diff --git a/docs/models/internchatprompttokensdetails.mdx b/docs/models/internchatprompttokensdetails.mdx deleted file mode 100644 index a2668dc81..000000000 --- a/docs/models/internchatprompttokensdetails.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: "InternChatPromptTokensDetails" ---- - -Prompt tokens served from cache, when the daemon reported them. - -## Example Usage - -```typescript -import { InternChatPromptTokensDetails } from "@openrouter/sdk/models"; - -let value: InternChatPromptTokensDetails = { - cachedTokens: 1024, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `cachedTokens` | *number* | ✔️ | N/A | \ No newline at end of file diff --git a/docs/models/internchatsteeredresponse.mdx b/docs/models/internchatsteeredresponse.mdx deleted file mode 100644 index 661ee71f5..000000000 --- a/docs/models/internchatsteeredresponse.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: "InternChatSteeredResponse" ---- - -The message was delivered into the turn already running on the same session. Its effect is streamed on that turn, not here. - -## Example Usage - -```typescript -import { InternChatSteeredResponse } from "@openrouter/sdk/models"; - -let value: InternChatSteeredResponse = { - sessionId: "sess_01j9x0k4q7v8r2t3m6n5p8w9y1", - status: "steered", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `sessionId` | *string* | ✔️ | The session of the running turn the message was delivered to. | sess_01j9x0k4q7v8r2t3m6n5p8w9y1 | -| `status` | [models.InternChatSteeredResponseStatus](../models/internchatsteeredresponsestatus.mdx) | ✔️ | The message was handed to the turn already running on this session. | | \ No newline at end of file diff --git a/docs/models/internchatsteeredresponsestatus.mdx b/docs/models/internchatsteeredresponsestatus.mdx deleted file mode 100644 index 132c04aad..000000000 --- a/docs/models/internchatsteeredresponsestatus.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "InternChatSteeredResponseStatus" ---- - -The message was handed to the turn already running on this session. - -## Example Usage - -```typescript -import { InternChatSteeredResponseStatus } from "@openrouter/sdk/models"; - -let value: InternChatSteeredResponseStatus = "steered"; -``` - -## Values - -```typescript -"steered" -``` \ No newline at end of file diff --git a/docs/models/internchatstreamerror.mdx b/docs/models/internchatstreamerror.mdx deleted file mode 100644 index 78e2da4b0..000000000 --- a/docs/models/internchatstreamerror.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: "InternChatStreamError" ---- - -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. - -## Example Usage - -```typescript -import { InternChatStreamError } from "@openrouter/sdk/models"; - -let value: InternChatStreamError = { - code: 502, - message: "The intern could not continue this run.", - metadata: { - reason: "attachment_failed", - retryable: false, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `code` | *number* | ✔️ | The HTTP status this failure would have had before the stream opened. | | -| `message` | *string* | ✔️ | N/A | | -| `metadata` | [models.InternChatErrorMetadata](../models/internchaterrormetadata.mdx) | ✔️ | Machine-readable detail for the failure. | \{
"reason": "interaction_not_pending",
"retryable": false
} | \ No newline at end of file diff --git a/docs/models/internchatstreamingresponse.mdx b/docs/models/internchatstreamingresponse.mdx deleted file mode 100644 index 67a8a9cc8..000000000 --- a/docs/models/internchatstreamingresponse.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: "InternChatStreamingResponse" ---- - -A server-sent event carrying one chunk. The stream ends with `data: [DONE]`. - -## Example Usage - -```typescript -import { InternChatStreamingResponse } from "@openrouter/sdk/models"; - -let value: InternChatStreamingResponse = { - data: { - choices: [ - { - delta: {}, - finishReason: null, - index: 0, - }, - ], - created: 1789537541, - id: "chatcmpl-f727571a-3bad-4e0d-8a9e-f18f8cda9750", - model: "openrouter/intern", - object: "chat.completion.chunk", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [models.InternChatCompletionChunk](../models/internchatcompletionchunk.mdx) | ✔️ | One `data:` line of the stream. A run streams a role chunk, content and reasoning chunks, then a finish chunk: `stop`, `tool_calls` (the run is paused for input) or `error` (with an `error` object). A final chunk with empty `choices` follows in every case, carrying `session_id` and `usage` (`null` unless the daemon reported usage, and always `null` after `tool_calls`). Every stream ends with `[DONE]`. | \{
"choices": [
\{
"delta": \{
"content": "Hello"
},
"finish_reason": null,
"index": 0
}
],
"created": 1789537541,
"id": "chatcmpl-f727571a-3bad-4e0d-8a9e-f18f8cda9750",
"model": "openrouter/intern",
"object": "chat.completion.chunk"
} | \ No newline at end of file diff --git a/docs/models/internchatsystemmessage.mdx b/docs/models/internchatsystemmessage.mdx deleted file mode 100644 index c967ae36b..000000000 --- a/docs/models/internchatsystemmessage.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: "InternChatSystemMessage" ---- - -A system message. Accepted for client compatibility and not forwarded. - -## Example Usage - -```typescript -import { InternChatSystemMessage } from "@openrouter/sdk/models"; - -let value: InternChatSystemMessage = { - content: "Summarize the open pull requests.", - role: "system", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content` | *models.InternChatMessageContent* | ✔️ | Message text as a string or a list of text parts. Assistant history may carry null. Only the last message is read; earlier messages are accepted so ordinary clients can resend history. | Summarize the open pull requests. | -| `role` | *"system"* | ✔️ | N/A | | \ No newline at end of file diff --git a/docs/models/internchattextpart.mdx b/docs/models/internchattextpart.mdx deleted file mode 100644 index eacc8ed54..000000000 --- a/docs/models/internchattextpart.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: "InternChatTextPart" ---- - -One text part of a message. - -## Example Usage - -```typescript -import { InternChatTextPart } from "@openrouter/sdk/models"; - -let value: InternChatTextPart = { - text: "Summarize the open pull requests.", - type: "text", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `text` | *string* | ✔️ | N/A | -| `type` | [models.InternChatTextPartType](../models/internchattextparttype.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/docs/models/internchattextparttype.mdx b/docs/models/internchattextparttype.mdx deleted file mode 100644 index b39fee050..000000000 --- a/docs/models/internchattextparttype.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: "InternChatTextPartType" ---- - -## Example Usage - -```typescript -import { InternChatTextPartType } from "@openrouter/sdk/models"; - -let value: InternChatTextPartType = "text"; -``` - -## Values - -```typescript -"text" -``` \ No newline at end of file diff --git a/docs/models/internchattoolcall.mdx b/docs/models/internchattoolcall.mdx deleted file mode 100644 index b8d9d58c8..000000000 --- a/docs/models/internchattoolcall.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: "InternChatToolCall" ---- - -An `openrouter.provide_input` request. The run pauses on the daemon until a `tool` message answers it, the caller cancels it, or its interaction deadline passes. - -## Example Usage - -```typescript -import { InternChatToolCall } from "@openrouter/sdk/models"; - -let value: InternChatToolCall = { - function: { - arguments: - "{\"fields\":[{\"name\":\"answer\",\"options\":[\"red\",\"blue\",\"Other\"],\"required\":true,\"type\":\"string\"}],\"kind\":\"elicitation\",\"message\":\"Which colour do you prefer?\"}", - name: "openrouter.provide_input", - }, - id: "15e90ad6-5320-4a59-af4f-b371428154fa", - index: 0, - type: "function", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `function` | [models.InternChatToolCallFunction](../models/internchattoolcallfunction.mdx) | ✔️ | The single tool this endpoint calls, asking the caller for input. | \{
"arguments": "\{\"fields\":[\{\"name\":\"answer\",\"options\":[\"red\",\"blue\",\"Other\"],\"required\":true,\"type\":\"string\"}],\"kind\":\"elicitation\",\"message\":\"Which colour do you prefer?\"}",
"name": "openrouter.provide_input"
} | -| `id` | *string* | ✔️ | The interaction id. Send it back as `tool_call_id` on the `tool` message that answers it. | 15e90ad6-5320-4a59-af4f-b371428154fa | -| `index` | *number* | ✔️ | N/A | | -| `type` | [models.InternChatToolCallType](../models/internchattoolcalltype.mdx) | ✔️ | N/A | | \ No newline at end of file diff --git a/docs/models/internchattoolcallfunction.mdx b/docs/models/internchattoolcallfunction.mdx deleted file mode 100644 index c378c57e1..000000000 --- a/docs/models/internchattoolcallfunction.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "InternChatToolCallFunction" ---- - -The single tool this endpoint calls, asking the caller for input. - -## Example Usage - -```typescript -import { InternChatToolCallFunction } from "@openrouter/sdk/models"; - -let value: InternChatToolCallFunction = { - arguments: - "{\"fields\":[{\"name\":\"answer\",\"options\":[\"red\",\"blue\",\"Other\"],\"required\":true,\"type\":\"string\"}],\"kind\":\"elicitation\",\"message\":\"Which colour do you prefer?\"}", - name: "openrouter.provide_input", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `arguments` | *string* | ✔️ | A JSON object string describing the interaction. A permission request is `{"kind":"permission","operation":,"options":[]}`. A question is `{"kind":"elicitation","message":,"fields":[]}`. | \{"fields":[\{"name":"answer","options":["red","blue","Other"],"required":true,"type":"string"}],"kind":"elicitation","message":"Which colour do you prefer?"} | -| `name` | [models.InternChatToolCallFunctionName](../models/internchattoolcallfunctionname.mdx) | ✔️ | N/A | | \ No newline at end of file diff --git a/docs/models/internchattoolcallfunctionname.mdx b/docs/models/internchattoolcallfunctionname.mdx deleted file mode 100644 index d143ffebc..000000000 --- a/docs/models/internchattoolcallfunctionname.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: "InternChatToolCallFunctionName" ---- - -## Example Usage - -```typescript -import { InternChatToolCallFunctionName } from "@openrouter/sdk/models"; - -let value: InternChatToolCallFunctionName = "openrouter.provide_input"; -``` - -## Values - -```typescript -"openrouter.provide_input" -``` \ No newline at end of file diff --git a/docs/models/internchattoolcalltype.mdx b/docs/models/internchattoolcalltype.mdx deleted file mode 100644 index 9fbd18166..000000000 --- a/docs/models/internchattoolcalltype.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: "InternChatToolCallType" ---- - -## Example Usage - -```typescript -import { InternChatToolCallType } from "@openrouter/sdk/models"; - -let value: InternChatToolCallType = "function"; -``` - -## Values - -```typescript -"function" -``` \ No newline at end of file diff --git a/docs/models/internchattoolmessage.mdx b/docs/models/internchattoolmessage.mdx deleted file mode 100644 index 4b869f29b..000000000 --- a/docs/models/internchattoolmessage.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: "InternChatToolMessage" ---- - -The answer to an `openrouter.provide_input` tool call. `tool_call_id` is the streamed tool call id and `session_id` must name the same session. For a permission, `content` is one of the offered option kinds (`allow_once`, `allow_always`, `reject_once`, `reject_always`) or `cancel`. For a question (elicitation), `content` is a JSON object string with `action` (`accept`, `decline` or `cancel`) and, for `accept`, `content` holding the field values. The answer is delivered to the run that asked. It never starts a new run. - -## Example Usage - -```typescript -import { InternChatToolMessage } from "@openrouter/sdk/models"; - -let value: InternChatToolMessage = { - content: "Summarize the open pull requests.", - role: "tool", - toolCallId: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content` | *models.InternChatMessageContent* | ✔️ | Message text as a string or a list of text parts. Assistant history may carry null. Only the last message is read; earlier messages are accepted so ordinary clients can resend history. | Summarize the open pull requests. | -| `role` | *"tool"* | ✔️ | N/A | | -| `toolCallId` | *string* | ✔️ | N/A | | \ No newline at end of file diff --git a/docs/models/internchatusage.mdx b/docs/models/internchatusage.mdx deleted file mode 100644 index cf6086bde..000000000 --- a/docs/models/internchatusage.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: "InternChatUsage" ---- - -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. - -## Example Usage - -```typescript -import { InternChatUsage } from "@openrouter/sdk/models"; - -let value: InternChatUsage = { - completionTokens: 12, - promptTokens: 40, - totalTokens: 52, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `completionTokens` | *number* | ✔️ | N/A | | -| `cost` | *number* | ➖ | The cost of the run in USD, when the daemon reported one. | | -| `promptTokens` | *number* | ✔️ | N/A | | -| `promptTokensDetails` | [models.InternChatPromptTokensDetails](../models/internchatprompttokensdetails.mdx) | ➖ | Prompt tokens served from cache, when the daemon reported them. | \{
"cached_tokens": 1024
} | -| `totalTokens` | *number* | ✔️ | N/A | | \ No newline at end of file diff --git a/docs/models/internchatusermessage.mdx b/docs/models/internchatusermessage.mdx deleted file mode 100644 index 296798c7f..000000000 --- a/docs/models/internchatusermessage.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: "InternChatUserMessage" ---- - -A user message. When it is the last message its text is the prompt for a new run, at most 32000 characters. - -## Example Usage - -```typescript -import { InternChatUserMessage } from "@openrouter/sdk/models"; - -let value: InternChatUserMessage = { - content: "Summarize the open pull requests.", - role: "user", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content` | *models.InternChatMessageContent* | ✔️ | Message text as a string or a list of text parts. Assistant history may carry null. Only the last message is read; earlier messages are accepted so ordinary clients can resend history. | Summarize the open pull requests. | -| `role` | *"user"* | ✔️ | N/A | | \ No newline at end of file diff --git a/docs/models/internconnection.mdx b/docs/models/internconnection.mdx deleted file mode 100644 index a85b08568..000000000 --- a/docs/models/internconnection.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: "InternConnection" ---- - -## Example Usage - -```typescript -import { InternConnection } from "@openrouter/sdk/models"; - -let value: InternConnection = { - account: { - actsAs: "", - isYourAccountLinked: true, - note: "", - scope: "yours", - }, - id: "", - isEnabled: false, - isInternOnly: true, - kind: "google", - mcpServerName: "", - name: "", - offReason: "disabled", - server: null, - status: { - reason: null, - state: "error", - }, - toolCount: 328769, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `account` | [models.Account](../models/account.mdx) | ✔️ | N/A | -| `id` | *string* | ✔️ | Stable id: the credential id of an MCP server, else the kind (`slack`, `github`, `google`). | -| `isEnabled` | *boolean* | ✔️ | Whether the intern reaches it now. | -| `isInternOnly` | *boolean* | ✔️ | Scoped to this intern rather than shared by the workspace. | -| `kind` | [models.Kind](../models/kind.mdx) | ✔️ | N/A | -| `mcpServerName` | *string* | ✔️ | The name the intern's MCP config keys the server by; null when it is not an MCP server or is off. | -| `name` | *string* | ✔️ | Display name. | -| `offReason` | [models.OffReason](../models/offreason.mdx) | ✔️ | `switched_off` for this intern, `disabled` for the whole workspace; null while on. | -| `server` | [models.Server](../models/server.mdx) | ✔️ | N/A | -| `status` | [models.InternConnectionStatus](../models/internconnectionstatus.mdx) | ✔️ | N/A | -| `toolCount` | *number* | ✔️ | Tools found by the last successful test. | \ No newline at end of file diff --git a/docs/models/internconnectionlist.mdx b/docs/models/internconnectionlist.mdx deleted file mode 100644 index 8b96723a9..000000000 --- a/docs/models/internconnectionlist.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "InternConnectionList" ---- - -## Example Usage - -```typescript -import { InternConnectionList } from "@openrouter/sdk/models"; - -let value: InternConnectionList = { - data: [], -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `data` | [models.InternConnection](../models/internconnection.mdx)[] | ✔️ | N/A | \ No newline at end of file diff --git a/docs/models/internconnectionscope.mdx b/docs/models/internconnectionscope.mdx deleted file mode 100644 index a0592c4e9..000000000 --- a/docs/models/internconnectionscope.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: "InternConnectionScope" ---- - -`workspace` for a shared connection, `yours` for the key user's personal account, `shared` for a teammate's. - -## Example Usage - -```typescript -import { InternConnectionScope } from "@openrouter/sdk/models"; - -let value: InternConnectionScope = "workspace"; - -// Open enum: unrecognized values are captured as Unrecognized -``` - -## Values - -```typescript -"workspace" | "yours" | "shared" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/internconnectionstatus.mdx b/docs/models/internconnectionstatus.mdx deleted file mode 100644 index a966e542a..000000000 --- a/docs/models/internconnectionstatus.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: "InternConnectionStatus" ---- - -## Example Usage - -```typescript -import { InternConnectionStatus } from "@openrouter/sdk/models"; - -let value: InternConnectionStatus = { - reason: "", - state: "error", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| `reason` | *string* | ✔️ | N/A | -| `state` | [models.StateEnum](../models/stateenum.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/docs/models/interndaemonaccess.mdx b/docs/models/interndaemonaccess.mdx deleted file mode 100644 index 23af535a3..000000000 --- a/docs/models/interndaemonaccess.mdx +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: "InternDaemonAccess" ---- - -The intern daemon's origin, the bearer `ori tui --host` sends to it as `ORI_DAEMON_TOKEN`, and who the caller is on the intern. - -## Example Usage - -```typescript -import { InternDaemonAccess } from "@openrouter/sdk/models"; - -let value: InternDaemonAccess = { - origin: "https://research-assistant-7c9e6679.or.bot", - token: "daemon_token", - viewer: { - principals: [ - "clerk:user_2abc", - "slack:T0123:U0456", - ], - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `origin` | *string* | ✔️ | N/A | -| `token` | *string* | ✔️ | N/A | -| `viewer` | [models.Viewer](../models/viewer.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/docs/models/interninvokeacceptedresponse.mdx b/docs/models/interninvokeacceptedresponse.mdx deleted file mode 100644 index 810a165cd..000000000 --- a/docs/models/interninvokeacceptedresponse.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: "InternInvokeAcceptedResponse" ---- - -The intern admitted the prompt. The run continues on the intern. - -## Example Usage - -```typescript -import { InternInvokeAcceptedResponse } from "@openrouter/sdk/models"; - -let value: InternInvokeAcceptedResponse = { - sessionId: "b51a0e21-368b-4780-a220-14655bf28c55", - status: "started", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -| `sessionId` | *string* | ✔️ | The session the run belongs to. Send it back to continue the conversation. | b51a0e21-368b-4780-a220-14655bf28c55 | -| `status` | [models.InternInvokeAcceptedResponseStatus](../models/interninvokeacceptedresponsestatus.mdx) | ✔️ | `started` when a new run began. `steered` when the session already had a run going and the prompt was delivered into it instead. | started | \ No newline at end of file diff --git a/docs/models/interninvokeacceptedresponsestatus.mdx b/docs/models/interninvokeacceptedresponsestatus.mdx deleted file mode 100644 index acefdeb83..000000000 --- a/docs/models/interninvokeacceptedresponsestatus.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: "InternInvokeAcceptedResponseStatus" ---- - -`started` when a new run began. `steered` when the session already had a run going and the prompt was delivered into it instead. - -## Example Usage - -```typescript -import { InternInvokeAcceptedResponseStatus } from "@openrouter/sdk/models"; - -let value: InternInvokeAcceptedResponseStatus = "started"; - -// Open enum: unrecognized values are captured as Unrecognized -``` - -## Values - -```typescript -"started" | "steered" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/interninvokerequest.mdx b/docs/models/interninvokerequest.mdx deleted file mode 100644 index 13a5d14a2..000000000 --- a/docs/models/interninvokerequest.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: "InternInvokeRequest" ---- - -A prompt to run on the intern without holding a connection open. - -## Example Usage - -```typescript -import { InternInvokeRequest } from "@openrouter/sdk/models"; - -let value: InternInvokeRequest = { - input: - "New support ticket 48213. Case token: ct_9f2c. Investigate and reply.", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `input` | *string* | ✔️ | The prompt for the run, at most 32000 characters. | New support ticket 48213. Case token: ct_9f2c. Investigate and reply. | -| `sessionId` | *string* | ➖ | The session to run in. Send the `session_id` from an earlier `202` to continue that conversation, for example to hand the intern a decision on a case it is working. Omit it to start a new session. Only a `session_id` this endpoint issued to the same caller on the same intern is accepted; any other is refused with `404`. | b51a0e21-368b-4780-a220-14655bf28c55 | \ No newline at end of file diff --git a/docs/models/internlifecycleerrorerror.mdx b/docs/models/internlifecycleerrorerror.mdx deleted file mode 100644 index 91bb8e851..000000000 --- a/docs/models/internlifecycleerrorerror.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: "InternLifecycleErrorError" ---- - -## Example Usage - -```typescript -import { InternLifecycleErrorError } from "@openrouter/sdk/models"; - -let value: InternLifecycleErrorError = { - code: "", - message: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `code` | *models.Code* | ✔️ | N/A | -| `message` | *string* | ✔️ | N/A | -| `metadata` | [models.InternLifecycleErrorMetadata](../models/internlifecycleerrormetadata.mdx) | ➖ | N/A | \ No newline at end of file diff --git a/docs/models/internlifecycleerrormetadata.mdx b/docs/models/internlifecycleerrormetadata.mdx deleted file mode 100644 index 329e74559..000000000 --- a/docs/models/internlifecycleerrormetadata.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: "InternLifecycleErrorMetadata" ---- - -## Example Usage - -```typescript -import { InternLifecycleErrorMetadata } from "@openrouter/sdk/models"; - -let value: InternLifecycleErrorMetadata = { - reason: "", - retryable: false, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `reason` | *string* | ✔️ | N/A | -| `retryable` | *boolean* | ✔️ | N/A | \ No newline at end of file diff --git a/docs/models/internlistresponse.mdx b/docs/models/internlistresponse.mdx deleted file mode 100644 index 63ef2891b..000000000 --- a/docs/models/internlistresponse.mdx +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: "InternListResponse" ---- - -Interns visible to the authenticated API key. - -## Example Usage - -```typescript -import { InternListResponse } from "@openrouter/sdk/models"; - -let value: InternListResponse = { - data: [ - { - attachedVaultId: null, - createdAt: "2026-09-16T08:30:00.000Z", - description: "Researches customer questions", - hostname: "research-assistant.openrouter.ai", - id: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - instructions: null, - lastFailureMessage: null, - model: "openai/gpt-5.4", - name: "research-assistant", - progress: null, - status: "running", - updatedAt: "2026-09-16T08:45:00.000Z", - vaultId: "b431c59d-6eed-41ac-bc89-9a89be79a121", - workspaceId: "89f9f5b2-3f89-4eaf-83ca-5ceae149e8bb", - }, - ], - hasMore: false, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `data` | [models.Intern](../models/intern.mdx)[] | ✔️ | N/A | | -| `hasMore` | *boolean* | ✔️ | True when more interns match the current filters. | | -| `nextCursor` | *string* | ➖ | Opaque cursor, present when `has_more` is true. Pass it as `starting_after` to fetch the next page. | MjAyNi0wOS0xNlQwODozMDowMC4wMDAwMDBafDdjOWU2Njc5LTc0MjUtNDBkZS05NDRiLWUwN2ZjMWY5MGFlNw | \ No newline at end of file diff --git a/docs/models/internstatus.mdx b/docs/models/internstatus.mdx deleted file mode 100644 index 152f9c583..000000000 --- a/docs/models/internstatus.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: "InternStatus" ---- - -Lifecycle status. - -## Example Usage - -```typescript -import { InternStatus } from "@openrouter/sdk/models"; - -let value: InternStatus = "provisioning"; - -// Open enum: unrecognized values are captured as Unrecognized -``` - -## Values - -```typescript -"awaiting_slack_install" | "queued" | "provisioning" | "running" | "failed" | "stopped" | "destroying" | "destroy_failed" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/kind.mdx b/docs/models/kind.mdx deleted file mode 100644 index cdf40b04e..000000000 --- a/docs/models/kind.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "Kind" ---- - -## Example Usage - -```typescript -import { Kind } from "@openrouter/sdk/models"; - -let value: Kind = "slack"; - -// Open enum: unrecognized values are captured as Unrecognized -``` - -## Values - -```typescript -"slack" | "github" | "google" | "mcp" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/offreason.mdx b/docs/models/offreason.mdx deleted file mode 100644 index 08e766bda..000000000 --- a/docs/models/offreason.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: "OffReason" ---- - -`switched_off` for this intern, `disabled` for the whole workspace; null while on. - -## Example Usage - -```typescript -import { OffReason } from "@openrouter/sdk/models"; - -let value: OffReason = "disabled"; - -// Open enum: unrecognized values are captured as Unrecognized -``` - -## Values - -```typescript -"switched_off" | "disabled" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/operations/createinternchatcompletionglobals.mdx b/docs/models/operations/createinternchatcompletionglobals.mdx deleted file mode 100644 index cca17cbb6..000000000 --- a/docs/models/operations/createinternchatcompletionglobals.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "CreateInternChatCompletionGlobals" ---- - -## Example Usage - -```typescript -import { CreateInternChatCompletionGlobals } from "@openrouter/sdk/models/operations"; - -let value: CreateInternChatCompletionGlobals = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/models/operations/createinternchatcompletionrequest.mdx b/docs/models/operations/createinternchatcompletionrequest.mdx deleted file mode 100644 index f059da5e5..000000000 --- a/docs/models/operations/createinternchatcompletionrequest.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: "CreateInternChatCompletionRequest" ---- - -## Example Usage - -```typescript -import { CreateInternChatCompletionRequest } from "@openrouter/sdk/models/operations"; - -let value: CreateInternChatCompletionRequest = { - internId: "a11e0000-0000-4000-8000-000000000005", - internChatCompletionRequest: { - messages: [ - { - content: "Summarize the open pull requests.", - role: "user", - }, - ], - stream: true, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `internId` | *string* | ✔️ | The intern to talk to. | a11e0000-0000-4000-8000-000000000005 | -| `internChatCompletionRequest` | [models.InternChatCompletionRequest](../../models/internchatcompletionrequest.mdx) | ✔️ | N/A | \{
"approval_mode": "manual",
"messages": [
\{
"content": "Summarize the open pull requests.",
"role": "user"
}
],
"stream": true
} | \ No newline at end of file diff --git a/docs/models/operations/createinternchatcompletionresponse.mdx b/docs/models/operations/createinternchatcompletionresponse.mdx deleted file mode 100644 index c27e91a48..000000000 --- a/docs/models/operations/createinternchatcompletionresponse.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: "CreateInternChatCompletionResponse" ---- - -## Example Usage - -```typescript -import { CreateInternChatCompletionResponse } from "@openrouter/sdk/models/operations"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `headers` | Record\ | ✔️ | N/A | -| `result` | *operations.CreateInternChatCompletionResponseResult* | ✔️ | N/A | \ No newline at end of file diff --git a/docs/models/operations/createinternchatcompletionresponseresult.mdx b/docs/models/operations/createinternchatcompletionresponseresult.mdx deleted file mode 100644 index 49ea5b618..000000000 --- a/docs/models/operations/createinternchatcompletionresponseresult.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: "CreateInternChatCompletionResponseResult" ---- - -## Supported Types - -### `EventStream` - -### `models.InternChatSteeredResponse` - -```typescript -const value: models.InternChatSteeredResponse = { - sessionId: "sess_01j9x0k4q7v8r2t3m6n5p8w9y1", - status: "steered", -}; -``` - diff --git a/docs/models/operations/createinternglobals.mdx b/docs/models/operations/createinternglobals.mdx deleted file mode 100644 index e7525fe98..000000000 --- a/docs/models/operations/createinternglobals.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "CreateInternGlobals" ---- - -## Example Usage - -```typescript -import { CreateInternGlobals } from "@openrouter/sdk/models/operations"; - -let value: CreateInternGlobals = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/models/operations/createinternrequest.mdx b/docs/models/operations/createinternrequest.mdx deleted file mode 100644 index 427633d61..000000000 --- a/docs/models/operations/createinternrequest.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: "CreateInternRequest" ---- - -## Example Usage - -```typescript -import { CreateInternRequest } from "@openrouter/sdk/models/operations"; - -let value: CreateInternRequest = { - createInternRequest: { - name: "research-assistant", - provision: true, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `idempotencyKey` | *string* | ➖ | Key that makes retries resume the same create operation, from 1 through 255 characters. An empty or longer key is refused with 400. Without the header, the server derives a stable key from the request body. | create-research-assistant-2026-09-16 | -| `createInternRequest` | [models.CreateInternRequest](../../models/createinternrequest.mdx) | ✔️ | N/A | \{
"name": "research-assistant",
"provision": true,
"workspace_id": "89f9f5b2-3f89-4eaf-83ca-5ceae149e8bb"
} | \ No newline at end of file diff --git a/docs/models/operations/deleteinternglobals.mdx b/docs/models/operations/deleteinternglobals.mdx deleted file mode 100644 index c6149f90a..000000000 --- a/docs/models/operations/deleteinternglobals.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "DeleteInternGlobals" ---- - -## Example Usage - -```typescript -import { DeleteInternGlobals } from "@openrouter/sdk/models/operations"; - -let value: DeleteInternGlobals = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/models/operations/deleteinternrequest.mdx b/docs/models/operations/deleteinternrequest.mdx deleted file mode 100644 index 904e1cd4e..000000000 --- a/docs/models/operations/deleteinternrequest.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: "DeleteInternRequest" ---- - -## Example Usage - -```typescript -import { DeleteInternRequest } from "@openrouter/sdk/models/operations"; - -let value: DeleteInternRequest = { - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - deleteInternRequest: { - acknowledgeWorkspaceLoss: true, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `internId` | *string* | ✔️ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | -| `deleteInternRequest` | [models.DeleteInternRequest](../../models/deleteinternrequest.mdx) | ✔️ | N/A | \{
"acknowledge_workspace_loss": true
} | \ No newline at end of file diff --git a/docs/models/operations/getinternconnectionsglobals.mdx b/docs/models/operations/getinternconnectionsglobals.mdx deleted file mode 100644 index 46facbc83..000000000 --- a/docs/models/operations/getinternconnectionsglobals.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "GetInternConnectionsGlobals" ---- - -## Example Usage - -```typescript -import { GetInternConnectionsGlobals } from "@openrouter/sdk/models/operations"; - -let value: GetInternConnectionsGlobals = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/models/operations/getinternconnectionsrequest.mdx b/docs/models/operations/getinternconnectionsrequest.mdx deleted file mode 100644 index ceb13818a..000000000 --- a/docs/models/operations/getinternconnectionsrequest.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: "GetInternConnectionsRequest" ---- - -## Example Usage - -```typescript -import { GetInternConnectionsRequest } from "@openrouter/sdk/models/operations"; - -let value: GetInternConnectionsRequest = { - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `internId` | *string* | ✔️ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | \ No newline at end of file diff --git a/docs/models/operations/getinterndaemonaccessglobals.mdx b/docs/models/operations/getinterndaemonaccessglobals.mdx deleted file mode 100644 index f30f317f8..000000000 --- a/docs/models/operations/getinterndaemonaccessglobals.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "GetInternDaemonAccessGlobals" ---- - -## Example Usage - -```typescript -import { GetInternDaemonAccessGlobals } from "@openrouter/sdk/models/operations"; - -let value: GetInternDaemonAccessGlobals = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/models/operations/getinterndaemonaccessrequest.mdx b/docs/models/operations/getinterndaemonaccessrequest.mdx deleted file mode 100644 index 7c88c0423..000000000 --- a/docs/models/operations/getinterndaemonaccessrequest.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: "GetInternDaemonAccessRequest" ---- - -## Example Usage - -```typescript -import { GetInternDaemonAccessRequest } from "@openrouter/sdk/models/operations"; - -let value: GetInternDaemonAccessRequest = { - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `internId` | *string* | ✔️ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | \ No newline at end of file diff --git a/docs/models/operations/getinterndaemonglobals.mdx b/docs/models/operations/getinterndaemonglobals.mdx deleted file mode 100644 index 19b5b53f9..000000000 --- a/docs/models/operations/getinterndaemonglobals.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "GetInternDaemonGlobals" ---- - -## Example Usage - -```typescript -import { GetInternDaemonGlobals } from "@openrouter/sdk/models/operations"; - -let value: GetInternDaemonGlobals = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/models/operations/getinterndaemonrequest.mdx b/docs/models/operations/getinterndaemonrequest.mdx deleted file mode 100644 index 046c55cec..000000000 --- a/docs/models/operations/getinterndaemonrequest.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: "GetInternDaemonRequest" ---- - -## Example Usage - -```typescript -import { GetInternDaemonRequest } from "@openrouter/sdk/models/operations"; - -let value: GetInternDaemonRequest = { - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `internId` | *string* | ✔️ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | \ No newline at end of file diff --git a/docs/models/operations/getinternglobals.mdx b/docs/models/operations/getinternglobals.mdx deleted file mode 100644 index bb138c805..000000000 --- a/docs/models/operations/getinternglobals.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "GetInternGlobals" ---- - -## Example Usage - -```typescript -import { GetInternGlobals } from "@openrouter/sdk/models/operations"; - -let value: GetInternGlobals = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/models/operations/getinterniconglobals.mdx b/docs/models/operations/getinterniconglobals.mdx deleted file mode 100644 index 1d6d7e4ba..000000000 --- a/docs/models/operations/getinterniconglobals.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "GetInternIconGlobals" ---- - -## Example Usage - -```typescript -import { GetInternIconGlobals } from "@openrouter/sdk/models/operations"; - -let value: GetInternIconGlobals = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/models/operations/getinterniconrequest.mdx b/docs/models/operations/getinterniconrequest.mdx deleted file mode 100644 index 0eb0626c0..000000000 --- a/docs/models/operations/getinterniconrequest.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: "GetInternIconRequest" ---- - -## Example Usage - -```typescript -import { GetInternIconRequest } from "@openrouter/sdk/models/operations"; - -let value: GetInternIconRequest = { - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `internId` | *string* | ✔️ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | -| `v` | *string* | ➖ | The `icon_sha256` the caller expects. | | \ No newline at end of file diff --git a/docs/models/operations/getinternrequest.mdx b/docs/models/operations/getinternrequest.mdx deleted file mode 100644 index 7d47f2d9f..000000000 --- a/docs/models/operations/getinternrequest.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: "GetInternRequest" ---- - -## Example Usage - -```typescript -import { GetInternRequest } from "@openrouter/sdk/models/operations"; - -let value: GetInternRequest = { - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `internId` | *string* | ✔️ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | \ No newline at end of file diff --git a/docs/models/operations/invokeinternglobals.mdx b/docs/models/operations/invokeinternglobals.mdx deleted file mode 100644 index 292a99d15..000000000 --- a/docs/models/operations/invokeinternglobals.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "InvokeInternGlobals" ---- - -## Example Usage - -```typescript -import { InvokeInternGlobals } from "@openrouter/sdk/models/operations"; - -let value: InvokeInternGlobals = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/models/operations/invokeinternrequest.mdx b/docs/models/operations/invokeinternrequest.mdx deleted file mode 100644 index 0823a40d0..000000000 --- a/docs/models/operations/invokeinternrequest.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: "InvokeInternRequest" ---- - -## Example Usage - -```typescript -import { InvokeInternRequest } from "@openrouter/sdk/models/operations"; - -let value: InvokeInternRequest = { - internId: "a11e0000-0000-4000-8000-000000000005", - internInvokeRequest: { - input: - "New support ticket 48213. Case token: ct_9f2c. Investigate and reply.", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `internId` | *string* | ✔️ | The intern to run. | a11e0000-0000-4000-8000-000000000005 | -| `internInvokeRequest` | [models.InternInvokeRequest](../../models/interninvokerequest.mdx) | ✔️ | N/A | \{
"input": "New support ticket 48213. Case token: ct_9f2c. Investigate and reply."
} | \ No newline at end of file diff --git a/docs/models/operations/invokeinternresponse.mdx b/docs/models/operations/invokeinternresponse.mdx deleted file mode 100644 index 605b22f44..000000000 --- a/docs/models/operations/invokeinternresponse.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "InvokeInternResponse" ---- - -## Example Usage - -```typescript -import { InvokeInternResponse } from "@openrouter/sdk/models/operations"; - -let value: InvokeInternResponse = { - headers: {}, - result: { - sessionId: "b51a0e21-368b-4780-a220-14655bf28c55", - status: "started", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `headers` | Record\ | ✔️ | N/A | | -| `result` | [models.InternInvokeAcceptedResponse](../../models/interninvokeacceptedresponse.mdx) | ✔️ | N/A | \{
"session_id": "b51a0e21-368b-4780-a220-14655bf28c55",
"status": "started"
} | \ No newline at end of file diff --git a/docs/models/operations/listinternsglobals.mdx b/docs/models/operations/listinternsglobals.mdx deleted file mode 100644 index 1836f79f7..000000000 --- a/docs/models/operations/listinternsglobals.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "ListInternsGlobals" ---- - -## Example Usage - -```typescript -import { ListInternsGlobals } from "@openrouter/sdk/models/operations"; - -let value: ListInternsGlobals = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/models/operations/listinternsrequest.mdx b/docs/models/operations/listinternsrequest.mdx deleted file mode 100644 index 360550785..000000000 --- a/docs/models/operations/listinternsrequest.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: "ListInternsRequest" ---- - -## Example Usage - -```typescript -import { ListInternsRequest } from "@openrouter/sdk/models/operations"; - -let value: ListInternsRequest = {}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `limit` | *number* | ➖ | Maximum number of interns to return, from 1 through 500. | 50 | -| `status` | [operations.Status](../../models/operations/status.mdx)[] | ➖ | Comma-separated lifecycle statuses to include, at most 8. Repeats are collapsed. | [
"queued",
"running"
] | -| `startingAfter` | *string* | ➖ | The opaque `next_cursor` of the previous page. Returns the interns that come after it in the newest-first order. A malformed cursor is a 400. | MjAyNi0wOS0xNlQwODozMDowMC4wMDAwMDBafDdjOWU2Njc5LTc0MjUtNDBkZS05NDRiLWUwN2ZjMWY5MGFlNw | -| `workspaceId` | *string* | ➖ | Only return interns in this workspace. It must match the API key workspace. | 89f9f5b2-3f89-4eaf-83ca-5ceae149e8bb | \ No newline at end of file diff --git a/docs/models/operations/provisioninternglobals.mdx b/docs/models/operations/provisioninternglobals.mdx deleted file mode 100644 index 0694a703e..000000000 --- a/docs/models/operations/provisioninternglobals.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "ProvisionInternGlobals" ---- - -## Example Usage - -```typescript -import { ProvisionInternGlobals } from "@openrouter/sdk/models/operations"; - -let value: ProvisionInternGlobals = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/models/operations/provisioninternrequest.mdx b/docs/models/operations/provisioninternrequest.mdx deleted file mode 100644 index 89321c90b..000000000 --- a/docs/models/operations/provisioninternrequest.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: "ProvisionInternRequest" ---- - -## Example Usage - -```typescript -import { ProvisionInternRequest } from "@openrouter/sdk/models/operations"; - -let value: ProvisionInternRequest = { - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `internId` | *string* | ✔️ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | \ No newline at end of file diff --git a/docs/models/operations/signinterndaemonaccessrequestglobals.mdx b/docs/models/operations/signinterndaemonaccessrequestglobals.mdx deleted file mode 100644 index ecb784a87..000000000 --- a/docs/models/operations/signinterndaemonaccessrequestglobals.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "SignInternDaemonAccessRequestGlobals" ---- - -## Example Usage - -```typescript -import { SignInternDaemonAccessRequestGlobals } from "@openrouter/sdk/models/operations"; - -let value: SignInternDaemonAccessRequestGlobals = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/models/operations/signinterndaemonaccessrequestrequest.mdx b/docs/models/operations/signinterndaemonaccessrequestrequest.mdx deleted file mode 100644 index e13d3d72d..000000000 --- a/docs/models/operations/signinterndaemonaccessrequestrequest.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: "SignInternDaemonAccessRequestRequest" ---- - -## Example Usage - -```typescript -import { SignInternDaemonAccessRequestRequest } from "@openrouter/sdk/models/operations"; - -let value: SignInternDaemonAccessRequestRequest = { - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - signInternDaemonRequest: { - bodySha256: - "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `internId` | *string* | ✔️ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | -| `signInternDaemonRequest` | [models.SignInternDaemonRequest](../../models/signinterndaemonrequest.mdx) | ✔️ | N/A | | \ No newline at end of file diff --git a/docs/models/operations/signinterndaemonaccessrequestresponse.mdx b/docs/models/operations/signinterndaemonaccessrequestresponse.mdx deleted file mode 100644 index e01e47eef..000000000 --- a/docs/models/operations/signinterndaemonaccessrequestresponse.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: "SignInternDaemonAccessRequestResponse" ---- - -## Example Usage - -```typescript -import { SignInternDaemonAccessRequestResponse } from "@openrouter/sdk/models/operations"; - -let value: SignInternDaemonAccessRequestResponse = { - headers: { - "key": [ - "", - "", - "", - ], - "key1": [], - }, - result: { - xOriInvokeSignature: "MEUCIQ...", - xOriInvokeTimestamp: "1789000000", - xOriInvokeUser: "user_2abc", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | -| `headers` | Record\ | ✔️ | N/A | | -| `result` | [models.SignInternDaemonResponse](../../models/signinterndaemonresponse.mdx) | ✔️ | N/A | \{
"x-ori-invoke-signature": "MEUCIQ...",
"x-ori-invoke-timestamp": "1789000000",
"x-ori-invoke-user": "user_2abc"
} | \ No newline at end of file diff --git a/docs/models/operations/signinterndaemonrequestglobals.mdx b/docs/models/operations/signinterndaemonrequestglobals.mdx deleted file mode 100644 index bf40f2e1a..000000000 --- a/docs/models/operations/signinterndaemonrequestglobals.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "SignInternDaemonRequestGlobals" ---- - -## Example Usage - -```typescript -import { SignInternDaemonRequestGlobals } from "@openrouter/sdk/models/operations"; - -let value: SignInternDaemonRequestGlobals = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/models/operations/signinterndaemonrequestrequest.mdx b/docs/models/operations/signinterndaemonrequestrequest.mdx deleted file mode 100644 index 0dd8c3b0f..000000000 --- a/docs/models/operations/signinterndaemonrequestrequest.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: "SignInternDaemonRequestRequest" ---- - -## Example Usage - -```typescript -import { SignInternDaemonRequestRequest } from "@openrouter/sdk/models/operations"; - -let value: SignInternDaemonRequestRequest = { - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - signInternDaemonRequest: { - bodySha256: - "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `internId` | *string* | ✔️ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | -| `signInternDaemonRequest` | [models.SignInternDaemonRequest](../../models/signinterndaemonrequest.mdx) | ✔️ | N/A | | \ No newline at end of file diff --git a/docs/models/operations/signinterndaemonrequestresponse.mdx b/docs/models/operations/signinterndaemonrequestresponse.mdx deleted file mode 100644 index 3f26b79dc..000000000 --- a/docs/models/operations/signinterndaemonrequestresponse.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: "SignInternDaemonRequestResponse" ---- - -## Example Usage - -```typescript -import { SignInternDaemonRequestResponse } from "@openrouter/sdk/models/operations"; - -let value: SignInternDaemonRequestResponse = { - headers: { - "key": [], - }, - result: { - xOriInvokeSignature: "MEUCIQ...", - xOriInvokeTimestamp: "1789000000", - xOriInvokeUser: "user_2abc", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | -| `headers` | Record\ | ✔️ | N/A | | -| `result` | [models.SignInternDaemonResponse](../../models/signinterndaemonresponse.mdx) | ✔️ | N/A | \{
"x-ori-invoke-signature": "MEUCIQ...",
"x-ori-invoke-timestamp": "1789000000",
"x-ori-invoke-user": "user_2abc"
} | \ No newline at end of file diff --git a/docs/models/operations/status.mdx b/docs/models/operations/status.mdx deleted file mode 100644 index 0db056721..000000000 --- a/docs/models/operations/status.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "Status" ---- - -## Example Usage - -```typescript -import { Status } from "@openrouter/sdk/models/operations"; - -let value: Status = "stopped"; - -// Open enum: unrecognized values are captured as Unrecognized -``` - -## Values - -```typescript -"awaiting_slack_install" | "queued" | "provisioning" | "running" | "failed" | "stopped" | "destroying" | "destroy_failed" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/operations/suspendinternglobals.mdx b/docs/models/operations/suspendinternglobals.mdx deleted file mode 100644 index 1e5dbf6c0..000000000 --- a/docs/models/operations/suspendinternglobals.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "SuspendInternGlobals" ---- - -## Example Usage - -```typescript -import { SuspendInternGlobals } from "@openrouter/sdk/models/operations"; - -let value: SuspendInternGlobals = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/models/operations/suspendinternrequest.mdx b/docs/models/operations/suspendinternrequest.mdx deleted file mode 100644 index 14d81fba4..000000000 --- a/docs/models/operations/suspendinternrequest.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: "SuspendInternRequest" ---- - -## Example Usage - -```typescript -import { SuspendInternRequest } from "@openrouter/sdk/models/operations"; - -let value: SuspendInternRequest = { - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `internId` | *string* | ✔️ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | \ No newline at end of file diff --git a/docs/models/operations/updateinternglobals.mdx b/docs/models/operations/updateinternglobals.mdx deleted file mode 100644 index 2bbf0fac0..000000000 --- a/docs/models/operations/updateinternglobals.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "UpdateInternGlobals" ---- - -## Example Usage - -```typescript -import { UpdateInternGlobals } from "@openrouter/sdk/models/operations"; - -let value: UpdateInternGlobals = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| \ No newline at end of file diff --git a/docs/models/operations/updateinternrequest.mdx b/docs/models/operations/updateinternrequest.mdx deleted file mode 100644 index c5f41b681..000000000 --- a/docs/models/operations/updateinternrequest.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "UpdateInternRequest" ---- - -## Example Usage - -```typescript -import { UpdateInternRequest } from "@openrouter/sdk/models/operations"; - -let value: UpdateInternRequest = { - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - updateInternRequest: {}, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `httpReferer` | *string* | ➖ | 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* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `appCategories` | *string* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `internId` | *string* | ✔️ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | -| `updateInternRequest` | [models.UpdateInternRequest](../../models/updateinternrequest.mdx) | ✔️ | N/A | \{
"description": "Researches customer questions",
"model": "openai/gpt-5.4"
} | \ No newline at end of file diff --git a/docs/models/progress.mdx b/docs/models/progress.mdx deleted file mode 100644 index 3feac8f5a..000000000 --- a/docs/models/progress.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: "Progress" ---- - -Active provisioning step, or null once provisioning has settled. - -## Example Usage - -```typescript -import { Progress } from "@openrouter/sdk/models"; - -let value: Progress = { - stepLabel: "", - stepNumber: 641278, - totalSteps: 340252, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `stepLabel` | *string* | ✔️ | Human-readable label of the active provisioning step. | -| `stepNumber` | *number* | ✔️ | One-based index of the active step. | -| `totalSteps` | *number* | ✔️ | Number of provisioning steps. | \ No newline at end of file diff --git a/docs/models/provisioninternresponse.mdx b/docs/models/provisioninternresponse.mdx deleted file mode 100644 index 3f04a4029..000000000 --- a/docs/models/provisioninternresponse.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "ProvisionInternResponse" ---- - -## Example Usage - -```typescript -import { ProvisionInternResponse } from "@openrouter/sdk/models"; - -let value: ProvisionInternResponse = { - provisioning: true, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `provisioning` | *true* | ✔️ | N/A | \ No newline at end of file diff --git a/docs/models/route.mdx b/docs/models/route.mdx deleted file mode 100644 index db0988ebf..000000000 --- a/docs/models/route.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: "Route" ---- - -The daemon request the proof is for. When present the response also carries the single-use, route-bound proof (`x-ori-invoke-signature-v2`, `x-ori-invoke-nonce`). - -## Example Usage - -```typescript -import { Route } from "@openrouter/sdk/models"; - -let value: Route = { - method: "POST", - path: "/api/invoke", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -| `method` | [models.SignInternDaemonRequestMethod](../models/signinterndaemonrequestmethod.mdx) | ✔️ | The HTTP method of the daemon request. | | -| `path` | *string* | ✔️ | The daemon request path, percent-encoded as sent, without origin or query. The route-bound proof admits only this path. | /api/invoke | \ No newline at end of file diff --git a/docs/models/server.mdx b/docs/models/server.mdx deleted file mode 100644 index ff856f445..000000000 --- a/docs/models/server.mdx +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: "Server" ---- - -## Example Usage - -```typescript -import { Server } from "@openrouter/sdk/models"; - -let value: Server = { - host: null, - surface: "", - transport: "", - url: "https://round-councilman.net", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `host` | *string* | ✔️ | N/A | -| `surface` | *string* | ✔️ | N/A | -| `transport` | *string* | ✔️ | N/A | -| `url` | *string* | ✔️ | N/A | \ No newline at end of file diff --git a/docs/models/signinterndaemonrequest.mdx b/docs/models/signinterndaemonrequest.mdx deleted file mode 100644 index af5de0c4c..000000000 --- a/docs/models/signinterndaemonrequest.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: "SignInternDaemonRequest" ---- - -## Example Usage - -```typescript -import { SignInternDaemonRequest } from "@openrouter/sdk/models"; - -let value: SignInternDaemonRequest = { - bodySha256: - "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `bodySha256` | *string* | ✔️ | Lower-case hex SHA-256 of the exact bytes the CLI will send as the daemon request body. | e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 | -| `route` | [models.Route](../models/route.mdx) | ➖ | The daemon request the proof is for. When present the response also carries the single-use, route-bound proof (`x-ori-invoke-signature-v2`, `x-ori-invoke-nonce`). | | \ No newline at end of file diff --git a/docs/models/signinterndaemonrequestmethod.mdx b/docs/models/signinterndaemonrequestmethod.mdx deleted file mode 100644 index 7d0da39cf..000000000 --- a/docs/models/signinterndaemonrequestmethod.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "SignInternDaemonRequestMethod" ---- - -The HTTP method of the daemon request. - -## Example Usage - -```typescript -import { SignInternDaemonRequestMethod } from "@openrouter/sdk/models"; - -let value: SignInternDaemonRequestMethod = "POST"; -``` - -## Values - -```typescript -"POST" -``` \ No newline at end of file diff --git a/docs/models/signinterndaemonresponse.mdx b/docs/models/signinterndaemonresponse.mdx deleted file mode 100644 index dbef63859..000000000 --- a/docs/models/signinterndaemonresponse.mdx +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: "SignInternDaemonResponse" ---- - -Headers the CLI copies onto the daemon request so the sidecar can verify who is asking. - -## Example Usage - -```typescript -import { SignInternDaemonResponse } from "@openrouter/sdk/models"; - -let value: SignInternDaemonResponse = { - xOriInvokeSignature: "MEUCIQ...", - xOriInvokeTimestamp: "1789000000", - xOriInvokeUser: "user_2abc", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `xOriInvokeNonce` | *string* | ➖ | Present with `x-ori-invoke-signature-v2`: the single-use id that proof is bound to. | -| `xOriInvokeSignature` | *string* | ✔️ | Base64 Ed25519 signature over the intern id, timestamp, user and body digest. | -| `xOriInvokeSignatureV2` | *string* | ➖ | Present when the request named a `route`: Base64 Ed25519 signature over the intern id, timestamp, nonce, user, method, path and body digest. The intern accepts it once. | -| `xOriInvokeTimestamp` | *string* | ✔️ | Unix seconds at signing; the daemon refuses proofs older than its window. | -| `xOriInvokeUser` | *string* | ✔️ | The verified OAuth subject the proof names. Never taken from the request. | \ No newline at end of file diff --git a/docs/models/stateenum.mdx b/docs/models/stateenum.mdx deleted file mode 100644 index e899a71f8..000000000 --- a/docs/models/stateenum.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "StateEnum" ---- - -## Example Usage - -```typescript -import { StateEnum } from "@openrouter/sdk/models"; - -let value: StateEnum = "connected"; - -// Open enum: unrecognized values are captured as Unrecognized -``` - -## Values - -```typescript -"connected" | "needs_reconnect" | "not_tested" | "error" | Unrecognized -``` \ No newline at end of file diff --git a/docs/models/suspendinternresponse.mdx b/docs/models/suspendinternresponse.mdx deleted file mode 100644 index 20c4d4686..000000000 --- a/docs/models/suspendinternresponse.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "SuspendInternResponse" ---- - -## Example Usage - -```typescript -import { SuspendInternResponse } from "@openrouter/sdk/models"; - -let value: SuspendInternResponse = { - suspended: true, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `suspended` | *true* | ✔️ | N/A | \ No newline at end of file diff --git a/docs/models/updateinternrequest.mdx b/docs/models/updateinternrequest.mdx deleted file mode 100644 index 9c4ca333e..000000000 --- a/docs/models/updateinternrequest.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: "UpdateInternRequest" ---- - -Lifecycle settings to change. Omitted fields stay unchanged and null clears a field. - -## Example Usage - -```typescript -import { UpdateInternRequest } from "@openrouter/sdk/models"; - -let value: UpdateInternRequest = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `description` | *string* | ➖ | New free-form description. Null clears it. | -| `instructions` | *string* | ➖ | New standing instructions. Null clears them. | -| `model` | *string* | ➖ | 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* | ➖ | New intern name, unique per creator within the workspace. | \ No newline at end of file diff --git a/docs/models/viewer.mdx b/docs/models/viewer.mdx deleted file mode 100644 index 550b13bca..000000000 --- a/docs/models/viewer.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: "Viewer" ---- - -## Example Usage - -```typescript -import { Viewer } from "@openrouter/sdk/models"; - -let value: Viewer = { - principals: [ - "", - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `principals` | *string*[] | ✔️ | The caller's Ori principals on this intern: `clerk:`, and, when the grant carries `vault:read`, `slack::` for each Slack account they linked to it. A session started by one of them in a one-to-one Slack DM is the caller's to see. | \ No newline at end of file diff --git a/docs/sdks/interns/README.mdx b/docs/sdks/interns/README.mdx deleted file mode 100644 index c37de706c..000000000 --- a/docs/sdks/interns/README.mdx +++ /dev/null @@ -1,1314 +0,0 @@ ---- -title: "Interns" -description: "Create, inspect, update, provision, suspend and delete OpenRouter interns through an API key, and talk to them: the chat route streams OpenAI-compatible completions from one intern, pausing as an `openrouter.provide_input` tool call when the intern needs your permission or an answer. Available to interns programme members; other callers receive 404. See https://openrouter.ai/docs/guides/ori/intern-chat." ---- - -## Overview - -Create, inspect, update, provision, suspend and delete OpenRouter interns through an API key, and talk to them: the chat route streams OpenAI-compatible completions from one intern, pausing as an `openrouter.provide_input` tool call when the intern needs your permission or an answer. Available to interns programme members; other callers receive 404. See https://openrouter.ai/docs/guides/ori/intern-chat. - -### Available Operations - -* [listInterns](#listinterns) - List interns -* [createIntern](#createintern) - Create an intern -* [deleteIntern](#deleteintern) - Delete an intern -* [getIntern](#getintern) - Get an intern -* [updateIntern](#updateintern) - Update an intern -* [getInternConnections](#getinternconnections) - List an intern's connections -* [getInternDaemon](#getinterndaemon) - Get an intern's daemon access -* [~~getInternDaemonAccess~~](#getinterndaemonaccess) - Get an intern's daemon access (deprecated alias) ⚠️ **Deprecated** -* [~~signInternDaemonAccessRequest~~](#signinterndaemonaccessrequest) - Sign a daemon request with the caller's identity (deprecated alias) ⚠️ **Deprecated** -* [signInternDaemonRequest](#signinterndaemonrequest) - Sign a daemon request with the caller's identity -* [getInternIcon](#getinternicon) - Get an intern's icon -* [provisionIntern](#provisionintern) - Provision an intern -* [suspendIntern](#suspendintern) - Suspend an intern -* [chat](#chat) - Stream a chat completion with an intern -* [invoke](#invoke) - Start an intern run without waiting for it - -## listInterns - -Lists interns visible to the authenticated key, newest first. Filter by workspace and one or more lifecycle statuses. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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 - -```typescript -import { OpenRouter } from "@openrouter/sdk"; - -const openRouter = new OpenRouter({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const result = await openRouter.interns.listInterns(); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { OpenRouterCore } from "@openrouter/sdk/core.js"; -import { internsListInterns } from "@openrouter/sdk/funcs/internsListInterns.js"; - -// Use `OpenRouterCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const openRouter = new OpenRouterCore({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const res = await internsListInterns(openRouter); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("internsListInterns failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListInternsRequest](../../models/operations/listinternsrequest.mdx) | ✔️ | The request object to use for the request. | -| `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[models.InternListResponse](../../models/internlistresponse.mdx)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| errors.InternLifecycleError | 400, 401, 403, 404, 408 | application/json | -| errors.InternLifecycleError | 500 | application/json | -| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | - -## createIntern - -Creates an intern in an explicit workspace. The operation also creates its private vault. It can start provisioning immediately or wait for a later provision call. A retry with the same idempotency key and body resumes unfinished work. The request body is capped at 1048576 bytes and a larger body is refused with 413. A non-empty body must declare `Content-Type: application/json` or it is refused with 415. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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 - -```typescript -import { OpenRouter } from "@openrouter/sdk"; - -const openRouter = new OpenRouter({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const result = await openRouter.interns.createIntern({ - createInternRequest: { - name: "research-assistant", - provision: true, - workspaceId: "89f9f5b2-3f89-4eaf-83ca-5ceae149e8bb", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { OpenRouterCore } from "@openrouter/sdk/core.js"; -import { internsCreateIntern } from "@openrouter/sdk/funcs/internsCreateIntern.js"; - -// Use `OpenRouterCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const openRouter = new OpenRouterCore({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const res = await internsCreateIntern(openRouter, { - createInternRequest: { - name: "research-assistant", - provision: true, - workspaceId: "89f9f5b2-3f89-4eaf-83ca-5ceae149e8bb", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("internsCreateIntern failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateInternRequest](../../models/operations/createinternrequest.mdx) | ✔️ | The request object to use for the request. | -| `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[models.Intern](../../models/intern.mdx)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| errors.InternLifecycleError | 400, 401, 403, 404, 408, 409, 413, 415 | application/json | -| errors.InternLifecycleError | 500, 502 | application/json | -| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | - -## deleteIntern - -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. A non-empty body must declare `Content-Type: application/json` or it is refused with 415. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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 - -```typescript -import { OpenRouter } from "@openrouter/sdk"; - -const openRouter = new OpenRouter({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const result = await openRouter.interns.deleteIntern({ - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - deleteInternRequest: { - acknowledgeWorkspaceLoss: true, - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { OpenRouterCore } from "@openrouter/sdk/core.js"; -import { internsDeleteIntern } from "@openrouter/sdk/funcs/internsDeleteIntern.js"; - -// Use `OpenRouterCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const openRouter = new OpenRouterCore({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const res = await internsDeleteIntern(openRouter, { - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - deleteInternRequest: { - acknowledgeWorkspaceLoss: true, - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("internsDeleteIntern failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteInternRequest](../../models/operations/deleteinternrequest.mdx) | ✔️ | The request object to use for the request. | -| `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[models.DeleteInternResponse](../../models/deleteinternresponse.mdx)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| errors.InternLifecycleError | 400, 401, 403, 404, 408, 409, 413, 415 | application/json | -| errors.InternLifecycleError | 500, 502 | application/json | -| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | - -## getIntern - -Returns the public lifecycle state and settings for one visible intern. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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 - -```typescript -import { OpenRouter } from "@openrouter/sdk"; - -const openRouter = new OpenRouter({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const result = await openRouter.interns.getIntern({ - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { OpenRouterCore } from "@openrouter/sdk/core.js"; -import { internsGetIntern } from "@openrouter/sdk/funcs/internsGetIntern.js"; - -// Use `OpenRouterCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const openRouter = new OpenRouterCore({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const res = await internsGetIntern(openRouter, { - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("internsGetIntern failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetInternRequest](../../models/operations/getinternrequest.mdx) | ✔️ | The request object to use for the request. | -| `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[models.Intern](../../models/intern.mdx)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| errors.InternLifecycleError | 401, 403, 404, 408 | application/json | -| errors.InternLifecycleError | 500 | application/json | -| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | - -## updateIntern - -Changes the intern name, description, instructions or model. Omitted fields stay unchanged. The request body is capped at 1048576 bytes and a larger body is refused with 413. A non-empty body must declare `Content-Type: application/json` or it is refused with 415. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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 - -```typescript -import { OpenRouter } from "@openrouter/sdk"; - -const openRouter = new OpenRouter({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const result = await openRouter.interns.updateIntern({ - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - updateInternRequest: { - description: "Researches customer questions", - model: "openai/gpt-5.4", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { OpenRouterCore } from "@openrouter/sdk/core.js"; -import { internsUpdateIntern } from "@openrouter/sdk/funcs/internsUpdateIntern.js"; - -// Use `OpenRouterCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const openRouter = new OpenRouterCore({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const res = await internsUpdateIntern(openRouter, { - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - updateInternRequest: { - description: "Researches customer questions", - model: "openai/gpt-5.4", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("internsUpdateIntern failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UpdateInternRequest](../../models/operations/updateinternrequest.mdx) | ✔️ | The request object to use for the request. | -| `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[models.Intern](../../models/intern.mdx)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| errors.InternLifecycleError | 400, 401, 403, 404, 408, 409, 413, 415 | application/json | -| errors.InternLifecycleError | 500 | application/json | -| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | - -## getInternConnections - -Returns the Slack, GitHub, Google Workspace and MCP connections one visible intern can reach, and the shared ones switched off for it or disabled for the workspace. An OAuth grant needs `vault:read`, because the list names members' personal accounts; without it the route answers 403 `insufficient_scope`. The response is sent with `Cache-Control: no-store`. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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 - -```typescript -import { OpenRouter } from "@openrouter/sdk"; - -const openRouter = new OpenRouter({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const result = await openRouter.interns.getInternConnections({ - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { OpenRouterCore } from "@openrouter/sdk/core.js"; -import { internsGetInternConnections } from "@openrouter/sdk/funcs/internsGetInternConnections.js"; - -// Use `OpenRouterCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const openRouter = new OpenRouterCore({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const res = await internsGetInternConnections(openRouter, { - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("internsGetInternConnections failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetInternConnectionsRequest](../../models/operations/getinternconnectionsrequest.mdx) | ✔️ | The request object to use for the request. | -| `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[models.InternConnectionList](../../models/internconnectionlist.mdx)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| errors.InternLifecycleError | 401, 403, 404, 408 | application/json | -| errors.InternLifecycleError | 500 | application/json | -| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | - -## getInternDaemon - -Returns the origin and daemon token that attach `ori tui --host` to one visible, running intern. The token is a credential: only an OAuth-token caller (`ori login --oidc`) may read it, the response is sent with `Cache-Control: no-store`, and each reveal is logged by caller and intern. API keys get 403 `personal_identity_required`. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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 - -```typescript -import { OpenRouter } from "@openrouter/sdk"; - -const openRouter = new OpenRouter({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const result = await openRouter.interns.getInternDaemon({ - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { OpenRouterCore } from "@openrouter/sdk/core.js"; -import { internsGetInternDaemon } from "@openrouter/sdk/funcs/internsGetInternDaemon.js"; - -// Use `OpenRouterCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const openRouter = new OpenRouterCore({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const res = await internsGetInternDaemon(openRouter, { - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("internsGetInternDaemon failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetInternDaemonRequest](../../models/operations/getinterndaemonrequest.mdx) | ✔️ | The request object to use for the request. | -| `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[models.InternDaemonAccess](../../models/interndaemonaccess.mdx)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| errors.InternLifecycleError | 401, 403, 404, 408, 409 | application/json | -| errors.InternLifecycleError | 500 | application/json | -| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | - -## ~~getInternDaemonAccess~~ - -Deprecated alias of `GET /interns/{internId}/daemon` with the same request, response, and errors. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required. - -> ⚠️ **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. - -### Example Usage - -```typescript -import { OpenRouter } from "@openrouter/sdk"; - -const openRouter = new OpenRouter({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const result = await openRouter.interns.getInternDaemonAccess({ - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { OpenRouterCore } from "@openrouter/sdk/core.js"; -import { internsGetInternDaemonAccess } from "@openrouter/sdk/funcs/internsGetInternDaemonAccess.js"; - -// Use `OpenRouterCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const openRouter = new OpenRouterCore({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const res = await internsGetInternDaemonAccess(openRouter, { - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("internsGetInternDaemonAccess failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetInternDaemonAccessRequest](../../models/operations/getinterndaemonaccessrequest.mdx) | ✔️ | The request object to use for the request. | -| `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[models.InternDaemonAccess](../../models/interndaemonaccess.mdx)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| errors.InternLifecycleError | 401, 403, 404, 408, 409 | application/json | -| errors.InternLifecycleError | 500 | application/json | -| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | - -## ~~signInternDaemonAccessRequest~~ - -Deprecated alias of `POST /interns/{internId}/daemon/sign` with the same request, response, and errors. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required. - -> ⚠️ **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. - -### Example Usage - -```typescript -import { OpenRouter } from "@openrouter/sdk"; - -const openRouter = new OpenRouter({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const result = await openRouter.interns.signInternDaemonAccessRequest({ - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - signInternDaemonRequest: { - bodySha256: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { OpenRouterCore } from "@openrouter/sdk/core.js"; -import { internsSignInternDaemonAccessRequest } from "@openrouter/sdk/funcs/internsSignInternDaemonAccessRequest.js"; - -// Use `OpenRouterCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const openRouter = new OpenRouterCore({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const res = await internsSignInternDaemonAccessRequest(openRouter, { - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - signInternDaemonRequest: { - bodySha256: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("internsSignInternDaemonAccessRequest failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.SignInternDaemonAccessRequestRequest](../../models/operations/signinterndaemonaccessrequestrequest.mdx) | ✔️ | The request object to use for the request. | -| `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[operations.SignInternDaemonAccessRequestResponse](../../models/operations/signinterndaemonaccessrequestresponse.mdx)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.InternLifecycleError | 400, 401, 403, 404, 408, 413, 415 | application/json | -| errors.InternLifecycleError | 429 | application/json | -| errors.InternLifecycleError | 500 | application/json | -| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | - -## signInternDaemonRequest - -Signs the SHA-256 digest of one request the CLI is about to send to the intern daemon, binding it to the intern and to the signed-in member so personal connections resolve. Only an OAuth session from `ori login --oidc` whose grant carries `vault:read` can sign: an API key is refused with 403 because it names no person, and an `interns`-only grant is refused with 403 because a proof releases that user's personal connections. The route is behind the same gate as chat and counts against the chat turn limiter. The response is sent with `Cache-Control: no-store`. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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 - -```typescript -import { OpenRouter } from "@openrouter/sdk"; - -const openRouter = new OpenRouter({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const result = await openRouter.interns.signInternDaemonRequest({ - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - signInternDaemonRequest: { - bodySha256: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { OpenRouterCore } from "@openrouter/sdk/core.js"; -import { internsSignInternDaemonRequest } from "@openrouter/sdk/funcs/internsSignInternDaemonRequest.js"; - -// Use `OpenRouterCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const openRouter = new OpenRouterCore({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const res = await internsSignInternDaemonRequest(openRouter, { - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - signInternDaemonRequest: { - bodySha256: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("internsSignInternDaemonRequest failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.SignInternDaemonRequestRequest](../../models/operations/signinterndaemonrequestrequest.mdx) | ✔️ | The request object to use for the request. | -| `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[operations.SignInternDaemonRequestResponse](../../models/operations/signinterndaemonrequestresponse.mdx)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.InternLifecycleError | 400, 401, 403, 404, 408, 413, 415 | application/json | -| errors.InternLifecycleError | 429 | application/json | -| errors.InternLifecycleError | 500 | application/json | -| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | - -## getInternIcon - -Returns the icon image of one visible intern. Pass the intern's `icon_sha256` as `v` to receive a response that can be cached indefinitely. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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 - -```typescript -import { OpenRouter } from "@openrouter/sdk"; - -const openRouter = new OpenRouter({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const result = await openRouter.interns.getInternIcon({ - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { OpenRouterCore } from "@openrouter/sdk/core.js"; -import { internsGetInternIcon } from "@openrouter/sdk/funcs/internsGetInternIcon.js"; - -// Use `OpenRouterCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const openRouter = new OpenRouterCore({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const res = await internsGetInternIcon(openRouter, { - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("internsGetInternIcon failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetInternIconRequest](../../models/operations/getinterniconrequest.mdx) | ✔️ | The request object to use for the request. | -| `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[ReadableStream\](../../models/.mdx)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| errors.InternLifecycleError | 401, 403, 404, 408 | application/json | -| errors.InternLifecycleError | 500 | application/json | -| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | - -## provisionIntern - -Starts the first boot, or resumes an intern after suspension. This operation takes no request body. A body carrying any field is refused with 400 rather than ignored. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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 - -```typescript -import { OpenRouter } from "@openrouter/sdk"; - -const openRouter = new OpenRouter({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const result = await openRouter.interns.provisionIntern({ - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { OpenRouterCore } from "@openrouter/sdk/core.js"; -import { internsProvisionIntern } from "@openrouter/sdk/funcs/internsProvisionIntern.js"; - -// Use `OpenRouterCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const openRouter = new OpenRouterCore({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const res = await internsProvisionIntern(openRouter, { - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("internsProvisionIntern failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ProvisionInternRequest](../../models/operations/provisioninternrequest.mdx) | ✔️ | The request object to use for the request. | -| `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[models.ProvisionInternResponse](../../models/provisioninternresponse.mdx)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| errors.InternLifecycleError | 400, 401, 403, 404, 408, 409, 413, 415 | application/json | -| errors.InternLifecycleError | 500, 502 | application/json | -| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | - -## suspendIntern - -Stops the intern runtime while keeping its disk and configuration for a later provision call. This operation takes no request body. A body carrying any field is refused with 400 rather than ignored. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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 - -```typescript -import { OpenRouter } from "@openrouter/sdk"; - -const openRouter = new OpenRouter({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const result = await openRouter.interns.suspendIntern({ - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { OpenRouterCore } from "@openrouter/sdk/core.js"; -import { internsSuspendIntern } from "@openrouter/sdk/funcs/internsSuspendIntern.js"; - -// Use `OpenRouterCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const openRouter = new OpenRouterCore({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const res = await internsSuspendIntern(openRouter, { - internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("internsSuspendIntern failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.SuspendInternRequest](../../models/operations/suspendinternrequest.mdx) | ✔️ | The request object to use for the request. | -| `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[models.SuspendInternResponse](../../models/suspendinternresponse.mdx)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| errors.InternLifecycleError | 400, 401, 403, 404, 408, 409, 413, 415 | application/json | -| errors.InternLifecycleError | 500, 502 | application/json | -| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | - -## chat - -Sends a prompt to one of your interns and streams the reply as OpenAI-compatible server-sent events ending with `[DONE]`. The run executes on the intern, which may pause to ask you something. It then streams one `openrouter.provide_input` tool call and finishes with `finish_reason: "tool_calls"`, and the run stays open on the intern. - -Every response, whether it ends with `stop`, `tool_calls` or `error`, is followed by a final chunk with empty `choices` that carries `session_id`, then `data: [DONE]`. That chunk carries the `usage` the intern reported for the run, after `stop` or `error`, and `null` when the intern reported none. After `tool_calls` its `usage` is `null` because the turn is not over. Read through `[DONE]`: the `session_id` you need to reply arrives after the `tool_calls` finish chunk. - -To answer, send a second request with the same `session_id`, the assistant message echoing that tool call, and a `tool` message whose `tool_call_id` is the tool call id and whose `content` is the answer. The answer is delivered to the run that asked and the stream continues from where it paused. A question stays open for its interaction deadline (5 minutes by default) and the run is cancelled when that passes. Rejected replies do not extend the deadline. - -Closing the connection after the `[DONE]` that follows `finish_reason: "tool_calls"` keeps the run alive. Disconnecting while a response is still streaming cancels the run. The stream writes a `: keepalive` comment whenever nothing else has been written for 30 seconds, so a disconnect is noticed within that interval even while the intern is silent. - -A run the intern ends while you are still connected, by cancellation or by a deadline, ends the stream with a `finish_reason: "error"` chunk carrying `410` and reason `run_ended`, then the final empty-`choices` chunk and `[DONE]`. That error reports only an ending the intern confirmed. A connection that breaks without that confirmation ends with reason `stream_severed`, and a client that has already disconnected is promised no final event. - -Set `approval_mode` to `manual` to have the intern ask before approval-bearing tools such as the shell. Omitted, the run self-drives and consents on your behalf. The mode belongs to the run started by that prompt and must be repeated on later prompts. - -Available to interns programme members. Callers outside the programme receive `404` for every path under `/api/v1/interns`. - -### Example Usage - -```typescript -import { OpenRouter } from "@openrouter/sdk"; - -const openRouter = new OpenRouter({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const result = await openRouter.interns.chat({ - internId: "a11e0000-0000-4000-8000-000000000005", - internChatCompletionRequest: { - approvalMode: "manual", - messages: [ - { - content: "Summarize the open pull requests.", - role: "user", - }, - ], - stream: true, - }, - }); - - for await (const event of result) { - console.log(event); - } -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { OpenRouterCore } from "@openrouter/sdk/core.js"; -import { internsChat } from "@openrouter/sdk/funcs/internsChat.js"; - -// Use `OpenRouterCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const openRouter = new OpenRouterCore({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const res = await internsChat(openRouter, { - internId: "a11e0000-0000-4000-8000-000000000005", - internChatCompletionRequest: { - approvalMode: "manual", - messages: [ - { - content: "Summarize the open pull requests.", - role: "user", - }, - ], - stream: true, - }, - }); - if (res.ok) { - const { value: result } = res; - for await (const event of result) { - console.log(event); - } - } else { - console.log("internsChat failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateInternChatCompletionRequest](../../models/operations/createinternchatcompletionrequest.mdx) | ✔️ | The request object to use for the request. | -| `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[operations.CreateInternChatCompletionResponse](../../models/operations/createinternchatcompletionresponse.mdx)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.InternChatErrorResponse | 400, 401, 403, 404, 408, 410, 413 | application/json | -| errors.InternChatErrorResponse | 409, 429 | application/json | -| errors.InternChatErrorResponse | 503 | application/json | -| errors.InternChatErrorResponse | 502, 504 | application/json | -| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | - -## invoke - -Starts a run on one of your interns and answers `202` with the `session_id` as soon as the intern accepts it. The run keeps going on the intern after the response. Nothing about its progress comes back on this request; the intern reports through its own tools, such as Slack. - -Send the same `session_id` later to continue the conversation, for example to hand the intern a decision on work it started. If that session already has a run going, the prompt is delivered into it and the status is `steered`. A `session_id` is accepted only from the caller it was issued to, on the same intern; any other, including sessions started from Slack or the chat endpoint, is refused with `404`. - -Runs started here self-drive: the intern consents to its own tool approvals, and a question it asks is answered by its own fallback. A run ends when the intern finishes it or after its execution deadline (1 hour by default). - -Available to interns programme members. Callers outside the programme receive `404` for every path under `/api/v1/interns`. - -### Example Usage - -```typescript -import { OpenRouter } from "@openrouter/sdk"; - -const openRouter = new OpenRouter({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const result = await openRouter.interns.invoke({ - internId: "a11e0000-0000-4000-8000-000000000005", - internInvokeRequest: { - input: "New support ticket 48213. Case token: ct_9f2c. Investigate and reply.", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { OpenRouterCore } from "@openrouter/sdk/core.js"; -import { internsInvoke } from "@openrouter/sdk/funcs/internsInvoke.js"; - -// Use `OpenRouterCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const openRouter = new OpenRouterCore({ - httpReferer: "", - appTitle: "", - appCategories: "", - apiKey: process.env["OPENROUTER_API_KEY"] ?? "", -}); - -async function run() { - const res = await internsInvoke(openRouter, { - internId: "a11e0000-0000-4000-8000-000000000005", - internInvokeRequest: { - input: "New support ticket 48213. Case token: ct_9f2c. Investigate and reply.", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("internsInvoke failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.InvokeInternRequest](../../models/operations/invokeinternrequest.mdx) | ✔️ | The request object to use for the request. | -| `options` | RequestOptions | ➖ | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.mdx) | ➖ | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[operations.InvokeInternResponse](../../models/operations/invokeinternresponse.mdx)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.InternChatErrorResponse | 400, 401, 403, 404, 408, 413 | application/json | -| errors.InternChatErrorResponse | 409, 429 | application/json | -| errors.InternChatErrorResponse | 503 | application/json | -| errors.InternChatErrorResponse | 500, 502, 504 | application/json | -| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/jsr.json b/jsr.json index 2116016c1..3de1ffd9b 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "1.5.6", + "version": "1.5.7", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package.json b/package.json index 71ec11545..f9b683bba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "1.5.6", + "version": "1.5.7", "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": [ @@ -21,8 +21,8 @@ "license": "Apache-2.0", "packageManager": "pnpm@10.22.0", "publishConfig": { - "provenance": true, - "access": "public" + "access": "public", + "provenance": true }, "type": "module", "main": "./esm/index.js", @@ -73,15 +73,15 @@ "lint": "eslint --cache --max-warnings=0 src", "build": "tsc && node scripts/unbarrel-imports.js", "prepublishOnly": "npm run build", - "test:transit": "exit 0", - "typecheck:transit": "exit 0", + "compile": "tsc && node scripts/unbarrel-imports.js", "prepare": "npm run build", - "test:watch": "vitest --watch --project unit", + "test": "vitest --run --project unit", + "test:e2e": "vitest --run --project e2e", "typecheck": "tsc --noEmit", - "compile": "tsc && node scripts/unbarrel-imports.js", "postinstall": "node scripts/check-types.js || true", - "test": "vitest --run --project unit", - "test:e2e": "vitest --run --project e2e" + "test:transit": "exit 0", + "test:watch": "vitest --watch --project unit", + "typecheck:transit": "exit 0" }, "peerDependencies": { diff --git a/src/funcs/internsChat.ts b/src/funcs/internsChat.ts deleted file mode 100644 index b73e7606a..000000000 --- a/src/funcs/internsChat.ts +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 36149dc7ea8d - */ - -import { OpenRouterCore } from "../core.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"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { OpenRouterError } from "../models/errors/openroutererror.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Stream a chat completion with an intern - * - * @remarks - * Sends a prompt to one of your interns and streams the reply as OpenAI-compatible server-sent events ending with `[DONE]`. The run executes on the intern, which may pause to ask you something. It then streams one `openrouter.provide_input` tool call and finishes with `finish_reason: "tool_calls"`, and the run stays open on the intern. - * - * Every response, whether it ends with `stop`, `tool_calls` or `error`, is followed by a final chunk with empty `choices` that carries `session_id`, then `data: [DONE]`. That chunk carries the `usage` the intern reported for the run, after `stop` or `error`, and `null` when the intern reported none. After `tool_calls` its `usage` is `null` because the turn is not over. Read through `[DONE]`: the `session_id` you need to reply arrives after the `tool_calls` finish chunk. - * - * To answer, send a second request with the same `session_id`, the assistant message echoing that tool call, and a `tool` message whose `tool_call_id` is the tool call id and whose `content` is the answer. The answer is delivered to the run that asked and the stream continues from where it paused. A question stays open for its interaction deadline (5 minutes by default) and the run is cancelled when that passes. Rejected replies do not extend the deadline. - * - * Closing the connection after the `[DONE]` that follows `finish_reason: "tool_calls"` keeps the run alive. Disconnecting while a response is still streaming cancels the run. The stream writes a `: keepalive` comment whenever nothing else has been written for 30 seconds, so a disconnect is noticed within that interval even while the intern is silent. - * - * A run the intern ends while you are still connected, by cancellation or by a deadline, ends the stream with a `finish_reason: "error"` chunk carrying `410` and reason `run_ended`, then the final empty-`choices` chunk and `[DONE]`. That error reports only an ending the intern confirmed. A connection that breaks without that confirmation ends with reason `stream_severed`, and a client that has already disconnected is promised no final event. - * - * Set `approval_mode` to `manual` to have the intern ask before approval-bearing tools such as the shell. Omitted, the run self-drives and consents on your behalf. The mode belongs to the run started by that prompt and must be repeated on later prompts. - * - * Available to interns programme members. Callers outside the programme receive `404` for every path under `/api/v1/interns`. - * - * If set, this operation will use {@link Security.apiKey} from the global security. - */ -export function internsChat( - client: OpenRouterCore, - request: operations.CreateInternChatCompletionRequest & { - internChatCompletionRequest: { stream?: false }; - }, - options?: RequestOptions, -): APIPromise< - Result< - operations.CreateInternChatCompletionResponse, - | errors.InternChatErrorResponse - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > ->; -export function internsChat( - client: OpenRouterCore, - request: operations.CreateInternChatCompletionRequest & { - internChatCompletionRequest: { stream: true }; - }, - options?: RequestOptions, -): APIPromise< - Result< - operations.CreateInternChatCompletionResponse, - | errors.InternChatErrorResponse - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > ->; -export function internsChat( - client: OpenRouterCore, - request: operations.CreateInternChatCompletionRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.CreateInternChatCompletionResponse, - | errors.InternChatErrorResponse - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > ->; -export function internsChat( - client: OpenRouterCore, - request: operations.CreateInternChatCompletionRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.CreateInternChatCompletionResponse, - | errors.InternChatErrorResponse - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: OpenRouterCore, - request: operations.CreateInternChatCompletionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.CreateInternChatCompletionResponse, - | errors.InternChatErrorResponse - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.CreateInternChatCompletionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.InternChatCompletionRequest, { - explode: true, - }); - - const pathParams = { - internId: encodeSimple("internId", payload.internId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/interns/{internId}/chat/completions")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: request?.internChatCompletionRequest?.stream - ? "text/event-stream" - : "application/json", - "HTTP-Referer": encodeSimple( - "HTTP-Referer", - payload["HTTP-Referer"] ?? client._options.httpReferer, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Categories": encodeSimple( - "X-OpenRouter-Categories", - payload.appCategories ?? client._options.appCategories, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Title": encodeSimple( - "X-OpenRouter-Title", - payload.appTitle ?? client._options.appTitle, - { explode: false, charEncoding: "none" }, - ), - })); - - const secConfig = await extractSecurity(client._options.apiKey); - const securityInput = secConfig == null ? {} : { apiKey: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput, [0]); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "createInternChatCompletion", - oAuth2Scopes: null, - - resolvedSecurity: requestSecurity, - - securitySource: client._options.apiKey, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.CreateInternChatCompletionResponse, - | errors.InternChatErrorResponse - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.sse(200, operations.CreateInternChatCompletionResponse$inboundSchema, { - key: "Result", - }), - M.json(202, operations.CreateInternChatCompletionResponse$inboundSchema, { - key: "Result", - }), - M.jsonErr( - [400, 401, 403, 404, 408, 410, 413], - errors.InternChatErrorResponse$inboundSchema, - ), - M.jsonErr([409, 429], errors.InternChatErrorResponse$inboundSchema, { - hdrs: true, - }), - M.jsonErr(503, errors.InternChatErrorResponse$inboundSchema, { - hdrs: true, - }), - M.jsonErr([502, 504], errors.InternChatErrorResponse$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/internsCreateIntern.ts b/src/funcs/internsCreateIntern.ts deleted file mode 100644 index 7bf7c9123..000000000 --- a/src/funcs/internsCreateIntern.ts +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 74ff6cd8e4b0 - */ - -import { OpenRouterCore } from "../core.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"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { OpenRouterError } from "../models/errors/openroutererror.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as models from "../models/index.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Create an intern - * - * @remarks - * Creates an intern in an explicit workspace. The operation also creates its private vault. It can start provisioning immediately or wait for a later provision call. A retry with the same idempotency key and body resumes unfinished work. The request body is capped at 1048576 bytes and a larger body is refused with 413. A non-empty body must declare `Content-Type: application/json` or it is refused with 415. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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. - */ -export function internsCreateIntern( - client: OpenRouterCore, - request: operations.CreateInternRequest, - options?: RequestOptions, -): APIPromise< - Result< - models.Intern, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: OpenRouterCore, - request: operations.CreateInternRequest, - options?: RequestOptions, -): Promise< - [ - Result< - models.Intern, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.CreateInternRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.CreateInternRequest, { - explode: true, - }); - - const path = pathToFunc("/interns")(); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - "HTTP-Referer": encodeSimple( - "HTTP-Referer", - payload["HTTP-Referer"] ?? client._options.httpReferer, - { explode: false, charEncoding: "none" }, - ), - "Idempotency-Key": encodeSimple( - "Idempotency-Key", - payload["Idempotency-Key"], - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Categories": encodeSimple( - "X-OpenRouter-Categories", - payload.appCategories ?? client._options.appCategories, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Title": encodeSimple( - "X-OpenRouter-Title", - payload.appTitle ?? client._options.appTitle, - { explode: false, charEncoding: "none" }, - ), - })); - - const secConfig = await extractSecurity(client._options.apiKey); - const securityInput = secConfig == null ? {} : { apiKey: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput, [0]); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "createIntern", - oAuth2Scopes: null, - - resolvedSecurity: requestSecurity, - - securitySource: client._options.apiKey, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - models.Intern, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json([200, 201], models.Intern$inboundSchema), - M.jsonErr( - [400, 401, 403, 404, 408, 409, 413, 415], - errors.InternLifecycleError$inboundSchema, - ), - M.jsonErr([500, 502], errors.InternLifecycleError$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/internsDeleteIntern.ts b/src/funcs/internsDeleteIntern.ts deleted file mode 100644 index 76ca8ecad..000000000 --- a/src/funcs/internsDeleteIntern.ts +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 7eb35f20da18 - */ - -import { OpenRouterCore } from "../core.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"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { OpenRouterError } from "../models/errors/openroutererror.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as models from "../models/index.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Delete an intern - * - * @remarks - * 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. A non-empty body must declare `Content-Type: application/json` or it is refused with 415. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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. - */ -export function internsDeleteIntern( - client: OpenRouterCore, - request: operations.DeleteInternRequest, - options?: RequestOptions, -): APIPromise< - Result< - models.DeleteInternResponse, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: OpenRouterCore, - request: operations.DeleteInternRequest, - options?: RequestOptions, -): Promise< - [ - Result< - models.DeleteInternResponse, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.DeleteInternRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.DeleteInternRequest, { - explode: true, - }); - - const pathParams = { - internId: encodeSimple("internId", payload.internId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/interns/{internId}")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - "HTTP-Referer": encodeSimple( - "HTTP-Referer", - payload["HTTP-Referer"] ?? client._options.httpReferer, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Categories": encodeSimple( - "X-OpenRouter-Categories", - payload.appCategories ?? client._options.appCategories, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Title": encodeSimple( - "X-OpenRouter-Title", - payload.appTitle ?? client._options.appTitle, - { explode: false, charEncoding: "none" }, - ), - })); - - const secConfig = await extractSecurity(client._options.apiKey); - const securityInput = secConfig == null ? {} : { apiKey: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput, [0]); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "deleteIntern", - oAuth2Scopes: null, - - resolvedSecurity: requestSecurity, - - securitySource: client._options.apiKey, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - models.DeleteInternResponse, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(202, models.DeleteInternResponse$inboundSchema), - M.jsonErr( - [400, 401, 403, 404, 408, 409, 413, 415], - errors.InternLifecycleError$inboundSchema, - ), - M.jsonErr([500, 502], errors.InternLifecycleError$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/internsGetIntern.ts b/src/funcs/internsGetIntern.ts deleted file mode 100644 index c63d853cc..000000000 --- a/src/funcs/internsGetIntern.ts +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 484b04c35876 - */ - -import { OpenRouterCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { OpenRouterError } from "../models/errors/openroutererror.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as models from "../models/index.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Get an intern - * - * @remarks - * Returns the public lifecycle state and settings for one visible intern. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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. - */ -export function internsGetIntern( - client: OpenRouterCore, - request: operations.GetInternRequest, - options?: RequestOptions, -): APIPromise< - Result< - models.Intern, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: OpenRouterCore, - request: operations.GetInternRequest, - options?: RequestOptions, -): Promise< - [ - Result< - models.Intern, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetInternRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - internId: encodeSimple("internId", payload.internId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/interns/{internId}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - "HTTP-Referer": encodeSimple( - "HTTP-Referer", - payload["HTTP-Referer"] ?? client._options.httpReferer, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Categories": encodeSimple( - "X-OpenRouter-Categories", - payload.appCategories ?? client._options.appCategories, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Title": encodeSimple( - "X-OpenRouter-Title", - payload.appTitle ?? client._options.appTitle, - { explode: false, charEncoding: "none" }, - ), - })); - - const secConfig = await extractSecurity(client._options.apiKey); - const securityInput = secConfig == null ? {} : { apiKey: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput, [0]); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "getIntern", - oAuth2Scopes: null, - - resolvedSecurity: requestSecurity, - - securitySource: client._options.apiKey, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - models.Intern, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, models.Intern$inboundSchema), - M.jsonErr([401, 403, 404, 408], errors.InternLifecycleError$inboundSchema), - M.jsonErr(500, errors.InternLifecycleError$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/internsGetInternConnections.ts b/src/funcs/internsGetInternConnections.ts deleted file mode 100644 index cb1a24b92..000000000 --- a/src/funcs/internsGetInternConnections.ts +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 5be250841af7 - */ - -import { OpenRouterCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { OpenRouterError } from "../models/errors/openroutererror.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as models from "../models/index.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * List an intern's connections - * - * @remarks - * Returns the Slack, GitHub, Google Workspace and MCP connections one visible intern can reach, and the shared ones switched off for it or disabled for the workspace. An OAuth grant needs `vault:read`, because the list names members' personal accounts; without it the route answers 403 `insufficient_scope`. The response is sent with `Cache-Control: no-store`. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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. - */ -export function internsGetInternConnections( - client: OpenRouterCore, - request: operations.GetInternConnectionsRequest, - options?: RequestOptions, -): APIPromise< - Result< - models.InternConnectionList, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: OpenRouterCore, - request: operations.GetInternConnectionsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - models.InternConnectionList, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetInternConnectionsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - internId: encodeSimple("internId", payload.internId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/interns/{internId}/connections")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - "HTTP-Referer": encodeSimple( - "HTTP-Referer", - payload["HTTP-Referer"] ?? client._options.httpReferer, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Categories": encodeSimple( - "X-OpenRouter-Categories", - payload.appCategories ?? client._options.appCategories, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Title": encodeSimple( - "X-OpenRouter-Title", - payload.appTitle ?? client._options.appTitle, - { explode: false, charEncoding: "none" }, - ), - })); - - const secConfig = await extractSecurity(client._options.apiKey); - const securityInput = secConfig == null ? {} : { apiKey: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput, [0]); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "getInternConnections", - oAuth2Scopes: null, - - resolvedSecurity: requestSecurity, - - securitySource: client._options.apiKey, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - models.InternConnectionList, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, models.InternConnectionList$inboundSchema), - M.jsonErr([401, 403, 404, 408], errors.InternLifecycleError$inboundSchema), - M.jsonErr(500, errors.InternLifecycleError$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/internsGetInternDaemon.ts b/src/funcs/internsGetInternDaemon.ts deleted file mode 100644 index f51a70bb3..000000000 --- a/src/funcs/internsGetInternDaemon.ts +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 727cbeff5468 - */ - -import { OpenRouterCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { OpenRouterError } from "../models/errors/openroutererror.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as models from "../models/index.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Get an intern's daemon access - * - * @remarks - * Returns the origin and daemon token that attach `ori tui --host` to one visible, running intern. The token is a credential: only an OAuth-token caller (`ori login --oidc`) may read it, the response is sent with `Cache-Control: no-store`, and each reveal is logged by caller and intern. API keys get 403 `personal_identity_required`. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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. - */ -export function internsGetInternDaemon( - client: OpenRouterCore, - request: operations.GetInternDaemonRequest, - options?: RequestOptions, -): APIPromise< - Result< - models.InternDaemonAccess, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: OpenRouterCore, - request: operations.GetInternDaemonRequest, - options?: RequestOptions, -): Promise< - [ - Result< - models.InternDaemonAccess, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetInternDaemonRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - internId: encodeSimple("internId", payload.internId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/interns/{internId}/daemon")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - "HTTP-Referer": encodeSimple( - "HTTP-Referer", - payload["HTTP-Referer"] ?? client._options.httpReferer, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Categories": encodeSimple( - "X-OpenRouter-Categories", - payload.appCategories ?? client._options.appCategories, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Title": encodeSimple( - "X-OpenRouter-Title", - payload.appTitle ?? client._options.appTitle, - { explode: false, charEncoding: "none" }, - ), - })); - - const secConfig = await extractSecurity(client._options.apiKey); - const securityInput = secConfig == null ? {} : { apiKey: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput, [0]); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "getInternDaemon", - oAuth2Scopes: null, - - resolvedSecurity: requestSecurity, - - securitySource: client._options.apiKey, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - models.InternDaemonAccess, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, models.InternDaemonAccess$inboundSchema), - M.jsonErr( - [401, 403, 404, 408, 409], - errors.InternLifecycleError$inboundSchema, - ), - M.jsonErr(500, errors.InternLifecycleError$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/internsGetInternDaemonAccess.ts b/src/funcs/internsGetInternDaemonAccess.ts deleted file mode 100644 index 7d1a84bfb..000000000 --- a/src/funcs/internsGetInternDaemonAccess.ts +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 464f7f69e2f0 - */ - -import { OpenRouterCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { OpenRouterError } from "../models/errors/openroutererror.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as models from "../models/index.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Get an intern's daemon access (deprecated alias) - * - * @remarks - * Deprecated alias of `GET /interns/{internId}/daemon` with the same request, response, and errors. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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. - * - * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. - */ -export function internsGetInternDaemonAccess( - client: OpenRouterCore, - request: operations.GetInternDaemonAccessRequest, - options?: RequestOptions, -): APIPromise< - Result< - models.InternDaemonAccess, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: OpenRouterCore, - request: operations.GetInternDaemonAccessRequest, - options?: RequestOptions, -): Promise< - [ - Result< - models.InternDaemonAccess, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetInternDaemonAccessRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - internId: encodeSimple("internId", payload.internId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/interns/{internId}/daemon-access")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - "HTTP-Referer": encodeSimple( - "HTTP-Referer", - payload["HTTP-Referer"] ?? client._options.httpReferer, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Categories": encodeSimple( - "X-OpenRouter-Categories", - payload.appCategories ?? client._options.appCategories, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Title": encodeSimple( - "X-OpenRouter-Title", - payload.appTitle ?? client._options.appTitle, - { explode: false, charEncoding: "none" }, - ), - })); - - const secConfig = await extractSecurity(client._options.apiKey); - const securityInput = secConfig == null ? {} : { apiKey: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput, [0]); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "getInternDaemonAccess", - oAuth2Scopes: null, - - resolvedSecurity: requestSecurity, - - securitySource: client._options.apiKey, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - models.InternDaemonAccess, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, models.InternDaemonAccess$inboundSchema), - M.jsonErr( - [401, 403, 404, 408, 409], - errors.InternLifecycleError$inboundSchema, - ), - M.jsonErr(500, errors.InternLifecycleError$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/internsGetInternIcon.ts b/src/funcs/internsGetInternIcon.ts deleted file mode 100644 index 5e38e57be..000000000 --- a/src/funcs/internsGetInternIcon.ts +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: df9f8b537f86 - */ - -import * as z from "zod/v4"; -import { OpenRouterCore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { OpenRouterError } from "../models/errors/openroutererror.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Get an intern's icon - * - * @remarks - * Returns the icon image of one visible intern. Pass the intern's `icon_sha256` as `v` to receive a response that can be cached indefinitely. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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. - */ -export function internsGetInternIcon( - client: OpenRouterCore, - request: operations.GetInternIconRequest, - options?: RequestOptions, -): APIPromise< - Result< - ReadableStream, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: OpenRouterCore, - request: operations.GetInternIconRequest, - options?: RequestOptions, -): Promise< - [ - Result< - ReadableStream, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetInternIconRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - internId: encodeSimple("internId", payload.internId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/interns/{internId}/icon")(pathParams); - - const query = encodeFormQuery({ - "v": payload.v, - }); - - const headers = new Headers(compactMap({ - Accept: "image/*", - "HTTP-Referer": encodeSimple( - "HTTP-Referer", - payload["HTTP-Referer"] ?? client._options.httpReferer, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Categories": encodeSimple( - "X-OpenRouter-Categories", - payload.appCategories ?? client._options.appCategories, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Title": encodeSimple( - "X-OpenRouter-Title", - payload.appTitle ?? client._options.appTitle, - { explode: false, charEncoding: "none" }, - ), - })); - - const secConfig = await extractSecurity(client._options.apiKey); - const securityInput = secConfig == null ? {} : { apiKey: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput, [0]); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "getInternIcon", - oAuth2Scopes: null, - - resolvedSecurity: requestSecurity, - - securitySource: client._options.apiKey, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - ReadableStream, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.stream( - 200, - z.custom>(x => x instanceof ReadableStream), - { ctype: "image/*" }, - ), - M.jsonErr([401, 403, 404, 408], errors.InternLifecycleError$inboundSchema), - M.jsonErr(500, errors.InternLifecycleError$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/internsInvoke.ts b/src/funcs/internsInvoke.ts deleted file mode 100644 index 60325197f..000000000 --- a/src/funcs/internsInvoke.ts +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: d0be40cd89cf - */ - -import { OpenRouterCore } from "../core.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"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { OpenRouterError } from "../models/errors/openroutererror.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Start an intern run without waiting for it - * - * @remarks - * Starts a run on one of your interns and answers `202` with the `session_id` as soon as the intern accepts it. The run keeps going on the intern after the response. Nothing about its progress comes back on this request; the intern reports through its own tools, such as Slack. - * - * Send the same `session_id` later to continue the conversation, for example to hand the intern a decision on work it started. If that session already has a run going, the prompt is delivered into it and the status is `steered`. A `session_id` is accepted only from the caller it was issued to, on the same intern; any other, including sessions started from Slack or the chat endpoint, is refused with `404`. - * - * Runs started here self-drive: the intern consents to its own tool approvals, and a question it asks is answered by its own fallback. A run ends when the intern finishes it or after its execution deadline (1 hour by default). - * - * Available to interns programme members. Callers outside the programme receive `404` for every path under `/api/v1/interns`. - * - * If set, this operation will use {@link Security.apiKey} from the global security. - */ -export function internsInvoke( - client: OpenRouterCore, - request: operations.InvokeInternRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.InvokeInternResponse, - | errors.InternChatErrorResponse - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: OpenRouterCore, - request: operations.InvokeInternRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.InvokeInternResponse, - | errors.InternChatErrorResponse - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.InvokeInternRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.InternInvokeRequest, { - explode: true, - }); - - const pathParams = { - internId: encodeSimple("internId", payload.internId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/interns/{internId}/invoke")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - "HTTP-Referer": encodeSimple( - "HTTP-Referer", - payload["HTTP-Referer"] ?? client._options.httpReferer, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Categories": encodeSimple( - "X-OpenRouter-Categories", - payload.appCategories ?? client._options.appCategories, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Title": encodeSimple( - "X-OpenRouter-Title", - payload.appTitle ?? client._options.appTitle, - { explode: false, charEncoding: "none" }, - ), - })); - - const secConfig = await extractSecurity(client._options.apiKey); - const securityInput = secConfig == null ? {} : { apiKey: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput, [0]); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "invokeIntern", - oAuth2Scopes: null, - - resolvedSecurity: requestSecurity, - - securitySource: client._options.apiKey, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.InvokeInternResponse, - | errors.InternChatErrorResponse - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(202, operations.InvokeInternResponse$inboundSchema, { - key: "Result", - }), - M.jsonErr( - [400, 401, 403, 404, 408, 413], - errors.InternChatErrorResponse$inboundSchema, - ), - M.jsonErr([409, 429], errors.InternChatErrorResponse$inboundSchema, { - hdrs: true, - }), - M.jsonErr(503, errors.InternChatErrorResponse$inboundSchema, { - hdrs: true, - }), - M.jsonErr([500, 502, 504], errors.InternChatErrorResponse$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/internsListInterns.ts b/src/funcs/internsListInterns.ts deleted file mode 100644 index 0e9759784..000000000 --- a/src/funcs/internsListInterns.ts +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: eceaf7dad653 - */ - -import { OpenRouterCore } from "../core.js"; -import { encodeFormQuery, encodeSimple, queryJoin } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { OpenRouterError } from "../models/errors/openroutererror.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as models from "../models/index.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * List interns - * - * @remarks - * Lists interns visible to the authenticated key, newest first. Filter by workspace and one or more lifecycle statuses. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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. - */ -export function internsListInterns( - client: OpenRouterCore, - request?: operations.ListInternsRequest | undefined, - options?: RequestOptions, -): APIPromise< - Result< - models.InternListResponse, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: OpenRouterCore, - request?: operations.ListInternsRequest | undefined, - options?: RequestOptions, -): Promise< - [ - Result< - models.InternListResponse, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.ListInternsRequest$outboundSchema.optional().parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const path = pathToFunc("/interns")(); - - const query = queryJoin( - encodeFormQuery({ - "status": payload?.status, - }, { explode: false }), - encodeFormQuery({ - "limit": payload?.limit, - "starting_after": payload?.starting_after, - "workspace_id": payload?.workspace_id, - }), - ); - - const headers = new Headers(compactMap({ - Accept: "application/json", - "HTTP-Referer": encodeSimple( - "HTTP-Referer", - payload?.["HTTP-Referer"] ?? client._options.httpReferer, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Categories": encodeSimple( - "X-OpenRouter-Categories", - payload?.appCategories ?? client._options.appCategories, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Title": encodeSimple( - "X-OpenRouter-Title", - payload?.appTitle ?? client._options.appTitle, - { explode: false, charEncoding: "none" }, - ), - })); - - const secConfig = await extractSecurity(client._options.apiKey); - const securityInput = secConfig == null ? {} : { apiKey: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput, [0]); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "listInterns", - oAuth2Scopes: null, - - resolvedSecurity: requestSecurity, - - securitySource: client._options.apiKey, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - models.InternListResponse, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, models.InternListResponse$inboundSchema), - M.jsonErr( - [400, 401, 403, 404, 408], - errors.InternLifecycleError$inboundSchema, - ), - M.jsonErr(500, errors.InternLifecycleError$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/internsProvisionIntern.ts b/src/funcs/internsProvisionIntern.ts deleted file mode 100644 index 84f3dddbf..000000000 --- a/src/funcs/internsProvisionIntern.ts +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 38001699f102 - */ - -import { OpenRouterCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { OpenRouterError } from "../models/errors/openroutererror.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as models from "../models/index.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Provision an intern - * - * @remarks - * Starts the first boot, or resumes an intern after suspension. This operation takes no request body. A body carrying any field is refused with 400 rather than ignored. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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. - */ -export function internsProvisionIntern( - client: OpenRouterCore, - request: operations.ProvisionInternRequest, - options?: RequestOptions, -): APIPromise< - Result< - models.ProvisionInternResponse, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: OpenRouterCore, - request: operations.ProvisionInternRequest, - options?: RequestOptions, -): Promise< - [ - Result< - models.ProvisionInternResponse, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.ProvisionInternRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - internId: encodeSimple("internId", payload.internId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/interns/{internId}/provision")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - "HTTP-Referer": encodeSimple( - "HTTP-Referer", - payload["HTTP-Referer"] ?? client._options.httpReferer, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Categories": encodeSimple( - "X-OpenRouter-Categories", - payload.appCategories ?? client._options.appCategories, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Title": encodeSimple( - "X-OpenRouter-Title", - payload.appTitle ?? client._options.appTitle, - { explode: false, charEncoding: "none" }, - ), - })); - - const secConfig = await extractSecurity(client._options.apiKey); - const securityInput = secConfig == null ? {} : { apiKey: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput, [0]); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "provisionIntern", - oAuth2Scopes: null, - - resolvedSecurity: requestSecurity, - - securitySource: client._options.apiKey, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - models.ProvisionInternResponse, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(202, models.ProvisionInternResponse$inboundSchema), - M.jsonErr( - [400, 401, 403, 404, 408, 409, 413, 415], - errors.InternLifecycleError$inboundSchema, - ), - M.jsonErr([500, 502], errors.InternLifecycleError$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/internsSignInternDaemonAccessRequest.ts b/src/funcs/internsSignInternDaemonAccessRequest.ts deleted file mode 100644 index b34e219d6..000000000 --- a/src/funcs/internsSignInternDaemonAccessRequest.ts +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 89cb6ec2c0e2 - */ - -import { OpenRouterCore } from "../core.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"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { OpenRouterError } from "../models/errors/openroutererror.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Sign a daemon request with the caller's identity (deprecated alias) - * - * @remarks - * Deprecated alias of `POST /interns/{internId}/daemon/sign` with the same request, response, and errors. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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. - * - * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. - */ -export function internsSignInternDaemonAccessRequest( - client: OpenRouterCore, - request: operations.SignInternDaemonAccessRequestRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.SignInternDaemonAccessRequestResponse, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: OpenRouterCore, - request: operations.SignInternDaemonAccessRequestRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.SignInternDaemonAccessRequestResponse, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.SignInternDaemonAccessRequestRequest$outboundSchema.parse( - value, - ), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.SignInternDaemonRequest, { - explode: true, - }); - - const pathParams = { - internId: encodeSimple("internId", payload.internId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/interns/{internId}/daemon-access/sign")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - "HTTP-Referer": encodeSimple( - "HTTP-Referer", - payload["HTTP-Referer"] ?? client._options.httpReferer, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Categories": encodeSimple( - "X-OpenRouter-Categories", - payload.appCategories ?? client._options.appCategories, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Title": encodeSimple( - "X-OpenRouter-Title", - payload.appTitle ?? client._options.appTitle, - { explode: false, charEncoding: "none" }, - ), - })); - - const secConfig = await extractSecurity(client._options.apiKey); - const securityInput = secConfig == null ? {} : { apiKey: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput, [0]); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "signInternDaemonAccessRequest", - oAuth2Scopes: null, - - resolvedSecurity: requestSecurity, - - securitySource: client._options.apiKey, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.SignInternDaemonAccessRequestResponse, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json( - 200, - operations.SignInternDaemonAccessRequestResponse$inboundSchema, - { key: "Result" }, - ), - M.jsonErr( - [400, 401, 403, 404, 408, 413, 415], - errors.InternLifecycleError$inboundSchema, - ), - M.jsonErr(429, errors.InternLifecycleError$inboundSchema, { hdrs: true }), - M.jsonErr(500, errors.InternLifecycleError$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/internsSignInternDaemonRequest.ts b/src/funcs/internsSignInternDaemonRequest.ts deleted file mode 100644 index 00c9ff5e2..000000000 --- a/src/funcs/internsSignInternDaemonRequest.ts +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 597f99f3800d - */ - -import { OpenRouterCore } from "../core.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"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { OpenRouterError } from "../models/errors/openroutererror.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Sign a daemon request with the caller's identity - * - * @remarks - * Signs the SHA-256 digest of one request the CLI is about to send to the intern daemon, binding it to the intern and to the signed-in member so personal connections resolve. Only an OAuth session from `ori login --oidc` whose grant carries `vault:read` can sign: an API key is refused with 403 because it names no person, and an `interns`-only grant is refused with 403 because a proof releases that user's personal connections. The route is behind the same gate as chat and counts against the chat turn limiter. The response is sent with `Cache-Control: no-store`. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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. - */ -export function internsSignInternDaemonRequest( - client: OpenRouterCore, - request: operations.SignInternDaemonRequestRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.SignInternDaemonRequestResponse, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: OpenRouterCore, - request: operations.SignInternDaemonRequestRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.SignInternDaemonRequestResponse, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.SignInternDaemonRequestRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.SignInternDaemonRequest, { - explode: true, - }); - - const pathParams = { - internId: encodeSimple("internId", payload.internId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/interns/{internId}/daemon/sign")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - "HTTP-Referer": encodeSimple( - "HTTP-Referer", - payload["HTTP-Referer"] ?? client._options.httpReferer, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Categories": encodeSimple( - "X-OpenRouter-Categories", - payload.appCategories ?? client._options.appCategories, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Title": encodeSimple( - "X-OpenRouter-Title", - payload.appTitle ?? client._options.appTitle, - { explode: false, charEncoding: "none" }, - ), - })); - - const secConfig = await extractSecurity(client._options.apiKey); - const securityInput = secConfig == null ? {} : { apiKey: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput, [0]); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "signInternDaemonRequest", - oAuth2Scopes: null, - - resolvedSecurity: requestSecurity, - - securitySource: client._options.apiKey, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.SignInternDaemonRequestResponse, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.SignInternDaemonRequestResponse$inboundSchema, { - key: "Result", - }), - M.jsonErr( - [400, 401, 403, 404, 408, 413, 415], - errors.InternLifecycleError$inboundSchema, - ), - M.jsonErr(429, errors.InternLifecycleError$inboundSchema, { hdrs: true }), - M.jsonErr(500, errors.InternLifecycleError$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/internsSuspendIntern.ts b/src/funcs/internsSuspendIntern.ts deleted file mode 100644 index 5c20a90b1..000000000 --- a/src/funcs/internsSuspendIntern.ts +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 5928ef254c09 - */ - -import { OpenRouterCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { matchStatusCode } from "../lib/http.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { OpenRouterError } from "../models/errors/openroutererror.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as models from "../models/index.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Suspend an intern - * - * @remarks - * Stops the intern runtime while keeping its disk and configuration for a later provision call. This operation takes no request body. A body carrying any field is refused with 400 rather than ignored. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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. - */ -export function internsSuspendIntern( - client: OpenRouterCore, - request: operations.SuspendInternRequest, - options?: RequestOptions, -): APIPromise< - Result< - models.SuspendInternResponse, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: OpenRouterCore, - request: operations.SuspendInternRequest, - options?: RequestOptions, -): Promise< - [ - Result< - models.SuspendInternResponse, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.SuspendInternRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - internId: encodeSimple("internId", payload.internId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/interns/{internId}/suspend")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - "HTTP-Referer": encodeSimple( - "HTTP-Referer", - payload["HTTP-Referer"] ?? client._options.httpReferer, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Categories": encodeSimple( - "X-OpenRouter-Categories", - payload.appCategories ?? client._options.appCategories, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Title": encodeSimple( - "X-OpenRouter-Title", - payload.appTitle ?? client._options.appTitle, - { explode: false, charEncoding: "none" }, - ), - })); - - const secConfig = await extractSecurity(client._options.apiKey); - const securityInput = secConfig == null ? {} : { apiKey: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput, [0]); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "suspendIntern", - oAuth2Scopes: null, - - resolvedSecurity: requestSecurity, - - securitySource: client._options.apiKey, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - models.SuspendInternResponse, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, models.SuspendInternResponse$inboundSchema), - M.jsonErr( - [400, 401, 403, 404, 408, 409, 413, 415], - errors.InternLifecycleError$inboundSchema, - ), - M.jsonErr([500, 502], errors.InternLifecycleError$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/internsUpdateIntern.ts b/src/funcs/internsUpdateIntern.ts deleted file mode 100644 index 8f5a82f87..000000000 --- a/src/funcs/internsUpdateIntern.ts +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 1d493469e489 - */ - -import { OpenRouterCore } from "../core.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"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { OpenRouterError } from "../models/errors/openroutererror.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as models from "../models/index.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Update an intern - * - * @remarks - * Changes the intern name, description, instructions or model. Omitted fields stay unchanged. The request body is capped at 1048576 bytes and a larger body is refused with 413. A non-empty body must declare `Content-Type: application/json` or it is refused with 415. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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. - */ -export function internsUpdateIntern( - client: OpenRouterCore, - request: operations.UpdateInternRequest, - options?: RequestOptions, -): APIPromise< - Result< - models.Intern, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: OpenRouterCore, - request: operations.UpdateInternRequest, - options?: RequestOptions, -): Promise< - [ - Result< - models.Intern, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.UpdateInternRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.UpdateInternRequest, { - explode: true, - }); - - const pathParams = { - internId: encodeSimple("internId", payload.internId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/interns/{internId}")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - "HTTP-Referer": encodeSimple( - "HTTP-Referer", - payload["HTTP-Referer"] ?? client._options.httpReferer, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Categories": encodeSimple( - "X-OpenRouter-Categories", - payload.appCategories ?? client._options.appCategories, - { explode: false, charEncoding: "none" }, - ), - "X-OpenRouter-Title": encodeSimple( - "X-OpenRouter-Title", - payload.appTitle ?? client._options.appTitle, - { explode: false, charEncoding: "none" }, - ), - })); - - const secConfig = await extractSecurity(client._options.apiKey); - const securityInput = secConfig == null ? {} : { apiKey: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput, [0]); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "updateIntern", - oAuth2Scopes: null, - - resolvedSecurity: requestSecurity, - - securitySource: client._options.apiKey, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PATCH", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - isErrorStatusCode: (statusCode: number) => - matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - models.Intern, - | errors.InternLifecycleError - | OpenRouterError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, models.Intern$inboundSchema), - M.jsonErr( - [400, 401, 403, 404, 408, 409, 413, 415], - errors.InternLifecycleError$inboundSchema, - ), - M.jsonErr(500, errors.InternLifecycleError$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/lib/config.ts b/src/lib/config.ts index 740cb677f..113775150 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.5.6", + sdkVersion: "1.5.7", genVersion: "2.948.4", - userAgent: "speakeasy-sdk/typescript 1.5.6 2.948.4 1.0.0 @openrouter/sdk", + userAgent: "speakeasy-sdk/typescript 1.5.7 2.948.4 1.0.0 @openrouter/sdk", } as const; diff --git a/src/models/createinternrequest.ts b/src/models/createinternrequest.ts deleted file mode 100644 index 0864d6eea..000000000 --- a/src/models/createinternrequest.ts +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 98307ca98901 - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../lib/primitives.js"; - -/** - * Settings for a new intern. - */ -export type CreateInternRequest = { - /** - * Free-form description, or null. - */ - description?: string | null | undefined; - /** - * Standing instructions the intern boots with, or null. - */ - instructions?: string | null | undefined; - /** - * Intern name, unique per creator within the workspace. - */ - name: string; - /** - * Start provisioning during this create operation. Defaults to false. - */ - provision?: boolean | undefined; - /** - * Vault owned by another intern in this workspace to attach as a borrowed vault. - */ - vaultId?: string | undefined; - /** - * Workspace that will own the intern. Defaults to the workspace the API key resolves to. When given, it must match the API key workspace. - */ - workspaceId?: string | undefined; -}; - -/** @internal */ -export type CreateInternRequest$Outbound = { - description?: string | null | undefined; - instructions?: string | null | undefined; - name: string; - provision: boolean; - vault_id?: string | undefined; - workspace_id?: string | undefined; -}; - -/** @internal */ -export const CreateInternRequest$outboundSchema: z.ZodType< - CreateInternRequest$Outbound, - CreateInternRequest -> = z.object({ - description: z.nullable(z.string()).optional(), - instructions: z.nullable(z.string()).optional(), - name: z.string(), - provision: z.boolean().default(false), - vaultId: z.string().optional(), - workspaceId: z.string().optional(), -}).transform((v) => { - return remap$(v, { - vaultId: "vault_id", - workspaceId: "workspace_id", - }); -}); - -export function createInternRequestToJSON( - createInternRequest: CreateInternRequest, -): string { - return JSON.stringify( - CreateInternRequest$outboundSchema.parse(createInternRequest), - ); -} diff --git a/src/models/deleteinternrequest.ts b/src/models/deleteinternrequest.ts deleted file mode 100644 index 7fdce05c5..000000000 --- a/src/models/deleteinternrequest.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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/deleteinternresponse.ts b/src/models/deleteinternresponse.ts deleted file mode 100644 index cd0778fef..000000000 --- a/src/models/deleteinternresponse.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 280574b56b8f - */ - -import * as z from "zod/v4"; -import { safeParse } from "../lib/schemas.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; - -export type DeleteInternResponse = { - deleting: true; -}; - -/** @internal */ -export const DeleteInternResponse$inboundSchema: z.ZodType< - DeleteInternResponse, - unknown -> = z.object({ - deleting: z.literal(true), -}); - -export function deleteInternResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DeleteInternResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DeleteInternResponse' from JSON`, - ); -} diff --git a/src/models/errors/index.ts b/src/models/errors/index.ts index 813b62005..124e82e07 100644 --- a/src/models/errors/index.ts +++ b/src/models/errors/index.ts @@ -17,8 +17,6 @@ export * from "./gatewaytimeoutresponseerror.js"; export * from "./goneresponseerror.js"; export * from "./httpclienterrors.js"; export * from "./internalserverresponseerror.js"; -export * from "./internchaterrorresponse.js"; -export * from "./internlifecycleerror.js"; export * from "./notfoundresponseerror.js"; export * from "./oautherrorresponse.js"; export * from "./openrouterdefaulterror.js"; diff --git a/src/models/errors/internchaterrorresponse.ts b/src/models/errors/internchaterrorresponse.ts deleted file mode 100644 index 425d34bc5..000000000 --- a/src/models/errors/internchaterrorresponse.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: bb73eae2fe73 - */ - -import * as z from "zod/v4"; -import * as models from "../index.js"; -import { OpenRouterError } from "./openroutererror.js"; - -/** - * A refusal before the stream opens. Once the response is `200` and streaming, failures arrive as a chunk with `finish_reason: "error"` instead. - */ -export type InternChatErrorResponseData = { - /** - * The OpenAI-compatible error object. `metadata` is present on refusals from the chat route. Authentication refusals (`401`), the departed-creator `403` and the programme `404` carry only `code` and `message`. - */ - error: models.InternChatError; -}; - -/** - * A refusal before the stream opens. Once the response is `200` and streaming, failures arrive as a chunk with `finish_reason: "error"` instead. - */ -export class InternChatErrorResponse extends OpenRouterError { - /** - * The OpenAI-compatible error object. `metadata` is present on refusals from the chat route. Authentication refusals (`401`), the departed-creator `403` and the programme `404` carry only `code` and `message`. - */ - error: models.InternChatError; - - /** The original data that was passed to this error instance. */ - data$: InternChatErrorResponseData; - - constructor( - err: InternChatErrorResponseData, - httpMeta: { response: Response; request: Request; body: string }, - ) { - const message = err.error?.message - || `API error occurred: ${JSON.stringify(err)}`; - super(message, httpMeta); - this.data$ = err; - this.error = err.error; - - this.name = "InternChatErrorResponse"; - } -} - -/** @internal */ -export const InternChatErrorResponse$inboundSchema: z.ZodType< - InternChatErrorResponse, - unknown -> = z.object({ - error: models.InternChatError$inboundSchema, - request$: z.custom(x => x instanceof Request), - response$: z.custom(x => x instanceof Response), - body$: z.string(), -}) - .transform((v) => { - return new InternChatErrorResponse(v, { - request: v.request$, - response: v.response$, - body: v.body$, - }); - }); diff --git a/src/models/errors/internlifecycleerror.ts b/src/models/errors/internlifecycleerror.ts deleted file mode 100644 index 9663624e1..000000000 --- a/src/models/errors/internlifecycleerror.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 31cfc72977f7 - */ - -import * as z from "zod/v4"; -import * as models from "../index.js"; -import { OpenRouterError } from "./openroutererror.js"; - -/** - * Intern lifecycle request failure. - */ -export type InternLifecycleErrorData = { - error: models.InternLifecycleErrorError; -}; - -/** - * Intern lifecycle request failure. - */ -export class InternLifecycleError extends OpenRouterError { - error: models.InternLifecycleErrorError; - - /** The original data that was passed to this error instance. */ - data$: InternLifecycleErrorData; - - constructor( - err: InternLifecycleErrorData, - httpMeta: { response: Response; request: Request; body: string }, - ) { - const message = err.error?.message - || `API error occurred: ${JSON.stringify(err)}`; - super(message, httpMeta); - this.data$ = err; - this.error = err.error; - - this.name = "InternLifecycleError"; - } -} - -/** @internal */ -export const InternLifecycleError$inboundSchema: z.ZodType< - InternLifecycleError, - unknown -> = z.object({ - error: z.lazy(() => models.InternLifecycleErrorError$inboundSchema), - request$: z.custom(x => x instanceof Request), - response$: z.custom(x => x instanceof Response), - body$: z.string(), -}) - .transform((v) => { - return new InternLifecycleError(v, { - request: v.request$, - response: v.response$, - body: v.body$, - }); - }); diff --git a/src/models/index.ts b/src/models/index.ts index 1bd1e5190..abf305723 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -276,7 +276,6 @@ export * from "./createbyokkeyresponse.js"; export * from "./createexternaluserrequest.js"; export * from "./createguardrailrequest.js"; export * from "./createguardrailresponse.js"; -export * from "./createinternrequest.js"; export * from "./createobservabilitydestinationrequest.js"; export * from "./createobservabilitydestinationresponse.js"; export * from "./createpresetfrominferenceresponse.js"; @@ -314,8 +313,6 @@ export * from "./deferredtoolscontrol.js"; export * from "./deferredtoolssearchstrategy.js"; export * from "./deletebyokkeyresponse.js"; export * from "./deleteguardrailresponse.js"; -export * from "./deleteinternrequest.js"; -export * from "./deleteinternresponse.js"; export * from "./deleteobservabilitydestinationresponse.js"; export * from "./deleteprivateendpointresponse.js"; export * from "./deletescimgroupmappingresponse.js"; @@ -425,39 +422,7 @@ export * from "./inputsunion.js"; export * from "./inputtext.js"; export * from "./inputvideo.js"; export * from "./instructtype.js"; -export * from "./intern.js"; export * from "./internalserverresponseerrordata.js"; -export * from "./internapprovalmode.js"; -export * from "./internchatassistantmessage.js"; -export * from "./internchatchoice.js"; -export * from "./internchatcompletionchunk.js"; -export * from "./internchatcompletionrequest.js"; -export * from "./internchatdelta.js"; -export * from "./internchatdevelopermessage.js"; -export * from "./internchatechoedtoolcall.js"; -export * from "./internchatechoedtoolcallfunction.js"; -export * from "./internchaterror.js"; -export * from "./internchaterrormetadata.js"; -export * from "./internchatmessage.js"; -export * from "./internchatmessagecontent.js"; -export * from "./internchatprompttokensdetails.js"; -export * from "./internchatsteeredresponse.js"; -export * from "./internchatstreamerror.js"; -export * from "./internchatstreamingresponse.js"; -export * from "./internchatsystemmessage.js"; -export * from "./internchattextpart.js"; -export * from "./internchattoolcall.js"; -export * from "./internchattoolcallfunction.js"; -export * from "./internchattoolmessage.js"; -export * from "./internchatusage.js"; -export * from "./internchatusermessage.js"; -export * from "./internconnection.js"; -export * from "./internconnectionlist.js"; -export * from "./interndaemonaccess.js"; -export * from "./interninvokeacceptedresponse.js"; -export * from "./interninvokerequest.js"; -export * from "./internlifecycleerror.js"; -export * from "./internlistresponse.js"; export * from "./itemreferenceitem.js"; export * from "./jevrouterplugin.js"; export * from "./keyassignment.js"; @@ -669,7 +634,6 @@ export * from "./providerpreferences.js"; export * from "./providerresponse.js"; export * from "./providersort.js"; export * from "./providersortconfig.js"; -export * from "./provisioninternresponse.js"; export * from "./publicendpoint.js"; export * from "./publicpricing.js"; export * from "./publicservicetier.js"; @@ -739,8 +703,6 @@ export * from "./shellservertoolconfig.js"; export * from "./shellservertoolengine.js"; export * from "./shellservertoolenvironment.js"; export * from "./shellservertoolopenrouter.js"; -export * from "./signinterndaemonrequest.js"; -export * from "./signinterndaemonresponse.js"; export * from "./speechinput.js"; export * from "./speechinputreference.js"; export * from "./speechinputreferenceaudio.js"; @@ -781,7 +743,6 @@ export * from "./subagentservertoolconfig.js"; export * from "./subagentservertoolopenrouter.js"; export * from "./submitgenerationfeedbackrequest.js"; export * from "./submitgenerationfeedbackresponse.js"; -export * from "./suspendinternresponse.js"; export * from "./switchyardrouterplugin.js"; export * from "./taskclassificationitem.js"; export * from "./taskclassificationmacrocategory.js"; @@ -818,7 +779,6 @@ export * from "./updatebyokkeyresponse.js"; export * from "./updateexternaluserrequest.js"; export * from "./updateguardrailrequest.js"; export * from "./updateguardrailresponse.js"; -export * from "./updateinternrequest.js"; export * from "./updateobservabilitydestinationrequest.js"; export * from "./updateobservabilitydestinationresponse.js"; export * from "./updateorganizationsettingsrequest.js"; diff --git a/src/models/intern.ts b/src/models/intern.ts deleted file mode 100644 index bbe6a1be2..000000000 --- a/src/models/intern.ts +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 88580bab3ce4 - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import * as openEnums from "../types/enums.js"; -import { OpenEnum } from "../types/enums.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; - -/** - * Active provisioning step, or null once provisioning has settled. - */ -export type Progress = { - /** - * Human-readable label of the active provisioning step. - */ - stepLabel: string; - /** - * One-based index of the active step. - */ - stepNumber: number; - /** - * Number of provisioning steps. - */ - totalSteps: number; -}; - -/** - * Lifecycle status. - */ -export const InternStatus = { - AwaitingSlackInstall: "awaiting_slack_install", - Queued: "queued", - Provisioning: "provisioning", - Running: "running", - Failed: "failed", - Stopped: "stopped", - Destroying: "destroying", - DestroyFailed: "destroy_failed", -} as const; -/** - * Lifecycle status. - */ -export type InternStatus = OpenEnum; - -/** - * Public lifecycle state and settings for one intern. - */ -export type Intern = { - /** - * Vault the intern borrows from another intern, or null when it borrows none. - */ - attachedVaultId: string | null; - /** - * Whether this key may change the intern (update, provision, suspend, delete). Present on list and retrieve; false while lifecycle writes are closed for the account. - */ - canEdit?: boolean | undefined; - /** - * ISO 8601 creation time. - */ - createdAt: string; - /** - * Whether the user behind the key created the intern. Present on list and retrieve; absent for organization keys, which act for no user. - */ - createdByYou?: boolean | undefined; - /** - * Free-form description. - */ - description: string | null; - /** - * Public hostname the intern is reachable at, or null until provisioning has assigned one. - */ - hostname: string | null; - /** - * SHA-256 of the intern icon, or null when it has none. Present on list and retrieve; fetch the bytes from `GET /api/v1/interns/{intern_id}/icon`. - */ - iconSha256?: string | null | undefined; - /** - * Intern id. - */ - id: string; - /** - * Standing instructions the intern boots with. - */ - instructions: string | null; - /** - * Why the last provisioning attempt failed, when status is failed. - */ - lastFailureMessage: string | null; - /** - * OpenRouter model slug the intern runs, or null for the workspace default. - */ - model: string | null; - /** - * Intern name, unique per creator within a workspace. - */ - name: string; - /** - * Active provisioning step, or null once provisioning has settled. - */ - progress: Progress | null; - /** - * Lifecycle status. - */ - status: InternStatus; - /** - * ISO 8601 last update time. - */ - updatedAt: string; - /** - * Vault the intern owns, or null before it has been created. - */ - vaultId: string | null; - /** - * Workspace that owns the intern and scopes its secrets. - */ - workspaceId: string; -}; - -/** @internal */ -export const Progress$inboundSchema: z.ZodType = z.object({ - step_label: z.string(), - step_number: z.int(), - total_steps: z.int(), -}).transform((v) => { - return remap$(v, { - "step_label": "stepLabel", - "step_number": "stepNumber", - "total_steps": "totalSteps", - }); -}); - -export function progressFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Progress$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Progress' from JSON`, - ); -} - -/** @internal */ -export const InternStatus$inboundSchema: z.ZodType = - openEnums.inboundSchema(InternStatus); - -/** @internal */ -export const Intern$inboundSchema: z.ZodType = z.object({ - attached_vault_id: z.nullable(z.string()), - can_edit: z.boolean().optional(), - created_at: z.string(), - created_by_you: z.boolean().optional(), - description: z.nullable(z.string()), - hostname: z.nullable(z.string()), - icon_sha256: z.nullable(z.string()).optional(), - id: z.string(), - instructions: z.nullable(z.string()), - last_failure_message: z.nullable(z.string()), - model: z.nullable(z.string()), - name: z.string(), - progress: z.nullable(z.lazy(() => Progress$inboundSchema)), - status: InternStatus$inboundSchema, - updated_at: z.string(), - vault_id: z.nullable(z.string()), - workspace_id: z.string(), -}).transform((v) => { - return remap$(v, { - "attached_vault_id": "attachedVaultId", - "can_edit": "canEdit", - "created_at": "createdAt", - "created_by_you": "createdByYou", - "icon_sha256": "iconSha256", - "last_failure_message": "lastFailureMessage", - "updated_at": "updatedAt", - "vault_id": "vaultId", - "workspace_id": "workspaceId", - }); -}); - -export function internFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Intern$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Intern' from JSON`, - ); -} diff --git a/src/models/internapprovalmode.ts b/src/models/internapprovalmode.ts deleted file mode 100644 index aaa74302f..000000000 --- a/src/models/internapprovalmode.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: cccfde70a06c - */ - -import * as z from "zod/v4"; -import * as openEnums from "../types/enums.js"; -import { OpenEnum } from "../types/enums.js"; - -/** - * 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. - */ -export const InternApprovalMode = { - Manual: "manual", - SelfDrive: "self-drive", -} as const; -/** - * 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. - */ -export type InternApprovalMode = OpenEnum; - -/** @internal */ -export const InternApprovalMode$outboundSchema: z.ZodType< - string, - InternApprovalMode -> = openEnums.outboundSchema(InternApprovalMode); diff --git a/src/models/internchatassistantmessage.ts b/src/models/internchatassistantmessage.ts deleted file mode 100644 index b3232079a..000000000 --- a/src/models/internchatassistantmessage.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: db891c763d46 - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../lib/primitives.js"; -import { - InternChatEchoedToolCall, - InternChatEchoedToolCall$Outbound, - InternChatEchoedToolCall$outboundSchema, -} from "./internchatechoedtoolcall.js"; -import { - InternChatMessageContent, - InternChatMessageContent$Outbound, - InternChatMessageContent$outboundSchema, -} from "./internchatmessagecontent.js"; - -/** - * An assistant message from an earlier response. When answering an interaction, echo the streamed `tool_calls` here before the `tool` message. - */ -export type InternChatAssistantMessage = { - /** - * Message text as a string or a list of text parts. Assistant history may carry null. Only the last message is read; earlier messages are accepted so ordinary clients can resend history. - */ - content?: InternChatMessageContent | null | undefined; - role: "assistant"; - toolCalls?: Array | undefined; -}; - -/** @internal */ -export type InternChatAssistantMessage$Outbound = { - content?: InternChatMessageContent$Outbound | null | undefined; - role: "assistant"; - tool_calls?: Array | undefined; -}; - -/** @internal */ -export const InternChatAssistantMessage$outboundSchema: z.ZodType< - InternChatAssistantMessage$Outbound, - InternChatAssistantMessage -> = z.object({ - content: z.nullable(InternChatMessageContent$outboundSchema).optional(), - role: z.literal("assistant"), - toolCalls: z.array(InternChatEchoedToolCall$outboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - toolCalls: "tool_calls", - }); -}); - -export function internChatAssistantMessageToJSON( - internChatAssistantMessage: InternChatAssistantMessage, -): string { - return JSON.stringify( - InternChatAssistantMessage$outboundSchema.parse(internChatAssistantMessage), - ); -} diff --git a/src/models/internchatchoice.ts b/src/models/internchatchoice.ts deleted file mode 100644 index 1bc35fdcd..000000000 --- a/src/models/internchatchoice.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: f10a43356b30 - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import * as openEnums from "../types/enums.js"; -import { OpenEnum } from "../types/enums.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; -import { - InternChatDelta, - InternChatDelta$inboundSchema, -} from "./internchatdelta.js"; - -/** - * `null` while streaming. `stop` when the run completed, `tool_calls` when the run is waiting for the caller to answer the streamed tool call, `error` on the terminal error chunk. - */ -export const InternChatChoiceFinishReason = { - Error: "error", - Stop: "stop", - ToolCalls: "tool_calls", -} as const; -/** - * `null` while streaming. `stop` when the run completed, `tool_calls` when the run is waiting for the caller to answer the streamed tool call, `error` on the terminal error chunk. - */ -export type InternChatChoiceFinishReason = OpenEnum< - typeof InternChatChoiceFinishReason ->; - -/** - * The single choice this endpoint streams. - */ -export type InternChatChoice = { - /** - * The incremental content of one chunk. The first chunk carries `role`, text chunks carry `content`, reasoning chunks carry `reasoning`, and an interaction chunk carries one complete `tool_calls` entry. - */ - delta: InternChatDelta; - /** - * `null` while streaming. `stop` when the run completed, `tool_calls` when the run is waiting for the caller to answer the streamed tool call, `error` on the terminal error chunk. - */ - finishReason: InternChatChoiceFinishReason | null; - index: number; -}; - -/** @internal */ -export const InternChatChoiceFinishReason$inboundSchema: z.ZodType< - InternChatChoiceFinishReason, - unknown -> = openEnums.inboundSchema(InternChatChoiceFinishReason); - -/** @internal */ -export const InternChatChoice$inboundSchema: z.ZodType< - InternChatChoice, - unknown -> = z.object({ - delta: InternChatDelta$inboundSchema, - finish_reason: z.nullable(InternChatChoiceFinishReason$inboundSchema), - index: z.int(), -}).transform((v) => { - return remap$(v, { - "finish_reason": "finishReason", - }); -}); - -export function internChatChoiceFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => InternChatChoice$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'InternChatChoice' from JSON`, - ); -} diff --git a/src/models/internchatcompletionchunk.ts b/src/models/internchatcompletionchunk.ts deleted file mode 100644 index 5d214c758..000000000 --- a/src/models/internchatcompletionchunk.ts +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 3492df914b61 - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { ClosedEnum } from "../types/enums.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; -import { - InternChatChoice, - InternChatChoice$inboundSchema, -} from "./internchatchoice.js"; -import { - InternChatStreamError, - InternChatStreamError$inboundSchema, -} from "./internchatstreamerror.js"; -import { - InternChatUsage, - InternChatUsage$inboundSchema, -} from "./internchatusage.js"; - -export const InternChatCompletionChunkObject = { - ChatCompletionChunk: "chat.completion.chunk", -} as const; -export type InternChatCompletionChunkObject = ClosedEnum< - typeof InternChatCompletionChunkObject ->; - -/** - * One `data:` line of the stream. A run streams a role chunk, content and reasoning chunks, then a finish chunk: `stop`, `tool_calls` (the run is paused for input) or `error` (with an `error` object). A final chunk with empty `choices` follows in every case, carrying `session_id` and `usage` (`null` unless the daemon reported usage, and always `null` after `tool_calls`). Every stream ends with `[DONE]`. - */ -export type InternChatCompletionChunk = { - /** - * One choice on content, tool-call and error chunks. Empty on the final chunk that carries `session_id`. - */ - choices: Array; - created: number; - /** - * 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. - */ - error?: InternChatStreamError | undefined; - /** - * The completion id, constant for the whole response. - */ - id: string; - /** - * 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. Session ids are client-visible and scoped to the intern's own daemon. - */ - sessionId?: string | null | undefined; - /** - * 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. - */ - usage?: InternChatUsage | null | undefined; -}; - -/** @internal */ -export const InternChatCompletionChunkObject$inboundSchema: z.ZodEnum< - typeof InternChatCompletionChunkObject -> = z.enum(InternChatCompletionChunkObject); - -/** @internal */ -export const InternChatCompletionChunk$inboundSchema: z.ZodType< - InternChatCompletionChunk, - unknown -> = z.object({ - choices: z.array(InternChatChoice$inboundSchema), - created: z.int(), - error: InternChatStreamError$inboundSchema.optional(), - id: z.string(), - model: z.string(), - object: InternChatCompletionChunkObject$inboundSchema, - session_id: z.nullable(z.string()).optional(), - usage: z.nullable(InternChatUsage$inboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - "session_id": "sessionId", - }); -}); - -export function internChatCompletionChunkFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => InternChatCompletionChunk$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'InternChatCompletionChunk' from JSON`, - ); -} diff --git a/src/models/internchatcompletionrequest.ts b/src/models/internchatcompletionrequest.ts deleted file mode 100644 index 13f44684f..000000000 --- a/src/models/internchatcompletionrequest.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 46664fa50bff - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../lib/primitives.js"; -import { - InternApprovalMode, - InternApprovalMode$outboundSchema, -} from "./internapprovalmode.js"; -import { - InternChatMessage, - InternChatMessage$Outbound, - InternChatMessage$outboundSchema, -} from "./internchatmessage.js"; - -/** - * An OpenAI-compatible streaming chat completion request for one intern. Other OpenAI fields such as `temperature` or `tools` are ignored. The intern owns its sampling and its tools. - */ -export type InternChatCompletionRequest = { - /** - * 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. - */ - approvalMode?: InternApprovalMode | undefined; - /** - * 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`. - */ - messages: Array; - /** - * 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. 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. `false` or an omitted `stream` is refused with `400` and reason `bad_request`. - */ - stream: true; -}; - -/** @internal */ -export type InternChatCompletionRequest$Outbound = { - approval_mode?: string | undefined; - messages: Array; - model?: string | undefined; - session_id?: string | undefined; - stream: true; -}; - -/** @internal */ -export const InternChatCompletionRequest$outboundSchema: z.ZodType< - InternChatCompletionRequest$Outbound, - InternChatCompletionRequest -> = z.object({ - approvalMode: InternApprovalMode$outboundSchema.optional(), - messages: z.array(InternChatMessage$outboundSchema), - model: z.string().optional(), - sessionId: z.string().optional(), - stream: z.literal(true), -}).transform((v) => { - return remap$(v, { - approvalMode: "approval_mode", - sessionId: "session_id", - }); -}); - -export function internChatCompletionRequestToJSON( - internChatCompletionRequest: InternChatCompletionRequest, -): string { - return JSON.stringify( - InternChatCompletionRequest$outboundSchema.parse( - internChatCompletionRequest, - ), - ); -} diff --git a/src/models/internchatdelta.ts b/src/models/internchatdelta.ts deleted file mode 100644 index 019fd58ec..000000000 --- a/src/models/internchatdelta.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: c2dc1f33e1df - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { ClosedEnum } from "../types/enums.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; -import { - InternChatToolCall, - InternChatToolCall$inboundSchema, -} from "./internchattoolcall.js"; - -export const InternChatDeltaRole = { - Assistant: "assistant", -} as const; -export type InternChatDeltaRole = ClosedEnum; - -/** - * The incremental content of one chunk. The first chunk carries `role`, text chunks carry `content`, reasoning chunks carry `reasoning`, and an interaction chunk carries one complete `tool_calls` entry. - */ -export type InternChatDelta = { - content?: string | undefined; - reasoning?: string | undefined; - role?: InternChatDeltaRole | undefined; - toolCalls?: Array | undefined; -}; - -/** @internal */ -export const InternChatDeltaRole$inboundSchema: z.ZodEnum< - typeof InternChatDeltaRole -> = z.enum(InternChatDeltaRole); - -/** @internal */ -export const InternChatDelta$inboundSchema: z.ZodType< - InternChatDelta, - unknown -> = z.object({ - content: z.string().optional(), - reasoning: z.string().optional(), - role: InternChatDeltaRole$inboundSchema.optional(), - tool_calls: z.array(InternChatToolCall$inboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - "tool_calls": "toolCalls", - }); -}); - -export function internChatDeltaFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => InternChatDelta$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'InternChatDelta' from JSON`, - ); -} diff --git a/src/models/internchatdevelopermessage.ts b/src/models/internchatdevelopermessage.ts deleted file mode 100644 index a82b6f5b5..000000000 --- a/src/models/internchatdevelopermessage.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 42bfc57a5f4f - */ - -import * as z from "zod/v4"; -import { - InternChatMessageContent, - InternChatMessageContent$Outbound, - InternChatMessageContent$outboundSchema, -} from "./internchatmessagecontent.js"; - -/** - * A developer message. Accepted for client compatibility and not forwarded. - */ -export type InternChatDeveloperMessage = { - /** - * Message text as a string or a list of text parts. Assistant history may carry null. Only the last message is read; earlier messages are accepted so ordinary clients can resend history. - */ - content: InternChatMessageContent | null; - role: "developer"; -}; - -/** @internal */ -export type InternChatDeveloperMessage$Outbound = { - content: InternChatMessageContent$Outbound | null; - role: "developer"; -}; - -/** @internal */ -export const InternChatDeveloperMessage$outboundSchema: z.ZodType< - InternChatDeveloperMessage$Outbound, - InternChatDeveloperMessage -> = z.object({ - content: z.nullable(InternChatMessageContent$outboundSchema), - role: z.literal("developer"), -}); - -export function internChatDeveloperMessageToJSON( - internChatDeveloperMessage: InternChatDeveloperMessage, -): string { - return JSON.stringify( - InternChatDeveloperMessage$outboundSchema.parse(internChatDeveloperMessage), - ); -} diff --git a/src/models/internchatechoedtoolcall.ts b/src/models/internchatechoedtoolcall.ts deleted file mode 100644 index b4c22093f..000000000 --- a/src/models/internchatechoedtoolcall.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 28fd4d113f6d - */ - -import * as z from "zod/v4"; -import { - InternChatEchoedToolCallFunction, - InternChatEchoedToolCallFunction$Outbound, - InternChatEchoedToolCallFunction$outboundSchema, -} from "./internchatechoedtoolcallfunction.js"; - -/** - * The `openrouter.provide_input` tool call from the previous response, echoed back unchanged. Its `id` is the interaction the following `tool` message answers. - */ -export type InternChatEchoedToolCall = { - /** - * The function name and JSON arguments string exactly as streamed. - */ - function: InternChatEchoedToolCallFunction; - id: string; -}; - -/** @internal */ -export type InternChatEchoedToolCall$Outbound = { - function: InternChatEchoedToolCallFunction$Outbound; - id: string; -}; - -/** @internal */ -export const InternChatEchoedToolCall$outboundSchema: z.ZodType< - InternChatEchoedToolCall$Outbound, - InternChatEchoedToolCall -> = z.object({ - function: InternChatEchoedToolCallFunction$outboundSchema, - id: z.string(), -}); - -export function internChatEchoedToolCallToJSON( - internChatEchoedToolCall: InternChatEchoedToolCall, -): string { - return JSON.stringify( - InternChatEchoedToolCall$outboundSchema.parse(internChatEchoedToolCall), - ); -} diff --git a/src/models/internchatechoedtoolcallfunction.ts b/src/models/internchatechoedtoolcallfunction.ts deleted file mode 100644 index 39d628888..000000000 --- a/src/models/internchatechoedtoolcallfunction.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 427820de46b3 - */ - -import * as z from "zod/v4"; - -/** - * The function name and JSON arguments string exactly as streamed. - */ -export type InternChatEchoedToolCallFunction = { - arguments: string; - name: string; -}; - -/** @internal */ -export type InternChatEchoedToolCallFunction$Outbound = { - arguments: string; - name: string; -}; - -/** @internal */ -export const InternChatEchoedToolCallFunction$outboundSchema: z.ZodType< - InternChatEchoedToolCallFunction$Outbound, - InternChatEchoedToolCallFunction -> = z.object({ - arguments: z.string(), - name: z.string(), -}); - -export function internChatEchoedToolCallFunctionToJSON( - internChatEchoedToolCallFunction: InternChatEchoedToolCallFunction, -): string { - return JSON.stringify( - InternChatEchoedToolCallFunction$outboundSchema.parse( - internChatEchoedToolCallFunction, - ), - ); -} diff --git a/src/models/internchaterror.ts b/src/models/internchaterror.ts deleted file mode 100644 index d6060b435..000000000 --- a/src/models/internchaterror.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 9bf0417c1e10 - */ - -import * as z from "zod/v4"; -import { safeParse } from "../lib/schemas.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; -import { - InternChatErrorMetadata, - InternChatErrorMetadata$inboundSchema, -} from "./internchaterrormetadata.js"; - -/** - * The OpenAI-compatible error object. `metadata` is present on refusals from the chat route. Authentication refusals (`401`), the departed-creator `403` and the programme `404` carry only `code` and `message`. - */ -export type InternChatError = { - /** - * The HTTP status of the response. - */ - code: number; - message: string; - /** - * Machine-readable detail for the failure. - */ - metadata?: InternChatErrorMetadata | undefined; -}; - -/** @internal */ -export const InternChatError$inboundSchema: z.ZodType< - InternChatError, - unknown -> = z.object({ - code: z.int(), - message: z.string(), - metadata: InternChatErrorMetadata$inboundSchema.optional(), -}); - -export function internChatErrorFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => InternChatError$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'InternChatError' from JSON`, - ); -} diff --git a/src/models/internchaterrormetadata.ts b/src/models/internchaterrormetadata.ts deleted file mode 100644 index f1ad7371f..000000000 --- a/src/models/internchaterrormetadata.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 3a4e9b3de0d5 - */ - -import * as z from "zod/v4"; -import { safeParse } from "../lib/schemas.js"; -import * as openEnums from "../types/enums.js"; -import { OpenEnum } from "../types/enums.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; - -/** - * A stable reason a client can branch on. - */ -export const InternChatErrorMetadataReason = { - AttachmentFailed: "attachment_failed", - BadRequest: "bad_request", - Busy: "busy", - ClientClosedRequest: "client_closed_request", - InteractionNotPending: "interaction_not_pending", - InteractionUnknown: "interaction_unknown", - InternNotReady: "intern_not_ready", - InternRejected: "intern_rejected", - InternUnreachable: "intern_unreachable", - NotFound: "not_found", - PayloadTooLarge: "payload_too_large", - RateLimited: "rate_limited", - RunEnded: "run_ended", - StreamSevered: "stream_severed", - Timeout: "timeout", - TurnFailed: "turn_failed", -} as const; -/** - * A stable reason a client can branch on. - */ -export type InternChatErrorMetadataReason = OpenEnum< - typeof InternChatErrorMetadataReason ->; - -/** - * Machine-readable detail for the failure. - */ -export type InternChatErrorMetadata = { - /** - * A stable reason a client can branch on. - */ - reason: InternChatErrorMetadataReason; - /** - * Whether the same request may be sent again unchanged. Always `true` for the transient refusals — `busy`, `intern_not_ready`, `intern_unreachable`, `rate_limited`, `stream_severed` and `timeout` — and always `false` for the ones a retry cannot fix. For `turn_failed` it varies by failure and is the intern's own classification of what went wrong: `true` for an upstream overload, rate limit, timeout or transport fault, `false` for an authentication or bad-request failure that would be rejected the same way again. Branch on this field rather than on `reason` when deciding whether to retry. A `429`, and a `409` or `503` with reason `busy`, also carry a `Retry-After` header saying how long to wait. - */ - retryable: boolean; -}; - -/** @internal */ -export const InternChatErrorMetadataReason$inboundSchema: z.ZodType< - InternChatErrorMetadataReason, - unknown -> = openEnums.inboundSchema(InternChatErrorMetadataReason); - -/** @internal */ -export const InternChatErrorMetadata$inboundSchema: z.ZodType< - InternChatErrorMetadata, - unknown -> = z.object({ - reason: InternChatErrorMetadataReason$inboundSchema, - retryable: z.boolean(), -}); - -export function internChatErrorMetadataFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => InternChatErrorMetadata$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'InternChatErrorMetadata' from JSON`, - ); -} diff --git a/src/models/internchatmessage.ts b/src/models/internchatmessage.ts deleted file mode 100644 index 8b082491e..000000000 --- a/src/models/internchatmessage.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: b5080dcf9c97 - */ - -import * as z from "zod/v4"; -import { - InternChatAssistantMessage, - InternChatAssistantMessage$Outbound, - InternChatAssistantMessage$outboundSchema, -} from "./internchatassistantmessage.js"; -import { - InternChatDeveloperMessage, - InternChatDeveloperMessage$Outbound, - InternChatDeveloperMessage$outboundSchema, -} from "./internchatdevelopermessage.js"; -import { - InternChatSystemMessage, - InternChatSystemMessage$Outbound, - InternChatSystemMessage$outboundSchema, -} from "./internchatsystemmessage.js"; -import { - InternChatToolMessage, - InternChatToolMessage$Outbound, - InternChatToolMessage$outboundSchema, -} from "./internchattoolmessage.js"; -import { - InternChatUserMessage, - InternChatUserMessage$Outbound, - InternChatUserMessage$outboundSchema, -} from "./internchatusermessage.js"; - -/** - * One OpenAI-compatible chat message, discriminated by `role`. - */ -export type InternChatMessage = - | InternChatAssistantMessage - | InternChatDeveloperMessage - | InternChatSystemMessage - | InternChatToolMessage - | InternChatUserMessage; - -/** @internal */ -export type InternChatMessage$Outbound = - | InternChatAssistantMessage$Outbound - | InternChatDeveloperMessage$Outbound - | InternChatSystemMessage$Outbound - | InternChatToolMessage$Outbound - | InternChatUserMessage$Outbound; - -/** @internal */ -export const InternChatMessage$outboundSchema: z.ZodType< - InternChatMessage$Outbound, - InternChatMessage -> = z.union([ - InternChatAssistantMessage$outboundSchema, - InternChatDeveloperMessage$outboundSchema, - InternChatSystemMessage$outboundSchema, - InternChatToolMessage$outboundSchema, - InternChatUserMessage$outboundSchema, -]); - -export function internChatMessageToJSON( - internChatMessage: InternChatMessage, -): string { - return JSON.stringify( - InternChatMessage$outboundSchema.parse(internChatMessage), - ); -} diff --git a/src/models/internchatmessagecontent.ts b/src/models/internchatmessagecontent.ts deleted file mode 100644 index c93982ca8..000000000 --- a/src/models/internchatmessagecontent.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 98b91b7e9488 - */ - -import * as z from "zod/v4"; -import { - InternChatTextPart, - InternChatTextPart$Outbound, - InternChatTextPart$outboundSchema, -} from "./internchattextpart.js"; - -/** - * Message text as a string or a list of text parts. Assistant history may carry null. Only the last message is read; earlier messages are accepted so ordinary clients can resend history. - */ -export type InternChatMessageContent = string | Array; - -/** @internal */ -export type InternChatMessageContent$Outbound = - | string - | Array; - -/** @internal */ -export const InternChatMessageContent$outboundSchema: z.ZodType< - InternChatMessageContent$Outbound, - InternChatMessageContent -> = z.union([z.string(), z.array(InternChatTextPart$outboundSchema)]); - -export function internChatMessageContentToJSON( - internChatMessageContent: InternChatMessageContent, -): string { - return JSON.stringify( - InternChatMessageContent$outboundSchema.parse(internChatMessageContent), - ); -} diff --git a/src/models/internchatprompttokensdetails.ts b/src/models/internchatprompttokensdetails.ts deleted file mode 100644 index 652657a8b..000000000 --- a/src/models/internchatprompttokensdetails.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: f7f08da9ab18 - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; - -/** - * Prompt tokens served from cache, when the daemon reported them. - */ -export type InternChatPromptTokensDetails = { - cachedTokens: number; -}; - -/** @internal */ -export const InternChatPromptTokensDetails$inboundSchema: z.ZodType< - InternChatPromptTokensDetails, - unknown -> = z.object({ - cached_tokens: z.int(), -}).transform((v) => { - return remap$(v, { - "cached_tokens": "cachedTokens", - }); -}); - -export function internChatPromptTokensDetailsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => InternChatPromptTokensDetails$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'InternChatPromptTokensDetails' from JSON`, - ); -} diff --git a/src/models/internchatsteeredresponse.ts b/src/models/internchatsteeredresponse.ts deleted file mode 100644 index 5ec3ba4fb..000000000 --- a/src/models/internchatsteeredresponse.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 81a2168a45b8 - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { ClosedEnum } from "../types/enums.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; - -/** - * The message was handed to the turn already running on this session. - */ -export const InternChatSteeredResponseStatus = { - Steered: "steered", -} as const; -/** - * The message was handed to the turn already running on this session. - */ -export type InternChatSteeredResponseStatus = ClosedEnum< - typeof InternChatSteeredResponseStatus ->; - -/** - * The message was delivered into the turn already running on the same session. Its effect is streamed on that turn, not here. - */ -export type InternChatSteeredResponse = { - /** - * The session of the running turn the message was delivered to. - */ - sessionId: string; - /** - * The message was handed to the turn already running on this session. - */ - status: InternChatSteeredResponseStatus; -}; - -/** @internal */ -export const InternChatSteeredResponseStatus$inboundSchema: z.ZodEnum< - typeof InternChatSteeredResponseStatus -> = z.enum(InternChatSteeredResponseStatus); - -/** @internal */ -export const InternChatSteeredResponse$inboundSchema: z.ZodType< - InternChatSteeredResponse, - unknown -> = z.object({ - session_id: z.string(), - status: InternChatSteeredResponseStatus$inboundSchema, -}).transform((v) => { - return remap$(v, { - "session_id": "sessionId", - }); -}); - -export function internChatSteeredResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => InternChatSteeredResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'InternChatSteeredResponse' from JSON`, - ); -} diff --git a/src/models/internchatstreamerror.ts b/src/models/internchatstreamerror.ts deleted file mode 100644 index 905651fdd..000000000 --- a/src/models/internchatstreamerror.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: c9734c01b14b - */ - -import * as z from "zod/v4"; -import { safeParse } from "../lib/schemas.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; -import { - InternChatErrorMetadata, - InternChatErrorMetadata$inboundSchema, -} from "./internchaterrormetadata.js"; - -/** - * 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. - */ -export type InternChatStreamError = { - /** - * The HTTP status this failure would have had before the stream opened. - */ - code: number; - message: string; - /** - * Machine-readable detail for the failure. - */ - metadata: InternChatErrorMetadata; -}; - -/** @internal */ -export const InternChatStreamError$inboundSchema: z.ZodType< - InternChatStreamError, - unknown -> = z.object({ - code: z.int(), - message: z.string(), - metadata: InternChatErrorMetadata$inboundSchema, -}); - -export function internChatStreamErrorFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => InternChatStreamError$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'InternChatStreamError' from JSON`, - ); -} diff --git a/src/models/internchatstreamingresponse.ts b/src/models/internchatstreamingresponse.ts deleted file mode 100644 index 0bfd2ef34..000000000 --- a/src/models/internchatstreamingresponse.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: c322164c222e - */ - -import * as z from "zod/v4"; -import { safeParse } from "../lib/schemas.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; -import { - InternChatCompletionChunk, - InternChatCompletionChunk$inboundSchema, -} from "./internchatcompletionchunk.js"; - -/** - * A server-sent event carrying one chunk. The stream ends with `data: [DONE]`. - */ -export type InternChatStreamingResponse = { - /** - * One `data:` line of the stream. A run streams a role chunk, content and reasoning chunks, then a finish chunk: `stop`, `tool_calls` (the run is paused for input) or `error` (with an `error` object). A final chunk with empty `choices` follows in every case, carrying `session_id` and `usage` (`null` unless the daemon reported usage, and always `null` after `tool_calls`). Every stream ends with `[DONE]`. - */ - data: InternChatCompletionChunk; -}; - -/** @internal */ -export const InternChatStreamingResponse$inboundSchema: z.ZodType< - InternChatStreamingResponse, - unknown -> = z.object({ - data: z.unknown().transform((v, ctx) => { - if (typeof v !== "string") return v; - try { - return JSON.parse(v); - } catch (err) { - ctx.addIssue({ - input: v, - code: "custom", - message: `malformed json: ${err}`, - }); - return z.NEVER; - } - }).pipe(InternChatCompletionChunk$inboundSchema), -}); - -export function internChatStreamingResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => InternChatStreamingResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'InternChatStreamingResponse' from JSON`, - ); -} diff --git a/src/models/internchatsystemmessage.ts b/src/models/internchatsystemmessage.ts deleted file mode 100644 index b71e177d1..000000000 --- a/src/models/internchatsystemmessage.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 4d16d7aadf85 - */ - -import * as z from "zod/v4"; -import { - InternChatMessageContent, - InternChatMessageContent$Outbound, - InternChatMessageContent$outboundSchema, -} from "./internchatmessagecontent.js"; - -/** - * A system message. Accepted for client compatibility and not forwarded. - */ -export type InternChatSystemMessage = { - /** - * Message text as a string or a list of text parts. Assistant history may carry null. Only the last message is read; earlier messages are accepted so ordinary clients can resend history. - */ - content: InternChatMessageContent | null; - role: "system"; -}; - -/** @internal */ -export type InternChatSystemMessage$Outbound = { - content: InternChatMessageContent$Outbound | null; - role: "system"; -}; - -/** @internal */ -export const InternChatSystemMessage$outboundSchema: z.ZodType< - InternChatSystemMessage$Outbound, - InternChatSystemMessage -> = z.object({ - content: z.nullable(InternChatMessageContent$outboundSchema), - role: z.literal("system"), -}); - -export function internChatSystemMessageToJSON( - internChatSystemMessage: InternChatSystemMessage, -): string { - return JSON.stringify( - InternChatSystemMessage$outboundSchema.parse(internChatSystemMessage), - ); -} diff --git a/src/models/internchattextpart.ts b/src/models/internchattextpart.ts deleted file mode 100644 index ae8759f4b..000000000 --- a/src/models/internchattextpart.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: f2832e16aec8 - */ - -import * as z from "zod/v4"; -import { ClosedEnum } from "../types/enums.js"; - -export const InternChatTextPartType = { - Text: "text", -} as const; -export type InternChatTextPartType = ClosedEnum; - -/** - * One text part of a message. - */ -export type InternChatTextPart = { - text: string; - type: InternChatTextPartType; -}; - -/** @internal */ -export const InternChatTextPartType$outboundSchema: z.ZodEnum< - typeof InternChatTextPartType -> = z.enum(InternChatTextPartType); - -/** @internal */ -export type InternChatTextPart$Outbound = { - text: string; - type: string; -}; - -/** @internal */ -export const InternChatTextPart$outboundSchema: z.ZodType< - InternChatTextPart$Outbound, - InternChatTextPart -> = z.object({ - text: z.string(), - type: InternChatTextPartType$outboundSchema, -}); - -export function internChatTextPartToJSON( - internChatTextPart: InternChatTextPart, -): string { - return JSON.stringify( - InternChatTextPart$outboundSchema.parse(internChatTextPart), - ); -} diff --git a/src/models/internchattoolcall.ts b/src/models/internchattoolcall.ts deleted file mode 100644 index 5eada8ec5..000000000 --- a/src/models/internchattoolcall.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: ab9593cbcfd4 - */ - -import * as z from "zod/v4"; -import { safeParse } from "../lib/schemas.js"; -import { ClosedEnum } from "../types/enums.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; -import { - InternChatToolCallFunction, - InternChatToolCallFunction$inboundSchema, -} from "./internchattoolcallfunction.js"; - -export const InternChatToolCallType = { - Function: "function", -} as const; -export type InternChatToolCallType = ClosedEnum; - -/** - * An `openrouter.provide_input` request. The run pauses on the daemon until a `tool` message answers it, the caller cancels it, or its interaction deadline passes. - */ -export type InternChatToolCall = { - /** - * The single tool this endpoint calls, asking the caller for input. - */ - function: InternChatToolCallFunction; - /** - * The interaction id. Send it back as `tool_call_id` on the `tool` message that answers it. - */ - id: string; - index: number; - type: InternChatToolCallType; -}; - -/** @internal */ -export const InternChatToolCallType$inboundSchema: z.ZodEnum< - typeof InternChatToolCallType -> = z.enum(InternChatToolCallType); - -/** @internal */ -export const InternChatToolCall$inboundSchema: z.ZodType< - InternChatToolCall, - unknown -> = z.object({ - function: InternChatToolCallFunction$inboundSchema, - id: z.string(), - index: z.int(), - type: InternChatToolCallType$inboundSchema, -}); - -export function internChatToolCallFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => InternChatToolCall$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'InternChatToolCall' from JSON`, - ); -} diff --git a/src/models/internchattoolcallfunction.ts b/src/models/internchattoolcallfunction.ts deleted file mode 100644 index 5f2b0fd14..000000000 --- a/src/models/internchattoolcallfunction.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 5a9b88a1d80e - */ - -import * as z from "zod/v4"; -import { safeParse } from "../lib/schemas.js"; -import { ClosedEnum } from "../types/enums.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; - -export const InternChatToolCallFunctionName = { - OpenrouterProvideInput: "openrouter.provide_input", -} as const; -export type InternChatToolCallFunctionName = ClosedEnum< - typeof InternChatToolCallFunctionName ->; - -/** - * The single tool this endpoint calls, asking the caller for input. - */ -export type InternChatToolCallFunction = { - /** - * A JSON object string describing the interaction. A permission request is `{"kind":"permission","operation":,"options":[]}`. A question is `{"kind":"elicitation","message":,"fields":[]}`. - */ - arguments: string; - name: InternChatToolCallFunctionName; -}; - -/** @internal */ -export const InternChatToolCallFunctionName$inboundSchema: z.ZodEnum< - typeof InternChatToolCallFunctionName -> = z.enum(InternChatToolCallFunctionName); - -/** @internal */ -export const InternChatToolCallFunction$inboundSchema: z.ZodType< - InternChatToolCallFunction, - unknown -> = z.object({ - arguments: z.string(), - name: InternChatToolCallFunctionName$inboundSchema, -}); - -export function internChatToolCallFunctionFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => InternChatToolCallFunction$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'InternChatToolCallFunction' from JSON`, - ); -} diff --git a/src/models/internchattoolmessage.ts b/src/models/internchattoolmessage.ts deleted file mode 100644 index 4b51774fa..000000000 --- a/src/models/internchattoolmessage.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 8ef92162c037 - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../lib/primitives.js"; -import { - InternChatMessageContent, - InternChatMessageContent$Outbound, - InternChatMessageContent$outboundSchema, -} from "./internchatmessagecontent.js"; - -/** - * The answer to an `openrouter.provide_input` tool call. `tool_call_id` is the streamed tool call id and `session_id` must name the same session. For a permission, `content` is one of the offered option kinds (`allow_once`, `allow_always`, `reject_once`, `reject_always`) or `cancel`. For a question (elicitation), `content` is a JSON object string with `action` (`accept`, `decline` or `cancel`) and, for `accept`, `content` holding the field values. The answer is delivered to the run that asked. It never starts a new run. - */ -export type InternChatToolMessage = { - /** - * Message text as a string or a list of text parts. Assistant history may carry null. Only the last message is read; earlier messages are accepted so ordinary clients can resend history. - */ - content: InternChatMessageContent | null; - role: "tool"; - toolCallId: string; -}; - -/** @internal */ -export type InternChatToolMessage$Outbound = { - content: InternChatMessageContent$Outbound | null; - role: "tool"; - tool_call_id: string; -}; - -/** @internal */ -export const InternChatToolMessage$outboundSchema: z.ZodType< - InternChatToolMessage$Outbound, - InternChatToolMessage -> = z.object({ - content: z.nullable(InternChatMessageContent$outboundSchema), - role: z.literal("tool"), - toolCallId: z.string(), -}).transform((v) => { - return remap$(v, { - toolCallId: "tool_call_id", - }); -}); - -export function internChatToolMessageToJSON( - internChatToolMessage: InternChatToolMessage, -): string { - return JSON.stringify( - InternChatToolMessage$outboundSchema.parse(internChatToolMessage), - ); -} diff --git a/src/models/internchatusage.ts b/src/models/internchatusage.ts deleted file mode 100644 index d9b216676..000000000 --- a/src/models/internchatusage.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 49d346597315 - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; -import { - InternChatPromptTokensDetails, - InternChatPromptTokensDetails$inboundSchema, -} from "./internchatprompttokensdetails.js"; - -/** - * 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. - */ -export type InternChatUsage = { - completionTokens: number; - /** - * The cost of the run in USD, when the daemon reported one. - */ - cost?: number | undefined; - promptTokens: number; - /** - * Prompt tokens served from cache, when the daemon reported them. - */ - promptTokensDetails?: InternChatPromptTokensDetails | undefined; - totalTokens: number; -}; - -/** @internal */ -export const InternChatUsage$inboundSchema: z.ZodType< - InternChatUsage, - unknown -> = z.object({ - completion_tokens: z.int(), - cost: z.number().optional(), - prompt_tokens: z.int(), - prompt_tokens_details: InternChatPromptTokensDetails$inboundSchema.optional(), - total_tokens: z.int(), -}).transform((v) => { - return remap$(v, { - "completion_tokens": "completionTokens", - "prompt_tokens": "promptTokens", - "prompt_tokens_details": "promptTokensDetails", - "total_tokens": "totalTokens", - }); -}); - -export function internChatUsageFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => InternChatUsage$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'InternChatUsage' from JSON`, - ); -} diff --git a/src/models/internchatusermessage.ts b/src/models/internchatusermessage.ts deleted file mode 100644 index ae6f841af..000000000 --- a/src/models/internchatusermessage.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 6d3909ea9433 - */ - -import * as z from "zod/v4"; -import { - InternChatMessageContent, - InternChatMessageContent$Outbound, - InternChatMessageContent$outboundSchema, -} from "./internchatmessagecontent.js"; - -/** - * A user message. When it is the last message its text is the prompt for a new run, at most 32000 characters. - */ -export type InternChatUserMessage = { - /** - * Message text as a string or a list of text parts. Assistant history may carry null. Only the last message is read; earlier messages are accepted so ordinary clients can resend history. - */ - content: InternChatMessageContent | null; - role: "user"; -}; - -/** @internal */ -export type InternChatUserMessage$Outbound = { - content: InternChatMessageContent$Outbound | null; - role: "user"; -}; - -/** @internal */ -export const InternChatUserMessage$outboundSchema: z.ZodType< - InternChatUserMessage$Outbound, - InternChatUserMessage -> = z.object({ - content: z.nullable(InternChatMessageContent$outboundSchema), - role: z.literal("user"), -}); - -export function internChatUserMessageToJSON( - internChatUserMessage: InternChatUserMessage, -): string { - return JSON.stringify( - InternChatUserMessage$outboundSchema.parse(internChatUserMessage), - ); -} diff --git a/src/models/internconnection.ts b/src/models/internconnection.ts deleted file mode 100644 index 06502ef88..000000000 --- a/src/models/internconnection.ts +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: c1d0989d7937 - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import * as openEnums from "../types/enums.js"; -import { OpenEnum } from "../types/enums.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; - -/** - * `workspace` for a shared connection, `yours` for the key user's personal account, `shared` for a teammate's. - */ -export const InternConnectionScope = { - Workspace: "workspace", - Yours: "yours", - Shared: "shared", -} as const; -/** - * `workspace` for a shared connection, `yours` for the key user's personal account, `shared` for a teammate's. - */ -export type InternConnectionScope = OpenEnum; - -export type Account = { - /** - * Whose account it acts as, when known. - */ - actsAs: string | null; - isYourAccountLinked: boolean | null; - note: string | null; - /** - * `workspace` for a shared connection, `yours` for the key user's personal account, `shared` for a teammate's. - */ - scope: InternConnectionScope; -}; - -export const Kind = { - Slack: "slack", - Github: "github", - Google: "google", - Mcp: "mcp", -} as const; -export type Kind = OpenEnum; - -/** - * `switched_off` for this intern, `disabled` for the whole workspace; null while on. - */ -export const OffReason = { - SwitchedOff: "switched_off", - Disabled: "disabled", -} as const; -/** - * `switched_off` for this intern, `disabled` for the whole workspace; null while on. - */ -export type OffReason = OpenEnum; - -export type Server = { - host: string | null; - surface: string; - transport: string; - url: string | null; -}; - -export const StateEnum = { - Connected: "connected", - NeedsReconnect: "needs_reconnect", - NotTested: "not_tested", - Error: "error", -} as const; -export type StateEnum = OpenEnum; - -export type InternConnectionStatus = { - reason: string | null; - state: StateEnum; -}; - -export type InternConnection = { - account: Account; - /** - * Stable id: the credential id of an MCP server, else the kind (`slack`, `github`, `google`). - */ - id: string; - /** - * Whether the intern reaches it now. - */ - isEnabled: boolean; - /** - * Scoped to this intern rather than shared by the workspace. - */ - isInternOnly: boolean; - kind: Kind; - /** - * The name the intern's MCP config keys the server by; null when it is not an MCP server or is off. - */ - mcpServerName: string | null; - /** - * Display name. - */ - name: string; - /** - * `switched_off` for this intern, `disabled` for the whole workspace; null while on. - */ - offReason: OffReason | null; - server: Server | null; - status: InternConnectionStatus; - /** - * Tools found by the last successful test. - */ - toolCount: number | null; -}; - -/** @internal */ -export const InternConnectionScope$inboundSchema: z.ZodType< - InternConnectionScope, - unknown -> = openEnums.inboundSchema(InternConnectionScope); - -/** @internal */ -export const Account$inboundSchema: z.ZodType = z.object({ - acts_as: z.nullable(z.string()), - is_your_account_linked: z.nullable(z.boolean()), - note: z.nullable(z.string()), - scope: InternConnectionScope$inboundSchema, -}).transform((v) => { - return remap$(v, { - "acts_as": "actsAs", - "is_your_account_linked": "isYourAccountLinked", - }); -}); - -export function accountFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Account$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Account' from JSON`, - ); -} - -/** @internal */ -export const Kind$inboundSchema: z.ZodType = openEnums - .inboundSchema(Kind); - -/** @internal */ -export const OffReason$inboundSchema: z.ZodType = openEnums - .inboundSchema(OffReason); - -/** @internal */ -export const Server$inboundSchema: z.ZodType = z.object({ - host: z.nullable(z.string()), - surface: z.string(), - transport: z.string(), - url: z.nullable(z.string()), -}); - -export function serverFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Server$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Server' from JSON`, - ); -} - -/** @internal */ -export const StateEnum$inboundSchema: z.ZodType = openEnums - .inboundSchema(StateEnum); - -/** @internal */ -export const InternConnectionStatus$inboundSchema: z.ZodType< - InternConnectionStatus, - unknown -> = z.object({ - reason: z.nullable(z.string()), - state: StateEnum$inboundSchema, -}); - -export function internConnectionStatusFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => InternConnectionStatus$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'InternConnectionStatus' from JSON`, - ); -} - -/** @internal */ -export const InternConnection$inboundSchema: z.ZodType< - InternConnection, - unknown -> = z.object({ - account: z.lazy(() => Account$inboundSchema), - id: z.string(), - is_enabled: z.boolean(), - is_intern_only: z.boolean(), - kind: Kind$inboundSchema, - mcp_server_name: z.nullable(z.string()), - name: z.string(), - off_reason: z.nullable(OffReason$inboundSchema), - server: z.nullable(z.lazy(() => Server$inboundSchema)), - status: z.lazy(() => InternConnectionStatus$inboundSchema), - tool_count: z.nullable(z.int()), -}).transform((v) => { - return remap$(v, { - "is_enabled": "isEnabled", - "is_intern_only": "isInternOnly", - "mcp_server_name": "mcpServerName", - "off_reason": "offReason", - "tool_count": "toolCount", - }); -}); - -export function internConnectionFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => InternConnection$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'InternConnection' from JSON`, - ); -} diff --git a/src/models/internconnectionlist.ts b/src/models/internconnectionlist.ts deleted file mode 100644 index d6de2cf2c..000000000 --- a/src/models/internconnectionlist.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: e3ed2abef547 - */ - -import * as z from "zod/v4"; -import { safeParse } from "../lib/schemas.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; -import { - InternConnection, - InternConnection$inboundSchema, -} from "./internconnection.js"; - -export type InternConnectionList = { - data: Array; -}; - -/** @internal */ -export const InternConnectionList$inboundSchema: z.ZodType< - InternConnectionList, - unknown -> = z.object({ - data: z.array(InternConnection$inboundSchema), -}); - -export function internConnectionListFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => InternConnectionList$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'InternConnectionList' from JSON`, - ); -} diff --git a/src/models/interndaemonaccess.ts b/src/models/interndaemonaccess.ts deleted file mode 100644 index 5a8c2fb3a..000000000 --- a/src/models/interndaemonaccess.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 3e1c71908a89 - */ - -import * as z from "zod/v4"; -import { safeParse } from "../lib/schemas.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; - -export type Viewer = { - /** - * The caller's Ori principals on this intern: `clerk:`, and, when the grant carries `vault:read`, `slack::` for each Slack account they linked to it. A session started by one of them in a one-to-one Slack DM is the caller's to see. - */ - principals: Array; -}; - -/** - * The intern daemon's origin, the bearer `ori tui --host` sends to it as `ORI_DAEMON_TOKEN`, and who the caller is on the intern. - */ -export type InternDaemonAccess = { - origin: string; - token: string; - viewer: Viewer; -}; - -/** @internal */ -export const Viewer$inboundSchema: z.ZodType = z.object({ - principals: z.array(z.string()), -}); - -export function viewerFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Viewer$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Viewer' from JSON`, - ); -} - -/** @internal */ -export const InternDaemonAccess$inboundSchema: z.ZodType< - InternDaemonAccess, - unknown -> = z.object({ - origin: z.string(), - token: z.string(), - viewer: z.lazy(() => Viewer$inboundSchema), -}); - -export function internDaemonAccessFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => InternDaemonAccess$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'InternDaemonAccess' from JSON`, - ); -} diff --git a/src/models/interninvokeacceptedresponse.ts b/src/models/interninvokeacceptedresponse.ts deleted file mode 100644 index d825f3099..000000000 --- a/src/models/interninvokeacceptedresponse.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 4684252ebfd9 - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import * as openEnums from "../types/enums.js"; -import { OpenEnum } from "../types/enums.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; - -/** - * `started` when a new run began. `steered` when the session already had a run going and the prompt was delivered into it instead. - */ -export const InternInvokeAcceptedResponseStatus = { - Started: "started", - Steered: "steered", -} as const; -/** - * `started` when a new run began. `steered` when the session already had a run going and the prompt was delivered into it instead. - */ -export type InternInvokeAcceptedResponseStatus = OpenEnum< - typeof InternInvokeAcceptedResponseStatus ->; - -/** - * The intern admitted the prompt. The run continues on the intern. - */ -export type InternInvokeAcceptedResponse = { - /** - * The session the run belongs to. Send it back to continue the conversation. - */ - sessionId: string; - /** - * `started` when a new run began. `steered` when the session already had a run going and the prompt was delivered into it instead. - */ - status: InternInvokeAcceptedResponseStatus; -}; - -/** @internal */ -export const InternInvokeAcceptedResponseStatus$inboundSchema: z.ZodType< - InternInvokeAcceptedResponseStatus, - unknown -> = openEnums.inboundSchema(InternInvokeAcceptedResponseStatus); - -/** @internal */ -export const InternInvokeAcceptedResponse$inboundSchema: z.ZodType< - InternInvokeAcceptedResponse, - unknown -> = z.object({ - session_id: z.string(), - status: InternInvokeAcceptedResponseStatus$inboundSchema, -}).transform((v) => { - return remap$(v, { - "session_id": "sessionId", - }); -}); - -export function internInvokeAcceptedResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => InternInvokeAcceptedResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'InternInvokeAcceptedResponse' from JSON`, - ); -} diff --git a/src/models/interninvokerequest.ts b/src/models/interninvokerequest.ts deleted file mode 100644 index ffbb6be7d..000000000 --- a/src/models/interninvokerequest.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 087aea86ca9d - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../lib/primitives.js"; - -/** - * A prompt to run on the intern without holding a connection open. - */ -export type InternInvokeRequest = { - /** - * The prompt for the run, at most 32000 characters. - */ - input: string; - /** - * The session to run in. Send the `session_id` from an earlier `202` to continue that conversation, for example to hand the intern a decision on a case it is working. Omit it to start a new session. Only a `session_id` this endpoint issued to the same caller on the same intern is accepted; any other is refused with `404`. - */ - sessionId?: string | undefined; -}; - -/** @internal */ -export type InternInvokeRequest$Outbound = { - input: string; - session_id?: string | undefined; -}; - -/** @internal */ -export const InternInvokeRequest$outboundSchema: z.ZodType< - InternInvokeRequest$Outbound, - InternInvokeRequest -> = z.object({ - input: z.string(), - sessionId: z.string().optional(), -}).transform((v) => { - return remap$(v, { - sessionId: "session_id", - }); -}); - -export function internInvokeRequestToJSON( - internInvokeRequest: InternInvokeRequest, -): string { - return JSON.stringify( - InternInvokeRequest$outboundSchema.parse(internInvokeRequest), - ); -} diff --git a/src/models/internlifecycleerror.ts b/src/models/internlifecycleerror.ts deleted file mode 100644 index a65e488c5..000000000 --- a/src/models/internlifecycleerror.ts +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 9d7cc6ac0062 - */ - -import * as z from "zod/v4"; -import { safeParse } from "../lib/schemas.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; - -export type Code = string | number; - -export type InternLifecycleErrorMetadata = { - reason: string; - retryable: boolean; -}; - -export type InternLifecycleErrorError = { - code: string | number; - message: string; - metadata?: InternLifecycleErrorMetadata | undefined; -}; - -/** @internal */ -export const Code$inboundSchema: z.ZodType = z.union([ - z.string(), - z.int(), -]); - -export function codeFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Code$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Code' from JSON`, - ); -} - -/** @internal */ -export const InternLifecycleErrorMetadata$inboundSchema: z.ZodType< - InternLifecycleErrorMetadata, - unknown -> = z.object({ - reason: z.string(), - retryable: z.boolean(), -}); - -export function internLifecycleErrorMetadataFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => InternLifecycleErrorMetadata$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'InternLifecycleErrorMetadata' from JSON`, - ); -} - -/** @internal */ -export const InternLifecycleErrorError$inboundSchema: z.ZodType< - InternLifecycleErrorError, - unknown -> = z.object({ - code: z.union([z.string(), z.int()]), - message: z.string(), - metadata: z.lazy(() => InternLifecycleErrorMetadata$inboundSchema).optional(), -}); - -export function internLifecycleErrorErrorFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => InternLifecycleErrorError$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'InternLifecycleErrorError' from JSON`, - ); -} diff --git a/src/models/internlistresponse.ts b/src/models/internlistresponse.ts deleted file mode 100644 index 0099b312a..000000000 --- a/src/models/internlistresponse.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: cd6ace7e64c6 - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; -import { Intern, Intern$inboundSchema } from "./intern.js"; - -/** - * Interns visible to the authenticated API key. - */ -export type InternListResponse = { - data: Array; - /** - * True when more interns match the current filters. - */ - hasMore: boolean; - /** - * Opaque cursor, present when `has_more` is true. Pass it as `starting_after` to fetch the next page. - */ - nextCursor?: string | undefined; -}; - -/** @internal */ -export const InternListResponse$inboundSchema: z.ZodType< - InternListResponse, - unknown -> = z.object({ - data: z.array(Intern$inboundSchema), - has_more: z.boolean(), - next_cursor: z.string().optional(), -}).transform((v) => { - return remap$(v, { - "has_more": "hasMore", - "next_cursor": "nextCursor", - }); -}); - -export function internListResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => InternListResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'InternListResponse' from JSON`, - ); -} diff --git a/src/models/operations/createintern.ts b/src/models/operations/createintern.ts deleted file mode 100644 index 1b89a6c6f..000000000 --- a/src/models/operations/createintern.ts +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 49d763cf1338 - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../../lib/primitives.js"; -import * as models from "../index.js"; - -export type CreateInternGlobals = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; -}; - -export type CreateInternRequest = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; - /** - * Key that makes retries resume the same create operation, from 1 through 255 characters. An empty or longer key is refused with 400. Without the header, the server derives a stable key from the request body. - */ - idempotencyKey?: string | undefined; - createInternRequest: models.CreateInternRequest; -}; - -/** @internal */ -export type CreateInternRequest$Outbound = { - "HTTP-Referer"?: string | undefined; - appTitle?: string | undefined; - appCategories?: string | undefined; - "Idempotency-Key"?: string | undefined; - CreateInternRequest: models.CreateInternRequest$Outbound; -}; - -/** @internal */ -export const CreateInternRequest$outboundSchema: z.ZodType< - CreateInternRequest$Outbound, - CreateInternRequest -> = z.object({ - httpReferer: z.string().optional(), - appTitle: z.string().optional(), - appCategories: z.string().optional(), - idempotencyKey: z.string().optional(), - createInternRequest: models.CreateInternRequest$outboundSchema, -}).transform((v) => { - return remap$(v, { - httpReferer: "HTTP-Referer", - idempotencyKey: "Idempotency-Key", - createInternRequest: "CreateInternRequest", - }); -}); - -export function createInternRequestToJSON( - createInternRequest: CreateInternRequest, -): string { - return JSON.stringify( - CreateInternRequest$outboundSchema.parse(createInternRequest), - ); -} diff --git a/src/models/operations/createinternchatcompletion.ts b/src/models/operations/createinternchatcompletion.ts deleted file mode 100644 index 0a49dec7c..000000000 --- a/src/models/operations/createinternchatcompletion.ts +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 0d92e801a635 - */ - -import * as z from "zod/v4"; -import { EventStream } from "../../lib/event-streams.js"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import * as models from "../index.js"; - -export type CreateInternChatCompletionGlobals = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; -}; - -export type CreateInternChatCompletionRequest = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; - /** - * The intern to talk to. - */ - internId: string; - internChatCompletionRequest: models.InternChatCompletionRequest; -}; - -export type CreateInternChatCompletionResponseResult = - | models.InternChatSteeredResponse - | EventStream; - -export type CreateInternChatCompletionResponse = { - headers: { [k: string]: Array }; - result: - | models.InternChatSteeredResponse - | EventStream; -}; - -/** @internal */ -export type CreateInternChatCompletionRequest$Outbound = { - "HTTP-Referer"?: string | undefined; - appTitle?: string | undefined; - appCategories?: string | undefined; - internId: string; - InternChatCompletionRequest: models.InternChatCompletionRequest$Outbound; -}; - -/** @internal */ -export const CreateInternChatCompletionRequest$outboundSchema: z.ZodType< - CreateInternChatCompletionRequest$Outbound, - CreateInternChatCompletionRequest -> = z.object({ - httpReferer: z.string().optional(), - appTitle: z.string().optional(), - appCategories: z.string().optional(), - internId: z.string(), - internChatCompletionRequest: - models.InternChatCompletionRequest$outboundSchema, -}).transform((v) => { - return remap$(v, { - httpReferer: "HTTP-Referer", - internChatCompletionRequest: "InternChatCompletionRequest", - }); -}); - -export function createInternChatCompletionRequestToJSON( - createInternChatCompletionRequest: CreateInternChatCompletionRequest, -): string { - return JSON.stringify( - CreateInternChatCompletionRequest$outboundSchema.parse( - createInternChatCompletionRequest, - ), - ); -} - -/** @internal */ -export const CreateInternChatCompletionResponseResult$inboundSchema: z.ZodType< - CreateInternChatCompletionResponseResult, - unknown -> = z.union([ - models.InternChatSteeredResponse$inboundSchema, - z.custom>(x => x instanceof ReadableStream) - .transform(stream => { - return new EventStream(stream, rawEvent => { - if (rawEvent.data === "[DONE]") return { done: true, value: undefined }; - return { - done: false, - value: models.InternChatStreamingResponse$inboundSchema.parse( - rawEvent, - )?.data, - }; - }); - }), -]); - -export function createInternChatCompletionResponseResultFromJSON( - jsonString: string, -): SafeParseResult< - CreateInternChatCompletionResponseResult, - SDKValidationError -> { - return safeParse( - jsonString, - (x) => - CreateInternChatCompletionResponseResult$inboundSchema.parse( - JSON.parse(x), - ), - `Failed to parse 'CreateInternChatCompletionResponseResult' from JSON`, - ); -} - -/** @internal */ -export const CreateInternChatCompletionResponse$inboundSchema: z.ZodType< - CreateInternChatCompletionResponse, - unknown -> = z.object({ - Headers: z.record(z.string(), z.array(z.string())).default({}), - Result: z.union([ - models.InternChatSteeredResponse$inboundSchema, - z.custom>(x => x instanceof ReadableStream) - .transform(stream => { - return new EventStream(stream, rawEvent => { - if (rawEvent.data === "[DONE]") { - return { done: true, value: undefined }; - } - return { - done: false, - value: models.InternChatStreamingResponse$inboundSchema.parse( - rawEvent, - )?.data, - }; - }); - }), - ]), -}).transform((v) => { - return remap$(v, { - "Headers": "headers", - "Result": "result", - }); -}); - -export function createInternChatCompletionResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => - CreateInternChatCompletionResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateInternChatCompletionResponse' from JSON`, - ); -} diff --git a/src/models/operations/deleteintern.ts b/src/models/operations/deleteintern.ts deleted file mode 100644 index ff7831b76..000000000 --- a/src/models/operations/deleteintern.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 3d76bcc84f78 - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../../lib/primitives.js"; -import * as models from "../index.js"; - -export type DeleteInternGlobals = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; -}; - -export type DeleteInternRequest = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; - /** - * ID of an intern visible to the authenticated API key. - */ - internId: string; - deleteInternRequest: models.DeleteInternRequest; -}; - -/** @internal */ -export type DeleteInternRequest$Outbound = { - "HTTP-Referer"?: string | undefined; - appTitle?: string | undefined; - appCategories?: string | undefined; - internId: string; - DeleteInternRequest: models.DeleteInternRequest$Outbound; -}; - -/** @internal */ -export const DeleteInternRequest$outboundSchema: z.ZodType< - DeleteInternRequest$Outbound, - DeleteInternRequest -> = z.object({ - httpReferer: z.string().optional(), - 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", - }); -}); - -export function deleteInternRequestToJSON( - deleteInternRequest: DeleteInternRequest, -): string { - return JSON.stringify( - DeleteInternRequest$outboundSchema.parse(deleteInternRequest), - ); -} diff --git a/src/models/operations/getintern.ts b/src/models/operations/getintern.ts deleted file mode 100644 index f468ba550..000000000 --- a/src/models/operations/getintern.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: f7646f94d5c3 - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../../lib/primitives.js"; - -export type GetInternGlobals = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; -}; - -export type GetInternRequest = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; - /** - * ID of an intern visible to the authenticated API key. - */ - internId: string; -}; - -/** @internal */ -export type GetInternRequest$Outbound = { - "HTTP-Referer"?: string | undefined; - appTitle?: string | undefined; - appCategories?: string | undefined; - internId: string; -}; - -/** @internal */ -export const GetInternRequest$outboundSchema: z.ZodType< - GetInternRequest$Outbound, - GetInternRequest -> = z.object({ - httpReferer: z.string().optional(), - appTitle: z.string().optional(), - appCategories: z.string().optional(), - internId: z.string(), -}).transform((v) => { - return remap$(v, { - httpReferer: "HTTP-Referer", - }); -}); - -export function getInternRequestToJSON( - getInternRequest: GetInternRequest, -): string { - return JSON.stringify( - GetInternRequest$outboundSchema.parse(getInternRequest), - ); -} diff --git a/src/models/operations/getinternconnections.ts b/src/models/operations/getinternconnections.ts deleted file mode 100644 index 593fd0fea..000000000 --- a/src/models/operations/getinternconnections.ts +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: e3ab1398423c - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../../lib/primitives.js"; - -export type GetInternConnectionsGlobals = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; -}; - -export type GetInternConnectionsRequest = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; - /** - * ID of an intern visible to the authenticated API key. - */ - internId: string; -}; - -/** @internal */ -export type GetInternConnectionsRequest$Outbound = { - "HTTP-Referer"?: string | undefined; - appTitle?: string | undefined; - appCategories?: string | undefined; - internId: string; -}; - -/** @internal */ -export const GetInternConnectionsRequest$outboundSchema: z.ZodType< - GetInternConnectionsRequest$Outbound, - GetInternConnectionsRequest -> = z.object({ - httpReferer: z.string().optional(), - appTitle: z.string().optional(), - appCategories: z.string().optional(), - internId: z.string(), -}).transform((v) => { - return remap$(v, { - httpReferer: "HTTP-Referer", - }); -}); - -export function getInternConnectionsRequestToJSON( - getInternConnectionsRequest: GetInternConnectionsRequest, -): string { - return JSON.stringify( - GetInternConnectionsRequest$outboundSchema.parse( - getInternConnectionsRequest, - ), - ); -} diff --git a/src/models/operations/getinterndaemon.ts b/src/models/operations/getinterndaemon.ts deleted file mode 100644 index 3d714ef79..000000000 --- a/src/models/operations/getinterndaemon.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 2f48932593a9 - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../../lib/primitives.js"; - -export type GetInternDaemonGlobals = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; -}; - -export type GetInternDaemonRequest = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; - /** - * ID of an intern visible to the authenticated API key. - */ - internId: string; -}; - -/** @internal */ -export type GetInternDaemonRequest$Outbound = { - "HTTP-Referer"?: string | undefined; - appTitle?: string | undefined; - appCategories?: string | undefined; - internId: string; -}; - -/** @internal */ -export const GetInternDaemonRequest$outboundSchema: z.ZodType< - GetInternDaemonRequest$Outbound, - GetInternDaemonRequest -> = z.object({ - httpReferer: z.string().optional(), - appTitle: z.string().optional(), - appCategories: z.string().optional(), - internId: z.string(), -}).transform((v) => { - return remap$(v, { - httpReferer: "HTTP-Referer", - }); -}); - -export function getInternDaemonRequestToJSON( - getInternDaemonRequest: GetInternDaemonRequest, -): string { - return JSON.stringify( - GetInternDaemonRequest$outboundSchema.parse(getInternDaemonRequest), - ); -} diff --git a/src/models/operations/getinterndaemonaccess.ts b/src/models/operations/getinterndaemonaccess.ts deleted file mode 100644 index 3a95dde7c..000000000 --- a/src/models/operations/getinterndaemonaccess.ts +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 2320374f9c4b - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../../lib/primitives.js"; - -export type GetInternDaemonAccessGlobals = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; -}; - -export type GetInternDaemonAccessRequest = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; - /** - * ID of an intern visible to the authenticated API key. - */ - internId: string; -}; - -/** @internal */ -export type GetInternDaemonAccessRequest$Outbound = { - "HTTP-Referer"?: string | undefined; - appTitle?: string | undefined; - appCategories?: string | undefined; - internId: string; -}; - -/** @internal */ -export const GetInternDaemonAccessRequest$outboundSchema: z.ZodType< - GetInternDaemonAccessRequest$Outbound, - GetInternDaemonAccessRequest -> = z.object({ - httpReferer: z.string().optional(), - appTitle: z.string().optional(), - appCategories: z.string().optional(), - internId: z.string(), -}).transform((v) => { - return remap$(v, { - httpReferer: "HTTP-Referer", - }); -}); - -export function getInternDaemonAccessRequestToJSON( - getInternDaemonAccessRequest: GetInternDaemonAccessRequest, -): string { - return JSON.stringify( - GetInternDaemonAccessRequest$outboundSchema.parse( - getInternDaemonAccessRequest, - ), - ); -} diff --git a/src/models/operations/getinternicon.ts b/src/models/operations/getinternicon.ts deleted file mode 100644 index ea6d9d103..000000000 --- a/src/models/operations/getinternicon.ts +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: a41b9b092844 - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../../lib/primitives.js"; - -export type GetInternIconGlobals = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; -}; - -export type GetInternIconRequest = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; - /** - * ID of an intern visible to the authenticated API key. - */ - internId: string; - /** - * The `icon_sha256` the caller expects. - */ - v?: string | undefined; -}; - -/** @internal */ -export type GetInternIconRequest$Outbound = { - "HTTP-Referer"?: string | undefined; - appTitle?: string | undefined; - appCategories?: string | undefined; - internId: string; - v?: string | undefined; -}; - -/** @internal */ -export const GetInternIconRequest$outboundSchema: z.ZodType< - GetInternIconRequest$Outbound, - GetInternIconRequest -> = z.object({ - httpReferer: z.string().optional(), - appTitle: z.string().optional(), - appCategories: z.string().optional(), - internId: z.string(), - v: z.string().optional(), -}).transform((v) => { - return remap$(v, { - httpReferer: "HTTP-Referer", - }); -}); - -export function getInternIconRequestToJSON( - getInternIconRequest: GetInternIconRequest, -): string { - return JSON.stringify( - GetInternIconRequest$outboundSchema.parse(getInternIconRequest), - ); -} diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index 44039e954..d52057092 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -22,8 +22,6 @@ export * from "./createembeddings.js"; export * from "./createexternaluser.js"; export * from "./createguardrail.js"; export * from "./createimages.js"; -export * from "./createintern.js"; -export * from "./createinternchatcompletion.js"; export * from "./createkeys.js"; export * from "./createoauthtoken.js"; export * from "./createobservabilitydestination.js"; @@ -43,7 +41,6 @@ export * from "./deletebyokkey.js"; export * from "./deleteexternaluser.js"; export * from "./deletefile.js"; export * from "./deleteguardrail.js"; -export * from "./deleteintern.js"; export * from "./deleteinternvaultsecret.js"; export * from "./deletekeys.js"; export * from "./deleteobservabilitydestination.js"; @@ -69,11 +66,6 @@ export * from "./getexternaluser.js"; export * from "./getfilemetadata.js"; export * from "./getgeneration.js"; export * from "./getguardrail.js"; -export * from "./getintern.js"; -export * from "./getinternconnections.js"; -export * from "./getinterndaemon.js"; -export * from "./getinterndaemonaccess.js"; -export * from "./getinternicon.js"; export * from "./getkey.js"; export * from "./getmodel.js"; export * from "./getmodels.js"; @@ -92,7 +84,6 @@ export * from "./getuseractivity.js"; export * from "./getvideos.js"; export * from "./getworkspace.js"; export * from "./getworkspacebudget.js"; -export * from "./invokeintern.js"; export * from "./list.js"; export * from "./listbatches.js"; export * from "./listbyokkeys.js"; @@ -110,7 +101,6 @@ export * from "./listimagemodelendpoints.js"; export * from "./listimagemodels.js"; export * from "./listinternconnections.js"; export * from "./listinterneffectivevaultsecrets.js"; -export * from "./listinterns.js"; export * from "./listinternvaultsecrets.js"; export * from "./listkeyassignments.js"; export * from "./listmemberassignments.js"; @@ -133,19 +123,14 @@ export * from "./listworkspacebudgets.js"; export * from "./listworkspacemembers.js"; export * from "./listworkspaces.js"; export * from "./promotecontainerfile.js"; -export * from "./provisionintern.js"; export * from "./queryanalytics.js"; export * from "./sendchatcompletionrequest.js"; -export * from "./signinterndaemonaccessrequest.js"; -export * from "./signinterndaemonrequest.js"; export * from "./storeinternvaultsecret.js"; export * from "./storevaultsecret.js"; export * from "./submitgenerationfeedback.js"; -export * from "./suspendintern.js"; export * from "./updatebyokkey.js"; export * from "./updateexternaluser.js"; export * from "./updateguardrail.js"; -export * from "./updateintern.js"; export * from "./updatekeys.js"; export * from "./updateobservabilitydestination.js"; export * from "./updateorganizationsettings.js"; diff --git a/src/models/operations/invokeintern.ts b/src/models/operations/invokeintern.ts deleted file mode 100644 index d2d1c887f..000000000 --- a/src/models/operations/invokeintern.ts +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: f2b19fbd8a96 - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import * as models from "../index.js"; - -export type InvokeInternGlobals = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; -}; - -export type InvokeInternRequest = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; - /** - * The intern to run. - */ - internId: string; - internInvokeRequest: models.InternInvokeRequest; -}; - -export type InvokeInternResponse = { - headers: { [k: string]: Array }; - result: models.InternInvokeAcceptedResponse; -}; - -/** @internal */ -export type InvokeInternRequest$Outbound = { - "HTTP-Referer"?: string | undefined; - appTitle?: string | undefined; - appCategories?: string | undefined; - internId: string; - InternInvokeRequest: models.InternInvokeRequest$Outbound; -}; - -/** @internal */ -export const InvokeInternRequest$outboundSchema: z.ZodType< - InvokeInternRequest$Outbound, - InvokeInternRequest -> = z.object({ - httpReferer: z.string().optional(), - appTitle: z.string().optional(), - appCategories: z.string().optional(), - internId: z.string(), - internInvokeRequest: models.InternInvokeRequest$outboundSchema, -}).transform((v) => { - return remap$(v, { - httpReferer: "HTTP-Referer", - internInvokeRequest: "InternInvokeRequest", - }); -}); - -export function invokeInternRequestToJSON( - invokeInternRequest: InvokeInternRequest, -): string { - return JSON.stringify( - InvokeInternRequest$outboundSchema.parse(invokeInternRequest), - ); -} - -/** @internal */ -export const InvokeInternResponse$inboundSchema: z.ZodType< - InvokeInternResponse, - unknown -> = z.object({ - Headers: z.record(z.string(), z.array(z.string())).default({}), - Result: models.InternInvokeAcceptedResponse$inboundSchema, -}).transform((v) => { - return remap$(v, { - "Headers": "headers", - "Result": "result", - }); -}); - -export function invokeInternResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => InvokeInternResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'InvokeInternResponse' from JSON`, - ); -} diff --git a/src/models/operations/listinterns.ts b/src/models/operations/listinterns.ts deleted file mode 100644 index 688a9eba8..000000000 --- a/src/models/operations/listinterns.ts +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 3fe8f2b8da99 - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../../lib/primitives.js"; -import * as openEnums from "../../types/enums.js"; -import { OpenEnum } from "../../types/enums.js"; - -export type ListInternsGlobals = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; -}; - -export const Status = { - AwaitingSlackInstall: "awaiting_slack_install", - Queued: "queued", - Provisioning: "provisioning", - Running: "running", - Failed: "failed", - Stopped: "stopped", - Destroying: "destroying", - DestroyFailed: "destroy_failed", -} as const; -export type Status = OpenEnum; - -export type ListInternsRequest = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; - /** - * Maximum number of interns to return, from 1 through 500. - */ - limit?: number | undefined; - /** - * Comma-separated lifecycle statuses to include, at most 8. Repeats are collapsed. - */ - status?: Array | undefined; - /** - * The opaque `next_cursor` of the previous page. Returns the interns that come after it in the newest-first order. A malformed cursor is a 400. - */ - startingAfter?: string | undefined; - /** - * Only return interns in this workspace. It must match the API key workspace. - */ - workspaceId?: string | undefined; -}; - -/** @internal */ -export const Status$outboundSchema: z.ZodType = openEnums - .outboundSchema(Status); - -/** @internal */ -export type ListInternsRequest$Outbound = { - "HTTP-Referer"?: string | undefined; - appTitle?: string | undefined; - appCategories?: string | undefined; - limit?: number | undefined; - status?: Array | undefined; - starting_after?: string | undefined; - workspace_id?: string | undefined; -}; - -/** @internal */ -export const ListInternsRequest$outboundSchema: z.ZodType< - ListInternsRequest$Outbound, - ListInternsRequest -> = z.object({ - httpReferer: z.string().optional(), - appTitle: z.string().optional(), - appCategories: z.string().optional(), - limit: z.int().optional(), - status: z.array(Status$outboundSchema).optional(), - startingAfter: z.string().optional(), - workspaceId: z.string().optional(), -}).transform((v) => { - return remap$(v, { - httpReferer: "HTTP-Referer", - startingAfter: "starting_after", - workspaceId: "workspace_id", - }); -}); - -export function listInternsRequestToJSON( - listInternsRequest: ListInternsRequest, -): string { - return JSON.stringify( - ListInternsRequest$outboundSchema.parse(listInternsRequest), - ); -} diff --git a/src/models/operations/provisionintern.ts b/src/models/operations/provisionintern.ts deleted file mode 100644 index a8ec859ed..000000000 --- a/src/models/operations/provisionintern.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 10202b36a7cd - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../../lib/primitives.js"; - -export type ProvisionInternGlobals = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; -}; - -export type ProvisionInternRequest = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; - /** - * ID of an intern visible to the authenticated API key. - */ - internId: string; -}; - -/** @internal */ -export type ProvisionInternRequest$Outbound = { - "HTTP-Referer"?: string | undefined; - appTitle?: string | undefined; - appCategories?: string | undefined; - internId: string; -}; - -/** @internal */ -export const ProvisionInternRequest$outboundSchema: z.ZodType< - ProvisionInternRequest$Outbound, - ProvisionInternRequest -> = z.object({ - httpReferer: z.string().optional(), - appTitle: z.string().optional(), - appCategories: z.string().optional(), - internId: z.string(), -}).transform((v) => { - return remap$(v, { - httpReferer: "HTTP-Referer", - }); -}); - -export function provisionInternRequestToJSON( - provisionInternRequest: ProvisionInternRequest, -): string { - return JSON.stringify( - ProvisionInternRequest$outboundSchema.parse(provisionInternRequest), - ); -} diff --git a/src/models/operations/signinterndaemonaccessrequest.ts b/src/models/operations/signinterndaemonaccessrequest.ts deleted file mode 100644 index 6c6953546..000000000 --- a/src/models/operations/signinterndaemonaccessrequest.ts +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 5b44549b1bcd - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import * as models from "../index.js"; - -export type SignInternDaemonAccessRequestGlobals = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; -}; - -export type SignInternDaemonAccessRequestRequest = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; - /** - * ID of an intern visible to the authenticated API key. - */ - internId: string; - signInternDaemonRequest: models.SignInternDaemonRequest; -}; - -export type SignInternDaemonAccessRequestResponse = { - headers: { [k: string]: Array }; - result: models.SignInternDaemonResponse; -}; - -/** @internal */ -export type SignInternDaemonAccessRequestRequest$Outbound = { - "HTTP-Referer"?: string | undefined; - appTitle?: string | undefined; - appCategories?: string | undefined; - internId: string; - SignInternDaemonRequest: models.SignInternDaemonRequest$Outbound; -}; - -/** @internal */ -export const SignInternDaemonAccessRequestRequest$outboundSchema: z.ZodType< - SignInternDaemonAccessRequestRequest$Outbound, - SignInternDaemonAccessRequestRequest -> = z.object({ - httpReferer: z.string().optional(), - appTitle: z.string().optional(), - appCategories: z.string().optional(), - internId: z.string(), - signInternDaemonRequest: models.SignInternDaemonRequest$outboundSchema, -}).transform((v) => { - return remap$(v, { - httpReferer: "HTTP-Referer", - signInternDaemonRequest: "SignInternDaemonRequest", - }); -}); - -export function signInternDaemonAccessRequestRequestToJSON( - signInternDaemonAccessRequestRequest: SignInternDaemonAccessRequestRequest, -): string { - return JSON.stringify( - SignInternDaemonAccessRequestRequest$outboundSchema.parse( - signInternDaemonAccessRequestRequest, - ), - ); -} - -/** @internal */ -export const SignInternDaemonAccessRequestResponse$inboundSchema: z.ZodType< - SignInternDaemonAccessRequestResponse, - unknown -> = z.object({ - Headers: z.record(z.string(), z.array(z.string())).default({}), - Result: models.SignInternDaemonResponse$inboundSchema, -}).transform((v) => { - return remap$(v, { - "Headers": "headers", - "Result": "result", - }); -}); - -export function signInternDaemonAccessRequestResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => - SignInternDaemonAccessRequestResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'SignInternDaemonAccessRequestResponse' from JSON`, - ); -} diff --git a/src/models/operations/signinterndaemonrequest.ts b/src/models/operations/signinterndaemonrequest.ts deleted file mode 100644 index 6dda7b3a7..000000000 --- a/src/models/operations/signinterndaemonrequest.ts +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: fa6bfb2ce12b - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import * as models from "../index.js"; - -export type SignInternDaemonRequestGlobals = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; -}; - -export type SignInternDaemonRequestRequest = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; - /** - * ID of an intern visible to the authenticated API key. - */ - internId: string; - signInternDaemonRequest: models.SignInternDaemonRequest; -}; - -export type SignInternDaemonRequestResponse = { - headers: { [k: string]: Array }; - result: models.SignInternDaemonResponse; -}; - -/** @internal */ -export type SignInternDaemonRequestRequest$Outbound = { - "HTTP-Referer"?: string | undefined; - appTitle?: string | undefined; - appCategories?: string | undefined; - internId: string; - SignInternDaemonRequest: models.SignInternDaemonRequest$Outbound; -}; - -/** @internal */ -export const SignInternDaemonRequestRequest$outboundSchema: z.ZodType< - SignInternDaemonRequestRequest$Outbound, - SignInternDaemonRequestRequest -> = z.object({ - httpReferer: z.string().optional(), - appTitle: z.string().optional(), - appCategories: z.string().optional(), - internId: z.string(), - signInternDaemonRequest: models.SignInternDaemonRequest$outboundSchema, -}).transform((v) => { - return remap$(v, { - httpReferer: "HTTP-Referer", - signInternDaemonRequest: "SignInternDaemonRequest", - }); -}); - -export function signInternDaemonRequestRequestToJSON( - signInternDaemonRequestRequest: SignInternDaemonRequestRequest, -): string { - return JSON.stringify( - SignInternDaemonRequestRequest$outboundSchema.parse( - signInternDaemonRequestRequest, - ), - ); -} - -/** @internal */ -export const SignInternDaemonRequestResponse$inboundSchema: z.ZodType< - SignInternDaemonRequestResponse, - unknown -> = z.object({ - Headers: z.record(z.string(), z.array(z.string())).default({}), - Result: models.SignInternDaemonResponse$inboundSchema, -}).transform((v) => { - return remap$(v, { - "Headers": "headers", - "Result": "result", - }); -}); - -export function signInternDaemonRequestResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => SignInternDaemonRequestResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'SignInternDaemonRequestResponse' from JSON`, - ); -} diff --git a/src/models/operations/suspendintern.ts b/src/models/operations/suspendintern.ts deleted file mode 100644 index 61ec3f407..000000000 --- a/src/models/operations/suspendintern.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 189ee7e2d8bb - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../../lib/primitives.js"; - -export type SuspendInternGlobals = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; -}; - -export type SuspendInternRequest = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; - /** - * ID of an intern visible to the authenticated API key. - */ - internId: string; -}; - -/** @internal */ -export type SuspendInternRequest$Outbound = { - "HTTP-Referer"?: string | undefined; - appTitle?: string | undefined; - appCategories?: string | undefined; - internId: string; -}; - -/** @internal */ -export const SuspendInternRequest$outboundSchema: z.ZodType< - SuspendInternRequest$Outbound, - SuspendInternRequest -> = z.object({ - httpReferer: z.string().optional(), - appTitle: z.string().optional(), - appCategories: z.string().optional(), - internId: z.string(), -}).transform((v) => { - return remap$(v, { - httpReferer: "HTTP-Referer", - }); -}); - -export function suspendInternRequestToJSON( - suspendInternRequest: SuspendInternRequest, -): string { - return JSON.stringify( - SuspendInternRequest$outboundSchema.parse(suspendInternRequest), - ); -} diff --git a/src/models/operations/updateintern.ts b/src/models/operations/updateintern.ts deleted file mode 100644 index b12bfa75b..000000000 --- a/src/models/operations/updateintern.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: fb05d7710bfa - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../../lib/primitives.js"; -import * as models from "../index.js"; - -export type UpdateInternGlobals = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; -}; - -export type UpdateInternRequest = { - /** - * The app identifier should be your app's URL and is used as the primary identifier for rankings. - * - * @remarks - * This is used to track API usage per application. - */ - httpReferer?: string | undefined; - /** - * The app display name allows you to customize how your app appears in OpenRouter's dashboard. - * - * @remarks - */ - appTitle?: string | undefined; - /** - * Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings. - * - * @remarks - */ - appCategories?: string | undefined; - /** - * ID of an intern visible to the authenticated API key. - */ - internId: string; - updateInternRequest: models.UpdateInternRequest; -}; - -/** @internal */ -export type UpdateInternRequest$Outbound = { - "HTTP-Referer"?: string | undefined; - appTitle?: string | undefined; - appCategories?: string | undefined; - internId: string; - UpdateInternRequest: models.UpdateInternRequest$Outbound; -}; - -/** @internal */ -export const UpdateInternRequest$outboundSchema: z.ZodType< - UpdateInternRequest$Outbound, - UpdateInternRequest -> = z.object({ - httpReferer: z.string().optional(), - appTitle: z.string().optional(), - appCategories: z.string().optional(), - internId: z.string(), - updateInternRequest: models.UpdateInternRequest$outboundSchema, -}).transform((v) => { - return remap$(v, { - httpReferer: "HTTP-Referer", - updateInternRequest: "UpdateInternRequest", - }); -}); - -export function updateInternRequestToJSON( - updateInternRequest: UpdateInternRequest, -): string { - return JSON.stringify( - UpdateInternRequest$outboundSchema.parse(updateInternRequest), - ); -} diff --git a/src/models/provisioninternresponse.ts b/src/models/provisioninternresponse.ts deleted file mode 100644 index 5960d3c3b..000000000 --- a/src/models/provisioninternresponse.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 43ed2389f509 - */ - -import * as z from "zod/v4"; -import { safeParse } from "../lib/schemas.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; - -export type ProvisionInternResponse = { - provisioning: true; -}; - -/** @internal */ -export const ProvisionInternResponse$inboundSchema: z.ZodType< - ProvisionInternResponse, - unknown -> = z.object({ - provisioning: z.literal(true), -}); - -export function provisionInternResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ProvisionInternResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ProvisionInternResponse' from JSON`, - ); -} diff --git a/src/models/signinterndaemonrequest.ts b/src/models/signinterndaemonrequest.ts deleted file mode 100644 index 4c9626237..000000000 --- a/src/models/signinterndaemonrequest.ts +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 2a823896a299 - */ - -import * as z from "zod/v4"; -import { ClosedEnum } from "../types/enums.js"; - -/** - * The HTTP method of the daemon request. - */ -export const SignInternDaemonRequestMethod = { - Post: "POST", -} as const; -/** - * The HTTP method of the daemon request. - */ -export type SignInternDaemonRequestMethod = ClosedEnum< - typeof SignInternDaemonRequestMethod ->; - -/** - * The daemon request the proof is for. When present the response also carries the single-use, route-bound proof (`x-ori-invoke-signature-v2`, `x-ori-invoke-nonce`). - */ -export type Route = { - /** - * The HTTP method of the daemon request. - */ - method: SignInternDaemonRequestMethod; - /** - * The daemon request path, percent-encoded as sent, without origin or query. The route-bound proof admits only this path. - */ - path: string; -}; - -export type SignInternDaemonRequest = { - /** - * Lower-case hex SHA-256 of the exact bytes the CLI will send as the daemon request body. - */ - bodySha256: string; - /** - * The daemon request the proof is for. When present the response also carries the single-use, route-bound proof (`x-ori-invoke-signature-v2`, `x-ori-invoke-nonce`). - */ - route?: Route | undefined; -}; - -/** @internal */ -export const SignInternDaemonRequestMethod$outboundSchema: z.ZodEnum< - typeof SignInternDaemonRequestMethod -> = z.enum(SignInternDaemonRequestMethod); - -/** @internal */ -export type Route$Outbound = { - method: string; - path: string; -}; - -/** @internal */ -export const Route$outboundSchema: z.ZodType = z.object({ - method: SignInternDaemonRequestMethod$outboundSchema, - path: z.string(), -}); - -export function routeToJSON(route: Route): string { - return JSON.stringify(Route$outboundSchema.parse(route)); -} - -/** @internal */ -export type SignInternDaemonRequest$Outbound = { - bodySha256: string; - route?: Route$Outbound | undefined; -}; - -/** @internal */ -export const SignInternDaemonRequest$outboundSchema: z.ZodType< - SignInternDaemonRequest$Outbound, - SignInternDaemonRequest -> = z.object({ - bodySha256: z.string(), - route: z.lazy(() => Route$outboundSchema).optional(), -}); - -export function signInternDaemonRequestToJSON( - signInternDaemonRequest: SignInternDaemonRequest, -): string { - return JSON.stringify( - SignInternDaemonRequest$outboundSchema.parse(signInternDaemonRequest), - ); -} diff --git a/src/models/signinterndaemonresponse.ts b/src/models/signinterndaemonresponse.ts deleted file mode 100644 index a1c310bee..000000000 --- a/src/models/signinterndaemonresponse.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 255ec3cd7651 - */ - -import * as z from "zod/v4"; -import { remap as remap$ } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; - -/** - * Headers the CLI copies onto the daemon request so the sidecar can verify who is asking. - */ -export type SignInternDaemonResponse = { - /** - * Present with `x-ori-invoke-signature-v2`: the single-use id that proof is bound to. - */ - xOriInvokeNonce?: string | undefined; - /** - * Base64 Ed25519 signature over the intern id, timestamp, user and body digest. - */ - xOriInvokeSignature: string; - /** - * Present when the request named a `route`: Base64 Ed25519 signature over the intern id, timestamp, nonce, user, method, path and body digest. The intern accepts it once. - */ - xOriInvokeSignatureV2?: string | undefined; - /** - * Unix seconds at signing; the daemon refuses proofs older than its window. - */ - xOriInvokeTimestamp: string; - /** - * The verified OAuth subject the proof names. Never taken from the request. - */ - xOriInvokeUser: string; -}; - -/** @internal */ -export const SignInternDaemonResponse$inboundSchema: z.ZodType< - SignInternDaemonResponse, - unknown -> = z.object({ - "x-ori-invoke-nonce": z.string().optional(), - "x-ori-invoke-signature": z.string(), - "x-ori-invoke-signature-v2": z.string().optional(), - "x-ori-invoke-timestamp": z.string(), - "x-ori-invoke-user": z.string(), -}).transform((v) => { - return remap$(v, { - "x-ori-invoke-nonce": "xOriInvokeNonce", - "x-ori-invoke-signature": "xOriInvokeSignature", - "x-ori-invoke-signature-v2": "xOriInvokeSignatureV2", - "x-ori-invoke-timestamp": "xOriInvokeTimestamp", - "x-ori-invoke-user": "xOriInvokeUser", - }); -}); - -export function signInternDaemonResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => SignInternDaemonResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'SignInternDaemonResponse' from JSON`, - ); -} diff --git a/src/models/suspendinternresponse.ts b/src/models/suspendinternresponse.ts deleted file mode 100644 index 59c0163a1..000000000 --- a/src/models/suspendinternresponse.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 1a88b3e1ceb1 - */ - -import * as z from "zod/v4"; -import { safeParse } from "../lib/schemas.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; - -export type SuspendInternResponse = { - suspended: true; -}; - -/** @internal */ -export const SuspendInternResponse$inboundSchema: z.ZodType< - SuspendInternResponse, - unknown -> = z.object({ - suspended: z.literal(true), -}); - -export function suspendInternResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => SuspendInternResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'SuspendInternResponse' from JSON`, - ); -} diff --git a/src/models/updateinternrequest.ts b/src/models/updateinternrequest.ts deleted file mode 100644 index 27e0a9c07..000000000 --- a/src/models/updateinternrequest.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 8e76ee00847f - */ - -import * as z from "zod/v4"; - -/** - * Lifecycle settings to change. Omitted fields stay unchanged and null clears a field. - */ -export type UpdateInternRequest = { - /** - * New free-form description. Null clears it. - */ - description?: string | null | undefined; - /** - * New standing instructions. Null clears them. - */ - instructions?: string | null | undefined; - /** - * 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; - /** - * New intern name, unique per creator within the workspace. - */ - name?: string | undefined; -}; - -/** @internal */ -export type UpdateInternRequest$Outbound = { - description?: string | null | undefined; - instructions?: string | null | undefined; - model?: string | null | undefined; - name?: string | undefined; -}; - -/** @internal */ -export const UpdateInternRequest$outboundSchema: z.ZodType< - UpdateInternRequest$Outbound, - UpdateInternRequest -> = z.object({ - description: z.nullable(z.string()).optional(), - instructions: z.nullable(z.string()).optional(), - model: z.nullable(z.string()).optional(), - name: z.string().optional(), -}); - -export function updateInternRequestToJSON( - updateInternRequest: UpdateInternRequest, -): string { - return JSON.stringify( - UpdateInternRequest$outboundSchema.parse(updateInternRequest), - ); -} diff --git a/src/sdk/interns.ts b/src/sdk/interns.ts deleted file mode 100644 index 623e58df4..000000000 --- a/src/sdk/interns.ts +++ /dev/null @@ -1,319 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: fc3b4e6c5008 - */ - -import { internsChat } from "../funcs/internsChat.js"; -import { internsCreateIntern } from "../funcs/internsCreateIntern.js"; -import { internsDeleteIntern } from "../funcs/internsDeleteIntern.js"; -import { internsGetIntern } from "../funcs/internsGetIntern.js"; -import { internsGetInternConnections } from "../funcs/internsGetInternConnections.js"; -import { internsGetInternDaemon } from "../funcs/internsGetInternDaemon.js"; -import { internsGetInternDaemonAccess } from "../funcs/internsGetInternDaemonAccess.js"; -import { internsGetInternIcon } from "../funcs/internsGetInternIcon.js"; -import { internsInvoke } from "../funcs/internsInvoke.js"; -import { internsListInterns } from "../funcs/internsListInterns.js"; -import { internsProvisionIntern } from "../funcs/internsProvisionIntern.js"; -import { internsSignInternDaemonAccessRequest } from "../funcs/internsSignInternDaemonAccessRequest.js"; -import { internsSignInternDaemonRequest } from "../funcs/internsSignInternDaemonRequest.js"; -import { internsSuspendIntern } from "../funcs/internsSuspendIntern.js"; -import { internsUpdateIntern } from "../funcs/internsUpdateIntern.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as models from "../models/index.js"; -import * as operations from "../models/operations/index.js"; -import { unwrapAsync } from "../types/fp.js"; - -export class Interns extends ClientSDK { - /** - * List interns - * - * @remarks - * Lists interns visible to the authenticated key, newest first. Filter by workspace and one or more lifecycle statuses. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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 listInterns( - request?: operations.ListInternsRequest | undefined, - options?: RequestOptions, - ): Promise { - return unwrapAsync(internsListInterns( - this, - request, - options, - )); - } - - /** - * Create an intern - * - * @remarks - * Creates an intern in an explicit workspace. The operation also creates its private vault. It can start provisioning immediately or wait for a later provision call. A retry with the same idempotency key and body resumes unfinished work. The request body is capped at 1048576 bytes and a larger body is refused with 413. A non-empty body must declare `Content-Type: application/json` or it is refused with 415. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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 createIntern( - request: operations.CreateInternRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(internsCreateIntern( - this, - request, - options, - )); - } - - /** - * Delete an intern - * - * @remarks - * 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. A non-empty body must declare `Content-Type: application/json` or it is refused with 415. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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, - options?: RequestOptions, - ): Promise { - return unwrapAsync(internsDeleteIntern( - this, - request, - options, - )); - } - - /** - * Get an intern - * - * @remarks - * Returns the public lifecycle state and settings for one visible intern. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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 getIntern( - request: operations.GetInternRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(internsGetIntern( - this, - request, - options, - )); - } - - /** - * Update an intern - * - * @remarks - * Changes the intern name, description, instructions or model. Omitted fields stay unchanged. The request body is capped at 1048576 bytes and a larger body is refused with 413. A non-empty body must declare `Content-Type: application/json` or it is refused with 415. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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 updateIntern( - request: operations.UpdateInternRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(internsUpdateIntern( - this, - request, - options, - )); - } - - /** - * List an intern's connections - * - * @remarks - * Returns the Slack, GitHub, Google Workspace and MCP connections one visible intern can reach, and the shared ones switched off for it or disabled for the workspace. An OAuth grant needs `vault:read`, because the list names members' personal accounts; without it the route answers 403 `insufficient_scope`. The response is sent with `Cache-Control: no-store`. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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 getInternConnections( - request: operations.GetInternConnectionsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(internsGetInternConnections( - this, - request, - options, - )); - } - - /** - * Get an intern's daemon access - * - * @remarks - * Returns the origin and daemon token that attach `ori tui --host` to one visible, running intern. The token is a credential: only an OAuth-token caller (`ori login --oidc`) may read it, the response is sent with `Cache-Control: no-store`, and each reveal is logged by caller and intern. API keys get 403 `personal_identity_required`. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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 getInternDaemon( - request: operations.GetInternDaemonRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(internsGetInternDaemon( - this, - request, - options, - )); - } - - /** - * Get an intern's daemon access (deprecated alias) - * - * @remarks - * Deprecated alias of `GET /interns/{internId}/daemon` with the same request, response, and errors. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required. - * - * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. - */ - async getInternDaemonAccess( - request: operations.GetInternDaemonAccessRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(internsGetInternDaemonAccess( - this, - request, - options, - )); - } - - /** - * Sign a daemon request with the caller's identity (deprecated alias) - * - * @remarks - * Deprecated alias of `POST /interns/{internId}/daemon/sign` with the same request, response, and errors. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required. - * - * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. - */ - async signInternDaemonAccessRequest( - request: operations.SignInternDaemonAccessRequestRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(internsSignInternDaemonAccessRequest( - this, - request, - options, - )); - } - - /** - * Sign a daemon request with the caller's identity - * - * @remarks - * Signs the SHA-256 digest of one request the CLI is about to send to the intern daemon, binding it to the intern and to the signed-in member so personal connections resolve. Only an OAuth session from `ori login --oidc` whose grant carries `vault:read` can sign: an API key is refused with 403 because it names no person, and an `interns`-only grant is refused with 403 because a proof releases that user's personal connections. The route is behind the same gate as chat and counts against the chat turn limiter. The response is sent with `Cache-Control: no-store`. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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 signInternDaemonRequest( - request: operations.SignInternDaemonRequestRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(internsSignInternDaemonRequest( - this, - request, - options, - )); - } - - /** - * Get an intern's icon - * - * @remarks - * Returns the icon image of one visible intern. Pass the intern's `icon_sha256` as `v` to receive a response that can be cached indefinitely. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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 getInternIcon( - request: operations.GetInternIconRequest, - options?: RequestOptions, - ): Promise> { - return unwrapAsync(internsGetInternIcon( - this, - request, - options, - )); - } - - /** - * Provision an intern - * - * @remarks - * Starts the first boot, or resumes an intern after suspension. This operation takes no request body. A body carrying any field is refused with 400 rather than ignored. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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 provisionIntern( - request: operations.ProvisionInternRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(internsProvisionIntern( - this, - request, - options, - )); - } - - /** - * Suspend an intern - * - * @remarks - * Stops the intern runtime while keeping its disk and configuration for a later provision call. This operation takes no request body. A body carrying any field is refused with 400 rather than ignored. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. 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 suspendIntern( - request: operations.SuspendInternRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(internsSuspendIntern( - this, - request, - options, - )); - } - - /** - * Stream a chat completion with an intern - * - * @remarks - * Sends a prompt to one of your interns and streams the reply as OpenAI-compatible server-sent events ending with `[DONE]`. The run executes on the intern, which may pause to ask you something. It then streams one `openrouter.provide_input` tool call and finishes with `finish_reason: "tool_calls"`, and the run stays open on the intern. - * - * Every response, whether it ends with `stop`, `tool_calls` or `error`, is followed by a final chunk with empty `choices` that carries `session_id`, then `data: [DONE]`. That chunk carries the `usage` the intern reported for the run, after `stop` or `error`, and `null` when the intern reported none. After `tool_calls` its `usage` is `null` because the turn is not over. Read through `[DONE]`: the `session_id` you need to reply arrives after the `tool_calls` finish chunk. - * - * To answer, send a second request with the same `session_id`, the assistant message echoing that tool call, and a `tool` message whose `tool_call_id` is the tool call id and whose `content` is the answer. The answer is delivered to the run that asked and the stream continues from where it paused. A question stays open for its interaction deadline (5 minutes by default) and the run is cancelled when that passes. Rejected replies do not extend the deadline. - * - * Closing the connection after the `[DONE]` that follows `finish_reason: "tool_calls"` keeps the run alive. Disconnecting while a response is still streaming cancels the run. The stream writes a `: keepalive` comment whenever nothing else has been written for 30 seconds, so a disconnect is noticed within that interval even while the intern is silent. - * - * A run the intern ends while you are still connected, by cancellation or by a deadline, ends the stream with a `finish_reason: "error"` chunk carrying `410` and reason `run_ended`, then the final empty-`choices` chunk and `[DONE]`. That error reports only an ending the intern confirmed. A connection that breaks without that confirmation ends with reason `stream_severed`, and a client that has already disconnected is promised no final event. - * - * Set `approval_mode` to `manual` to have the intern ask before approval-bearing tools such as the shell. Omitted, the run self-drives and consents on your behalf. The mode belongs to the run started by that prompt and must be repeated on later prompts. - * - * Available to interns programme members. Callers outside the programme receive `404` for every path under `/api/v1/interns`. - */ - async chat( - request: operations.CreateInternChatCompletionRequest & { - internChatCompletionRequest: { stream?: false | undefined }; - }, - options?: RequestOptions, - ): Promise; - async chat( - request: operations.CreateInternChatCompletionRequest & { - internChatCompletionRequest: { stream: true }; - }, - options?: RequestOptions, - ): Promise; - async chat( - request: operations.CreateInternChatCompletionRequest, - options?: RequestOptions, - ): Promise; - async chat( - request: operations.CreateInternChatCompletionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(internsChat( - this, - request, - options, - )); - } - - /** - * Start an intern run without waiting for it - * - * @remarks - * Starts a run on one of your interns and answers `202` with the `session_id` as soon as the intern accepts it. The run keeps going on the intern after the response. Nothing about its progress comes back on this request; the intern reports through its own tools, such as Slack. - * - * Send the same `session_id` later to continue the conversation, for example to hand the intern a decision on work it started. If that session already has a run going, the prompt is delivered into it and the status is `steered`. A `session_id` is accepted only from the caller it was issued to, on the same intern; any other, including sessions started from Slack or the chat endpoint, is refused with `404`. - * - * Runs started here self-drive: the intern consents to its own tool approvals, and a question it asks is answered by its own fallback. A run ends when the intern finishes it or after its execution deadline (1 hour by default). - * - * Available to interns programme members. Callers outside the programme receive `404` for every path under `/api/v1/interns`. - */ - async invoke( - request: operations.InvokeInternRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(internsInvoke( - this, - request, - options, - )); - } -} diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index 5f89b6b08..4d284c4b3 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -24,7 +24,6 @@ import { Files } from "./files.js"; import { Generations } from "./generations.js"; import { Guardrails } from "./guardrails.js"; import { Images } from "./images.js"; -import { Interns } from "./interns.js"; import { Models } from "./models.js"; import { OAuth } from "./oauth.js"; import { Observability } from "./observability.js"; @@ -161,11 +160,6 @@ export class OpenRouter extends ClientSDK { return (this._images ??= new Images(this._options)); } - private _interns?: Interns; - get interns(): Interns { - return (this._interns ??= new Interns(this._options)); - } - private _apiKeys?: APIKeys; get apiKeys(): APIKeys { return (this._apiKeys ??= new APIKeys(this._options)); From e3afc8114b9532855cd258eef3c26cf6643d2bac Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Fri, 23 Oct 2026 18:00:02 +0000 Subject: [PATCH 2/3] empty commit to trigger [run-tests] workflow From a7c8ea9822dd4b7b9dfc730ae77422ddd15c6d6d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 23 Oct 2026 18:00:18 +0000 Subject: [PATCH 3/3] Chore: regenerate docs navigation Auto-generated-by: update-generated-files-action; https://github.com/OpenRouterTeam/typescript-sdk/actions/runs/39999692212 --- docs/docs.json | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/docs.json b/docs/docs.json index ecd19396d..cd387efb7 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -30,7 +30,6 @@ "sdks/generations/README", "sdks/guardrails/README", "sdks/images/README", - "sdks/interns/README", "sdks/models/README", "sdks/oauth/README", "sdks/observability/README",