diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 0567b0f9..0860ea27 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: 565c94d309517febad862f36e872e29d + docChecksum: d295c0e06671ab47f0762f669e11ea1a docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.3.70 - configChecksum: 0a4950b2e092fef1a724f0edd446ed0d + releaseVersion: 1.3.71 + configChecksum: c045c2f1c14480f67ba84a2b5f117fe6 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 9df4e84d-d967-4e61-a71e-f916f8eb44f7 - pristine_commit_hash: 850251964ed53cc1d4fde846fe24633a7bf8fcb5 - pristine_tree_hash: 1c7875742600ca4d91640240333f06f7a75cfef5 + generation_id: ae7ddf9e-dcb7-4439-b5ab-3d48a3e0ae4d + pristine_commit_hash: 4b579ac47ed47051ca1c01b09eb77e8e8b8290bb + pristine_tree_hash: 4162185defe65ec724fe9796cb3390f4b1af23fe features: python: acceptHeaders: 3.0.0 @@ -82,6 +82,10 @@ 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 @@ -1808,8 +1812,8 @@ trackedFiles: pristine_git_object: 92c9c5c2ce23807bac9756e55803057921c34f24 docs/components/chatcontenttext.mdx: id: a2436d6c5c1c - last_write_checksum: sha1:bf50de67c2c4b71ef14a92a53507b1c28fa1cc5b - pristine_git_object: b31006bd9cd42c1afa9f936eb085af94ae786f4d + last_write_checksum: sha1:2b9659cfd8b1096f1e7b680387a2b2e025ad18b6 + pristine_git_object: 030069d2c77855447df9403766e011855dd0a7ff docs/components/chatcontenttexttype.mdx: id: eb29ddb48a88 last_write_checksum: sha1:154a7cb1f0dcdc0ff60b5fcfe1ce5e86e08bb72f @@ -1940,8 +1944,8 @@ trackedFiles: pristine_git_object: 220be03bd674a257c2064c0455104959b3974a35 docs/components/chatrequest.mdx: id: 055812be14d8 - last_write_checksum: sha1:a2aeae8cb0cb082d0f298b8d9ff3eee01c493fb2 - pristine_git_object: e472c2ce45dbfbcb04fa251dc6d12feb8e3d43d3 + last_write_checksum: sha1:75f5eb943e9f6709749363372f5684f20b65b764 + pristine_git_object: 914a7e12b07312c64aac0870c358c2acfd70ca72 docs/components/chatrequesteffort.mdx: id: 703c73252ebd last_write_checksum: sha1:243510f188071a3f317dc06a07fbcfcedd3cf821 @@ -3956,8 +3960,8 @@ trackedFiles: pristine_git_object: dab31fe384d6fd44ca993c38e819d8b6ad10b3f0 docs/components/inputtext.mdx: id: c8a97322a50a - last_write_checksum: sha1:6f92abbb193a5d21cc129df4c5804b3f9161322d - pristine_git_object: 5908413083a34d8bdd34ed916610dc5eee0d6564 + last_write_checksum: sha1:5902ffb7bbb579f45ed9e177fc2fcb6256a05f6f + pristine_git_object: 951e9288640a41bda9627934fd6dc7e049e49e72 docs/components/inputtexttype.mdx: id: 91f958925357 last_write_checksum: sha1:42a8d9a6d3506e02f6024592691292b7ac255075 @@ -3988,8 +3992,8 @@ trackedFiles: pristine_git_object: e3e71d16be9294f68ca671f76dbcc8b6d8ecc749 docs/components/intern.mdx: id: 95d0e0ffc539 - last_write_checksum: sha1:1efaf0f73cb574f68983fdcf2d02f113876a07bc - pristine_git_object: 6959c6067cfe3ab926e62b35ae8bcdb700622478 + last_write_checksum: sha1:c621dd387bb84ba6b886aa0dbb044dd870e6f880 + pristine_git_object: 91493b58c81b606c3043cc44e4e466364cf5209a docs/components/internalserverresponseerrordata.mdx: id: 9a443dea63c5 last_write_checksum: sha1:39c41704820f6cde2d67ec3b9f1bcac7bc1a81d0 @@ -4142,6 +4146,22 @@ trackedFiles: 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:52df2833e8e8483fa67bbc680d74503dd622c7f6 @@ -4230,6 +4250,10 @@ 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 @@ -5070,6 +5094,10 @@ 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 @@ -5296,8 +5324,8 @@ trackedFiles: pristine_git_object: 09effe2d3fe45536c8b0aa0f23c02ce19b15f62c docs/components/openresponsesresult.mdx: id: d0fed85674d2 - last_write_checksum: sha1:b6c1d992504f8e50fe4f8426d715edad28522394 - pristine_git_object: af726f8f63aec89960dd73120b02677c82159420 + last_write_checksum: sha1:413836418a98054add3a0eff2fd76c33d6989135 + pristine_git_object: af187ae8d95e497c275b7096b0c8ba76279fc814 docs/components/openresponsesresultallowedcaller.mdx: id: 09e2289416bf last_write_checksum: sha1:5971a2111c35fa89208cf827bb317262e14915ba @@ -6344,16 +6372,16 @@ trackedFiles: pristine_git_object: 1c5f4b732e434daa29af2f811fe949fcfa99344b docs/components/promptcachebreakpoint.mdx: id: c135956dc623 - last_write_checksum: sha1:6df345ea99da1fdcae22895faa2ee36339ba7332 - pristine_git_object: 313ab84d0db5d181f8dea91208a4b5127f43477b + last_write_checksum: sha1:eb302e1163f406252e6889d26f657b8c7692263e + pristine_git_object: 25c12b89ede1f1d40f73d815d1826faa7152c32a docs/components/promptcachebreakpointmode.mdx: id: 05abe4e54869 last_write_checksum: sha1:f7ca9f8ff280c1fa750609f4aa13b0706d1dd7cd pristine_git_object: 37263b53e0db06966ac692cd11558cd68c515637 docs/components/promptcacheoptions.mdx: id: 84100012ff84 - last_write_checksum: sha1:fee66864b36bed40090f8e330a390f12b8847dec - pristine_git_object: a9b20d3f963b738ae414738b0b96d42ab8f9ab13 + last_write_checksum: sha1:967625fff056d8212a78c2e8d9166223f2447067 + pristine_git_object: dfa27d14a2fc6492534a151e64340ee8dd0bc2ba docs/components/promptcacheoptionsmode.mdx: id: fbdb2c936b50 last_write_checksum: sha1:9ad96fb9d26840c0088b7013ef9cba7a7d0431c9 @@ -6716,8 +6744,8 @@ trackedFiles: pristine_git_object: aa7c89233d761c71c471d4f9ee808e648e683fcf docs/components/responsesrequest.mdx: id: 0dbcef40a4b1 - last_write_checksum: sha1:d55f4d1d0882c5265c08453372068c74436e06fe - pristine_git_object: 3fc7bc954f1525f4ecc0047fa8c8ec62a70b5568 + last_write_checksum: sha1:ef4c76314a41c80b77a2796d686b3d2860e2b266 + pristine_git_object: 71a7af8bba04dc52ac8b3e7e44fd726f7376809c docs/components/responsesrequestallowedcaller.mdx: id: 07ac030bdf1b last_write_checksum: sha1:9370b318e4620662b13a773ac1a47a93ea201b55 @@ -6830,6 +6858,10 @@ 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 @@ -7078,6 +7110,10 @@ 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 @@ -9110,6 +9146,14 @@ 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 @@ -10220,16 +10264,16 @@ trackedFiles: pristine_git_object: 5026ac2a283240480026d80d2f77d5528ae8bdc8 docs/sdks/betaresponses/README.mdx: id: 8a1e987c9840 - last_write_checksum: sha1:ac83cd401fac2a70c4ec397dc5d08accf4f0b803 - pristine_git_object: 7655e1a2a988babed1209a4becbd4eed180e8aa6 + last_write_checksum: sha1:06b244bbd6fd8523b22cd1ef64ca6f45945a1fc3 + pristine_git_object: 26a176217e09f4a0029cb92a821d159e104c409c docs/sdks/byok/README.mdx: id: 17792f3b180d last_write_checksum: sha1:de666d5914416300450e62c960a887664fa81dd5 pristine_git_object: 08d86cd475282a39de45740038c5530474a95f06 docs/sdks/chat/README.mdx: id: 1dd859c23fe1 - last_write_checksum: sha1:6711140eeadcf506e823067ae0aaf8e06b9cd0e6 - pristine_git_object: 6839ac65cd8a61c2ff351bb704b4a503b3b57ca7 + last_write_checksum: sha1:fcf4bfc2dfd58777c5b970b81ea7372af715c70a + pristine_git_object: 299c265bebae21c7a48c159ae517c477acd2a03a docs/sdks/classifications/README.mdx: id: 4786130ef02a last_write_checksum: sha1:87ea3518b4147ae7833b01da7be92d41a4b49df7 @@ -10280,8 +10324,8 @@ trackedFiles: pristine_git_object: 08c687694efbecf50406ae7929029d39fb121295 docs/sdks/interns/README.mdx: id: 2f8a053ffe78 - last_write_checksum: sha1:f1e490ca33862aa586705377035d9d1734380ab0 - pristine_git_object: 77e9f4acc46c4486ad25b879b0159f0ae6f515e9 + last_write_checksum: sha1:212d765ca05cc6747cb202c2f4dc3df7bba0e619 + pristine_git_object: c56a6ed2540876f6705b1198c69920024946af42 docs/sdks/models/README.mdx: id: 58f1ca464e0b last_write_checksum: sha1:aab5b254f0a6dc7ab7c6d543b20c889113cc0dc9 @@ -10300,8 +10344,8 @@ trackedFiles: pristine_git_object: c39c54c9f6e92fff4d967b0c935dcf613fa33ba8 docs/sdks/presets/README.mdx: id: eeb505928d52 - last_write_checksum: sha1:dea05e3def9eba9be9d886378d8905f155610223 - pristine_git_object: 1ce487399cb44e4e2b0c96374c7b955954a2440f + last_write_checksum: sha1:a7556797ff5e3ee5568fadacf9bcdb369c664bb0 + pristine_git_object: 28d3f17d25e50a97e4c195ea46a15ee6ab431902 docs/sdks/privateendpoints/README.mdx: id: 54dee70b8cc7 last_write_checksum: sha1:3ee195b23b8124d351823bb7ef8fb956ef281c3c @@ -10316,8 +10360,8 @@ trackedFiles: pristine_git_object: 0836d633a90c128d0062b9fb532aa8be2591927a docs/sdks/responses/README.mdx: id: abab319e080e - last_write_checksum: sha1:fc9a79a43f32f79c35153c434ebe304213639a01 - pristine_git_object: b566fa851645a940c856e0780a481331f69bb443 + last_write_checksum: sha1:44f8f4fa493e0941a899909ec5d7fa4b86d00eea + pristine_git_object: 32fe3b3de09cacb22378204aa1a4ac831e070500 docs/sdks/scim/README.mdx: id: fd6d8a91a053 last_write_checksum: sha1:0a28f030bf42146fde86887c2b79831af07f1d4f @@ -10356,8 +10400,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:ab303bf1e4d1fa45bea946f96d69988bf7fe8b95 - pristine_git_object: f8faac5537dee38ed0d1867392cb665cac20820f + last_write_checksum: sha1:466fa425157848d33c61096c0f1e07fed0a04055 + pristine_git_object: eea7c851acbca4bb66b5e48094093e1c286672a6 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -10384,8 +10428,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:290c12212e53ce6494ee0fe34e171ac79427b38a - pristine_git_object: e233904d27ca8f57bd6c415ec622a2c1a2bb9e09 + last_write_checksum: sha1:568c8e9f267e3a340ec6e8fed31e911ce32655bf + pristine_git_object: 5848b5acc5cc9d9a4d979d78de0c18162f922343 src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:30f55a360f41376ab194b9ea725fe4e001a5ae1a @@ -10416,24 +10460,24 @@ trackedFiles: pristine_git_object: aa95a65cf560fd7edb0c3c6f5fed707ca5015da3 src/openrouter/beta_responses.py: id: 001eaf848bf1 - last_write_checksum: sha1:2f7acba25097307a6cf9304636f8be99b3e05580 - pristine_git_object: 982740d39fae4e5b8a99debb8558ac72191afe57 + last_write_checksum: sha1:8b7bb5f528472f0f62f550a1e83892e8f5b78624 + pristine_git_object: e9bae7b641ce3b858197497c3f48807e5835869c src/openrouter/byok.py: id: bec352462ae1 last_write_checksum: sha1:85ea3173f700494bc2ec412090206e873536ac9f pristine_git_object: 8f6695eae6b87f579b79b47a5af49f15e94186a9 src/openrouter/chat.py: id: 723fdce15c1d - last_write_checksum: sha1:19ce1037c811e8cbf995d86fb89bc719fefbbdda - pristine_git_object: 5a3cf6f89f610ee05311d2c01fa96f8e6a9ebbbd + last_write_checksum: sha1:33ac449ca72c5c907ec419f04ec9d6a7e82b955e + pristine_git_object: 43dbe7dff7ebfc3a17ea4ee9241441c8fb64a20f src/openrouter/classifications.py: id: 4f2efc24b95b last_write_checksum: sha1:3ab6fcd9ef679cd2149ec8dfbb4a86109cd152ad pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:fa2f9c974eaa8f9feb366b843d648209f045b422 - pristine_git_object: 36f891de4aefeaa4c5ee5ed277ab72329496ae35 + last_write_checksum: sha1:39ed1d832fbdd9ae392e4f45960ac1ab3daae59f + pristine_git_object: 6983d8cbe4c0de1fbb228ed337651ff978711c8f src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c @@ -11208,8 +11252,8 @@ trackedFiles: pristine_git_object: 61415b0c78602a7fabc4bf7f62ac869bacf38195 src/openrouter/components/chatcontenttext.py: id: 5301d8af31e7 - last_write_checksum: sha1:f4abea5885878b3c6aaacac28829fae85a7c25ce - pristine_git_object: 45f9d3e9873702cbffb4cd7078fff4fffe2b81d2 + last_write_checksum: sha1:238613f85fc7e6d09740bfe12cb0bd3d7e10769c + pristine_git_object: 77b045158fdfa5de296cd22e12ef75e7c0c91341 src/openrouter/components/chatcontentvideo.py: id: 42859cb5a9f4 last_write_checksum: sha1:f60354c6602613f3f8628ca29330a6037fcf20e9 @@ -11276,8 +11320,8 @@ trackedFiles: pristine_git_object: 8bbde153b53887e426989fd5b0486b6dc1122810 src/openrouter/components/chatrequest.py: id: 5e39eaefa9cf - last_write_checksum: sha1:fb1ba0dbd2d792ea5141a47db53dd4e69f3e09a2 - pristine_git_object: c563996c36ba21ab7227936bc36fe920306e2603 + last_write_checksum: sha1:ae69df07e940af7449bd9a974d404886becfd00f + pristine_git_object: b278ed4451980d3550bed9907e638a184b28e257 src/openrouter/components/chatresult.py: id: 9062fe2935fe last_write_checksum: sha1:832ad4df3f9f92818e36e9d26a73da3bcff3eb7a @@ -12116,8 +12160,8 @@ trackedFiles: pristine_git_object: 48a23ae29f1fab203a5a74ef0470bcee9c0e3f17 src/openrouter/components/inputtext.py: id: a995ae96be99 - last_write_checksum: sha1:2da9ff645acc96772701908830151c5a707ed021 - pristine_git_object: 81a4151b3b1cdb6eb262a9ede28217b6c0afd1df + last_write_checksum: sha1:94c720a449e0d5a3f23ee7195f648422f61ac114 + pristine_git_object: e158c324c67f548aa82a06e7dd15c6c3bbe9bcd9 src/openrouter/components/inputvideo.py: id: d262affd6f7e last_write_checksum: sha1:010c449ce057f80339201a10ba78ff8800860a52 @@ -12128,8 +12172,8 @@ trackedFiles: pristine_git_object: 4a58daf7d055e111ebf204b18ee413203f06b745 src/openrouter/components/intern.py: id: eed59a44b44f - last_write_checksum: sha1:29b7a9aabd31b99bd0d6fb221a3f92e7e0dd9e6e - pristine_git_object: 0597b6a695a4b91f0dd5b793ccd5c63c17111f96 + last_write_checksum: sha1:7094779dfa6a0ea8600e345577c58e40d0902180 + pristine_git_object: 33ec792825d96807a643b165b2091369590c5e05 src/openrouter/components/internalserverresponseerrordata.py: id: 91397805fa13 last_write_checksum: sha1:6307236e36dc876dbfae76cfcc29ad49461b5b5d @@ -12230,6 +12274,14 @@ trackedFiles: 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:4098660a0247c95f4bc53cf5b40b4a56747d69b3 @@ -12672,8 +12724,8 @@ trackedFiles: pristine_git_object: 08d990d8cc07b7928158fc55784cd9d613f4c58b src/openrouter/components/openresponsesresult.py: id: 78f7e33b19e6 - last_write_checksum: sha1:757fb758c6726dbd75032a6fcf14f3fe3d9bf564 - pristine_git_object: b270324acd6131ff55b6ccc6bb67cb97814a066f + last_write_checksum: sha1:49fbbbceae52d9595b35123406d23e9c77602aac + pristine_git_object: 0e1f8dafe2210d3f5bc7c25225f630d164fdc45d src/openrouter/components/openrouterfile.py: id: df1961bcb130 last_write_checksum: sha1:1a9a1b1e640f4d0ef78ce0caa160b5ab342f02cc @@ -13056,12 +13108,12 @@ trackedFiles: pristine_git_object: 6e8b78ced26a0853ead11ec27400f8bf98f1fa83 src/openrouter/components/promptcachebreakpoint.py: id: f1e589a13300 - last_write_checksum: sha1:ea0f5d81093058c261edd1937b4c7148989a203a - pristine_git_object: 13fbce26b5254ca66ebecfbbc8701d2002483399 + last_write_checksum: sha1:f39a912f18e3d27aa9488700e981f282f585d58b + pristine_git_object: 856bdfd149cdbf5780fbbcf4787234b0d595298f src/openrouter/components/promptcacheoptions.py: id: 5c39fe555e03 - last_write_checksum: sha1:77647b94fd80f6cfcae368bff4c87cbaf903a98e - pristine_git_object: 9d3586245623788e9accd1fe5ff883de89dc4bbe + last_write_checksum: sha1:b0b86d27d341254fbcd004a0b3cc301a12be6d85 + pristine_git_object: 357f51113746cd77d9b231441ec0310b5906bdf5 src/openrouter/components/promptinjectionscanscope.py: id: e78ab231a530 last_write_checksum: sha1:f257e3ae2b6385cf758e891ba02601c435e92098 @@ -13232,8 +13284,8 @@ trackedFiles: pristine_git_object: 900bf08ec940565a8cbf55712a437775db00ca46 src/openrouter/components/responsesrequest.py: id: 8c850080ec5d - last_write_checksum: sha1:87f182354c4a74ddb3047117c7e7e367fe4bbf23 - pristine_git_object: 0a6faddb4d79b354c665aee081ee8dd0299e37aa + last_write_checksum: sha1:dad2c4bad8a36d07ac573f4309d58b4ca270f6ed + pristine_git_object: 366b5e9ec43f16c67d7cd93c05a764409b6a78e7 src/openrouter/components/responsesstreamingresponse.py: id: 142379f3bd90 last_write_checksum: sha1:a48d6f3610f5d15248ef4d25a0d88a0a4a1a9db7 @@ -14068,8 +14120,8 @@ trackedFiles: pristine_git_object: 50643a126668498dd668c7cceb9f78c03d413d32 src/openrouter/interns.py: id: d18df05c5c6d - last_write_checksum: sha1:576e427059ba5b814a84a7d227e642343fcb9711 - pristine_git_object: 49185f472377ba6b9d13f7475221a5f9b0215700 + last_write_checksum: sha1:7ec3df50159ae127a84e64bb18cba33fa57f229d + pristine_git_object: 3d2865201bc050c4159cc45059c3e59058eea997 src/openrouter/models/__init__.py: id: ed73b93abb3f last_write_checksum: sha1:932a790ae66ccd7d7022b39c659bcf72a664ebea @@ -14096,8 +14148,8 @@ trackedFiles: pristine_git_object: f01a5ab1865b16939c092d854fe8a7145c327058 src/openrouter/operations/__init__.py: id: 9afcea1e7161 - last_write_checksum: sha1:c6accf39fc79bfdb4eb59cdafd6817a2822de1d4 - pristine_git_object: 80fde27cb554d651c0cb03f75f64b1d7bf91f5b1 + last_write_checksum: sha1:62a371180a300aa83a33cf0e5d00f7724b39d24f + pristine_git_object: 352e1b49012fad38078815b28b7092f5305ff22b src/openrouter/operations/activateprivateendpoint.py: id: 3b39eec5d66f last_write_checksum: sha1:9406e6b3d38c82895fd795f637702ef579cc6d36 @@ -14366,6 +14418,10 @@ trackedFiles: 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 @@ -14712,8 +14768,8 @@ trackedFiles: pristine_git_object: f5cb812851c3bc44273cff23a6fd6023fbb10d60 src/openrouter/presets.py: id: bd0c40379dcd - last_write_checksum: sha1:be26640402f8449d4ea0d023a923d55314b23c28 - pristine_git_object: c65361bd081a76cc55a37573f90518bc5aeeede6 + last_write_checksum: sha1:4448330ef9bf75cdb69445b69fc289df97e8fa33 + pristine_git_object: 559ca6ad194bd4f66bc3777d7edc040ccb041a7c src/openrouter/private_endpoints.py: id: fdbce8846ed0 last_write_checksum: sha1:f24e5496b1b57429d578c6422aef9ecb3b204760 @@ -14732,8 +14788,8 @@ trackedFiles: pristine_git_object: 9db3cc719bd343ee7be0183d0c87b50c29e5eb31 src/openrouter/responses.py: id: f2108fb635e1 - last_write_checksum: sha1:8910ea87a6d1ea1240377d630f9f7b91e39b82f7 - pristine_git_object: d4f629c2d9aacfaa3e277759be08b4127acdd5ed + last_write_checksum: sha1:f68f72c792c636928a0c6e31a34ce27357bbfa76 + pristine_git_object: 1aa587d5efdb8e61d83b88ef26532151601edb77 src/openrouter/scim.py: id: 351afd6b616e last_write_checksum: sha1:2f58c4cf29650549257e79c476de0a9500a33772 @@ -19098,17 +19154,17 @@ examples: application/json: {"error": {"code": 404, "message": "Resource not found"}} "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + getInternConnections: + speakeasy-default-get-intern-connections: + parameters: + path: + internId: "7c9e6679-7425-40de-944b-e07fc1f90ae7" + responses: + "200": + application/json: {"data": [{"account": {"acts_as": "", "is_your_account_linked": false, "note": null, "scope": "shared"}, "id": "", "is_enabled": true, "is_intern_only": false, "kind": "google", "mcp_server_name": "", "name": "", "off_reason": "disabled", "server": {"host": "juicy-bookend.biz", "surface": "", "transport": "", "url": "https://knowledgeable-ectoderm.biz"}, "status": {"reason": "", "state": "error"}, "tool_count": 230953}]} + "401": + application/json: {"error": {"code": 404, "message": "Intern not found"}} + "500": + application/json: {"error": {"code": 404, "message": "Intern not found"}} examplesVersion: 1.0.2 -releaseNotes: | - ## Python SDK Changes: - * `open_router.interns.get_intern_icon()`: `response.status[200]` **Changed** (Breaking ⚠️) - * `open_router.external_users.list()`: **Added** - * `open_router.external_users.create()`: **Added** - * `open_router.external_users.delete()`: **Added** - * `open_router.external_users.get()`: **Added** - * `open_router.external_users.update()`: **Added** - * `open_router.end_users.list()`: **Removed** (Breaking ⚠️) - * `open_router.end_users.create()`: **Removed** (Breaking ⚠️) - * `open_router.end_users.delete()`: **Removed** (Breaking ⚠️) - * `open_router.end_users.get()`: **Removed** (Breaking ⚠️) - * `open_router.end_users.update()`: **Removed** (Breaking ⚠️) +releaseNotes: "## Python SDK Changes:\n* `open_router.interns.get_intern_connections()`: **Added**\n* `open_router.batch.create_batches()`: `response.results[].response.body.union(OpenResponsesResult).instructions.union(Array<>)[].union(OpenAIResponseInputMessageItem).content[].union(input_text).prompt_cache_breakpoint.ttl` **Added**\n* `open_router.batch.get_batches()`: `response.results[].response.body.union(OpenResponsesResult).instructions.union(Array<>)[].union(OpenAIResponseCustomToolCallOutput).output.union(Array<>)[].union(input_text).prompt_cache_breakpoint.ttl` **Added**\n* `open_router.chat.send()`: \n * `request.messages[].union(system).content.union(Array)[].prompt_cache_breakpoint.ttl` **Added**\n * `response.choices[].message.content.union(Array)[].union(text).prompt_cache_breakpoint.ttl` **Added**\n* `open_router.interns.list_interns()`: `response.data[].can_edit` **Added**\n* `open_router.interns.create_intern()`: `response.can_edit` **Added**\n* `open_router.interns.get_intern()`: `response.can_edit` **Added**\n* `open_router.interns.update_intern()`: `response.can_edit` **Added**\n* `open_router.presets.create_presets_chat_completions()`: \n * `request.messages[].union(user).content.union(Array)[].union(text).prompt_cache_breakpoint.ttl` **Added**\n* `open_router.presets.create_presets_responses()`: \n * `request.input.union(Array<>)[].union(FunctionCallOutputItem).output.union(Array<>)[].union(input_text).prompt_cache_breakpoint.ttl` **Added**\n* `open_router.responses.send()`: \n * `request.input.union(Array<>)[].union(InputMessageItem).content[].union(input_text).prompt_cache_breakpoint.ttl` **Added**\n * `response` **Changed**\n* `open_router.beta.responses.send()`: \n * `request.input.union(Array<>)[].union(AgentMessageItem).content[].union(input_text).prompt_cache_breakpoint.ttl` **Added**\n * `response` **Changed**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 7bbfd735..9c2af911 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.70 + version: 1.3.71 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index f5915ad7..ea34b5e5 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -15173,6 +15173,7 @@ components: 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' @@ -15194,6 +15195,9 @@ components: 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' @@ -15861,6 +15865,139 @@ components: - 'content' - 'role' type: 'object' + InternConnection: + 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: + properties: + reason: + type: + - 'string' + - 'null' + state: + enum: + - 'connected' + - 'needs_reconnect' + - 'not_tested' + - 'error' + type: 'string' + x-speakeasy-unknown-values: allow + required: + - 'state' + - 'reason' + type: 'object' + tool_count: + description: 'Tools found by the last successful test.' + type: + - 'integer' + - 'null' + required: + - 'id' + - 'kind' + - 'name' + - 'is_enabled' + - 'is_intern_only' + - 'off_reason' + - 'mcp_server_name' + - 'server' + - 'status' + - 'tool_count' + - 'account' + type: 'object' + InternConnectionList: + properties: + data: + items: + $ref: '#/components/schemas/InternConnection' + type: 'array' + required: + - 'data' + type: 'object' InternDaemonAccess: description: 'The intern daemon''s origin and the bearer `ori tui --host` sends to it as `ORI_DAEMON_TOKEN`.' example: @@ -15963,6 +16100,7 @@ components: 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' @@ -26469,21 +26607,26 @@ components: - 'data' type: 'object' PromptCacheBreakpoint: - description: 'Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically.' + description: 'Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically. `ttl` ("30m" or "12h") overrides the request-level `prompt_cache_options.ttl` for this boundary; 12h writes bill at the higher cache-write rate.' example: mode: 'explicit' + ttl: '30m' properties: mode: enum: - 'explicit' type: 'string' + ttl: + type: + - 'string' + - 'null' required: - 'mode' type: - 'object' - 'null' PromptCacheOptions: - description: 'Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.' + description: 'Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: "30m" (default) or "12h" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer.' example: mode: 'explicit' ttl: '30m' @@ -42463,6 +42606,7 @@ paths: 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' @@ -42589,6 +42733,7 @@ paths: 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' @@ -42612,6 +42757,7 @@ paths: 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' @@ -42965,6 +43111,7 @@ paths: 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' @@ -43075,6 +43222,7 @@ paths: 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' @@ -43457,6 +43605,114 @@ paths: - $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' + 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' + 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.' + '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: '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, the intern is hidden, or lifecycle writes are disabled.' + '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.' + '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.' + security: + - apiKey: [] + summary: 'List an intern''s connections' + tags: + - 'Interns' + parameters: + - $ref: "#/components/parameters/AppIdentifier" + - $ref: "#/components/parameters/AppDisplayName" + - $ref: "#/components/parameters/AppCategories" /interns/{internId}/daemon: 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.' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 394d4cc5..616fe1e3 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:165916283a5cbb0d4988e849d7a8e21a08e9d50b07f9b561bfc5d96fe1c14ad2 - sourceBlobDigest: sha256:6890fba3c45c0f1234267a16495eb8f5235672cf8abe93dfb2b4662cc60e2b51 + sourceRevisionDigest: sha256:4c1bf80ad069a003e7b232202da907c7ad80d096d0a0111d95e4d1c696225b1c + sourceBlobDigest: sha256:f86a62aafe6b3f44673578ea274d11cea6ab4851211e2c669e376a3d399cd23b tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:165916283a5cbb0d4988e849d7a8e21a08e9d50b07f9b561bfc5d96fe1c14ad2 - sourceBlobDigest: sha256:6890fba3c45c0f1234267a16495eb8f5235672cf8abe93dfb2b4662cc60e2b51 + sourceRevisionDigest: sha256:4c1bf80ad069a003e7b232202da907c7ad80d096d0a0111d95e4d1c696225b1c + sourceBlobDigest: sha256:f86a62aafe6b3f44673578ea274d11cea6ab4851211e2c669e376a3d399cd23b codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:3d0c5934a586cb687dd5a20aa57dc19db61a33ee564b132adb55c34c33012bea + codeSamplesRevisionDigest: sha256:50416a548f944df084bcd75240de5e214000a8f204f464d6845745a11fe83614 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index 25235c4f..6c50d8c2 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -3469,4 +3469,14 @@ Based on: ### Generated - [python v1.3.70] . ### Releases -- [PyPI v1.3.70] https://pypi.org/project/openrouter/1.3.70 - . \ No newline at end of file +- [PyPI v1.3.70] https://pypi.org/project/openrouter/1.3.70 - . + +## 2026-10-21 04:26:02 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.71] . +### Releases +- [PyPI v1.3.71] https://pypi.org/project/openrouter/1.3.71 - . \ No newline at end of file diff --git a/docs/components/account.mdx b/docs/components/account.mdx new file mode 100644 index 00000000..66a78ddc --- /dev/null +++ b/docs/components/account.mdx @@ -0,0 +1,12 @@ +--- +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/chatcontenttext.mdx b/docs/components/chatcontenttext.mdx index 9c1f10de..ec749dec 100644 --- a/docs/components/chatcontenttext.mdx +++ b/docs/components/chatcontenttext.mdx @@ -7,9 +7,9 @@ Text content part ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `cache_control` | [Optional[components.ChatContentCacheControl]](../components/chatcontentcachecontrol.mdx) | ➖ | Anthropic-style cache breakpoint for the content part. Interchangeable with the OpenAI-style `prompt_cache_breakpoint` marker: OpenRouter converts between the two based on the provider serving the request. | \{
"ttl": "5m",
"type": "ephemeral"
} | -| `prompt_cache_breakpoint` | [OptionalNullable[components.PromptCacheBreakpoint]](../components/promptcachebreakpoint.mdx) | ➖ | Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically. | \{
"mode": "explicit"
} | -| `text` | *str* | ✅ | N/A | | -| `type` | [components.ChatContentTextType](../components/chatcontenttexttype.mdx) | ✅ | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `cache_control` | [Optional[components.ChatContentCacheControl]](../components/chatcontentcachecontrol.mdx) | ➖ | Anthropic-style cache breakpoint for the content part. Interchangeable with the OpenAI-style `prompt_cache_breakpoint` marker: OpenRouter converts between the two based on the provider serving the request. | \{
"ttl": "5m",
"type": "ephemeral"
} | +| `prompt_cache_breakpoint` | [OptionalNullable[components.PromptCacheBreakpoint]](../components/promptcachebreakpoint.mdx) | ➖ | Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically. `ttl` ("30m" or "12h") overrides the request-level `prompt_cache_options.ttl` for this boundary; 12h writes bill at the higher cache-write rate. | \{
"mode": "explicit",
"ttl": "30m"
} | +| `text` | *str* | ✅ | N/A | | +| `type` | [components.ChatContentTextType](../components/chatcontenttexttype.mdx) | ✅ | N/A | | \ No newline at end of file diff --git a/docs/components/chatrequest.mdx b/docs/components/chatrequest.mdx index a5a30d62..7def943b 100644 --- a/docs/components/chatrequest.mdx +++ b/docs/components/chatrequest.mdx @@ -29,7 +29,7 @@ Chat completion request parameters | `prediction` | [OptionalNullable[components.Prediction]](../components/prediction.mdx) | ➖ | Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance. | \{
"content": "Expected response",
"type": "content"
} | | `presence_penalty` | *OptionalNullable[float]* | ➖ | Presence penalty (-2.0 to 2.0) | 0 | | `prompt_cache_key` | *OptionalNullable[str]* | ➖ | N/A | | -| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../components/promptcacheoptions.mdx) | ➖ | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | +| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../components/promptcacheoptions.mdx) | ➖ | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: "30m" (default) or "12h" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | | `provider` | [OptionalNullable[components.ProviderPreferences]](../components/providerpreferences.mdx) | ➖ | When multiple model providers are available, optionally indicate your routing preference. | \{
"allow_fallbacks": true
} | | `reasoning` | [Optional[components.ChatRequestReasoning]](../components/chatrequestreasoning.mdx) | ➖ | Configuration options for reasoning models | \{
"effort": "medium",
"summary": "concise"
} | | `reasoning_effort` | [OptionalNullable[components.ChatRequestReasoningEffort]](../components/chatrequestreasoningeffort.mdx) | ➖ | Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. | medium | diff --git a/docs/components/inputtext.mdx b/docs/components/inputtext.mdx index cf4c5888..0705e6aa 100644 --- a/docs/components/inputtext.mdx +++ b/docs/components/inputtext.mdx @@ -7,8 +7,8 @@ Text input content item ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `prompt_cache_breakpoint` | [OptionalNullable[components.PromptCacheBreakpoint]](../components/promptcachebreakpoint.mdx) | ➖ | Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically. | \{
"mode": "explicit"
} | -| `text` | *str* | ✅ | N/A | | -| `type` | [components.InputTextType](../components/inputtexttype.mdx) | ✅ | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `prompt_cache_breakpoint` | [OptionalNullable[components.PromptCacheBreakpoint]](../components/promptcachebreakpoint.mdx) | ➖ | Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically. `ttl` ("30m" or "12h") overrides the request-level `prompt_cache_options.ttl` for this boundary; 12h writes bill at the higher cache-write rate. | \{
"mode": "explicit",
"ttl": "30m"
} | +| `text` | *str* | ✅ | N/A | | +| `type` | [components.InputTextType](../components/inputtexttype.mdx) | ✅ | N/A | | \ No newline at end of file diff --git a/docs/components/intern.mdx b/docs/components/intern.mdx index f5462adf..5778644f 100644 --- a/docs/components/intern.mdx +++ b/docs/components/intern.mdx @@ -7,21 +7,22 @@ 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. | -| `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 +| 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/internconnection.mdx b/docs/components/internconnection.mdx new file mode 100644 index 00000000..d4bb1d99 --- /dev/null +++ b/docs/components/internconnection.mdx @@ -0,0 +1,19 @@ +--- +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 new file mode 100644 index 00000000..bff09910 --- /dev/null +++ b/docs/components/internconnectionlist.mdx @@ -0,0 +1,9 @@ +--- +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 new file mode 100644 index 00000000..a543fdc8 --- /dev/null +++ b/docs/components/internconnectionscope.mdx @@ -0,0 +1,23 @@ +--- +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 new file mode 100644 index 00000000..55c5eeaf --- /dev/null +++ b/docs/components/internconnectionstatus.mdx @@ -0,0 +1,10 @@ +--- +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/kind.mdx b/docs/components/kind.mdx new file mode 100644 index 00000000..8b7b3b9c --- /dev/null +++ b/docs/components/kind.mdx @@ -0,0 +1,22 @@ +--- +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 new file mode 100644 index 00000000..1b7bd4fb --- /dev/null +++ b/docs/components/offreason.mdx @@ -0,0 +1,22 @@ +--- +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/openresponsesresult.mdx b/docs/components/openresponsesresult.mdx index 3717d0f7..b9cab01d 100644 --- a/docs/components/openresponsesresult.mdx +++ b/docs/components/openresponsesresult.mdx @@ -7,44 +7,44 @@ Complete non-streaming response from the Responses API ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `background` | *OptionalNullable[bool]* | ➖ | N/A | | -| `completed_at` | *Nullable[int]* | ✅ | N/A | | -| `created_at` | *int* | ✅ | N/A | | -| `error` | [Nullable[components.OpenResponsesErrorField]](../components/openresponseserrorfield.mdx) | ✅ | Error of a failed response; `metadata` carries OpenRouter-specific details. | \{
"code": "server_error",
"message": "Alignment plugin: the reply could not be evaluated: evaluator_error",
"metadata": \{
"alignment": \{
"calls": [
\{
"call": 1,
"outcome": "unavailable",
"reason": "evaluator_error"
}
]
}
}
} | -| `frequency_penalty` | *Nullable[float]* | ✅ | N/A | | -| `id` | *str* | ✅ | N/A | | -| `incomplete_details` | [Nullable[components.IncompleteDetails]](../components/incompletedetails.mdx) | ✅ | N/A | \{
"reason": "max_output_tokens"
} | -| `instructions` | [Nullable[components.BaseInputsUnion]](../components/baseinputsunion.mdx) | ✅ | N/A | [
\{
"content": "What is the weather today?",
"role": "user"
}
] | -| `max_output_tokens` | *OptionalNullable[int]* | ➖ | N/A | | -| `max_tool_calls` | *OptionalNullable[int]* | ➖ | N/A | | -| `metadata` | Dict[str, *str*] | ✅ | Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed. | \{
"session_id": "abc-def-ghi",
"user_id": "123"
} | -| `model` | *str* | ✅ | N/A | | -| `object` | [components.OpenResponsesResultObject](../components/openresponsesresultobject.mdx) | ✅ | N/A | | -| `output` | List[[components.OutputItems](../components/outputitems.mdx)] | ✅ | N/A | | -| `output_text` | *Optional[str]* | ➖ | N/A | | -| `parallel_tool_calls` | *bool* | ✅ | N/A | | -| `presence_penalty` | *Nullable[float]* | ✅ | N/A | | -| `previous_response_id` | *OptionalNullable[str]* | ➖ | N/A | | -| `prompt` | [OptionalNullable[components.StoredPromptTemplate]](../components/storedprompttemplate.mdx) | ➖ | N/A | \{
"id": "prompt-abc123",
"variables": \{
"name": "John"
}
} | -| `prompt_cache_key` | *OptionalNullable[str]* | ➖ | N/A | | -| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../components/promptcacheoptions.mdx) | ➖ | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | -| `reasoning` | [OptionalNullable[components.BaseReasoningConfig]](../components/basereasoningconfig.mdx) | ➖ | N/A | \{
"effort": "medium",
"summary": "auto"
} | -| `safety_identifier` | *OptionalNullable[str]* | ➖ | N/A | | -| `service_tier` | *OptionalNullable[str]* | ➖ | N/A | | -| `status` | [components.OpenAIResponsesResponseStatus](../components/openairesponsesresponsestatus.mdx) | ✅ | N/A | completed | -| `store` | *Optional[bool]* | ➖ | N/A | | -| `temperature` | *Nullable[float]* | ✅ | N/A | | -| `text` | [Optional[components.TextExtendedConfig]](../components/textextendedconfig.mdx) | ➖ | Text output configuration including format and verbosity | \{
"format": \{
"type": "text"
}
} | -| `tool_choice` | [components.OpenAIResponsesToolChoiceUnion](../components/openairesponsestoolchoiceunion.mdx) | ✅ | N/A | auto | -| `tools` | List[[components.OpenResponsesResultToolUnion](../components/openresponsesresulttoolunion.mdx)] | ✅ | N/A | | -| `top_logprobs` | *Optional[int]* | ➖ | N/A | | -| `top_p` | *Nullable[float]* | ✅ | N/A | | -| `truncation` | [OptionalNullable[components.Truncation]](../components/truncation.mdx) | ➖ | N/A | auto | -| `usage` | [OptionalNullable[components.Usage]](../components/usage.mdx) | ➖ | Token usage information for the response | \{
"cost": 0.0012,
"cost_details": \{
"upstream_inference_cost": null,
"upstream_inference_input_cost": 0.0008,
"upstream_inference_output_cost": 0.0004
},
"input_tokens": 10,
"input_tokens_details": \{
"cached_tokens": 0
},
"output_tokens": 25,
"output_tokens_details": \{
"reasoning_tokens": 0
},
"total_tokens": 35
} | -| `user` | *OptionalNullable[str]* | ➖ | N/A | | -| `alignment` | [Optional[components.Alignment]](../components/alignment.mdx) | ➖ | Beta. The result of the alignment plugin for this request; the shape may change. | \{
"calls": [
\{
"call": 1,
"outcome": "allowed",
"rules": [
\{
"applicable": true,
"broken": false,
"probability": 0.04
}
]
}
]
} | -| `error_type` | [Optional[components.APIErrorType]](../components/apierrortype.mdx) | ➖ | Canonical OpenRouter error type, stable across all API formats | rate_limit_exceeded | -| `openrouter_metadata` | [Optional[components.OpenRouterMetadata]](../components/openroutermetadata.mdx) | ➖ | N/A | \{
"attempt": 1,
"endpoints": \{
"available": [
\{
"model": "openai/gpt-4o",
"provider": "OpenAI",
"selected": true
}
],
"total": 1
},
"generation_time": 2016,
"is_byok": false,
"region": "iad",
"requested": "openai/gpt-4o",
"strategy": "direct",
"summary": "available=1, selected=OpenAI"
} | -| `safeguard_results` | List[[components.ArmorSafeguardResult](../components/armorsafeguardresult.mdx)] | ➖ | OpenRouter Armor's verdict for each client tool call of this response, present whenever Armor evaluated the response (even when nothing was flagged). Independent of the `openrouter_metadata` opt-in. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `background` | *OptionalNullable[bool]* | ➖ | N/A | | +| `completed_at` | *Nullable[int]* | ✅ | N/A | | +| `created_at` | *int* | ✅ | N/A | | +| `error` | [Nullable[components.OpenResponsesErrorField]](../components/openresponseserrorfield.mdx) | ✅ | Error of a failed response; `metadata` carries OpenRouter-specific details. | \{
"code": "server_error",
"message": "Alignment plugin: the reply could not be evaluated: evaluator_error",
"metadata": \{
"alignment": \{
"calls": [
\{
"call": 1,
"outcome": "unavailable",
"reason": "evaluator_error"
}
]
}
}
} | +| `frequency_penalty` | *Nullable[float]* | ✅ | N/A | | +| `id` | *str* | ✅ | N/A | | +| `incomplete_details` | [Nullable[components.IncompleteDetails]](../components/incompletedetails.mdx) | ✅ | N/A | \{
"reason": "max_output_tokens"
} | +| `instructions` | [Nullable[components.BaseInputsUnion]](../components/baseinputsunion.mdx) | ✅ | N/A | [
\{
"content": "What is the weather today?",
"role": "user"
}
] | +| `max_output_tokens` | *OptionalNullable[int]* | ➖ | N/A | | +| `max_tool_calls` | *OptionalNullable[int]* | ➖ | N/A | | +| `metadata` | Dict[str, *str*] | ✅ | Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed. | \{
"session_id": "abc-def-ghi",
"user_id": "123"
} | +| `model` | *str* | ✅ | N/A | | +| `object` | [components.OpenResponsesResultObject](../components/openresponsesresultobject.mdx) | ✅ | N/A | | +| `output` | List[[components.OutputItems](../components/outputitems.mdx)] | ✅ | N/A | | +| `output_text` | *Optional[str]* | ➖ | N/A | | +| `parallel_tool_calls` | *bool* | ✅ | N/A | | +| `presence_penalty` | *Nullable[float]* | ✅ | N/A | | +| `previous_response_id` | *OptionalNullable[str]* | ➖ | N/A | | +| `prompt` | [OptionalNullable[components.StoredPromptTemplate]](../components/storedprompttemplate.mdx) | ➖ | N/A | \{
"id": "prompt-abc123",
"variables": \{
"name": "John"
}
} | +| `prompt_cache_key` | *OptionalNullable[str]* | ➖ | N/A | | +| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../components/promptcacheoptions.mdx) | ➖ | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: "30m" (default) or "12h" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | +| `reasoning` | [OptionalNullable[components.BaseReasoningConfig]](../components/basereasoningconfig.mdx) | ➖ | N/A | \{
"effort": "medium",
"summary": "auto"
} | +| `safety_identifier` | *OptionalNullable[str]* | ➖ | N/A | | +| `service_tier` | *OptionalNullable[str]* | ➖ | N/A | | +| `status` | [components.OpenAIResponsesResponseStatus](../components/openairesponsesresponsestatus.mdx) | ✅ | N/A | completed | +| `store` | *Optional[bool]* | ➖ | N/A | | +| `temperature` | *Nullable[float]* | ✅ | N/A | | +| `text` | [Optional[components.TextExtendedConfig]](../components/textextendedconfig.mdx) | ➖ | Text output configuration including format and verbosity | \{
"format": \{
"type": "text"
}
} | +| `tool_choice` | [components.OpenAIResponsesToolChoiceUnion](../components/openairesponsestoolchoiceunion.mdx) | ✅ | N/A | auto | +| `tools` | List[[components.OpenResponsesResultToolUnion](../components/openresponsesresulttoolunion.mdx)] | ✅ | N/A | | +| `top_logprobs` | *Optional[int]* | ➖ | N/A | | +| `top_p` | *Nullable[float]* | ✅ | N/A | | +| `truncation` | [OptionalNullable[components.Truncation]](../components/truncation.mdx) | ➖ | N/A | auto | +| `usage` | [OptionalNullable[components.Usage]](../components/usage.mdx) | ➖ | Token usage information for the response | \{
"cost": 0.0012,
"cost_details": \{
"upstream_inference_cost": null,
"upstream_inference_input_cost": 0.0008,
"upstream_inference_output_cost": 0.0004
},
"input_tokens": 10,
"input_tokens_details": \{
"cached_tokens": 0
},
"output_tokens": 25,
"output_tokens_details": \{
"reasoning_tokens": 0
},
"total_tokens": 35
} | +| `user` | *OptionalNullable[str]* | ➖ | N/A | | +| `alignment` | [Optional[components.Alignment]](../components/alignment.mdx) | ➖ | Beta. The result of the alignment plugin for this request; the shape may change. | \{
"calls": [
\{
"call": 1,
"outcome": "allowed",
"rules": [
\{
"applicable": true,
"broken": false,
"probability": 0.04
}
]
}
]
} | +| `error_type` | [Optional[components.APIErrorType]](../components/apierrortype.mdx) | ➖ | Canonical OpenRouter error type, stable across all API formats | rate_limit_exceeded | +| `openrouter_metadata` | [Optional[components.OpenRouterMetadata]](../components/openroutermetadata.mdx) | ➖ | N/A | \{
"attempt": 1,
"endpoints": \{
"available": [
\{
"model": "openai/gpt-4o",
"provider": "OpenAI",
"selected": true
}
],
"total": 1
},
"generation_time": 2016,
"is_byok": false,
"region": "iad",
"requested": "openai/gpt-4o",
"strategy": "direct",
"summary": "available=1, selected=OpenAI"
} | +| `safeguard_results` | List[[components.ArmorSafeguardResult](../components/armorsafeguardresult.mdx)] | ➖ | OpenRouter Armor's verdict for each client tool call of this response, present whenever Armor evaluated the response (even when nothing was flagged). Independent of the `openrouter_metadata` opt-in. | | \ No newline at end of file diff --git a/docs/components/promptcachebreakpoint.mdx b/docs/components/promptcachebreakpoint.mdx index d05c026d..108c3bc0 100644 --- a/docs/components/promptcachebreakpoint.mdx +++ b/docs/components/promptcachebreakpoint.mdx @@ -2,11 +2,12 @@ title: "PromptCacheBreakpoint" --- -Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically. +Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically. `ttl` ("30m" or "12h") overrides the request-level `prompt_cache_options.ttl` for this boundary; 12h writes bill at the higher cache-write rate. ## Fields | Field | Type | Required | Description | | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `mode` | [components.PromptCacheBreakpointMode](../components/promptcachebreakpointmode.mdx) | ✅ | N/A | \ No newline at end of file +| `mode` | [components.PromptCacheBreakpointMode](../components/promptcachebreakpointmode.mdx) | ✅ | N/A | +| `ttl` | *OptionalNullable[str]* | ➖ | N/A | \ No newline at end of file diff --git a/docs/components/promptcacheoptions.mdx b/docs/components/promptcacheoptions.mdx index 4d05fd3b..78f26a86 100644 --- a/docs/components/promptcacheoptions.mdx +++ b/docs/components/promptcacheoptions.mdx @@ -2,7 +2,7 @@ title: "PromptCacheOptions" --- -Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. +Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: "30m" (default) or "12h" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. ## Fields diff --git a/docs/components/responsesrequest.mdx b/docs/components/responsesrequest.mdx index 29ae53a1..a8ac7bc7 100644 --- a/docs/components/responsesrequest.mdx +++ b/docs/components/responsesrequest.mdx @@ -30,7 +30,7 @@ Request schema for Responses endpoint | `previous_response_id` | *Optional[Any]* | ➖ | Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead. | | | `prompt` | [OptionalNullable[components.StoredPromptTemplate]](../components/storedprompttemplate.mdx) | ➖ | N/A | \{
"id": "prompt-abc123",
"variables": \{
"name": "John"
}
} | | `prompt_cache_key` | *OptionalNullable[str]* | ➖ | N/A | | -| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../components/promptcacheoptions.mdx) | ➖ | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | +| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../components/promptcacheoptions.mdx) | ➖ | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: "30m" (default) or "12h" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | | `provider` | [OptionalNullable[components.ProviderPreferences]](../components/providerpreferences.mdx) | ➖ | When multiple model providers are available, optionally indicate your routing preference. | \{
"allow_fallbacks": true
} | | `reasoning` | [OptionalNullable[components.ReasoningConfig]](../components/reasoningconfig.mdx) | ➖ | Configuration for reasoning mode in the response | \{
"enabled": true,
"summary": "auto"
} | | `safety_identifier` | *OptionalNullable[str]* | ➖ | Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account. | user-123 | diff --git a/docs/components/server.mdx b/docs/components/server.mdx new file mode 100644 index 00000000..494756bc --- /dev/null +++ b/docs/components/server.mdx @@ -0,0 +1,12 @@ +--- +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/stateenum.mdx b/docs/components/stateenum.mdx new file mode 100644 index 00000000..761a1ccc --- /dev/null +++ b/docs/components/stateenum.mdx @@ -0,0 +1,22 @@ +--- +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/operations/getinternconnectionsglobals.mdx b/docs/operations/getinternconnectionsglobals.mdx new file mode 100644 index 00000000..0c10e0f8 --- /dev/null +++ b/docs/operations/getinternconnectionsglobals.mdx @@ -0,0 +1,11 @@ +--- +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 new file mode 100644 index 00000000..c9609f36 --- /dev/null +++ b/docs/operations/getinternconnectionsrequest.mdx @@ -0,0 +1,12 @@ +--- +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/sdks/betaresponses/README.mdx b/docs/sdks/betaresponses/README.mdx index 3dd47e9f..2641add7 100644 --- a/docs/sdks/betaresponses/README.mdx +++ b/docs/sdks/betaresponses/README.mdx @@ -89,7 +89,7 @@ with OpenRouter( | `previous_response_id` | *Optional[Any]* | ➖ | Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead. | | | `prompt` | [OptionalNullable[components.StoredPromptTemplate]](../../components/storedprompttemplate.mdx) | ➖ | N/A | \{
"id": "prompt-abc123",
"variables": \{
"name": "John"
}
} | | `prompt_cache_key` | *OptionalNullable[str]* | ➖ | N/A | | -| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../../components/promptcacheoptions.mdx) | ➖ | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | +| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../../components/promptcacheoptions.mdx) | ➖ | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: "30m" (default) or "12h" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | | `provider` | [OptionalNullable[components.ProviderPreferences]](../../components/providerpreferences.mdx) | ➖ | When multiple model providers are available, optionally indicate your routing preference. | \{
"allow_fallbacks": true
} | | `reasoning` | [OptionalNullable[components.ReasoningConfig]](../../components/reasoningconfig.mdx) | ➖ | Configuration for reasoning mode in the response | \{
"enabled": true,
"summary": "auto"
} | | `safety_identifier` | *OptionalNullable[str]* | ➖ | Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account. | user-123 | diff --git a/docs/sdks/chat/README.mdx b/docs/sdks/chat/README.mdx index 56c33c7e..b8ac42e4 100644 --- a/docs/sdks/chat/README.mdx +++ b/docs/sdks/chat/README.mdx @@ -103,7 +103,7 @@ with OpenRouter( | `prediction` | [OptionalNullable[components.Prediction]](../../components/prediction.mdx) | ➖ | Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance. | \{
"content": "Expected response",
"type": "content"
} | | `presence_penalty` | *OptionalNullable[float]* | ➖ | Presence penalty (-2.0 to 2.0) | 0 | | `prompt_cache_key` | *OptionalNullable[str]* | ➖ | N/A | | -| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../../components/promptcacheoptions.mdx) | ➖ | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | +| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../../components/promptcacheoptions.mdx) | ➖ | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: "30m" (default) or "12h" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | | `provider` | [OptionalNullable[components.ProviderPreferences]](../../components/providerpreferences.mdx) | ➖ | When multiple model providers are available, optionally indicate your routing preference. | \{
"allow_fallbacks": true
} | | `reasoning` | [Optional[components.ChatRequestReasoning]](../../components/chatrequestreasoning.mdx) | ➖ | Configuration options for reasoning models | \{
"effort": "medium",
"summary": "concise"
} | | `reasoning_effort` | [OptionalNullable[components.ChatRequestReasoningEffort]](../../components/chatrequestreasoningeffort.mdx) | ➖ | Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. | medium | diff --git a/docs/sdks/interns/README.mdx b/docs/sdks/interns/README.mdx index 45a68eef..1573fcf3 100644 --- a/docs/sdks/interns/README.mdx +++ b/docs/sdks/interns/README.mdx @@ -14,6 +14,7 @@ Create, inspect, update, provision, suspend and delete OpenRouter interns throug * [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** @@ -273,6 +274,53 @@ with OpenRouter( | 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. diff --git a/docs/sdks/presets/README.mdx b/docs/sdks/presets/README.mdx index 2eef57c0..b4f6c1c6 100644 --- a/docs/sdks/presets/README.mdx +++ b/docs/sdks/presets/README.mdx @@ -179,7 +179,7 @@ with OpenRouter( | `prediction` | [OptionalNullable[components.Prediction]](../../components/prediction.mdx) | ➖ | Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance. | \{
"content": "Expected response",
"type": "content"
} | | `presence_penalty` | *OptionalNullable[float]* | ➖ | Presence penalty (-2.0 to 2.0) | 0 | | `prompt_cache_key` | *OptionalNullable[str]* | ➖ | N/A | | -| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../../components/promptcacheoptions.mdx) | ➖ | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | +| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../../components/promptcacheoptions.mdx) | ➖ | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: "30m" (default) or "12h" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | | `provider` | [OptionalNullable[components.ProviderPreferences]](../../components/providerpreferences.mdx) | ➖ | When multiple model providers are available, optionally indicate your routing preference. | \{
"allow_fallbacks": true
} | | `reasoning` | [Optional[components.ChatRequestReasoning]](../../components/chatrequestreasoning.mdx) | ➖ | Configuration options for reasoning models | \{
"effort": "medium",
"summary": "concise"
} | | `reasoning_effort` | [OptionalNullable[components.ChatRequestReasoningEffort]](../../components/chatrequestreasoningeffort.mdx) | ➖ | Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. | medium | @@ -357,7 +357,7 @@ with OpenRouter( | `previous_response_id` | *Optional[Any]* | ➖ | Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead. | | | `prompt` | [OptionalNullable[components.StoredPromptTemplate]](../../components/storedprompttemplate.mdx) | ➖ | N/A | \{
"id": "prompt-abc123",
"variables": \{
"name": "John"
}
} | | `prompt_cache_key` | *OptionalNullable[str]* | ➖ | N/A | | -| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../../components/promptcacheoptions.mdx) | ➖ | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | +| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../../components/promptcacheoptions.mdx) | ➖ | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: "30m" (default) or "12h" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | | `provider` | [OptionalNullable[components.ProviderPreferences]](../../components/providerpreferences.mdx) | ➖ | When multiple model providers are available, optionally indicate your routing preference. | \{
"allow_fallbacks": true
} | | `reasoning` | [OptionalNullable[components.ReasoningConfig]](../../components/reasoningconfig.mdx) | ➖ | Configuration for reasoning mode in the response | \{
"enabled": true,
"summary": "auto"
} | | `safety_identifier` | *OptionalNullable[str]* | ➖ | Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account. | user-123 | diff --git a/docs/sdks/responses/README.mdx b/docs/sdks/responses/README.mdx index 248cc838..edd7ea52 100644 --- a/docs/sdks/responses/README.mdx +++ b/docs/sdks/responses/README.mdx @@ -89,7 +89,7 @@ with OpenRouter( | `previous_response_id` | *Optional[Any]* | ➖ | Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead. | | | `prompt` | [OptionalNullable[components.StoredPromptTemplate]](../../components/storedprompttemplate.mdx) | ➖ | N/A | \{
"id": "prompt-abc123",
"variables": \{
"name": "John"
}
} | | `prompt_cache_key` | *OptionalNullable[str]* | ➖ | N/A | | -| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../../components/promptcacheoptions.mdx) | ➖ | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | +| `prompt_cache_options` | [OptionalNullable[components.PromptCacheOptions]](../../components/promptcacheoptions.mdx) | ➖ | Request-level prompt-cache controls. `mode: "explicit"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: "30m" (default) or "12h" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. | \{
"mode": "explicit",
"ttl": "30m"
} | | `provider` | [OptionalNullable[components.ProviderPreferences]](../../components/providerpreferences.mdx) | ➖ | When multiple model providers are available, optionally indicate your routing preference. | \{
"allow_fallbacks": true
} | | `reasoning` | [OptionalNullable[components.ReasoningConfig]](../../components/reasoningconfig.mdx) | ➖ | Configuration for reasoning mode in the response | \{
"enabled": true,
"summary": "auto"
} | | `safety_identifier` | *OptionalNullable[str]* | ➖ | Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account. | user-123 | diff --git a/pyproject.toml b/pyproject.toml index f8faac55..eea7c851 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.70" +version = "1.3.71" 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 e233904d..5848b5ac 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.70" +__version__: str = "1.3.71" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.3.70 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.71 2.914.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/beta_responses.py b/src/openrouter/beta_responses.py index 982740d3..e9bae7b6 100644 --- a/src/openrouter/beta_responses.py +++ b/src/openrouter/beta_responses.py @@ -169,7 +169,7 @@ def send( :param previous_response_id: Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead. :param prompt: :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account. @@ -341,7 +341,7 @@ def send( :param previous_response_id: Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead. :param prompt: :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account. @@ -516,7 +516,7 @@ def send( :param previous_response_id: Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead. :param prompt: :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account. @@ -690,7 +690,7 @@ def send( :param previous_response_id: Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead. :param prompt: :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account. @@ -1150,7 +1150,7 @@ async def send_async( :param previous_response_id: Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead. :param prompt: :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account. @@ -1322,7 +1322,7 @@ async def send_async( :param previous_response_id: Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead. :param prompt: :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account. @@ -1497,7 +1497,7 @@ async def send_async( :param previous_response_id: Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead. :param prompt: :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account. @@ -1671,7 +1671,7 @@ async def send_async( :param previous_response_id: Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead. :param prompt: :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account. diff --git a/src/openrouter/chat.py b/src/openrouter/chat.py index 5a3cf6f8..43dbe7df 100644 --- a/src/openrouter/chat.py +++ b/src/openrouter/chat.py @@ -167,7 +167,7 @@ def send( :param prediction: Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance. :param presence_penalty: Presence penalty (-2.0 to 2.0) :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration options for reasoning models :param reasoning_effort: Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. @@ -342,7 +342,7 @@ def send( :param prediction: Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance. :param presence_penalty: Presence penalty (-2.0 to 2.0) :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration options for reasoning models :param reasoning_effort: Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. @@ -519,7 +519,7 @@ def send( :param prediction: Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance. :param presence_penalty: Presence penalty (-2.0 to 2.0) :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration options for reasoning models :param reasoning_effort: Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. @@ -695,7 +695,7 @@ def send( :param prediction: Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance. :param presence_penalty: Presence penalty (-2.0 to 2.0) :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration options for reasoning models :param reasoning_effort: Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. @@ -1160,7 +1160,7 @@ async def send_async( :param prediction: Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance. :param presence_penalty: Presence penalty (-2.0 to 2.0) :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration options for reasoning models :param reasoning_effort: Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. @@ -1335,7 +1335,7 @@ async def send_async( :param prediction: Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance. :param presence_penalty: Presence penalty (-2.0 to 2.0) :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration options for reasoning models :param reasoning_effort: Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. @@ -1513,7 +1513,7 @@ async def send_async( :param prediction: Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance. :param presence_penalty: Presence penalty (-2.0 to 2.0) :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration options for reasoning models :param reasoning_effort: Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. @@ -1690,7 +1690,7 @@ async def send_async( :param prediction: Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance. :param presence_penalty: Presence penalty (-2.0 to 2.0) :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration options for reasoning models :param reasoning_effort: Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. diff --git a/src/openrouter/components/__init__.py b/src/openrouter/components/__init__.py index 36f891de..6983d8cb 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -2356,6 +2356,24 @@ 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 from .interninvokeacceptedresponse import ( InternInvokeAcceptedResponse, @@ -4500,6 +4518,8 @@ "AABenchmarkEntryTypedDict", "APIErrorType", "APIType", + "Account", + "AccountTypedDict", "ActionEnum", "ActivityItem", "ActivityItemTypedDict", @@ -6128,6 +6148,13 @@ "InternChatUserMessage", "InternChatUserMessageRole", "InternChatUserMessageTypedDict", + "InternConnection", + "InternConnectionList", + "InternConnectionListTypedDict", + "InternConnectionScope", + "InternConnectionStatus", + "InternConnectionStatusTypedDict", + "InternConnectionTypedDict", "InternDaemonAccess", "InternDaemonAccessTypedDict", "InternInvokeAcceptedResponse", @@ -6166,6 +6193,7 @@ "KeyBudgetScope", "KeyBudgetTypedDict", "KeyTypedDict", + "Kind", "Kty", "LegacyChatContentVideo", "LegacyChatContentVideoInput", @@ -6536,6 +6564,7 @@ "ObservabilityWebhookDestinationMethod", "ObservabilityWebhookDestinationType", "ObservabilityWebhookDestinationTypedDict", + "OffReason", "OnError", "OpenAIFile", "OpenAIFileDeleted", @@ -7205,6 +7234,7 @@ "SearchSurface", "Security", "SecurityTypedDict", + "Server", "ServerTool", "ServerToolDetails", "ServerToolDetailsStatus", @@ -7231,6 +7261,7 @@ "ServerToolTypedDict", "ServerToolUseDetails", "ServerToolUseDetailsTypedDict", + "ServerTypedDict", "ServiceUnavailableResponseErrorData", "ServiceUnavailableResponseErrorDataTypedDict", "SessionCostItem", @@ -7304,6 +7335,7 @@ "Stance", "StanceTypedDict", "State", + "StateEnum", "StateTypedDict", "StopServerToolsWhenCondition", "StopServerToolsWhenConditionTypedDict", @@ -9464,6 +9496,20 @@ "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", "InternInvokeAcceptedResponse": ".interninvokeacceptedresponse", diff --git a/src/openrouter/components/chatcontenttext.py b/src/openrouter/components/chatcontenttext.py index 45f9d3e9..77b04515 100644 --- a/src/openrouter/components/chatcontenttext.py +++ b/src/openrouter/components/chatcontenttext.py @@ -29,7 +29,7 @@ class ChatContentTextTypedDict(TypedDict): cache_control: NotRequired[ChatContentCacheControlTypedDict] r"""Anthropic-style cache breakpoint for the content part. Interchangeable with the OpenAI-style `prompt_cache_breakpoint` marker: OpenRouter converts between the two based on the provider serving the request.""" prompt_cache_breakpoint: NotRequired[Nullable[PromptCacheBreakpointTypedDict]] - r"""Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically.""" + r"""Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically. `ttl` (\"30m\" or \"12h\") overrides the request-level `prompt_cache_options.ttl` for this boundary; 12h writes bill at the higher cache-write rate.""" class ChatContentText(BaseModel): @@ -43,7 +43,7 @@ class ChatContentText(BaseModel): r"""Anthropic-style cache breakpoint for the content part. Interchangeable with the OpenAI-style `prompt_cache_breakpoint` marker: OpenRouter converts between the two based on the provider serving the request.""" prompt_cache_breakpoint: OptionalNullable[PromptCacheBreakpoint] = UNSET - r"""Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically.""" + r"""Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically. `ttl` (\"30m\" or \"12h\") overrides the request-level `prompt_cache_options.ttl` for this boundary; 12h writes bill at the higher cache-write rate.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/openrouter/components/chatrequest.py b/src/openrouter/components/chatrequest.py index c563996c..b278ed44 100644 --- a/src/openrouter/components/chatrequest.py +++ b/src/openrouter/components/chatrequest.py @@ -290,7 +290,7 @@ class ChatRequestTypedDict(TypedDict): r"""Presence penalty (-2.0 to 2.0)""" prompt_cache_key: NotRequired[Nullable[str]] prompt_cache_options: NotRequired[Nullable[PromptCacheOptionsTypedDict]] - r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.""" + r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer.""" provider: NotRequired[Nullable[ProviderPreferencesTypedDict]] r"""When multiple model providers are available, optionally indicate your routing preference.""" reasoning: NotRequired[ChatRequestReasoningTypedDict] @@ -398,7 +398,7 @@ class ChatRequest(BaseModel): prompt_cache_key: OptionalNullable[str] = UNSET prompt_cache_options: OptionalNullable[PromptCacheOptions] = UNSET - r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.""" + r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer.""" provider: OptionalNullable[ProviderPreferences] = UNSET r"""When multiple model providers are available, optionally indicate your routing preference.""" diff --git a/src/openrouter/components/inputtext.py b/src/openrouter/components/inputtext.py index 81a4151b..e158c324 100644 --- a/src/openrouter/components/inputtext.py +++ b/src/openrouter/components/inputtext.py @@ -23,7 +23,7 @@ class InputTextTypedDict(TypedDict): text: str type: InputTextType prompt_cache_breakpoint: NotRequired[Nullable[PromptCacheBreakpointTypedDict]] - r"""Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically.""" + r"""Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically. `ttl` (\"30m\" or \"12h\") overrides the request-level `prompt_cache_options.ttl` for this boundary; 12h writes bill at the higher cache-write rate.""" class InputText(BaseModel): @@ -34,7 +34,7 @@ class InputText(BaseModel): type: InputTextType prompt_cache_breakpoint: OptionalNullable[PromptCacheBreakpoint] = UNSET - r"""Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically.""" + r"""Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically. `ttl` (\"30m\" or \"12h\") overrides the request-level `prompt_cache_options.ttl` for this boundary; 12h writes bill at the higher cache-write rate.""" @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/openrouter/components/intern.py b/src/openrouter/components/intern.py index 0597b6a6..33ec7928 100644 --- a/src/openrouter/components/intern.py +++ b/src/openrouter/components/intern.py @@ -85,6 +85,8 @@ class InternTypedDict(TypedDict): 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]] @@ -136,6 +138,9 @@ class Intern(BaseModel): 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.""" @@ -144,7 +149,7 @@ class Intern(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["created_by_you", "icon_sha256"]) + optional_fields = set(["can_edit", "created_by_you", "icon_sha256"]) nullable_fields = set( [ "attached_vault_id", diff --git a/src/openrouter/components/internconnection.py b/src/openrouter/components/internconnection.py new file mode 100644 index 00000000..ea777e7a --- /dev/null +++ b/src/openrouter/components/internconnection.py @@ -0,0 +1,207 @@ +"""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 new file mode 100644 index 00000000..0b7d72ef --- /dev/null +++ b/src/openrouter/components/internconnectionlist.py @@ -0,0 +1,15 @@ +"""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/openresponsesresult.py b/src/openrouter/components/openresponsesresult.py index b270324a..0e1f8daf 100644 --- a/src/openrouter/components/openresponsesresult.py +++ b/src/openrouter/components/openresponsesresult.py @@ -426,7 +426,7 @@ class OpenResponsesResultTypedDict(TypedDict): prompt: NotRequired[Nullable[StoredPromptTemplateTypedDict]] prompt_cache_key: NotRequired[Nullable[str]] prompt_cache_options: NotRequired[Nullable[PromptCacheOptionsTypedDict]] - r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.""" + r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer.""" reasoning: NotRequired[Nullable[BaseReasoningConfigTypedDict]] safety_identifier: NotRequired[Nullable[str]] service_tier: NotRequired[Nullable[str]] @@ -503,7 +503,7 @@ class OpenResponsesResult(BaseModel): prompt_cache_key: OptionalNullable[str] = UNSET prompt_cache_options: OptionalNullable[PromptCacheOptions] = UNSET - r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.""" + r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer.""" reasoning: OptionalNullable[BaseReasoningConfig] = UNSET diff --git a/src/openrouter/components/promptcachebreakpoint.py b/src/openrouter/components/promptcachebreakpoint.py index 13fbce26..856bdfd1 100644 --- a/src/openrouter/components/promptcachebreakpoint.py +++ b/src/openrouter/components/promptcachebreakpoint.py @@ -1,21 +1,56 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from openrouter.types import BaseModel +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer from typing import Literal -from typing_extensions import TypedDict +from typing_extensions import NotRequired, TypedDict PromptCacheBreakpointMode = Literal["explicit",] class PromptCacheBreakpointTypedDict(TypedDict): - r"""Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically.""" + r"""Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically. `ttl` (\"30m\" or \"12h\") overrides the request-level `prompt_cache_options.ttl` for this boundary; 12h writes bill at the higher cache-write rate.""" mode: PromptCacheBreakpointMode + ttl: NotRequired[Nullable[str]] class PromptCacheBreakpoint(BaseModel): - r"""Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically.""" + r"""Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically. `ttl` (\"30m\" or \"12h\") overrides the request-level `prompt_cache_options.ttl` for this boundary; 12h writes bill at the higher cache-write rate.""" mode: PromptCacheBreakpointMode + + ttl: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["ttl"]) + nullable_fields = set(["ttl"]) + 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/promptcacheoptions.py b/src/openrouter/components/promptcacheoptions.py index 9d358624..357f5111 100644 --- a/src/openrouter/components/promptcacheoptions.py +++ b/src/openrouter/components/promptcacheoptions.py @@ -17,14 +17,14 @@ class PromptCacheOptionsTypedDict(TypedDict): - r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.""" + r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer.""" mode: PromptCacheOptionsMode ttl: NotRequired[Nullable[str]] class PromptCacheOptions(BaseModel): - r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.""" + r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer.""" mode: PromptCacheOptionsMode diff --git a/src/openrouter/components/responsesrequest.py b/src/openrouter/components/responsesrequest.py index 0a6faddb..366b5e9e 100644 --- a/src/openrouter/components/responsesrequest.py +++ b/src/openrouter/components/responsesrequest.py @@ -454,7 +454,7 @@ class ResponsesRequestTypedDict(TypedDict): prompt: NotRequired[Nullable[StoredPromptTemplateTypedDict]] prompt_cache_key: NotRequired[Nullable[str]] prompt_cache_options: NotRequired[Nullable[PromptCacheOptionsTypedDict]] - r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.""" + r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer.""" provider: NotRequired[Nullable[ProviderPreferencesTypedDict]] r"""When multiple model providers are available, optionally indicate your routing preference.""" reasoning: NotRequired[Nullable[ReasoningConfigTypedDict]] @@ -542,7 +542,7 @@ class ResponsesRequest(BaseModel): prompt_cache_key: OptionalNullable[str] = UNSET prompt_cache_options: OptionalNullable[PromptCacheOptions] = UNSET - r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer.""" + r"""Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer.""" provider: OptionalNullable[ProviderPreferences] = UNSET r"""When multiple model providers are available, optionally indicate your routing preference.""" diff --git a/src/openrouter/interns.py b/src/openrouter/interns.py index 49185f47..3d286520 100644 --- a/src/openrouter/interns.py +++ b/src/openrouter/interns.py @@ -1450,6 +1450,262 @@ async def update_intern_async( 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, *, diff --git a/src/openrouter/operations/__init__.py b/src/openrouter/operations/__init__.py index 80fde27c..352e1b49 100644 --- a/src/openrouter/operations/__init__.py +++ b/src/openrouter/operations/__init__.py @@ -536,6 +536,12 @@ GetInternRequest, GetInternRequestTypedDict, ) + from .getinternconnections import ( + GetInternConnectionsGlobals, + GetInternConnectionsGlobalsTypedDict, + GetInternConnectionsRequest, + GetInternConnectionsRequestTypedDict, + ) from .getinterndaemon import ( GetInternDaemonGlobals, GetInternDaemonGlobalsTypedDict, @@ -1570,6 +1576,10 @@ "GetGuardrailGlobalsTypedDict", "GetGuardrailRequest", "GetGuardrailRequestTypedDict", + "GetInternConnectionsGlobals", + "GetInternConnectionsGlobalsTypedDict", + "GetInternConnectionsRequest", + "GetInternConnectionsRequestTypedDict", "GetInternDaemonAccessGlobals", "GetInternDaemonAccessGlobalsTypedDict", "GetInternDaemonAccessRequest", @@ -2483,6 +2493,10 @@ "GetInternGlobalsTypedDict": ".getintern", "GetInternRequest": ".getintern", "GetInternRequestTypedDict": ".getintern", + "GetInternConnectionsGlobals": ".getinternconnections", + "GetInternConnectionsGlobalsTypedDict": ".getinternconnections", + "GetInternConnectionsRequest": ".getinternconnections", + "GetInternConnectionsRequestTypedDict": ".getinternconnections", "GetInternDaemonGlobals": ".getinterndaemon", "GetInternDaemonGlobalsTypedDict": ".getinterndaemon", "GetInternDaemonRequest": ".getinterndaemon", diff --git a/src/openrouter/operations/getinternconnections.py b/src/openrouter/operations/getinternconnections.py new file mode 100644 index 00000000..e369735a --- /dev/null +++ b/src/openrouter/operations/getinternconnections.py @@ -0,0 +1,146 @@ +"""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/presets.py b/src/openrouter/presets.py index c65361bd..559ca6ad 100644 --- a/src/openrouter/presets.py +++ b/src/openrouter/presets.py @@ -768,7 +768,7 @@ def create_presets_chat_completions( :param prediction: Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance. :param presence_penalty: Presence penalty (-2.0 to 2.0) :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration options for reasoning models :param reasoning_effort: Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. @@ -1145,7 +1145,7 @@ async def create_presets_chat_completions_async( :param prediction: Static predicted output content. Supported models can use this to reduce latency when much of the response is known in advance. :param presence_penalty: Presence penalty (-2.0 to 2.0) :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration options for reasoning models :param reasoning_effort: Shorthand for setting reasoning effort. Equivalent to setting reasoning.effort. Cannot be used simultaneously with reasoning.effort if they differ. @@ -2186,7 +2186,7 @@ def create_presets_responses( :param previous_response_id: Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead. :param prompt: :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account. @@ -2558,7 +2558,7 @@ async def create_presets_responses_async( :param previous_response_id: Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead. :param prompt: :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account. diff --git a/src/openrouter/responses.py b/src/openrouter/responses.py index d4f629c2..1aa587d5 100644 --- a/src/openrouter/responses.py +++ b/src/openrouter/responses.py @@ -169,7 +169,7 @@ def send( :param previous_response_id: Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead. :param prompt: :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account. @@ -341,7 +341,7 @@ def send( :param previous_response_id: Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead. :param prompt: :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account. @@ -516,7 +516,7 @@ def send( :param previous_response_id: Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead. :param prompt: :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account. @@ -690,7 +690,7 @@ def send( :param previous_response_id: Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead. :param prompt: :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account. @@ -1150,7 +1150,7 @@ async def send_async( :param previous_response_id: Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead. :param prompt: :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account. @@ -1322,7 +1322,7 @@ async def send_async( :param previous_response_id: Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead. :param prompt: :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account. @@ -1497,7 +1497,7 @@ async def send_async( :param previous_response_id: Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead. :param prompt: :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account. @@ -1671,7 +1671,7 @@ async def send_async( :param previous_response_id: Not supported on this proxy. Each response request is independent: no responses are stored, so a previous response cannot be referenced. Requests with a non-null value are rejected with a 400 error. Send the full conversation history in `input` instead. :param prompt: :param prompt_cache_key: - :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. Only supported by OpenAI GPT-5.6 and newer. + :param prompt_cache_options: Request-level prompt-cache controls. `mode: \"explicit\"` disables OpenAI-managed breakpoints so only blocks marked with `prompt_cache_breakpoint` are cached. `ttl` sets the minimum cache lifetime for every breakpoint the request writes: \"30m\" (default) or \"12h\" (billed at the higher 12h cache-write rate). Only supported by OpenAI GPT-5.6 and newer. :param provider: When multiple model providers are available, optionally indicate your routing preference. :param reasoning: Configuration for reasoning mode in the response :param safety_identifier: Recommended per-end-user identifier for abuse isolation. Use a stable ID, hash, or pseudonym. When a provider requires a user identity, OpenRouter folds it into the hashed identity sent upstream and never forwards it raw. If omitted, requests use an account-level identity, so provider policy blocks can affect the whole account. diff --git a/uv.lock b/uv.lock index 1aaa13ac..b97b246b 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.70" +version = "1.3.71" source = { editable = "." } dependencies = [ { name = "httpcore" },