diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 2f66a008..732ef401 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: c48cf606-fb42-4a45-9c23-8f0555307828 management: - docChecksum: ce3af718d344bede5e7fbac65667a273 + docChecksum: 52b9616e5674dc26531fa882c93d7504 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.3.79 - configChecksum: d99c715292056c8059a4139c19a573ee + releaseVersion: 1.3.80 + configChecksum: 5cb8222a959a0d468ef90ea282acea79 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: f7c67753-a18c-46d6-a112-335ed42a5e2c - pristine_commit_hash: b54f5cca62404501cf53ec1a3c7c5fe779a1d0e7 - pristine_tree_hash: 44866872ac3fe1447c9f7bc2a20bfbe35a2e3e98 + generation_id: a6382c86-1f16-453e-9724-2bf59a1dff6c + pristine_commit_hash: 74b5f63f9082cc1f1a72ba0846beab57ee301c04 + pristine_tree_hash: d92cd4818d8a8d81c11586a4ca3062ba1c493300 features: python: acceptHeaders: 3.0.0 @@ -82,10 +82,6 @@ trackedFiles: id: 35ebea5f13ae last_write_checksum: sha1:a870589d8fa8dda11eaa5007cbc5fdf8214e2ac1 pristine_git_object: 172d96463883f8a74704b07443ee3e84c83ec4e9 - docs/components/account.mdx: - id: b174f975ca46 - last_write_checksum: sha1:118103c6422689907c2a870762ffa960a7b34c4d - pristine_git_object: 1a11efe87ee349da67d2439779f7df13dc377cf8 docs/components/actionenum.mdx: id: 80a6e5c8e11b last_write_checksum: sha1:fd6ff66bb4a43dd71b399b9c5be55f79624b33bf @@ -2166,10 +2162,6 @@ trackedFiles: id: "137661546600" last_write_checksum: sha1:de9c1e926f22ff6b6de4a9b9ee434527419f876b pristine_git_object: f431a6c1f2f77e8d9797a4445df2b1d96cded9c3 - docs/components/code.mdx: - id: 1cc125f1dfa9 - last_write_checksum: sha1:90126ec33b82bbdfbce812b79d6241da3d5f220e - pristine_git_object: f4cb5da6450105978064f99a92065478c247270d docs/components/codeenum.mdx: id: 9b9b999fccff last_write_checksum: sha1:903532ee1d395caf07d574dd22d27dcbe6c76b89 @@ -2578,10 +2570,6 @@ trackedFiles: id: 1477eebdf505 last_write_checksum: sha1:76bb1fcafda689e9823bb21541c84e7d0bdb991d pristine_git_object: 63cc820d2e3f4ddaa6d42dfef4c80006f7810cb2 - docs/components/createinternrequest.mdx: - id: 31228037ef68 - last_write_checksum: sha1:7f6dd17a2cc45ed74745d9147ec34be3530c9459 - pristine_git_object: 28e8aee5c2ddf7faea52b6f4515b4f25bcaa77fe docs/components/createobservabilitydestinationrequest.mdx: id: 8d942a601a6e last_write_checksum: sha1:beae67d4f70858469b70ac0fe26a0a69dc9594a5 @@ -2902,14 +2890,6 @@ trackedFiles: id: 4b5aa42babb9 last_write_checksum: sha1:85c65956be5b333b233ada31f980a73eb580f9b8 pristine_git_object: 36069a9639aef5294e8ef81b5e96d169b01e5b07 - docs/components/deleteinternrequest.mdx: - id: e5c80eeb6e80 - last_write_checksum: sha1:b3c0e009c71afeb39b31ef99b7f674feed4f8fde - pristine_git_object: 3b870d4dd3c1d960f986b62b1afb334828807bf1 - docs/components/deleteinternresponse.mdx: - id: 80308aeb681f - last_write_checksum: sha1:b9f46d98fd3d91f0f1398bfbdd0d1dd2141ce4eb - pristine_git_object: dcf556fcd919cf9853c4a3e74783a20147f15dd9 docs/components/deleteobservabilitydestinationresponse.mdx: id: 0f606ad36822 last_write_checksum: sha1:99269cd4a1958da8aa09cb828709ca8a734541ff @@ -3990,210 +3970,10 @@ trackedFiles: id: 4e1ceba5a654 last_write_checksum: sha1:2efe0463c8d0ed63159bbcc8cb8c21743800b88e pristine_git_object: e3e71d16be9294f68ca671f76dbcc8b6d8ecc749 - docs/components/intern.mdx: - id: 95d0e0ffc539 - last_write_checksum: sha1:c621dd387bb84ba6b886aa0dbb044dd870e6f880 - pristine_git_object: 91493b58c81b606c3043cc44e4e466364cf5209a docs/components/internalserverresponseerrordata.mdx: id: 9a443dea63c5 last_write_checksum: sha1:39c41704820f6cde2d67ec3b9f1bcac7bc1a81d0 pristine_git_object: 8ddf14e86902b5d1b69fd15b7098e489c741b993 - docs/components/internapprovalmode.mdx: - id: 52eda3fd8d4b - last_write_checksum: sha1:d7f1e11967398a04edae6ac80c6a21f13871c5b5 - pristine_git_object: 14f94bb02c48a460c14d50a0595fc0e89b52e6af - docs/components/internchatassistantmessage.mdx: - id: 041634b73e1e - last_write_checksum: sha1:94e8b73e31c14adcdb26c27494e527c308a6a15b - pristine_git_object: 3334fd334d99f2fbb41a8991fbd1065e5aa4234d - docs/components/internchatassistantmessagerole.mdx: - id: 129e5368066f - last_write_checksum: sha1:82c992193fb0cc60c16db0c54e827830edd565dc - pristine_git_object: caef6da66201fc69d119282fa86bd54c5674d57b - docs/components/internchatchoice.mdx: - id: 5ef48232ae77 - last_write_checksum: sha1:eb3636810c988d0a9f731829ca0ed664b3bf8285 - pristine_git_object: 7d0bdde08f818dfa0d53daa326b4605bf963fe2f - docs/components/internchatchoicefinishreason.mdx: - id: 8c0d6f9d5d37 - last_write_checksum: sha1:4e4ad36194a1b650bbc181933e596172b3e496d5 - pristine_git_object: ebcb8202e58b8c700f2a6e9d562ea50c9502833d - docs/components/internchatcompletionchunk.mdx: - id: 4f5dc2924625 - last_write_checksum: sha1:7576fe0d255e706ec04cbfa93ad21536adc5dc4a - pristine_git_object: 9f35a80a9f2e3fc4d2d352e9d27ec973bf476f58 - docs/components/internchatcompletionchunkobject.mdx: - id: 3a1962ac4886 - last_write_checksum: sha1:9602771c3a5fc48b22adf67daeaf1387bbdfb501 - pristine_git_object: ae29bb6aa4cc5e60a75270c19790621c0bce4244 - docs/components/internchatcompletionrequest.mdx: - id: 3ff4f362621e - last_write_checksum: sha1:fc3b602f49cd7922a7b065dfe4d8c943e38bf9ed - pristine_git_object: ea77f21bcfbb6e188b0ab2ea56dd256f6f99d543 - docs/components/internchatdelta.mdx: - id: 362ca71ada74 - last_write_checksum: sha1:d69514763165871299a922f8f0dac1890283f4ab - pristine_git_object: 950f73d45431fadb0467ceceefa0b3d3fe0b680c - docs/components/internchatdeltarole.mdx: - id: 15b022eaf454 - last_write_checksum: sha1:7c09b3f62fc917e5fd67dffae5abc2a37b110ed9 - pristine_git_object: 76b5ccf10b5c6391cca4ff9a61245154dcf553de - docs/components/internchatdevelopermessage.mdx: - id: f36efe2db963 - last_write_checksum: sha1:13ee091947d6804ff46bb9f8c88b3b8125949544 - pristine_git_object: 0fd5f0fbf2b56acac17b22d70b02e18c598e10bf - docs/components/internchatdevelopermessagerole.mdx: - id: 7c0a36643391 - last_write_checksum: sha1:ca797f5e414953653817b16b9150b1092ab5872b - pristine_git_object: c8a28fe93affb7e8afbcadf834e74342861c6f02 - docs/components/internchatechoedtoolcall.mdx: - id: 749fa26fe692 - last_write_checksum: sha1:fbf1763609c837284b65bb8be9354bffeb3eb90a - pristine_git_object: a869fcac252801165106e04ba5d6272a6b5bb16a - docs/components/internchatechoedtoolcallfunction.mdx: - id: e5e6d4096a43 - last_write_checksum: sha1:66c1bad71707501455eab6d14d81415df3637f06 - pristine_git_object: 7b057bd6aebd0261f7f15ac2e6189414001d0d09 - docs/components/internchaterror.mdx: - id: 64defb4bf787 - last_write_checksum: sha1:c75fae440575a3f8a3c3846f291a7ecaa21cb693 - pristine_git_object: 84af96295ce8f7b446014c6648618346a16687ee - docs/components/internchaterrormetadata.mdx: - id: e5a6cafc8cf1 - last_write_checksum: sha1:54ea3296b6988d804548d70c9ce6cb32a617a4a2 - pristine_git_object: 0e5c6b605420f764fdcabafde013eb56c5a5527a - docs/components/internchaterrormetadatareason.mdx: - id: e912c85957cc - last_write_checksum: sha1:f5c63a578391ef058999767b2fe00ac26861c8d8 - pristine_git_object: 7b17f0e23f07068ef2647c6fe2fade30de06add3 - docs/components/internchatmessage.mdx: - id: a04de4c0fe24 - last_write_checksum: sha1:ca74833b04478f52dbd2ff72cae083897f32f7ba - pristine_git_object: 95dcf6235634c9f345d8586e9226c3d8067f9e22 - docs/components/internchatmessagecontent.mdx: - id: 4a630696be4a - last_write_checksum: sha1:f577d36a8689634fa7a2d4dd63bce499a413dcef - pristine_git_object: 8330e45e79206d00503f2a0bc351503acf623bd8 - docs/components/internchatprompttokensdetails.mdx: - id: 6cf9cf093489 - last_write_checksum: sha1:a0555dca77b390a95c2bc79aae41b2ae53eb96f0 - pristine_git_object: 77b2e34176730645168f5953bca6c98134dc37e8 - docs/components/internchatsteeredresponse.mdx: - id: 9e93a736a63b - last_write_checksum: sha1:0c8fec19cce78719791ff8b59c672ff51ca58ef9 - pristine_git_object: 51fdf717853566f95dba70470cbcf414414f1d80 - docs/components/internchatsteeredresponsestatus.mdx: - id: 47fb740d8f87 - last_write_checksum: sha1:9fc59dfe45b19a09b077a2dbd30c88561406b61c - pristine_git_object: 1ac306e63cb6601a5d9b123c09675175232436a9 - docs/components/internchatstreamerror.mdx: - id: d960f7518865 - last_write_checksum: sha1:93c6917119e7a9b36c8736c614a505ea86c8f7de - pristine_git_object: b19200571a678d1d83e140f5bd753930450b4a0c - docs/components/internchatstreamingresponse.mdx: - id: 5bcf4a593132 - last_write_checksum: sha1:8c36128d1cdac2822bbb2c223dabd6b63f508a5c - pristine_git_object: 04ad18b619361faed61723ead4007171644a9610 - docs/components/internchatsystemmessage.mdx: - id: 20c1225749a4 - last_write_checksum: sha1:40543c39b26a5b1486b4edba17087ee294cd064c - pristine_git_object: d456834151003cbeaa3256f5191d5da8254ae32f - docs/components/internchatsystemmessagerole.mdx: - id: dfaa737f415b - last_write_checksum: sha1:7a6a2f5de88707966ac7320a665f00529d1bb30a - pristine_git_object: 0a20d5dd7343a9569e7e4cc80fd062262bdb9bb2 - docs/components/internchattextpart.mdx: - id: e363a4e86181 - last_write_checksum: sha1:cb2dfa78910e924228712cffae81e20fda32e7ea - pristine_git_object: 0bd3a5dc937a9b4c76338a34275f32bb6e61d2c9 - docs/components/internchattextparttype.mdx: - id: c04229df62f6 - last_write_checksum: sha1:4a9332e97ed33ec7a8d4c4f49ee1e5fb7b18026a - pristine_git_object: 9807a99c339285e705d1af4b1970801b69c0afd0 - docs/components/internchattoolcall.mdx: - id: 3dda2839482f - last_write_checksum: sha1:1866d183693b5a3432de5ffe884463ccd999c2e6 - pristine_git_object: 6176afe83ecbf2d564838006f220860997d810d3 - docs/components/internchattoolcallfunction.mdx: - id: 6ea64a326f37 - last_write_checksum: sha1:fc071cd80e4b7493ea831f6bf3d9add756a62dac - pristine_git_object: 918fa0b276428acef9b4cf5736f8b03fbcd6ce75 - docs/components/internchattoolcallfunctionname.mdx: - id: 9058994c209d - last_write_checksum: sha1:73344765db3a55a6b9fff3110a86dd00f1f657ac - pristine_git_object: 15d42c44f67974c0848d3754902c24144176fddf - docs/components/internchattoolcalltype.mdx: - id: 6b4485cf3a70 - last_write_checksum: sha1:692f210071d07c7ce102f35ab79e552452b810ac - pristine_git_object: 8e1145d1024947c863d50a85912df036dafbed50 - docs/components/internchattoolmessage.mdx: - id: c438ca57c9cc - last_write_checksum: sha1:2a0b2fb4633d54127858a8855274fd673c219967 - pristine_git_object: f2673d01f14c621aa7ef8470771f7f97a1204d30 - docs/components/internchattoolmessagerole.mdx: - id: 753e17c5217f - last_write_checksum: sha1:02bdfc9ddb029426fe1e2b90c907bd6de1364001 - pristine_git_object: 8f338c95667ee82378da721fa349a3738b7f129f - docs/components/internchatusage.mdx: - id: f5aed0754540 - last_write_checksum: sha1:ea80b91e539a427ae7bafd34f422e3749fc77acc - pristine_git_object: 221095cfd370a8bd16911fe84405635b59369abe - docs/components/internchatusermessage.mdx: - id: 0073668c3d8d - last_write_checksum: sha1:53a8c52ead668be930deb9a3a0c7ecd4149503e0 - pristine_git_object: 55aae5818b0db37b735d95788602a76bf8237564 - docs/components/internchatusermessagerole.mdx: - id: b314b250af70 - last_write_checksum: sha1:22c9aaa210f59e0d4845a03a268b6ba879fb4132 - pristine_git_object: 4a98d72416014765c3e6b38b7b5eae9cbc8e2f34 - docs/components/internconnection.mdx: - id: c53e6fbe3a35 - last_write_checksum: sha1:bce4ac9ddd24ad3e0e9ff6b6041fd2505d9a7994 - pristine_git_object: dfa0039094ac99bf32d9db0aa7af26161d6b926c - docs/components/internconnectionlist.mdx: - id: 9b353a9e1209 - last_write_checksum: sha1:18f7cc5c27d62efaf720543fa62d6650016bf733 - pristine_git_object: 8105c81e8f925a4bdaf773da236b2a3b7e236444 - docs/components/internconnectionscope.mdx: - id: ebb01700b6f4 - last_write_checksum: sha1:ec8a5d484d73c0212ad5404f51dd45f634409351 - pristine_git_object: a543fdc84452b32b96dbeda8c04ce0250edb731a - docs/components/internconnectionstatus.mdx: - id: 5f5f312dccd4 - last_write_checksum: sha1:2858afb47e45442bf93a87dd937a0ac2d1858719 - pristine_git_object: 3d98e2f09cb445b9c155e66690720be77355dcdf - docs/components/interndaemonaccess.mdx: - id: ba56f69a1513 - last_write_checksum: sha1:aab5570e46ec477d799e5aed9bb41b4082b01c62 - pristine_git_object: 331e8fe95683749590b5317c9ab77146e141f228 - docs/components/interninvokeacceptedresponse.mdx: - id: fabf6978427d - last_write_checksum: sha1:2a29dff72ed9ef5438d4269be8b2c0ad2cb21569 - pristine_git_object: bcec63f8d6fc92f2230d08620555507ecbc60fd4 - docs/components/interninvokeacceptedresponsestatus.mdx: - id: 15a13a755d2e - last_write_checksum: sha1:1380143cde9259d756032888c9c8d50de0c97b1b - pristine_git_object: ac3cd774ee80c6b2e84441a7f51bf02e4ab68139 - docs/components/interninvokerequest.mdx: - id: f6cb5da6d6df - last_write_checksum: sha1:700c5215fb1d51ef1a9dd540ff59277b441d10b4 - pristine_git_object: 01ec56d1b224be02f4569c6035ed1d90c5c1f726 - docs/components/internlifecycleerrorerror.mdx: - id: 501146f0d87d - last_write_checksum: sha1:044b3295aa55836ed6b018679d1e8d6558bd33ec - pristine_git_object: dc3a8f402833fa05fab1c530c48a149aa4b45114 - docs/components/internlifecycleerrormetadata.mdx: - id: 86fa451a31a7 - last_write_checksum: sha1:3176bc02e88e75c81a0be655309bad2d43b49661 - pristine_git_object: f0f45816263733aa1b00c5eb21f8e6c951853102 - docs/components/internlistresponse.mdx: - id: 4c41e6189730 - last_write_checksum: sha1:8253a947e183a40e10e54a21a5daecff3c1ca969 - pristine_git_object: 75702eed180998d3c69ffb0a32932147f9946c6b - docs/components/internstatus.mdx: - id: c90242af9f30 - last_write_checksum: sha1:23f8d62521ceaa0468c43d9355dba84a260058a3 - pristine_git_object: b0753ab065074bd8988bc23026b69162d9b3910d docs/components/issuedtokentype.mdx: id: b5c747e2aaf8 last_write_checksum: sha1:33d9e8b021a11c7168f66a288dd5d7ed3aa0a78e @@ -4250,10 +4030,6 @@ trackedFiles: id: a1f9479635c7 last_write_checksum: sha1:ec8e9cbad12950906189fe864e25edc0e51fd0d2 pristine_git_object: 5be3fb2f0f628d3615c26467f16df76e7b262ca4 - docs/components/kind.mdx: - id: 70cc312838f0 - last_write_checksum: sha1:e120c536be6de7a2db38202a8ebbbab18d006ddd - pristine_git_object: 8b7b3b9ce5ac1dee23679eb4f636be53600e5ab9 docs/components/kty.mdx: id: e031cc3f462c last_write_checksum: sha1:2506bc8b4e80b7b71b9f59a8d84a0367cfd3a119 @@ -5094,10 +4870,6 @@ trackedFiles: id: 35262d81b0a1 last_write_checksum: sha1:53220ed66cf059d9f06df81b7f5bb0f2d87f5283 pristine_git_object: bf3c27b8d2da352bd80bb18179159839e69b9b0a - docs/components/offreason.mdx: - id: 166ede31f763 - last_write_checksum: sha1:bd44b24eb53605cbaa74be19e21d0831686899bc - pristine_git_object: 1b7bd4fb5a1cc59ed01aca9c3e5976068d2cf0a5 docs/components/onerror.mdx: id: 652a1db16dbe last_write_checksum: sha1:e9b7ccb3ef20c9c5c1536fa88bfdc57e94d3717a @@ -6366,10 +6138,6 @@ trackedFiles: id: cb682ce5da89 last_write_checksum: sha1:4cf126470a616a8097d53d721fbc5b50ca2a5495 pristine_git_object: b59688b7be0ae1054801e22f84a62252d5692821 - docs/components/progress.mdx: - id: 0b8df88cc38e - last_write_checksum: sha1:f7aa4681aa80d62f2a7c69b809b002f6758fe7fc - pristine_git_object: 1c5f4b732e434daa29af2f811fe949fcfa99344b docs/components/promptcachebreakpoint.mdx: id: c135956dc623 last_write_checksum: sha1:eb302e1163f406252e6889d26f657b8c7692263e @@ -6442,10 +6210,6 @@ trackedFiles: id: 9ca776e56c1b last_write_checksum: sha1:6e4c1559eef9ee1369886cca6708b01b93d685bc pristine_git_object: 5aa8e90a6761d61aa63204bc3aa73f4481449d3e - docs/components/provisioninternresponse.mdx: - id: 23160e47706d - last_write_checksum: sha1:acf8dada13882840c6f666af22913959ce99917f - pristine_git_object: be1e5af9301ba917704f25fdafed31c152485abf docs/components/publicendpoint.mdx: id: ec4843ef5d86 last_write_checksum: sha1:76b4e644e6c2d59cdcc7df05b789a91ca7713117 @@ -6786,10 +6550,6 @@ trackedFiles: id: 4ad56b7d7d1a last_write_checksum: sha1:0ee81f3831154c344605a72f2924167f220f402b pristine_git_object: 2609a9af043ce5570970252f3ebd5df12d693be3 - docs/components/route.mdx: - id: f43dfcb07063 - last_write_checksum: sha1:473caf7a8c0c3ab2a0b9e6ec4d18b068e78a1489 - pristine_git_object: d4c2213a983345b39746b758896ecfe67babc994 docs/components/routedservicetier.mdx: id: 1ecc7cdd925e last_write_checksum: sha1:674d22f78f85c9d89408f6e791023fd6d1f36289 @@ -6858,10 +6618,6 @@ trackedFiles: id: 126e702b7c97 last_write_checksum: sha1:3fbb5c3145b96472437de6e6384ae222b0ae5210 pristine_git_object: 185abbfd59b8369f9e7475ab4cd7acdfc58962a3 - docs/components/server.mdx: - id: 976d3374d0f4 - last_write_checksum: sha1:d381fcddd3358e4ebb83dad466eb40f769809074 - pristine_git_object: c359ad77e04db76ff6023fdb94970a232e4327be docs/components/servertool.mdx: id: 4faa55488ef4 last_write_checksum: sha1:d7095487baa7be99256568e23fbb3b270ae38795 @@ -7014,18 +6770,6 @@ trackedFiles: id: b35cae5eacec last_write_checksum: sha1:6865169ff4445d70d63c674092812b47236f213f pristine_git_object: 1c0dd3c44cfce8b531e7d89e3db6b2787f060984 - docs/components/signinterndaemonrequest.mdx: - id: a611533bd5da - last_write_checksum: sha1:f3f1449053393f9bb4392d20e0c00b815a230e20 - pristine_git_object: 637f6d3cb76052768c2451e81ac0496c8b27aa34 - docs/components/signinterndaemonrequestmethod.mdx: - id: 43e07b7170f0 - last_write_checksum: sha1:8b4d6c38b0c8eb62202d8f31d853bac2da0e2981 - pristine_git_object: 3f4ae7426fc3bec4b84048ee50ebc8fd8c695809 - docs/components/signinterndaemonresponse.mdx: - id: e86dd4c94fe2 - last_write_checksum: sha1:ada171d25c67a5185ea699b948746190ef5d6e5f - pristine_git_object: 704de49dc9f5c22c068603f429ddbb8d38be6454 docs/components/softdeny.mdx: id: d113e0c596b9 last_write_checksum: sha1:56c1888fc6437e170d31ceabfa505cc1aad87ce2 @@ -7110,10 +6854,6 @@ trackedFiles: id: 5f13bb58ae41 last_write_checksum: sha1:3c1825cf0232520f8bf0a7d763391689c8ded8d0 pristine_git_object: 00263cb8d99a3b5fabd9154030b29959a2f66fef - docs/components/stateenum.mdx: - id: 7f79af252071 - last_write_checksum: sha1:e9272743f57607668b53ed0841d6b218b6eca856 - pristine_git_object: 761a1ccc7e79c2e2ad524bd18a6ff291db79bcf1 docs/components/stopservertoolswhencondition.mdx: id: 5fdb9a5c17ee last_write_checksum: sha1:fd59b93bfdf655a268171fc4f35170cbffa72f47 @@ -7334,10 +7074,6 @@ trackedFiles: id: c38f709222bb last_write_checksum: sha1:c9fbb7716e93b17333eedfdb7016d4281b8ac09f pristine_git_object: 16f38dcf620a1a193612e4612a5e6b3300976b10 - docs/components/suspendinternresponse.mdx: - id: 958bfa1f41a0 - last_write_checksum: sha1:6b0cc6e6dc961257ddf8dca2bb94b2db66b254e9 - pristine_git_object: 7a513bd20c993f110b1fb306d9817cf049df27e4 docs/components/switchyardrouterplugin.mdx: id: 86509511f517 last_write_checksum: sha1:72a811fcbb48baea6071851820eb1bb2122be5ac @@ -7886,10 +7622,6 @@ trackedFiles: id: e00dc0a0c6e0 last_write_checksum: sha1:1be70185072640936151f861913c2b89a09d4bab pristine_git_object: 510bac097152bc64d1eccad4f2a498db9bd8a86c - docs/components/updateinternrequest.mdx: - id: fbc072e9b00d - last_write_checksum: sha1:95ded2fa3df74187aa645553071ef0b3b825d9f6 - pristine_git_object: cd20dcfbb7749d7b6b19e44fc2c5d2899718b01a docs/components/updateobservabilitydestinationrequest.mdx: id: b54091567003 last_write_checksum: sha1:de1ce8d3f2c401c6a9f2d958bfd31b22e821d996 @@ -8082,10 +7814,6 @@ trackedFiles: id: d08b4554c5c0 last_write_checksum: sha1:7ae6976a0228f2bc89c4378faa7c2126b8477748 pristine_git_object: 7cbbaeaa059c9bd9181ce53fa86817b66f675a0f - docs/components/viewer.mdx: - id: 7f9ac7ecfda4 - last_write_checksum: sha1:1a4535e0ef472ee81ed93b420e6d6a449dbb88df - pristine_git_object: de09184bb5d4694e3607dd0a3bbbf0de3d99e596 docs/components/watch.mdx: id: 30a963a3de2c last_write_checksum: sha1:c9d01625c52deaa2399d196211ae37b63892efd9 @@ -8310,14 +8038,6 @@ trackedFiles: id: e3cb72f51ee2 last_write_checksum: sha1:144494af097e80aa9fdb921d094b2473bc598165 pristine_git_object: 2a892b08d47733e805a94c47c7f87252f262f753 - docs/errors/internchaterrorresponse.mdx: - id: 68f63d6ed931 - last_write_checksum: sha1:a657b9024d5365dfc17727a35efeca2d56485ca9 - pristine_git_object: ec1c162ec35061c1e1b1d2015e2ce3b079032997 - docs/errors/internlifecycleerror.mdx: - id: 628a6023e104 - last_write_checksum: sha1:bf1a5dd26e7c994c2bef5eef51e3a70dbccd2ceb - pristine_git_object: 9de3964c049fda5bbb0bd5d37b845f2fdc572bb4 docs/errors/notfound.mdx: id: d11022907acc last_write_checksum: sha1:42f60aa69b20c85464337077d2bef1d6cad21043 @@ -8622,30 +8342,6 @@ trackedFiles: id: 852027a00620 last_write_checksum: sha1:f65739779d5b4cd6cbacf59817765623554abef6 pristine_git_object: 77636052b24b9c8973895543fc9bacebe8459844 - docs/operations/createinternchatcompletionglobals.mdx: - id: cce9167e906c - last_write_checksum: sha1:aecbc4296a988fce00115ba6313921ea94058901 - pristine_git_object: 561b72c40da1ebfe6e01a57bd313be238557f279 - docs/operations/createinternchatcompletionrequest.mdx: - id: 24bc5d86217b - last_write_checksum: sha1:a1b741aa4ebd6a388735452a827a58dd58c5c342 - pristine_git_object: a4bd48afd3faf36fa76a2d37561c5582af141ca0 - docs/operations/createinternchatcompletionresponse.mdx: - id: a5139c86a594 - last_write_checksum: sha1:9f6f43db4ee4f560100c712deea289da32a5bedd - pristine_git_object: 6c0f59590a3d8a4377b7be09672cfca88605359e - docs/operations/createinternchatcompletionresponseresult.mdx: - id: 266a0e6c2271 - last_write_checksum: sha1:bac4089c3a8038cc24187d1e75ba90d2eaf2a0f4 - pristine_git_object: b91c4809ecf8b501336052097400f0c70f649010 - docs/operations/createinternglobals.mdx: - id: 45b4d0de1076 - last_write_checksum: sha1:d9bae324793bf0ceed41e23e92bf267574cd7834 - pristine_git_object: 8eb5e1fc3969fddf5f3706423354192dcaa725e6 - docs/operations/createinternrequest.mdx: - id: 775d728f4c95 - last_write_checksum: sha1:4e1bf8e46cf4535f491f18119c13c60316618d70 - pristine_git_object: b3a22348904b9b6e07314e82f77b08763524eb1b docs/operations/createkeysdata.mdx: id: bf8133a06827 last_write_checksum: sha1:a8e15d810ead6120052ac4db3c137d500b177bae @@ -8842,14 +8538,6 @@ trackedFiles: id: a7b7e64c7fb1 last_write_checksum: sha1:e993d4511c68b02e368f21a0b319b2068c6180b4 pristine_git_object: ba80054b8619991e06ee23b1ce40a97692b15c77 - docs/operations/deleteinternglobals.mdx: - id: aa95d8a4b14b - last_write_checksum: sha1:42a9591a7e628d3844d68cd65a1a40e9dd7269be - pristine_git_object: fd39b2b5196d8737e978e97a8d47469940b33679 - docs/operations/deleteinternrequest.mdx: - id: f8055480b92d - last_write_checksum: sha1:5d250a1e8ececb0ad27d1f1fb2a4804d8c836e51 - pristine_git_object: 0ed033d7e9f477f6be0eec2505344ca29fa49179 docs/operations/deleteinternvaultsecretglobals.mdx: id: 6bab12e48fb6 last_write_checksum: sha1:31611313c0d6ef1067af551a8433b2eee40dcdcd @@ -9150,46 +8838,6 @@ trackedFiles: id: 1e6b86bd352e last_write_checksum: sha1:61e6cae3e157e329be3ea0f60ed28408f55b58da pristine_git_object: 15bebf62bb77b99ccfbb68dd33a2b38d42d12b85 - docs/operations/getinternconnectionsglobals.mdx: - id: 94cee61283bc - last_write_checksum: sha1:37d38fb67574360a2ed03660da38b762dc5162c5 - pristine_git_object: 1ddc635b355afbd9b19af347091da87fe1fa4a10 - docs/operations/getinternconnectionsrequest.mdx: - id: 209b0acf3df5 - last_write_checksum: sha1:b698f031046c99ab1061c0110d82e20377ecaa64 - pristine_git_object: c33f9212f154792b25bcea641d6bbf1cd99e7adf - docs/operations/getinterndaemonaccessglobals.mdx: - id: 9c1de03162b5 - last_write_checksum: sha1:dcb2e8aa6726ec42bd508afca59f51c599b4f258 - pristine_git_object: 95abed7a19872a8a8ea348ff40f2dca73ea5275a - docs/operations/getinterndaemonaccessrequest.mdx: - id: d3656df0343d - last_write_checksum: sha1:14d4198519fb1fe68d97ef6aa980714875bc051e - pristine_git_object: e2035a9f0347f8403d43f00136d20fc0e4641887 - docs/operations/getinterndaemonglobals.mdx: - id: da2fcc18ec1f - last_write_checksum: sha1:39e2ceca098bd6a76fcdff47d8de191802056aaf - pristine_git_object: b2ba0d173ad11afd00cf1657b1deab7de641df7d - docs/operations/getinterndaemonrequest.mdx: - id: f275c0103d98 - last_write_checksum: sha1:e99e1b5727148bd43de02d30b6f1ebff309b6efb - pristine_git_object: cdfbaafc1e5c94bfc7cc585ebc075e891160c388 - docs/operations/getinternglobals.mdx: - id: 9bfe3e0e8a6f - last_write_checksum: sha1:7f2d43fe0f91149b2982edebe432faed9bfb3bea - pristine_git_object: 118bb0d2fe8033480475600b890910226a389d65 - docs/operations/getinterniconglobals.mdx: - id: afca2a95de05 - last_write_checksum: sha1:ad615e690060f9fd36c21954928dbd711362dc2c - pristine_git_object: 542cb475e2a3aa6c1dcba78315b6f03ed662a7b9 - docs/operations/getinterniconrequest.mdx: - id: bbe139c71b51 - last_write_checksum: sha1:40fb590d80dac97224b8309e80a2984026e39972 - pristine_git_object: c55add4d062c1129570cb9f69404ae09253d21c6 - docs/operations/getinternrequest.mdx: - id: 6e44684f038a - last_write_checksum: sha1:e3b38672e96405461ef3069043f981eb45730bc1 - pristine_git_object: cd83fdf513f2e3581b526d6fd2bee78841dfd8c6 docs/operations/getkeydata.mdx: id: 6e826a999e6b last_write_checksum: sha1:839f9b181199dc3f3596227d05e6631f1dcdb459 @@ -9402,18 +9050,6 @@ trackedFiles: id: fa09ca81a05c last_write_checksum: sha1:6126fc355e98574f157b9b485ac850a0ec6f2a5e pristine_git_object: 2394952123e253a775bb81426d6ee2d49911e97b - docs/operations/invokeinternglobals.mdx: - id: 9095c942b3a0 - last_write_checksum: sha1:3566995d255c6e0b2bf54aaf406b7288fc27a02c - pristine_git_object: fc2a01268a4789e307b4b2d200c493b1b6337036 - docs/operations/invokeinternrequest.mdx: - id: 14842247e729 - last_write_checksum: sha1:fd1cf98386aa1fbc6f35d87ce76cd27c4897dddb - pristine_git_object: 999ed9735479abd59406706ab1f6e6360fa54f2e - docs/operations/invokeinternresponse.mdx: - id: b75de5a70242 - last_write_checksum: sha1:0ab4b732cb71abfe36c826673b0d70ede866d1e3 - pristine_git_object: bf7427ee3e3ea97873d9510e2e0d9f8505d8a54c docs/operations/keepmembers.mdx: id: 2794baf69c28 last_write_checksum: sha1:aaeb714170a62787f1821383b6136d1753f14722 @@ -9610,14 +9246,6 @@ trackedFiles: id: 28d54bbf7bd0 last_write_checksum: sha1:437819461388cce3d350fdadcec4870766d913e0 pristine_git_object: ca1e31d1cb7936ff8e8f25da69e051cd74743b12 - docs/operations/listinternsglobals.mdx: - id: 6a0fb4e1a618 - last_write_checksum: sha1:b257bc2c67a98c98cebc8bb1046b170d8a6757bb - pristine_git_object: 3a55ed59f02347866993fd5891898cec46a62c28 - docs/operations/listinternsrequest.mdx: - id: e6de03b26b5e - last_write_checksum: sha1:1a3875f6b6a9674b0640038e11bc0daba6b882fd - pristine_git_object: c595b861d0fae9a14542d150c17acd38c700babf docs/operations/listinternvaultsecretsglobals.mdx: id: 83e0c9cb95c6 last_write_checksum: sha1:4def94f91a2e27836d1e4d8d313ad5bc31154d01 @@ -9922,14 +9550,6 @@ trackedFiles: id: c75b3bbeeaa0 last_write_checksum: sha1:ce3f3fa5d69d80a788a934d48fcaa6bbb17260ed pristine_git_object: 0a8cad96cd904712da6f4e77f5889cf32203f8c3 - docs/operations/provisioninternglobals.mdx: - id: 5e34eb9c579a - last_write_checksum: sha1:e5ddc9680dd8f7c0bbec6bb900f0754c8d8da955 - pristine_git_object: 5e790162a8ce632cda6238c8c2687bee9bf8ec5a - docs/operations/provisioninternrequest.mdx: - id: 074aa151686e - last_write_checksum: sha1:250fea07fb32beb5c38dfa2e1d34876da453ad43 - pristine_git_object: 5c14eb74f07f1ece813b29d707e2820635926196 docs/operations/queryanalyticsdata1.mdx: id: 0e41beea77d0 last_write_checksum: sha1:f9a349b4fee07f786180e94b45f92002bfae0e56 @@ -9990,38 +9610,10 @@ trackedFiles: id: 8cb7359a629c last_write_checksum: sha1:710032d2b0328c856d9cf6d6eca279e0b960ff6f pristine_git_object: ed3d7a92aa56dde65beae92df86cf13120828823 - docs/operations/signinterndaemonaccessrequestglobals.mdx: - id: 1a602cb7d11c - last_write_checksum: sha1:dafefd3670d65ba25311c15b08bd8fe4e8562347 - pristine_git_object: 44569250d14f0af8f285b8edfe5fc9e001f1734e - docs/operations/signinterndaemonaccessrequestrequest.mdx: - id: b63efa5c132a - last_write_checksum: sha1:f05a17482ae2e9b30edea70126de56e3df34ab08 - pristine_git_object: 1816b60921ef83f3207beba0975993150eba03a4 - docs/operations/signinterndaemonaccessrequestresponse.mdx: - id: 376bcab67c47 - last_write_checksum: sha1:c22e81b089b238af149e20a0390e66864201beee - pristine_git_object: 83bc490dc949459b77506634f53641ee5759f299 - docs/operations/signinterndaemonrequestglobals.mdx: - id: 2ac9596ea11e - last_write_checksum: sha1:fb71d14710a92f289a68a73ea93c41fd054ae07a - pristine_git_object: 488b9b0634191177b8056fb5da2e6fb5157fcde6 - docs/operations/signinterndaemonrequestrequest.mdx: - id: c2a6b27c1efc - last_write_checksum: sha1:62426c2aa3396d8bcb9416f96cf04faca0c16bc8 - pristine_git_object: afc21adef7f04407021d824320cdfe922e5f800b - docs/operations/signinterndaemonrequestresponse.mdx: - id: 40881c9760b3 - last_write_checksum: sha1:36a052827336abc6d1d29f49e05845ed70a5cfc2 - pristine_git_object: 0686965805d5901fff3ddbe4e13dc6ee4204c138 docs/operations/source.mdx: id: 53486739ebf2 last_write_checksum: sha1:ed574764fc3d9c85d55705aee27616e3de0c8fcc pristine_git_object: 85b44c9e7e9fd56b3a5a0bded755877840cc31b2 - docs/operations/status.mdx: - id: 46242b22ddfe - last_write_checksum: sha1:c0082216aef9dda39994012af2210095c86aaada - pristine_git_object: afe17b53bb6976e38f7f264c5e8a906c2bd1cc42 docs/operations/storeinternvaultsecretglobals.mdx: id: cee17ad4252e last_write_checksum: sha1:dcf11780c44a028cefc5ccc3e96d53536f3af2e7 @@ -10050,14 +9642,6 @@ trackedFiles: id: f159f51b36f7 last_write_checksum: sha1:1d16f944195d66950cba4bfc2f96255286cf33c0 pristine_git_object: 18f5cc3e2fe30014037f8f68d5513a4981d513b9 - docs/operations/suspendinternglobals.mdx: - id: 36617646a835 - last_write_checksum: sha1:135089b28d6874eaffede59ab8a432cce1b8cde5 - pristine_git_object: 3837a6174815dc473a017550b4fcb987e5824e79 - docs/operations/suspendinternrequest.mdx: - id: 035d45ab50f2 - last_write_checksum: sha1:3a932cde1ec1f21b0fc1463f98ce22507272f3b5 - pristine_git_object: d039292f15a1c3ceebb99662f9a8274172b65e0b docs/operations/tasktype.mdx: id: d3da8106d2d1 last_write_checksum: sha1:0955731aba6ddddeeaee3b34ca7e353dc2dd9700 @@ -10106,14 +9690,6 @@ trackedFiles: id: b3a26bb527db last_write_checksum: sha1:61d23143ea26684dacce468f671014cdfa4ab811 pristine_git_object: b89a6072a0e463fdc6e8cf72fb69947c72771768 - docs/operations/updateinternglobals.mdx: - id: 456485694b42 - last_write_checksum: sha1:23ba19d29f64e3268d05edf019d5d2b14b96da57 - pristine_git_object: ef2e1631549eabe9a96b7468bce3b4492fa53489 - docs/operations/updateinternrequest.mdx: - id: 4b345c88804b - last_write_checksum: sha1:acef7242c09041659cb616a6e977e133fa9ffa50 - pristine_git_object: 059a2165b5a09252162e7d21d25de48eb631e29d docs/operations/updatekeysdata.mdx: id: d398ba596e27 last_write_checksum: sha1:f6f5cd048b7b6037bc087eca052d0b19d22c5530 @@ -10326,10 +9902,6 @@ trackedFiles: id: 534a6c102c4f last_write_checksum: sha1:82a8bd22fb399fe419076afe29b9234950baf9f9 pristine_git_object: 08c687694efbecf50406ae7929029d39fb121295 - docs/sdks/interns/README.mdx: - id: 2f8a053ffe78 - last_write_checksum: sha1:212d765ca05cc6747cb202c2f4dc3df7bba0e619 - pristine_git_object: c56a6ed2540876f6705b1198c69920024946af42 docs/sdks/models/README.mdx: id: 58f1ca464e0b last_write_checksum: sha1:aab5b254f0a6dc7ab7c6d543b20c889113cc0dc9 @@ -10404,8 +9976,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:00f20970dece430a33488ce3867718cd4f015f39 - pristine_git_object: 17d5ed6683e134c83e15e85f376ccf0b0c249ccb + last_write_checksum: sha1:0ca5cad890feb4d71ec6abd074460eeb2d7355b8 + pristine_git_object: 1ac8b59d964723b35cd1cfff884e2f79e8a6d95c scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -10432,8 +10004,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:e0963466ebe43f7eb6cd3d9ef0bc62defccf32e0 - pristine_git_object: 758593058001815e80283d53d902cd20c9b7e87a + last_write_checksum: sha1:3e1386277b134d51b9cf84da8e9388c97e73bd24 + pristine_git_object: 66b62897fd1a18f5e185408f1c324f6ed1f20eae src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:30f55a360f41376ab194b9ea725fe4e001a5ae1a @@ -10480,8 +10052,8 @@ trackedFiles: pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:8c8be01fbd17a1ef8ece71c35380cb25a9fb7be0 - pristine_git_object: a8b91e53035003d356401f0f6ada494f3b247ec7 + last_write_checksum: sha1:2a8f0287e3b5b6469dd81f3ee023d94ad66b7a6b + pristine_git_object: 6c2399427a0ddffad32984cd7276da330bd5819e src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c @@ -11578,10 +11150,6 @@ trackedFiles: id: b4e1bdf1de5b last_write_checksum: sha1:ae20a5e7425510c240e5697d847b1cae65940bd6 pristine_git_object: d6c4a4dc73222668daddc2a1788d314ff30e8fe6 - src/openrouter/components/createinternrequest.py: - id: 5722cff28787 - last_write_checksum: sha1:7bb6aa692c02e2c844df09e1109d47b82c53433f - pristine_git_object: b65a8d59c7513566b243b61ba052e2d921186153 src/openrouter/components/createobservabilitydestinationrequest.py: id: 58587fb98a32 last_write_checksum: sha1:f956b75a335301856e16a244d7bd463397688057 @@ -11730,14 +11298,6 @@ trackedFiles: id: c3ac908331ef last_write_checksum: sha1:6a5ca367dfad148ce7f01d14044efbef37b36d2b pristine_git_object: 0c4b2ec66b592fb5be3ac587a5c6d60c84069384 - src/openrouter/components/deleteinternrequest.py: - id: cd214174bc54 - last_write_checksum: sha1:7a3af9c749630d9b80bfbe652555d5b0b7a480c2 - pristine_git_object: 8829804d4c1eee6d4a02d68f1ec7a9f01445c6c1 - src/openrouter/components/deleteinternresponse.py: - id: ac5a1edfacb6 - last_write_checksum: sha1:f00bb81495e80b7c1054160dbc698cbdbe331875 - pristine_git_object: 8be686f460cf8a3fd9e1f56831c5e23ee832f8e6 src/openrouter/components/deleteobservabilitydestinationresponse.py: id: daf99e240820 last_write_checksum: sha1:485d3e763c2edd7ccd69926e2ea872eb6d031fdc @@ -12174,138 +11734,10 @@ trackedFiles: id: 411acdbfeb84 last_write_checksum: sha1:6cc1744db62a53dfa1425c8cab508f5538cd3d50 pristine_git_object: 4a58daf7d055e111ebf204b18ee413203f06b745 - src/openrouter/components/intern.py: - id: eed59a44b44f - last_write_checksum: sha1:7094779dfa6a0ea8600e345577c58e40d0902180 - pristine_git_object: 33ec792825d96807a643b165b2091369590c5e05 src/openrouter/components/internalserverresponseerrordata.py: id: 91397805fa13 last_write_checksum: sha1:6307236e36dc876dbfae76cfcc29ad49461b5b5d pristine_git_object: c3e202d3c93225aba92c8ed9b83633c98f25fb4c - src/openrouter/components/internapprovalmode.py: - id: c44c27f9902d - last_write_checksum: sha1:402f51e4a6cda3f69abf85843961df96b2cf7f0b - pristine_git_object: 988b3a736faf813db2adf006f36e0c400935bb46 - src/openrouter/components/internchatassistantmessage.py: - id: c730f5412099 - last_write_checksum: sha1:b7604b2f9bf91090ef9e55f6d77a85aeaf771762 - pristine_git_object: 208a06d25920d4bfd39bb527b54e78be44adf9f3 - src/openrouter/components/internchatchoice.py: - id: 9ff5592609ff - last_write_checksum: sha1:d9d406cafa766ff427a6a56bbf656f058a484630 - pristine_git_object: f3851f63985f4fce693bd9774c3db6630a3dae50 - src/openrouter/components/internchatcompletionchunk.py: - id: 416076befae5 - last_write_checksum: sha1:37c104e427698983acda53fd08e4bb6bfb339622 - pristine_git_object: d0a3ff2032dedcaef33a1e68315d66a9ce65a005 - src/openrouter/components/internchatcompletionrequest.py: - id: a354f4a174e3 - last_write_checksum: sha1:4131ac13627ad4b9e4de0f70f335b96ff81a2fce - pristine_git_object: a16a69d706126a9a7b3926d3289a70c3c91866e0 - src/openrouter/components/internchatdelta.py: - id: d5bd69629fe9 - last_write_checksum: sha1:309b516f24413099d88cb232c9f12a95e1a01df0 - pristine_git_object: 1ce01a227583fec713bcb6a88bc7630969b6b56f - src/openrouter/components/internchatdevelopermessage.py: - id: d005bd37ce19 - last_write_checksum: sha1:dff8edd919ed9271b4e87fa91cae50224d924214 - pristine_git_object: 92b3981ebcc9afc31b15c5ccc6e8f0fbc37da873 - src/openrouter/components/internchatechoedtoolcall.py: - id: 893eafc39025 - last_write_checksum: sha1:3556da194fd4a33c0e6c4d72d152d36380623e5a - pristine_git_object: 36ce2369a30d72dbcf09a57e5c5e691a79bfb539 - src/openrouter/components/internchatechoedtoolcallfunction.py: - id: de0d0d50a277 - last_write_checksum: sha1:fa5ba1fc3eaaa5ccbb8094567e341abc9020e529 - pristine_git_object: e3ed05c3513244bc989c5deb14efbe7df2f0f046 - src/openrouter/components/internchaterror.py: - id: a517f7c13ccf - last_write_checksum: sha1:4d0498c675b7df3f7082837da34bd34cec8e98b6 - pristine_git_object: 6ddb8c0cb704f5d042e89077fdf487614ab92939 - src/openrouter/components/internchaterrormetadata.py: - id: 6285b9634aae - last_write_checksum: sha1:01dbf6ba388feaf4b4cb146b8ac27f4f7298ef69 - pristine_git_object: 78eb3a03224a49f5399f276166fda60a16ff40e3 - src/openrouter/components/internchatmessage.py: - id: a1261b993693 - last_write_checksum: sha1:94fa02daf0022b3867764cb6de75587ee0b7b104 - pristine_git_object: c880eb7b262ef3fb08f7ccda78d9cf4030ca3e87 - src/openrouter/components/internchatmessagecontent.py: - id: ffa1d259ca0f - last_write_checksum: sha1:43ff1da9e943448d0ee5917a209475d661dcac96 - pristine_git_object: 15127e201afb08059dc72dca07157f6543f65a72 - src/openrouter/components/internchatprompttokensdetails.py: - id: db8fcf7252a0 - last_write_checksum: sha1:551079dcc7a264200845ed175ba23246a8e54797 - pristine_git_object: 592244a0e5455e3cb419bc725413c859d25f6ad9 - src/openrouter/components/internchatsteeredresponse.py: - id: 0193362595df - last_write_checksum: sha1:14f5cfb8ea1b9c0c3eef641831209f518ef66152 - pristine_git_object: 811d58ee11f2d4209cb7333b30a04ba5c48046b9 - src/openrouter/components/internchatstreamerror.py: - id: c4e363e9080c - last_write_checksum: sha1:574315e1f05594bdaec0f34ff6b7052fbe3af23c - pristine_git_object: e862c7450bea59052295789fc565ea30837d99d9 - src/openrouter/components/internchatstreamingresponse.py: - id: 82046faca08f - last_write_checksum: sha1:2fb9525157cf16fc18a31247c741558ec034f6d2 - pristine_git_object: 3a5dcf60553f898ea5366fbf607900e2ad23d3e5 - src/openrouter/components/internchatsystemmessage.py: - id: 3cd679ed29a6 - last_write_checksum: sha1:93a7d7e3236c8f82414093756a79eef3534238e8 - pristine_git_object: b4d9ed2acd19382ce86a24afcb7c2fabc6cd7793 - src/openrouter/components/internchattextpart.py: - id: b23cdde69d55 - last_write_checksum: sha1:166555122a9b1069c53c27e9b13c10f27548cf78 - pristine_git_object: 32223695f161d21d5fe3457a982358a733b222d0 - src/openrouter/components/internchattoolcall.py: - id: 63256627d6b6 - last_write_checksum: sha1:5e88dc414ca40a337452e9eb2e62f38af3580272 - pristine_git_object: ceb01c943db04c4c248d270e56dc4ef0c64a0282 - src/openrouter/components/internchattoolcallfunction.py: - id: f40616f4c0ae - last_write_checksum: sha1:5d92b783605042e9ad24a1f91fc0589eabbf8b7f - pristine_git_object: b723d3eae51d2c2bc5db2a5cc7b5cb4d3648cf41 - src/openrouter/components/internchattoolmessage.py: - id: 7de707b1d7bd - last_write_checksum: sha1:3d49fda7fc0d02b47daef67d703a6797f937899b - pristine_git_object: af736a62114a4e117ffd6eba210039306ce57f8a - src/openrouter/components/internchatusage.py: - id: 6cea3da7bf0f - last_write_checksum: sha1:5e48130973ec6273f7765f5ef74259a5b6b7e118 - pristine_git_object: 439af87192202af664a28ce17f5423a69308f71e - src/openrouter/components/internchatusermessage.py: - id: 97fab5db9a7e - last_write_checksum: sha1:d7d2493ea2f82a9c1fa1f90fae5c5365e589345f - pristine_git_object: a87aacc5a001412a5789caace557974ccf931928 - src/openrouter/components/internconnection.py: - id: 6bd85db851c2 - last_write_checksum: sha1:d9336ba3c657360c4ee5857d8e0046938663a6ae - pristine_git_object: ea777e7a2d6d788dfb06d54ba77844f65ab028c7 - src/openrouter/components/internconnectionlist.py: - id: 4fbeba35b6e3 - last_write_checksum: sha1:381d538ac3f1ab5c984d51c6628d099d24389445 - pristine_git_object: 0b7d72ef1d12f081e62501cd413ae78432cc6797 - src/openrouter/components/interndaemonaccess.py: - id: 023a6ecdcd2d - last_write_checksum: sha1:1b6243da622f56aee6db312e3e3cf3cee96c6eef - pristine_git_object: 2b465e2098a0fd38fe63983c46b081760d7437b0 - src/openrouter/components/interninvokeacceptedresponse.py: - id: b33d41d36bed - last_write_checksum: sha1:0237a0fa91192a250e4162f4d6c0a764a87a9fbe - pristine_git_object: 9f2d10b9b07bfd6f1003533c4302c5dfd69c9699 - src/openrouter/components/interninvokerequest.py: - id: 3c9ecc132cba - last_write_checksum: sha1:20dec52635e43847411caa0c78771b955be3f176 - pristine_git_object: f781e6fa44e17f06fe177f0106ee7317683d9362 - src/openrouter/components/internlifecycleerror.py: - id: 2b89c094850e - last_write_checksum: sha1:5cd04c20e433588e3ecbc026af90cf3508ecbc7c - pristine_git_object: cde6b4d1fdd5eaaef513b8f289f0da6ebcb7174b - src/openrouter/components/internlistresponse.py: - id: 1d6ce743dbed - last_write_checksum: sha1:ffb97c9bdd1ccca6cfe9951cd0ae0297e4525765 - pristine_git_object: 2afe11472e1f3861b2b9725ddafd036b961d3088 src/openrouter/components/itemreferenceitem.py: id: d3c42b5f11fb last_write_checksum: sha1:25fd74f1c34307a97931e1d2c138a1db347218ad @@ -13150,10 +12582,6 @@ trackedFiles: id: 02719ff8dcd5 last_write_checksum: sha1:d45c5195b22199a5f03a1a749a861f110c8a3a13 pristine_git_object: 1798ae9dd8c2e4b629bb99cc5c643827895e8231 - src/openrouter/components/provisioninternresponse.py: - id: bb3ef5f9a913 - last_write_checksum: sha1:670fe98feb4572efa1000f2d2dcb9795c99374a1 - pristine_git_object: 5f4a4186a9c98767217546b6b87d238fbc0155f3 src/openrouter/components/publicendpoint.py: id: 848aa2ef9129 last_write_checksum: sha1:db4e23bf4cda6a1829228c83e13d2645f9dd0325 @@ -13430,14 +12858,6 @@ trackedFiles: id: 6d6e8d7d80ad last_write_checksum: sha1:d065afdd505a8303f6ba8e268cef42a3e9ea39fb pristine_git_object: 418953ba7366a6015934bf8795178d79adb03b89 - src/openrouter/components/signinterndaemonrequest.py: - id: 20aab639ddf2 - last_write_checksum: sha1:bde362d81745729323ff18cbcb534a45c62fa37a - pristine_git_object: a5d555221fbfd5ef01a1468b341042d8d39faeb3 - src/openrouter/components/signinterndaemonresponse.py: - id: 206595537b76 - last_write_checksum: sha1:c0675834e1a8bd8f67620f8e2fc1232421ee720b - pristine_git_object: 43b66eaec7de82007ea1b29e60c86dc609cafa6b src/openrouter/components/speechinput.py: id: 14e46bea4b32 last_write_checksum: sha1:c6e320441ce7eaa95072d8796e97f082302bb326 @@ -13598,10 +13018,6 @@ trackedFiles: id: 1e1463bcfd03 last_write_checksum: sha1:d7ba55af6eca473c91a3cd09a73068bb8a75ad22 pristine_git_object: 139b0fc5a600fee17eafff1d36df72754c90b2fe - src/openrouter/components/suspendinternresponse.py: - id: 0e696fa5051f - last_write_checksum: sha1:9f511d4136c3ee36cdebd2fe135375d571a9b094 - pristine_git_object: 703bf7deed21138fa64db63e6648be4cd2f3d09d src/openrouter/components/switchyardrouterplugin.py: id: abdcef77e2bb last_write_checksum: sha1:913d38596c2cbfe32aecf10033727d556f6bbb48 @@ -13746,10 +13162,6 @@ trackedFiles: id: 7b068d26ce31 last_write_checksum: sha1:2b63cbb90747f07f775d9a22e80f74c67221fea8 pristine_git_object: df833960211cc7ed2a2a42fddbeafda0092e1c0c - src/openrouter/components/updateinternrequest.py: - id: 41df64f43394 - last_write_checksum: sha1:7de95851732db214cd7488927551faaf9a41004d - pristine_git_object: 1b9db811b6931c267b00e5f12a8560be603c9da9 src/openrouter/components/updateobservabilitydestinationrequest.py: id: d7a39fe04386 last_write_checksum: sha1:15ddb24dc0d5ed9b9757eb767426c0cc5a263f7e @@ -13980,8 +13392,8 @@ trackedFiles: pristine_git_object: 5c3a48759ba31aa633627707b68885b6cc367ddf src/openrouter/errors/__init__.py: id: 366154d0d60a - last_write_checksum: sha1:61e6d3f0eecba0f95e27e6ab0662b2c5e742ba48 - pristine_git_object: 668e68c7e79e2d442bc526d90fcf3c4f9ba9e437 + last_write_checksum: sha1:2bf92aa2923c6564ce5b91ae5c27e95257fe0f19 + pristine_git_object: 0159d3af1415d9c59412b32971cc1e9ba6bbe2e3 src/openrouter/errors/badgatewayresponse_error.py: id: 818c3605ce23 last_write_checksum: sha1:f0307bff4a47f950c514d7d47de5690cac871bbb @@ -14034,14 +13446,6 @@ trackedFiles: id: a5ab5c4a53a9 last_write_checksum: sha1:3ffab8fcee20916d34ac6ff5112e8721f8d30c46 pristine_git_object: e63641558c6a2f555b46a76fa0e224c9ad526b88 - src/openrouter/errors/internchaterrorresponse.py: - id: 855f6fb3466e - last_write_checksum: sha1:6711c6b63107134e8b81665ca8f5b7c462ebabf1 - pristine_git_object: 6fe3f73572a88bdcce0cd15da283b25f034186a1 - src/openrouter/errors/internlifecycleerror.py: - id: 8d3ad41bb70c - last_write_checksum: sha1:3a5f33a12bbd90a5477c08f3a88b6967ecd88abe - pristine_git_object: 8a93352420aca779ccb028d51c9d869696f838b3 src/openrouter/errors/no_response_error.py: id: b8b987b5e306 last_write_checksum: sha1:7f326424a7d5ae1bcd5c89a0d6b3dbda9138942f @@ -14122,10 +13526,6 @@ trackedFiles: id: c4d7adf63ae0 last_write_checksum: sha1:adc4c03f5bbc670f202c475721c524d8c651c3f3 pristine_git_object: 50643a126668498dd668c7cceb9f78c03d413d32 - src/openrouter/interns.py: - id: d18df05c5c6d - last_write_checksum: sha1:7ec3df50159ae127a84e64bb18cba33fa57f229d - pristine_git_object: 3d2865201bc050c4159cc45059c3e59058eea997 src/openrouter/models/__init__.py: id: ed73b93abb3f last_write_checksum: sha1:932a790ae66ccd7d7022b39c659bcf72a664ebea @@ -14152,8 +13552,8 @@ trackedFiles: pristine_git_object: 4a35ede011d09dddab042e2c00413ce4f6be655e src/openrouter/operations/__init__.py: id: 9afcea1e7161 - last_write_checksum: sha1:62a371180a300aa83a33cf0e5d00f7724b39d24f - pristine_git_object: 352e1b49012fad38078815b28b7092f5305ff22b + last_write_checksum: sha1:43ffeba90ee98353a23fcec744d42e61e4e30173 + pristine_git_object: 6ddf9ad70fae1a604773fc55b42ad6a770e71dd5 src/openrouter/operations/activateprivateendpoint.py: id: 3b39eec5d66f last_write_checksum: sha1:9406e6b3d38c82895fd795f637702ef579cc6d36 @@ -14230,14 +13630,6 @@ trackedFiles: id: ef9b8b32ed45 last_write_checksum: sha1:a1a8152a7c5a29004c17a9eed5b796a69dbe9db6 pristine_git_object: 8216a656ec1412a034878e257bd9de9e94fa8da1 - src/openrouter/operations/createintern.py: - id: b5cd9ac981a1 - last_write_checksum: sha1:ddd5255797b56717dbc1a9a9eae62ca74fc6c760 - pristine_git_object: 4443b789b7d9f68a1d25d085da8aeb80cadd2f8f - src/openrouter/operations/createinternchatcompletion.py: - id: 3d0567b5533b - last_write_checksum: sha1:f4db00ec08c8b0a0ebaaf4699fc9911e50e5c825 - pristine_git_object: e25761cb500ef9cc21adf91165fb9f11fb8379da src/openrouter/operations/createkeys.py: id: 64ad31fdaa6c last_write_checksum: sha1:ab6dc89efd3f557b263ccd2211fc5b2740d8e218 @@ -14314,10 +13706,6 @@ trackedFiles: id: 1fbdb98bbb85 last_write_checksum: sha1:9205bdbe64c2902d51ac7c6bddc8677af5b14ed7 pristine_git_object: a8c58e7fa8dd7e781d70c87ecc427f3fdff59ce9 - src/openrouter/operations/deleteintern.py: - id: daeef9c6710e - last_write_checksum: sha1:71c03cf5abbd6285a899a1ac7b56137892ec6dcb - pristine_git_object: 9595f01349b9f74cd3ac7475e907f28f7a3ba935 src/openrouter/operations/deleteinternvaultsecret.py: id: ffac57160027 last_write_checksum: sha1:bc0d5957e085421f3a82cddc86d2bb6139a3d0f9 @@ -14418,26 +13806,6 @@ trackedFiles: id: 9b3309b59c64 last_write_checksum: sha1:76d3d0f15b487afef177e4b5148bddb814795b0f pristine_git_object: 3d69c1678d900400234631c4ace61a9f8354efc2 - src/openrouter/operations/getintern.py: - id: 9169bcde1477 - last_write_checksum: sha1:b0efb3c2205f580b8bad328ccca792dfa8eb18aa - pristine_git_object: 137abb8f6a48c3a7a0463370d6a254d6af406cad - src/openrouter/operations/getinternconnections.py: - id: 453551e3aa96 - last_write_checksum: sha1:f31c690b60c4f81a306e608e212945014a5e65a4 - pristine_git_object: e369735a2938bc22b4bc6320a52223405a02daaa - src/openrouter/operations/getinterndaemon.py: - id: ffa3cab7de3b - last_write_checksum: sha1:6ff5d4d67457f1be58426a4b81ff66251ede39b2 - pristine_git_object: d85bf67f5c67c3690a27a8314eeab55bf5c278c2 - src/openrouter/operations/getinterndaemonaccess.py: - id: 30c4fbbddd94 - last_write_checksum: sha1:c9a4991c38d8588d2f272710f24fa430975d4fab - pristine_git_object: 6632fbbbe4e59918369b70cf2a365880f2d315d6 - src/openrouter/operations/getinternicon.py: - id: 2d450ce18c27 - last_write_checksum: sha1:79680571aeeeee2d39abf834415519b22640070d - pristine_git_object: ecda3acddbf6a798b78354c25e472093d08bb79e src/openrouter/operations/getkey.py: id: d9769da90865 last_write_checksum: sha1:63a27034e350b578b6d5f29d6568111bc14c75c1 @@ -14510,10 +13878,6 @@ trackedFiles: id: 1873b593f56e last_write_checksum: sha1:a7f6b390da2472f04cef719e30d998e08b24acd3 pristine_git_object: 0365c6edd5a01c4086dfcf75d326fb48a67ad9d6 - src/openrouter/operations/invokeintern.py: - id: 554091fee715 - last_write_checksum: sha1:31b3686adff4428ebc5c1a9a58190c7475df0d9a - pristine_git_object: e2024274ca5a6aedb60eb9d9dfdc741e04b26c03 src/openrouter/operations/list.py: id: 3ced31e3804e last_write_checksum: sha1:eee1e1075132399c1e45e6f5e0ad953cb6dea968 @@ -14582,10 +13946,6 @@ trackedFiles: id: 32772b285bb4 last_write_checksum: sha1:d2e172f972cc8ed89dfe1541e2c4bf5314ab7490 pristine_git_object: aa75b78b26ac046e05df9b89f265e4caf897ac91 - src/openrouter/operations/listinterns.py: - id: 89bc4fa38c9f - last_write_checksum: sha1:8b938ac53c5ff37cc670b49c605fd7cf513be8be - pristine_git_object: 305b5b570d1bac7698a8fb7ce809e68de9e0bfa4 src/openrouter/operations/listinternvaultsecrets.py: id: d9f9db46871d last_write_checksum: sha1:31bd0f67cb4e7dffe16c4a4af5d27a08920d355c @@ -14674,10 +14034,6 @@ trackedFiles: id: 4303a549823d last_write_checksum: sha1:b38c12973abf643632ac5fd2293bff383c20c0a2 pristine_git_object: 6ab264885a9454b195955adba4b65e01f2abf223 - src/openrouter/operations/provisionintern.py: - id: 3e316cf3dd88 - last_write_checksum: sha1:5786bd713d8d4a84fc4bac072f624b59527ff0b1 - pristine_git_object: 2efbcc03b9385327bbe4d64652bb6f0881f46169 src/openrouter/operations/queryanalytics.py: id: d76c63ff66f6 last_write_checksum: sha1:d166f291e1b720de07ceb8f684bd1d876213843e @@ -14686,14 +14042,6 @@ trackedFiles: id: d9fee71bb577 last_write_checksum: sha1:0cba4011b8e305270ac30f88cb7ab59b6aefe619 pristine_git_object: b065e38c8d449348c4d133004653607e4194da6e - src/openrouter/operations/signinterndaemonaccessrequest.py: - id: 2f8731a56620 - last_write_checksum: sha1:18b0b35071bad75696c99ec74b9cc5cd665f2299 - pristine_git_object: 8334ef4145ebd6f7f446b7ea9263b7a893480a6d - src/openrouter/operations/signinterndaemonrequest.py: - id: 768271b5b2b1 - last_write_checksum: sha1:9fa390699ade711e992e3c86e77c877c964cc98f - pristine_git_object: 45e6c39309940d5c3000570dbfb923a19872f0dc src/openrouter/operations/storeinternvaultsecret.py: id: 59c0352c6d20 last_write_checksum: sha1:60af864dcc1d9140f04957a1b5308de2bee9833e @@ -14706,10 +14054,6 @@ trackedFiles: id: a1f4458f5e75 last_write_checksum: sha1:634750972ca2bf7d76b1530f19f0d5401a44c3d8 pristine_git_object: 878e3ec2224f81c003c35efa326d2ba53ee595c0 - src/openrouter/operations/suspendintern.py: - id: 935964c35b42 - last_write_checksum: sha1:e51f9036765222c8f52c9e25398286e446ec11e3 - pristine_git_object: 7fff4cf03fee3d60909e5efe3710ab796572cf99 src/openrouter/operations/updatebyokkey.py: id: 486f4ea60120 last_write_checksum: sha1:a170382e38c66128bddbe8ea18c034d1350910da @@ -14722,10 +14066,6 @@ trackedFiles: id: 6cfb33d7d40c last_write_checksum: sha1:bf4f6b9899c176fa012acc607556a66d6e85a51b pristine_git_object: 3787f0ce396fca69bdd7bce99d8054fec4dd23d6 - src/openrouter/operations/updateintern.py: - id: b69b4ae29277 - last_write_checksum: sha1:c26fb7bce5047b277a028d786a12f99db9262531 - pristine_git_object: d87519cfb18258224c2958076dedb16ff4abe208 src/openrouter/operations/updatekeys.py: id: 56fb213253a8 last_write_checksum: sha1:8a49a1d8fecd7314d177d488ecec30214f4e918b @@ -14800,8 +14140,8 @@ trackedFiles: pristine_git_object: 6bc5fe5e691f5136f59e018dac5998ac36700e10 src/openrouter/sdk.py: id: ee9846c4c9c5 - last_write_checksum: sha1:77ba201e90ea7357c69be7f049c8b2f4366bd19f - pristine_git_object: 610c2f778fa06707eacf88c68ea5234ec406e651 + last_write_checksum: sha1:c814e782f7fc3e756d7c764a6241e2c978ec8e83 + pristine_git_object: 9e37516f4c72a7b5e22317597b75683656926aa3 src/openrouter/sdkconfiguration.py: id: 55773bb98d7c last_write_checksum: sha1:c01826125c31a8b8bc99d9d679782c8758fae001 @@ -19255,4 +18595,18 @@ examples: examplesVersion: 1.0.2 releaseNotes: | ## Python SDK Changes: - * `open_router.generations.get_generation()`: `error.status[403]` **Added** + * `open_router.interns.list_interns()`: **Removed** (Breaking ⚠️) + * `open_router.interns.create_intern()`: **Removed** (Breaking ⚠️) + * `open_router.interns.delete_intern()`: **Removed** (Breaking ⚠️) + * `open_router.interns.get_intern()`: **Removed** (Breaking ⚠️) + * `open_router.interns.update_intern()`: **Removed** (Breaking ⚠️) + * `open_router.interns.get_intern_connections()`: **Removed** (Breaking ⚠️) + * `open_router.interns.get_intern_daemon()`: **Removed** (Breaking ⚠️) + * `open_router.interns.get_intern_daemon_access()`: **Removed** (Breaking ⚠️) + * `open_router.interns.sign_intern_daemon_access_request()`: **Removed** (Breaking ⚠️) + * `open_router.interns.sign_intern_daemon_request()`: **Removed** (Breaking ⚠️) + * `open_router.interns.get_intern_icon()`: **Removed** (Breaking ⚠️) + * `open_router.interns.provision_intern()`: **Removed** (Breaking ⚠️) + * `open_router.interns.suspend_intern()`: **Removed** (Breaking ⚠️) + * `open_router.interns.chat()`: **Removed** (Breaking ⚠️) + * `open_router.interns.invoke()`: **Removed** (Breaking ⚠️) diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index d61789d2..5b961237 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.79 + version: 1.3.80 additionalDependencies: dev: pytest: '>=8.3' diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 52f51288..b2a58c60 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -8175,6 +8175,7 @@ components: type: 'string' required: - 'error_type' + title: 'ChatStreamChunkMetadata' type: 'object' required: - 'message' @@ -10060,47 +10061,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: @@ -11242,26 +11202,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 @@ -15172,136 +15112,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: @@ -15342,891 +15152,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' @@ -16248,2862 +16358,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: @@ -22269,6 +21271,7 @@ components: enum: - 'POST' - 'PUT' + title: 'ObservabilityWebhookDestinationMethod' type: 'string' x-speakeasy-unknown-values: allow url: @@ -23170,6 +22173,7 @@ components: - 'misalignment_policy_violation' - 'data_residency_mismatch' - 'permission_denied' + title: 'CodeEnum' type: 'string' x-speakeasy-unknown-values: allow message: @@ -27655,15 +26659,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: @@ -30046,63 +29041,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' @@ -31319,15 +30257,6 @@ components: seed: type: 'boolean' type: 'object' - SuspendInternResponse: - additionalProperties: false - properties: - suspended: - const: true - type: 'boolean' - required: - - 'suspended' - type: 'object' SwitchyardRouterPlugin: example: algorithm: 'stage' @@ -32934,40 +31863,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 @@ -34633,2312 +33528,285 @@ components: 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 + 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: @@ -36959,16 +33827,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: @@ -36979,204 +33857,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' - nullable: false - - 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: @@ -37207,6 +34301,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: @@ -37217,59 +34321,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: @@ -37290,67 +34423,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: @@ -37371,88 +34453,26 @@ 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: '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': - content: - application/json: - example: - error: - code: 401 - message: 'Missing Authentication header' - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '403': + '413': content: application/json: example: error: - code: 403 - message: 'Only management keys can perform this operation' + code: 413 + message: 'Request payload too large' schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' - '404': + $ref: '#/components/schemas/PayloadTooLargeResponse' + description: 'Payload Too Large - Request payload exceeds size limits' + '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: @@ -37463,191 +34483,82 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Get a BYOK provider credential' - 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' - 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: - 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/UpdateBYOKKeyResponse' - description: 'BYOK credential updated 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' - '403': + '502': content: application/json: example: error: - code: 403 - message: 'Only management keys can perform this operation' + code: 502 + message: 'Provider returned error' schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' - '404': + $ref: '#/components/schemas/BadGatewayResponse' + description: 'Bad Gateway - Provider/upstream API failure' + '503': content: application/json: example: error: - code: 404 - message: 'Resource not found' + 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' + servers: + - url: 'https://openrouter.ai' + summary: 'Submit a Decisions request' tags: - - 'BYOK' - x-speakeasy-name-override: 'update' + - 'alpha.decisions' + x-speakeasy-name-override: 'create' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /chat/completions: + /audio/speech: 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: '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: - 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: 'Hello world' + model: 'mistralai/voxtral-mini-tts-2603' + response_format: 'pcm' + speed: 1 + voice: 'en_paul_neutral' schema: - $ref: '#/components/schemas/ChatRequest' + $ref: '#/components/schemas/SpeechRequest' 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' - 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' + audio/*: schema: - $ref: '#/components/schemas/ChatStreamingResponse' - x-speakeasy-sse-sentinel: '[DONE]' - description: 'Successful chat completion response' + 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: @@ -37681,51 +34592,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: @@ -37736,16 +34609,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: @@ -37756,16 +34619,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: @@ -37826,60 +34679,111 @@ paths: schema: $ref: '#/components/schemas/ProviderOverloadedResponse' description: 'Provider Overloaded - Provider is temporarily overloaded' - summary: 'Create a chat completion' + summary: 'Create speech' tags: - - 'Chat' - x-speakeasy-group: 'chat' - x-speakeasy-name-override: 'send' - x-speakeasy-stream-request-field: 'stream' + - '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" - /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' + /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: - 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 + 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/TaskClassificationResponse' - description: 'Task classification market-share data for the requested trailing window.' + $ref: '#/components/schemas/STTResponse' + description: 'Transcription result' '400': content: application/json: @@ -37900,6 +34804,46 @@ 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' + 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: @@ -37920,65 +34864,132 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' description: 'Internal Server Error - Unexpected server error' - summary: 'Task classification market share' + '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: - - 'Classifications' + - '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" - /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' + /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: - - 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' + key: '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' + user_id: 'user_2yOPcMpKoQhcd4bVgSMlELRaIah' schema: - $ref: '#/components/schemas/ContainerFileListResponse' - description: 'The files in the container.' + 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: @@ -37989,16 +35000,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: @@ -38009,79 +35010,149 @@ paths: schema: $ref: '#/components/schemas/ForbiddenResponse' description: 'Forbidden - Authentication successful but insufficient permissions' - '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' - '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: - - '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: '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' + 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: - bytes: 123 - container_id: 'sess_abc123' - created_at: 1755640000 - id: 'cfile_b3V0L3JlcG9ydC5jc3Y' - object: 'container.file' - path: 'out/report.csv' - source: 'assistant' + data: + app_id: 12345 + created_at: '2025-08-24T10:30:00Z' + id: 'auth_code_xyz789' schema: - $ref: '#/components/schemas/ContainerFile' - description: 'The container file.' + 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: @@ -38112,26 +35183,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': + '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: @@ -38142,678 +35203,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: 'Retrieve a container file' + 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}/content: + /batches: get: - description: 'Streams the raw bytes of a file in a container.' - operationId: 'downloadContainerFileContent' + 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/octet-stream: - example: 'binary file contents' + application/json: schema: - format: 'binary' - type: 'string' - description: 'The raw file content.' + $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: '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: 'List batches' tags: - - 'Containers' - parameters: - - $ref: "#/components/parameters/AppIdentifier" - - $ref: "#/components/parameters/AppDisplayName" - - $ref: "#/components/parameters/AppCategories" - /containers/{container_id}/files/{file_id}/promote: + - '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: '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: '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' + 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/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.' + $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: 'Request payload too large' + message: 'Batch input exceeds the 200 MB payload limit.' schema: - $ref: '#/components/schemas/PayloadTooLargeResponse' - description: 'Payload Too Large - Request payload exceeds size limits' - '429': + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Batch input exceeds the maximum payload size.' + '422': content: application/json: example: error: - code: 429 - message: 'Rate limit exceeded' + code: 422 + message: 'The batch request could not be processed.' schema: - $ref: '#/components/schemas/TooManyRequestsResponse' - description: 'Too Many Requests - Rate limit exceeded' - '499': + $ref: '#/components/schemas/BatchErrorResponse' + description: 'The requested model variant or custom IDs violate Batch API constraints.' + '429': content: application/json: example: error: - code: 499 - message: 'The request was cancelled.' + code: 429 + message: 'Rate limit exceeded.' schema: - $ref: '#/components/schemas/ClientClosedRequestResponse' - description: 'Client Closed Request - The caller cancelled the request' + $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: 'Promote a container file into workspace documents' + $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" - /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' + /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 + type: 'string' 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' + $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: 'Missing Authentication header' + message: 'No auth credentials found.' schema: - $ref: '#/components/schemas/UnauthorizedResponse' - description: 'Unauthorized - Authentication required or invalid credentials' - '403': + $ref: '#/components/schemas/BatchErrorResponse' + description: 'Missing or invalid API key.' + '404': content: application/json: example: error: - code: 403 - message: 'Only management keys can perform this operation' + code: 404 + message: 'Batch not found.' schema: - $ref: '#/components/schemas/ForbiddenResponse' - description: 'Forbidden - Authentication successful but insufficient permissions' + $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' + 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' - nullable: false 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: @@ -38854,92 +35875,204 @@ 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' + nullable: false + - 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' - nullable: false 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: @@ -38960,16 +36093,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: @@ -38980,9 +36113,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' @@ -38994,261 +36128,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: @@ -39264,21 +36181,11 @@ paths: 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' + code: 401 + message: 'Missing Authentication header' 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: @@ -39289,56 +36196,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: @@ -39349,133 +36277,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' - nullable: false - - 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: @@ -39486,132 +36420,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: @@ -39622,6 +36440,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: @@ -39632,77 +36470,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' - nullable: false - - 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: + 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: - - created_at: '2026-09-16T12:00:00Z' - is_active: true - updated_at: '2026-09-16T12:00:00Z' - user: 'employee_123' - total_count: 1 + 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: @@ -39723,16 +36564,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: @@ -39743,134 +36632,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' - x-speakeasy-group: 'externalUsers' - 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' - x-speakeasy-group: 'externalUsers' - 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: @@ -39891,16 +36796,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: @@ -39911,25 +36816,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' - x-speakeasy-group: 'externalUsers' - 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': @@ -39937,13 +36861,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: @@ -39974,16 +36905,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: @@ -39994,47 +36925,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' - x-speakeasy-group: 'externalUsers' - 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: @@ -40055,6 +36998,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: @@ -40065,6 +37018,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: @@ -40075,110 +37038,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' - x-speakeasy-group: 'externalUsers' - x-speakeasy-name-override: 'update' + - 'Containers' 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 + - $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: @@ -40209,6 +37115,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: @@ -40229,16 +37145,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: @@ -40249,68 +37155,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: @@ -40341,6 +37229,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: @@ -40381,16 +37279,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: @@ -40401,84 +37289,447 @@ 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' + nullable: false + 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: + 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' + 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: 'context_bucket' + required: false schema: - example: 'or_file_011CNha8iCJcU1wXNR6q4V8w' - maxLength: 256 - minLength: 1 - pattern: '^[\w-]+$' + 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: 'Workspace to scope the request to. Defaults to the caller’s default workspace.' + 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: 'workspace_id' + name: 'category' 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 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' - - 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 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: 'provider' + name: 'language_type' required: false schema: - $ref: '#/components/schemas/FileProvider' + 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: @@ -40499,104 +37750,112 @@ 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' + nullable: false 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: @@ -40617,73 +37876,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: @@ -40704,6 +38165,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: @@ -40724,6 +38195,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: @@ -40734,6 +38225,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: @@ -40764,160 +38265,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: @@ -40938,44 +38295,83 @@ 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' + nullable: false + - 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: @@ -40986,46 +38382,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: @@ -41036,117 +38392,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: @@ -41157,18 +38528,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' @@ -41194,42 +38565,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: @@ -41260,6 +38629,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: @@ -41270,9 +38649,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' + x-speakeasy-group: 'externalUsers' x-speakeasy-name-override: 'list' x-speakeasy-pagination: inputs: @@ -41286,32 +38666,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': @@ -41319,31 +38682,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: @@ -41364,16 +38709,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: @@ -41384,37 +38739,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' + x-speakeasy-group: 'externalUsers' 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: @@ -41425,16 +38787,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: @@ -41455,22 +38807,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' + x-speakeasy-group: 'externalUsers' 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': @@ -41478,26 +38833,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: @@ -41527,7 +38879,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: @@ -41538,33 +38890,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' + x-speakeasy-group: 'externalUsers' 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': @@ -41572,29 +38924,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: @@ -41604,7 +38940,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: @@ -41615,16 +38951,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: @@ -41635,16 +38961,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: @@ -41655,69 +38971,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' + x-speakeasy-group: 'externalUsers' 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' - nullable: false - - 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: @@ -41738,16 +39105,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: @@ -41758,52 +39125,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: @@ -41833,179 +39236,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' - nullable: false - - 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: @@ -42036,164 +39375,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: @@ -42224,6 +39493,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: @@ -42234,60 +39513,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' - nullable: false - - 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: @@ -42328,6 +39620,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: @@ -42338,70 +39640,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' - nullable: false - - 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: @@ -42422,16 +39754,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: @@ -42442,6 +39784,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: @@ -42452,63 +39804,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: @@ -42529,16 +39892,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: @@ -42559,16 +39912,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: @@ -42619,110 +39962,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: @@ -42733,6 +40023,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: @@ -42743,69 +40053,50 @@ 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' + nullable: false + - 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: @@ -42814,2272 +40105,1544 @@ 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 - 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' '409': content: application/json: example: 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 new name is already taken by an intern in this workspace.' - '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 conflict. Please try again later.' schema: - $ref: '#/components/schemas/InternLifecycleError' - description: 'The request body is non-empty and its Content-Type is not application/json.' + $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: 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: 'Update a guardrail' tags: - - 'Interns' + - 'Guardrails' + x-speakeasy-name-override: 'update' parameters: - $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppCategories" - /interns/{internId}/chat/completions: - 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' + /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 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 - schema: - $ref: '#/components/schemas/InternChatCompletionRequest' - 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]' - application/json: - schema: - $ref: '#/components/schemas/InternChatCompletionChunk' - 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: - 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.' - '400': + - 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' + nullable: false + - 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: - error: - code: 400 - message: 'The intern did not accept that answer for this tool_call_id.' - metadata: - reason: 'bad_request' - retryable: false + 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/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/ListKeyAssignmentsResponse' + description: 'List of key assignments' '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: 'Forbidden - Authentication successful but insufficient permissions' '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 + message: 'Resource not found' 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': + $ref: '#/components/schemas/NotFoundResponse' + description: 'Not Found - Resource does not exist' + '500': 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 + code: 500 + message: 'Internal Server Error' schema: - description: 'Seconds to wait before retrying this request. Present only on a `busy` refusal.' - example: '5' - type: 'string' - '410': + $ref: '#/components/schemas/InternalServerResponse' + description: 'Internal Server Error - Unexpected server error' + summary: 'List key assignments for a guardrail' + tags: + - '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: '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 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/BulkAssignKeysRequest' + required: true + responses: + '200': 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 + assigned_count: 3 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': + $ref: '#/components/schemas/BulkAssignKeysResponse' + description: 'Assignment result' + '400': content: application/json: example: error: - code: 413 - message: 'Request body exceeds 1048576 bytes' - metadata: - reason: 'payload_too_large' - retryable: false + code: 400 + message: 'Invalid request parameters' schema: - $ref: '#/components/schemas/InternChatErrorResponse' - description: 'The body exceeds 1 MiB (`payload_too_large`).' - '429': + $ref: '#/components/schemas/BadRequestResponse' + description: 'Bad Request - Invalid request parameters or malformed input' + '401': 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 + code: 401 + message: 'Missing Authentication header' schema: - description: 'Seconds to wait before retrying this request.' - example: '60' - type: 'string' - '502': + $ref: '#/components/schemas/UnauthorizedResponse' + description: 'Unauthorized - Authentication required or invalid credentials' + '403': content: application/json: example: error: - code: 502 - message: 'The intern could not be reached.' - metadata: - reason: 'intern_unreachable' - retryable: true + code: 403 + message: 'Only management keys can perform this operation' 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': + $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: 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 + code: 404 + 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' + nullable: false + - 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' + nullable: false + - 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' + nullable: false + - 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" @@ -56518,8 +53081,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 c90dff93..672c91ff 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.787.0 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:679a55eb70e93e30b91b6cede2d02b2145791d6ba380c264e04477cb45c167df - sourceBlobDigest: sha256:86762b4810b691bf9bcdf8c189b62e1ae708a224ee217c2cf2c61ce6a9578475 + sourceRevisionDigest: sha256:882ced4df0045b95bda12ac96debc123ac7bc308b3394c4b159f20b8ec89021c + sourceBlobDigest: sha256:f04f358dbc4b3698bfd6967169df9bea0c7b2de647ea9e67a1cfd891312c4376 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:679a55eb70e93e30b91b6cede2d02b2145791d6ba380c264e04477cb45c167df - sourceBlobDigest: sha256:86762b4810b691bf9bcdf8c189b62e1ae708a224ee217c2cf2c61ce6a9578475 + sourceRevisionDigest: sha256:882ced4df0045b95bda12ac96debc123ac7bc308b3394c4b159f20b8ec89021c + sourceBlobDigest: sha256:f04f358dbc4b3698bfd6967169df9bea0c7b2de647ea9e67a1cfd891312c4376 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:5b0b13856cc8e46088ecc07e40a86ef13ec0da39d5c8038263d12019552370e6 + codeSamplesRevisionDigest: sha256:e611601a41dd0a669aebea3ce8cdfef01a422ae86beecb0c392046f68cf0ae95 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index e972d132..20c14237 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -3559,4 +3559,14 @@ Based on: ### Generated - [python v1.3.79] . ### Releases -- [PyPI v1.3.79] https://pypi.org/project/openrouter/1.3.79 - . \ No newline at end of file +- [PyPI v1.3.79] https://pypi.org/project/openrouter/1.3.79 - . + +## 2026-10-23 17:57:30 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.80] . +### Releases +- [PyPI v1.3.80] https://pypi.org/project/openrouter/1.3.80 - . \ No newline at end of file diff --git a/docs/components/account.mdx b/docs/components/account.mdx deleted file mode 100644 index 66a78ddc..00000000 --- a/docs/components/account.mdx +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "Account" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `acts_as` | *Nullable[str]* | ✅ | Whose account it acts as, when known. | -| `is_your_account_linked` | *Nullable[bool]* | ✅ | N/A | -| `note` | *Nullable[str]* | ✅ | N/A | -| `scope` | [components.InternConnectionScope](../components/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/components/code.mdx b/docs/components/code.mdx deleted file mode 100644 index f4cb5da6..00000000 --- a/docs/components/code.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: "Code" ---- - -## Supported Types - -### `str` - -```python -value: str = /* values here */ -``` - -### `int` - -```python -value: int = /* values here */ -``` - diff --git a/docs/components/createinternrequest.mdx b/docs/components/createinternrequest.mdx deleted file mode 100644 index e85bd9bc..00000000 --- a/docs/components/createinternrequest.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: "CreateInternRequest" ---- - -Settings for a new intern. - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -| `description` | *OptionalNullable[str]* | ➖ | Free-form description, or null. | -| `instructions` | *OptionalNullable[str]* | ➖ | Standing instructions the intern boots with, or null. | -| `name` | *str* | ✅ | Intern name, unique per creator within the workspace. | -| `provision` | *Optional[bool]* | ➖ | Start provisioning during this create operation. Defaults to false. | -| `vault_id` | *Optional[str]* | ➖ | Vault owned by another intern in this workspace to attach as a borrowed vault. | -| `workspace_id` | *Optional[str]* | ➖ | 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/components/deleteinternrequest.mdx b/docs/components/deleteinternrequest.mdx deleted file mode 100644 index 8323d82f..00000000 --- a/docs/components/deleteinternrequest.mdx +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "DeleteInternRequest" ---- - -Optional consent for a teardown that discards the workspace. - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `acknowledge_workspace_loss` | *Optional[bool]* | ➖ | Delete even though the workspace backup was not confirmed. Defaults to false, which refuses the teardown when a workspace archive is missing. | \ No newline at end of file diff --git a/docs/components/deleteinternresponse.mdx b/docs/components/deleteinternresponse.mdx deleted file mode 100644 index c24e5242..00000000 --- a/docs/components/deleteinternresponse.mdx +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: "DeleteInternResponse" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `deleting` | *Literal[True]* | ✅ | N/A | \ No newline at end of file diff --git a/docs/components/intern.mdx b/docs/components/intern.mdx deleted file mode 100644 index 5778644f..00000000 --- a/docs/components/intern.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: "Intern" ---- - -Public lifecycle state and settings for one intern. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `attached_vault_id` | *Nullable[str]* | ✅ | Vault the intern borrows from another intern, or null when it borrows none. | -| `can_edit` | *Optional[bool]* | ➖ | 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. | -| `created_at` | *str* | ✅ | ISO 8601 creation time. | -| `created_by_you` | *Optional[bool]* | ➖ | Whether the user behind the key created the intern. Present on list and retrieve; absent for organization keys, which act for no user. | -| `description` | *Nullable[str]* | ✅ | Free-form description. | -| `hostname` | *Nullable[str]* | ✅ | Public hostname the intern is reachable at, or null until provisioning has assigned one. | -| `icon_sha256` | *OptionalNullable[str]* | ➖ | 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` | *str* | ✅ | Intern id. | -| `instructions` | *Nullable[str]* | ✅ | Standing instructions the intern boots with. | -| `last_failure_message` | *Nullable[str]* | ✅ | Why the last provisioning attempt failed, when status is failed. | -| `model` | *Nullable[str]* | ✅ | OpenRouter model slug the intern runs, or null for the workspace default. | -| `name` | *str* | ✅ | Intern name, unique per creator within a workspace. | -| `progress` | [Nullable[components.Progress]](../components/progress.mdx) | ✅ | Active provisioning step, or null once provisioning has settled. | -| `status` | [components.InternStatus](../components/internstatus.mdx) | ✅ | Lifecycle status. | -| `updated_at` | *str* | ✅ | ISO 8601 last update time. | -| `vault_id` | *Nullable[str]* | ✅ | Vault the intern owns, or null before it has been created. | -| `workspace_id` | *str* | ✅ | Workspace that owns the intern and scopes its secrets. | \ No newline at end of file diff --git a/docs/components/internapprovalmode.mdx b/docs/components/internapprovalmode.mdx deleted file mode 100644 index 14f94bb0..00000000 --- a/docs/components/internapprovalmode.mdx +++ /dev/null @@ -1,22 +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 - -```python -from openrouter.components import InternApprovalMode - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: InternApprovalMode = "manual" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"manual"` -- `"self-drive"` diff --git a/docs/components/internchatassistantmessage.mdx b/docs/components/internchatassistantmessage.mdx deleted file mode 100644 index f2815277..00000000 --- a/docs/components/internchatassistantmessage.mdx +++ /dev/null @@ -1,14 +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. - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content` | [OptionalNullable[components.InternChatMessageContent]](../components/internchatmessagecontent.mdx) | ➖ | 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` | [components.InternChatAssistantMessageRole](../components/internchatassistantmessagerole.mdx) | ✅ | N/A | | -| `tool_calls` | List[[components.InternChatEchoedToolCall](../components/internchatechoedtoolcall.mdx)] | ➖ | N/A | | \ No newline at end of file diff --git a/docs/components/internchatassistantmessagerole.mdx b/docs/components/internchatassistantmessagerole.mdx deleted file mode 100644 index caef6da6..00000000 --- a/docs/components/internchatassistantmessagerole.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "InternChatAssistantMessageRole" ---- - -## Example Usage - -```python -from openrouter.components import InternChatAssistantMessageRole -value: InternChatAssistantMessageRole = "assistant" -``` - - -## Values - -- `"assistant"` diff --git a/docs/components/internchatchoice.mdx b/docs/components/internchatchoice.mdx deleted file mode 100644 index 4ae3de47..00000000 --- a/docs/components/internchatchoice.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: "InternChatChoice" ---- - -The single choice this endpoint streams. - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `delta` | [components.InternChatDelta](../components/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"
} | -| `finish_reason` | [Nullable[components.InternChatChoiceFinishReason]](../components/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` | *int* | ✅ | N/A | | \ No newline at end of file diff --git a/docs/components/internchatchoicefinishreason.mdx b/docs/components/internchatchoicefinishreason.mdx deleted file mode 100644 index ebcb8202..00000000 --- a/docs/components/internchatchoicefinishreason.mdx +++ /dev/null @@ -1,23 +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 - -```python -from openrouter.components import InternChatChoiceFinishReason - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: InternChatChoiceFinishReason = "error" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"error"` -- `"stop"` -- `"tool_calls"` diff --git a/docs/components/internchatcompletionchunk.mdx b/docs/components/internchatcompletionchunk.mdx deleted file mode 100644 index 49dd63e5..00000000 --- a/docs/components/internchatcompletionchunk.mdx +++ /dev/null @@ -1,19 +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]`. - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `choices` | List[[components.InternChatChoice](../components/internchatchoice.mdx)] | ✅ | One choice on content, tool-call and error chunks. Empty on the final chunk that carries `session_id`. | | -| `created` | *int* | ✅ | N/A | | -| `error` | [Optional[components.InternChatStreamError]](../components/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` | *str* | ✅ | The completion id, constant for the whole response. | chatcmpl-f727571a-3bad-4e0d-8a9e-f18f8cda9750 | -| `model` | *str* | ✅ | The runtime's identifier for the model the intern is running, as the intern reports it. Each chunk carries the model from the event behind it: `openrouter/intern` on chunks emitted before the intern has reported one and on chunks the API emits itself (timeout, run-ended and severed-stream errors and their final usage chunk), even after an earlier chunk named a model. It can change within a stream. It is not an OpenRouter model slug, and the request `model` is never used. | | -| `object` | [components.InternChatCompletionChunkObject](../components/internchatcompletionchunkobject.mdx) | ✅ | N/A | | -| `session_id` | *OptionalNullable[str]* | ➖ | On the final chunk of every response, the daemon session to continue with, or `null` when the run failed before the intern reported one. Send it as `session_id` on the next request, including the `tool` reply to an interaction. Session ids are client-visible and scoped to the intern's own daemon. | ses_7f3c9a | -| `usage` | [OptionalNullable[components.InternChatUsage]](../components/internchatusage.mdx) | ➖ | Token usage for the run as the daemon reported it, on the final chunk before `[DONE]`. `null` when the daemon reported none, and always `null` after `tool_calls` because the turn is not over. | \{
"completion_tokens": 12,
"prompt_tokens": 40,
"total_tokens": 52
} | \ No newline at end of file diff --git a/docs/components/internchatcompletionchunkobject.mdx b/docs/components/internchatcompletionchunkobject.mdx deleted file mode 100644 index ae29bb6a..00000000 --- a/docs/components/internchatcompletionchunkobject.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "InternChatCompletionChunkObject" ---- - -## Example Usage - -```python -from openrouter.components import InternChatCompletionChunkObject -value: InternChatCompletionChunkObject = "chat.completion.chunk" -``` - - -## Values - -- `"chat.completion.chunk"` diff --git a/docs/components/internchatcompletionrequest.mdx b/docs/components/internchatcompletionrequest.mdx deleted file mode 100644 index 26a29d7b..00000000 --- a/docs/components/internchatcompletionrequest.mdx +++ /dev/null @@ -1,16 +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. - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `approval_mode` | [Optional[components.InternApprovalMode]](../components/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` | List[[components.InternChatMessage](../components/internchatmessage.mdx)] | ✅ | The conversation. Only the last message is read. A last `user` message starts a run. A last `tool` message answers the interaction named by its `tool_call_id` and requires `session_id`. | | -| `model` | *Optional[str]* | ➖ | Accepted for OpenAI compatibility and never used. The intern runs the model configured on it (`PATCH` the intern to change it). Streamed chunks report the runtime's identifier for that model as the intern reports it, or `openrouter/intern` on chunks whose event carries no model (before the intern reports one, and on the chunks the API emits itself: the timeout, run-ended and severed-stream error chunks, the stop chunk of a replay that ends without a terminal daemon event, and the final usage chunk after any of them). A usage chunk that follows a daemon completion event carries the model the intern reported. | openrouter/intern | -| `session_id` | *Optional[str]* | ➖ | The daemon session to continue, as returned in `session_id` on the final chunk of an earlier response. Omit it to start a new session. An id the intern has not seen before is not an error: it starts a new session under that id, so a mistyped id forks the conversation. Sessions are scoped to the intern's own daemon. Required when the last message has role `tool`. | ses_7f3c9a | -| `stream` | *Literal[True]* | ✅ | Must be `true`. This endpoint only streams. `false` or an omitted `stream` is refused with `400` and reason `bad_request`. | true | \ No newline at end of file diff --git a/docs/components/internchatdelta.mdx b/docs/components/internchatdelta.mdx deleted file mode 100644 index 62b50f77..00000000 --- a/docs/components/internchatdelta.mdx +++ /dev/null @@ -1,15 +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. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `content` | *Optional[str]* | ➖ | N/A | -| `reasoning` | *Optional[str]* | ➖ | N/A | -| `role` | [Optional[components.InternChatDeltaRole]](../components/internchatdeltarole.mdx) | ➖ | N/A | -| `tool_calls` | List[[components.InternChatToolCall](../components/internchattoolcall.mdx)] | ➖ | N/A | \ No newline at end of file diff --git a/docs/components/internchatdeltarole.mdx b/docs/components/internchatdeltarole.mdx deleted file mode 100644 index 76b5ccf1..00000000 --- a/docs/components/internchatdeltarole.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "InternChatDeltaRole" ---- - -## Example Usage - -```python -from openrouter.components import InternChatDeltaRole -value: InternChatDeltaRole = "assistant" -``` - - -## Values - -- `"assistant"` diff --git a/docs/components/internchatdevelopermessage.mdx b/docs/components/internchatdevelopermessage.mdx deleted file mode 100644 index 9c2f8fa1..00000000 --- a/docs/components/internchatdevelopermessage.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "InternChatDeveloperMessage" ---- - -A developer message. Accepted for client compatibility and not forwarded. - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content` | [Nullable[components.InternChatMessageContent]](../components/internchatmessagecontent.mdx) | ✅ | 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` | [components.InternChatDeveloperMessageRole](../components/internchatdevelopermessagerole.mdx) | ✅ | N/A | | \ No newline at end of file diff --git a/docs/components/internchatdevelopermessagerole.mdx b/docs/components/internchatdevelopermessagerole.mdx deleted file mode 100644 index c8a28fe9..00000000 --- a/docs/components/internchatdevelopermessagerole.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "InternChatDeveloperMessageRole" ---- - -## Example Usage - -```python -from openrouter.components import InternChatDeveloperMessageRole -value: InternChatDeveloperMessageRole = "developer" -``` - - -## Values - -- `"developer"` diff --git a/docs/components/internchatechoedtoolcall.mdx b/docs/components/internchatechoedtoolcall.mdx deleted file mode 100644 index 4daf2bb5..00000000 --- a/docs/components/internchatechoedtoolcall.mdx +++ /dev/null @@ -1,13 +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. - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -| `function` | [components.InternChatEchoedToolCallFunction](../components/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` | *str* | ✅ | N/A | | \ No newline at end of file diff --git a/docs/components/internchatechoedtoolcallfunction.mdx b/docs/components/internchatechoedtoolcallfunction.mdx deleted file mode 100644 index a8a640ee..00000000 --- a/docs/components/internchatechoedtoolcallfunction.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "InternChatEchoedToolCallFunction" ---- - -The function name and JSON arguments string exactly as streamed. - - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `arguments` | *str* | ✅ | N/A | -| `name` | *str* | ✅ | N/A | \ No newline at end of file diff --git a/docs/components/internchaterror.mdx b/docs/components/internchaterror.mdx deleted file mode 100644 index 288e1147..00000000 --- a/docs/components/internchaterror.mdx +++ /dev/null @@ -1,14 +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`. - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `code` | *int* | ✅ | The HTTP status of the response. | | -| `message` | *str* | ✅ | N/A | | -| `metadata` | [Optional[components.InternChatErrorMetadata]](../components/internchaterrormetadata.mdx) | ➖ | Machine-readable detail for the failure. | \{
"reason": "interaction_not_pending",
"retryable": false
} | \ No newline at end of file diff --git a/docs/components/internchaterrormetadata.mdx b/docs/components/internchaterrormetadata.mdx deleted file mode 100644 index 19b1afb7..00000000 --- a/docs/components/internchaterrormetadata.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "InternChatErrorMetadata" ---- - -Machine-readable detail for the failure. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `reason` | [components.InternChatErrorMetadataReason](../components/internchaterrormetadatareason.mdx) | ✅ | A stable reason a client can branch on. | -| `retryable` | *bool* | ✅ | 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/components/internchaterrormetadatareason.mdx b/docs/components/internchaterrormetadatareason.mdx deleted file mode 100644 index 7b17f0e2..00000000 --- a/docs/components/internchaterrormetadatareason.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: "InternChatErrorMetadataReason" ---- - -A stable reason a client can branch on. - -## Example Usage - -```python -from openrouter.components import InternChatErrorMetadataReason - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: InternChatErrorMetadataReason = "attachment_failed" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"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"` diff --git a/docs/components/internchatmessage.mdx b/docs/components/internchatmessage.mdx deleted file mode 100644 index 95dcf623..00000000 --- a/docs/components/internchatmessage.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: "InternChatMessage" ---- - -One OpenAI-compatible chat message, discriminated by `role`. - - -## Supported Types - -### `components.InternChatAssistantMessage` - -```python -value: components.InternChatAssistantMessage = /* values here */ -``` - -### `components.InternChatDeveloperMessage` - -```python -value: components.InternChatDeveloperMessage = /* values here */ -``` - -### `components.InternChatSystemMessage` - -```python -value: components.InternChatSystemMessage = /* values here */ -``` - -### `components.InternChatToolMessage` - -```python -value: components.InternChatToolMessage = /* values here */ -``` - -### `components.InternChatUserMessage` - -```python -value: components.InternChatUserMessage = /* values here */ -``` - diff --git a/docs/components/internchatmessagecontent.mdx b/docs/components/internchatmessagecontent.mdx deleted file mode 100644 index 8330e45e..00000000 --- a/docs/components/internchatmessagecontent.mdx +++ /dev/null @@ -1,21 +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 - -### `str` - -```python -value: str = /* values here */ -``` - -### `List[components.InternChatTextPart]` - -```python -value: List[components.InternChatTextPart] = /* values here */ -``` - diff --git a/docs/components/internchatprompttokensdetails.mdx b/docs/components/internchatprompttokensdetails.mdx deleted file mode 100644 index 2aab9333..00000000 --- a/docs/components/internchatprompttokensdetails.mdx +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "InternChatPromptTokensDetails" ---- - -Prompt tokens served from cache, when the daemon reported them. - - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `cached_tokens` | *int* | ✅ | N/A | \ No newline at end of file diff --git a/docs/components/internchatsteeredresponse.mdx b/docs/components/internchatsteeredresponse.mdx deleted file mode 100644 index 44a8a6b0..00000000 --- a/docs/components/internchatsteeredresponse.mdx +++ /dev/null @@ -1,13 +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. - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `session_id` | *str* | ✅ | The session of the running turn the message was delivered to. | sess_01j9x0k4q7v8r2t3m6n5p8w9y1 | -| `status` | [components.InternChatSteeredResponseStatus](../components/internchatsteeredresponsestatus.mdx) | ✅ | The message was handed to the turn already running on this session. | | \ No newline at end of file diff --git a/docs/components/internchatsteeredresponsestatus.mdx b/docs/components/internchatsteeredresponsestatus.mdx deleted file mode 100644 index 1ac306e6..00000000 --- a/docs/components/internchatsteeredresponsestatus.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: "InternChatSteeredResponseStatus" ---- - -The message was handed to the turn already running on this session. - -## Example Usage - -```python -from openrouter.components import InternChatSteeredResponseStatus -value: InternChatSteeredResponseStatus = "steered" -``` - - -## Values - -- `"steered"` diff --git a/docs/components/internchatstreamerror.mdx b/docs/components/internchatstreamerror.mdx deleted file mode 100644 index f6abede1..00000000 --- a/docs/components/internchatstreamerror.mdx +++ /dev/null @@ -1,14 +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. - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `code` | *int* | ✅ | The HTTP status this failure would have had before the stream opened. | | -| `message` | *str* | ✅ | N/A | | -| `metadata` | [components.InternChatErrorMetadata](../components/internchaterrormetadata.mdx) | ✅ | Machine-readable detail for the failure. | \{
"reason": "interaction_not_pending",
"retryable": false
} | \ No newline at end of file diff --git a/docs/components/internchatstreamingresponse.mdx b/docs/components/internchatstreamingresponse.mdx deleted file mode 100644 index 496aa77f..00000000 --- a/docs/components/internchatstreamingresponse.mdx +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "InternChatStreamingResponse" ---- - -A server-sent event carrying one chunk. The stream ends with `data: [DONE]`. - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [components.InternChatCompletionChunk](../components/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/components/internchatsystemmessage.mdx b/docs/components/internchatsystemmessage.mdx deleted file mode 100644 index 7c5aa907..00000000 --- a/docs/components/internchatsystemmessage.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "InternChatSystemMessage" ---- - -A system message. Accepted for client compatibility and not forwarded. - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content` | [Nullable[components.InternChatMessageContent]](../components/internchatmessagecontent.mdx) | ✅ | 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` | [components.InternChatSystemMessageRole](../components/internchatsystemmessagerole.mdx) | ✅ | N/A | | \ No newline at end of file diff --git a/docs/components/internchatsystemmessagerole.mdx b/docs/components/internchatsystemmessagerole.mdx deleted file mode 100644 index 0a20d5dd..00000000 --- a/docs/components/internchatsystemmessagerole.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "InternChatSystemMessageRole" ---- - -## Example Usage - -```python -from openrouter.components import InternChatSystemMessageRole -value: InternChatSystemMessageRole = "system" -``` - - -## Values - -- `"system"` diff --git a/docs/components/internchattextpart.mdx b/docs/components/internchattextpart.mdx deleted file mode 100644 index 23980940..00000000 --- a/docs/components/internchattextpart.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "InternChatTextPart" ---- - -One text part of a message. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `text` | *str* | ✅ | N/A | -| `type` | [components.InternChatTextPartType](../components/internchattextparttype.mdx) | ✅ | N/A | \ No newline at end of file diff --git a/docs/components/internchattextparttype.mdx b/docs/components/internchattextparttype.mdx deleted file mode 100644 index 9807a99c..00000000 --- a/docs/components/internchattextparttype.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "InternChatTextPartType" ---- - -## Example Usage - -```python -from openrouter.components import InternChatTextPartType -value: InternChatTextPartType = "text" -``` - - -## Values - -- `"text"` diff --git a/docs/components/internchattoolcall.mdx b/docs/components/internchattoolcall.mdx deleted file mode 100644 index 082d06ac..00000000 --- a/docs/components/internchattoolcall.mdx +++ /dev/null @@ -1,15 +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. - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `function` | [components.InternChatToolCallFunction](../components/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` | *str* | ✅ | The interaction id. Send it back as `tool_call_id` on the `tool` message that answers it. | 15e90ad6-5320-4a59-af4f-b371428154fa | -| `index` | *int* | ✅ | N/A | | -| `type` | [components.InternChatToolCallType](../components/internchattoolcalltype.mdx) | ✅ | N/A | | \ No newline at end of file diff --git a/docs/components/internchattoolcallfunction.mdx b/docs/components/internchattoolcallfunction.mdx deleted file mode 100644 index fd934b30..00000000 --- a/docs/components/internchattoolcallfunction.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "InternChatToolCallFunction" ---- - -The single tool this endpoint calls, asking the caller for input. - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `arguments` | *str* | ✅ | 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` | [components.InternChatToolCallFunctionName](../components/internchattoolcallfunctionname.mdx) | ✅ | N/A | | \ No newline at end of file diff --git a/docs/components/internchattoolcallfunctionname.mdx b/docs/components/internchattoolcallfunctionname.mdx deleted file mode 100644 index 15d42c44..00000000 --- a/docs/components/internchattoolcallfunctionname.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "InternChatToolCallFunctionName" ---- - -## Example Usage - -```python -from openrouter.components import InternChatToolCallFunctionName -value: InternChatToolCallFunctionName = "openrouter.provide_input" -``` - - -## Values - -- `"openrouter.provide_input"` diff --git a/docs/components/internchattoolcalltype.mdx b/docs/components/internchattoolcalltype.mdx deleted file mode 100644 index 8e1145d1..00000000 --- a/docs/components/internchattoolcalltype.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "InternChatToolCallType" ---- - -## Example Usage - -```python -from openrouter.components import InternChatToolCallType -value: InternChatToolCallType = "function" -``` - - -## Values - -- `"function"` diff --git a/docs/components/internchattoolmessage.mdx b/docs/components/internchattoolmessage.mdx deleted file mode 100644 index 6a80386b..00000000 --- a/docs/components/internchattoolmessage.mdx +++ /dev/null @@ -1,14 +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. - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content` | [Nullable[components.InternChatMessageContent]](../components/internchatmessagecontent.mdx) | ✅ | 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` | [components.InternChatToolMessageRole](../components/internchattoolmessagerole.mdx) | ✅ | N/A | | -| `tool_call_id` | *str* | ✅ | N/A | | \ No newline at end of file diff --git a/docs/components/internchattoolmessagerole.mdx b/docs/components/internchattoolmessagerole.mdx deleted file mode 100644 index 8f338c95..00000000 --- a/docs/components/internchattoolmessagerole.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "InternChatToolMessageRole" ---- - -## Example Usage - -```python -from openrouter.components import InternChatToolMessageRole -value: InternChatToolMessageRole = "tool" -``` - - -## Values - -- `"tool"` diff --git a/docs/components/internchatusage.mdx b/docs/components/internchatusage.mdx deleted file mode 100644 index 7d4ea67d..00000000 --- a/docs/components/internchatusage.mdx +++ /dev/null @@ -1,16 +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. - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `completion_tokens` | *int* | ✅ | N/A | | -| `cost` | *Optional[float]* | ➖ | The cost of the run in USD, when the daemon reported one. | | -| `prompt_tokens` | *int* | ✅ | N/A | | -| `prompt_tokens_details` | [Optional[components.InternChatPromptTokensDetails]](../components/internchatprompttokensdetails.mdx) | ➖ | Prompt tokens served from cache, when the daemon reported them. | \{
"cached_tokens": 1024
} | -| `total_tokens` | *int* | ✅ | N/A | | \ No newline at end of file diff --git a/docs/components/internchatusermessage.mdx b/docs/components/internchatusermessage.mdx deleted file mode 100644 index 22469972..00000000 --- a/docs/components/internchatusermessage.mdx +++ /dev/null @@ -1,13 +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. - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content` | [Nullable[components.InternChatMessageContent]](../components/internchatmessagecontent.mdx) | ✅ | 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` | [components.InternChatUserMessageRole](../components/internchatusermessagerole.mdx) | ✅ | N/A | | \ No newline at end of file diff --git a/docs/components/internchatusermessagerole.mdx b/docs/components/internchatusermessagerole.mdx deleted file mode 100644 index 4a98d724..00000000 --- a/docs/components/internchatusermessagerole.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "InternChatUserMessageRole" ---- - -## Example Usage - -```python -from openrouter.components import InternChatUserMessageRole -value: InternChatUserMessageRole = "user" -``` - - -## Values - -- `"user"` diff --git a/docs/components/internconnection.mdx b/docs/components/internconnection.mdx deleted file mode 100644 index d4bb1d99..00000000 --- a/docs/components/internconnection.mdx +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "InternConnection" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `account` | [components.Account](../components/account.mdx) | ✅ | N/A | -| `id` | *str* | ✅ | Stable id: the credential id of an MCP server, else the kind (`slack`, `github`, `google`). | -| `is_enabled` | *bool* | ✅ | Whether the intern reaches it now. | -| `is_intern_only` | *bool* | ✅ | Scoped to this intern rather than shared by the workspace. | -| `kind` | [components.Kind](../components/kind.mdx) | ✅ | N/A | -| `mcp_server_name` | *Nullable[str]* | ✅ | The name the intern's MCP config keys the server by; null when it is not an MCP server or is off. | -| `name` | *str* | ✅ | Display name. | -| `off_reason` | [Nullable[components.OffReason]](../components/offreason.mdx) | ✅ | `switched_off` for this intern, `disabled` for the whole workspace; null while on. | -| `server` | [Nullable[components.Server]](../components/server.mdx) | ✅ | N/A | -| `status` | [components.InternConnectionStatus](../components/internconnectionstatus.mdx) | ✅ | N/A | -| `tool_count` | *Nullable[int]* | ✅ | Tools found by the last successful test. | \ No newline at end of file diff --git a/docs/components/internconnectionlist.mdx b/docs/components/internconnectionlist.mdx deleted file mode 100644 index bff09910..00000000 --- a/docs/components/internconnectionlist.mdx +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: "InternConnectionList" ---- - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `data` | List[[components.InternConnection](../components/internconnection.mdx)] | ✅ | N/A | \ No newline at end of file diff --git a/docs/components/internconnectionscope.mdx b/docs/components/internconnectionscope.mdx deleted file mode 100644 index a543fdc8..00000000 --- a/docs/components/internconnectionscope.mdx +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: "InternConnectionScope" ---- - -`workspace` for a shared connection, `yours` for the key user's personal account, `shared` for a teammate's. - -## Example Usage - -```python -from openrouter.components import InternConnectionScope - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: InternConnectionScope = "workspace" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"workspace"` -- `"yours"` -- `"shared"` diff --git a/docs/components/internconnectionstatus.mdx b/docs/components/internconnectionstatus.mdx deleted file mode 100644 index 55c5eeaf..00000000 --- a/docs/components/internconnectionstatus.mdx +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "InternConnectionStatus" ---- - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -| `reason` | *Nullable[str]* | ✅ | N/A | -| `state` | [components.StateEnum](../components/stateenum.mdx) | ✅ | N/A | \ No newline at end of file diff --git a/docs/components/interndaemonaccess.mdx b/docs/components/interndaemonaccess.mdx deleted file mode 100644 index 77b00098..00000000 --- a/docs/components/interndaemonaccess.mdx +++ /dev/null @@ -1,14 +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. - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| `origin` | *str* | ✅ | N/A | -| `token` | *str* | ✅ | N/A | -| `viewer` | [components.Viewer](../components/viewer.mdx) | ✅ | N/A | \ No newline at end of file diff --git a/docs/components/interninvokeacceptedresponse.mdx b/docs/components/interninvokeacceptedresponse.mdx deleted file mode 100644 index cf0a574a..00000000 --- a/docs/components/interninvokeacceptedresponse.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "InternInvokeAcceptedResponse" ---- - -The intern admitted the prompt. The run continues on the intern. - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -| `session_id` | *str* | ✅ | The session the run belongs to. Send it back to continue the conversation. | b51a0e21-368b-4780-a220-14655bf28c55 | -| `status` | [components.InternInvokeAcceptedResponseStatus](../components/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/components/interninvokeacceptedresponsestatus.mdx b/docs/components/interninvokeacceptedresponsestatus.mdx deleted file mode 100644 index ac3cd774..00000000 --- a/docs/components/interninvokeacceptedresponsestatus.mdx +++ /dev/null @@ -1,22 +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 - -```python -from openrouter.components import InternInvokeAcceptedResponseStatus - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: InternInvokeAcceptedResponseStatus = "started" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"started"` -- `"steered"` diff --git a/docs/components/interninvokerequest.mdx b/docs/components/interninvokerequest.mdx deleted file mode 100644 index 8f1fdf4a..00000000 --- a/docs/components/interninvokerequest.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "InternInvokeRequest" ---- - -A prompt to run on the intern without holding a connection open. - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `input` | *str* | ✅ | The prompt for the run, at most 32000 characters. | New support ticket 48213. Case token: ct_9f2c. Investigate and reply. | -| `session_id` | *Optional[str]* | ➖ | 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/components/internlifecycleerrorerror.mdx b/docs/components/internlifecycleerrorerror.mdx deleted file mode 100644 index f4cfd7cb..00000000 --- a/docs/components/internlifecycleerrorerror.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "InternLifecycleErrorError" ---- - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `code` | [components.Code](../components/code.mdx) | ✅ | N/A | -| `message` | *str* | ✅ | N/A | -| `metadata` | [Optional[components.InternLifecycleErrorMetadata]](../components/internlifecycleerrormetadata.mdx) | ➖ | N/A | \ No newline at end of file diff --git a/docs/components/internlifecycleerrormetadata.mdx b/docs/components/internlifecycleerrormetadata.mdx deleted file mode 100644 index e699b3cd..00000000 --- a/docs/components/internlifecycleerrormetadata.mdx +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "InternLifecycleErrorMetadata" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `reason` | *str* | ✅ | N/A | -| `retryable` | *bool* | ✅ | N/A | \ No newline at end of file diff --git a/docs/components/internlistresponse.mdx b/docs/components/internlistresponse.mdx deleted file mode 100644 index ad1d23db..00000000 --- a/docs/components/internlistresponse.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: "InternListResponse" ---- - -Interns visible to the authenticated API key. - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `data` | List[[components.Intern](../components/intern.mdx)] | ✅ | N/A | | -| `has_more` | *bool* | ✅ | True when more interns match the current filters. | | -| `next_cursor` | *Optional[str]* | ➖ | 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/components/internstatus.mdx b/docs/components/internstatus.mdx deleted file mode 100644 index b0753ab0..00000000 --- a/docs/components/internstatus.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: "InternStatus" ---- - -Lifecycle status. - -## Example Usage - -```python -from openrouter.components import InternStatus - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: InternStatus = "awaiting_slack_install" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"awaiting_slack_install"` -- `"queued"` -- `"provisioning"` -- `"running"` -- `"failed"` -- `"stopped"` -- `"destroying"` -- `"destroy_failed"` diff --git a/docs/components/kind.mdx b/docs/components/kind.mdx deleted file mode 100644 index 8b7b3b9c..00000000 --- a/docs/components/kind.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: "Kind" ---- - -## Example Usage - -```python -from openrouter.components import Kind - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: Kind = "slack" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"slack"` -- `"github"` -- `"google"` -- `"mcp"` diff --git a/docs/components/offreason.mdx b/docs/components/offreason.mdx deleted file mode 100644 index 1b7bd4fb..00000000 --- a/docs/components/offreason.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: "OffReason" ---- - -`switched_off` for this intern, `disabled` for the whole workspace; null while on. - -## Example Usage - -```python -from openrouter.components import OffReason - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: OffReason = "switched_off" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"switched_off"` -- `"disabled"` diff --git a/docs/components/progress.mdx b/docs/components/progress.mdx deleted file mode 100644 index bf32f73e..00000000 --- a/docs/components/progress.mdx +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: "Progress" ---- - -Active provisioning step, or null once provisioning has settled. - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `step_label` | *str* | ✅ | Human-readable label of the active provisioning step. | -| `step_number` | *int* | ✅ | One-based index of the active step. | -| `total_steps` | *int* | ✅ | Number of provisioning steps. | \ No newline at end of file diff --git a/docs/components/provisioninternresponse.mdx b/docs/components/provisioninternresponse.mdx deleted file mode 100644 index 18f80f08..00000000 --- a/docs/components/provisioninternresponse.mdx +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: "ProvisionInternResponse" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `provisioning` | *Literal[True]* | ✅ | N/A | \ No newline at end of file diff --git a/docs/components/route.mdx b/docs/components/route.mdx deleted file mode 100644 index 5ae3ea59..00000000 --- a/docs/components/route.mdx +++ /dev/null @@ -1,13 +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`). - - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -| `method` | [components.SignInternDaemonRequestMethod](../components/signinterndaemonrequestmethod.mdx) | ✅ | The HTTP method of the daemon request. | | -| `path` | *str* | ✅ | 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/components/server.mdx b/docs/components/server.mdx deleted file mode 100644 index 494756bc..00000000 --- a/docs/components/server.mdx +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "Server" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `host` | *Nullable[str]* | ✅ | N/A | -| `surface` | *str* | ✅ | N/A | -| `transport` | *str* | ✅ | N/A | -| `url` | *Nullable[str]* | ✅ | N/A | \ No newline at end of file diff --git a/docs/components/signinterndaemonrequest.mdx b/docs/components/signinterndaemonrequest.mdx deleted file mode 100644 index 9e139834..00000000 --- a/docs/components/signinterndaemonrequest.mdx +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "SignInternDaemonRequest" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `body_sha256` | *str* | ✅ | Lower-case hex SHA-256 of the exact bytes the CLI will send as the daemon request body. | e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 | -| `route` | [Optional[components.Route]](../components/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/components/signinterndaemonrequestmethod.mdx b/docs/components/signinterndaemonrequestmethod.mdx deleted file mode 100644 index 3f4ae742..00000000 --- a/docs/components/signinterndaemonrequestmethod.mdx +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: "SignInternDaemonRequestMethod" ---- - -The HTTP method of the daemon request. - -## Example Usage - -```python -from openrouter.components import SignInternDaemonRequestMethod -value: SignInternDaemonRequestMethod = "POST" -``` - - -## Values - -- `"POST"` diff --git a/docs/components/signinterndaemonresponse.mdx b/docs/components/signinterndaemonresponse.mdx deleted file mode 100644 index 3b1cad78..00000000 --- a/docs/components/signinterndaemonresponse.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: "SignInternDaemonResponse" ---- - -Headers the CLI copies onto the daemon request so the sidecar can verify who is asking. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `x_ori_invoke_nonce` | *Optional[str]* | ➖ | Present with `x-ori-invoke-signature-v2`: the single-use id that proof is bound to. | -| `x_ori_invoke_signature` | *str* | ✅ | Base64 Ed25519 signature over the intern id, timestamp, user and body digest. | -| `x_ori_invoke_signature_v2` | *Optional[str]* | ➖ | 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. | -| `x_ori_invoke_timestamp` | *str* | ✅ | Unix seconds at signing; the daemon refuses proofs older than its window. | -| `x_ori_invoke_user` | *str* | ✅ | The verified OAuth subject the proof names. Never taken from the request. | \ No newline at end of file diff --git a/docs/components/stateenum.mdx b/docs/components/stateenum.mdx deleted file mode 100644 index 761a1ccc..00000000 --- a/docs/components/stateenum.mdx +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: "StateEnum" ---- - -## Example Usage - -```python -from openrouter.components import StateEnum - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: StateEnum = "connected" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"connected"` -- `"needs_reconnect"` -- `"not_tested"` -- `"error"` diff --git a/docs/components/suspendinternresponse.mdx b/docs/components/suspendinternresponse.mdx deleted file mode 100644 index 8af1f9d2..00000000 --- a/docs/components/suspendinternresponse.mdx +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: "SuspendInternResponse" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `suspended` | *Literal[True]* | ✅ | N/A | \ No newline at end of file diff --git a/docs/components/updateinternrequest.mdx b/docs/components/updateinternrequest.mdx deleted file mode 100644 index 423c2504..00000000 --- a/docs/components/updateinternrequest.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "UpdateInternRequest" ---- - -Lifecycle settings to change. Omitted fields stay unchanged and null clears a field. - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `description` | *OptionalNullable[str]* | ➖ | New free-form description. Null clears it. | -| `instructions` | *OptionalNullable[str]* | ➖ | New standing instructions. Null clears them. | -| `model` | *OptionalNullable[str]* | ➖ | New OpenRouter model slug in `author/slug` form (an optional `:variant` suffix is accepted). Other shapes are refused with 400. Null restores the workspace default. Takes effect on the next provision: until then `GET` shows this configured model while chat chunks show the model the running intern reports. | -| `name` | *Optional[str]* | ➖ | New intern name, unique per creator within the workspace. | \ No newline at end of file diff --git a/docs/components/viewer.mdx b/docs/components/viewer.mdx deleted file mode 100644 index a01f7d05..00000000 --- a/docs/components/viewer.mdx +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: "Viewer" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `principals` | List[*str*] | ✅ | 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/docs.json b/docs/docs.json index 59526025..99d58bf4 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -29,7 +29,6 @@ "sdks/generations/README", "sdks/guardrails/README", "sdks/images/README", - "sdks/interns/README", "sdks/models/README", "sdks/oauth/README", "sdks/observability/README", diff --git a/docs/errors/internchaterrorresponse.mdx b/docs/errors/internchaterrorresponse.mdx deleted file mode 100644 index 876c46af..00000000 --- a/docs/errors/internchaterrorresponse.mdx +++ /dev/null @@ -1,12 +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. - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `error` | [components.InternChatError](../components/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/errors/internlifecycleerror.mdx b/docs/errors/internlifecycleerror.mdx deleted file mode 100644 index 0cdbfafe..00000000 --- a/docs/errors/internlifecycleerror.mdx +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "InternLifecycleError" ---- - -Intern lifecycle request failure. - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `error` | [components.InternLifecycleErrorError](../components/internlifecycleerrorerror.mdx) | ✅ | N/A | \ No newline at end of file diff --git a/docs/operations/createinternchatcompletionglobals.mdx b/docs/operations/createinternchatcompletionglobals.mdx deleted file mode 100644 index 1c824840..00000000 --- a/docs/operations/createinternchatcompletionglobals.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "CreateInternChatCompletionGlobals" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `x_open_router_categories` | *Optional[str]* | ➖ | 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/operations/createinternchatcompletionrequest.mdx b/docs/operations/createinternchatcompletionrequest.mdx deleted file mode 100644 index bad5ae9c..00000000 --- a/docs/operations/createinternchatcompletionrequest.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "CreateInternChatCompletionRequest" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `intern_id` | *str* | ✅ | The intern to talk to. | a11e0000-0000-4000-8000-000000000005 | -| `intern_chat_completion_request` | [components.InternChatCompletionRequest](../components/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/operations/createinternchatcompletionresponse.mdx b/docs/operations/createinternchatcompletionresponse.mdx deleted file mode 100644 index 591187f2..00000000 --- a/docs/operations/createinternchatcompletionresponse.mdx +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "CreateInternChatCompletionResponse" ---- - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| `headers` | Dict[str, List[*str*]] | ✅ | N/A | -| `result` | [operations.CreateInternChatCompletionResponseResult](../operations/createinternchatcompletionresponseresult.mdx) | ✅ | N/A | \ No newline at end of file diff --git a/docs/operations/createinternchatcompletionresponseresult.mdx b/docs/operations/createinternchatcompletionresponseresult.mdx deleted file mode 100644 index b91c4809..00000000 --- a/docs/operations/createinternchatcompletionresponseresult.mdx +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "CreateInternChatCompletionResponseResult" ---- - -## Supported Types - -### `Union[eventstreaming.EventStream[components.InternChatCompletionChunk], eventstreaming.EventStreamAsync[components.InternChatCompletionChunk]]` - -```python -value: Union[eventstreaming.EventStream[components.InternChatCompletionChunk], eventstreaming.EventStreamAsync[components.InternChatCompletionChunk]] = /* values here */ -``` - -### `components.InternChatCompletionChunk` - -```python -value: components.InternChatCompletionChunk = /* values here */ -``` - -### `components.InternChatSteeredResponse` - -```python -value: components.InternChatSteeredResponse = /* values here */ -``` - diff --git a/docs/operations/createinternglobals.mdx b/docs/operations/createinternglobals.mdx deleted file mode 100644 index f9f61416..00000000 --- a/docs/operations/createinternglobals.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "CreateInternGlobals" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `x_open_router_categories` | *Optional[str]* | ➖ | 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/operations/createinternrequest.mdx b/docs/operations/createinternrequest.mdx deleted file mode 100644 index 131f791d..00000000 --- a/docs/operations/createinternrequest.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "CreateInternRequest" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `idempotency_key` | *Optional[str]* | ➖ | 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 | -| `create_intern_request` | [components.CreateInternRequest](../components/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/operations/deleteinternglobals.mdx b/docs/operations/deleteinternglobals.mdx deleted file mode 100644 index 52a4af8e..00000000 --- a/docs/operations/deleteinternglobals.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "DeleteInternGlobals" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `x_open_router_categories` | *Optional[str]* | ➖ | 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/operations/deleteinternrequest.mdx b/docs/operations/deleteinternrequest.mdx deleted file mode 100644 index c4980d4d..00000000 --- a/docs/operations/deleteinternrequest.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "DeleteInternRequest" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `intern_id` | *str* | ✅ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | -| `delete_intern_request` | [components.DeleteInternRequest](../components/deleteinternrequest.mdx) | ✅ | N/A | \{
"acknowledge_workspace_loss": true
} | \ No newline at end of file diff --git a/docs/operations/getinternconnectionsglobals.mdx b/docs/operations/getinternconnectionsglobals.mdx deleted file mode 100644 index 0c10e0f8..00000000 --- a/docs/operations/getinternconnectionsglobals.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "GetInternConnectionsGlobals" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `x_open_router_categories` | *Optional[str]* | ➖ | 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/operations/getinternconnectionsrequest.mdx b/docs/operations/getinternconnectionsrequest.mdx deleted file mode 100644 index c9609f36..00000000 --- a/docs/operations/getinternconnectionsrequest.mdx +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "GetInternConnectionsRequest" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `intern_id` | *str* | ✅ | 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/operations/getinterndaemonaccessglobals.mdx b/docs/operations/getinterndaemonaccessglobals.mdx deleted file mode 100644 index d2699894..00000000 --- a/docs/operations/getinterndaemonaccessglobals.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "GetInternDaemonAccessGlobals" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `x_open_router_categories` | *Optional[str]* | ➖ | 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/operations/getinterndaemonaccessrequest.mdx b/docs/operations/getinterndaemonaccessrequest.mdx deleted file mode 100644 index 169fa767..00000000 --- a/docs/operations/getinterndaemonaccessrequest.mdx +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "GetInternDaemonAccessRequest" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `intern_id` | *str* | ✅ | 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/operations/getinterndaemonglobals.mdx b/docs/operations/getinterndaemonglobals.mdx deleted file mode 100644 index 5cb15c10..00000000 --- a/docs/operations/getinterndaemonglobals.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "GetInternDaemonGlobals" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `x_open_router_categories` | *Optional[str]* | ➖ | 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/operations/getinterndaemonrequest.mdx b/docs/operations/getinterndaemonrequest.mdx deleted file mode 100644 index b2189720..00000000 --- a/docs/operations/getinterndaemonrequest.mdx +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "GetInternDaemonRequest" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `intern_id` | *str* | ✅ | 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/operations/getinternglobals.mdx b/docs/operations/getinternglobals.mdx deleted file mode 100644 index a524a18a..00000000 --- a/docs/operations/getinternglobals.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "GetInternGlobals" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `x_open_router_categories` | *Optional[str]* | ➖ | 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/operations/getinterniconglobals.mdx b/docs/operations/getinterniconglobals.mdx deleted file mode 100644 index 8dcdd830..00000000 --- a/docs/operations/getinterniconglobals.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "GetInternIconGlobals" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `x_open_router_categories` | *Optional[str]* | ➖ | 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/operations/getinterniconrequest.mdx b/docs/operations/getinterniconrequest.mdx deleted file mode 100644 index 0ea24cbe..00000000 --- a/docs/operations/getinterniconrequest.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "GetInternIconRequest" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `intern_id` | *str* | ✅ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | -| `v` | *Optional[str]* | ➖ | The `icon_sha256` the caller expects. | | \ No newline at end of file diff --git a/docs/operations/getinternrequest.mdx b/docs/operations/getinternrequest.mdx deleted file mode 100644 index 3b516a3b..00000000 --- a/docs/operations/getinternrequest.mdx +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "GetInternRequest" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `intern_id` | *str* | ✅ | 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/operations/invokeinternglobals.mdx b/docs/operations/invokeinternglobals.mdx deleted file mode 100644 index 473ed152..00000000 --- a/docs/operations/invokeinternglobals.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "InvokeInternGlobals" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `x_open_router_categories` | *Optional[str]* | ➖ | 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/operations/invokeinternrequest.mdx b/docs/operations/invokeinternrequest.mdx deleted file mode 100644 index 84ec62f0..00000000 --- a/docs/operations/invokeinternrequest.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "InvokeInternRequest" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `intern_id` | *str* | ✅ | The intern to run. | a11e0000-0000-4000-8000-000000000005 | -| `intern_invoke_request` | [components.InternInvokeRequest](../components/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/operations/invokeinternresponse.mdx b/docs/operations/invokeinternresponse.mdx deleted file mode 100644 index 23145f5e..00000000 --- a/docs/operations/invokeinternresponse.mdx +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "InvokeInternResponse" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `headers` | Dict[str, List[*str*]] | ✅ | N/A | | -| `result` | [components.InternInvokeAcceptedResponse](../components/interninvokeacceptedresponse.mdx) | ✅ | N/A | \{
"session_id": "b51a0e21-368b-4780-a220-14655bf28c55",
"status": "started"
} | \ No newline at end of file diff --git a/docs/operations/listinternsglobals.mdx b/docs/operations/listinternsglobals.mdx deleted file mode 100644 index 94241de6..00000000 --- a/docs/operations/listinternsglobals.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "ListInternsGlobals" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `x_open_router_categories` | *Optional[str]* | ➖ | 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/operations/listinternsrequest.mdx b/docs/operations/listinternsrequest.mdx deleted file mode 100644 index 30f90855..00000000 --- a/docs/operations/listinternsrequest.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "ListInternsRequest" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `limit` | *Optional[int]* | ➖ | Maximum number of interns to return, from 1 through 500. | 50 | -| `status` | List[[operations.Status](../operations/status.mdx)] | ➖ | Comma-separated lifecycle statuses to include, at most 8. Repeats are collapsed. | [
"queued",
"running"
] | -| `starting_after` | *Optional[str]* | ➖ | 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 | -| `workspace_id` | *Optional[str]* | ➖ | 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/operations/provisioninternglobals.mdx b/docs/operations/provisioninternglobals.mdx deleted file mode 100644 index 05197d7f..00000000 --- a/docs/operations/provisioninternglobals.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "ProvisionInternGlobals" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `x_open_router_categories` | *Optional[str]* | ➖ | 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/operations/provisioninternrequest.mdx b/docs/operations/provisioninternrequest.mdx deleted file mode 100644 index 19527e6e..00000000 --- a/docs/operations/provisioninternrequest.mdx +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "ProvisionInternRequest" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `intern_id` | *str* | ✅ | 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/operations/signinterndaemonaccessrequestglobals.mdx b/docs/operations/signinterndaemonaccessrequestglobals.mdx deleted file mode 100644 index 38e57362..00000000 --- a/docs/operations/signinterndaemonaccessrequestglobals.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "SignInternDaemonAccessRequestGlobals" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `x_open_router_categories` | *Optional[str]* | ➖ | 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/operations/signinterndaemonaccessrequestrequest.mdx b/docs/operations/signinterndaemonaccessrequestrequest.mdx deleted file mode 100644 index bad49873..00000000 --- a/docs/operations/signinterndaemonaccessrequestrequest.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "SignInternDaemonAccessRequestRequest" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `intern_id` | *str* | ✅ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | -| `sign_intern_daemon_request` | [components.SignInternDaemonRequest](../components/signinterndaemonrequest.mdx) | ✅ | N/A | | \ No newline at end of file diff --git a/docs/operations/signinterndaemonaccessrequestresponse.mdx b/docs/operations/signinterndaemonaccessrequestresponse.mdx deleted file mode 100644 index 6e1f966a..00000000 --- a/docs/operations/signinterndaemonaccessrequestresponse.mdx +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "SignInternDaemonAccessRequestResponse" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | -| `headers` | Dict[str, List[*str*]] | ✅ | N/A | | -| `result` | [components.SignInternDaemonResponse](../components/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/operations/signinterndaemonrequestglobals.mdx b/docs/operations/signinterndaemonrequestglobals.mdx deleted file mode 100644 index 4d4018db..00000000 --- a/docs/operations/signinterndaemonrequestglobals.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "SignInternDaemonRequestGlobals" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `x_open_router_categories` | *Optional[str]* | ➖ | 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/operations/signinterndaemonrequestrequest.mdx b/docs/operations/signinterndaemonrequestrequest.mdx deleted file mode 100644 index 29a5ad13..00000000 --- a/docs/operations/signinterndaemonrequestrequest.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "SignInternDaemonRequestRequest" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `intern_id` | *str* | ✅ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | -| `sign_intern_daemon_request` | [components.SignInternDaemonRequest](../components/signinterndaemonrequest.mdx) | ✅ | N/A | | \ No newline at end of file diff --git a/docs/operations/signinterndaemonrequestresponse.mdx b/docs/operations/signinterndaemonrequestresponse.mdx deleted file mode 100644 index 7d427767..00000000 --- a/docs/operations/signinterndaemonrequestresponse.mdx +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "SignInternDaemonRequestResponse" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | -| `headers` | Dict[str, List[*str*]] | ✅ | N/A | | -| `result` | [components.SignInternDaemonResponse](../components/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/operations/status.mdx b/docs/operations/status.mdx deleted file mode 100644 index afe17b53..00000000 --- a/docs/operations/status.mdx +++ /dev/null @@ -1,26 +0,0 @@ ---- -title: "Status" ---- - -## Example Usage - -```python -from openrouter.operations import Status - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: Status = "awaiting_slack_install" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"awaiting_slack_install"` -- `"queued"` -- `"provisioning"` -- `"running"` -- `"failed"` -- `"stopped"` -- `"destroying"` -- `"destroy_failed"` diff --git a/docs/operations/suspendinternglobals.mdx b/docs/operations/suspendinternglobals.mdx deleted file mode 100644 index 1d1c22fb..00000000 --- a/docs/operations/suspendinternglobals.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "SuspendInternGlobals" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `x_open_router_categories` | *Optional[str]* | ➖ | 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/operations/suspendinternrequest.mdx b/docs/operations/suspendinternrequest.mdx deleted file mode 100644 index 6bd3bcbf..00000000 --- a/docs/operations/suspendinternrequest.mdx +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "SuspendInternRequest" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `intern_id` | *str* | ✅ | 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/operations/updateinternglobals.mdx b/docs/operations/updateinternglobals.mdx deleted file mode 100644 index cb55402b..00000000 --- a/docs/operations/updateinternglobals.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "UpdateInternGlobals" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| -| `x_open_router_categories` | *Optional[str]* | ➖ | 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/operations/updateinternrequest.mdx b/docs/operations/updateinternrequest.mdx deleted file mode 100644 index 179bb1df..00000000 --- a/docs/operations/updateinternrequest.mdx +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "UpdateInternRequest" ---- - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `intern_id` | *str* | ✅ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | -| `update_intern_request` | [components.UpdateInternRequest](../components/updateinternrequest.mdx) | ✅ | N/A | \{
"description": "Researches customer questions",
"model": "openai/gpt-5.4"
} | \ 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 1573fcf3..00000000 --- a/docs/sdks/interns/README.mdx +++ /dev/null @@ -1,791 +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 - -* [list_interns](#list_interns) - List interns -* [create_intern](#create_intern) - Create an intern -* [delete_intern](#delete_intern) - Delete an intern -* [get_intern](#get_intern) - Get an intern -* [update_intern](#update_intern) - Update an intern -* [get_intern_connections](#get_intern_connections) - List an intern's connections -* [get_intern_daemon](#get_intern_daemon) - Get an intern's daemon access -* [~~get_intern_daemon_access~~](#get_intern_daemon_access) - Get an intern's daemon access (deprecated alias) ⚠️ **Deprecated** -* [~~sign_intern_daemon_access_request~~](#sign_intern_daemon_access_request) - Sign a daemon request with the caller's identity (deprecated alias) ⚠️ **Deprecated** -* [sign_intern_daemon_request](#sign_intern_daemon_request) - Sign a daemon request with the caller's identity -* [get_intern_icon](#get_intern_icon) - Get an intern's icon -* [provision_intern](#provision_intern) - Provision an intern -* [suspend_intern](#suspend_intern) - Suspend an intern -* [chat](#chat) - Stream a chat completion with an intern -* [invoke](#invoke) - Start an intern run without waiting for it - -## list_interns - -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 - -```python -from openrouter import OpenRouter -import os - - -with OpenRouter( - http_referer="", - x_open_router_title="", - x_open_router_categories="", - api_key=os.getenv("OPENROUTER_API_KEY", ""), -) as open_router: - - res = open_router.interns.list_interns() - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `limit` | *Optional[int]* | ➖ | Maximum number of interns to return, from 1 through 500. | 50 | -| `status` | List[[operations.Status](../../operations/status.mdx)] | ➖ | Comma-separated lifecycle statuses to include, at most 8. Repeats are collapsed. | [
"queued",
"running"
] | -| `starting_after` | *Optional[str]* | ➖ | 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 | -| `workspace_id` | *Optional[str]* | ➖ | Only return interns in this workspace. It must match the API key workspace. | 89f9f5b2-3f89-4eaf-83ca-5ceae149e8bb | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | - -### Response - -**[components.InternListResponse](../../components/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 | \*/\* | - -## create_intern - -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 - -```python -from openrouter import OpenRouter -import os - - -with OpenRouter( - http_referer="", - x_open_router_title="", - x_open_router_categories="", - api_key=os.getenv("OPENROUTER_API_KEY", ""), -) as open_router: - - res = open_router.interns.create_intern(name="research-assistant", provision=True, workspace_id="89f9f5b2-3f89-4eaf-83ca-5ceae149e8bb") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | *str* | ✅ | Intern name, unique per creator within the workspace. | | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `idempotency_key` | *Optional[str]* | ➖ | 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 | -| `description` | *OptionalNullable[str]* | ➖ | Free-form description, or null. | | -| `instructions` | *OptionalNullable[str]* | ➖ | Standing instructions the intern boots with, or null. | | -| `provision` | *Optional[bool]* | ➖ | Start provisioning during this create operation. Defaults to false. | | -| `vault_id` | *Optional[str]* | ➖ | Vault owned by another intern in this workspace to attach as a borrowed vault. | | -| `workspace_id` | *Optional[str]* | ➖ | Workspace that will own the intern. Defaults to the workspace the API key resolves to. When given, it must match the API key workspace. | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | - -### Response - -**[components.Intern](../../components/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 | \*/\* | - -## delete_intern - -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 - -```python -from openrouter import OpenRouter -import os - - -with OpenRouter( - http_referer="", - x_open_router_title="", - x_open_router_categories="", - api_key=os.getenv("OPENROUTER_API_KEY", ""), -) as open_router: - - res = open_router.interns.delete_intern(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", acknowledge_workspace_loss=True) - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `intern_id` | *str* | ✅ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `acknowledge_workspace_loss` | *Optional[bool]* | ➖ | Delete even though the workspace backup was not confirmed. Defaults to false, which refuses the teardown when a workspace archive is missing. | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | - -### Response - -**[components.DeleteInternResponse](../../components/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 | \*/\* | - -## get_intern - -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 - -```python -from openrouter import OpenRouter -import os - - -with OpenRouter( - http_referer="", - x_open_router_title="", - x_open_router_categories="", - api_key=os.getenv("OPENROUTER_API_KEY", ""), -) as open_router: - - res = open_router.interns.get_intern(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `intern_id` | *str* | ✅ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | - -### Response - -**[components.Intern](../../components/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 | \*/\* | - -## update_intern - -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 - -```python -from openrouter import OpenRouter -import os - - -with OpenRouter( - http_referer="", - x_open_router_title="", - x_open_router_categories="", - api_key=os.getenv("OPENROUTER_API_KEY", ""), -) as open_router: - - res = open_router.interns.update_intern(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", description="Researches customer questions", model="openai/gpt-5.4") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `intern_id` | *str* | ✅ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `description` | *OptionalNullable[str]* | ➖ | New free-form description. Null clears it. | | -| `instructions` | *OptionalNullable[str]* | ➖ | New standing instructions. Null clears them. | | -| `model` | *OptionalNullable[str]* | ➖ | New OpenRouter model slug in `author/slug` form (an optional `:variant` suffix is accepted). Other shapes are refused with 400. Null restores the workspace default. Takes effect on the next provision: until then `GET` shows this configured model while chat chunks show the model the running intern reports. | | -| `name` | *Optional[str]* | ➖ | New intern name, unique per creator within the workspace. | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | - -### Response - -**[components.Intern](../../components/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 | \*/\* | - -## get_intern_connections - -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 - -```python -from openrouter import OpenRouter -import os - - -with OpenRouter( - http_referer="", - x_open_router_title="", - x_open_router_categories="", - api_key=os.getenv("OPENROUTER_API_KEY", ""), -) as open_router: - - res = open_router.interns.get_intern_connections(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `intern_id` | *str* | ✅ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | - -### Response - -**[components.InternConnectionList](../../components/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 | \*/\* | - -## get_intern_daemon - -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 - -```python -from openrouter import OpenRouter -import os - - -with OpenRouter( - http_referer="", - x_open_router_title="", - x_open_router_categories="", - api_key=os.getenv("OPENROUTER_API_KEY", ""), -) as open_router: - - res = open_router.interns.get_intern_daemon(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `intern_id` | *str* | ✅ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | - -### Response - -**[components.InternDaemonAccess](../../components/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 | \*/\* | - -## ~~get_intern_daemon_access~~ - -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 - -```python -from openrouter import OpenRouter -import os - - -with OpenRouter( - http_referer="", - x_open_router_title="", - x_open_router_categories="", - api_key=os.getenv("OPENROUTER_API_KEY", ""), -) as open_router: - - res = open_router.interns.get_intern_daemon_access(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `intern_id` | *str* | ✅ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | - -### Response - -**[components.InternDaemonAccess](../../components/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 | \*/\* | - -## ~~sign_intern_daemon_access_request~~ - -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 - -```python -from openrouter import OpenRouter -import os - - -with OpenRouter( - http_referer="", - x_open_router_title="", - x_open_router_categories="", - api_key=os.getenv("OPENROUTER_API_KEY", ""), -) as open_router: - - res = open_router.interns.sign_intern_daemon_access_request(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", body_sha256="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `intern_id` | *str* | ✅ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | -| `body_sha256` | *str* | ✅ | Lower-case hex SHA-256 of the exact bytes the CLI will send as the daemon request body. | e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `route` | [Optional[components.Route]](../../components/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`). | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | - -### Response - -**[operations.SignInternDaemonAccessRequestResponse](../../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 | \*/\* | - -## sign_intern_daemon_request - -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 - -```python -from openrouter import OpenRouter -import os - - -with OpenRouter( - http_referer="", - x_open_router_title="", - x_open_router_categories="", - api_key=os.getenv("OPENROUTER_API_KEY", ""), -) as open_router: - - res = open_router.interns.sign_intern_daemon_request(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7", body_sha256="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `intern_id` | *str* | ✅ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | -| `body_sha256` | *str* | ✅ | Lower-case hex SHA-256 of the exact bytes the CLI will send as the daemon request body. | e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `route` | [Optional[components.Route]](../../components/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`). | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | - -### Response - -**[operations.SignInternDaemonRequestResponse](../../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 | \*/\* | - -## get_intern_icon - -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 - -```python -from openrouter import OpenRouter -import os - - -with OpenRouter( - http_referer="", - x_open_router_title="", - x_open_router_categories="", - api_key=os.getenv("OPENROUTER_API_KEY", ""), -) as open_router: - - res = open_router.interns.get_intern_icon(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `intern_id` | *str* | ✅ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `v` | *Optional[str]* | ➖ | The `icon_sha256` the caller expects. | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | - -### Response - -**[httpx.Response](../../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 | \*/\* | - -## provision_intern - -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 - -```python -from openrouter import OpenRouter -import os - - -with OpenRouter( - http_referer="", - x_open_router_title="", - x_open_router_categories="", - api_key=os.getenv("OPENROUTER_API_KEY", ""), -) as open_router: - - res = open_router.interns.provision_intern(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `intern_id` | *str* | ✅ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | - -### Response - -**[components.ProvisionInternResponse](../../components/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 | \*/\* | - -## suspend_intern - -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 - -```python -from openrouter import OpenRouter -import os - - -with OpenRouter( - http_referer="", - x_open_router_title="", - x_open_router_categories="", - api_key=os.getenv("OPENROUTER_API_KEY", ""), -) as open_router: - - res = open_router.interns.suspend_intern(intern_id="7c9e6679-7425-40de-944b-e07fc1f90ae7") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| `intern_id` | *str* | ✅ | ID of an intern visible to the authenticated API key. | 7c9e6679-7425-40de-944b-e07fc1f90ae7 | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | - -### Response - -**[components.SuspendInternResponse](../../components/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 - -```python -from openrouter import OpenRouter -import os - - -with OpenRouter( - http_referer="", - x_open_router_title="", - x_open_router_categories="", - api_key=os.getenv("OPENROUTER_API_KEY", ""), -) as open_router: - - res = open_router.interns.chat(intern_id="a11e0000-0000-4000-8000-000000000005", messages=[ - { - "content": "Summarize the open pull requests.", - "role": "user", - }, - ], approval_mode="manual") - - with res as event_stream: - for event in event_stream: - # handle event - print(event, flush=True) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `intern_id` | *str* | ✅ | The intern to talk to. | a11e0000-0000-4000-8000-000000000005 | -| `messages` | List[[components.InternChatMessage](../../components/internchatmessage.mdx)] | ✅ | The conversation. Only the last message is read. A last `user` message starts a run. A last `tool` message answers the interaction named by its `tool_call_id` and requires `session_id`. | | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `approval_mode` | [Optional[components.InternApprovalMode]](../../components/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 | -| `model` | *Optional[str]* | ➖ | Accepted for OpenAI compatibility and never used. The intern runs the model configured on it (`PATCH` the intern to change it). Streamed chunks report the runtime's identifier for that model as the intern reports it, or `openrouter/intern` on chunks whose event carries no model (before the intern reports one, and on the chunks the API emits itself: the timeout, run-ended and severed-stream error chunks, the stop chunk of a replay that ends without a terminal daemon event, and the final usage chunk after any of them). A usage chunk that follows a daemon completion event carries the model the intern reported. | openrouter/intern | -| `session_id` | *Optional[str]* | ➖ | The daemon session to continue, as returned in `session_id` on the final chunk of an earlier response. Omit it to start a new session. An id the intern has not seen before is not an error: it starts a new session under that id, so a mistyped id forks the conversation. Sessions are scoped to the intern's own daemon. Required when the last message has role `tool`. | ses_7f3c9a | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | - -### Response - -**[operations.CreateInternChatCompletionResponse](../../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 - -```python -from openrouter import OpenRouter -import os - - -with OpenRouter( - http_referer="", - x_open_router_title="", - x_open_router_categories="", - api_key=os.getenv("OPENROUTER_API_KEY", ""), -) as open_router: - - res = open_router.interns.invoke(intern_id="a11e0000-0000-4000-8000-000000000005", input="New support ticket 48213. Case token: ct_9f2c. Investigate and reply.") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `intern_id` | *str* | ✅ | The intern to run. | a11e0000-0000-4000-8000-000000000005 | -| `input` | *str* | ✅ | The prompt for the run, at most 32000 characters. | New support ticket 48213. Case token: ct_9f2c. Investigate and reply. | -| `http_referer` | *Optional[str]* | ➖ | The app identifier should be your app's URL and is used as the primary identifier for rankings.
This is used to track API usage per application.
| | -| `x_open_router_title` | *Optional[str]* | ➖ | The app display name allows you to customize how your app appears in OpenRouter's dashboard.
| | -| `x_open_router_categories` | *Optional[str]* | ➖ | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | -| `session_id` | *Optional[str]* | ➖ | 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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | ➖ | Configuration to override the default retry behavior of the client. | | - -### Response - -**[operations.InvokeInternResponse](../../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/pyproject.toml b/pyproject.toml index 17d5ed66..1ac8b59d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.79" +version = "1.3.80" description = "Official Python Client SDK for OpenRouter." authors = [{ name = "OpenRouter" },] readme = "README-PYPI.md" diff --git a/src/openrouter/_version.py b/src/openrouter/_version.py index 75859305..66b62897 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "1.3.79" +__version__: str = "1.3.80" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.3.79 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.80 2.914.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/components/__init__.py b/src/openrouter/components/__init__.py index a8b91e53..6c239942 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -1472,7 +1472,6 @@ CreateGuardrailResponse, CreateGuardrailResponseTypedDict, ) - from .createinternrequest import CreateInternRequest, CreateInternRequestTypedDict from .createobservabilitydestinationrequest import ( CreateObservabilityDestinationRequest, CreateObservabilityDestinationRequestType, @@ -1696,11 +1695,6 @@ DeleteGuardrailResponse, DeleteGuardrailResponseTypedDict, ) - from .deleteinternrequest import DeleteInternRequest, DeleteInternRequestTypedDict - from .deleteinternresponse import ( - DeleteInternResponse, - DeleteInternResponseTypedDict, - ) from .deleteobservabilitydestinationresponse import ( DeleteObservabilityDestinationResponse, DeleteObservabilityDestinationResponseTypedDict, @@ -2248,153 +2242,10 @@ InputVideoTypedDict, ) from .instructtype import InstructType - from .intern import ( - Intern, - InternStatus, - InternTypedDict, - Progress, - ProgressTypedDict, - ) from .internalserverresponseerrordata import ( InternalServerResponseErrorData, InternalServerResponseErrorDataTypedDict, ) - from .internapprovalmode import InternApprovalMode - from .internchatassistantmessage import ( - InternChatAssistantMessage, - InternChatAssistantMessageRole, - InternChatAssistantMessageTypedDict, - ) - from .internchatchoice import ( - InternChatChoice, - InternChatChoiceFinishReason, - InternChatChoiceTypedDict, - ) - from .internchatcompletionchunk import ( - InternChatCompletionChunk, - InternChatCompletionChunkObject, - InternChatCompletionChunkTypedDict, - ) - from .internchatcompletionrequest import ( - InternChatCompletionRequest, - InternChatCompletionRequestTypedDict, - ) - from .internchatdelta import ( - InternChatDelta, - InternChatDeltaRole, - InternChatDeltaTypedDict, - ) - from .internchatdevelopermessage import ( - InternChatDeveloperMessage, - InternChatDeveloperMessageRole, - InternChatDeveloperMessageTypedDict, - ) - from .internchatechoedtoolcall import ( - InternChatEchoedToolCall, - InternChatEchoedToolCallTypedDict, - ) - from .internchatechoedtoolcallfunction import ( - InternChatEchoedToolCallFunction, - InternChatEchoedToolCallFunctionTypedDict, - ) - from .internchaterror import InternChatError, InternChatErrorTypedDict - from .internchaterrormetadata import ( - InternChatErrorMetadata, - InternChatErrorMetadataReason, - InternChatErrorMetadataTypedDict, - ) - from .internchatmessage import InternChatMessage, InternChatMessageTypedDict - from .internchatmessagecontent import ( - InternChatMessageContent, - InternChatMessageContentTypedDict, - ) - from .internchatprompttokensdetails import ( - InternChatPromptTokensDetails, - InternChatPromptTokensDetailsTypedDict, - ) - from .internchatsteeredresponse import ( - InternChatSteeredResponse, - InternChatSteeredResponseStatus, - InternChatSteeredResponseTypedDict, - ) - from .internchatstreamerror import ( - InternChatStreamError, - InternChatStreamErrorTypedDict, - ) - from .internchatstreamingresponse import ( - InternChatStreamingResponse, - InternChatStreamingResponseTypedDict, - ) - from .internchatsystemmessage import ( - InternChatSystemMessage, - InternChatSystemMessageRole, - InternChatSystemMessageTypedDict, - ) - from .internchattextpart import ( - InternChatTextPart, - InternChatTextPartType, - InternChatTextPartTypedDict, - ) - from .internchattoolcall import ( - InternChatToolCall, - InternChatToolCallType, - InternChatToolCallTypedDict, - ) - from .internchattoolcallfunction import ( - InternChatToolCallFunction, - InternChatToolCallFunctionName, - InternChatToolCallFunctionTypedDict, - ) - from .internchattoolmessage import ( - InternChatToolMessage, - InternChatToolMessageRole, - InternChatToolMessageTypedDict, - ) - from .internchatusage import InternChatUsage, InternChatUsageTypedDict - from .internchatusermessage import ( - InternChatUserMessage, - InternChatUserMessageRole, - InternChatUserMessageTypedDict, - ) - from .internconnection import ( - Account, - AccountTypedDict, - InternConnection, - InternConnectionScope, - InternConnectionStatus, - InternConnectionStatusTypedDict, - InternConnectionTypedDict, - Kind, - OffReason, - Server, - ServerTypedDict, - StateEnum, - ) - from .internconnectionlist import ( - InternConnectionList, - InternConnectionListTypedDict, - ) - from .interndaemonaccess import ( - InternDaemonAccess, - InternDaemonAccessTypedDict, - Viewer, - ViewerTypedDict, - ) - from .interninvokeacceptedresponse import ( - InternInvokeAcceptedResponse, - InternInvokeAcceptedResponseStatus, - InternInvokeAcceptedResponseTypedDict, - ) - from .interninvokerequest import InternInvokeRequest, InternInvokeRequestTypedDict - from .internlifecycleerror import ( - Code, - CodeTypedDict, - InternLifecycleErrorError, - InternLifecycleErrorErrorTypedDict, - InternLifecycleErrorMetadata, - InternLifecycleErrorMetadataTypedDict, - ) - from .internlistresponse import InternListResponse, InternListResponseTypedDict from .itemreferenceitem import ( ItemReferenceItem, ItemReferenceItemType, @@ -3675,10 +3526,6 @@ ProviderSortConfig, ProviderSortConfigTypedDict, ) - from .provisioninternresponse import ( - ProvisionInternResponse, - ProvisionInternResponseTypedDict, - ) from .publicendpoint import ( Decisions, DecisionsTypedDict, @@ -3981,17 +3828,6 @@ ShellServerToolEnvironment, ShellServerToolEnvironmentTypedDict, ) - from .signinterndaemonrequest import ( - Route, - RouteTypedDict, - SignInternDaemonRequest, - SignInternDaemonRequestMethod, - SignInternDaemonRequestTypedDict, - ) - from .signinterndaemonresponse import ( - SignInternDaemonResponse, - SignInternDaemonResponseTypedDict, - ) from .speechinput import SpeechInput, SpeechInputTypedDict from .speechinputreference import ( SpeechInputReference, @@ -4138,10 +3974,6 @@ SubmitGenerationFeedbackResponseDataTypedDict, SubmitGenerationFeedbackResponseTypedDict, ) - from .suspendinternresponse import ( - SuspendInternResponse, - SuspendInternResponseTypedDict, - ) from .switchyardrouterplugin import ( Algorithm, SwitchyardRouterPlugin, @@ -4315,7 +4147,6 @@ UpdateGuardrailResponse, UpdateGuardrailResponseTypedDict, ) - from .updateinternrequest import UpdateInternRequest, UpdateInternRequestTypedDict from .updateobservabilitydestinationrequest import ( UpdateObservabilityDestinationRequest, UpdateObservabilityDestinationRequestTypedDict, @@ -4523,8 +4354,6 @@ "AABenchmarkEntryTypedDict", "APIErrorType", "APIType", - "Account", - "AccountTypedDict", "ActionEnum", "ActivityItem", "ActivityItemTypedDict", @@ -5355,7 +5184,6 @@ "ClearToolInputsTypedDict", "ClientClosedRequestResponseErrorData", "ClientClosedRequestResponseErrorDataTypedDict", - "Code", "CodeEnum", "CodeInterpreterCallCodeDeltaEvent", "CodeInterpreterCallCodeDeltaEventType", @@ -5383,7 +5211,6 @@ "CodeInterpreterLogsOutputTypedDict", "CodeInterpreterServerTool", "CodeInterpreterServerToolTypedDict", - "CodeTypedDict", "CodexLocalShellTool", "CodexLocalShellToolType", "CodexLocalShellToolTypedDict", @@ -5522,8 +5349,6 @@ "CreateGuardrailRequestTypedDict", "CreateGuardrailResponse", "CreateGuardrailResponseTypedDict", - "CreateInternRequest", - "CreateInternRequestTypedDict", "CreateObservabilityDestinationRequest", "CreateObservabilityDestinationRequestType", "CreateObservabilityDestinationRequestTypedDict", @@ -5656,10 +5481,6 @@ "DeleteBYOKKeyResponseTypedDict", "DeleteGuardrailResponse", "DeleteGuardrailResponseTypedDict", - "DeleteInternRequest", - "DeleteInternRequestTypedDict", - "DeleteInternResponse", - "DeleteInternResponseTypedDict", "DeleteObservabilityDestinationResponse", "DeleteObservabilityDestinationResponseTypedDict", "DeletePrivateEndpointResponse", @@ -6092,89 +5913,6 @@ "InputsUnion1TypedDict", "InputsUnionTypedDict", "InstructType", - "Intern", - "InternApprovalMode", - "InternChatAssistantMessage", - "InternChatAssistantMessageRole", - "InternChatAssistantMessageTypedDict", - "InternChatChoice", - "InternChatChoiceFinishReason", - "InternChatChoiceTypedDict", - "InternChatCompletionChunk", - "InternChatCompletionChunkObject", - "InternChatCompletionChunkTypedDict", - "InternChatCompletionRequest", - "InternChatCompletionRequestTypedDict", - "InternChatDelta", - "InternChatDeltaRole", - "InternChatDeltaTypedDict", - "InternChatDeveloperMessage", - "InternChatDeveloperMessageRole", - "InternChatDeveloperMessageTypedDict", - "InternChatEchoedToolCall", - "InternChatEchoedToolCallFunction", - "InternChatEchoedToolCallFunctionTypedDict", - "InternChatEchoedToolCallTypedDict", - "InternChatError", - "InternChatErrorMetadata", - "InternChatErrorMetadataReason", - "InternChatErrorMetadataTypedDict", - "InternChatErrorTypedDict", - "InternChatMessage", - "InternChatMessageContent", - "InternChatMessageContentTypedDict", - "InternChatMessageTypedDict", - "InternChatPromptTokensDetails", - "InternChatPromptTokensDetailsTypedDict", - "InternChatSteeredResponse", - "InternChatSteeredResponseStatus", - "InternChatSteeredResponseTypedDict", - "InternChatStreamError", - "InternChatStreamErrorTypedDict", - "InternChatStreamingResponse", - "InternChatStreamingResponseTypedDict", - "InternChatSystemMessage", - "InternChatSystemMessageRole", - "InternChatSystemMessageTypedDict", - "InternChatTextPart", - "InternChatTextPartType", - "InternChatTextPartTypedDict", - "InternChatToolCall", - "InternChatToolCallFunction", - "InternChatToolCallFunctionName", - "InternChatToolCallFunctionTypedDict", - "InternChatToolCallType", - "InternChatToolCallTypedDict", - "InternChatToolMessage", - "InternChatToolMessageRole", - "InternChatToolMessageTypedDict", - "InternChatUsage", - "InternChatUsageTypedDict", - "InternChatUserMessage", - "InternChatUserMessageRole", - "InternChatUserMessageTypedDict", - "InternConnection", - "InternConnectionList", - "InternConnectionListTypedDict", - "InternConnectionScope", - "InternConnectionStatus", - "InternConnectionStatusTypedDict", - "InternConnectionTypedDict", - "InternDaemonAccess", - "InternDaemonAccessTypedDict", - "InternInvokeAcceptedResponse", - "InternInvokeAcceptedResponseStatus", - "InternInvokeAcceptedResponseTypedDict", - "InternInvokeRequest", - "InternInvokeRequestTypedDict", - "InternLifecycleErrorError", - "InternLifecycleErrorErrorTypedDict", - "InternLifecycleErrorMetadata", - "InternLifecycleErrorMetadataTypedDict", - "InternListResponse", - "InternListResponseTypedDict", - "InternStatus", - "InternTypedDict", "InternalServerResponseErrorData", "InternalServerResponseErrorDataTypedDict", "IssuedTokenType", @@ -6198,7 +5936,6 @@ "KeyBudgetScope", "KeyBudgetTypedDict", "KeyTypedDict", - "Kind", "Kty", "LegacyChatContentVideo", "LegacyChatContentVideoInput", @@ -6569,7 +6306,6 @@ "ObservabilityWebhookDestinationMethod", "ObservabilityWebhookDestinationType", "ObservabilityWebhookDestinationTypedDict", - "OffReason", "OnError", "OpenAIFile", "OpenAIFileDeleted", @@ -7021,8 +6757,6 @@ "PrivateEndpointValidationResponseTypedDict", "PrivateEndpointValidationTypedDict", "Profile", - "Progress", - "ProgressTypedDict", "PromptCacheBreakpoint", "PromptCacheBreakpointMode", "PromptCacheBreakpointTypedDict", @@ -7052,8 +6786,6 @@ "ProviderSort", "ProviderSortConfig", "ProviderSortConfigTypedDict", - "ProvisionInternResponse", - "ProvisionInternResponseTypedDict", "PublicEndpoint", "PublicEndpointTypedDict", "PublicPricing", @@ -7185,8 +6917,6 @@ "ResultError", "ResultErrorTypedDict", "ResultTypedDict", - "Route", - "RouteTypedDict", "RoutedServiceTier", "RouterAttempt", "RouterAttemptTypedDict", @@ -7239,7 +6969,6 @@ "SearchSurface", "Security", "SecurityTypedDict", - "Server", "ServerTool", "ServerToolDetails", "ServerToolDetailsStatus", @@ -7266,7 +6995,6 @@ "ServerToolTypedDict", "ServerToolUseDetails", "ServerToolUseDetailsTypedDict", - "ServerTypedDict", "ServiceUnavailableResponseErrorData", "ServiceUnavailableResponseErrorDataTypedDict", "SessionCostItem", @@ -7301,11 +7029,6 @@ "ShellServerToolOpenRouterTypedDict", "ShellServerToolType", "ShellServerToolTypedDict", - "SignInternDaemonRequest", - "SignInternDaemonRequestMethod", - "SignInternDaemonRequestTypedDict", - "SignInternDaemonResponse", - "SignInternDaemonResponseTypedDict", "SoftDeny", "SoftDenyTypedDict", "SourceContent", @@ -7340,7 +7063,6 @@ "Stance", "StanceTypedDict", "State", - "StateEnum", "StateTypedDict", "StopServerToolsWhenCondition", "StopServerToolsWhenConditionTypedDict", @@ -7404,8 +7126,6 @@ "SupportedFrameImage", "SupportedResolution", "SupportedSize", - "SuspendInternResponse", - "SuspendInternResponseTypedDict", "SwitchyardRouterPlugin", "SwitchyardRouterPluginID", "SwitchyardRouterPluginTypedDict", @@ -7664,8 +7384,6 @@ "UpdateGuardrailRequestTypedDict", "UpdateGuardrailResponse", "UpdateGuardrailResponseTypedDict", - "UpdateInternRequest", - "UpdateInternRequestTypedDict", "UpdateObservabilityDestinationRequest", "UpdateObservabilityDestinationRequestTypedDict", "UpdateObservabilityDestinationResponse", @@ -7747,8 +7465,6 @@ "VideoModelsListResponseTypedDict", "VideoURL", "VideoURLTypedDict", - "Viewer", - "ViewerTypedDict", "Watch", "WebFetchEngineEnum", "WebFetchPlugin", @@ -8860,8 +8576,6 @@ "CreateGuardrailRequestTypedDict": ".createguardrailrequest", "CreateGuardrailResponse": ".createguardrailresponse", "CreateGuardrailResponseTypedDict": ".createguardrailresponse", - "CreateInternRequest": ".createinternrequest", - "CreateInternRequestTypedDict": ".createinternrequest", "CreateObservabilityDestinationRequest": ".createobservabilitydestinationrequest", "CreateObservabilityDestinationRequestType": ".createobservabilitydestinationrequest", "CreateObservabilityDestinationRequestTypedDict": ".createobservabilitydestinationrequest", @@ -9017,10 +8731,6 @@ "DeleteBYOKKeyResponseTypedDict": ".deletebyokkeyresponse", "DeleteGuardrailResponse": ".deleteguardrailresponse", "DeleteGuardrailResponseTypedDict": ".deleteguardrailresponse", - "DeleteInternRequest": ".deleteinternrequest", - "DeleteInternRequestTypedDict": ".deleteinternrequest", - "DeleteInternResponse": ".deleteinternresponse", - "DeleteInternResponseTypedDict": ".deleteinternresponse", "DeleteObservabilityDestinationResponse": ".deleteobservabilitydestinationresponse", "DeleteObservabilityDestinationResponseTypedDict": ".deleteobservabilitydestinationresponse", "DeletePrivateEndpointResponse": ".deleteprivateendpointresponse", @@ -9436,104 +9146,8 @@ "InputVideoType": ".inputvideo", "InputVideoTypedDict": ".inputvideo", "InstructType": ".instructtype", - "Intern": ".intern", - "InternStatus": ".intern", - "InternTypedDict": ".intern", - "Progress": ".intern", - "ProgressTypedDict": ".intern", "InternalServerResponseErrorData": ".internalserverresponseerrordata", "InternalServerResponseErrorDataTypedDict": ".internalserverresponseerrordata", - "InternApprovalMode": ".internapprovalmode", - "InternChatAssistantMessage": ".internchatassistantmessage", - "InternChatAssistantMessageRole": ".internchatassistantmessage", - "InternChatAssistantMessageTypedDict": ".internchatassistantmessage", - "InternChatChoice": ".internchatchoice", - "InternChatChoiceFinishReason": ".internchatchoice", - "InternChatChoiceTypedDict": ".internchatchoice", - "InternChatCompletionChunk": ".internchatcompletionchunk", - "InternChatCompletionChunkObject": ".internchatcompletionchunk", - "InternChatCompletionChunkTypedDict": ".internchatcompletionchunk", - "InternChatCompletionRequest": ".internchatcompletionrequest", - "InternChatCompletionRequestTypedDict": ".internchatcompletionrequest", - "InternChatDelta": ".internchatdelta", - "InternChatDeltaRole": ".internchatdelta", - "InternChatDeltaTypedDict": ".internchatdelta", - "InternChatDeveloperMessage": ".internchatdevelopermessage", - "InternChatDeveloperMessageRole": ".internchatdevelopermessage", - "InternChatDeveloperMessageTypedDict": ".internchatdevelopermessage", - "InternChatEchoedToolCall": ".internchatechoedtoolcall", - "InternChatEchoedToolCallTypedDict": ".internchatechoedtoolcall", - "InternChatEchoedToolCallFunction": ".internchatechoedtoolcallfunction", - "InternChatEchoedToolCallFunctionTypedDict": ".internchatechoedtoolcallfunction", - "InternChatError": ".internchaterror", - "InternChatErrorTypedDict": ".internchaterror", - "InternChatErrorMetadata": ".internchaterrormetadata", - "InternChatErrorMetadataReason": ".internchaterrormetadata", - "InternChatErrorMetadataTypedDict": ".internchaterrormetadata", - "InternChatMessage": ".internchatmessage", - "InternChatMessageTypedDict": ".internchatmessage", - "InternChatMessageContent": ".internchatmessagecontent", - "InternChatMessageContentTypedDict": ".internchatmessagecontent", - "InternChatPromptTokensDetails": ".internchatprompttokensdetails", - "InternChatPromptTokensDetailsTypedDict": ".internchatprompttokensdetails", - "InternChatSteeredResponse": ".internchatsteeredresponse", - "InternChatSteeredResponseStatus": ".internchatsteeredresponse", - "InternChatSteeredResponseTypedDict": ".internchatsteeredresponse", - "InternChatStreamError": ".internchatstreamerror", - "InternChatStreamErrorTypedDict": ".internchatstreamerror", - "InternChatStreamingResponse": ".internchatstreamingresponse", - "InternChatStreamingResponseTypedDict": ".internchatstreamingresponse", - "InternChatSystemMessage": ".internchatsystemmessage", - "InternChatSystemMessageRole": ".internchatsystemmessage", - "InternChatSystemMessageTypedDict": ".internchatsystemmessage", - "InternChatTextPart": ".internchattextpart", - "InternChatTextPartType": ".internchattextpart", - "InternChatTextPartTypedDict": ".internchattextpart", - "InternChatToolCall": ".internchattoolcall", - "InternChatToolCallType": ".internchattoolcall", - "InternChatToolCallTypedDict": ".internchattoolcall", - "InternChatToolCallFunction": ".internchattoolcallfunction", - "InternChatToolCallFunctionName": ".internchattoolcallfunction", - "InternChatToolCallFunctionTypedDict": ".internchattoolcallfunction", - "InternChatToolMessage": ".internchattoolmessage", - "InternChatToolMessageRole": ".internchattoolmessage", - "InternChatToolMessageTypedDict": ".internchattoolmessage", - "InternChatUsage": ".internchatusage", - "InternChatUsageTypedDict": ".internchatusage", - "InternChatUserMessage": ".internchatusermessage", - "InternChatUserMessageRole": ".internchatusermessage", - "InternChatUserMessageTypedDict": ".internchatusermessage", - "Account": ".internconnection", - "AccountTypedDict": ".internconnection", - "InternConnection": ".internconnection", - "InternConnectionScope": ".internconnection", - "InternConnectionStatus": ".internconnection", - "InternConnectionStatusTypedDict": ".internconnection", - "InternConnectionTypedDict": ".internconnection", - "Kind": ".internconnection", - "OffReason": ".internconnection", - "Server": ".internconnection", - "ServerTypedDict": ".internconnection", - "StateEnum": ".internconnection", - "InternConnectionList": ".internconnectionlist", - "InternConnectionListTypedDict": ".internconnectionlist", - "InternDaemonAccess": ".interndaemonaccess", - "InternDaemonAccessTypedDict": ".interndaemonaccess", - "Viewer": ".interndaemonaccess", - "ViewerTypedDict": ".interndaemonaccess", - "InternInvokeAcceptedResponse": ".interninvokeacceptedresponse", - "InternInvokeAcceptedResponseStatus": ".interninvokeacceptedresponse", - "InternInvokeAcceptedResponseTypedDict": ".interninvokeacceptedresponse", - "InternInvokeRequest": ".interninvokerequest", - "InternInvokeRequestTypedDict": ".interninvokerequest", - "Code": ".internlifecycleerror", - "CodeTypedDict": ".internlifecycleerror", - "InternLifecycleErrorError": ".internlifecycleerror", - "InternLifecycleErrorErrorTypedDict": ".internlifecycleerror", - "InternLifecycleErrorMetadata": ".internlifecycleerror", - "InternLifecycleErrorMetadataTypedDict": ".internlifecycleerror", - "InternListResponse": ".internlistresponse", - "InternListResponseTypedDict": ".internlistresponse", "ItemReferenceItem": ".itemreferenceitem", "ItemReferenceItemType": ".itemreferenceitem", "ItemReferenceItemTypedDict": ".itemreferenceitem", @@ -10510,8 +10124,6 @@ "Partition": ".providersortconfig", "ProviderSortConfig": ".providersortconfig", "ProviderSortConfigTypedDict": ".providersortconfig", - "ProvisionInternResponse": ".provisioninternresponse", - "ProvisionInternResponseTypedDict": ".provisioninternresponse", "Decisions": ".publicendpoint", "DecisionsTypedDict": ".publicendpoint", "Embeddings": ".publicendpoint", @@ -10736,13 +10348,6 @@ "ShellServerToolEngine": ".shellservertoolengine", "ShellServerToolEnvironment": ".shellservertoolenvironment", "ShellServerToolEnvironmentTypedDict": ".shellservertoolenvironment", - "Route": ".signinterndaemonrequest", - "RouteTypedDict": ".signinterndaemonrequest", - "SignInternDaemonRequest": ".signinterndaemonrequest", - "SignInternDaemonRequestMethod": ".signinterndaemonrequest", - "SignInternDaemonRequestTypedDict": ".signinterndaemonrequest", - "SignInternDaemonResponse": ".signinterndaemonresponse", - "SignInternDaemonResponseTypedDict": ".signinterndaemonresponse", "SpeechInput": ".speechinput", "SpeechInputTypedDict": ".speechinput", "SpeechInputReference": ".speechinputreference", @@ -10852,8 +10457,6 @@ "SubmitGenerationFeedbackResponseData": ".submitgenerationfeedbackresponse", "SubmitGenerationFeedbackResponseDataTypedDict": ".submitgenerationfeedbackresponse", "SubmitGenerationFeedbackResponseTypedDict": ".submitgenerationfeedbackresponse", - "SuspendInternResponse": ".suspendinternresponse", - "SuspendInternResponseTypedDict": ".suspendinternresponse", "Algorithm": ".switchyardrouterplugin", "SwitchyardRouterPlugin": ".switchyardrouterplugin", "SwitchyardRouterPluginID": ".switchyardrouterplugin", @@ -10972,8 +10575,6 @@ "UpdateGuardrailRequestTypedDict": ".updateguardrailrequest", "UpdateGuardrailResponse": ".updateguardrailresponse", "UpdateGuardrailResponseTypedDict": ".updateguardrailresponse", - "UpdateInternRequest": ".updateinternrequest", - "UpdateInternRequestTypedDict": ".updateinternrequest", "UpdateObservabilityDestinationRequest": ".updateobservabilitydestinationrequest", "UpdateObservabilityDestinationRequestTypedDict": ".updateobservabilitydestinationrequest", "UpdateObservabilityDestinationResponse": ".updateobservabilitydestinationresponse", diff --git a/src/openrouter/components/createinternrequest.py b/src/openrouter/components/createinternrequest.py deleted file mode 100644 index b65a8d59..00000000 --- a/src/openrouter/components/createinternrequest.py +++ /dev/null @@ -1,79 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from pydantic import model_serializer -from typing import Optional -from typing_extensions import NotRequired, TypedDict - - -class CreateInternRequestTypedDict(TypedDict): - r"""Settings for a new intern.""" - - name: str - r"""Intern name, unique per creator within the workspace.""" - description: NotRequired[Nullable[str]] - r"""Free-form description, or null.""" - instructions: NotRequired[Nullable[str]] - r"""Standing instructions the intern boots with, or null.""" - provision: NotRequired[bool] - r"""Start provisioning during this create operation. Defaults to false.""" - vault_id: NotRequired[str] - r"""Vault owned by another intern in this workspace to attach as a borrowed vault.""" - workspace_id: NotRequired[str] - r"""Workspace that will own the intern. Defaults to the workspace the API key resolves to. When given, it must match the API key workspace.""" - - -class CreateInternRequest(BaseModel): - r"""Settings for a new intern.""" - - name: str - r"""Intern name, unique per creator within the workspace.""" - - description: OptionalNullable[str] = UNSET - r"""Free-form description, or null.""" - - instructions: OptionalNullable[str] = UNSET - r"""Standing instructions the intern boots with, or null.""" - - provision: Optional[bool] = False - r"""Start provisioning during this create operation. Defaults to false.""" - - vault_id: Optional[str] = None - r"""Vault owned by another intern in this workspace to attach as a borrowed vault.""" - - workspace_id: Optional[str] = None - r"""Workspace that will own the intern. Defaults to the workspace the API key resolves to. When given, it must match the API key workspace.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["description", "instructions", "provision", "vault_id", "workspace_id"] - ) - nullable_fields = set(["description", "instructions"]) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - is_nullable_and_explicitly_set = ( - k in nullable_fields - and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member - ) - - if val != UNSET_SENTINEL: - if ( - val is not None - or k not in optional_fields - or is_nullable_and_explicitly_set - ): - m[k] = val - - return m diff --git a/src/openrouter/components/deleteinternrequest.py b/src/openrouter/components/deleteinternrequest.py deleted file mode 100644 index 8829804d..00000000 --- a/src/openrouter/components/deleteinternrequest.py +++ /dev/null @@ -1,37 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Optional -from typing_extensions import NotRequired, TypedDict - - -class DeleteInternRequestTypedDict(TypedDict): - r"""Optional consent for a teardown that discards the workspace.""" - - acknowledge_workspace_loss: NotRequired[bool] - r"""Delete even though the workspace backup was not confirmed. Defaults to false, which refuses the teardown when a workspace archive is missing.""" - - -class DeleteInternRequest(BaseModel): - r"""Optional consent for a teardown that discards the workspace.""" - - acknowledge_workspace_loss: Optional[bool] = False - r"""Delete even though the workspace backup was not confirmed. Defaults to false, which refuses the teardown when a workspace archive is missing.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["acknowledge_workspace_loss"]) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m diff --git a/src/openrouter/components/deleteinternresponse.py b/src/openrouter/components/deleteinternresponse.py deleted file mode 100644 index 8be686f4..00000000 --- a/src/openrouter/components/deleteinternresponse.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel -from openrouter.utils import validate_const -import pydantic -from pydantic.functional_validators import AfterValidator -from typing import Literal -from typing_extensions import Annotated, TypedDict - - -class DeleteInternResponseTypedDict(TypedDict): - deleting: Literal[True] - - -class DeleteInternResponse(BaseModel): - DELETING: Annotated[ - Annotated[Literal[True], AfterValidator(validate_const(True))], - pydantic.Field(alias="deleting"), - ] = True - - -try: - DeleteInternResponse.model_rebuild() -except NameError: - pass diff --git a/src/openrouter/components/intern.py b/src/openrouter/components/intern.py deleted file mode 100644 index 33ec7928..00000000 --- a/src/openrouter/components/intern.py +++ /dev/null @@ -1,185 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, - UnrecognizedStr, -) -from pydantic import model_serializer -from typing import Literal, Optional, Union -from typing_extensions import NotRequired, TypedDict - - -class ProgressTypedDict(TypedDict): - r"""Active provisioning step, or null once provisioning has settled.""" - - step_label: str - r"""Human-readable label of the active provisioning step.""" - step_number: int - r"""One-based index of the active step.""" - total_steps: int - r"""Number of provisioning steps.""" - - -class Progress(BaseModel): - r"""Active provisioning step, or null once provisioning has settled.""" - - step_label: str - r"""Human-readable label of the active provisioning step.""" - - step_number: int - r"""One-based index of the active step.""" - - total_steps: int - r"""Number of provisioning steps.""" - - -InternStatus = Union[ - Literal[ - "awaiting_slack_install", - "queued", - "provisioning", - "running", - "failed", - "stopped", - "destroying", - "destroy_failed", - ], - UnrecognizedStr, -] -r"""Lifecycle status.""" - - -class InternTypedDict(TypedDict): - r"""Public lifecycle state and settings for one intern.""" - - attached_vault_id: Nullable[str] - r"""Vault the intern borrows from another intern, or null when it borrows none.""" - created_at: str - r"""ISO 8601 creation time.""" - description: Nullable[str] - r"""Free-form description.""" - hostname: Nullable[str] - r"""Public hostname the intern is reachable at, or null until provisioning has assigned one.""" - id: str - r"""Intern id.""" - instructions: Nullable[str] - r"""Standing instructions the intern boots with.""" - last_failure_message: Nullable[str] - r"""Why the last provisioning attempt failed, when status is failed.""" - model: Nullable[str] - r"""OpenRouter model slug the intern runs, or null for the workspace default.""" - name: str - r"""Intern name, unique per creator within a workspace.""" - progress: Nullable[ProgressTypedDict] - r"""Active provisioning step, or null once provisioning has settled.""" - status: InternStatus - r"""Lifecycle status.""" - updated_at: str - r"""ISO 8601 last update time.""" - vault_id: Nullable[str] - r"""Vault the intern owns, or null before it has been created.""" - workspace_id: str - r"""Workspace that owns the intern and scopes its secrets.""" - can_edit: NotRequired[bool] - r"""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.""" - created_by_you: NotRequired[bool] - r"""Whether the user behind the key created the intern. Present on list and retrieve; absent for organization keys, which act for no user.""" - icon_sha256: NotRequired[Nullable[str]] - r"""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`.""" - - -class Intern(BaseModel): - r"""Public lifecycle state and settings for one intern.""" - - attached_vault_id: Nullable[str] - r"""Vault the intern borrows from another intern, or null when it borrows none.""" - - created_at: str - r"""ISO 8601 creation time.""" - - description: Nullable[str] - r"""Free-form description.""" - - hostname: Nullable[str] - r"""Public hostname the intern is reachable at, or null until provisioning has assigned one.""" - - id: str - r"""Intern id.""" - - instructions: Nullable[str] - r"""Standing instructions the intern boots with.""" - - last_failure_message: Nullable[str] - r"""Why the last provisioning attempt failed, when status is failed.""" - - model: Nullable[str] - r"""OpenRouter model slug the intern runs, or null for the workspace default.""" - - name: str - r"""Intern name, unique per creator within a workspace.""" - - progress: Nullable[Progress] - r"""Active provisioning step, or null once provisioning has settled.""" - - status: InternStatus - r"""Lifecycle status.""" - - updated_at: str - r"""ISO 8601 last update time.""" - - vault_id: Nullable[str] - r"""Vault the intern owns, or null before it has been created.""" - - workspace_id: str - r"""Workspace that owns the intern and scopes its secrets.""" - - can_edit: Optional[bool] = None - r"""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.""" - - created_by_you: Optional[bool] = None - r"""Whether the user behind the key created the intern. Present on list and retrieve; absent for organization keys, which act for no user.""" - - icon_sha256: OptionalNullable[str] = UNSET - r"""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`.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["can_edit", "created_by_you", "icon_sha256"]) - nullable_fields = set( - [ - "attached_vault_id", - "description", - "hostname", - "icon_sha256", - "instructions", - "last_failure_message", - "model", - "progress", - "vault_id", - ] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - is_nullable_and_explicitly_set = ( - k in nullable_fields - and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member - ) - - if val != UNSET_SENTINEL: - if ( - val is not None - or k not in optional_fields - or is_nullable_and_explicitly_set - ): - m[k] = val - - return m diff --git a/src/openrouter/components/internapprovalmode.py b/src/openrouter/components/internapprovalmode.py deleted file mode 100644 index 988b3a73..00000000 --- a/src/openrouter/components/internapprovalmode.py +++ /dev/null @@ -1,15 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import UnrecognizedStr -from typing import Literal, Union - - -InternApprovalMode = Union[ - Literal[ - "manual", - "self-drive", - ], - UnrecognizedStr, -] -r"""How the run started by this prompt handles tool approvals. `self-drive` (the default when omitted) consents on your behalf and runs the shell unsandboxed. `manual` asks you before an approval-bearing tool runs, as an `openrouter.provide_input` permission request, and keeps the shell sandboxed until an escalation is allowed. The mode applies to the run this prompt starts and is not remembered by the session. Repeat it on each new prompt that should use it. A `tool` reply continues the run under the mode it started with.""" diff --git a/src/openrouter/components/internchatassistantmessage.py b/src/openrouter/components/internchatassistantmessage.py deleted file mode 100644 index 208a06d2..00000000 --- a/src/openrouter/components/internchatassistantmessage.py +++ /dev/null @@ -1,69 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .internchatechoedtoolcall import ( - InternChatEchoedToolCall, - InternChatEchoedToolCallTypedDict, -) -from .internchatmessagecontent import ( - InternChatMessageContent, - InternChatMessageContentTypedDict, -) -from openrouter.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from pydantic import model_serializer -from typing import List, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -InternChatAssistantMessageRole = Literal["assistant",] - - -class InternChatAssistantMessageTypedDict(TypedDict): - r"""An assistant message from an earlier response. When answering an interaction, echo the streamed `tool_calls` here before the `tool` message.""" - - role: InternChatAssistantMessageRole - content: NotRequired[Nullable[InternChatMessageContentTypedDict]] - r"""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.""" - tool_calls: NotRequired[List[InternChatEchoedToolCallTypedDict]] - - -class InternChatAssistantMessage(BaseModel): - r"""An assistant message from an earlier response. When answering an interaction, echo the streamed `tool_calls` here before the `tool` message.""" - - role: InternChatAssistantMessageRole - - content: OptionalNullable[InternChatMessageContent] = UNSET - r"""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.""" - - tool_calls: Optional[List[InternChatEchoedToolCall]] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["content", "tool_calls"]) - nullable_fields = set(["content"]) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - is_nullable_and_explicitly_set = ( - k in nullable_fields - and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member - ) - - if val != UNSET_SENTINEL: - if ( - val is not None - or k not in optional_fields - or is_nullable_and_explicitly_set - ): - m[k] = val - - return m diff --git a/src/openrouter/components/internchatchoice.py b/src/openrouter/components/internchatchoice.py deleted file mode 100644 index f3851f63..00000000 --- a/src/openrouter/components/internchatchoice.py +++ /dev/null @@ -1,55 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .internchatdelta import InternChatDelta, InternChatDeltaTypedDict -from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr -from pydantic import model_serializer -from typing import Literal, Union -from typing_extensions import TypedDict - - -InternChatChoiceFinishReason = Union[ - Literal[ - "error", - "stop", - "tool_calls", - ], - UnrecognizedStr, -] -r"""`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.""" - - -class InternChatChoiceTypedDict(TypedDict): - r"""The single choice this endpoint streams.""" - - delta: InternChatDeltaTypedDict - r"""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.""" - finish_reason: Nullable[InternChatChoiceFinishReason] - r"""`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: int - - -class InternChatChoice(BaseModel): - r"""The single choice this endpoint streams.""" - - delta: InternChatDelta - r"""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.""" - - finish_reason: Nullable[InternChatChoiceFinishReason] - r"""`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: int - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - m[k] = val - - return m diff --git a/src/openrouter/components/internchatcompletionchunk.py b/src/openrouter/components/internchatcompletionchunk.py deleted file mode 100644 index d0a3ff20..00000000 --- a/src/openrouter/components/internchatcompletionchunk.py +++ /dev/null @@ -1,89 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .internchatchoice import InternChatChoice, InternChatChoiceTypedDict -from .internchatstreamerror import InternChatStreamError, InternChatStreamErrorTypedDict -from .internchatusage import InternChatUsage, InternChatUsageTypedDict -from openrouter.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from pydantic import model_serializer -from typing import List, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -InternChatCompletionChunkObject = Literal["chat.completion.chunk",] - - -class InternChatCompletionChunkTypedDict(TypedDict): - r"""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: List[InternChatChoiceTypedDict] - r"""One choice on content, tool-call and error chunks. Empty on the final chunk that carries `session_id`.""" - created: int - id: str - r"""The completion id, constant for the whole response.""" - model: str - r"""The runtime's identifier for the model the intern is running, as the intern reports it. Each chunk carries the model from the event behind it: `openrouter/intern` on chunks emitted before the intern has reported one and on chunks the API emits itself (timeout, run-ended and severed-stream errors and their final usage chunk), even after an earlier chunk named a model. It can change within a stream. It is not an OpenRouter model slug, and the request `model` is never used.""" - object: InternChatCompletionChunkObject - error: NotRequired[InternChatStreamErrorTypedDict] - r"""A failure after the response headers were sent. The chunk that carries it has `finish_reason: \"error\"`, then the final empty-`choices` chunk and `[DONE]` follow. Reasons here are `attachment_failed`, `busy`, `client_closed_request`, `interaction_not_pending`, `interaction_unknown`, `intern_unreachable`, `run_ended`, `stream_severed`, `timeout` or `turn_failed`. `run_ended` reports an ending the intern confirmed, such as a cancellation or a deadline, while `stream_severed` reports a connection lost without that confirmation.""" - session_id: NotRequired[Nullable[str]] - r"""On the final chunk of every response, the daemon session to continue with, or `null` when the run failed before the intern reported one. Send it as `session_id` on the next request, including the `tool` reply to an interaction. Session ids are client-visible and scoped to the intern's own daemon.""" - usage: NotRequired[Nullable[InternChatUsageTypedDict]] - r"""Token usage for the run as the daemon reported it, on the final chunk before `[DONE]`. `null` when the daemon reported none, and always `null` after `tool_calls` because the turn is not over.""" - - -class InternChatCompletionChunk(BaseModel): - r"""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: List[InternChatChoice] - r"""One choice on content, tool-call and error chunks. Empty on the final chunk that carries `session_id`.""" - - created: int - - id: str - r"""The completion id, constant for the whole response.""" - - model: str - r"""The runtime's identifier for the model the intern is running, as the intern reports it. Each chunk carries the model from the event behind it: `openrouter/intern` on chunks emitted before the intern has reported one and on chunks the API emits itself (timeout, run-ended and severed-stream errors and their final usage chunk), even after an earlier chunk named a model. It can change within a stream. It is not an OpenRouter model slug, and the request `model` is never used.""" - - object: InternChatCompletionChunkObject - - error: Optional[InternChatStreamError] = None - r"""A failure after the response headers were sent. The chunk that carries it has `finish_reason: \"error\"`, then the final empty-`choices` chunk and `[DONE]` follow. Reasons here are `attachment_failed`, `busy`, `client_closed_request`, `interaction_not_pending`, `interaction_unknown`, `intern_unreachable`, `run_ended`, `stream_severed`, `timeout` or `turn_failed`. `run_ended` reports an ending the intern confirmed, such as a cancellation or a deadline, while `stream_severed` reports a connection lost without that confirmation.""" - - session_id: OptionalNullable[str] = UNSET - r"""On the final chunk of every response, the daemon session to continue with, or `null` when the run failed before the intern reported one. Send it as `session_id` on the next request, including the `tool` reply to an interaction. Session ids are client-visible and scoped to the intern's own daemon.""" - - usage: OptionalNullable[InternChatUsage] = UNSET - r"""Token usage for the run as the daemon reported it, on the final chunk before `[DONE]`. `null` when the daemon reported none, and always `null` after `tool_calls` because the turn is not over.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["error", "session_id", "usage"]) - nullable_fields = set(["session_id", "usage"]) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - is_nullable_and_explicitly_set = ( - k in nullable_fields - and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member - ) - - if val != UNSET_SENTINEL: - if ( - val is not None - or k not in optional_fields - or is_nullable_and_explicitly_set - ): - m[k] = val - - return m diff --git a/src/openrouter/components/internchatcompletionrequest.py b/src/openrouter/components/internchatcompletionrequest.py deleted file mode 100644 index a16a69d7..00000000 --- a/src/openrouter/components/internchatcompletionrequest.py +++ /dev/null @@ -1,71 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .internapprovalmode import InternApprovalMode -from .internchatmessage import InternChatMessage, InternChatMessageTypedDict -from openrouter.types import BaseModel, UNSET_SENTINEL -from openrouter.utils import validate_const -import pydantic -from pydantic import model_serializer -from pydantic.functional_validators import AfterValidator -from typing import List, Literal, Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class InternChatCompletionRequestTypedDict(TypedDict): - r"""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.""" - - messages: List[InternChatMessageTypedDict] - r"""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`.""" - approval_mode: NotRequired[InternApprovalMode] - r"""How the run started by this prompt handles tool approvals. `self-drive` (the default when omitted) consents on your behalf and runs the shell unsandboxed. `manual` asks you before an approval-bearing tool runs, as an `openrouter.provide_input` permission request, and keeps the shell sandboxed until an escalation is allowed. The mode applies to the run this prompt starts and is not remembered by the session. Repeat it on each new prompt that should use it. A `tool` reply continues the run under the mode it started with.""" - model: NotRequired[str] - r"""Accepted for OpenAI compatibility and never used. The intern runs the model configured on it (`PATCH` the intern to change it). Streamed chunks report the runtime's identifier for that model as the intern reports it, or `openrouter/intern` on chunks whose event carries no model (before the intern reports one, and on the chunks the API emits itself: the timeout, run-ended and severed-stream error chunks, the stop chunk of a replay that ends without a terminal daemon event, and the final usage chunk after any of them). A usage chunk that follows a daemon completion event carries the model the intern reported.""" - session_id: NotRequired[str] - r"""The daemon session to continue, as returned in `session_id` on the final chunk of an earlier response. Omit it to start a new session. An id the intern has not seen before is not an error: it starts a new session under that id, so a mistyped id forks the conversation. Sessions are scoped to the intern's own daemon. Required when the last message has role `tool`.""" - stream: Literal[True] - r"""Must be `true`. This endpoint only streams. `false` or an omitted `stream` is refused with `400` and reason `bad_request`.""" - - -class InternChatCompletionRequest(BaseModel): - r"""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.""" - - messages: List[InternChatMessage] - r"""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`.""" - - approval_mode: Optional[InternApprovalMode] = None - r"""How the run started by this prompt handles tool approvals. `self-drive` (the default when omitted) consents on your behalf and runs the shell unsandboxed. `manual` asks you before an approval-bearing tool runs, as an `openrouter.provide_input` permission request, and keeps the shell sandboxed until an escalation is allowed. The mode applies to the run this prompt starts and is not remembered by the session. Repeat it on each new prompt that should use it. A `tool` reply continues the run under the mode it started with.""" - - model: Optional[str] = None - r"""Accepted for OpenAI compatibility and never used. The intern runs the model configured on it (`PATCH` the intern to change it). Streamed chunks report the runtime's identifier for that model as the intern reports it, or `openrouter/intern` on chunks whose event carries no model (before the intern reports one, and on the chunks the API emits itself: the timeout, run-ended and severed-stream error chunks, the stop chunk of a replay that ends without a terminal daemon event, and the final usage chunk after any of them). A usage chunk that follows a daemon completion event carries the model the intern reported.""" - - session_id: Optional[str] = None - r"""The daemon session to continue, as returned in `session_id` on the final chunk of an earlier response. Omit it to start a new session. An id the intern has not seen before is not an error: it starts a new session under that id, so a mistyped id forks the conversation. Sessions are scoped to the intern's own daemon. Required when the last message has role `tool`.""" - - STREAM: Annotated[ - Annotated[Literal[True], AfterValidator(validate_const(True))], - pydantic.Field(alias="stream"), - ] = True - r"""Must be `true`. This endpoint only streams. `false` or an omitted `stream` is refused with `400` and reason `bad_request`.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["approval_mode", "model", "session_id"]) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -try: - InternChatCompletionRequest.model_rebuild() -except NameError: - pass diff --git a/src/openrouter/components/internchatdelta.py b/src/openrouter/components/internchatdelta.py deleted file mode 100644 index 1ce01a22..00000000 --- a/src/openrouter/components/internchatdelta.py +++ /dev/null @@ -1,48 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .internchattoolcall import InternChatToolCall, InternChatToolCallTypedDict -from openrouter.types import BaseModel, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List, Literal, Optional -from typing_extensions import NotRequired, TypedDict - - -InternChatDeltaRole = Literal["assistant",] - - -class InternChatDeltaTypedDict(TypedDict): - r"""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: NotRequired[str] - reasoning: NotRequired[str] - role: NotRequired[InternChatDeltaRole] - tool_calls: NotRequired[List[InternChatToolCallTypedDict]] - - -class InternChatDelta(BaseModel): - r"""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: Optional[str] = None - - reasoning: Optional[str] = None - - role: Optional[InternChatDeltaRole] = None - - tool_calls: Optional[List[InternChatToolCall]] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["content", "reasoning", "role", "tool_calls"]) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m diff --git a/src/openrouter/components/internchatdevelopermessage.py b/src/openrouter/components/internchatdevelopermessage.py deleted file mode 100644 index 92b3981e..00000000 --- a/src/openrouter/components/internchatdevelopermessage.py +++ /dev/null @@ -1,45 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .internchatmessagecontent import ( - InternChatMessageContent, - InternChatMessageContentTypedDict, -) -from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Literal -from typing_extensions import TypedDict - - -InternChatDeveloperMessageRole = Literal["developer",] - - -class InternChatDeveloperMessageTypedDict(TypedDict): - r"""A developer message. Accepted for client compatibility and not forwarded.""" - - content: Nullable[InternChatMessageContentTypedDict] - r"""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.""" - role: InternChatDeveloperMessageRole - - -class InternChatDeveloperMessage(BaseModel): - r"""A developer message. Accepted for client compatibility and not forwarded.""" - - content: Nullable[InternChatMessageContent] - r"""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.""" - - role: InternChatDeveloperMessageRole - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - m[k] = val - - return m diff --git a/src/openrouter/components/internchatechoedtoolcall.py b/src/openrouter/components/internchatechoedtoolcall.py deleted file mode 100644 index 36ce2369..00000000 --- a/src/openrouter/components/internchatechoedtoolcall.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .internchatechoedtoolcallfunction import ( - InternChatEchoedToolCallFunction, - InternChatEchoedToolCallFunctionTypedDict, -) -from openrouter.types import BaseModel -from typing_extensions import TypedDict - - -class InternChatEchoedToolCallTypedDict(TypedDict): - r"""The `openrouter.provide_input` tool call from the previous response, echoed back unchanged. Its `id` is the interaction the following `tool` message answers.""" - - function: InternChatEchoedToolCallFunctionTypedDict - r"""The function name and JSON arguments string exactly as streamed.""" - id: str - - -class InternChatEchoedToolCall(BaseModel): - r"""The `openrouter.provide_input` tool call from the previous response, echoed back unchanged. Its `id` is the interaction the following `tool` message answers.""" - - function: InternChatEchoedToolCallFunction - r"""The function name and JSON arguments string exactly as streamed.""" - - id: str diff --git a/src/openrouter/components/internchatechoedtoolcallfunction.py b/src/openrouter/components/internchatechoedtoolcallfunction.py deleted file mode 100644 index e3ed05c3..00000000 --- a/src/openrouter/components/internchatechoedtoolcallfunction.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel -from typing_extensions import TypedDict - - -class InternChatEchoedToolCallFunctionTypedDict(TypedDict): - r"""The function name and JSON arguments string exactly as streamed.""" - - arguments: str - name: str - - -class InternChatEchoedToolCallFunction(BaseModel): - r"""The function name and JSON arguments string exactly as streamed.""" - - arguments: str - - name: str diff --git a/src/openrouter/components/internchaterror.py b/src/openrouter/components/internchaterror.py deleted file mode 100644 index 6ddb8c0c..00000000 --- a/src/openrouter/components/internchaterror.py +++ /dev/null @@ -1,49 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .internchaterrormetadata import ( - InternChatErrorMetadata, - InternChatErrorMetadataTypedDict, -) -from openrouter.types import BaseModel, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Optional -from typing_extensions import NotRequired, TypedDict - - -class InternChatErrorTypedDict(TypedDict): - r"""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: int - r"""The HTTP status of the response.""" - message: str - metadata: NotRequired[InternChatErrorMetadataTypedDict] - r"""Machine-readable detail for the failure.""" - - -class InternChatError(BaseModel): - r"""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: int - r"""The HTTP status of the response.""" - - message: str - - metadata: Optional[InternChatErrorMetadata] = None - r"""Machine-readable detail for the failure.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["metadata"]) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m diff --git a/src/openrouter/components/internchaterrormetadata.py b/src/openrouter/components/internchaterrormetadata.py deleted file mode 100644 index 78eb3a03..00000000 --- a/src/openrouter/components/internchaterrormetadata.py +++ /dev/null @@ -1,49 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel, UnrecognizedStr -from typing import Literal, Union -from typing_extensions import TypedDict - - -InternChatErrorMetadataReason = Union[ - Literal[ - "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", - ], - UnrecognizedStr, -] -r"""A stable reason a client can branch on.""" - - -class InternChatErrorMetadataTypedDict(TypedDict): - r"""Machine-readable detail for the failure.""" - - reason: InternChatErrorMetadataReason - r"""A stable reason a client can branch on.""" - retryable: bool - r"""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.""" - - -class InternChatErrorMetadata(BaseModel): - r"""Machine-readable detail for the failure.""" - - reason: InternChatErrorMetadataReason - r"""A stable reason a client can branch on.""" - - retryable: bool - r"""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.""" diff --git a/src/openrouter/components/internchatmessage.py b/src/openrouter/components/internchatmessage.py deleted file mode 100644 index c880eb7b..00000000 --- a/src/openrouter/components/internchatmessage.py +++ /dev/null @@ -1,47 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .internchatassistantmessage import ( - InternChatAssistantMessage, - InternChatAssistantMessageTypedDict, -) -from .internchatdevelopermessage import ( - InternChatDeveloperMessage, - InternChatDeveloperMessageTypedDict, -) -from .internchatsystemmessage import ( - InternChatSystemMessage, - InternChatSystemMessageTypedDict, -) -from .internchattoolmessage import InternChatToolMessage, InternChatToolMessageTypedDict -from .internchatusermessage import InternChatUserMessage, InternChatUserMessageTypedDict -from openrouter.utils import get_discriminator -from pydantic import Discriminator, Tag -from typing import Union -from typing_extensions import Annotated, TypeAliasType - - -InternChatMessageTypedDict = TypeAliasType( - "InternChatMessageTypedDict", - Union[ - InternChatSystemMessageTypedDict, - InternChatDeveloperMessageTypedDict, - InternChatUserMessageTypedDict, - InternChatAssistantMessageTypedDict, - InternChatToolMessageTypedDict, - ], -) -r"""One OpenAI-compatible chat message, discriminated by `role`.""" - - -InternChatMessage = Annotated[ - Union[ - Annotated[InternChatAssistantMessage, Tag("assistant")], - Annotated[InternChatDeveloperMessage, Tag("developer")], - Annotated[InternChatSystemMessage, Tag("system")], - Annotated[InternChatToolMessage, Tag("tool")], - Annotated[InternChatUserMessage, Tag("user")], - ], - Discriminator(lambda m: get_discriminator(m, "role", "role")), -] -r"""One OpenAI-compatible chat message, discriminated by `role`.""" diff --git a/src/openrouter/components/internchatmessagecontent.py b/src/openrouter/components/internchatmessagecontent.py deleted file mode 100644 index 15127e20..00000000 --- a/src/openrouter/components/internchatmessagecontent.py +++ /dev/null @@ -1,18 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .internchattextpart import InternChatTextPart, InternChatTextPartTypedDict -from typing import List, Union -from typing_extensions import TypeAliasType - - -InternChatMessageContentTypedDict = TypeAliasType( - "InternChatMessageContentTypedDict", Union[str, List[InternChatTextPartTypedDict]] -) -r"""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.""" - - -InternChatMessageContent = TypeAliasType( - "InternChatMessageContent", Union[str, List[InternChatTextPart]] -) -r"""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.""" diff --git a/src/openrouter/components/internchatprompttokensdetails.py b/src/openrouter/components/internchatprompttokensdetails.py deleted file mode 100644 index 592244a0..00000000 --- a/src/openrouter/components/internchatprompttokensdetails.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel -from typing_extensions import TypedDict - - -class InternChatPromptTokensDetailsTypedDict(TypedDict): - r"""Prompt tokens served from cache, when the daemon reported them.""" - - cached_tokens: int - - -class InternChatPromptTokensDetails(BaseModel): - r"""Prompt tokens served from cache, when the daemon reported them.""" - - cached_tokens: int diff --git a/src/openrouter/components/internchatsteeredresponse.py b/src/openrouter/components/internchatsteeredresponse.py deleted file mode 100644 index 811d58ee..00000000 --- a/src/openrouter/components/internchatsteeredresponse.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel -from typing import Literal -from typing_extensions import TypedDict - - -InternChatSteeredResponseStatus = Literal["steered",] -r"""The message was handed to the turn already running on this session.""" - - -class InternChatSteeredResponseTypedDict(TypedDict): - r"""The message was delivered into the turn already running on the same session. Its effect is streamed on that turn, not here.""" - - session_id: str - r"""The session of the running turn the message was delivered to.""" - status: InternChatSteeredResponseStatus - r"""The message was handed to the turn already running on this session.""" - - -class InternChatSteeredResponse(BaseModel): - r"""The message was delivered into the turn already running on the same session. Its effect is streamed on that turn, not here.""" - - session_id: str - r"""The session of the running turn the message was delivered to.""" - - status: InternChatSteeredResponseStatus - r"""The message was handed to the turn already running on this session.""" diff --git a/src/openrouter/components/internchatstreamerror.py b/src/openrouter/components/internchatstreamerror.py deleted file mode 100644 index e862c745..00000000 --- a/src/openrouter/components/internchatstreamerror.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .internchaterrormetadata import ( - InternChatErrorMetadata, - InternChatErrorMetadataTypedDict, -) -from openrouter.types import BaseModel -from typing_extensions import TypedDict - - -class InternChatStreamErrorTypedDict(TypedDict): - r"""A failure after the response headers were sent. The chunk that carries it has `finish_reason: \"error\"`, then the final empty-`choices` chunk and `[DONE]` follow. Reasons here are `attachment_failed`, `busy`, `client_closed_request`, `interaction_not_pending`, `interaction_unknown`, `intern_unreachable`, `run_ended`, `stream_severed`, `timeout` or `turn_failed`. `run_ended` reports an ending the intern confirmed, such as a cancellation or a deadline, while `stream_severed` reports a connection lost without that confirmation.""" - - code: int - r"""The HTTP status this failure would have had before the stream opened.""" - message: str - metadata: InternChatErrorMetadataTypedDict - r"""Machine-readable detail for the failure.""" - - -class InternChatStreamError(BaseModel): - r"""A failure after the response headers were sent. The chunk that carries it has `finish_reason: \"error\"`, then the final empty-`choices` chunk and `[DONE]` follow. Reasons here are `attachment_failed`, `busy`, `client_closed_request`, `interaction_not_pending`, `interaction_unknown`, `intern_unreachable`, `run_ended`, `stream_severed`, `timeout` or `turn_failed`. `run_ended` reports an ending the intern confirmed, such as a cancellation or a deadline, while `stream_severed` reports a connection lost without that confirmation.""" - - code: int - r"""The HTTP status this failure would have had before the stream opened.""" - - message: str - - metadata: InternChatErrorMetadata - r"""Machine-readable detail for the failure.""" diff --git a/src/openrouter/components/internchatstreamingresponse.py b/src/openrouter/components/internchatstreamingresponse.py deleted file mode 100644 index 3a5dcf60..00000000 --- a/src/openrouter/components/internchatstreamingresponse.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .internchatcompletionchunk import ( - InternChatCompletionChunk, - InternChatCompletionChunkTypedDict, -) -from openrouter.types import BaseModel -from typing_extensions import TypedDict - - -class InternChatStreamingResponseTypedDict(TypedDict): - r"""A server-sent event carrying one chunk. The stream ends with `data: [DONE]`.""" - - data: InternChatCompletionChunkTypedDict - r"""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]`.""" - - -class InternChatStreamingResponse(BaseModel): - r"""A server-sent event carrying one chunk. The stream ends with `data: [DONE]`.""" - - data: InternChatCompletionChunk - r"""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]`.""" diff --git a/src/openrouter/components/internchatsystemmessage.py b/src/openrouter/components/internchatsystemmessage.py deleted file mode 100644 index b4d9ed2a..00000000 --- a/src/openrouter/components/internchatsystemmessage.py +++ /dev/null @@ -1,45 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .internchatmessagecontent import ( - InternChatMessageContent, - InternChatMessageContentTypedDict, -) -from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Literal -from typing_extensions import TypedDict - - -InternChatSystemMessageRole = Literal["system",] - - -class InternChatSystemMessageTypedDict(TypedDict): - r"""A system message. Accepted for client compatibility and not forwarded.""" - - content: Nullable[InternChatMessageContentTypedDict] - r"""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.""" - role: InternChatSystemMessageRole - - -class InternChatSystemMessage(BaseModel): - r"""A system message. Accepted for client compatibility and not forwarded.""" - - content: Nullable[InternChatMessageContent] - r"""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.""" - - role: InternChatSystemMessageRole - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - m[k] = val - - return m diff --git a/src/openrouter/components/internchattextpart.py b/src/openrouter/components/internchattextpart.py deleted file mode 100644 index 32223695..00000000 --- a/src/openrouter/components/internchattextpart.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel -from typing import Literal -from typing_extensions import TypedDict - - -InternChatTextPartType = Literal["text",] - - -class InternChatTextPartTypedDict(TypedDict): - r"""One text part of a message.""" - - text: str - type: InternChatTextPartType - - -class InternChatTextPart(BaseModel): - r"""One text part of a message.""" - - text: str - - type: InternChatTextPartType diff --git a/src/openrouter/components/internchattoolcall.py b/src/openrouter/components/internchattoolcall.py deleted file mode 100644 index ceb01c94..00000000 --- a/src/openrouter/components/internchattoolcall.py +++ /dev/null @@ -1,38 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .internchattoolcallfunction import ( - InternChatToolCallFunction, - InternChatToolCallFunctionTypedDict, -) -from openrouter.types import BaseModel -from typing import Literal -from typing_extensions import TypedDict - - -InternChatToolCallType = Literal["function",] - - -class InternChatToolCallTypedDict(TypedDict): - r"""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.""" - - function: InternChatToolCallFunctionTypedDict - r"""The single tool this endpoint calls, asking the caller for input.""" - id: str - r"""The interaction id. Send it back as `tool_call_id` on the `tool` message that answers it.""" - index: int - type: InternChatToolCallType - - -class InternChatToolCall(BaseModel): - r"""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.""" - - function: InternChatToolCallFunction - r"""The single tool this endpoint calls, asking the caller for input.""" - - id: str - r"""The interaction id. Send it back as `tool_call_id` on the `tool` message that answers it.""" - - index: int - - type: InternChatToolCallType diff --git a/src/openrouter/components/internchattoolcallfunction.py b/src/openrouter/components/internchattoolcallfunction.py deleted file mode 100644 index b723d3ea..00000000 --- a/src/openrouter/components/internchattoolcallfunction.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel -from typing import Literal -from typing_extensions import TypedDict - - -InternChatToolCallFunctionName = Literal["openrouter.provide_input",] - - -class InternChatToolCallFunctionTypedDict(TypedDict): - r"""The single tool this endpoint calls, asking the caller for input.""" - - arguments: str - r"""A JSON object string describing the interaction. A permission request is `{\"kind\":\"permission\",\"operation\":,\"options\":[]}`. A question is `{\"kind\":\"elicitation\",\"message\":,\"fields\":[]}`.""" - name: InternChatToolCallFunctionName - - -class InternChatToolCallFunction(BaseModel): - r"""The single tool this endpoint calls, asking the caller for input.""" - - arguments: str - r"""A JSON object string describing the interaction. A permission request is `{\"kind\":\"permission\",\"operation\":,\"options\":[]}`. A question is `{\"kind\":\"elicitation\",\"message\":,\"fields\":[]}`.""" - - name: InternChatToolCallFunctionName diff --git a/src/openrouter/components/internchattoolmessage.py b/src/openrouter/components/internchattoolmessage.py deleted file mode 100644 index af736a62..00000000 --- a/src/openrouter/components/internchattoolmessage.py +++ /dev/null @@ -1,48 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .internchatmessagecontent import ( - InternChatMessageContent, - InternChatMessageContentTypedDict, -) -from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Literal -from typing_extensions import TypedDict - - -InternChatToolMessageRole = Literal["tool",] - - -class InternChatToolMessageTypedDict(TypedDict): - r"""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.""" - - content: Nullable[InternChatMessageContentTypedDict] - r"""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.""" - role: InternChatToolMessageRole - tool_call_id: str - - -class InternChatToolMessage(BaseModel): - r"""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.""" - - content: Nullable[InternChatMessageContent] - r"""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.""" - - role: InternChatToolMessageRole - - tool_call_id: str - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - m[k] = val - - return m diff --git a/src/openrouter/components/internchatusage.py b/src/openrouter/components/internchatusage.py deleted file mode 100644 index 439af871..00000000 --- a/src/openrouter/components/internchatusage.py +++ /dev/null @@ -1,55 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .internchatprompttokensdetails import ( - InternChatPromptTokensDetails, - InternChatPromptTokensDetailsTypedDict, -) -from openrouter.types import BaseModel, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Optional -from typing_extensions import NotRequired, TypedDict - - -class InternChatUsageTypedDict(TypedDict): - r"""Token usage for the run as the daemon reported it, on the final chunk before `[DONE]`. `null` when the daemon reported none, and always `null` after `tool_calls` because the turn is not over.""" - - completion_tokens: int - prompt_tokens: int - total_tokens: int - cost: NotRequired[float] - r"""The cost of the run in USD, when the daemon reported one.""" - prompt_tokens_details: NotRequired[InternChatPromptTokensDetailsTypedDict] - r"""Prompt tokens served from cache, when the daemon reported them.""" - - -class InternChatUsage(BaseModel): - r"""Token usage for the run as the daemon reported it, on the final chunk before `[DONE]`. `null` when the daemon reported none, and always `null` after `tool_calls` because the turn is not over.""" - - completion_tokens: int - - prompt_tokens: int - - total_tokens: int - - cost: Optional[float] = None - r"""The cost of the run in USD, when the daemon reported one.""" - - prompt_tokens_details: Optional[InternChatPromptTokensDetails] = None - r"""Prompt tokens served from cache, when the daemon reported them.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["cost", "prompt_tokens_details"]) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m diff --git a/src/openrouter/components/internchatusermessage.py b/src/openrouter/components/internchatusermessage.py deleted file mode 100644 index a87aacc5..00000000 --- a/src/openrouter/components/internchatusermessage.py +++ /dev/null @@ -1,45 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .internchatmessagecontent import ( - InternChatMessageContent, - InternChatMessageContentTypedDict, -) -from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Literal -from typing_extensions import TypedDict - - -InternChatUserMessageRole = Literal["user",] - - -class InternChatUserMessageTypedDict(TypedDict): - r"""A user message. When it is the last message its text is the prompt for a new run, at most 32000 characters.""" - - content: Nullable[InternChatMessageContentTypedDict] - r"""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.""" - role: InternChatUserMessageRole - - -class InternChatUserMessage(BaseModel): - r"""A user message. When it is the last message its text is the prompt for a new run, at most 32000 characters.""" - - content: Nullable[InternChatMessageContent] - r"""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.""" - - role: InternChatUserMessageRole - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - m[k] = val - - return m diff --git a/src/openrouter/components/internconnection.py b/src/openrouter/components/internconnection.py deleted file mode 100644 index ea777e7a..00000000 --- a/src/openrouter/components/internconnection.py +++ /dev/null @@ -1,207 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr -from pydantic import model_serializer -from typing import Literal, Union -from typing_extensions import TypedDict - - -InternConnectionScope = Union[ - Literal[ - "workspace", - "yours", - "shared", - ], - UnrecognizedStr, -] -r"""`workspace` for a shared connection, `yours` for the key user's personal account, `shared` for a teammate's.""" - - -class AccountTypedDict(TypedDict): - acts_as: Nullable[str] - r"""Whose account it acts as, when known.""" - is_your_account_linked: Nullable[bool] - note: Nullable[str] - scope: InternConnectionScope - r"""`workspace` for a shared connection, `yours` for the key user's personal account, `shared` for a teammate's.""" - - -class Account(BaseModel): - acts_as: Nullable[str] - r"""Whose account it acts as, when known.""" - - is_your_account_linked: Nullable[bool] - - note: Nullable[str] - - scope: InternConnectionScope - r"""`workspace` for a shared connection, `yours` for the key user's personal account, `shared` for a teammate's.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - m[k] = val - - return m - - -Kind = Union[ - Literal[ - "slack", - "github", - "google", - "mcp", - ], - UnrecognizedStr, -] - - -OffReason = Union[ - Literal[ - "switched_off", - "disabled", - ], - UnrecognizedStr, -] -r"""`switched_off` for this intern, `disabled` for the whole workspace; null while on.""" - - -class ServerTypedDict(TypedDict): - host: Nullable[str] - surface: str - transport: str - url: Nullable[str] - - -class Server(BaseModel): - host: Nullable[str] - - surface: str - - transport: str - - url: Nullable[str] - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - m[k] = val - - return m - - -StateEnum = Union[ - Literal[ - "connected", - "needs_reconnect", - "not_tested", - "error", - ], - UnrecognizedStr, -] - - -class InternConnectionStatusTypedDict(TypedDict): - reason: Nullable[str] - state: StateEnum - - -class InternConnectionStatus(BaseModel): - reason: Nullable[str] - - state: StateEnum - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - m[k] = val - - return m - - -class InternConnectionTypedDict(TypedDict): - account: AccountTypedDict - id: str - r"""Stable id: the credential id of an MCP server, else the kind (`slack`, `github`, `google`).""" - is_enabled: bool - r"""Whether the intern reaches it now.""" - is_intern_only: bool - r"""Scoped to this intern rather than shared by the workspace.""" - kind: Kind - mcp_server_name: Nullable[str] - r"""The name the intern's MCP config keys the server by; null when it is not an MCP server or is off.""" - name: str - r"""Display name.""" - off_reason: Nullable[OffReason] - r"""`switched_off` for this intern, `disabled` for the whole workspace; null while on.""" - server: Nullable[ServerTypedDict] - status: InternConnectionStatusTypedDict - tool_count: Nullable[int] - r"""Tools found by the last successful test.""" - - -class InternConnection(BaseModel): - account: Account - - id: str - r"""Stable id: the credential id of an MCP server, else the kind (`slack`, `github`, `google`).""" - - is_enabled: bool - r"""Whether the intern reaches it now.""" - - is_intern_only: bool - r"""Scoped to this intern rather than shared by the workspace.""" - - kind: Kind - - mcp_server_name: Nullable[str] - r"""The name the intern's MCP config keys the server by; null when it is not an MCP server or is off.""" - - name: str - r"""Display name.""" - - off_reason: Nullable[OffReason] - r"""`switched_off` for this intern, `disabled` for the whole workspace; null while on.""" - - server: Nullable[Server] - - status: InternConnectionStatus - - tool_count: Nullable[int] - r"""Tools found by the last successful test.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - m[k] = val - - return m diff --git a/src/openrouter/components/internconnectionlist.py b/src/openrouter/components/internconnectionlist.py deleted file mode 100644 index 0b7d72ef..00000000 --- a/src/openrouter/components/internconnectionlist.py +++ /dev/null @@ -1,15 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .internconnection import InternConnection, InternConnectionTypedDict -from openrouter.types import BaseModel -from typing import List -from typing_extensions import TypedDict - - -class InternConnectionListTypedDict(TypedDict): - data: List[InternConnectionTypedDict] - - -class InternConnectionList(BaseModel): - data: List[InternConnection] diff --git a/src/openrouter/components/interndaemonaccess.py b/src/openrouter/components/interndaemonaccess.py deleted file mode 100644 index 2b465e20..00000000 --- a/src/openrouter/components/interndaemonaccess.py +++ /dev/null @@ -1,34 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel -from typing import List -from typing_extensions import TypedDict - - -class ViewerTypedDict(TypedDict): - principals: List[str] - r"""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.""" - - -class Viewer(BaseModel): - principals: List[str] - r"""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.""" - - -class InternDaemonAccessTypedDict(TypedDict): - r"""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.""" - - origin: str - token: str - viewer: ViewerTypedDict - - -class InternDaemonAccess(BaseModel): - r"""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.""" - - origin: str - - token: str - - viewer: Viewer diff --git a/src/openrouter/components/interninvokeacceptedresponse.py b/src/openrouter/components/interninvokeacceptedresponse.py deleted file mode 100644 index 9f2d10b9..00000000 --- a/src/openrouter/components/interninvokeacceptedresponse.py +++ /dev/null @@ -1,35 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel, UnrecognizedStr -from typing import Literal, Union -from typing_extensions import TypedDict - - -InternInvokeAcceptedResponseStatus = Union[ - Literal[ - "started", - "steered", - ], - UnrecognizedStr, -] -r"""`started` when a new run began. `steered` when the session already had a run going and the prompt was delivered into it instead.""" - - -class InternInvokeAcceptedResponseTypedDict(TypedDict): - r"""The intern admitted the prompt. The run continues on the intern.""" - - session_id: str - r"""The session the run belongs to. Send it back to continue the conversation.""" - status: InternInvokeAcceptedResponseStatus - r"""`started` when a new run began. `steered` when the session already had a run going and the prompt was delivered into it instead.""" - - -class InternInvokeAcceptedResponse(BaseModel): - r"""The intern admitted the prompt. The run continues on the intern.""" - - session_id: str - r"""The session the run belongs to. Send it back to continue the conversation.""" - - status: InternInvokeAcceptedResponseStatus - r"""`started` when a new run began. `steered` when the session already had a run going and the prompt was delivered into it instead.""" diff --git a/src/openrouter/components/interninvokerequest.py b/src/openrouter/components/interninvokerequest.py deleted file mode 100644 index f781e6fa..00000000 --- a/src/openrouter/components/interninvokerequest.py +++ /dev/null @@ -1,42 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Optional -from typing_extensions import NotRequired, TypedDict - - -class InternInvokeRequestTypedDict(TypedDict): - r"""A prompt to run on the intern without holding a connection open.""" - - input: str - r"""The prompt for the run, at most 32000 characters.""" - session_id: NotRequired[str] - r"""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`.""" - - -class InternInvokeRequest(BaseModel): - r"""A prompt to run on the intern without holding a connection open.""" - - input: str - r"""The prompt for the run, at most 32000 characters.""" - - session_id: Optional[str] = None - r"""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`.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["session_id"]) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m diff --git a/src/openrouter/components/internlifecycleerror.py b/src/openrouter/components/internlifecycleerror.py deleted file mode 100644 index cde6b4d1..00000000 --- a/src/openrouter/components/internlifecycleerror.py +++ /dev/null @@ -1,54 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel, UNSET_SENTINEL -from pydantic import model_serializer -from typing import Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict - - -CodeTypedDict = TypeAliasType("CodeTypedDict", Union[str, int]) - - -Code = TypeAliasType("Code", Union[str, int]) - - -class InternLifecycleErrorMetadataTypedDict(TypedDict): - reason: str - retryable: bool - - -class InternLifecycleErrorMetadata(BaseModel): - reason: str - - retryable: bool - - -class InternLifecycleErrorErrorTypedDict(TypedDict): - code: CodeTypedDict - message: str - metadata: NotRequired[InternLifecycleErrorMetadataTypedDict] - - -class InternLifecycleErrorError(BaseModel): - code: Code - - message: str - - metadata: Optional[InternLifecycleErrorMetadata] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["metadata"]) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m diff --git a/src/openrouter/components/internlistresponse.py b/src/openrouter/components/internlistresponse.py deleted file mode 100644 index 2afe1147..00000000 --- a/src/openrouter/components/internlistresponse.py +++ /dev/null @@ -1,46 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .intern import Intern, InternTypedDict -from openrouter.types import BaseModel, UNSET_SENTINEL -from pydantic import model_serializer -from typing import List, Optional -from typing_extensions import NotRequired, TypedDict - - -class InternListResponseTypedDict(TypedDict): - r"""Interns visible to the authenticated API key.""" - - data: List[InternTypedDict] - has_more: bool - r"""True when more interns match the current filters.""" - next_cursor: NotRequired[str] - r"""Opaque cursor, present when `has_more` is true. Pass it as `starting_after` to fetch the next page.""" - - -class InternListResponse(BaseModel): - r"""Interns visible to the authenticated API key.""" - - data: List[Intern] - - has_more: bool - r"""True when more interns match the current filters.""" - - next_cursor: Optional[str] = None - r"""Opaque cursor, present when `has_more` is true. Pass it as `starting_after` to fetch the next page.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["next_cursor"]) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m diff --git a/src/openrouter/components/provisioninternresponse.py b/src/openrouter/components/provisioninternresponse.py deleted file mode 100644 index 5f4a4186..00000000 --- a/src/openrouter/components/provisioninternresponse.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel -from openrouter.utils import validate_const -import pydantic -from pydantic.functional_validators import AfterValidator -from typing import Literal -from typing_extensions import Annotated, TypedDict - - -class ProvisionInternResponseTypedDict(TypedDict): - provisioning: Literal[True] - - -class ProvisionInternResponse(BaseModel): - PROVISIONING: Annotated[ - Annotated[Literal[True], AfterValidator(validate_const(True))], - pydantic.Field(alias="provisioning"), - ] = True - - -try: - ProvisionInternResponse.model_rebuild() -except NameError: - pass diff --git a/src/openrouter/components/signinterndaemonrequest.py b/src/openrouter/components/signinterndaemonrequest.py deleted file mode 100644 index a5d55522..00000000 --- a/src/openrouter/components/signinterndaemonrequest.py +++ /dev/null @@ -1,68 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel, UNSET_SENTINEL -import pydantic -from pydantic import model_serializer -from typing import Literal, Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -SignInternDaemonRequestMethod = Literal["POST",] -r"""The HTTP method of the daemon request.""" - - -class RouteTypedDict(TypedDict): - r"""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`).""" - - method: SignInternDaemonRequestMethod - r"""The HTTP method of the daemon request.""" - path: str - r"""The daemon request path, percent-encoded as sent, without origin or query. The route-bound proof admits only this path.""" - - -class Route(BaseModel): - r"""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`).""" - - method: SignInternDaemonRequestMethod - r"""The HTTP method of the daemon request.""" - - path: str - r"""The daemon request path, percent-encoded as sent, without origin or query. The route-bound proof admits only this path.""" - - -class SignInternDaemonRequestTypedDict(TypedDict): - body_sha256: str - r"""Lower-case hex SHA-256 of the exact bytes the CLI will send as the daemon request body.""" - route: NotRequired[RouteTypedDict] - r"""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`).""" - - -class SignInternDaemonRequest(BaseModel): - body_sha256: Annotated[str, pydantic.Field(alias="bodySha256")] - r"""Lower-case hex SHA-256 of the exact bytes the CLI will send as the daemon request body.""" - - route: Optional[Route] = None - r"""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`).""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["route"]) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -try: - SignInternDaemonRequest.model_rebuild() -except NameError: - pass diff --git a/src/openrouter/components/signinterndaemonresponse.py b/src/openrouter/components/signinterndaemonresponse.py deleted file mode 100644 index 43b66eae..00000000 --- a/src/openrouter/components/signinterndaemonresponse.py +++ /dev/null @@ -1,72 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel, UNSET_SENTINEL -import pydantic -from pydantic import model_serializer -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class SignInternDaemonResponseTypedDict(TypedDict): - r"""Headers the CLI copies onto the daemon request so the sidecar can verify who is asking.""" - - x_ori_invoke_signature: str - r"""Base64 Ed25519 signature over the intern id, timestamp, user and body digest.""" - x_ori_invoke_timestamp: str - r"""Unix seconds at signing; the daemon refuses proofs older than its window.""" - x_ori_invoke_user: str - r"""The verified OAuth subject the proof names. Never taken from the request.""" - x_ori_invoke_nonce: NotRequired[str] - r"""Present with `x-ori-invoke-signature-v2`: the single-use id that proof is bound to.""" - x_ori_invoke_signature_v2: NotRequired[str] - r"""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.""" - - -class SignInternDaemonResponse(BaseModel): - r"""Headers the CLI copies onto the daemon request so the sidecar can verify who is asking.""" - - x_ori_invoke_signature: Annotated[ - str, pydantic.Field(alias="x-ori-invoke-signature") - ] - r"""Base64 Ed25519 signature over the intern id, timestamp, user and body digest.""" - - x_ori_invoke_timestamp: Annotated[ - str, pydantic.Field(alias="x-ori-invoke-timestamp") - ] - r"""Unix seconds at signing; the daemon refuses proofs older than its window.""" - - x_ori_invoke_user: Annotated[str, pydantic.Field(alias="x-ori-invoke-user")] - r"""The verified OAuth subject the proof names. Never taken from the request.""" - - x_ori_invoke_nonce: Annotated[ - Optional[str], pydantic.Field(alias="x-ori-invoke-nonce") - ] = None - r"""Present with `x-ori-invoke-signature-v2`: the single-use id that proof is bound to.""" - - x_ori_invoke_signature_v2: Annotated[ - Optional[str], pydantic.Field(alias="x-ori-invoke-signature-v2") - ] = None - r"""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.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["x-ori-invoke-nonce", "x-ori-invoke-signature-v2"]) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -try: - SignInternDaemonResponse.model_rebuild() -except NameError: - pass diff --git a/src/openrouter/components/suspendinternresponse.py b/src/openrouter/components/suspendinternresponse.py deleted file mode 100644 index 703bf7de..00000000 --- a/src/openrouter/components/suspendinternresponse.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel -from openrouter.utils import validate_const -import pydantic -from pydantic.functional_validators import AfterValidator -from typing import Literal -from typing_extensions import Annotated, TypedDict - - -class SuspendInternResponseTypedDict(TypedDict): - suspended: Literal[True] - - -class SuspendInternResponse(BaseModel): - SUSPENDED: Annotated[ - Annotated[Literal[True], AfterValidator(validate_const(True))], - pydantic.Field(alias="suspended"), - ] = True - - -try: - SuspendInternResponse.model_rebuild() -except NameError: - pass diff --git a/src/openrouter/components/updateinternrequest.py b/src/openrouter/components/updateinternrequest.py deleted file mode 100644 index 1b9db811..00000000 --- a/src/openrouter/components/updateinternrequest.py +++ /dev/null @@ -1,67 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from pydantic import model_serializer -from typing import Optional -from typing_extensions import NotRequired, TypedDict - - -class UpdateInternRequestTypedDict(TypedDict): - r"""Lifecycle settings to change. Omitted fields stay unchanged and null clears a field.""" - - description: NotRequired[Nullable[str]] - r"""New free-form description. Null clears it.""" - instructions: NotRequired[Nullable[str]] - r"""New standing instructions. Null clears them.""" - model: NotRequired[Nullable[str]] - r"""New OpenRouter model slug in `author/slug` form (an optional `:variant` suffix is accepted). Other shapes are refused with 400. Null restores the workspace default. Takes effect on the next provision: until then `GET` shows this configured model while chat chunks show the model the running intern reports.""" - name: NotRequired[str] - r"""New intern name, unique per creator within the workspace.""" - - -class UpdateInternRequest(BaseModel): - r"""Lifecycle settings to change. Omitted fields stay unchanged and null clears a field.""" - - description: OptionalNullable[str] = UNSET - r"""New free-form description. Null clears it.""" - - instructions: OptionalNullable[str] = UNSET - r"""New standing instructions. Null clears them.""" - - model: OptionalNullable[str] = UNSET - r"""New OpenRouter model slug in `author/slug` form (an optional `:variant` suffix is accepted). Other shapes are refused with 400. Null restores the workspace default. Takes effect on the next provision: until then `GET` shows this configured model while chat chunks show the model the running intern reports.""" - - name: Optional[str] = None - r"""New intern name, unique per creator within the workspace.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["description", "instructions", "model", "name"]) - nullable_fields = set(["description", "instructions", "model"]) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - is_nullable_and_explicitly_set = ( - k in nullable_fields - and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member - ) - - if val != UNSET_SENTINEL: - if ( - val is not None - or k not in optional_fields - or is_nullable_and_explicitly_set - ): - m[k] = val - - return m diff --git a/src/openrouter/errors/__init__.py b/src/openrouter/errors/__init__.py index 668e68c7..0159d3af 100644 --- a/src/openrouter/errors/__init__.py +++ b/src/openrouter/errors/__init__.py @@ -57,11 +57,6 @@ InternalServerResponseError, InternalServerResponseErrorData, ) - from .internchaterrorresponse import ( - InternChatErrorResponse, - InternChatErrorResponseData, - ) - from .internlifecycleerror import InternLifecycleError, InternLifecycleErrorData from .no_response_error import NoResponseError from .notfoundresponse_error import NotFoundResponseError, NotFoundResponseErrorData from .oautherrorresponse import OAuthErrorResponse, OAuthErrorResponseData @@ -127,10 +122,6 @@ "GatewayTimeoutResponseErrorData", "GoneResponseError", "GoneResponseErrorData", - "InternChatErrorResponse", - "InternChatErrorResponseData", - "InternLifecycleError", - "InternLifecycleErrorData", "InternalServerError", "InternalServerErrorUnion", "InternalServerResponseError", @@ -200,10 +191,6 @@ "GoneResponseErrorData": ".goneresponse_error", "InternalServerResponseError": ".internalserverresponse_error", "InternalServerResponseErrorData": ".internalserverresponse_error", - "InternChatErrorResponse": ".internchaterrorresponse", - "InternChatErrorResponseData": ".internchaterrorresponse", - "InternLifecycleError": ".internlifecycleerror", - "InternLifecycleErrorData": ".internlifecycleerror", "NoResponseError": ".no_response_error", "NotFoundResponseError": ".notfoundresponse_error", "NotFoundResponseErrorData": ".notfoundresponse_error", diff --git a/src/openrouter/errors/internchaterrorresponse.py b/src/openrouter/errors/internchaterrorresponse.py deleted file mode 100644 index 6fe3f735..00000000 --- a/src/openrouter/errors/internchaterrorresponse.py +++ /dev/null @@ -1,32 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from dataclasses import dataclass, field -import httpx -from openrouter.components import internchaterror as components_internchaterror -from openrouter.errors import OpenRouterError -from openrouter.types import BaseModel -from typing import Optional - - -class InternChatErrorResponseData(BaseModel): - error: components_internchaterror.InternChatError - r"""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`.""" - - -@dataclass(unsafe_hash=True) -class InternChatErrorResponse(OpenRouterError): - r"""A refusal before the stream opens. Once the response is `200` and streaming, failures arrive as a chunk with `finish_reason: \"error\"` instead.""" - - data: InternChatErrorResponseData = field(hash=False) - - def __init__( - self, - data: InternChatErrorResponseData, - raw_response: httpx.Response, - body: Optional[str] = None, - ): - fallback = body or raw_response.text - message = str(data.error.message) or fallback - super().__init__(message, raw_response, body) - object.__setattr__(self, "data", data) diff --git a/src/openrouter/errors/internlifecycleerror.py b/src/openrouter/errors/internlifecycleerror.py deleted file mode 100644 index 8a933524..00000000 --- a/src/openrouter/errors/internlifecycleerror.py +++ /dev/null @@ -1,33 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from dataclasses import dataclass, field -import httpx -from openrouter.components import ( - internlifecycleerror as components_internlifecycleerror, -) -from openrouter.errors import OpenRouterError -from openrouter.types import BaseModel -from typing import Optional - - -class InternLifecycleErrorData(BaseModel): - error: components_internlifecycleerror.InternLifecycleErrorError - - -@dataclass(unsafe_hash=True) -class InternLifecycleError(OpenRouterError): - r"""Intern lifecycle request failure.""" - - data: InternLifecycleErrorData = field(hash=False) - - def __init__( - self, - data: InternLifecycleErrorData, - raw_response: httpx.Response, - body: Optional[str] = None, - ): - fallback = body or raw_response.text - message = str(data.error.message) or fallback - super().__init__(message, raw_response, body) - object.__setattr__(self, "data", data) diff --git a/src/openrouter/interns.py b/src/openrouter/interns.py deleted file mode 100644 index 3d286520..00000000 --- a/src/openrouter/interns.py +++ /dev/null @@ -1,4405 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from enum import Enum -import httpx -from openrouter import components, errors, operations, utils -from openrouter._hooks import HookContext -from openrouter.types import OptionalNullable, UNSET -from openrouter.utils import eventstreaming, get_security_from_env -from openrouter.utils.unmarshal_json_response import unmarshal_json_response -from typing import Any, Iterable, List, Mapping, Optional, Union -from typing_extensions import deprecated - - -class ChatAcceptEnum(str, Enum): - APPLICATION_JSON = "application/json" - TEXT_EVENT_STREAM = "text/event-stream" - - -class Interns(BaseSDK): - r"""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.""" - - def list_interns( - self, - *, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - limit: Optional[int] = None, - status: Optional[Iterable[operations.Status]] = None, - starting_after: Optional[str] = None, - workspace_id: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.InternListResponse: - r"""List interns - - 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 `api_key` from the global security. - - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param limit: Maximum number of interns to return, from 1 through 500. - :param status: Comma-separated lifecycle statuses to include, at most 8. Repeats are collapsed. - :param starting_after: 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. - :param workspace_id: Only return interns in this workspace. It must match the API key workspace. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.ListInternsRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - limit=limit, - status=utils.unmarshal(status, Optional[List[operations.Status]]), - starting_after=starting_after, - workspace_id=workspace_id, - ) - - req = self._build_request( - method="GET", - path="/interns", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.ListInternsGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="listInterns", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.InternListResponse, http_res) - if utils.match_response( - http_res, ["400", "401", "403", "404", "408"], "application/json" - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - async def list_interns_async( - self, - *, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - limit: Optional[int] = None, - status: Optional[Iterable[operations.Status]] = None, - starting_after: Optional[str] = None, - workspace_id: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.InternListResponse: - r"""List interns - - 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 `api_key` from the global security. - - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param limit: Maximum number of interns to return, from 1 through 500. - :param status: Comma-separated lifecycle statuses to include, at most 8. Repeats are collapsed. - :param starting_after: 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. - :param workspace_id: Only return interns in this workspace. It must match the API key workspace. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.ListInternsRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - limit=limit, - status=utils.unmarshal(status, Optional[List[operations.Status]]), - starting_after=starting_after, - workspace_id=workspace_id, - ) - - req = self._build_request_async( - method="GET", - path="/interns", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.ListInternsGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="listInterns", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.InternListResponse, http_res) - if utils.match_response( - http_res, ["400", "401", "403", "404", "408"], "application/json" - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - def create_intern( - self, - *, - name: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - idempotency_key: Optional[str] = None, - description: OptionalNullable[str] = UNSET, - instructions: OptionalNullable[str] = UNSET, - provision: Optional[bool] = False, - vault_id: Optional[str] = None, - workspace_id: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.Intern: - r"""Create an intern - - 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 `api_key` from the global security. - - :param name: Intern name, unique per creator within the workspace. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param idempotency_key: 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. - :param description: Free-form description, or null. - :param instructions: Standing instructions the intern boots with, or null. - :param provision: Start provisioning during this create operation. Defaults to false. - :param vault_id: Vault owned by another intern in this workspace to attach as a borrowed vault. - :param workspace_id: Workspace that will own the intern. Defaults to the workspace the API key resolves to. When given, it must match the API key workspace. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.CreateInternRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - idempotency_key=idempotency_key, - create_intern_request=components.CreateInternRequest( - description=description, - instructions=instructions, - name=name, - provision=provision, - vault_id=vault_id, - workspace_id=workspace_id, - ), - ) - - req = self._build_request( - method="POST", - path="/interns", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.CreateInternGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.create_intern_request, - False, - False, - "json", - components.CreateInternRequest, - ), - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="createIntern", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, ["200", "201"], "application/json"): - return unmarshal_json_response(components.Intern, http_res) - if utils.match_response( - http_res, - ["400", "401", "403", "404", "408", "409", "413", "415"], - "application/json", - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, ["500", "502"], "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - async def create_intern_async( - self, - *, - name: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - idempotency_key: Optional[str] = None, - description: OptionalNullable[str] = UNSET, - instructions: OptionalNullable[str] = UNSET, - provision: Optional[bool] = False, - vault_id: Optional[str] = None, - workspace_id: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.Intern: - r"""Create an intern - - 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 `api_key` from the global security. - - :param name: Intern name, unique per creator within the workspace. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param idempotency_key: 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. - :param description: Free-form description, or null. - :param instructions: Standing instructions the intern boots with, or null. - :param provision: Start provisioning during this create operation. Defaults to false. - :param vault_id: Vault owned by another intern in this workspace to attach as a borrowed vault. - :param workspace_id: Workspace that will own the intern. Defaults to the workspace the API key resolves to. When given, it must match the API key workspace. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.CreateInternRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - idempotency_key=idempotency_key, - create_intern_request=components.CreateInternRequest( - description=description, - instructions=instructions, - name=name, - provision=provision, - vault_id=vault_id, - workspace_id=workspace_id, - ), - ) - - req = self._build_request_async( - method="POST", - path="/interns", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=False, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.CreateInternGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.create_intern_request, - False, - False, - "json", - components.CreateInternRequest, - ), - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="createIntern", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, ["200", "201"], "application/json"): - return unmarshal_json_response(components.Intern, http_res) - if utils.match_response( - http_res, - ["400", "401", "403", "404", "408", "409", "413", "415"], - "application/json", - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, ["500", "502"], "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - def delete_intern( - self, - *, - intern_id: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - acknowledge_workspace_loss: Optional[bool] = False, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.DeleteInternResponse: - r"""Delete an intern - - 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 `api_key` from the global security. - - :param intern_id: ID of an intern visible to the authenticated API key. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param acknowledge_workspace_loss: Delete even though the workspace backup was not confirmed. Defaults to false, which refuses the teardown when a workspace archive is missing. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.DeleteInternRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - delete_intern_request=components.DeleteInternRequest( - acknowledge_workspace_loss=acknowledge_workspace_loss, - ), - ) - - req = self._build_request( - method="DELETE", - path="/interns/{internId}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.DeleteInternGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.delete_intern_request, - False, - False, - "json", - components.DeleteInternRequest, - ), - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="deleteIntern", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "202", "application/json"): - return unmarshal_json_response(components.DeleteInternResponse, http_res) - if utils.match_response( - http_res, - ["400", "401", "403", "404", "408", "409", "413", "415"], - "application/json", - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, ["500", "502"], "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - async def delete_intern_async( - self, - *, - intern_id: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - acknowledge_workspace_loss: Optional[bool] = False, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.DeleteInternResponse: - r"""Delete an intern - - 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 `api_key` from the global security. - - :param intern_id: ID of an intern visible to the authenticated API key. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param acknowledge_workspace_loss: Delete even though the workspace backup was not confirmed. Defaults to false, which refuses the teardown when a workspace archive is missing. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.DeleteInternRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - delete_intern_request=components.DeleteInternRequest( - acknowledge_workspace_loss=acknowledge_workspace_loss, - ), - ) - - req = self._build_request_async( - method="DELETE", - path="/interns/{internId}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.DeleteInternGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.delete_intern_request, - False, - False, - "json", - components.DeleteInternRequest, - ), - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="deleteIntern", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "202", "application/json"): - return unmarshal_json_response(components.DeleteInternResponse, http_res) - if utils.match_response( - http_res, - ["400", "401", "403", "404", "408", "409", "413", "415"], - "application/json", - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, ["500", "502"], "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - def get_intern( - self, - *, - intern_id: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.Intern: - r"""Get an intern - - 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 `api_key` from the global security. - - :param intern_id: ID of an intern visible to the authenticated API key. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.GetInternRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - ) - - req = self._build_request( - method="GET", - path="/interns/{internId}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.GetInternGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="getIntern", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.Intern, http_res) - if utils.match_response( - http_res, ["401", "403", "404", "408"], "application/json" - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - async def get_intern_async( - self, - *, - intern_id: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.Intern: - r"""Get an intern - - 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 `api_key` from the global security. - - :param intern_id: ID of an intern visible to the authenticated API key. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.GetInternRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - ) - - req = self._build_request_async( - method="GET", - path="/interns/{internId}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.GetInternGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="getIntern", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.Intern, http_res) - if utils.match_response( - http_res, ["401", "403", "404", "408"], "application/json" - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - def update_intern( - self, - *, - intern_id: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - description: OptionalNullable[str] = UNSET, - instructions: OptionalNullable[str] = UNSET, - model: OptionalNullable[str] = UNSET, - name: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.Intern: - r"""Update an intern - - 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 `api_key` from the global security. - - :param intern_id: ID of an intern visible to the authenticated API key. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param description: New free-form description. Null clears it. - :param instructions: New standing instructions. Null clears them. - :param model: New OpenRouter model slug in `author/slug` form (an optional `:variant` suffix is accepted). Other shapes are refused with 400. Null restores the workspace default. Takes effect on the next provision: until then `GET` shows this configured model while chat chunks show the model the running intern reports. - :param name: New intern name, unique per creator within the workspace. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.UpdateInternRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - update_intern_request=components.UpdateInternRequest( - description=description, - instructions=instructions, - model=model, - name=name, - ), - ) - - req = self._build_request( - method="PATCH", - path="/interns/{internId}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.UpdateInternGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.update_intern_request, - False, - False, - "json", - components.UpdateInternRequest, - ), - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="updateIntern", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.Intern, http_res) - if utils.match_response( - http_res, - ["400", "401", "403", "404", "408", "409", "413", "415"], - "application/json", - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - async def update_intern_async( - self, - *, - intern_id: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - description: OptionalNullable[str] = UNSET, - instructions: OptionalNullable[str] = UNSET, - model: OptionalNullable[str] = UNSET, - name: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.Intern: - r"""Update an intern - - 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 `api_key` from the global security. - - :param intern_id: ID of an intern visible to the authenticated API key. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param description: New free-form description. Null clears it. - :param instructions: New standing instructions. Null clears them. - :param model: New OpenRouter model slug in `author/slug` form (an optional `:variant` suffix is accepted). Other shapes are refused with 400. Null restores the workspace default. Takes effect on the next provision: until then `GET` shows this configured model while chat chunks show the model the running intern reports. - :param name: New intern name, unique per creator within the workspace. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.UpdateInternRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - update_intern_request=components.UpdateInternRequest( - description=description, - instructions=instructions, - model=model, - name=name, - ), - ) - - req = self._build_request_async( - method="PATCH", - path="/interns/{internId}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.UpdateInternGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.update_intern_request, - False, - False, - "json", - components.UpdateInternRequest, - ), - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="updateIntern", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.Intern, http_res) - if utils.match_response( - http_res, - ["400", "401", "403", "404", "408", "409", "413", "415"], - "application/json", - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - def get_intern_connections( - self, - *, - intern_id: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.InternConnectionList: - r"""List an intern's connections - - 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 `api_key` from the global security. - - :param intern_id: ID of an intern visible to the authenticated API key. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.GetInternConnectionsRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - ) - - req = self._build_request( - method="GET", - path="/interns/{internId}/connections", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.GetInternConnectionsGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="getInternConnections", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.InternConnectionList, http_res) - if utils.match_response( - http_res, ["401", "403", "404", "408"], "application/json" - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - async def get_intern_connections_async( - self, - *, - intern_id: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.InternConnectionList: - r"""List an intern's connections - - 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 `api_key` from the global security. - - :param intern_id: ID of an intern visible to the authenticated API key. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.GetInternConnectionsRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - ) - - req = self._build_request_async( - method="GET", - path="/interns/{internId}/connections", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.GetInternConnectionsGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="getInternConnections", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.InternConnectionList, http_res) - if utils.match_response( - http_res, ["401", "403", "404", "408"], "application/json" - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - def get_intern_daemon( - self, - *, - intern_id: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.InternDaemonAccess: - r"""Get an intern's daemon access - - 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 `api_key` from the global security. - - :param intern_id: ID of an intern visible to the authenticated API key. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.GetInternDaemonRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - ) - - req = self._build_request( - method="GET", - path="/interns/{internId}/daemon", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.GetInternDaemonGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="getInternDaemon", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.InternDaemonAccess, http_res) - if utils.match_response( - http_res, ["401", "403", "404", "408", "409"], "application/json" - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - async def get_intern_daemon_async( - self, - *, - intern_id: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.InternDaemonAccess: - r"""Get an intern's daemon access - - 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 `api_key` from the global security. - - :param intern_id: ID of an intern visible to the authenticated API key. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.GetInternDaemonRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - ) - - req = self._build_request_async( - method="GET", - path="/interns/{internId}/daemon", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.GetInternDaemonGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="getInternDaemon", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.InternDaemonAccess, http_res) - if utils.match_response( - http_res, ["401", "403", "404", "408", "409"], "application/json" - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - @deprecated( - "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." - ) - def get_intern_daemon_access( - self, - *, - intern_id: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.InternDaemonAccess: - r"""Get an intern's daemon access (deprecated alias) - - 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 `api_key` from the global security. - - :param intern_id: ID of an intern visible to the authenticated API key. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.GetInternDaemonAccessRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - ) - - req = self._build_request( - method="GET", - path="/interns/{internId}/daemon-access", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.GetInternDaemonAccessGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="getInternDaemonAccess", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.InternDaemonAccess, http_res) - if utils.match_response( - http_res, ["401", "403", "404", "408", "409"], "application/json" - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - @deprecated( - "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." - ) - async def get_intern_daemon_access_async( - self, - *, - intern_id: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.InternDaemonAccess: - r"""Get an intern's daemon access (deprecated alias) - - 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 `api_key` from the global security. - - :param intern_id: ID of an intern visible to the authenticated API key. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.GetInternDaemonAccessRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - ) - - req = self._build_request_async( - method="GET", - path="/interns/{internId}/daemon-access", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.GetInternDaemonAccessGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="getInternDaemonAccess", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.InternDaemonAccess, http_res) - if utils.match_response( - http_res, ["401", "403", "404", "408", "409"], "application/json" - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - @deprecated( - "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." - ) - def sign_intern_daemon_access_request( - self, - *, - intern_id: str, - body_sha256: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - route: Optional[Union[components.Route, components.RouteTypedDict]] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> operations.SignInternDaemonAccessRequestResponse: - r"""Sign a daemon request with the caller's identity (deprecated alias) - - 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 `api_key` from the global security. - - :param intern_id: ID of an intern visible to the authenticated API key. - :param body_sha256: Lower-case hex SHA-256 of the exact bytes the CLI will send as the daemon request body. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param 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`). - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.SignInternDaemonAccessRequestRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - sign_intern_daemon_request=components.SignInternDaemonRequest( - body_sha256=body_sha256, - route=utils.get_pydantic_model(route, Optional[components.Route]), - ), - ) - - req = self._build_request( - method="POST", - path="/interns/{internId}/daemon-access/sign", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.SignInternDaemonAccessRequestGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.sign_intern_daemon_request, - False, - False, - "json", - components.SignInternDaemonRequest, - ), - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="signInternDaemonAccessRequest", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return operations.SignInternDaemonAccessRequestResponse( - result=unmarshal_json_response( - components.SignInternDaemonResponse, http_res - ), - headers={}, - ) - if utils.match_response( - http_res, - ["400", "401", "403", "404", "408", "413", "415"], - "application/json", - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "429", "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - @deprecated( - "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." - ) - async def sign_intern_daemon_access_request_async( - self, - *, - intern_id: str, - body_sha256: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - route: Optional[Union[components.Route, components.RouteTypedDict]] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> operations.SignInternDaemonAccessRequestResponse: - r"""Sign a daemon request with the caller's identity (deprecated alias) - - 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 `api_key` from the global security. - - :param intern_id: ID of an intern visible to the authenticated API key. - :param body_sha256: Lower-case hex SHA-256 of the exact bytes the CLI will send as the daemon request body. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param 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`). - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.SignInternDaemonAccessRequestRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - sign_intern_daemon_request=components.SignInternDaemonRequest( - body_sha256=body_sha256, - route=utils.get_pydantic_model(route, Optional[components.Route]), - ), - ) - - req = self._build_request_async( - method="POST", - path="/interns/{internId}/daemon-access/sign", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.SignInternDaemonAccessRequestGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.sign_intern_daemon_request, - False, - False, - "json", - components.SignInternDaemonRequest, - ), - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="signInternDaemonAccessRequest", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return operations.SignInternDaemonAccessRequestResponse( - result=unmarshal_json_response( - components.SignInternDaemonResponse, http_res - ), - headers={}, - ) - if utils.match_response( - http_res, - ["400", "401", "403", "404", "408", "413", "415"], - "application/json", - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "429", "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - def sign_intern_daemon_request( - self, - *, - intern_id: str, - body_sha256: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - route: Optional[Union[components.Route, components.RouteTypedDict]] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> operations.SignInternDaemonRequestResponse: - r"""Sign a daemon request with the caller's identity - - 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 `api_key` from the global security. - - :param intern_id: ID of an intern visible to the authenticated API key. - :param body_sha256: Lower-case hex SHA-256 of the exact bytes the CLI will send as the daemon request body. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param 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`). - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.SignInternDaemonRequestRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - sign_intern_daemon_request=components.SignInternDaemonRequest( - body_sha256=body_sha256, - route=utils.get_pydantic_model(route, Optional[components.Route]), - ), - ) - - req = self._build_request( - method="POST", - path="/interns/{internId}/daemon/sign", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.SignInternDaemonRequestGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.sign_intern_daemon_request, - False, - False, - "json", - components.SignInternDaemonRequest, - ), - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="signInternDaemonRequest", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return operations.SignInternDaemonRequestResponse( - result=unmarshal_json_response( - components.SignInternDaemonResponse, http_res - ), - headers={}, - ) - if utils.match_response( - http_res, - ["400", "401", "403", "404", "408", "413", "415"], - "application/json", - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "429", "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - async def sign_intern_daemon_request_async( - self, - *, - intern_id: str, - body_sha256: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - route: Optional[Union[components.Route, components.RouteTypedDict]] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> operations.SignInternDaemonRequestResponse: - r"""Sign a daemon request with the caller's identity - - 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 `api_key` from the global security. - - :param intern_id: ID of an intern visible to the authenticated API key. - :param body_sha256: Lower-case hex SHA-256 of the exact bytes the CLI will send as the daemon request body. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param 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`). - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.SignInternDaemonRequestRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - sign_intern_daemon_request=components.SignInternDaemonRequest( - body_sha256=body_sha256, - route=utils.get_pydantic_model(route, Optional[components.Route]), - ), - ) - - req = self._build_request_async( - method="POST", - path="/interns/{internId}/daemon/sign", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.SignInternDaemonRequestGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.sign_intern_daemon_request, - False, - False, - "json", - components.SignInternDaemonRequest, - ), - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="signInternDaemonRequest", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return operations.SignInternDaemonRequestResponse( - result=unmarshal_json_response( - components.SignInternDaemonResponse, http_res - ), - headers={}, - ) - if utils.match_response( - http_res, - ["400", "401", "403", "404", "408", "413", "415"], - "application/json", - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "429", "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - def get_intern_icon( - self, - *, - intern_id: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - v: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> httpx.Response: - r"""Get an intern's icon - - 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 `api_key` from the global security. - - :param intern_id: ID of an intern visible to the authenticated API key. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param v: The `icon_sha256` the caller expects. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.GetInternIconRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - v=v, - ) - - req = self._build_request( - method="GET", - path="/interns/{internId}/icon", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="image/*", - http_headers=http_headers, - _globals=operations.GetInternIconGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="getInternIcon", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - stream=True, - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "image/*"): - return http_res - if utils.match_response( - http_res, ["401", "403", "404", "408"], "application/json" - ): - http_res_text = utils.stream_to_text(http_res) - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res, http_res_text - ) - raise errors.InternLifecycleError(response_data, http_res, http_res_text) - if utils.match_response(http_res, "500", "application/json"): - http_res_text = utils.stream_to_text(http_res) - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res, http_res_text - ) - raise errors.InternLifecycleError(response_data, http_res, http_res_text) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "Unexpected response received", http_res, http_res_text - ) - - async def get_intern_icon_async( - self, - *, - intern_id: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - v: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> httpx.Response: - r"""Get an intern's icon - - 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 `api_key` from the global security. - - :param intern_id: ID of an intern visible to the authenticated API key. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param v: The `icon_sha256` the caller expects. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.GetInternIconRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - v=v, - ) - - req = self._build_request_async( - method="GET", - path="/interns/{internId}/icon", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="image/*", - http_headers=http_headers, - _globals=operations.GetInternIconGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="getInternIcon", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - stream=True, - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "image/*"): - return http_res - if utils.match_response( - http_res, ["401", "403", "404", "408"], "application/json" - ): - http_res_text = await utils.stream_to_text_async(http_res) - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res, http_res_text - ) - raise errors.InternLifecycleError(response_data, http_res, http_res_text) - if utils.match_response(http_res, "500", "application/json"): - http_res_text = await utils.stream_to_text_async(http_res) - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res, http_res_text - ) - raise errors.InternLifecycleError(response_data, http_res, http_res_text) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "Unexpected response received", http_res, http_res_text - ) - - def provision_intern( - self, - *, - intern_id: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.ProvisionInternResponse: - r"""Provision an intern - - 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 `api_key` from the global security. - - :param intern_id: ID of an intern visible to the authenticated API key. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.ProvisionInternRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - ) - - req = self._build_request( - method="POST", - path="/interns/{internId}/provision", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.ProvisionInternGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="provisionIntern", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "202", "application/json"): - return unmarshal_json_response(components.ProvisionInternResponse, http_res) - if utils.match_response( - http_res, - ["400", "401", "403", "404", "408", "409", "413", "415"], - "application/json", - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, ["500", "502"], "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - async def provision_intern_async( - self, - *, - intern_id: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.ProvisionInternResponse: - r"""Provision an intern - - 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 `api_key` from the global security. - - :param intern_id: ID of an intern visible to the authenticated API key. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.ProvisionInternRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - ) - - req = self._build_request_async( - method="POST", - path="/interns/{internId}/provision", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.ProvisionInternGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="provisionIntern", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "202", "application/json"): - return unmarshal_json_response(components.ProvisionInternResponse, http_res) - if utils.match_response( - http_res, - ["400", "401", "403", "404", "408", "409", "413", "415"], - "application/json", - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, ["500", "502"], "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - def suspend_intern( - self, - *, - intern_id: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.SuspendInternResponse: - r"""Suspend an intern - - 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 `api_key` from the global security. - - :param intern_id: ID of an intern visible to the authenticated API key. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.SuspendInternRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - ) - - req = self._build_request( - method="POST", - path="/interns/{internId}/suspend", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.SuspendInternGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="suspendIntern", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.SuspendInternResponse, http_res) - if utils.match_response( - http_res, - ["400", "401", "403", "404", "408", "409", "413", "415"], - "application/json", - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, ["500", "502"], "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - async def suspend_intern_async( - self, - *, - intern_id: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> components.SuspendInternResponse: - r"""Suspend an intern - - 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 `api_key` from the global security. - - :param intern_id: ID of an intern visible to the authenticated API key. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.SuspendInternRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - ) - - req = self._build_request_async( - method="POST", - path="/interns/{internId}/suspend", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.SuspendInternGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="suspendIntern", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(components.SuspendInternResponse, http_res) - if utils.match_response( - http_res, - ["400", "401", "403", "404", "408", "409", "413", "415"], - "application/json", - ): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, ["500", "502"], "application/json"): - response_data = unmarshal_json_response( - errors.InternLifecycleErrorData, http_res - ) - raise errors.InternLifecycleError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - def chat( - self, - *, - intern_id: str, - messages: Union[ - Iterable[components.InternChatMessage], - Iterable[components.InternChatMessageTypedDict], - ], - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - approval_mode: Optional[components.InternApprovalMode] = None, - model: Optional[str] = None, - session_id: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - accept_header_override: Optional[ChatAcceptEnum] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> operations.CreateInternChatCompletionResponse: - r"""Stream a chat completion with an intern - - 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 `api_key` from the global security. - - :param intern_id: The intern to talk to. - :param messages: 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`. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param approval_mode: How the run started by this prompt handles tool approvals. `self-drive` (the default when omitted) consents on your behalf and runs the shell unsandboxed. `manual` asks you before an approval-bearing tool runs, as an `openrouter.provide_input` permission request, and keeps the shell sandboxed until an escalation is allowed. The mode applies to the run this prompt starts and is not remembered by the session. Repeat it on each new prompt that should use it. A `tool` reply continues the run under the mode it started with. - :param model: Accepted for OpenAI compatibility and never used. The intern runs the model configured on it (`PATCH` the intern to change it). Streamed chunks report the runtime's identifier for that model as the intern reports it, or `openrouter/intern` on chunks whose event carries no model (before the intern reports one, and on the chunks the API emits itself: the timeout, run-ended and severed-stream error chunks, the stop chunk of a replay that ends without a terminal daemon event, and the final usage chunk after any of them). A usage chunk that follows a daemon completion event carries the model the intern reported. - :param session_id: The daemon session to continue, as returned in `session_id` on the final chunk of an earlier response. Omit it to start a new session. An id the intern has not seen before is not an error: it starts a new session under that id, so a mistyped id forks the conversation. Sessions are scoped to the intern's own daemon. Required when the last message has role `tool`. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param accept_header_override: Override the default accept header for this method - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.CreateInternChatCompletionRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - intern_chat_completion_request=components.InternChatCompletionRequest( - approval_mode=approval_mode, - messages=utils.get_pydantic_model( - messages, List[components.InternChatMessage] - ), - model=model, - session_id=session_id, - ), - ) - - req = self._build_request( - method="POST", - path="/interns/{internId}/chat/completions", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value=accept_header_override.value - if accept_header_override is not None - else "application/json;q=1, text/event-stream;q=0", - http_headers=http_headers, - _globals=operations.CreateInternChatCompletionGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.intern_chat_completion_request, - False, - False, - "json", - components.InternChatCompletionRequest, - ), - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="createInternChatCompletion", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - stream=True, - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "text/event-stream"): - return operations.CreateInternChatCompletionResponse( - result=eventstreaming.EventStream( - http_res, - lambda raw: unmarshal_json_response( - components.InternChatStreamingResponse, http_res, raw - ).data, - sentinel="[DONE]", - client_ref=self, - ), - headers={}, - ) - if utils.match_response(http_res, "200", "application/json"): - http_res_text = utils.stream_to_text(http_res) - return operations.CreateInternChatCompletionResponse( - result=unmarshal_json_response( - components.InternChatCompletionChunk, http_res, http_res_text - ), - headers={}, - ) - if utils.match_response(http_res, "202", "application/json"): - http_res_text = utils.stream_to_text(http_res) - return operations.CreateInternChatCompletionResponse( - result=unmarshal_json_response( - components.InternChatSteeredResponse, http_res, http_res_text - ), - headers={}, - ) - if utils.match_response( - http_res, - ["400", "401", "403", "404", "408", "410", "413"], - "application/json", - ): - http_res_text = utils.stream_to_text(http_res) - response_data = unmarshal_json_response( - errors.InternChatErrorResponseData, http_res, http_res_text - ) - raise errors.InternChatErrorResponse(response_data, http_res, http_res_text) - if utils.match_response(http_res, ["409", "429"], "application/json"): - http_res_text = utils.stream_to_text(http_res) - response_data = unmarshal_json_response( - errors.InternChatErrorResponseData, http_res, http_res_text - ) - raise errors.InternChatErrorResponse(response_data, http_res, http_res_text) - if utils.match_response(http_res, "503", "application/json"): - http_res_text = utils.stream_to_text(http_res) - response_data = unmarshal_json_response( - errors.InternChatErrorResponseData, http_res, http_res_text - ) - raise errors.InternChatErrorResponse(response_data, http_res, http_res_text) - if utils.match_response(http_res, ["502", "504"], "application/json"): - http_res_text = utils.stream_to_text(http_res) - response_data = unmarshal_json_response( - errors.InternChatErrorResponseData, http_res, http_res_text - ) - raise errors.InternChatErrorResponse(response_data, http_res, http_res_text) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "Unexpected response received", http_res, http_res_text - ) - - async def chat_async( - self, - *, - intern_id: str, - messages: Union[ - Iterable[components.InternChatMessage], - Iterable[components.InternChatMessageTypedDict], - ], - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - approval_mode: Optional[components.InternApprovalMode] = None, - model: Optional[str] = None, - session_id: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - accept_header_override: Optional[ChatAcceptEnum] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> operations.CreateInternChatCompletionResponse: - r"""Stream a chat completion with an intern - - 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 `api_key` from the global security. - - :param intern_id: The intern to talk to. - :param messages: 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`. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param approval_mode: How the run started by this prompt handles tool approvals. `self-drive` (the default when omitted) consents on your behalf and runs the shell unsandboxed. `manual` asks you before an approval-bearing tool runs, as an `openrouter.provide_input` permission request, and keeps the shell sandboxed until an escalation is allowed. The mode applies to the run this prompt starts and is not remembered by the session. Repeat it on each new prompt that should use it. A `tool` reply continues the run under the mode it started with. - :param model: Accepted for OpenAI compatibility and never used. The intern runs the model configured on it (`PATCH` the intern to change it). Streamed chunks report the runtime's identifier for that model as the intern reports it, or `openrouter/intern` on chunks whose event carries no model (before the intern reports one, and on the chunks the API emits itself: the timeout, run-ended and severed-stream error chunks, the stop chunk of a replay that ends without a terminal daemon event, and the final usage chunk after any of them). A usage chunk that follows a daemon completion event carries the model the intern reported. - :param session_id: The daemon session to continue, as returned in `session_id` on the final chunk of an earlier response. Omit it to start a new session. An id the intern has not seen before is not an error: it starts a new session under that id, so a mistyped id forks the conversation. Sessions are scoped to the intern's own daemon. Required when the last message has role `tool`. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param accept_header_override: Override the default accept header for this method - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.CreateInternChatCompletionRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - intern_chat_completion_request=components.InternChatCompletionRequest( - approval_mode=approval_mode, - messages=utils.get_pydantic_model( - messages, List[components.InternChatMessage] - ), - model=model, - session_id=session_id, - ), - ) - - req = self._build_request_async( - method="POST", - path="/interns/{internId}/chat/completions", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value=accept_header_override.value - if accept_header_override is not None - else "application/json;q=1, text/event-stream;q=0", - http_headers=http_headers, - _globals=operations.CreateInternChatCompletionGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.intern_chat_completion_request, - False, - False, - "json", - components.InternChatCompletionRequest, - ), - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="createInternChatCompletion", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - stream=True, - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "text/event-stream"): - return operations.CreateInternChatCompletionResponse( - result=eventstreaming.EventStreamAsync( - http_res, - lambda raw: unmarshal_json_response( - components.InternChatStreamingResponse, http_res, raw - ).data, - sentinel="[DONE]", - client_ref=self, - ), - headers={}, - ) - if utils.match_response(http_res, "200", "application/json"): - http_res_text = await utils.stream_to_text_async(http_res) - return operations.CreateInternChatCompletionResponse( - result=unmarshal_json_response( - components.InternChatCompletionChunk, http_res, http_res_text - ), - headers={}, - ) - if utils.match_response(http_res, "202", "application/json"): - http_res_text = await utils.stream_to_text_async(http_res) - return operations.CreateInternChatCompletionResponse( - result=unmarshal_json_response( - components.InternChatSteeredResponse, http_res, http_res_text - ), - headers={}, - ) - if utils.match_response( - http_res, - ["400", "401", "403", "404", "408", "410", "413"], - "application/json", - ): - http_res_text = await utils.stream_to_text_async(http_res) - response_data = unmarshal_json_response( - errors.InternChatErrorResponseData, http_res, http_res_text - ) - raise errors.InternChatErrorResponse(response_data, http_res, http_res_text) - if utils.match_response(http_res, ["409", "429"], "application/json"): - http_res_text = await utils.stream_to_text_async(http_res) - response_data = unmarshal_json_response( - errors.InternChatErrorResponseData, http_res, http_res_text - ) - raise errors.InternChatErrorResponse(response_data, http_res, http_res_text) - if utils.match_response(http_res, "503", "application/json"): - http_res_text = await utils.stream_to_text_async(http_res) - response_data = unmarshal_json_response( - errors.InternChatErrorResponseData, http_res, http_res_text - ) - raise errors.InternChatErrorResponse(response_data, http_res, http_res_text) - if utils.match_response(http_res, ["502", "504"], "application/json"): - http_res_text = await utils.stream_to_text_async(http_res) - response_data = unmarshal_json_response( - errors.InternChatErrorResponseData, http_res, http_res_text - ) - raise errors.InternChatErrorResponse(response_data, http_res, http_res_text) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "Unexpected response received", http_res, http_res_text - ) - - def invoke( - self, - *, - intern_id: str, - input: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - session_id: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> operations.InvokeInternResponse: - r"""Start an intern run without waiting for it - - 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 `api_key` from the global security. - - :param intern_id: The intern to run. - :param input: The prompt for the run, at most 32000 characters. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param session_id: 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`. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.InvokeInternRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - intern_invoke_request=components.InternInvokeRequest( - input=input, - session_id=session_id, - ), - ) - - req = self._build_request( - method="POST", - path="/interns/{internId}/invoke", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.InvokeInternGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.intern_invoke_request, - False, - False, - "json", - components.InternInvokeRequest, - ), - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="invokeIntern", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "202", "application/json"): - return operations.InvokeInternResponse( - result=unmarshal_json_response( - components.InternInvokeAcceptedResponse, http_res - ), - headers={}, - ) - if utils.match_response( - http_res, ["400", "401", "403", "404", "408", "413"], "application/json" - ): - response_data = unmarshal_json_response( - errors.InternChatErrorResponseData, http_res - ) - raise errors.InternChatErrorResponse(response_data, http_res) - if utils.match_response(http_res, ["409", "429"], "application/json"): - response_data = unmarshal_json_response( - errors.InternChatErrorResponseData, http_res - ) - raise errors.InternChatErrorResponse(response_data, http_res) - if utils.match_response(http_res, "503", "application/json"): - response_data = unmarshal_json_response( - errors.InternChatErrorResponseData, http_res - ) - raise errors.InternChatErrorResponse(response_data, http_res) - if utils.match_response(http_res, ["500", "502", "504"], "application/json"): - response_data = unmarshal_json_response( - errors.InternChatErrorResponseData, http_res - ) - raise errors.InternChatErrorResponse(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - async def invoke_async( - self, - *, - intern_id: str, - input: str, - http_referer: Optional[str] = None, - x_open_router_title: Optional[str] = None, - x_open_router_categories: Optional[str] = None, - session_id: Optional[str] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> operations.InvokeInternResponse: - r"""Start an intern run without waiting for it - - 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 `api_key` from the global security. - - :param intern_id: The intern to run. - :param input: The prompt for the run, at most 32000 characters. - :param http_referer: 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. - - :param x_open_router_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - :param session_id: 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`. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.InvokeInternRequest( - http_referer=http_referer, - x_open_router_title=x_open_router_title, - x_open_router_categories=x_open_router_categories, - intern_id=intern_id, - intern_invoke_request=components.InternInvokeRequest( - input=input, - session_id=session_id, - ), - ) - - req = self._build_request_async( - method="POST", - path="/interns/{internId}/invoke", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=True, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - _globals=operations.InvokeInternGlobals( - http_referer=self.sdk_configuration.globals.http_referer, - x_open_router_title=self.sdk_configuration.globals.x_open_router_title, - x_open_router_categories=self.sdk_configuration.globals.x_open_router_categories, - ), - security=self.sdk_configuration.security, - get_serialized_body=lambda: utils.serialize_request_body( - request.intern_invoke_request, - False, - False, - "json", - components.InternInvokeRequest, - ), - allow_empty_value=None, - allowed_fields=["api_key"], - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5XX"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="invokeIntern", - oauth2_scopes=None, - security_source=get_security_from_env( - self.sdk_configuration.security, components.Security - ), - tags=["Interns"], - extensions=None, - ), - request=req, - is_error_status_code=lambda c: utils.match_status_codes(["4XX", "5XX"], c), - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "202", "application/json"): - return operations.InvokeInternResponse( - result=unmarshal_json_response( - components.InternInvokeAcceptedResponse, http_res - ), - headers={}, - ) - if utils.match_response( - http_res, ["400", "401", "403", "404", "408", "413"], "application/json" - ): - response_data = unmarshal_json_response( - errors.InternChatErrorResponseData, http_res - ) - raise errors.InternChatErrorResponse(response_data, http_res) - if utils.match_response(http_res, ["409", "429"], "application/json"): - response_data = unmarshal_json_response( - errors.InternChatErrorResponseData, http_res - ) - raise errors.InternChatErrorResponse(response_data, http_res) - if utils.match_response(http_res, "503", "application/json"): - response_data = unmarshal_json_response( - errors.InternChatErrorResponseData, http_res - ) - raise errors.InternChatErrorResponse(response_data, http_res) - if utils.match_response(http_res, ["500", "502", "504"], "application/json"): - response_data = unmarshal_json_response( - errors.InternChatErrorResponseData, http_res - ) - raise errors.InternChatErrorResponse(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) diff --git a/src/openrouter/operations/__init__.py b/src/openrouter/operations/__init__.py index 352e1b49..6ddf9ad7 100644 --- a/src/openrouter/operations/__init__.py +++ b/src/openrouter/operations/__init__.py @@ -167,22 +167,6 @@ CreateImagesResponse, CreateImagesResponseTypedDict, ) - from .createintern import ( - CreateInternGlobals, - CreateInternGlobalsTypedDict, - CreateInternRequest, - CreateInternRequestTypedDict, - ) - from .createinternchatcompletion import ( - CreateInternChatCompletionGlobals, - CreateInternChatCompletionGlobalsTypedDict, - CreateInternChatCompletionRequest, - CreateInternChatCompletionRequestTypedDict, - CreateInternChatCompletionResponse, - CreateInternChatCompletionResponseResult, - CreateInternChatCompletionResponseResultTypedDict, - CreateInternChatCompletionResponseTypedDict, - ) from .createkeys import ( CreateKeysData, CreateKeysDataTypedDict, @@ -326,12 +310,6 @@ DeleteGuardrailRequest, DeleteGuardrailRequestTypedDict, ) - from .deleteintern import ( - DeleteInternGlobals, - DeleteInternGlobalsTypedDict, - DeleteInternRequest, - DeleteInternRequestTypedDict, - ) from .deleteinternvaultsecret import ( DeleteInternVaultSecretGlobals, DeleteInternVaultSecretGlobalsTypedDict, @@ -530,36 +508,6 @@ GetGuardrailRequest, GetGuardrailRequestTypedDict, ) - from .getintern import ( - GetInternGlobals, - GetInternGlobalsTypedDict, - GetInternRequest, - GetInternRequestTypedDict, - ) - from .getinternconnections import ( - GetInternConnectionsGlobals, - GetInternConnectionsGlobalsTypedDict, - GetInternConnectionsRequest, - GetInternConnectionsRequestTypedDict, - ) - from .getinterndaemon import ( - GetInternDaemonGlobals, - GetInternDaemonGlobalsTypedDict, - GetInternDaemonRequest, - GetInternDaemonRequestTypedDict, - ) - from .getinterndaemonaccess import ( - GetInternDaemonAccessGlobals, - GetInternDaemonAccessGlobalsTypedDict, - GetInternDaemonAccessRequest, - GetInternDaemonAccessRequestTypedDict, - ) - from .getinternicon import ( - GetInternIconGlobals, - GetInternIconGlobalsTypedDict, - GetInternIconRequest, - GetInternIconRequestTypedDict, - ) from .getkey import ( GetKeyData, GetKeyDataTypedDict, @@ -695,14 +643,6 @@ GetWorkspaceBudgetRequest, GetWorkspaceBudgetRequestTypedDict, ) - from .invokeintern import ( - InvokeInternGlobals, - InvokeInternGlobalsTypedDict, - InvokeInternRequest, - InvokeInternRequestTypedDict, - InvokeInternResponse, - InvokeInternResponseTypedDict, - ) from .list import ( ListData, ListDataTypedDict, @@ -835,13 +775,6 @@ ListInternEffectiveVaultSecretsRequest, ListInternEffectiveVaultSecretsRequestTypedDict, ) - from .listinterns import ( - ListInternsGlobals, - ListInternsGlobalsTypedDict, - ListInternsRequest, - ListInternsRequestTypedDict, - Status, - ) from .listinternvaultsecrets import ( ListInternVaultSecretsGlobals, ListInternVaultSecretsGlobalsTypedDict, @@ -1013,12 +946,6 @@ PromoteContainerFileRequest, PromoteContainerFileRequestTypedDict, ) - from .provisionintern import ( - ProvisionInternGlobals, - ProvisionInternGlobalsTypedDict, - ProvisionInternRequest, - ProvisionInternRequestTypedDict, - ) from .queryanalytics import ( ClassifierDimensions, ClassifierDimensionsTypedDict, @@ -1064,22 +991,6 @@ SendChatCompletionRequestResponse, SendChatCompletionRequestResponseTypedDict, ) - from .signinterndaemonaccessrequest import ( - SignInternDaemonAccessRequestGlobals, - SignInternDaemonAccessRequestGlobalsTypedDict, - SignInternDaemonAccessRequestRequest, - SignInternDaemonAccessRequestRequestTypedDict, - SignInternDaemonAccessRequestResponse, - SignInternDaemonAccessRequestResponseTypedDict, - ) - from .signinterndaemonrequest import ( - SignInternDaemonRequestGlobals, - SignInternDaemonRequestGlobalsTypedDict, - SignInternDaemonRequestRequest, - SignInternDaemonRequestRequestTypedDict, - SignInternDaemonRequestResponse, - SignInternDaemonRequestResponseTypedDict, - ) from .storeinternvaultsecret import ( StoreInternVaultSecretGlobals, StoreInternVaultSecretGlobalsTypedDict, @@ -1098,12 +1009,6 @@ SubmitGenerationFeedbackRequest, SubmitGenerationFeedbackRequestTypedDict, ) - from .suspendintern import ( - SuspendInternGlobals, - SuspendInternGlobalsTypedDict, - SuspendInternRequest, - SuspendInternRequestTypedDict, - ) from .updatebyokkey import ( UpdateBYOKKeyGlobals, UpdateBYOKKeyGlobalsTypedDict, @@ -1122,12 +1027,6 @@ UpdateGuardrailRequest, UpdateGuardrailRequestTypedDict, ) - from .updateintern import ( - UpdateInternGlobals, - UpdateInternGlobalsTypedDict, - UpdateInternRequest, - UpdateInternRequestTypedDict, - ) from .updatekeys import ( UpdateKeysData, UpdateKeysDataTypedDict, @@ -1322,18 +1221,6 @@ "CreateImagesRequestTypedDict", "CreateImagesResponse", "CreateImagesResponseTypedDict", - "CreateInternChatCompletionGlobals", - "CreateInternChatCompletionGlobalsTypedDict", - "CreateInternChatCompletionRequest", - "CreateInternChatCompletionRequestTypedDict", - "CreateInternChatCompletionResponse", - "CreateInternChatCompletionResponseResult", - "CreateInternChatCompletionResponseResultTypedDict", - "CreateInternChatCompletionResponseTypedDict", - "CreateInternGlobals", - "CreateInternGlobalsTypedDict", - "CreateInternRequest", - "CreateInternRequestTypedDict", "CreateKeysData", "CreateKeysDataTypedDict", "CreateKeysGlobals", @@ -1430,10 +1317,6 @@ "DeleteGuardrailGlobalsTypedDict", "DeleteGuardrailRequest", "DeleteGuardrailRequestTypedDict", - "DeleteInternGlobals", - "DeleteInternGlobalsTypedDict", - "DeleteInternRequest", - "DeleteInternRequestTypedDict", "DeleteInternVaultSecretGlobals", "DeleteInternVaultSecretGlobalsTypedDict", "DeleteInternVaultSecretRequest", @@ -1576,26 +1459,6 @@ "GetGuardrailGlobalsTypedDict", "GetGuardrailRequest", "GetGuardrailRequestTypedDict", - "GetInternConnectionsGlobals", - "GetInternConnectionsGlobalsTypedDict", - "GetInternConnectionsRequest", - "GetInternConnectionsRequestTypedDict", - "GetInternDaemonAccessGlobals", - "GetInternDaemonAccessGlobalsTypedDict", - "GetInternDaemonAccessRequest", - "GetInternDaemonAccessRequestTypedDict", - "GetInternDaemonGlobals", - "GetInternDaemonGlobalsTypedDict", - "GetInternDaemonRequest", - "GetInternDaemonRequestTypedDict", - "GetInternGlobals", - "GetInternGlobalsTypedDict", - "GetInternIconGlobals", - "GetInternIconGlobalsTypedDict", - "GetInternIconRequest", - "GetInternIconRequestTypedDict", - "GetInternRequest", - "GetInternRequestTypedDict", "GetKeyData", "GetKeyDataTypedDict", "GetKeyGlobals", @@ -1696,12 +1559,6 @@ "InputTypedDict", "InputUnion", "InputUnionTypedDict", - "InvokeInternGlobals", - "InvokeInternGlobalsTypedDict", - "InvokeInternRequest", - "InvokeInternRequestTypedDict", - "InvokeInternResponse", - "InvokeInternResponseTypedDict", "KeepMembers", "KeepMembersEnum", "KeepMembersTypedDict", @@ -1802,10 +1659,6 @@ "ListInternVaultSecretsGlobalsTypedDict", "ListInternVaultSecretsRequest", "ListInternVaultSecretsRequestTypedDict", - "ListInternsGlobals", - "ListInternsGlobalsTypedDict", - "ListInternsRequest", - "ListInternsRequestTypedDict", "ListKeyAssignmentsGlobals", "ListKeyAssignmentsGlobalsTypedDict", "ListKeyAssignmentsRequest", @@ -1946,10 +1799,6 @@ "PromptTokensDetails", "PromptTokensDetailsTypedDict", "Provider", - "ProvisionInternGlobals", - "ProvisionInternGlobalsTypedDict", - "ProvisionInternRequest", - "ProvisionInternRequestTypedDict", "QueryAnalyticsData1", "QueryAnalyticsData1TypedDict", "QueryAnalyticsData2", @@ -1976,20 +1825,7 @@ "SendChatCompletionRequestRequestTypedDict", "SendChatCompletionRequestResponse", "SendChatCompletionRequestResponseTypedDict", - "SignInternDaemonAccessRequestGlobals", - "SignInternDaemonAccessRequestGlobalsTypedDict", - "SignInternDaemonAccessRequestRequest", - "SignInternDaemonAccessRequestRequestTypedDict", - "SignInternDaemonAccessRequestResponse", - "SignInternDaemonAccessRequestResponseTypedDict", - "SignInternDaemonRequestGlobals", - "SignInternDaemonRequestGlobalsTypedDict", - "SignInternDaemonRequestRequest", - "SignInternDaemonRequestRequestTypedDict", - "SignInternDaemonRequestResponse", - "SignInternDaemonRequestResponseTypedDict", "Source", - "Status", "StoreInternVaultSecretGlobals", "StoreInternVaultSecretGlobalsTypedDict", "StoreInternVaultSecretRequest", @@ -2003,10 +1839,6 @@ "SubmitGenerationFeedbackGlobalsTypedDict", "SubmitGenerationFeedbackRequest", "SubmitGenerationFeedbackRequestTypedDict", - "SuspendInternGlobals", - "SuspendInternGlobalsTypedDict", - "SuspendInternRequest", - "SuspendInternRequestTypedDict", "TaskType", "TimeRange", "TimeRangeTypedDict", @@ -2026,10 +1858,6 @@ "UpdateGuardrailGlobalsTypedDict", "UpdateGuardrailRequest", "UpdateGuardrailRequestTypedDict", - "UpdateInternGlobals", - "UpdateInternGlobalsTypedDict", - "UpdateInternRequest", - "UpdateInternRequestTypedDict", "UpdateKeysData", "UpdateKeysDataTypedDict", "UpdateKeysGlobals", @@ -2220,18 +2048,6 @@ "CreateImagesRequestTypedDict": ".createimages", "CreateImagesResponse": ".createimages", "CreateImagesResponseTypedDict": ".createimages", - "CreateInternGlobals": ".createintern", - "CreateInternGlobalsTypedDict": ".createintern", - "CreateInternRequest": ".createintern", - "CreateInternRequestTypedDict": ".createintern", - "CreateInternChatCompletionGlobals": ".createinternchatcompletion", - "CreateInternChatCompletionGlobalsTypedDict": ".createinternchatcompletion", - "CreateInternChatCompletionRequest": ".createinternchatcompletion", - "CreateInternChatCompletionRequestTypedDict": ".createinternchatcompletion", - "CreateInternChatCompletionResponse": ".createinternchatcompletion", - "CreateInternChatCompletionResponseResult": ".createinternchatcompletion", - "CreateInternChatCompletionResponseResultTypedDict": ".createinternchatcompletion", - "CreateInternChatCompletionResponseTypedDict": ".createinternchatcompletion", "CreateKeysData": ".createkeys", "CreateKeysDataTypedDict": ".createkeys", "CreateKeysGlobals": ".createkeys", @@ -2337,10 +2153,6 @@ "DeleteGuardrailGlobalsTypedDict": ".deleteguardrail", "DeleteGuardrailRequest": ".deleteguardrail", "DeleteGuardrailRequestTypedDict": ".deleteguardrail", - "DeleteInternGlobals": ".deleteintern", - "DeleteInternGlobalsTypedDict": ".deleteintern", - "DeleteInternRequest": ".deleteintern", - "DeleteInternRequestTypedDict": ".deleteintern", "DeleteInternVaultSecretGlobals": ".deleteinternvaultsecret", "DeleteInternVaultSecretGlobalsTypedDict": ".deleteinternvaultsecret", "DeleteInternVaultSecretRequest": ".deleteinternvaultsecret", @@ -2489,26 +2301,6 @@ "GetGuardrailGlobalsTypedDict": ".getguardrail", "GetGuardrailRequest": ".getguardrail", "GetGuardrailRequestTypedDict": ".getguardrail", - "GetInternGlobals": ".getintern", - "GetInternGlobalsTypedDict": ".getintern", - "GetInternRequest": ".getintern", - "GetInternRequestTypedDict": ".getintern", - "GetInternConnectionsGlobals": ".getinternconnections", - "GetInternConnectionsGlobalsTypedDict": ".getinternconnections", - "GetInternConnectionsRequest": ".getinternconnections", - "GetInternConnectionsRequestTypedDict": ".getinternconnections", - "GetInternDaemonGlobals": ".getinterndaemon", - "GetInternDaemonGlobalsTypedDict": ".getinterndaemon", - "GetInternDaemonRequest": ".getinterndaemon", - "GetInternDaemonRequestTypedDict": ".getinterndaemon", - "GetInternDaemonAccessGlobals": ".getinterndaemonaccess", - "GetInternDaemonAccessGlobalsTypedDict": ".getinterndaemonaccess", - "GetInternDaemonAccessRequest": ".getinterndaemonaccess", - "GetInternDaemonAccessRequestTypedDict": ".getinterndaemonaccess", - "GetInternIconGlobals": ".getinternicon", - "GetInternIconGlobalsTypedDict": ".getinternicon", - "GetInternIconRequest": ".getinternicon", - "GetInternIconRequestTypedDict": ".getinternicon", "GetKeyData": ".getkey", "GetKeyDataTypedDict": ".getkey", "GetKeyGlobals": ".getkey", @@ -2608,12 +2400,6 @@ "GetWorkspaceBudgetGlobalsTypedDict": ".getworkspacebudget", "GetWorkspaceBudgetRequest": ".getworkspacebudget", "GetWorkspaceBudgetRequestTypedDict": ".getworkspacebudget", - "InvokeInternGlobals": ".invokeintern", - "InvokeInternGlobalsTypedDict": ".invokeintern", - "InvokeInternRequest": ".invokeintern", - "InvokeInternRequestTypedDict": ".invokeintern", - "InvokeInternResponse": ".invokeintern", - "InvokeInternResponseTypedDict": ".invokeintern", "ListData": ".list", "ListDataTypedDict": ".list", "ListGlobals": ".list", @@ -2712,11 +2498,6 @@ "ListInternEffectiveVaultSecretsGlobalsTypedDict": ".listinterneffectivevaultsecrets", "ListInternEffectiveVaultSecretsRequest": ".listinterneffectivevaultsecrets", "ListInternEffectiveVaultSecretsRequestTypedDict": ".listinterneffectivevaultsecrets", - "ListInternsGlobals": ".listinterns", - "ListInternsGlobalsTypedDict": ".listinterns", - "ListInternsRequest": ".listinterns", - "ListInternsRequestTypedDict": ".listinterns", - "Status": ".listinterns", "ListInternVaultSecretsGlobals": ".listinternvaultsecrets", "ListInternVaultSecretsGlobalsTypedDict": ".listinternvaultsecrets", "ListInternVaultSecretsRequest": ".listinternvaultsecrets", @@ -2844,10 +2625,6 @@ "PromoteContainerFileGlobalsTypedDict": ".promotecontainerfile", "PromoteContainerFileRequest": ".promotecontainerfile", "PromoteContainerFileRequestTypedDict": ".promotecontainerfile", - "ProvisionInternGlobals": ".provisionintern", - "ProvisionInternGlobalsTypedDict": ".provisionintern", - "ProvisionInternRequest": ".provisionintern", - "ProvisionInternRequestTypedDict": ".provisionintern", "ClassifierDimensions": ".queryanalytics", "ClassifierDimensionsTypedDict": ".queryanalytics", "ClassifierFilters": ".queryanalytics", @@ -2889,18 +2666,6 @@ "SendChatCompletionRequestRequestTypedDict": ".sendchatcompletionrequest", "SendChatCompletionRequestResponse": ".sendchatcompletionrequest", "SendChatCompletionRequestResponseTypedDict": ".sendchatcompletionrequest", - "SignInternDaemonAccessRequestGlobals": ".signinterndaemonaccessrequest", - "SignInternDaemonAccessRequestGlobalsTypedDict": ".signinterndaemonaccessrequest", - "SignInternDaemonAccessRequestRequest": ".signinterndaemonaccessrequest", - "SignInternDaemonAccessRequestRequestTypedDict": ".signinterndaemonaccessrequest", - "SignInternDaemonAccessRequestResponse": ".signinterndaemonaccessrequest", - "SignInternDaemonAccessRequestResponseTypedDict": ".signinterndaemonaccessrequest", - "SignInternDaemonRequestGlobals": ".signinterndaemonrequest", - "SignInternDaemonRequestGlobalsTypedDict": ".signinterndaemonrequest", - "SignInternDaemonRequestRequest": ".signinterndaemonrequest", - "SignInternDaemonRequestRequestTypedDict": ".signinterndaemonrequest", - "SignInternDaemonRequestResponse": ".signinterndaemonrequest", - "SignInternDaemonRequestResponseTypedDict": ".signinterndaemonrequest", "StoreInternVaultSecretGlobals": ".storeinternvaultsecret", "StoreInternVaultSecretGlobalsTypedDict": ".storeinternvaultsecret", "StoreInternVaultSecretRequest": ".storeinternvaultsecret", @@ -2913,10 +2678,6 @@ "SubmitGenerationFeedbackGlobalsTypedDict": ".submitgenerationfeedback", "SubmitGenerationFeedbackRequest": ".submitgenerationfeedback", "SubmitGenerationFeedbackRequestTypedDict": ".submitgenerationfeedback", - "SuspendInternGlobals": ".suspendintern", - "SuspendInternGlobalsTypedDict": ".suspendintern", - "SuspendInternRequest": ".suspendintern", - "SuspendInternRequestTypedDict": ".suspendintern", "UpdateBYOKKeyGlobals": ".updatebyokkey", "UpdateBYOKKeyGlobalsTypedDict": ".updatebyokkey", "UpdateBYOKKeyRequest": ".updatebyokkey", @@ -2929,10 +2690,6 @@ "UpdateGuardrailGlobalsTypedDict": ".updateguardrail", "UpdateGuardrailRequest": ".updateguardrail", "UpdateGuardrailRequestTypedDict": ".updateguardrail", - "UpdateInternGlobals": ".updateintern", - "UpdateInternGlobalsTypedDict": ".updateintern", - "UpdateInternRequest": ".updateintern", - "UpdateInternRequestTypedDict": ".updateintern", "UpdateKeysData": ".updatekeys", "UpdateKeysDataTypedDict": ".updatekeys", "UpdateKeysGlobals": ".updatekeys", diff --git a/src/openrouter/operations/createintern.py b/src/openrouter/operations/createintern.py deleted file mode 100644 index 4443b789..00000000 --- a/src/openrouter/operations/createintern.py +++ /dev/null @@ -1,158 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.components import createinternrequest as components_createinternrequest -from openrouter.types import BaseModel, UNSET_SENTINEL -from openrouter.utils import FieldMetadata, HeaderMetadata, RequestMetadata -import pydantic -from pydantic import model_serializer -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class CreateInternGlobalsTypedDict(TypedDict): - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class CreateInternGlobals(BaseModel): - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -class CreateInternRequestTypedDict(TypedDict): - create_intern_request: components_createinternrequest.CreateInternRequestTypedDict - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - idempotency_key: NotRequired[str] - r"""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.""" - - -class CreateInternRequest(BaseModel): - create_intern_request: Annotated[ - components_createinternrequest.CreateInternRequest, - FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] - - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - idempotency_key: Annotated[ - Optional[str], - pydantic.Field(alias="Idempotency-Key"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""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.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - [ - "HTTP-Referer", - "X-OpenRouter-Title", - "X-OpenRouter-Categories", - "Idempotency-Key", - ] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m diff --git a/src/openrouter/operations/createinternchatcompletion.py b/src/openrouter/operations/createinternchatcompletion.py deleted file mode 100644 index e25761cb..00000000 --- a/src/openrouter/operations/createinternchatcompletion.py +++ /dev/null @@ -1,210 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.components import ( - internchatcompletionchunk as components_internchatcompletionchunk, - internchatcompletionrequest as components_internchatcompletionrequest, - internchatsteeredresponse as components_internchatsteeredresponse, -) -from openrouter.types import BaseModel, UNSET_SENTINEL -from openrouter.utils import ( - FieldMetadata, - HeaderMetadata, - PathParamMetadata, - RequestMetadata, - eventstreaming, -) -import pydantic -from pydantic import model_serializer -from typing import Dict, List, Optional, Union -from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict - - -class CreateInternChatCompletionGlobalsTypedDict(TypedDict): - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class CreateInternChatCompletionGlobals(BaseModel): - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -class CreateInternChatCompletionRequestTypedDict(TypedDict): - intern_id: str - r"""The intern to talk to.""" - intern_chat_completion_request: ( - components_internchatcompletionrequest.InternChatCompletionRequestTypedDict - ) - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class CreateInternChatCompletionRequest(BaseModel): - intern_id: Annotated[ - str, - pydantic.Field(alias="internId"), - FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), - ] - r"""The intern to talk to.""" - - intern_chat_completion_request: Annotated[ - components_internchatcompletionrequest.InternChatCompletionRequest, - FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] - - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -CreateInternChatCompletionResponseResultTypedDict = TypeAliasType( - "CreateInternChatCompletionResponseResultTypedDict", - Union[ - components_internchatsteeredresponse.InternChatSteeredResponseTypedDict, - components_internchatcompletionchunk.InternChatCompletionChunkTypedDict, - Union[ - eventstreaming.EventStream[ - components_internchatcompletionchunk.InternChatCompletionChunkTypedDict - ], - eventstreaming.EventStreamAsync[ - components_internchatcompletionchunk.InternChatCompletionChunkTypedDict - ], - ], - ], -) - - -CreateInternChatCompletionResponseResult = TypeAliasType( - "CreateInternChatCompletionResponseResult", - Union[ - components_internchatsteeredresponse.InternChatSteeredResponse, - components_internchatcompletionchunk.InternChatCompletionChunk, - Union[ - eventstreaming.EventStream[ - components_internchatcompletionchunk.InternChatCompletionChunk - ], - eventstreaming.EventStreamAsync[ - components_internchatcompletionchunk.InternChatCompletionChunk - ], - ], - ], -) - - -class CreateInternChatCompletionResponseTypedDict(TypedDict): - headers: Dict[str, List[str]] - result: CreateInternChatCompletionResponseResultTypedDict - - -class CreateInternChatCompletionResponse(BaseModel): - headers: Dict[str, List[str]] - - result: CreateInternChatCompletionResponseResult diff --git a/src/openrouter/operations/deleteintern.py b/src/openrouter/operations/deleteintern.py deleted file mode 100644 index 9595f013..00000000 --- a/src/openrouter/operations/deleteintern.py +++ /dev/null @@ -1,158 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.components import deleteinternrequest as components_deleteinternrequest -from openrouter.types import BaseModel, UNSET_SENTINEL -from openrouter.utils import ( - FieldMetadata, - HeaderMetadata, - PathParamMetadata, - RequestMetadata, -) -import pydantic -from pydantic import model_serializer -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class DeleteInternGlobalsTypedDict(TypedDict): - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class DeleteInternGlobals(BaseModel): - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -class DeleteInternRequestTypedDict(TypedDict): - intern_id: str - r"""ID of an intern visible to the authenticated API key.""" - delete_intern_request: components_deleteinternrequest.DeleteInternRequestTypedDict - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class DeleteInternRequest(BaseModel): - intern_id: Annotated[ - str, - pydantic.Field(alias="internId"), - FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), - ] - r"""ID of an intern visible to the authenticated API key.""" - - delete_intern_request: Annotated[ - components_deleteinternrequest.DeleteInternRequest, - FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] - - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m diff --git a/src/openrouter/operations/getintern.py b/src/openrouter/operations/getintern.py deleted file mode 100644 index 137abb8f..00000000 --- a/src/openrouter/operations/getintern.py +++ /dev/null @@ -1,146 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel, UNSET_SENTINEL -from openrouter.utils import FieldMetadata, HeaderMetadata, PathParamMetadata -import pydantic -from pydantic import model_serializer -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class GetInternGlobalsTypedDict(TypedDict): - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class GetInternGlobals(BaseModel): - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -class GetInternRequestTypedDict(TypedDict): - intern_id: str - r"""ID of an intern visible to the authenticated API key.""" - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class GetInternRequest(BaseModel): - intern_id: Annotated[ - str, - pydantic.Field(alias="internId"), - FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), - ] - r"""ID of an intern visible to the authenticated API key.""" - - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m diff --git a/src/openrouter/operations/getinternconnections.py b/src/openrouter/operations/getinternconnections.py deleted file mode 100644 index e369735a..00000000 --- a/src/openrouter/operations/getinternconnections.py +++ /dev/null @@ -1,146 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel, UNSET_SENTINEL -from openrouter.utils import FieldMetadata, HeaderMetadata, PathParamMetadata -import pydantic -from pydantic import model_serializer -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class GetInternConnectionsGlobalsTypedDict(TypedDict): - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class GetInternConnectionsGlobals(BaseModel): - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -class GetInternConnectionsRequestTypedDict(TypedDict): - intern_id: str - r"""ID of an intern visible to the authenticated API key.""" - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class GetInternConnectionsRequest(BaseModel): - intern_id: Annotated[ - str, - pydantic.Field(alias="internId"), - FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), - ] - r"""ID of an intern visible to the authenticated API key.""" - - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m diff --git a/src/openrouter/operations/getinterndaemon.py b/src/openrouter/operations/getinterndaemon.py deleted file mode 100644 index d85bf67f..00000000 --- a/src/openrouter/operations/getinterndaemon.py +++ /dev/null @@ -1,146 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel, UNSET_SENTINEL -from openrouter.utils import FieldMetadata, HeaderMetadata, PathParamMetadata -import pydantic -from pydantic import model_serializer -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class GetInternDaemonGlobalsTypedDict(TypedDict): - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class GetInternDaemonGlobals(BaseModel): - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -class GetInternDaemonRequestTypedDict(TypedDict): - intern_id: str - r"""ID of an intern visible to the authenticated API key.""" - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class GetInternDaemonRequest(BaseModel): - intern_id: Annotated[ - str, - pydantic.Field(alias="internId"), - FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), - ] - r"""ID of an intern visible to the authenticated API key.""" - - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m diff --git a/src/openrouter/operations/getinterndaemonaccess.py b/src/openrouter/operations/getinterndaemonaccess.py deleted file mode 100644 index 6632fbbb..00000000 --- a/src/openrouter/operations/getinterndaemonaccess.py +++ /dev/null @@ -1,146 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel, UNSET_SENTINEL -from openrouter.utils import FieldMetadata, HeaderMetadata, PathParamMetadata -import pydantic -from pydantic import model_serializer -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class GetInternDaemonAccessGlobalsTypedDict(TypedDict): - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class GetInternDaemonAccessGlobals(BaseModel): - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -class GetInternDaemonAccessRequestTypedDict(TypedDict): - intern_id: str - r"""ID of an intern visible to the authenticated API key.""" - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class GetInternDaemonAccessRequest(BaseModel): - intern_id: Annotated[ - str, - pydantic.Field(alias="internId"), - FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), - ] - r"""ID of an intern visible to the authenticated API key.""" - - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m diff --git a/src/openrouter/operations/getinternicon.py b/src/openrouter/operations/getinternicon.py deleted file mode 100644 index ecda3acd..00000000 --- a/src/openrouter/operations/getinternicon.py +++ /dev/null @@ -1,159 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel, UNSET_SENTINEL -from openrouter.utils import ( - FieldMetadata, - HeaderMetadata, - PathParamMetadata, - QueryParamMetadata, -) -import pydantic -from pydantic import model_serializer -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class GetInternIconGlobalsTypedDict(TypedDict): - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class GetInternIconGlobals(BaseModel): - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -class GetInternIconRequestTypedDict(TypedDict): - intern_id: str - r"""ID of an intern visible to the authenticated API key.""" - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - v: NotRequired[str] - r"""The `icon_sha256` the caller expects.""" - - -class GetInternIconRequest(BaseModel): - intern_id: Annotated[ - str, - pydantic.Field(alias="internId"), - FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), - ] - r"""ID of an intern visible to the authenticated API key.""" - - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - v: Annotated[ - Optional[str], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None - r"""The `icon_sha256` the caller expects.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories", "v"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m diff --git a/src/openrouter/operations/invokeintern.py b/src/openrouter/operations/invokeintern.py deleted file mode 100644 index e2024274..00000000 --- a/src/openrouter/operations/invokeintern.py +++ /dev/null @@ -1,174 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.components import ( - interninvokeacceptedresponse as components_interninvokeacceptedresponse, - interninvokerequest as components_interninvokerequest, -) -from openrouter.types import BaseModel, UNSET_SENTINEL -from openrouter.utils import ( - FieldMetadata, - HeaderMetadata, - PathParamMetadata, - RequestMetadata, -) -import pydantic -from pydantic import model_serializer -from typing import Dict, List, Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class InvokeInternGlobalsTypedDict(TypedDict): - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class InvokeInternGlobals(BaseModel): - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -class InvokeInternRequestTypedDict(TypedDict): - intern_id: str - r"""The intern to run.""" - intern_invoke_request: components_interninvokerequest.InternInvokeRequestTypedDict - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class InvokeInternRequest(BaseModel): - intern_id: Annotated[ - str, - pydantic.Field(alias="internId"), - FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), - ] - r"""The intern to run.""" - - intern_invoke_request: Annotated[ - components_interninvokerequest.InternInvokeRequest, - FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] - - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -class InvokeInternResponseTypedDict(TypedDict): - headers: Dict[str, List[str]] - result: ( - components_interninvokeacceptedresponse.InternInvokeAcceptedResponseTypedDict - ) - - -class InvokeInternResponse(BaseModel): - headers: Dict[str, List[str]] - - result: components_interninvokeacceptedresponse.InternInvokeAcceptedResponse diff --git a/src/openrouter/operations/listinterns.py b/src/openrouter/operations/listinterns.py deleted file mode 100644 index 305b5b57..00000000 --- a/src/openrouter/operations/listinterns.py +++ /dev/null @@ -1,192 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel, UNSET_SENTINEL, UnrecognizedStr -from openrouter.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata -import pydantic -from pydantic import model_serializer -from typing import List, Literal, Optional, Union -from typing_extensions import Annotated, NotRequired, TypedDict - - -class ListInternsGlobalsTypedDict(TypedDict): - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class ListInternsGlobals(BaseModel): - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -Status = Union[ - Literal[ - "awaiting_slack_install", - "queued", - "provisioning", - "running", - "failed", - "stopped", - "destroying", - "destroy_failed", - ], - UnrecognizedStr, -] - - -class ListInternsRequestTypedDict(TypedDict): - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - limit: NotRequired[int] - r"""Maximum number of interns to return, from 1 through 500.""" - status: NotRequired[List[Status]] - r"""Comma-separated lifecycle statuses to include, at most 8. Repeats are collapsed.""" - starting_after: NotRequired[str] - r"""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.""" - workspace_id: NotRequired[str] - r"""Only return interns in this workspace. It must match the API key workspace.""" - - -class ListInternsRequest(BaseModel): - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - limit: Annotated[ - Optional[int], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None - r"""Maximum number of interns to return, from 1 through 500.""" - - status: Annotated[ - Optional[List[Status]], - FieldMetadata(query=QueryParamMetadata(style="form", explode=False)), - ] = None - r"""Comma-separated lifecycle statuses to include, at most 8. Repeats are collapsed.""" - - starting_after: Annotated[ - Optional[str], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None - r"""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.""" - - workspace_id: Annotated[ - Optional[str], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None - r"""Only return interns in this workspace. It must match the API key workspace.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - [ - "HTTP-Referer", - "X-OpenRouter-Title", - "X-OpenRouter-Categories", - "limit", - "status", - "starting_after", - "workspace_id", - ] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m diff --git a/src/openrouter/operations/provisionintern.py b/src/openrouter/operations/provisionintern.py deleted file mode 100644 index 2efbcc03..00000000 --- a/src/openrouter/operations/provisionintern.py +++ /dev/null @@ -1,146 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel, UNSET_SENTINEL -from openrouter.utils import FieldMetadata, HeaderMetadata, PathParamMetadata -import pydantic -from pydantic import model_serializer -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class ProvisionInternGlobalsTypedDict(TypedDict): - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class ProvisionInternGlobals(BaseModel): - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -class ProvisionInternRequestTypedDict(TypedDict): - intern_id: str - r"""ID of an intern visible to the authenticated API key.""" - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class ProvisionInternRequest(BaseModel): - intern_id: Annotated[ - str, - pydantic.Field(alias="internId"), - FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), - ] - r"""ID of an intern visible to the authenticated API key.""" - - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m diff --git a/src/openrouter/operations/signinterndaemonaccessrequest.py b/src/openrouter/operations/signinterndaemonaccessrequest.py deleted file mode 100644 index 8334ef41..00000000 --- a/src/openrouter/operations/signinterndaemonaccessrequest.py +++ /dev/null @@ -1,174 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.components import ( - signinterndaemonrequest as components_signinterndaemonrequest, - signinterndaemonresponse as components_signinterndaemonresponse, -) -from openrouter.types import BaseModel, UNSET_SENTINEL -from openrouter.utils import ( - FieldMetadata, - HeaderMetadata, - PathParamMetadata, - RequestMetadata, -) -import pydantic -from pydantic import model_serializer -from typing import Dict, List, Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class SignInternDaemonAccessRequestGlobalsTypedDict(TypedDict): - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class SignInternDaemonAccessRequestGlobals(BaseModel): - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -class SignInternDaemonAccessRequestRequestTypedDict(TypedDict): - intern_id: str - r"""ID of an intern visible to the authenticated API key.""" - sign_intern_daemon_request: ( - components_signinterndaemonrequest.SignInternDaemonRequestTypedDict - ) - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class SignInternDaemonAccessRequestRequest(BaseModel): - intern_id: Annotated[ - str, - pydantic.Field(alias="internId"), - FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), - ] - r"""ID of an intern visible to the authenticated API key.""" - - sign_intern_daemon_request: Annotated[ - components_signinterndaemonrequest.SignInternDaemonRequest, - FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] - - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -class SignInternDaemonAccessRequestResponseTypedDict(TypedDict): - headers: Dict[str, List[str]] - result: components_signinterndaemonresponse.SignInternDaemonResponseTypedDict - - -class SignInternDaemonAccessRequestResponse(BaseModel): - headers: Dict[str, List[str]] - - result: components_signinterndaemonresponse.SignInternDaemonResponse diff --git a/src/openrouter/operations/signinterndaemonrequest.py b/src/openrouter/operations/signinterndaemonrequest.py deleted file mode 100644 index 45e6c393..00000000 --- a/src/openrouter/operations/signinterndaemonrequest.py +++ /dev/null @@ -1,174 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.components import ( - signinterndaemonrequest as components_signinterndaemonrequest, - signinterndaemonresponse as components_signinterndaemonresponse, -) -from openrouter.types import BaseModel, UNSET_SENTINEL -from openrouter.utils import ( - FieldMetadata, - HeaderMetadata, - PathParamMetadata, - RequestMetadata, -) -import pydantic -from pydantic import model_serializer -from typing import Dict, List, Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class SignInternDaemonRequestGlobalsTypedDict(TypedDict): - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class SignInternDaemonRequestGlobals(BaseModel): - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -class SignInternDaemonRequestRequestTypedDict(TypedDict): - intern_id: str - r"""ID of an intern visible to the authenticated API key.""" - sign_intern_daemon_request: ( - components_signinterndaemonrequest.SignInternDaemonRequestTypedDict - ) - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class SignInternDaemonRequestRequest(BaseModel): - intern_id: Annotated[ - str, - pydantic.Field(alias="internId"), - FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), - ] - r"""ID of an intern visible to the authenticated API key.""" - - sign_intern_daemon_request: Annotated[ - components_signinterndaemonrequest.SignInternDaemonRequest, - FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] - - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -class SignInternDaemonRequestResponseTypedDict(TypedDict): - headers: Dict[str, List[str]] - result: components_signinterndaemonresponse.SignInternDaemonResponseTypedDict - - -class SignInternDaemonRequestResponse(BaseModel): - headers: Dict[str, List[str]] - - result: components_signinterndaemonresponse.SignInternDaemonResponse diff --git a/src/openrouter/operations/suspendintern.py b/src/openrouter/operations/suspendintern.py deleted file mode 100644 index 7fff4cf0..00000000 --- a/src/openrouter/operations/suspendintern.py +++ /dev/null @@ -1,146 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import BaseModel, UNSET_SENTINEL -from openrouter.utils import FieldMetadata, HeaderMetadata, PathParamMetadata -import pydantic -from pydantic import model_serializer -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class SuspendInternGlobalsTypedDict(TypedDict): - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class SuspendInternGlobals(BaseModel): - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -class SuspendInternRequestTypedDict(TypedDict): - intern_id: str - r"""ID of an intern visible to the authenticated API key.""" - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class SuspendInternRequest(BaseModel): - intern_id: Annotated[ - str, - pydantic.Field(alias="internId"), - FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), - ] - r"""ID of an intern visible to the authenticated API key.""" - - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m diff --git a/src/openrouter/operations/updateintern.py b/src/openrouter/operations/updateintern.py deleted file mode 100644 index d87519cf..00000000 --- a/src/openrouter/operations/updateintern.py +++ /dev/null @@ -1,158 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.components import updateinternrequest as components_updateinternrequest -from openrouter.types import BaseModel, UNSET_SENTINEL -from openrouter.utils import ( - FieldMetadata, - HeaderMetadata, - PathParamMetadata, - RequestMetadata, -) -import pydantic -from pydantic import model_serializer -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -class UpdateInternGlobalsTypedDict(TypedDict): - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class UpdateInternGlobals(BaseModel): - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -class UpdateInternRequestTypedDict(TypedDict): - intern_id: str - r"""ID of an intern visible to the authenticated API key.""" - update_intern_request: components_updateinternrequest.UpdateInternRequestTypedDict - http_referer: NotRequired[str] - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - x_open_router_title: NotRequired[str] - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - x_open_router_categories: NotRequired[str] - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - -class UpdateInternRequest(BaseModel): - intern_id: Annotated[ - str, - pydantic.Field(alias="internId"), - FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), - ] - r"""ID of an intern visible to the authenticated API key.""" - - update_intern_request: Annotated[ - components_updateinternrequest.UpdateInternRequest, - FieldMetadata(request=RequestMetadata(media_type="application/json")), - ] - - http_referer: Annotated[ - Optional[str], - pydantic.Field(alias="HTTP-Referer"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app identifier should be your app's URL and is used as the primary identifier for rankings. - This is used to track API usage per application. - - """ - - x_open_router_title: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Title"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""The app display name allows you to customize how your app appears in OpenRouter's dashboard. - - """ - - x_open_router_categories: Annotated[ - Optional[str], - pydantic.Field(alias="X-OpenRouter-Categories"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = None - r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. - - """ - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set( - ["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"] - ) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m diff --git a/src/openrouter/sdk.py b/src/openrouter/sdk.py index 610c2f77..9e37516f 100644 --- a/src/openrouter/sdk.py +++ b/src/openrouter/sdk.py @@ -35,7 +35,6 @@ from openrouter.generations import Generations from openrouter.guardrails import Guardrails from openrouter.images import Images - from openrouter.interns import Interns from openrouter.models_ import Models from openrouter.oauth import OAuth from openrouter.observability import Observability @@ -97,8 +96,6 @@ class OpenRouter(BaseSDK): r"""Guardrails endpoints""" images: "Images" r"""Images endpoints""" - interns: "Interns" - r"""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.""" api_keys: "APIKeys" r"""API key management endpoints""" models: "Models" @@ -151,7 +148,6 @@ class OpenRouter(BaseSDK): "generations": ("openrouter.generations", "Generations"), "guardrails": ("openrouter.guardrails", "Guardrails"), "images": ("openrouter.images", "Images"), - "interns": ("openrouter.interns", "Interns"), "api_keys": ("openrouter.api_keys", "APIKeys"), "models": ("openrouter.models_", "Models"), "observability": ("openrouter.observability", "Observability"), diff --git a/uv.lock b/uv.lock index de2632be..2c505c17 100644 --- a/uv.lock +++ b/uv.lock @@ -231,7 +231,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.79" +version = "1.3.80" source = { editable = "." } dependencies = [ { name = "httpcore" },